Merge
authorlana
Fri, 18 Mar 2011 11:00:10 -0700
changeset 8852 c228cf346138
parent 8851 e630c590eb10 (current diff)
parent 8717 f75a1efb1412 (diff)
child 8853 6aa795396cc8
child 9067 c0b85430843d
Merge
jdk/make/common/Modules.gmk
jdk/make/java/nio/mxbean/Makefile
jdk/make/modules/Makefile
jdk/make/modules/bootmodule.roots
jdk/make/modules/jdk7.depconfig
jdk/make/modules/modules.config
jdk/make/modules/modules.group
jdk/make/modules/optional.depconfig
jdk/make/modules/tools/Makefile
jdk/make/modules/tools/build.xml
jdk/make/modules/tools/nbproject/project.properties
jdk/make/modules/tools/nbproject/project.xml
jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java
jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java
jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java
jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java
jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java
jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java
jdk/src/share/classes/sun/misc/BootClassLoaderHook.java
jdk/src/share/classes/sun/misc/JavaSecurityCodeSignerAccess.java
jdk/test/sun/misc/BootClassLoaderHook/TestHook.java
langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties
--- a/.hgtags	Wed Mar 16 17:21:52 2011 -0700
+++ b/.hgtags	Fri Mar 18 11:00:10 2011 -0700
@@ -107,3 +107,5 @@
 a36beda9b9de91231d92a2c529f21cc218fcf8d5 jdk7-b130
 d8af56da89bc0fc02a6b6ad78f51157a46d665ab jdk7-b131
 d61280d36755d1941fb487f554e8b7a6d0bca6a1 jdk7-b132
+fd444c61e7ed3d92b2a730da7c737b02191b682f jdk7-b133
+def8e16dd237a47fc067d66d4c616d7baaec6001 jdk7-b134
--- a/.hgtags-top-repo	Wed Mar 16 17:21:52 2011 -0700
+++ b/.hgtags-top-repo	Fri Mar 18 11:00:10 2011 -0700
@@ -107,3 +107,5 @@
 cc58c11af15411042719e9c82707fdbef60a9e0f jdk7-b130
 5d86d951426aaf340b1ba84ae2d5ab5da65a71e2 jdk7-b131
 0f62a65fb666b337caa585015ab6ea2e60e709ca jdk7-b132
+c6f380693342feadccc5fe2c5adf500e861361aa jdk7-b133
+ddc2fcb3682ffd27f44354db666128827be7e3c3 jdk7-b134
--- a/README	Wed Mar 16 17:21:52 2011 -0700
+++ b/README	Fri Mar 18 11:00:10 2011 -0700
@@ -29,13 +29,14 @@
      Set the environment variable ALT_BOOTDIR to the location of JDK 6.
 
   2. Check the sanity of doing a build with your current system:
-       gnumake sanity
+       make sanity
      See README-builds.html if you run into problems.
   
   3. Do a complete build of the OpenJDK:
-       gnumake all
+       make all
      The resulting JDK image should be found in build/*/j2sdk-image
 
-where gnumake is GNU make 3.81 or newer, /usr/bin/make on Linux and
-/usr/sfw/bin/gmake or /opt/sfw/bin/gmake on Solaris.
+where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually
+is 3.81 or newer.
 
+Complete details are available in README-builds.html.
--- a/README-builds.html	Wed Mar 16 17:21:52 2011 -0700
+++ b/README-builds.html	Fri Mar 18 11:00:10 2011 -0700
@@ -54,7 +54,11 @@
                         <li><a href="#opensolaris">OpenSolaris</a></li>
                     </ul>
                 </li>
-                <li><a href="#directories">Source Directory Structure</a> </li>
+                <li><a href="#directories">Source Directory Structure</a> 
+                    <ul>
+                        <li><a href="#drops">Managing the Source Drops</a></li>
+                    </ul>
+                </li>
                 <li><a href="#building">Build Information</a>
                     <ul>
                         <li><a href="#gmake">GNU Make (<tt><i>gmake</i></tt>)</a> </li>
@@ -65,7 +69,7 @@
                             <ul>
                                 <li><a href="#bootjdk">Bootstrap JDK</a> </li>
                                 <li><a href="#importjdk">Optional Import JDK</a> </li>
-                                <li><a href="#ant">Ant</a> </li>
+                                <li><a href="#ant">Ant 1.7.1</a> </li>
                                 <li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
                                 <li><a href="#compilers">Compilers</a>
                                     <ul>
@@ -114,13 +118,13 @@
             <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>.
+            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.
             <br>
             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>
+            <a href="http://openjdk.java.net/guide/repositories.html#installConfig">
+                Developer Guide: Installing and Configuring Mercurial</a>
             section for more information.
             The Forest Extension is not part of the Mercurial install,
             and is optional,
@@ -146,14 +150,14 @@
                 using the Forest Extension:
                 <blockquote>
                     <tt>
-                        hg fclone http://openjdk.java.net/jdk7/jdk7 <i>YourOpenJDK</i>
+                        hg fclone http://hg.openjdk.java.net/jdk7/jdk7 <i>YourOpenJDK</i>
                     </tt>
                 </blockquote>
                 To get the entire set of OpenJDK Mercurial repositories
                 without using the Forest Extension:
                 <blockquote>
                     <tt>
-                        hg clone http://openjdk.java.net/jdk7/jdk7 <i>YourOpenJDK</i>
+                        hg clone http://hg.openjdk.java.net/jdk7/jdk7 <i>YourOpenJDK</i>
                         <br>cd <i>YourOpenJDK</i>
                         <br>sh ./get_source.sh
                     </tt>
@@ -207,66 +211,50 @@
                     <tr>
                         <td>Linux X86 (32-bit)</td>
                         <td>Fedora 9</td>
-                        <td>gcc 4 </td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>gcc 4.3 </td>
+                        <td>JDK 6u18</td>
                     </tr>
                     <tr>
                         <td>Linux X64 (64-bit)</td>
                         <td>Fedora 9</td>
-                        <td>gcc 4 </td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>gcc 4.3 </td>
+                        <td>JDK 6u18</td>
                     </tr>
                     <tr>
                         <td>Solaris SPARC (32-bit)</td>
-                        <td>Solaris 10u2 + patches 
-                            <br>
-                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
-                                SunSolve</a> for patch downloads.
-                        </td>
+                        <td>Solaris 10 Update 6</td>
                         <td>Sun Studio 12 Update 1 + patches</td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>JDK 6u18</td>
                     </tr>
                     <tr>
                         <td>Solaris SPARCV9 (64-bit)</td>
-                        <td>Solaris 10u2 + patches
-                            <br>
-                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
-                                SunSolve</a> for patch downloads.
-                        </td>
+                        <td>Solaris 10 Update 6</td>
                         <td>Sun Studio 12 Update 1 + patches</td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>JDK 6u18</td>
                     </tr>
                     <tr>
                         <td>Solaris X86 (32-bit)</td>
-                        <td>Solaris 10u2 + patches
-                            <br>
-                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
-                                SunSolve</a> for patch downloads.
-                        </td>
+                        <td>Solaris 10 Update 6</td>
                         <td>Sun Studio 12 Update 1 + patches</td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>JDK 6u18</td>
                     </tr>
                     <tr>
                         <td>Solaris X64 (64-bit)</td>
-                        <td>Solaris 10u2 + patches
-                            <br>
-                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
-                                SunSolve</a> for patch downloads.
-                        </td>
+                        <td>Solaris 10 Update 6</td>
                         <td>Sun Studio 12 Update 1 + patches</td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>JDK 6u18</td>
                     </tr>
                     <tr>
                         <td>Windows X86 (32-bit)</td>
                         <td>Windows XP</td>
                         <td>Microsoft Visual Studio C++ 2010 Professional Edition</td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>JDK 6u18</td>
                     </tr>
                     <tr>
                         <td>Windows X64 (64-bit)</td>
                         <td>Windows Server 2003 - Enterprise x64 Edition</td>
                         <td>Microsoft Visual Studio C++ 2010 Professional Edition</td>
-                        <td>JDK 6u14 FCS </td>
+                        <td>JDK 6u18</td>
                     </tr>
                 </tbody>
             </table>
@@ -300,7 +288,7 @@
 	      way to do it is to execute the following commands as user 
                 <tt>root</tt>:
                 <p/>
-                <code>yum-builddep java-openjdk</code>
+                <code>yum-builddep java-1.6.0-openjdk</code>
                 <p/>
                 <code>yum install gcc gcc-c++</code>
                 <p/>
@@ -345,10 +333,10 @@
             </blockquote>
         </blockquote>
         <!-- ------------------------------------------------------ -->
-        <h3><a name="centos">CentOS 5.2</a></h3>
+        <h3><a name="centos">CentOS 5.5</a></h3>
         <blockquote>
             After installing
-            <a href="http://www.centos.org/">CentOS 5.2</a>
+            <a href="http://www.centos.org/">CentOS 5.5</a>
             you need to make sure you have
             the following Development bundles installed:
             <blockquote>
@@ -356,7 +344,7 @@
                     <li>Development Libraries</li>
                     <li>Development Tools</li>
                     <li>Java Development</li>
-                    <li>X Software Development</li>
+                    <li>X Software Development (Including XFree86-devel)</li>
                 </ul>
             </blockquote>
             <p>
@@ -552,15 +540,105 @@
                 building the OpenJDK runtime libraries and misc files.
                 The top level <tt>Makefile</tt>
                 is used to build the entire OpenJDK.
+
+            <h3><a name="drops">Managing the Source Drops</a></h3>
+            <blockquote>
+                <p>
+                    The repositories <tt>jaxp</tt> and <tt>jaxws</tt> actually
+                    do not contain the sources for JAXP or JAX-WS.
+                    These products have their own open source procedures at their
+                    <a href="http://jaxp.java.net/">JAXP</a> and
+                    <a href="http://jax-ws.java.net/">JAX-WS</a> home pages.
+                    The OpenJDK project does need access to these sources to build
+                    a complete JDK image because JAXP and JAX-WS are part of the JDK.
+                    The current process for delivery of the JAXP and JAX-WS sources
+                    involves so called "source drop bundles" downloaded from a public
+                    website.
+                    There are many reasons for this current mechanism, and it is
+                    understood that this is not ideal for the open source community.
+                    It is possible this process could change in the future.
+                    <br>
+                    <b>NOTE:</b> The <a href="http://download.java.net/openjdk/jdk7/">
+                        Complete OpenJDK Source Bundles</a> <u>will</u> contain the JAXP and
+                    JAX-WS sources.
+                </p>
+
+                <h4><a name="dropcreation">Creation of New Source Drop Bundles</a></h4>
+                <blockquote>
+                    <ol>
+                        <li>
+                            The JAXP or JAX-WS team prepares a new zip bundle,
+                            places a copy in a public download area on java.net,
+                            sends us a link and a list of CRs (Change Request Numbers).
+                            The older download bundles should not be deleted.
+                            It is the responsibility of the JAXP and JAX-WS team to
+                            place the proper GPL legal notices on the sources
+                            and do any filtering or java re-packaging for the
+                            OpenJDK instances of these classes.
+                        </li>
+                        <li>
+                            The OpenJDK team copies this new bundle into shared
+                            area (e.g. <tt>/java/devtools/share/jdk7-drops</tt>).
+                            Older bundles are never deleted so we retain the history.
+                        </li>
+                        <li>
+                            The OpenJDK team edits the ant property file
+                            <tt>jaxp/jaxp.properties</tt> or
+                            <tt>jaxws/jaxws.properties</tt> to update the
+                            base URL, the zip bundle name, and the MD5 checksum
+                            of the zip bundle
+                            (on Solaris: <tt>sum -c md5 <i>bundlename</i></tt>)
+                        </li>
+                        <li>
+                            OpenJDK team reviews and commits those changes with the
+                            given CRs.
+                        </li>
+                    </ol>
+                </blockquote>
+
+                <h4><a name="dropusage">Using Source Drop Bundles</a></h4>
+                <blockquote>
+                    <p>
+                        The ant scripts that build <tt>jaxp</tt> and <tt>jaxws</tt>
+                        will attempt to locate these zip bundles from the directory
+                        in the environment variable
+                        <tt><a href="#ALT_DROPS_DIR">ALT_DROPS_DIR</a></tt>.
+                        The checksums protect from getting the wrong, corrupted, or
+                        improperly modified sources.
+                        Once the sources are made available, the population will not
+                        happen again unless a <tt>make clobber</tt> is requested
+                        or the <tt>jaxp/drop/</tt> or <tt>jaxws/drop/</tt>
+                        directory is explicitly deleted.
+                        <br>
+                        <b>NOTE:</b> The default Makefile and ant script behavior
+                        is to NOT download these bundles from the public http site.
+                        In general, doing downloads
+                        during the build process is not advised, it creates too much
+                        unpredictability in the build process.
+                        However, you can use <tt>make ALLOW_DOWNLOADS=true</tt> to
+                        tell the ant script that the download of the zip bundle is
+                        acceptable.
+                    </p>
+                    <p>
+                        The recommended procedure for keeping a cache of these
+                        source bundles would be to download them once, place them
+                        in a directory outside the repositories, and then set
+                        <tt><a href="#ALT_DROPS_DIR">ALT_DROPS_DIR</a></tt> to refer
+                        to that directory.
+                        These drop bundles do change occasionally, so the newer
+                        bundles may need to be added to this area from time to time.
+                    </p>
+                </blockquote>
+            </blockquote>
         </blockquote>
         <!-- ------------------------------------------------------ -->
         <hr>
         <h2><a name="building">Build Information</a></h2>
         <blockquote>
             Building the OpenJDK
-            is done with a <tt><i>gmake</i></tt>
-            command line and various
-            environment or make variable settings that direct the make rules
+            is done with a <a href="#gmake">GNU <tt>make</tt></a> command line
+            and various
+            environment or make variable settings that direct the makefile rules
             to where various components have been installed.
             Where possible the makefiles will attempt to located the various
             components in the default locations or any component specific 
@@ -578,7 +656,7 @@
                 <pre><tt>
                 bash
                 . jdk/make/jdk_generic_profile.sh
-                <i>gmake</i> sanity &amp;&amp; <i>gmake</i>
+                <a href="#gmake"><tt>make</tt></a> sanity &amp;&amp; <a href="#gmake"><tt>make</tt></a>
                 </tt></pre>
             </blockquote>
             <p>
@@ -599,25 +677,31 @@
             A few notes about using GNU make:
             <ul>
                 <li>
-                    In general, you need GNU make version 3.81 or newer.
+                    You need GNU make version 3.81 or newer.
                 </li>
                 <li>
                     Place the location of the GNU make binary in the <tt>PATH</tt>. 
                 </li>
                 <li>
                     <strong>Linux:</strong>
-                    The <tt>/usr/bin/make</tt> command should work fine for you.
+                    The <tt>/usr/bin/make</tt> should be 3.81 or newer
+                    and should work fine for you.
+                    If this version is not 3.81 or newer,
+                    see the <a href="#buildgmake">"Building GNU make"</a> section.
                 </li>
                 <li>
                     <strong>Solaris:</strong>
                     Do NOT use <tt>/usr/bin/make</tt> on Solaris.
                     If your Solaris system has the software
                     from the Solaris Companion CD installed, 
-                    you should use <tt>gmake</tt>
+                    you should try and use <tt>gmake</tt>
                     which will be located in either the <tt>/opt/sfw/bin</tt> or 
                     <tt>/usr/sfw/bin</tt> directory.
-                    In more recent versions of Solaris GNU make can be found
-                    at <tt>/usr/bin/gmake</tt>. 
+                    In more recent versions of Solaris GNU make might be found
+                    at <tt>/usr/bin/gmake</tt>.<br>
+                    <b>NOTE:</b> It is very likely that this <tt>gmake</tt>
+                    could be 3.80, you need 3.81, in which case,
+                    see the <a href="#buildgmake">"Building GNU make"</a> section.
                 </li>
                 <li>
                     <strong>Windows:</strong>
@@ -627,30 +711,25 @@
                     as a <tt>make.exe</tt> built for something like
                     <a href="http://www.mkssoftware.com/">MKS</a>). 
                     <br>
-                    <b>WARNING:</b> Watch out for make version 3.81, it may
+                    <b>WARNING:</b> Watch out on some make 3.81 versions, it may
                     not work due to a lack of support for MS-DOS drive letter paths
                     like <tt>C:/</tt> or <tt>C:\</tt>.
-                    Use a 3.80 version, or find a newer
-                    version that has this problem fixed.
-                    The older 3.80 version of make.exe can be downloaded with this
-                    <a href="http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2" target="_blank">
-                        link</a>.
-                    Use of this older 3.80 make.exe may require that you install the
-                    libintl2.dll library or libintl2 cygwin package which is
-                    no longer installed by default by the cygwin installer.
                     <br>
-                    Also see the
+                    You may be able to use the information at the
                     <a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
                         mozilla developer center</a>
                     on this topic.
                     <br>
                     It's hoped that when make 3.82 starts shipping in a future cygwin
                     release that this MS-DOS path issue will be fixed.
-                    In addition to the above 3.80 make.exe you can download 
-                    this
+                    <br>
+                    It may be possible to download the version at
                     <a href="http://www.cmake.org/files/cygwin/make.exe">
-                        www.cmake.org make.exe</a> which will not have a libintl2.dll
-                    dependency.
+                        www.cmake.org make.exe</a>.
+                    <br>
+                    It might be necessary for you to build your own GNU make 3.81,
+                    see the <a href="#buildgmake">"Building GNU make"</a> section
+                    in that case.
                 </li>
             </ul>
             <p>
@@ -662,6 +741,34 @@
                 The latest source to GNU make is available at
                 <a href="http://ftp.gnu.org/pub/gnu/make/" target="_blank">
                     ftp.gnu.org/pub/gnu/make/</a>.
+            </p>
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="buildgmake">Building GNU make</a></h4>
+            <blockquote>
+                First step is to get the GNU make 3.81 source from
+                <a href="http://ftp.gnu.org/pub/gnu/make/" target="_blank">
+                    ftp.gnu.org/pub/gnu/make/</a>.
+                Building is a little different depending on the OS and unix toolset
+                on Windows:
+                <ul>
+                    <li>
+                        <strong>Linux:</strong>
+                        <tt>./configure && make</tt>
+                    </li>
+                    <li>
+                        <strong>Solaris:</strong>
+                        <tt>./configure && gmake CC=gcc</tt>
+                    </li>
+                    <li>
+                        <strong>Windows for CYGWIN:</strong>
+                        <tt>./configure && make</tt>
+                    </li>
+                    <li>
+                        <strong>Windows for MKS: (CYGWIN is recommended)</strong>
+                        <tt>./configure && make -f Makefile.win32</tt>
+                    </li>
+                </ul>
+            </blockquote>
         </blockquote>
         <!-- ------------------------------------------------------ -->
         <hr>
@@ -713,7 +820,7 @@
                 </li>
                 <li>
                     Install
-                    <a href="#ant">Ant</a>, 
+                    <a href="#ant">Ant 1.7.1 or newer</a>,
                     make sure it is in your PATH.
                 </li>
             </ol>
@@ -776,7 +883,7 @@
                 </li>
                 <li>
                     Install
-                    <a href="#ant">Ant</a>, 
+                    <a href="#ant">Ant 1.7.1 or newer</a>,
                     make sure it is in your PATH.
                 </li>
             </ol>
@@ -862,7 +969,7 @@
                 </li>
                 <li>
                     Install
-                    <a href="#ant">Ant</a>, 
+                    <a href="#ant">Ant 1.7.1 or newer</a>,
                     make sure it is in your PATH and set
                     <tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
                 </li>
@@ -923,14 +1030,20 @@
             <blockquote>
                 All OpenJDK builds require access to least Ant 1.7.1.
                 The Ant tool is available from the 
-                <a href="http://ant.apache.org" target="_blank">
-                    Ant download site</a>.
+                <a href="http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.zip" target="_blank">
+                    Ant 1.7.1 archive download site</a>.
                 You should always make sure <tt>ant</tt> is in your PATH, and
                 on Windows you may also need to set 
                 <tt><a href="#ANT_HOME">ANT_HOME</a></tt>
                 to point to the location of
                 the Ant installation, this is the directory pathname
                 that contains a <tt>bin and lib</tt>.
+                <br>
+                <b>WARNING:</b> Ant versions used from IDE tools like NetBeans
+                or installed via system packages may not operate the same
+                as the one obtained from the Ant download bundles.
+                These system and IDE installers sometimes choose to change
+                the ant installation enough to cause differences.
             </blockquote>
             <!-- ------------------------------------------------------ -->
             <h4><a name="cacerts">Certificate Authority File (cacert)</a></h4>
@@ -962,7 +1075,7 @@
             <blockquote>
                 <strong><a name="gcc">Linux gcc/binutils</a></strong>
                 <blockquote>
-                    The GNU gcc compiler version should be 4 or newer.
+                    The GNU gcc compiler version should be 4.3 or newer.
                     The compiler used should be the default compiler installed
                     in <tt>/usr/bin</tt>.
                 </blockquote>
@@ -1047,21 +1160,16 @@
                 <strong><a name="msvc32">Windows i586: Microsoft Visual Studio 2010 Compilers</a></strong>
                 <blockquote>
                     <p>
-                        <b>BEGIN WARNING</b>: At this time (Spring/Summer 2010) JDK 7 is starting a transition to
-                        use the newest VS2010 Microsoft compilers. These build instructions are updated
-                        to show where we are going. We have a QA process to go through before
-                        official builds actually use VS2010. So for now, official builds are
-                        still using VS2003. No other compilers are known to build the entire JDK,
+                        <b>BEGIN WARNING</b>: JDK 7 has transitioned to
+                        use the newest VS2010 Microsoft compilers.
+                        No other compilers are known to build the entire JDK,
                         including non-open portions.
-                        So for now you should be able to build with either VS2003 or VS2010.
-                        We do not guarantee that VS2008 will work, although there is sufficient
-                        makefile support to make at least basic JDK builds plausible.
                         Visual Studio 2010 Express compilers are now able to build all the
                         open source repositories, but this is 32 bit only. To build 64 bit
-                        Windows binaries use the the 7.1 Windows SDK.<b>END WARNING.</b>
+                        Windows binaries use the the 7.1 Windows SDK.
+                        <b>END WARNING.</b>
                     <p>
-                        The 32-bit OpenJDK Windows build
-                        requires
+                        The 32-bit OpenJDK Windows build requires
                         Microsoft Visual Studio C++ 2010 (VS2010) Professional
                         Edition or Express compiler.
                         The compiler and other tools are expected to reside
@@ -1088,11 +1196,10 @@
                 </blockquote>
                 <strong><a name="msvc64">Windows x64: Microsoft Visual Studio 2010 Professional Compiler</a></strong>
                 <blockquote>
-                    For <b>X64</b>, builds, when using the VS2010 Professional
-                    compiler, the 64 bit build set up is much the same as 32 bit
+                    For <b>X64</b>, the set up is much the same as 32 bit
                     except that you run <tt>amd64\VCVARS64.BAT</tt>
                     to set the compiler environment variables.
-                    Previously 64 bit builds had used the 64 bit compiler in
+                    Previously 64 bit builds had to use the 64 bit compiler in
                     an unbundled Windows SDK but this is no longer necessary if
                     you have VS2010 Professional.
                 </blockquote>
@@ -1614,6 +1721,13 @@
                     and on Windows with CYGWIN
                     <tt>/usr/bin</tt>.
                 </dd>
+                <dt><tt><a name="ALT_DROPS_DIR">ALT_DROPS_DIR</a></tt> </dt>
+                <dd>
+                    The location of any source drop bundles
+                    (see <a href="#drops">Managing the Source Drops</a>).
+                    The default will be
+                    <tt>$(ALT_JDK_DEVTOOLS_PATH)/share/jdk7-drops</tt>.
+                </dd>
                 <dt><a name="ALT_UNIXCCS_PATH"><tt>ALT_UNIXCCS_PATH</tt></a></dt>
                 <dd>
                     <strong>Solaris only:</strong>
@@ -1659,9 +1773,8 @@
 			    located.
 			    The default is whatever WINDOWSSDKDIR is set to
 			    (or WindowsSdkDir) or the path
-			    <pre>
-                            c:\Program Files\Microsoft SDKs\Windows\v6.1a
-			    </pre>
+                            <br>
+                            <tt>c:\Program Files\Microsoft SDKs\Windows\v7.0a</tt>
                         </dd>
                         <dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt>
                         <dd>
@@ -1682,6 +1795,81 @@
         </blockquote>
         <!-- ------------------------------------------------------ -->
         <hr>
+        <h2><a name="hints">Hints and Tips</a></h2>
+        <blockquote>
+            You don't have to use all these hints and tips, and in fact people do actually
+            build with systems that contradict these, but they might prove to be
+            helpful to some.
+            <ul>
+                <li>
+                    If <tt>make sanity</tt> does not work, find out why, fix that
+                    before going any further. Or at least understand what the
+                    complaints are from it.
+                </li>
+                <li>
+                    JDK: Keep in mind that you are building a JDK, but you need
+                    a JDK (BOOTDIR JDK) to build this JDK.
+                </li>
+                <li>
+                    Ant: The ant utility is a java application and besides having
+                    ant available to you, it's important that ant finds the right
+                    java to run with. Make sure you can type <tt>ant -version</tt>
+                    and get clean results with no error messages.
+                </li>
+                <li>
+                    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.
+                </li>
+                <li>
+                    Solaris: Typically you will need to get compilers on your systems
+                    and occasionally GNU make 3.81 if a gmake binary is not available.
+                    The gmake binary might not be 3.81, be careful.
+                </li>
+                <li>
+                    Windows VS2010:
+                    <ul>
+                        <li>
+                            Only the C++ part of VS2010 is needed.
+                            Try to let the installation go to the default install directory.
+                            Always reboot your system after installing VS2010.
+                            The system environment variable VS100COMNTOOLS should be
+                            set in your environment.
+                        </li>
+                        <li>
+                            Make sure that TMP and TEMP are also set in the environment
+                            and refer to Windows paths that exist, like <tt>C:\temp</tt>,
+                            not <tt>/tmp</tt>, not <tt>/cygdrive/c/temp</tt>, and not <tt>C:/temp</tt>.
+                            <tt>C:\temp</tt> 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.
+                        </li>
+                        <li>
+                            You need to use vsvars32.bat or vsvars64.bat to get the
+                            PATH, INCLUDE, LIB, LIBPATH, and WINDOWSSDKDIR
+                            variables set in your shell environment.
+                            These bat files are not easy to use from a shell environment.
+                            However, there is a script placed in the root jdk7 repository called
+                            vsvars.sh that can help, it should only be done once in a shell
+                            that will be doing the build, e.g.<br>
+                            <tt>sh ./make/scripts/vsvars.sh -v10 > settings<br>
+                                eval `cat settings`</tt><br>
+                            Or just <tt>eval `sh ./make/scripts/vsvars.sh -v10`</tt>.
+                        </li>
+                    </ul>
+                </li>
+                <li>
+                    Windows: PATH order is critical, see the
+                    <a href="#paths">paths</a> section for more information.
+                </li>
+                <li>
+                    Windows 64bit builds: Use ARCH_DATA_MODEL=64.
+                </li>
+            </ul>
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
         <h2><a name="troubleshooting">Troubleshooting</a></h2>
         <blockquote>
             A build can fail for any number of reasons. 
@@ -1707,6 +1895,19 @@
                 below, with suggestions for remedies.
             <ul>
                 <li>
+                    <b>Corrupted Bundles on Windows:</b>
+                    <blockquote>
+                        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.
+                    </blockquote>
+                </li>
+                <li>
                     <b>Slow Builds:</b>
                     <blockquote>
                         If your build machine seems to be overloaded from too many
@@ -1801,7 +2002,11 @@
                     </blockquote>
                 </li>
                 <li>
-                    <b>Windows Error Message: <tt>*** fatal error - couldn't allocate heap, ... </tt></b>
+                    <b>Windows Error Messages:</b><br>
+                    <tt>*** fatal error - couldn't allocate heap, ... </tt><br>
+                    <tt>rm fails with "Directory not empty"</tt><br>
+                    <tt>unzip fails with "cannot create ... Permission denied"</tt><br>
+                    <tt>unzip fails with "cannot create ... Error 50"</tt><br>
                     <blockquote>
                         The CYGWIN software can conflict with other non-CYGWIN
                         software. See the CYGWIN FAQ section on
@@ -1810,12 +2015,11 @@
                     </blockquote>
                 </li>
                 <li>
-                    <b>Windows Error Message: <tt>*** multiple target patterns.  Stop.</tt></b>
+                    <b>Windows Error Message: <tt>spawn failed</tt></b>
                     <blockquote>
-                        The CYGWIN make version 3.81 may not like the Windows <tt>C:/</tt>
-                        style paths, it may not like the ':' character in the path
-                        when used in a makefile target definition.
-                        See the <a href="#gmake"><tt><i>gmake</i></tt></a> section.
+                        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.
                     </blockquote>
                 </li>
             </ul>
--- a/corba/.hgtags	Wed Mar 16 17:21:52 2011 -0700
+++ b/corba/.hgtags	Fri Mar 18 11:00:10 2011 -0700
@@ -107,3 +107,5 @@
 563a8f8b5be3940e9346cffac4eff9ed02b3c69f jdk7-b130
 9d6dd2cdfcb92612dbd836ecded87770d52b49db jdk7-b131
 1b1e75e8f476e5c07f0d2b035993895e2603e1f0 jdk7-b132
+671fe2e623ffefb4b7c312be919fc71eb48c1df1 jdk7-b133
+918003855fa0dba5acf4bf1fe36526d2fc4c1ba8 jdk7-b134
--- a/hotspot/.hgtags	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/.hgtags	Fri Mar 18 11:00:10 2011 -0700
@@ -153,3 +153,6 @@
 e9aa2ca89ad6c53420623d579765f9706ec523d7 hs21-b02
 0e531ab5ba04967a0e9aa6aef65e6eb3a0dcf632 jdk7-b132
 a8d643a4db47c7b58e0bcb49c77b5c3610de86a8 hs21-b03
+1b3a350709e4325d759bb453ff3fb6a463270488 jdk7-b133
+447e6faab4a8755d4860c2366630729dbaec111c jdk7-b134
+3c76374706ea8a77e15aec8310e831e5734f8775 hs21-b04
--- a/hotspot/make/hotspot_version	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/make/hotspot_version	Fri Mar 18 11:00:10 2011 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=21
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=03
+HS_BUILD_NUMBER=05
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/hotspot/make/windows/makefiles/compile.make	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/make/windows/makefiles/compile.make	Fri Mar 18 11:00:10 2011 -0700
@@ -207,6 +207,9 @@
 # Manifest Tool - used in VS2005 and later to adjust manifests stored
 # as resources inside build artifacts.
 MT=mt.exe
+!if "$(BUILDARCH)" == "i486"
+LINK_FLAGS = /SAFESEH $(LINK_FLAGS)
+!endif
 !endif
 
 # Compile for space above time.
--- a/hotspot/make/windows/makefiles/launcher.make	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/make/windows/makefiles/launcher.make	Fri Mar 18 11:00:10 2011 -0700
@@ -1,71 +1,73 @@
-#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#  
-#
-
-
-LAUNCHER_FLAGS=$(CPP_FLAGS) $(ARCHFLAG) \
-	/D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
-	/D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
-	/D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
-	/D GAMMA \
-	/D LAUNCHER_TYPE=\"gamma\" \
-	/D _CRT_SECURE_NO_WARNINGS \
-	/D _CRT_SECURE_NO_DEPRECATE \
-	/D LINK_INTO_LIBJVM \
-	/I $(WorkSpace)\src\os\windows\launcher \
-	/I $(WorkSpace)\src\share\tools\launcher \
-	/I $(WorkSpace)\src\share\vm\prims \
-	/I $(WorkSpace)\src\share\vm \
-	/I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \
-	/I $(WorkSpace)\src\os\windows\vm
-
-LINK_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console 
-
-!if "$(COMPILER_NAME)" == "VS2005"
-# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
-#    on the link command line, otherwise we get missing __security_check_cookie
-#    externals at link time. Even with /GS-, you need bufferoverflowU.lib.
-BUFFEROVERFLOWLIB = bufferoverflowU.lib
-LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB)
-!endif
-
-LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher
-LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher
-
-OUTDIR = launcher
-
-{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj:
-	-mkdir $(OUTDIR) 2>NUL >NUL
-        $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
-
-{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj:
-	-mkdir $(OUTDIR) 2>NUL >NUL
-        $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
-
-$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h
-
-launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj
-	echo $(JAVA_HOME) > jdkpath.txt  
-	$(LINK) $(LINK_FLAGS) /out:hotspot.exe $**
-
-
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+
+LAUNCHER_FLAGS=$(CPP_FLAGS) $(ARCHFLAG) \
+	/D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+	/D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+	/D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
+	/D GAMMA \
+	/D LAUNCHER_TYPE=\"gamma\" \
+	/D _CRT_SECURE_NO_WARNINGS \
+	/D _CRT_SECURE_NO_DEPRECATE \
+	/D LINK_INTO_LIBJVM \
+	/I $(WorkSpace)\src\os\windows\launcher \
+	/I $(WorkSpace)\src\share\tools\launcher \
+	/I $(WorkSpace)\src\share\vm\prims \
+	/I $(WorkSpace)\src\share\vm \
+	/I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \
+	/I $(WorkSpace)\src\os\windows\vm
+
+LINK_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console 
+
+!if "$(COMPILER_NAME)" == "VS2005"
+# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
+#    on the link command line, otherwise we get missing __security_check_cookie
+#    externals at link time. Even with /GS-, you need bufferoverflowU.lib.
+BUFFEROVERFLOWLIB = bufferoverflowU.lib
+LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB)
+!endif
+
+!if "$(COMPILER_NAME)" == "VS2010" && "$(BUILDARCH)" == "i486"
+LINK_FLAGS = /SAFESEH $(LINK_FLAGS)
+!endif
+
+LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher
+LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher
+
+OUTDIR = launcher
+
+{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj:
+	-mkdir $(OUTDIR) 2>NUL >NUL
+        $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
+
+{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj:
+	-mkdir $(OUTDIR) 2>NUL >NUL
+        $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
+
+$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h
+
+launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj
+	echo $(JAVA_HOME) > jdkpath.txt  
+	$(LINK) $(LINK_FLAGS) /out:hotspot.exe $**
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -3179,7 +3179,7 @@
                                               Label& wrong_method_type) {
   assert_different_registers(mtype_reg, mh_reg, temp_reg);
   // compare method type against that of the receiver
-  RegisterOrConstant mhtype_offset = delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg);
+  RegisterOrConstant mhtype_offset = delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg);
   load_heap_oop(mh_reg, mhtype_offset, temp_reg);
   cmp(temp_reg, mtype_reg);
   br(Assembler::notEqual, false, Assembler::pn, wrong_method_type);
@@ -3195,14 +3195,14 @@
                                                 Register temp_reg) {
   assert_different_registers(vmslots_reg, mh_reg, temp_reg);
   // load mh.type.form.vmslots
-  if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
+  if (java_lang_invoke_MethodHandle::vmslots_offset_in_bytes() != 0) {
     // hoist vmslots into every mh to avoid dependent load chain
-    ld(           Address(mh_reg,    delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)),   vmslots_reg);
+    ld(           Address(mh_reg,    delayed_value(java_lang_invoke_MethodHandle::vmslots_offset_in_bytes, temp_reg)),   vmslots_reg);
   } else {
     Register temp2_reg = vmslots_reg;
-    load_heap_oop(Address(mh_reg,    delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)),      temp2_reg);
-    load_heap_oop(Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)),        temp2_reg);
-    ld(           Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
+    load_heap_oop(Address(mh_reg,    delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg)),      temp2_reg);
+    load_heap_oop(Address(temp2_reg, delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, temp_reg)),        temp2_reg);
+    ld(           Address(temp2_reg, delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
   }
 }
 
@@ -3213,7 +3213,7 @@
 
   // pick out the interpreted side of the handler
   // NOTE: vmentry is not an oop!
-  ld_ptr(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg), temp_reg);
+  ld_ptr(mh_reg, delayed_value(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes, temp_reg), temp_reg);
 
   // off we go...
   ld_ptr(temp_reg, MethodHandleEntry::from_interpreted_entry_offset_in_bytes(), temp_reg);
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -395,9 +395,9 @@
 
   int offset = code_offset();
 
-  __ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type);
+  __ call(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id), relocInfo::runtime_call_type);
   __ delayed()->nop();
-  debug_only(__ stop("should have gone to the caller");)
+  __ should_not_reach_here();
   assert(code_offset() - offset <= exception_handler_size, "overflow");
   __ end_a_stub();
 
--- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -148,7 +148,7 @@
 
 static OopMap* generate_oop_map(StubAssembler* sasm, bool save_fpu_registers) {
   assert(frame_size_in_bytes == __ total_frame_size_in_bytes(reg_save_size_in_words),
-         " mismatch in calculation");
+         "mismatch in calculation");
   sasm->set_frame_size(frame_size_in_bytes / BytesPerWord);
   int frame_size_in_slots = frame_size_in_bytes / sizeof(jint);
   OopMap* oop_map = new OopMap(frame_size_in_slots, 0);
@@ -176,9 +176,8 @@
 
 static OopMap* save_live_registers(StubAssembler* sasm, bool save_fpu_registers = true) {
   assert(frame_size_in_bytes == __ total_frame_size_in_bytes(reg_save_size_in_words),
-         " mismatch in calculation");
+         "mismatch in calculation");
   __ save_frame_c1(frame_size_in_bytes);
-  sasm->set_frame_size(frame_size_in_bytes / BytesPerWord);
 
   // Record volatile registers as callee-save values in an OopMap so their save locations will be
   // propagated to the caller frame's RegisterMap during StackFrameStream construction (needed for
@@ -367,23 +366,7 @@
   switch (id) {
     case forward_exception_id:
       {
-        // we're handling an exception in the context of a compiled
-        // frame.  The registers have been saved in the standard
-        // places.  Perform an exception lookup in the caller and
-        // dispatch to the handler if found.  Otherwise unwind and
-        // dispatch to the callers exception handler.
-
-        oop_maps = new OopMapSet();
-        OopMap* oop_map = generate_oop_map(sasm, true);
-
-        // transfer the pending exception to the exception_oop
-        __ ld_ptr(G2_thread, in_bytes(JavaThread::pending_exception_offset()), Oexception);
-        __ ld_ptr(Oexception, 0, G0);
-        __ st_ptr(G0, G2_thread, in_bytes(JavaThread::pending_exception_offset()));
-        __ add(I7, frame::pc_return_offset, Oissuing_pc);
-
-        generate_handle_exception(sasm, oop_maps, oop_map);
-        __ should_not_reach_here();
+        oop_maps = generate_handle_exception(id, sasm);
       }
       break;
 
@@ -671,15 +654,14 @@
       break;
 
     case handle_exception_id:
-      {
-        __ set_info("handle_exception", dont_gc_arguments);
-        // make a frame and preserve the caller's caller-save registers
+      { __ set_info("handle_exception", dont_gc_arguments);
+        oop_maps = generate_handle_exception(id, sasm);
+      }
+      break;
 
-        oop_maps = new OopMapSet();
-        OopMap* oop_map = save_live_registers(sasm);
-        __ mov(Oexception->after_save(),  Oexception);
-        __ mov(Oissuing_pc->after_save(), Oissuing_pc);
-        generate_handle_exception(sasm, oop_maps, oop_map);
+    case handle_exception_from_callee_id:
+      { __ set_info("handle_exception_from_callee", dont_gc_arguments);
+        oop_maps = generate_handle_exception(id, sasm);
       }
       break;
 
@@ -696,7 +678,7 @@
                         G2_thread, Oissuing_pc->after_save());
         __ verify_not_null_oop(Oexception->after_save());
 
-        // Restore SP from L7 if the exception PC is a MethodHandle call site.
+        // Restore SP from L7 if the exception PC is a method handle call site.
         __ mov(O0, G5);  // Save the target address.
         __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), L0);
         __ tst(L0);  // Condition codes are preserved over the restore.
@@ -1006,48 +988,89 @@
 }
 
 
-void Runtime1::generate_handle_exception(StubAssembler* sasm, OopMapSet* oop_maps, OopMap* oop_map, bool) {
-  Label no_deopt;
+OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) {
+  __ block_comment("generate_handle_exception");
+
+  // Save registers, if required.
+  OopMapSet* oop_maps = new OopMapSet();
+  OopMap* oop_map = NULL;
+  switch (id) {
+  case forward_exception_id:
+    // We're handling an exception in the context of a compiled frame.
+    // The registers have been saved in the standard places.  Perform
+    // an exception lookup in the caller and dispatch to the handler
+    // if found.  Otherwise unwind and dispatch to the callers
+    // exception handler.
+     oop_map = generate_oop_map(sasm, true);
+
+     // transfer the pending exception to the exception_oop
+     __ ld_ptr(G2_thread, in_bytes(JavaThread::pending_exception_offset()), Oexception);
+     __ ld_ptr(Oexception, 0, G0);
+     __ st_ptr(G0, G2_thread, in_bytes(JavaThread::pending_exception_offset()));
+     __ add(I7, frame::pc_return_offset, Oissuing_pc);
+    break;
+  case handle_exception_id:
+    // At this point all registers MAY be live.
+    oop_map = save_live_registers(sasm);
+    __ mov(Oexception->after_save(),  Oexception);
+    __ mov(Oissuing_pc->after_save(), Oissuing_pc);
+    break;
+  case handle_exception_from_callee_id:
+    // At this point all registers except exception oop (Oexception)
+    // and exception pc (Oissuing_pc) are dead.
+    oop_map = new OopMap(frame_size_in_bytes / sizeof(jint), 0);
+    sasm->set_frame_size(frame_size_in_bytes / BytesPerWord);
+    __ save_frame_c1(frame_size_in_bytes);
+    __ mov(Oexception->after_save(),  Oexception);
+    __ mov(Oissuing_pc->after_save(), Oissuing_pc);
+    break;
+  default:  ShouldNotReachHere();
+  }
 
   __ verify_not_null_oop(Oexception);
 
   // save the exception and issuing pc in the thread
-  __ st_ptr(Oexception, G2_thread, in_bytes(JavaThread::exception_oop_offset()));
+  __ st_ptr(Oexception,  G2_thread, in_bytes(JavaThread::exception_oop_offset()));
   __ st_ptr(Oissuing_pc, G2_thread, in_bytes(JavaThread::exception_pc_offset()));
 
-  // save the real return address and use the throwing pc as the return address to lookup (has bci & oop map)
-  __ mov(I7, L0);
+  // use the throwing pc as the return address to lookup (has bci & oop map)
   __ mov(Oissuing_pc, I7);
   __ sub(I7, frame::pc_return_offset, I7);
   int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, exception_handler_for_pc));
+  oop_maps->add_gc_map(call_offset, oop_map);
 
   // Note: if nmethod has been deoptimized then regardless of
   // whether it had a handler or not we will deoptimize
   // by entering the deopt blob with a pending exception.
 
-#ifdef ASSERT
-  Label done;
-  __ tst(O0);
-  __ br(Assembler::notZero, false, Assembler::pn, done);
-  __ delayed()->nop();
-  __ stop("should have found address");
-  __ bind(done);
-#endif
+  // Restore the registers that were saved at the beginning, remove
+  // the frame and jump to the exception handler.
+  switch (id) {
+  case forward_exception_id:
+  case handle_exception_id:
+    restore_live_registers(sasm);
+    __ jmp(O0, 0);
+    __ delayed()->restore();
+    break;
+  case handle_exception_from_callee_id:
+    // Restore SP from L7 if the exception PC is a method handle call site.
+    __ mov(O0, G5);  // Save the target address.
+    __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), L0);
+    __ tst(L0);  // Condition codes are preserved over the restore.
+    __ restore();
 
-  // restore the registers that were saved at the beginning and jump to the exception handler.
-  restore_live_registers(sasm);
+    __ jmp(G5, 0);  // jump to the exception handler
+    __ delayed()->movcc(Assembler::notZero, false, Assembler::icc, L7_mh_SP_save, SP);  // Restore SP if required.
+    break;
+  default:  ShouldNotReachHere();
+  }
 
-  __ jmp(O0, 0);
-  __ delayed()->restore();
-
-  oop_maps->add_gc_map(call_offset, oop_map);
+  return oop_maps;
 }
 
 
 #undef __
 
-#define __ masm->
-
 const char *Runtime1::pd_name_for_address(address entry) {
   return "<unknown function>";
 }
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1188,7 +1188,7 @@
   __ st_ptr(O2, XXX_STATE(_stack));                // PREPUSH
 
   __ lduh(max_stack, O3);                      // Full size expression stack
-  guarantee(!EnableMethodHandles, "no support yet for java.dyn.MethodHandle"); //6815692
+  guarantee(!EnableMethodHandles, "no support yet for java.lang.invoke.MethodHandle"); //6815692
   //6815692//if (EnableMethodHandles)
   //6815692//  __ inc(O3, methodOopDesc::extra_stack_entries());
   __ sll(O3, LogBytesPerWord, O3);
--- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 define_pd_global(intx, OptoLoopAlignment,     16);  // = 4*wordSize
 define_pd_global(intx, InlineFrequencyCount,  50);  // we can use more inlining on the SPARC
 define_pd_global(intx, InlineSmallCode,       1500);
+
 #ifdef _LP64
 // Stack slots are 2X larger in LP64 than in the 32 bit VM.
 define_pd_global(intx, ThreadStackSize,       1024);
@@ -71,4 +72,6 @@
 
 define_pd_global(bool, UseMembar,            false);
 
+// GC Ergo Flags
+define_pd_global(intx, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
 #endif // CPU_SPARC_VM_GLOBALS_SPARC_HPP
--- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
 
 
 // Method handle invoker
-// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
+// Dispatch a method of the form java.lang.invoke.MethodHandles::invoke(...)
 address InterpreterGenerator::generate_method_handle_entry(void) {
   if (!EnableMethodHandles) {
     return generate_abstract_entry();
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -112,8 +112,8 @@
   }
 
   // given the MethodType, find out where the MH argument is buried
-  __ load_heap_oop(Address(O0_mtype,   __ delayed_value(java_dyn_MethodType::form_offset_in_bytes,        O1_scratch)), O4_argslot);
-  __ ldsw(         Address(O4_argslot, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O4_argslot);
+  __ load_heap_oop(Address(O0_mtype,   __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes,        O1_scratch)), O4_argslot);
+  __ ldsw(         Address(O4_argslot, __ delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O4_argslot);
   __ add(Gargs, __ argument_offset(O4_argslot, 1), O4_argbase);
   // Note: argument_address uses its input as a scratch register!
   __ ld_ptr(Address(O4_argbase, -Interpreter::stackElementSize), G3_method_handle);
@@ -141,10 +141,10 @@
   // load up an adapter from the calling type (Java weaves this)
   Register O2_form    = O2_scratch;
   Register O3_adapter = O3_scratch;
-  __ load_heap_oop(Address(O0_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes,               O1_scratch)), O2_form);
-  // load_heap_oop(Address(O2_form,  __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
+  __ load_heap_oop(Address(O0_mtype, __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes,               O1_scratch)), O2_form);
+  // load_heap_oop(Address(O2_form,  __ delayed_value(java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
   // deal with old JDK versions:
-  __ add(          Address(O2_form,  __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
+  __ add(          Address(O2_form,  __ delayed_value(java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
   __ cmp(O3_adapter, O2_form);
   Label sorry_no_invoke_generic;
   __ brx(Assembler::lessUnsigned, false, Assembler::pn, sorry_no_invoke_generic);
@@ -376,16 +376,16 @@
 
 // which conversion op types are implemented here?
 int MethodHandles::adapter_conversion_ops_supported_mask() {
-  return ((1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_CHECK_CAST)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_ROT_ARGS)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_DUP_ARGS)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_DROP_ARGS)
-         //|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
+  return ((1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS)
+         //|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
          );
   // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
 }
@@ -413,21 +413,22 @@
   const Register O1_actual   = O1;
   const Register O2_required = O2;
 
-  guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
+  guarantee(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
 
   // Some handy addresses:
   Address G5_method_fie(    G5_method,        in_bytes(methodOopDesc::from_interpreted_offset()));
+  Address G5_method_fce(    G5_method,        in_bytes(methodOopDesc::from_compiled_offset()));
 
-  Address G3_mh_vmtarget(   G3_method_handle, java_dyn_MethodHandle::vmtarget_offset_in_bytes());
+  Address G3_mh_vmtarget(   G3_method_handle, java_lang_invoke_MethodHandle::vmtarget_offset_in_bytes());
 
-  Address G3_dmh_vmindex(   G3_method_handle, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes());
+  Address G3_dmh_vmindex(   G3_method_handle, java_lang_invoke_DirectMethodHandle::vmindex_offset_in_bytes());
 
-  Address G3_bmh_vmargslot( G3_method_handle, sun_dyn_BoundMethodHandle::vmargslot_offset_in_bytes());
-  Address G3_bmh_argument(  G3_method_handle, sun_dyn_BoundMethodHandle::argument_offset_in_bytes());
+  Address G3_bmh_vmargslot( G3_method_handle, java_lang_invoke_BoundMethodHandle::vmargslot_offset_in_bytes());
+  Address G3_bmh_argument(  G3_method_handle, java_lang_invoke_BoundMethodHandle::argument_offset_in_bytes());
 
-  Address G3_amh_vmargslot( G3_method_handle, sun_dyn_AdapterMethodHandle::vmargslot_offset_in_bytes());
-  Address G3_amh_argument ( G3_method_handle, sun_dyn_AdapterMethodHandle::argument_offset_in_bytes());
-  Address G3_amh_conversion(G3_method_handle, sun_dyn_AdapterMethodHandle::conversion_offset_in_bytes());
+  Address G3_amh_vmargslot( G3_method_handle, java_lang_invoke_AdapterMethodHandle::vmargslot_offset_in_bytes());
+  Address G3_amh_argument ( G3_method_handle, java_lang_invoke_AdapterMethodHandle::argument_offset_in_bytes());
+  Address G3_amh_conversion(G3_method_handle, java_lang_invoke_AdapterMethodHandle::conversion_offset_in_bytes());
 
   const int java_mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
 
@@ -444,17 +445,15 @@
   case _raise_exception:
     {
       // Not a real MH entry, but rather shared code for raising an
-      // exception.  Since we use a C2I adapter to set up the
-      // interpreter state, arguments are expected in compiler
-      // argument registers.
+      // exception.  Since we use the compiled entry, arguments are
+      // expected in compiler argument registers.
       assert(raise_exception_method(), "must be set");
-      address c2i_entry = raise_exception_method()->get_c2i_entry();
-      assert(c2i_entry, "method must be linked");
+      assert(raise_exception_method()->from_compiled_entry(), "method must be linked");
 
       __ mov(O5_savedSP, SP);  // Cut the stack back to where the caller started.
 
       Label L_no_method;
-      // FIXME: fill in _raise_exception_method with a suitable sun.dyn method
+      // FIXME: fill in _raise_exception_method with a suitable java.lang.invoke method
       __ set(AddressLiteral((address) &_raise_exception_method), G5_method);
       __ ld_ptr(Address(G5_method, 0), G5_method);
       __ tst(G5_method);
@@ -468,10 +467,9 @@
       __ delayed()->nop();
 
       __ verify_oop(G5_method);
-      __ jump_to(AddressLiteral(c2i_entry), O3_scratch);
+      __ jump_indirect_to(G5_method_fce, O3_scratch);  // jump to compiled entry
       __ delayed()->nop();
 
-      // If we get here, the Java runtime did not do its job of creating the exception.
       // Do something that is at least causes a valid throw from the interpreter.
       __ bind(L_no_method);
       __ unimplemented("call throw_WrongMethodType_entry");
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -968,19 +968,6 @@
     return start;
   }
 
-  static address disjoint_byte_copy_entry;
-  static address disjoint_short_copy_entry;
-  static address disjoint_int_copy_entry;
-  static address disjoint_long_copy_entry;
-  static address disjoint_oop_copy_entry;
-
-  static address byte_copy_entry;
-  static address short_copy_entry;
-  static address int_copy_entry;
-  static address long_copy_entry;
-  static address oop_copy_entry;
-
-  static address checkcast_copy_entry;
 
   //
   // Verify that a register contains clean 32-bits positive value
@@ -1046,31 +1033,40 @@
   //
   //  The input registers are overwritten.
   //
-  void gen_write_ref_array_pre_barrier(Register addr, Register count) {
+  void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
-    if (bs->has_write_ref_pre_barrier()) {
-      assert(bs->has_write_ref_array_pre_opt(),
-             "Else unsupported barrier set.");
-
-      __ save_frame(0);
-      // Save the necessary global regs... will be used after.
-      if (addr->is_global()) {
-        __ mov(addr, L0);
-      }
-      if (count->is_global()) {
-        __ mov(count, L1);
-      }
-      __ mov(addr->after_save(), O0);
-      // Get the count into O1
-      __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre));
-      __ delayed()->mov(count->after_save(), O1);
-      if (addr->is_global()) {
-        __ mov(L0, addr);
-      }
-      if (count->is_global()) {
-        __ mov(L1, count);
-      }
-      __ restore();
+    switch (bs->kind()) {
+      case BarrierSet::G1SATBCT:
+      case BarrierSet::G1SATBCTLogging:
+        // With G1, don't generate the call if we statically know that the target in uninitialized
+        if (!dest_uninitialized) {
+          __ save_frame(0);
+          // Save the necessary global regs... will be used after.
+          if (addr->is_global()) {
+            __ mov(addr, L0);
+          }
+          if (count->is_global()) {
+            __ mov(count, L1);
+          }
+          __ mov(addr->after_save(), O0);
+          // Get the count into O1
+          __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre));
+          __ delayed()->mov(count->after_save(), O1);
+          if (addr->is_global()) {
+            __ mov(L0, addr);
+          }
+          if (count->is_global()) {
+            __ mov(L1, count);
+          }
+          __ restore();
+        }
+        break;
+      case BarrierSet::CardTableModRef:
+      case BarrierSet::CardTableExtension:
+      case BarrierSet::ModRef:
+        break;
+      default:
+        ShouldNotReachHere();
     }
   }
   //
@@ -1084,7 +1080,7 @@
   //  The input registers are overwritten.
   //
   void gen_write_ref_array_post_barrier(Register addr, Register count,
-                                   Register tmp) {
+                                        Register tmp) {
     BarrierSet* bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
@@ -1283,7 +1279,7 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_disjoint_byte_copy(bool aligned, const char * name) {
+  address generate_disjoint_byte_copy(bool aligned, address *entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1299,9 +1295,11 @@
 
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  disjoint_byte_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     // for short arrays, just do single element copy
     __ cmp(count, 23); // 16 + 7
@@ -1391,15 +1389,13 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_conjoint_byte_copy(bool aligned, const char * name) {
+  address generate_conjoint_byte_copy(bool aligned, address nooverlap_target,
+                                      address *entry, const char *name) {
     // Do reverse copy.
 
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
-    address nooverlap_target = aligned ?
-        StubRoutines::arrayof_jbyte_disjoint_arraycopy() :
-        disjoint_byte_copy_entry;
 
     Label L_skip_alignment, L_align, L_aligned_copy;
     Label L_copy_byte, L_copy_byte_loop, L_exit;
@@ -1412,9 +1408,11 @@
 
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  byte_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     array_overlap_test(nooverlap_target, 0);
 
@@ -1504,7 +1502,7 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_disjoint_short_copy(bool aligned, const char * name) {
+  address generate_disjoint_short_copy(bool aligned, address *entry, const char * name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1520,9 +1518,11 @@
 
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  disjoint_short_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     // for short arrays, just do single element copy
     __ cmp(count, 11); // 8 + 3  (22 bytes)
@@ -1842,15 +1842,13 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_conjoint_short_copy(bool aligned, const char * name) {
+  address generate_conjoint_short_copy(bool aligned, address nooverlap_target,
+                                       address *entry, const char *name) {
     // Do reverse copy.
 
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
-    address nooverlap_target = aligned ?
-        StubRoutines::arrayof_jshort_disjoint_arraycopy() :
-        disjoint_short_copy_entry;
 
     Label L_skip_alignment, L_skip_alignment2, L_aligned_copy;
     Label L_copy_2_bytes, L_copy_2_bytes_loop, L_exit;
@@ -1865,9 +1863,11 @@
 
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  short_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     array_overlap_test(nooverlap_target, 1);
 
@@ -2072,7 +2072,7 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_disjoint_int_copy(bool aligned, const char * name) {
+  address generate_disjoint_int_copy(bool aligned, address *entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -2080,9 +2080,11 @@
     const Register count = O2;
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  disjoint_int_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     generate_disjoint_int_copy_core(aligned);
 
@@ -2204,20 +2206,19 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_conjoint_int_copy(bool aligned, const char * name) {
+  address generate_conjoint_int_copy(bool aligned, address nooverlap_target,
+                                     address *entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
 
-    address nooverlap_target = aligned ?
-        StubRoutines::arrayof_jint_disjoint_arraycopy() :
-        disjoint_int_copy_entry;
-
     assert_clean_int(O2, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  int_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     array_overlap_test(nooverlap_target, 2);
 
@@ -2336,16 +2337,18 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_disjoint_long_copy(bool aligned, const char * name) {
+  address generate_disjoint_long_copy(bool aligned, address *entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
 
     assert_clean_int(O2, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  disjoint_long_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     generate_disjoint_long_copy_core(aligned);
 
@@ -2406,19 +2409,21 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_conjoint_long_copy(bool aligned, const char * name) {
+  address generate_conjoint_long_copy(bool aligned, address nooverlap_target,
+                                      address *entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
 
-    assert(!aligned, "usage");
-    address nooverlap_target = disjoint_long_copy_entry;
+    assert(aligned, "Should always be aligned");
 
     assert_clean_int(O2, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  long_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     array_overlap_test(nooverlap_target, 3);
 
@@ -2439,7 +2444,8 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_disjoint_oop_copy(bool aligned, const char * name) {
+  address generate_disjoint_oop_copy(bool aligned, address *entry, const char *name,
+                                     bool dest_uninitialized = false) {
 
     const Register from  = O0;  // source array address
     const Register to    = O1;  // destination array address
@@ -2451,14 +2457,16 @@
 
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  disjoint_oop_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here
+      BLOCK_COMMENT("Entry:");
+    }
 
     // save arguments for barrier generation
     __ mov(to, G1);
     __ mov(count, G5);
-    gen_write_ref_array_pre_barrier(G1, G5);
+    gen_write_ref_array_pre_barrier(G1, G5, dest_uninitialized);
   #ifdef _LP64
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
     if (UseCompressedOops) {
@@ -2487,7 +2495,9 @@
   //      to:    O1
   //      count: O2 treated as signed
   //
-  address generate_conjoint_oop_copy(bool aligned, const char * name) {
+  address generate_conjoint_oop_copy(bool aligned, address nooverlap_target,
+                                     address *entry, const char *name,
+                                     bool dest_uninitialized = false) {
 
     const Register from  = O0;  // source array address
     const Register to    = O1;  // destination array address
@@ -2499,21 +2509,18 @@
 
     assert_clean_int(count, O3);     // Make sure 'count' is clean int.
 
-    if (!aligned)  oop_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here
-    if (!aligned)  BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here
+      BLOCK_COMMENT("Entry:");
+    }
+
+    array_overlap_test(nooverlap_target, LogBytesPerHeapOop);
 
     // save arguments for barrier generation
     __ mov(to, G1);
     __ mov(count, G5);
-
-    gen_write_ref_array_pre_barrier(G1, G5);
-
-    address nooverlap_target = aligned ?
-        StubRoutines::arrayof_oop_disjoint_arraycopy() :
-        disjoint_oop_copy_entry;
-
-    array_overlap_test(nooverlap_target, LogBytesPerHeapOop);
+    gen_write_ref_array_pre_barrier(G1, G5, dest_uninitialized);
 
   #ifdef _LP64
     if (UseCompressedOops) {
@@ -2582,7 +2589,7 @@
   //      ckval: O4 (super_klass)
   //      ret:   O0 zero for success; (-1^K) where K is partial transfer count
   //
-  address generate_checkcast_copy(const char* name) {
+  address generate_checkcast_copy(const char *name, address *entry, bool dest_uninitialized = false) {
 
     const Register O0_from   = O0;      // source array address
     const Register O1_to     = O1;      // destination array address
@@ -2600,8 +2607,6 @@
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
 
-    gen_write_ref_array_pre_barrier(O1, O2);
-
 #ifdef ASSERT
     // We sometimes save a frame (see generate_type_check below).
     // If this will cause trouble, let's fail now instead of later.
@@ -2625,9 +2630,12 @@
     }
 #endif //ASSERT
 
-    checkcast_copy_entry = __ pc();
-    // caller can pass a 64-bit byte count here (from generic stub)
-    BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from generic stub)
+      BLOCK_COMMENT("Entry:");
+    }
+    gen_write_ref_array_pre_barrier(O1_to, O2_count, dest_uninitialized);
 
     Label load_element, store_element, do_card_marks, fail, done;
     __ addcc(O2_count, 0, G1_remain);   // initialize loop index, and test it
@@ -2700,7 +2708,11 @@
   // Examines the alignment of the operands and dispatches
   // to a long, int, short, or byte copy loop.
   //
-  address generate_unsafe_copy(const char* name) {
+  address generate_unsafe_copy(const char* name,
+                               address byte_copy_entry,
+                               address short_copy_entry,
+                               address int_copy_entry,
+                               address long_copy_entry) {
 
     const Register O0_from   = O0;      // source array address
     const Register O1_to     = O1;      // destination array address
@@ -2796,8 +2808,13 @@
   //    O0 ==  0  -  success
   //    O0 == -1  -  need to call System.arraycopy
   //
-  address generate_generic_copy(const char *name) {
-
+  address generate_generic_copy(const char *name,
+                                address entry_jbyte_arraycopy,
+                                address entry_jshort_arraycopy,
+                                address entry_jint_arraycopy,
+                                address entry_oop_arraycopy,
+                                address entry_jlong_arraycopy,
+                                address entry_checkcast_arraycopy) {
     Label L_failed, L_objArray;
 
     // Input registers
@@ -2970,15 +2987,15 @@
 
     BLOCK_COMMENT("choose copy loop based on element size");
     __ cmp(G3_elsize, 0);
-    __ br(Assembler::equal,true,Assembler::pt,StubRoutines::_jbyte_arraycopy);
+    __ br(Assembler::equal, true, Assembler::pt, entry_jbyte_arraycopy);
     __ delayed()->signx(length, count); // length
 
     __ cmp(G3_elsize, LogBytesPerShort);
-    __ br(Assembler::equal,true,Assembler::pt,StubRoutines::_jshort_arraycopy);
+    __ br(Assembler::equal, true, Assembler::pt, entry_jshort_arraycopy);
     __ delayed()->signx(length, count); // length
 
     __ cmp(G3_elsize, LogBytesPerInt);
-    __ br(Assembler::equal,true,Assembler::pt,StubRoutines::_jint_arraycopy);
+    __ br(Assembler::equal, true, Assembler::pt, entry_jint_arraycopy);
     __ delayed()->signx(length, count); // length
 #ifdef ASSERT
     { Label L;
@@ -2989,7 +3006,7 @@
       __ bind(L);
     }
 #endif
-    __ br(Assembler::always,false,Assembler::pt,StubRoutines::_jlong_arraycopy);
+    __ br(Assembler::always, false, Assembler::pt, entry_jlong_arraycopy);
     __ delayed()->signx(length, count); // length
 
     // objArrayKlass
@@ -3013,7 +3030,7 @@
     __ add(src, src_pos, from);       // src_addr
     __ add(dst, dst_pos, to);         // dst_addr
   __ BIND(L_plain_copy);
-    __ br(Assembler::always, false, Assembler::pt,StubRoutines::_oop_arraycopy);
+    __ br(Assembler::always, false, Assembler::pt, entry_oop_arraycopy);
     __ delayed()->signx(length, count); // length
 
   __ BIND(L_checkcast_copy);
@@ -3057,7 +3074,7 @@
       __ ld_ptr(G4_dst_klass, ek_offset, O4);   // dest elem klass
       // lduw(O4, sco_offset, O3);              // sco of elem klass
 
-      __ br(Assembler::always, false, Assembler::pt, checkcast_copy_entry);
+      __ br(Assembler::always, false, Assembler::pt, entry_checkcast_arraycopy);
       __ delayed()->lduw(O4, sco_offset, O3);
     }
 
@@ -3068,39 +3085,124 @@
   }
 
   void generate_arraycopy_stubs() {
-
-    // Note:  the disjoint stubs must be generated first, some of
-    //        the conjoint stubs use them.
-    StubRoutines::_jbyte_disjoint_arraycopy  = generate_disjoint_byte_copy(false, "jbyte_disjoint_arraycopy");
-    StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, "jshort_disjoint_arraycopy");
-    StubRoutines::_jint_disjoint_arraycopy   = generate_disjoint_int_copy(false, "jint_disjoint_arraycopy");
-    StubRoutines::_jlong_disjoint_arraycopy  = generate_disjoint_long_copy(false, "jlong_disjoint_arraycopy");
-    StubRoutines::_oop_disjoint_arraycopy    = generate_disjoint_oop_copy(false, "oop_disjoint_arraycopy");
-    StubRoutines::_arrayof_jbyte_disjoint_arraycopy  = generate_disjoint_byte_copy(true, "arrayof_jbyte_disjoint_arraycopy");
-    StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_short_copy(true, "arrayof_jshort_disjoint_arraycopy");
-    StubRoutines::_arrayof_jint_disjoint_arraycopy   = generate_disjoint_int_copy(true, "arrayof_jint_disjoint_arraycopy");
-    StubRoutines::_arrayof_jlong_disjoint_arraycopy  = generate_disjoint_long_copy(true, "arrayof_jlong_disjoint_arraycopy");
-    StubRoutines::_arrayof_oop_disjoint_arraycopy    =  generate_disjoint_oop_copy(true, "arrayof_oop_disjoint_arraycopy");
-
-    StubRoutines::_jbyte_arraycopy  = generate_conjoint_byte_copy(false, "jbyte_arraycopy");
-    StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(false, "jshort_arraycopy");
-    StubRoutines::_jint_arraycopy   = generate_conjoint_int_copy(false, "jint_arraycopy");
-    StubRoutines::_jlong_arraycopy  = generate_conjoint_long_copy(false, "jlong_arraycopy");
-    StubRoutines::_oop_arraycopy    = generate_conjoint_oop_copy(false, "oop_arraycopy");
-    StubRoutines::_arrayof_jbyte_arraycopy    = generate_conjoint_byte_copy(true, "arrayof_jbyte_arraycopy");
-    StubRoutines::_arrayof_jshort_arraycopy   = generate_conjoint_short_copy(true, "arrayof_jshort_arraycopy");
+    address entry;
+    address entry_jbyte_arraycopy;
+    address entry_jshort_arraycopy;
+    address entry_jint_arraycopy;
+    address entry_oop_arraycopy;
+    address entry_jlong_arraycopy;
+    address entry_checkcast_arraycopy;
+
+    //*** jbyte
+    // Always need aligned and unaligned versions
+    StubRoutines::_jbyte_disjoint_arraycopy         = generate_disjoint_byte_copy(false, &entry,
+                                                                                  "jbyte_disjoint_arraycopy");
+    StubRoutines::_jbyte_arraycopy                  = generate_conjoint_byte_copy(false, entry,
+                                                                                  &entry_jbyte_arraycopy,
+                                                                                  "jbyte_arraycopy");
+    StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(true, &entry,
+                                                                                  "arrayof_jbyte_disjoint_arraycopy");
+    StubRoutines::_arrayof_jbyte_arraycopy          = generate_conjoint_byte_copy(true, entry, NULL,
+                                                                                  "arrayof_jbyte_arraycopy");
+
+    //*** jshort
+    // Always need aligned and unaligned versions
+    StubRoutines::_jshort_disjoint_arraycopy         = generate_disjoint_short_copy(false, &entry,
+                                                                                    "jshort_disjoint_arraycopy");
+    StubRoutines::_jshort_arraycopy                  = generate_conjoint_short_copy(false, entry,
+                                                                                    &entry_jshort_arraycopy,
+                                                                                    "jshort_arraycopy");
+    StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_short_copy(true, &entry,
+                                                                                    "arrayof_jshort_disjoint_arraycopy");
+    StubRoutines::_arrayof_jshort_arraycopy          = generate_conjoint_short_copy(true, entry, NULL,
+                                                                                    "arrayof_jshort_arraycopy");
+
+    //*** jint
+    // Aligned versions
+    StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_disjoint_int_copy(true, &entry,
+                                                                                "arrayof_jint_disjoint_arraycopy");
+    StubRoutines::_arrayof_jint_arraycopy          = generate_conjoint_int_copy(true, entry, &entry_jint_arraycopy,
+                                                                                "arrayof_jint_arraycopy");
 #ifdef _LP64
-    // since sizeof(jint) < sizeof(HeapWord), there's a different flavor:
-    StubRoutines::_arrayof_jint_arraycopy     = generate_conjoint_int_copy(true, "arrayof_jint_arraycopy");
-  #else
-    StubRoutines::_arrayof_jint_arraycopy     = StubRoutines::_jint_arraycopy;
+    // In 64 bit we need both aligned and unaligned versions of jint arraycopy.
+    // entry_jint_arraycopy always points to the unaligned version (notice that we overwrite it).
+    StubRoutines::_jint_disjoint_arraycopy         = generate_disjoint_int_copy(false, &entry,
+                                                                                "jint_disjoint_arraycopy");
+    StubRoutines::_jint_arraycopy                  = generate_conjoint_int_copy(false, entry,
+                                                                                &entry_jint_arraycopy,
+                                                                                "jint_arraycopy");
+#else
+    // In 32 bit jints are always HeapWordSize aligned, so always use the aligned version
+    // (in fact in 32bit we always have a pre-loop part even in the aligned version,
+    //  because it uses 64-bit loads/stores, so the aligned flag is actually ignored).
+    StubRoutines::_jint_disjoint_arraycopy = StubRoutines::_arrayof_jint_disjoint_arraycopy;
+    StubRoutines::_jint_arraycopy          = StubRoutines::_arrayof_jint_arraycopy;
 #endif
-    StubRoutines::_arrayof_jlong_arraycopy    = StubRoutines::_jlong_arraycopy;
-    StubRoutines::_arrayof_oop_arraycopy      = StubRoutines::_oop_arraycopy;
-
-    StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy");
-    StubRoutines::_unsafe_arraycopy    = generate_unsafe_copy("unsafe_arraycopy");
-    StubRoutines::_generic_arraycopy   = generate_generic_copy("generic_arraycopy");
+
+
+    //*** jlong
+    // It is always aligned
+    StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_disjoint_long_copy(true, &entry,
+                                                                                  "arrayof_jlong_disjoint_arraycopy");
+    StubRoutines::_arrayof_jlong_arraycopy          = generate_conjoint_long_copy(true, entry, &entry_jlong_arraycopy,
+                                                                                  "arrayof_jlong_arraycopy");
+    StubRoutines::_jlong_disjoint_arraycopy         = StubRoutines::_arrayof_jlong_disjoint_arraycopy;
+    StubRoutines::_jlong_arraycopy                  = StubRoutines::_arrayof_jlong_arraycopy;
+
+
+    //*** oops
+    // Aligned versions
+    StubRoutines::_arrayof_oop_disjoint_arraycopy        = generate_disjoint_oop_copy(true, &entry,
+                                                                                      "arrayof_oop_disjoint_arraycopy");
+    StubRoutines::_arrayof_oop_arraycopy                 = generate_conjoint_oop_copy(true, entry, &entry_oop_arraycopy,
+                                                                                      "arrayof_oop_arraycopy");
+    // Aligned versions without pre-barriers
+    StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy(true, &entry,
+                                                                                      "arrayof_oop_disjoint_arraycopy_uninit",
+                                                                                      /*dest_uninitialized*/true);
+    StubRoutines::_arrayof_oop_arraycopy_uninit          = generate_conjoint_oop_copy(true, entry, NULL,
+                                                                                      "arrayof_oop_arraycopy_uninit",
+                                                                                      /*dest_uninitialized*/true);
+#ifdef _LP64
+    if (UseCompressedOops) {
+      // With compressed oops we need unaligned versions, notice that we overwrite entry_oop_arraycopy.
+      StubRoutines::_oop_disjoint_arraycopy            = generate_disjoint_oop_copy(false, &entry,
+                                                                                    "oop_disjoint_arraycopy");
+      StubRoutines::_oop_arraycopy                     = generate_conjoint_oop_copy(false, entry, &entry_oop_arraycopy,
+                                                                                    "oop_arraycopy");
+      // Unaligned versions without pre-barriers
+      StubRoutines::_oop_disjoint_arraycopy_uninit     = generate_disjoint_oop_copy(false, &entry,
+                                                                                    "oop_disjoint_arraycopy_uninit",
+                                                                                    /*dest_uninitialized*/true);
+      StubRoutines::_oop_arraycopy_uninit              = generate_conjoint_oop_copy(false, entry, NULL,
+                                                                                    "oop_arraycopy_uninit",
+                                                                                    /*dest_uninitialized*/true);
+    } else
+#endif
+    {
+      // oop arraycopy is always aligned on 32bit and 64bit without compressed oops
+      StubRoutines::_oop_disjoint_arraycopy            = StubRoutines::_arrayof_oop_disjoint_arraycopy;
+      StubRoutines::_oop_arraycopy                     = StubRoutines::_arrayof_oop_arraycopy;
+      StubRoutines::_oop_disjoint_arraycopy_uninit     = StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit;
+      StubRoutines::_oop_arraycopy_uninit              = StubRoutines::_arrayof_oop_arraycopy_uninit;
+    }
+
+    StubRoutines::_checkcast_arraycopy        = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy);
+    StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy("checkcast_arraycopy_uninit", NULL,
+                                                                        /*dest_uninitialized*/true);
+
+    StubRoutines::_unsafe_arraycopy    = generate_unsafe_copy("unsafe_arraycopy",
+                                                              entry_jbyte_arraycopy,
+                                                              entry_jshort_arraycopy,
+                                                              entry_jint_arraycopy,
+                                                              entry_jlong_arraycopy);
+    StubRoutines::_generic_arraycopy   = generate_generic_copy("generic_arraycopy",
+                                                               entry_jbyte_arraycopy,
+                                                               entry_jshort_arraycopy,
+                                                               entry_jint_arraycopy,
+                                                               entry_oop_arraycopy,
+                                                               entry_jlong_arraycopy,
+                                                               entry_checkcast_arraycopy);
 
     StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
     StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
@@ -3224,21 +3326,6 @@
 
 }; // end class declaration
 
-
-address StubGenerator::disjoint_byte_copy_entry  = NULL;
-address StubGenerator::disjoint_short_copy_entry = NULL;
-address StubGenerator::disjoint_int_copy_entry   = NULL;
-address StubGenerator::disjoint_long_copy_entry  = NULL;
-address StubGenerator::disjoint_oop_copy_entry   = NULL;
-
-address StubGenerator::byte_copy_entry  = NULL;
-address StubGenerator::short_copy_entry = NULL;
-address StubGenerator::int_copy_entry   = NULL;
-address StubGenerator::long_copy_entry  = NULL;
-address StubGenerator::oop_copy_entry   = NULL;
-
-address StubGenerator::checkcast_copy_entry = NULL;
-
 void StubGenerator_generate(CodeBuffer* code, bool all) {
   StubGenerator g(code, all);
 }
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -3303,7 +3303,7 @@
   __ sll(Rret, LogBytesPerWord, Rret);
   __ ld_ptr(Rtemp, Rret, Rret);  // get return address
 
-  __ load_heap_oop(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle);
+  __ load_heap_oop(G5_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle);
   __ null_check(G3_method_handle);
 
   // Adjust Rret first so Llast_SP can be same as Rret
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1601,6 +1601,17 @@
   emit_byte(0xC0 | encode);
 }
 
+void Assembler::movdl(XMMRegister dst, Address src) {
+  NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+  InstructionMark im(this);
+  emit_byte(0x66);
+  prefix(src, dst);
+  emit_byte(0x0F);
+  emit_byte(0x6E);
+  emit_operand(dst, src);
+}
+
+
 void Assembler::movdqa(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
@@ -2412,7 +2423,10 @@
 }
 
 void Assembler::psrlq(XMMRegister dst, int shift) {
-  // HMM Table D-1 says sse2 or mmx
+  // Shift 64 bit value logically right by specified number of bits.
+  // HMM Table D-1 says sse2 or mmx.
+  // Do not confuse it with psrldq SSE2 instruction which
+  // shifts 128 bit value in xmm register by number of bytes.
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
 
   int encode = prefixq_and_encode(xmm2->encoding(), dst->encoding());
@@ -2423,6 +2437,18 @@
   emit_byte(shift);
 }
 
+void Assembler::psrldq(XMMRegister dst, int shift) {
+  // Shift 128 bit value in xmm register by number of bytes.
+  NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+
+  int encode = prefixq_and_encode(xmm3->encoding(), dst->encoding());
+  emit_byte(0x66);
+  emit_byte(0x0F);
+  emit_byte(0x73);
+  emit_byte(0xC0 | encode);
+  emit_byte(shift);
+}
+
 void Assembler::ptest(XMMRegister dst, Address src) {
   assert(VM_Version::supports_sse4_1(), "");
 
@@ -7805,7 +7831,7 @@
 void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg,
                                               Register temp_reg,
                                               Label& wrong_method_type) {
-  Address type_addr(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg));
+  Address type_addr(mh_reg, delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg));
   // compare method type against that of the receiver
   if (UseCompressedOops) {
     load_heap_oop(temp_reg, type_addr);
@@ -7825,14 +7851,14 @@
                                                 Register temp_reg) {
   assert_different_registers(vmslots_reg, mh_reg, temp_reg);
   // load mh.type.form.vmslots
-  if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
+  if (java_lang_invoke_MethodHandle::vmslots_offset_in_bytes() != 0) {
     // hoist vmslots into every mh to avoid dependent load chain
-    movl(vmslots_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)));
+    movl(vmslots_reg, Address(mh_reg, delayed_value(java_lang_invoke_MethodHandle::vmslots_offset_in_bytes, temp_reg)));
   } else {
     Register temp2_reg = vmslots_reg;
-    load_heap_oop(temp2_reg, Address(mh_reg,    delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)));
-    load_heap_oop(temp2_reg, Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)));
-    movl(vmslots_reg, Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)));
+    load_heap_oop(temp2_reg, Address(mh_reg,    delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg)));
+    load_heap_oop(temp2_reg, Address(temp2_reg, delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, temp_reg)));
+    movl(vmslots_reg, Address(temp2_reg, delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)));
   }
 }
 
@@ -7847,7 +7873,7 @@
 
   // pick out the interpreted side of the handler
   // NOTE: vmentry is not an oop!
-  movptr(temp_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg)));
+  movptr(temp_reg, Address(mh_reg, delayed_value(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes, temp_reg)));
 
   // off we go...
   jmp(Address(temp_reg, MethodHandleEntry::from_interpreted_entry_offset_in_bytes()));
@@ -8567,101 +8593,418 @@
 }
 #endif // _LP64
 
-// IndexOf substring.
-void MacroAssembler::string_indexof(Register str1, Register str2,
-                                    Register cnt1, Register cnt2, Register result,
-                                    XMMRegister vec, Register tmp) {
+// IndexOf for constant substrings with size >= 8 chars
+// which don't need to be loaded through stack.
+void MacroAssembler::string_indexofC8(Register str1, Register str2,
+                                      Register cnt1, Register cnt2,
+                                      int int_cnt2,  Register result,
+                                      XMMRegister vec, Register tmp) {
   assert(UseSSE42Intrinsics, "SSE4.2 is required");
 
-  Label RELOAD_SUBSTR, PREP_FOR_SCAN, SCAN_TO_SUBSTR,
-        SCAN_SUBSTR, RET_NOT_FOUND, CLEANUP;
-
-  push(str1); // string addr
-  push(str2); // substr addr
-  push(cnt2); // substr count
-  jmpb(PREP_FOR_SCAN);
-
-  // Substr count saved at sp
-  // Substr saved at sp+1*wordSize
-  // String saved at sp+2*wordSize
-
-  // Reload substr for rescan
-  bind(RELOAD_SUBSTR);
-  movl(cnt2, Address(rsp, 0));
-  movptr(str2, Address(rsp, wordSize));
-  // We came here after the beginninig of the substring was
-  // matched but the rest of it was not so we need to search
-  // again. Start from the next element after the previous match.
-  subptr(str1, result); // Restore counter
-  shrl(str1, 1);
-  addl(cnt1, str1);
-  decrementl(cnt1);
-  lea(str1, Address(result, 2)); // Reload string
-
-  // Load substr
-  bind(PREP_FOR_SCAN);
-  movdqu(vec, Address(str2, 0));
-  addl(cnt1, 8);  // prime the loop
-  subptr(str1, 16);
-
-  // Scan string for substr in 16-byte vectors
-  bind(SCAN_TO_SUBSTR);
-  subl(cnt1, 8);
-  addptr(str1, 16);
-
-  // pcmpestri
+  // This method uses pcmpestri inxtruction with bound registers
   //   inputs:
   //     xmm - substring
   //     rax - substring length (elements count)
-  //     mem - scaned string
+  //     mem - scanned string
+  //     rdx - string length (elements count)
+  //     0xd - mode: 1100 (substring search) + 01 (unsigned shorts)
+  //   outputs:
+  //     rcx - matched index in string
+  assert(cnt1 == rdx && cnt2 == rax && tmp == rcx, "pcmpestri");
+
+  Label RELOAD_SUBSTR, SCAN_TO_SUBSTR, SCAN_SUBSTR,
+        RET_FOUND, RET_NOT_FOUND, EXIT, FOUND_SUBSTR,
+        MATCH_SUBSTR_HEAD, RELOAD_STR, FOUND_CANDIDATE;
+
+  // Note, inline_string_indexOf() generates checks:
+  // if (substr.count > string.count) return -1;
+  // if (substr.count == 0) return 0;
+  assert(int_cnt2 >= 8, "this code isused only for cnt2 >= 8 chars");
+
+  // Load substring.
+  movdqu(vec, Address(str2, 0));
+  movl(cnt2, int_cnt2);
+  movptr(result, str1); // string addr
+
+  if (int_cnt2 > 8) {
+    jmpb(SCAN_TO_SUBSTR);
+
+    // Reload substr for rescan, this code
+    // is executed only for large substrings (> 8 chars)
+    bind(RELOAD_SUBSTR);
+    movdqu(vec, Address(str2, 0));
+    negptr(cnt2); // Jumped here with negative cnt2, convert to positive
+
+    bind(RELOAD_STR);
+    // We came here after the beginning of the substring was
+    // matched but the rest of it was not so we need to search
+    // again. Start from the next element after the previous match.
+
+    // cnt2 is number of substring reminding elements and
+    // cnt1 is number of string reminding elements when cmp failed.
+    // Restored cnt1 = cnt1 - cnt2 + int_cnt2
+    subl(cnt1, cnt2);
+    addl(cnt1, int_cnt2);
+    movl(cnt2, int_cnt2); // Now restore cnt2
+
+    decrementl(cnt1);     // Shift to next element
+    cmpl(cnt1, cnt2);
+    jccb(Assembler::negative, RET_NOT_FOUND);  // Left less then substring
+
+    addptr(result, 2);
+
+  } // (int_cnt2 > 8)
+
+  // Scan string for start of substr in 16-byte vectors
+  bind(SCAN_TO_SUBSTR);
+  pcmpestri(vec, Address(result, 0), 0x0d);
+  jccb(Assembler::below, FOUND_CANDIDATE);   // CF == 1
+  subl(cnt1, 8);
+  jccb(Assembler::lessEqual, RET_NOT_FOUND); // Scanned full string
+  cmpl(cnt1, cnt2);
+  jccb(Assembler::negative, RET_NOT_FOUND);  // Left less then substring
+  addptr(result, 16);
+  jmpb(SCAN_TO_SUBSTR);
+
+  // Found a potential substr
+  bind(FOUND_CANDIDATE);
+  // Matched whole vector if first element matched (tmp(rcx) == 0).
+  if (int_cnt2 == 8) {
+    jccb(Assembler::overflow, RET_FOUND);    // OF == 1
+  } else { // int_cnt2 > 8
+    jccb(Assembler::overflow, FOUND_SUBSTR);
+  }
+  // After pcmpestri tmp(rcx) contains matched element index
+  // Compute start addr of substr
+  lea(result, Address(result, tmp, Address::times_2));
+
+  // Make sure string is still long enough
+  subl(cnt1, tmp);
+  cmpl(cnt1, cnt2);
+  if (int_cnt2 == 8) {
+    jccb(Assembler::greaterEqual, SCAN_TO_SUBSTR);
+  } else { // int_cnt2 > 8
+    jccb(Assembler::greaterEqual, MATCH_SUBSTR_HEAD);
+  }
+  // Left less then substring.
+
+  bind(RET_NOT_FOUND);
+  movl(result, -1);
+  jmpb(EXIT);
+
+  if (int_cnt2 > 8) {
+    // This code is optimized for the case when whole substring
+    // is matched if its head is matched.
+    bind(MATCH_SUBSTR_HEAD);
+    pcmpestri(vec, Address(result, 0), 0x0d);
+    // Reload only string if does not match
+    jccb(Assembler::noOverflow, RELOAD_STR); // OF == 0
+
+    Label CONT_SCAN_SUBSTR;
+    // Compare the rest of substring (> 8 chars).
+    bind(FOUND_SUBSTR);
+    // First 8 chars are already matched.
+    negptr(cnt2);
+    addptr(cnt2, 8);
+
+    bind(SCAN_SUBSTR);
+    subl(cnt1, 8);
+    cmpl(cnt2, -8); // Do not read beyond substring
+    jccb(Assembler::lessEqual, CONT_SCAN_SUBSTR);
+    // Back-up strings to avoid reading beyond substring:
+    // cnt1 = cnt1 - cnt2 + 8
+    addl(cnt1, cnt2); // cnt2 is negative
+    addl(cnt1, 8);
+    movl(cnt2, 8); negptr(cnt2);
+    bind(CONT_SCAN_SUBSTR);
+    if (int_cnt2 < (int)G) {
+      movdqu(vec, Address(str2, cnt2, Address::times_2, int_cnt2*2));
+      pcmpestri(vec, Address(result, cnt2, Address::times_2, int_cnt2*2), 0x0d);
+    } else {
+      // calculate index in register to avoid integer overflow (int_cnt2*2)
+      movl(tmp, int_cnt2);
+      addptr(tmp, cnt2);
+      movdqu(vec, Address(str2, tmp, Address::times_2, 0));
+      pcmpestri(vec, Address(result, tmp, Address::times_2, 0), 0x0d);
+    }
+    // Need to reload strings pointers if not matched whole vector
+    jccb(Assembler::noOverflow, RELOAD_SUBSTR); // OF == 0
+    addptr(cnt2, 8);
+    jccb(Assembler::negative, SCAN_SUBSTR);
+    // Fall through if found full substring
+
+  } // (int_cnt2 > 8)
+
+  bind(RET_FOUND);
+  // Found result if we matched full small substring.
+  // Compute substr offset
+  subptr(result, str1);
+  shrl(result, 1); // index
+  bind(EXIT);
+
+} // string_indexofC8
+
+// Small strings are loaded through stack if they cross page boundary.
+void MacroAssembler::string_indexof(Register str1, Register str2,
+                                    Register cnt1, Register cnt2,
+                                    int int_cnt2,  Register result,
+                                    XMMRegister vec, Register tmp) {
+  assert(UseSSE42Intrinsics, "SSE4.2 is required");
+  //
+  // int_cnt2 is length of small (< 8 chars) constant substring
+  // or (-1) for non constant substring in which case its length
+  // is in cnt2 register.
+  //
+  // Note, inline_string_indexOf() generates checks:
+  // if (substr.count > string.count) return -1;
+  // if (substr.count == 0) return 0;
+  //
+  assert(int_cnt2 == -1 || (0 < int_cnt2 && int_cnt2 < 8), "should be != 0");
+
+  // This method uses pcmpestri inxtruction with bound registers
+  //   inputs:
+  //     xmm - substring
+  //     rax - substring length (elements count)
+  //     mem - scanned string
   //     rdx - string length (elements count)
   //     0xd - mode: 1100 (substring search) + 01 (unsigned shorts)
   //   outputs:
   //     rcx - matched index in string
   assert(cnt1 == rdx && cnt2 == rax && tmp == rcx, "pcmpestri");
 
-  pcmpestri(vec, Address(str1, 0), 0x0d);
-  jcc(Assembler::above, SCAN_TO_SUBSTR);      // CF == 0 && ZF == 0
-  jccb(Assembler::aboveEqual, RET_NOT_FOUND); // CF == 0
-
-  // Fallthrough: found a potential substr
+  Label RELOAD_SUBSTR, SCAN_TO_SUBSTR, SCAN_SUBSTR, ADJUST_STR,
+        RET_FOUND, RET_NOT_FOUND, CLEANUP, FOUND_SUBSTR,
+        FOUND_CANDIDATE;
+
+  { //========================================================
+    // We don't know where these strings are located
+    // and we can't read beyond them. Load them through stack.
+    Label BIG_STRINGS, CHECK_STR, COPY_SUBSTR, COPY_STR;
+
+    movptr(tmp, rsp); // save old SP
+
+    if (int_cnt2 > 0) {     // small (< 8 chars) constant substring
+      if (int_cnt2 == 1) {  // One char
+        load_unsigned_short(result, Address(str2, 0));
+        movdl(vec, result); // move 32 bits
+      } else if (int_cnt2 == 2) { // Two chars
+        movdl(vec, Address(str2, 0)); // move 32 bits
+      } else if (int_cnt2 == 4) { // Four chars
+        movq(vec, Address(str2, 0));  // move 64 bits
+      } else { // cnt2 = { 3, 5, 6, 7 }
+        // Array header size is 12 bytes in 32-bit VM
+        // + 6 bytes for 3 chars == 18 bytes,
+        // enough space to load vec and shift.
+        assert(HeapWordSize*typeArrayKlass::header_size() >= 12,"sanity");
+        movdqu(vec, Address(str2, (int_cnt2*2)-16));
+        psrldq(vec, 16-(int_cnt2*2));
+      }
+    } else { // not constant substring
+      cmpl(cnt2, 8);
+      jccb(Assembler::aboveEqual, BIG_STRINGS); // Both strings are big enough
+
+      // We can read beyond string if srt+16 does not cross page boundary
+      // since heaps are aligned and mapped by pages.
+      assert(os::vm_page_size() < (int)G, "default page should be small");
+      movl(result, str2); // We need only low 32 bits
+      andl(result, (os::vm_page_size()-1));
+      cmpl(result, (os::vm_page_size()-16));
+      jccb(Assembler::belowEqual, CHECK_STR);
+
+      // Move small strings to stack to allow load 16 bytes into vec.
+      subptr(rsp, 16);
+      int stk_offset = wordSize-2;
+      push(cnt2);
+
+      bind(COPY_SUBSTR);
+      load_unsigned_short(result, Address(str2, cnt2, Address::times_2, -2));
+      movw(Address(rsp, cnt2, Address::times_2, stk_offset), result);
+      decrement(cnt2);
+      jccb(Assembler::notZero, COPY_SUBSTR);
+
+      pop(cnt2);
+      movptr(str2, rsp);  // New substring address
+    } // non constant
+
+    bind(CHECK_STR);
+    cmpl(cnt1, 8);
+    jccb(Assembler::aboveEqual, BIG_STRINGS);
+
+    // Check cross page boundary.
+    movl(result, str1); // We need only low 32 bits
+    andl(result, (os::vm_page_size()-1));
+    cmpl(result, (os::vm_page_size()-16));
+    jccb(Assembler::belowEqual, BIG_STRINGS);
+
+    subptr(rsp, 16);
+    int stk_offset = -2;
+    if (int_cnt2 < 0) { // not constant
+      push(cnt2);
+      stk_offset += wordSize;
+    }
+    movl(cnt2, cnt1);
+
+    bind(COPY_STR);
+    load_unsigned_short(result, Address(str1, cnt2, Address::times_2, -2));
+    movw(Address(rsp, cnt2, Address::times_2, stk_offset), result);
+    decrement(cnt2);
+    jccb(Assembler::notZero, COPY_STR);
+
+    if (int_cnt2 < 0) { // not constant
+      pop(cnt2);
+    }
+    movptr(str1, rsp);  // New string address
+
+    bind(BIG_STRINGS);
+    // Load substring.
+    if (int_cnt2 < 0) { // -1
+      movdqu(vec, Address(str2, 0));
+      push(cnt2);       // substr count
+      push(str2);       // substr addr
+      push(str1);       // string addr
+    } else {
+      // Small (< 8 chars) constant substrings are loaded already.
+      movl(cnt2, int_cnt2);
+    }
+    push(tmp);  // original SP
+
+  } // Finished loading
+
+  //========================================================
+  // Start search
+  //
+
+  movptr(result, str1); // string addr
+
+  if (int_cnt2  < 0) {  // Only for non constant substring
+    jmpb(SCAN_TO_SUBSTR);
+
+    // SP saved at sp+0
+    // String saved at sp+1*wordSize
+    // Substr saved at sp+2*wordSize
+    // Substr count saved at sp+3*wordSize
+
+    // Reload substr for rescan, this code
+    // is executed only for large substrings (> 8 chars)
+    bind(RELOAD_SUBSTR);
+    movptr(str2, Address(rsp, 2*wordSize));
+    movl(cnt2, Address(rsp, 3*wordSize));
+    movdqu(vec, Address(str2, 0));
+    // We came here after the beginning of the substring was
+    // matched but the rest of it was not so we need to search
+    // again. Start from the next element after the previous match.
+    subptr(str1, result); // Restore counter
+    shrl(str1, 1);
+    addl(cnt1, str1);
+    decrementl(cnt1);   // Shift to next element
+    cmpl(cnt1, cnt2);
+    jccb(Assembler::negative, RET_NOT_FOUND);  // Left less then substring
+
+    addptr(result, 2);
+  } // non constant
+
+  // Scan string for start of substr in 16-byte vectors
+  bind(SCAN_TO_SUBSTR);
+  assert(cnt1 == rdx && cnt2 == rax && tmp == rcx, "pcmpestri");
+  pcmpestri(vec, Address(result, 0), 0x0d);
+  jccb(Assembler::below, FOUND_CANDIDATE);   // CF == 1
+  subl(cnt1, 8);
+  jccb(Assembler::lessEqual, RET_NOT_FOUND); // Scanned full string
+  cmpl(cnt1, cnt2);
+  jccb(Assembler::negative, RET_NOT_FOUND);  // Left less then substring
+  addptr(result, 16);
+
+  bind(ADJUST_STR);
+  cmpl(cnt1, 8); // Do not read beyond string
+  jccb(Assembler::greaterEqual, SCAN_TO_SUBSTR);
+  // Back-up string to avoid reading beyond string.
+  lea(result, Address(result, cnt1, Address::times_2, -16));
+  movl(cnt1, 8);
+  jmpb(SCAN_TO_SUBSTR);
+
+  // Found a potential substr
+  bind(FOUND_CANDIDATE);
+  // After pcmpestri tmp(rcx) contains matched element index
 
   // Make sure string is still long enough
   subl(cnt1, tmp);
   cmpl(cnt1, cnt2);
-  jccb(Assembler::negative, RET_NOT_FOUND);
-  // Compute start addr of substr
-  lea(str1, Address(str1, tmp, Address::times_2));
-  movptr(result, str1); // save
-
-  // Compare potential substr
-  addl(cnt1, 8);     // prime the loop
-  addl(cnt2, 8);
-  subptr(str1, 16);
-  subptr(str2, 16);
-
-  // Scan 16-byte vectors of string and substr
-  bind(SCAN_SUBSTR);
-  subl(cnt1, 8);
-  subl(cnt2, 8);
-  addptr(str1, 16);
-  addptr(str2, 16);
-  movdqu(vec, Address(str2, 0));
-  pcmpestri(vec, Address(str1, 0), 0x0d);
-  jcc(Assembler::noOverflow, RELOAD_SUBSTR); // OF == 0
-  jcc(Assembler::positive, SCAN_SUBSTR);     // SF == 0
-
-  // Compute substr offset
-  subptr(result, Address(rsp, 2*wordSize));
-  shrl(result, 1); // index
-  jmpb(CLEANUP);
+  jccb(Assembler::greaterEqual, FOUND_SUBSTR);
+  // Left less then substring.
 
   bind(RET_NOT_FOUND);
   movl(result, -1);
+  jmpb(CLEANUP);
+
+  bind(FOUND_SUBSTR);
+  // Compute start addr of substr
+  lea(result, Address(result, tmp, Address::times_2));
+
+  if (int_cnt2 > 0) { // Constant substring
+    // Repeat search for small substring (< 8 chars)
+    // from new point without reloading substring.
+    // Have to check that we don't read beyond string.
+    cmpl(tmp, 8-int_cnt2);
+    jccb(Assembler::greater, ADJUST_STR);
+    // Fall through if matched whole substring.
+  } else { // non constant
+    assert(int_cnt2 == -1, "should be != 0");
+
+    addl(tmp, cnt2);
+    // Found result if we matched whole substring.
+    cmpl(tmp, 8);
+    jccb(Assembler::lessEqual, RET_FOUND);
+
+    // Repeat search for small substring (<= 8 chars)
+    // from new point 'str1' without reloading substring.
+    cmpl(cnt2, 8);
+    // Have to check that we don't read beyond string.
+    jccb(Assembler::lessEqual, ADJUST_STR);
+
+    Label CHECK_NEXT, CONT_SCAN_SUBSTR, RET_FOUND_LONG;
+    // Compare the rest of substring (> 8 chars).
+    movptr(str1, result);
+
+    cmpl(tmp, cnt2);
+    // First 8 chars are already matched.
+    jccb(Assembler::equal, CHECK_NEXT);
+
+    bind(SCAN_SUBSTR);
+    pcmpestri(vec, Address(str1, 0), 0x0d);
+    // Need to reload strings pointers if not matched whole vector
+    jcc(Assembler::noOverflow, RELOAD_SUBSTR); // OF == 0
+
+    bind(CHECK_NEXT);
+    subl(cnt2, 8);
+    jccb(Assembler::lessEqual, RET_FOUND_LONG); // Found full substring
+    addptr(str1, 16);
+    addptr(str2, 16);
+    subl(cnt1, 8);
+    cmpl(cnt2, 8); // Do not read beyond substring
+    jccb(Assembler::greaterEqual, CONT_SCAN_SUBSTR);
+    // Back-up strings to avoid reading beyond substring.
+    lea(str2, Address(str2, cnt2, Address::times_2, -16));
+    lea(str1, Address(str1, cnt2, Address::times_2, -16));
+    subl(cnt1, cnt2);
+    movl(cnt2, 8);
+    addl(cnt1, 8);
+    bind(CONT_SCAN_SUBSTR);
+    movdqu(vec, Address(str2, 0));
+    jmpb(SCAN_SUBSTR);
+
+    bind(RET_FOUND_LONG);
+    movptr(str1, Address(rsp, wordSize));
+  } // non constant
+
+  bind(RET_FOUND);
+  // Compute substr offset
+  subptr(result, str1);
+  shrl(result, 1); // index
 
   bind(CLEANUP);
-  addptr(rsp, 3*wordSize);
-}
+  pop(rsp); // restore SP
+
+} // string_indexof
 
 // Compare strings.
 void MacroAssembler::string_compare(Register str1, Register str2,
--- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1121,6 +1121,7 @@
 
   void movdl(XMMRegister dst, Register src);
   void movdl(Register dst, XMMRegister src);
+  void movdl(XMMRegister dst, Address src);
 
   // Move Double Quadword
   void movdq(XMMRegister dst, Register src);
@@ -1288,9 +1289,12 @@
   void pshuflw(XMMRegister dst, XMMRegister src, int mode);
   void pshuflw(XMMRegister dst, Address src,     int mode);
 
-  // Shift Right Logical Quadword Immediate
+  // Shift Right by bits Logical Quadword Immediate
   void psrlq(XMMRegister dst, int shift);
 
+  // Shift Right by bytes Logical DoubleQuadword Immediate
+  void psrldq(XMMRegister dst, int shift);
+
   // Logical Compare Double Quadword
   void ptest(XMMRegister dst, XMMRegister src);
   void ptest(XMMRegister dst, Address src);
@@ -2290,10 +2294,22 @@
   void movl2ptr(Register dst, Register src) { LP64_ONLY(movslq(dst, src)) NOT_LP64(if (dst != src) movl(dst, src)); }
 
   // IndexOf strings.
+  // Small strings are loaded through stack if they cross page boundary.
   void string_indexof(Register str1, Register str2,
-                      Register cnt1, Register cnt2, Register result,
+                      Register cnt1, Register cnt2,
+                      int int_cnt2,  Register result,
                       XMMRegister vec, Register tmp);
 
+  // IndexOf for constant substrings with size >= 8 elements
+  // which don't need to be loaded through stack.
+  void string_indexofC8(Register str1, Register str2,
+                      Register cnt1, Register cnt2,
+                      int int_cnt2,  Register result,
+                      XMMRegister vec, Register tmp);
+
+    // Smallest code: we don't need to load through stack,
+    // check string tail.
+
   // Compare strings.
   void string_compare(Register str1, Register str2,
                       Register cnt1, Register cnt2, Register result,
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -456,10 +456,8 @@
   __ verify_not_null_oop(rax);
 
   // search an exception handler (rax: exception oop, rdx: throwing pc)
-  __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id)));
-
-  __ stop("should not reach here");
-
+  __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id)));
+  __ should_not_reach_here();
   assert(code_offset() - offset <= exception_handler_size, "overflow");
   __ end_a_stub();
 
--- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -248,11 +248,14 @@
 #ifdef _LP64
   align_dummy_0, align_dummy_1,
 #endif // _LP64
-  dummy1, SLOT2(dummy1H)                                                                    // 0, 4
-  dummy2, SLOT2(dummy2H)                                                                    // 8, 12
-  // Two temps to be used as needed by users of save/restore callee registers
-  temp_2_off, SLOT2(temp_2H_off)                                                            // 16, 20
-  temp_1_off, SLOT2(temp_1H_off)                                                            // 24, 28
+#ifdef _WIN64
+  // Windows always allocates space for it's argument registers (see
+  // frame::arg_reg_save_area_bytes).
+  arg_reg_save_1, arg_reg_save_1H,                                                          // 0, 4
+  arg_reg_save_2, arg_reg_save_2H,                                                          // 8, 12
+  arg_reg_save_3, arg_reg_save_3H,                                                          // 16, 20
+  arg_reg_save_4, arg_reg_save_4H,                                                          // 24, 28
+#endif // _WIN64
   xmm_regs_as_doubles_off,                                                                  // 32
   float_regs_as_doubles_off = xmm_regs_as_doubles_off + xmm_regs_as_doubles_size_in_slots,  // 160
   fpu_state_off = float_regs_as_doubles_off + float_regs_as_doubles_size_in_slots,          // 224
@@ -282,24 +285,7 @@
   rax_off, SLOT2(raxH_off)                                                                  // 480, 484
   saved_rbp_off, SLOT2(saved_rbpH_off)                                                      // 488, 492
   return_off, SLOT2(returnH_off)                                                            // 496, 500
-  reg_save_frame_size,  // As noted: neglects any parameters to runtime                     // 504
-
-#ifdef _WIN64
-  c_rarg0_off = rcx_off,
-#else
-  c_rarg0_off = rdi_off,
-#endif // WIN64
-
-  // equates
-
-  // illegal instruction handler
-  continue_dest_off = temp_1_off,
-
-  // deoptimization equates
-  fp0_off = float_regs_as_doubles_off, // slot for java float/double return value
-  xmm0_off = xmm_regs_as_doubles_off,  // slot for java float/double return value
-  deopt_type = temp_2_off,             // slot for type of deopt in progress
-  ret_type = temp_1_off                // slot for return type
+  reg_save_frame_size   // As noted: neglects any parameters to runtime                     // 504
 };
 
 
@@ -405,11 +391,6 @@
                                    bool save_fpu_registers = true) {
   __ block_comment("save_live_registers");
 
-  // 64bit passes the args in regs to the c++ runtime
-  int frame_size_in_slots = reg_save_frame_size NOT_LP64(+ num_rt_args); // args + thread
-  // frame_size = round_to(frame_size, 4);
-  sasm->set_frame_size(frame_size_in_slots / VMRegImpl::slots_per_word );
-
   __ pusha();         // integer registers
 
   // assert(float_regs_as_doubles_off % 2 == 0, "misaligned offset");
@@ -642,19 +623,58 @@
 }
 
 
-void Runtime1::generate_handle_exception(StubAssembler *sasm, OopMapSet* oop_maps, OopMap* oop_map, bool save_fpu_registers) {
+OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) {
+  __ block_comment("generate_handle_exception");
+
   // incoming parameters
   const Register exception_oop = rax;
-  const Register exception_pc = rdx;
+  const Register exception_pc  = rdx;
   // other registers used in this stub
-  const Register real_return_addr = rbx;
   const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread);
 
-  __ block_comment("generate_handle_exception");
+  // Save registers, if required.
+  OopMapSet* oop_maps = new OopMapSet();
+  OopMap* oop_map = NULL;
+  switch (id) {
+  case forward_exception_id:
+    // We're handling an exception in the context of a compiled frame.
+    // The registers have been saved in the standard places.  Perform
+    // an exception lookup in the caller and dispatch to the handler
+    // if found.  Otherwise unwind and dispatch to the callers
+    // exception handler.
+    oop_map = generate_oop_map(sasm, 1 /*thread*/);
+
+    // load and clear pending exception oop into RAX
+    __ movptr(exception_oop, Address(thread, Thread::pending_exception_offset()));
+    __ movptr(Address(thread, Thread::pending_exception_offset()), NULL_WORD);
+
+    // load issuing PC (the return address for this stub) into rdx
+    __ movptr(exception_pc, Address(rbp, 1*BytesPerWord));
+
+    // make sure that the vm_results are cleared (may be unnecessary)
+    __ movptr(Address(thread, JavaThread::vm_result_offset()),   NULL_WORD);
+    __ movptr(Address(thread, JavaThread::vm_result_2_offset()), NULL_WORD);
+    break;
+  case handle_exception_nofpu_id:
+  case handle_exception_id:
+    // At this point all registers MAY be live.
+    oop_map = save_live_registers(sasm, 1 /*thread*/, id == handle_exception_nofpu_id);
+    break;
+  case handle_exception_from_callee_id: {
+    // At this point all registers except exception oop (RAX) and
+    // exception pc (RDX) are dead.
+    const int frame_size = 2 /*BP, return address*/ NOT_LP64(+ 1 /*thread*/) WIN64_ONLY(+ frame::arg_reg_save_area_bytes / BytesPerWord);
+    oop_map = new OopMap(frame_size * VMRegImpl::slots_per_word, 0);
+    sasm->set_frame_size(frame_size);
+    WIN64_ONLY(__ subq(rsp, frame::arg_reg_save_area_bytes));
+    break;
+  }
+  default:  ShouldNotReachHere();
+  }
 
 #ifdef TIERED
   // C2 can leave the fpu stack dirty
-  if (UseSSE < 2 ) {
+  if (UseSSE < 2) {
     __ empty_FPU_stack();
   }
 #endif // TIERED
@@ -686,11 +706,7 @@
   // save exception oop and issuing pc into JavaThread
   // (exception handler will load it from here)
   __ movptr(Address(thread, JavaThread::exception_oop_offset()), exception_oop);
-  __ movptr(Address(thread, JavaThread::exception_pc_offset()), exception_pc);
-
-  // save real return address (pc that called this stub)
-  __ movptr(real_return_addr, Address(rbp, 1*BytesPerWord));
-  __ movptr(Address(rsp, temp_1_off * VMRegImpl::stack_slot_size), real_return_addr);
+  __ movptr(Address(thread, JavaThread::exception_pc_offset()),  exception_pc);
 
   // patch throwing pc into return address (has bci & oop map)
   __ movptr(Address(rbp, 1*BytesPerWord), exception_pc);
@@ -700,33 +716,41 @@
   int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, exception_handler_for_pc));
   oop_maps->add_gc_map(call_offset, oop_map);
 
-  // rax,: handler address
+  // rax: handler address
   //      will be the deopt blob if nmethod was deoptimized while we looked up
   //      handler regardless of whether handler existed in the nmethod.
 
   // only rax, is valid at this time, all other registers have been destroyed by the runtime call
   __ invalidate_registers(false, true, true, true, true, true);
 
-#ifdef ASSERT
-  // Do we have an exception handler in the nmethod?
-  Label done;
-  __ testptr(rax, rax);
-  __ jcc(Assembler::notZero, done);
-  __ stop("no handler found");
-  __ bind(done);
-#endif
-
-  // exception handler found
-  // patch the return address -> the stub will directly return to the exception handler
+  // patch the return address, this stub will directly return to the exception handler
   __ movptr(Address(rbp, 1*BytesPerWord), rax);
 
-  // restore registers
-  restore_live_registers(sasm, save_fpu_registers);
+  switch (id) {
+  case forward_exception_id:
+  case handle_exception_nofpu_id:
+  case handle_exception_id:
+    // Restore the registers that were saved at the beginning.
+    restore_live_registers(sasm, id == handle_exception_nofpu_id);
+    break;
+  case handle_exception_from_callee_id:
+    // WIN64_ONLY: No need to add frame::arg_reg_save_area_bytes to SP
+    // since we do a leave anyway.
 
-  // return to exception handler
-  __ leave();
-  __ ret(0);
+    // Pop the return address since we are possibly changing SP (restoring from BP).
+    __ leave();
+    __ pop(rcx);
 
+    // Restore SP from BP if the exception PC is a method handle call site.
+    NOT_LP64(__ get_thread(thread);)
+    __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0);
+    __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
+    __ jmp(rcx);  // jump to exception handler
+    break;
+  default:  ShouldNotReachHere();
+  }
+
+  return oop_maps;
 }
 
 
@@ -791,7 +815,7 @@
   // the pop is also necessary to simulate the effect of a ret(0)
   __ pop(exception_pc);
 
-  // Restore SP from BP if the exception PC is a MethodHandle call site.
+  // Restore SP from BP if the exception PC is a method handle call site.
   NOT_LP64(__ get_thread(thread);)
   __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0);
   __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
@@ -934,7 +958,6 @@
   __ ret(0);
 
   return oop_maps;
-
 }
 
 
@@ -952,35 +975,9 @@
   switch (id) {
     case forward_exception_id:
       {
-        // we're handling an exception in the context of a compiled
-        // frame.  The registers have been saved in the standard
-        // places.  Perform an exception lookup in the caller and
-        // dispatch to the handler if found.  Otherwise unwind and
-        // dispatch to the callers exception handler.
-
-        const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread);
-        const Register exception_oop = rax;
-        const Register exception_pc = rdx;
-
-        // load pending exception oop into rax,
-        __ movptr(exception_oop, Address(thread, Thread::pending_exception_offset()));
-        // clear pending exception
-        __ movptr(Address(thread, Thread::pending_exception_offset()), NULL_WORD);
-
-        // load issuing PC (the return address for this stub) into rdx
-        __ movptr(exception_pc, Address(rbp, 1*BytesPerWord));
-
-        // make sure that the vm_results are cleared (may be unnecessary)
-        __ movptr(Address(thread, JavaThread::vm_result_offset()), NULL_WORD);
-        __ movptr(Address(thread, JavaThread::vm_result_2_offset()), NULL_WORD);
-
-        // verify that that there is really a valid exception in rax,
-        __ verify_not_null_oop(exception_oop);
-
-        oop_maps = new OopMapSet();
-        OopMap* oop_map = generate_oop_map(sasm, 1);
-        generate_handle_exception(sasm, oop_maps, oop_map);
-        __ stop("should not reach here");
+        oop_maps = generate_handle_exception(id, sasm);
+        __ leave();
+        __ ret(0);
       }
       break;
 
@@ -1315,13 +1312,15 @@
       break;
 
     case handle_exception_nofpu_id:
-      save_fpu_registers = false;
-      // fall through
     case handle_exception_id:
       { StubFrame f(sasm, "handle_exception", dont_gc_arguments);
-        oop_maps = new OopMapSet();
-        OopMap* oop_map = save_live_registers(sasm, 1, save_fpu_registers);
-        generate_handle_exception(sasm, oop_maps, oop_map, save_fpu_registers);
+        oop_maps = generate_handle_exception(id, sasm);
+      }
+      break;
+
+    case handle_exception_from_callee_id:
+      { StubFrame f(sasm, "handle_exception_from_callee", dont_gc_arguments);
+        oop_maps = generate_handle_exception(id, sasm);
       }
       break;
 
--- a/hotspot/src/cpu/x86/vm/globals_x86.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,4 +72,6 @@
 
 define_pd_global(bool, UseMembar,            false);
 
+// GC Ergo Flags
+define_pd_global(intx, CMSYoungGenPerWorker, 64*M);  // default max size of CMS young gen, per GC worker thread
 #endif // CPU_X86_VM_GLOBALS_X86_HPP
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -231,7 +231,7 @@
 
 
 // Method handle invoker
-// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
+// Dispatch a method of the form java.lang.invoke.MethodHandles::invoke(...)
 address InterpreterGenerator::generate_method_handle_entry(void) {
   if (!EnableMethodHandles) {
     return generate_abstract_entry();
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -318,7 +318,7 @@
 
 
 // Method handle invoker
-// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
+// Dispatch a method of the form java.lang.invoke.MethodHandles::invoke(...)
 address InterpreterGenerator::generate_method_handle_entry(void) {
   if (!EnableMethodHandles) {
     return generate_abstract_entry();
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -125,9 +125,9 @@
   }
 
   // given the MethodType, find out where the MH argument is buried
-  __ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp)));
+  __ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, rdi_temp)));
   Register rdx_vmslots = rdx_temp;
-  __ movl(rdx_vmslots, Address(rdx_temp, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, rdi_temp)));
+  __ movl(rdx_vmslots, Address(rdx_temp, __ delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, rdi_temp)));
   __ movptr(rcx_recv, __ argument_address(rdx_vmslots));
 
   trace_method_handle(_masm, "invokeExact");
@@ -154,11 +154,11 @@
                    rcx_argslot, rbx_temp, rdx_temp);
 
   // load up an adapter from the calling type (Java weaves this)
-  __ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp)));
+  __ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, rdi_temp)));
   Register rdx_adapter = rdx_temp;
-  // __ load_heap_oop(rdx_adapter, Address(rdx_temp, java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes()));
+  // __ load_heap_oop(rdx_adapter, Address(rdx_temp, java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes()));
   // deal with old JDK versions:
-  __ lea(rdi_temp, Address(rdx_temp, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, rdi_temp)));
+  __ lea(rdi_temp, Address(rdx_temp, __ delayed_value(java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes, rdi_temp)));
   __ cmpptr(rdi_temp, rdx_temp);
   Label sorry_no_invoke_generic;
   __ jcc(Assembler::below, sorry_no_invoke_generic);
@@ -371,16 +371,16 @@
 
 // which conversion op types are implemented here?
 int MethodHandles::adapter_conversion_ops_supported_mask() {
-  return ((1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_CHECK_CAST)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_ROT_ARGS)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_DUP_ARGS)
-         |(1<<sun_dyn_AdapterMethodHandle::OP_DROP_ARGS)
-         //|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
+  return ((1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS)
+         |(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS)
+         //|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
          );
   // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
 }
@@ -415,20 +415,21 @@
   const Register rarg2_required = LP64_ONLY(j_rarg2) NOT_LP64(rdi);
   assert_different_registers(rarg0_code, rarg1_actual, rarg2_required, saved_last_sp);
 
-  guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
+  guarantee(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
 
   // some handy addresses
   Address rbx_method_fie(     rbx,      methodOopDesc::from_interpreted_offset() );
+  Address rbx_method_fce(     rbx,      methodOopDesc::from_compiled_offset() );
 
-  Address rcx_mh_vmtarget(    rcx_recv, java_dyn_MethodHandle::vmtarget_offset_in_bytes() );
-  Address rcx_dmh_vmindex(    rcx_recv, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes() );
+  Address rcx_mh_vmtarget(    rcx_recv, java_lang_invoke_MethodHandle::vmtarget_offset_in_bytes() );
+  Address rcx_dmh_vmindex(    rcx_recv, java_lang_invoke_DirectMethodHandle::vmindex_offset_in_bytes() );
 
-  Address rcx_bmh_vmargslot(  rcx_recv, sun_dyn_BoundMethodHandle::vmargslot_offset_in_bytes() );
-  Address rcx_bmh_argument(   rcx_recv, sun_dyn_BoundMethodHandle::argument_offset_in_bytes() );
+  Address rcx_bmh_vmargslot(  rcx_recv, java_lang_invoke_BoundMethodHandle::vmargslot_offset_in_bytes() );
+  Address rcx_bmh_argument(   rcx_recv, java_lang_invoke_BoundMethodHandle::argument_offset_in_bytes() );
 
-  Address rcx_amh_vmargslot(  rcx_recv, sun_dyn_AdapterMethodHandle::vmargslot_offset_in_bytes() );
-  Address rcx_amh_argument(   rcx_recv, sun_dyn_AdapterMethodHandle::argument_offset_in_bytes() );
-  Address rcx_amh_conversion( rcx_recv, sun_dyn_AdapterMethodHandle::conversion_offset_in_bytes() );
+  Address rcx_amh_vmargslot(  rcx_recv, java_lang_invoke_AdapterMethodHandle::vmargslot_offset_in_bytes() );
+  Address rcx_amh_argument(   rcx_recv, java_lang_invoke_AdapterMethodHandle::argument_offset_in_bytes() );
+  Address rcx_amh_conversion( rcx_recv, java_lang_invoke_AdapterMethodHandle::conversion_offset_in_bytes() );
   Address vmarg;                // __ argument_address(vmargslot)
 
   const int java_mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
@@ -448,12 +449,10 @@
   case _raise_exception:
     {
       // Not a real MH entry, but rather shared code for raising an
-      // exception.  Since we use a C2I adapter to set up the
-      // interpreter state, arguments are expected in compiler
-      // argument registers.
+      // exception.  Since we use the compiled entry, arguments are
+      // expected in compiler argument registers.
       assert(raise_exception_method(), "must be set");
-      address c2i_entry = raise_exception_method()->get_c2i_entry();
-      assert(c2i_entry, "method must be linked");
+      assert(raise_exception_method()->from_compiled_entry(), "method must be linked");
 
       const Register rdi_pc = rax;
       __ pop(rdi_pc);  // caller PC
@@ -461,7 +460,7 @@
 
       Register rbx_method = rbx_temp;
       Label L_no_method;
-      // FIXME: fill in _raise_exception_method with a suitable sun.dyn method
+      // FIXME: fill in _raise_exception_method with a suitable java.lang.invoke method
       __ movptr(rbx_method, ExternalAddress((address) &_raise_exception_method));
       __ testptr(rbx_method, rbx_method);
       __ jccb(Assembler::zero, L_no_method);
@@ -472,13 +471,10 @@
       __ jccb(Assembler::zero, L_no_method);
       __ verify_oop(rbx_method);
 
-      // 32-bit: push remaining arguments as if coming from the compiler.
       NOT_LP64(__ push(rarg2_required));
+      __ push(rdi_pc);         // restore caller PC
+      __ jmp(rbx_method_fce);  // jump to compiled entry
 
-      __ push(rdi_pc);  // restore caller PC
-      __ jump(ExternalAddress(c2i_entry));  // do C2I transition
-
-      // If we get here, the Java runtime did not do its job of creating the exception.
       // Do something that is at least causes a valid throw from the interpreter.
       __ bind(L_no_method);
       __ push(rarg2_required);
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -439,10 +439,6 @@
     // Verify that there is really a valid exception in RAX.
     __ verify_oop(exception_oop);
 
-    // Restore SP from BP if the exception PC is a MethodHandle call site.
-    __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0);
-    __ cmovptr(Assembler::notEqual, rsp, rbp);
-
     // continue at exception handler (return address removed)
     // rax: exception
     // rbx: exception handler
@@ -733,18 +729,19 @@
   //  Input:
   //     start   -  starting address
   //     count   -  element count
-  void  gen_write_ref_array_pre_barrier(Register start, Register count) {
+  void  gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
     assert_different_registers(start, count);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
       case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
-        {
-          __ pusha();                      // push registers
-          __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre),
-                          start, count);
-          __ popa();
-        }
+        // With G1, don't generate the call if we statically know that the target in uninitialized
+        if (!uninitialized_target) {
+           __ pusha();                      // push registers
+           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre),
+                           start, count);
+           __ popa();
+         }
         break;
       case BarrierSet::CardTableModRef:
       case BarrierSet::CardTableExtension:
@@ -923,7 +920,8 @@
 
   address generate_disjoint_copy(BasicType t, bool aligned,
                                  Address::ScaleFactor sf,
-                                 address* entry, const char *name) {
+                                 address* entry, const char *name,
+                                 bool dest_uninitialized = false) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -945,16 +943,19 @@
     __ movptr(from , Address(rsp, 12+ 4));
     __ movptr(to   , Address(rsp, 12+ 8));
     __ movl(count, Address(rsp, 12+ 12));
+
+    if (entry != NULL) {
+      *entry = __ pc(); // Entry point from conjoint arraycopy stub.
+      BLOCK_COMMENT("Entry:");
+    }
+
     if (t == T_OBJECT) {
       __ testl(count, count);
       __ jcc(Assembler::zero, L_0_count);
-      gen_write_ref_array_pre_barrier(to, count);
+      gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
       __ mov(saved_to, to);          // save 'to'
     }
 
-    *entry = __ pc(); // Entry point from conjoint arraycopy stub.
-    BLOCK_COMMENT("Entry:");
-
     __ subptr(to, from); // to --> to_from
     __ cmpl(count, 2<<shift); // Short arrays (< 8 bytes) copy by element
     __ jcc(Assembler::below, L_copy_4_bytes); // use unsigned cmp
@@ -1085,7 +1086,8 @@
   address generate_conjoint_copy(BasicType t, bool aligned,
                                  Address::ScaleFactor sf,
                                  address nooverlap_target,
-                                 address* entry, const char *name) {
+                                 address* entry, const char *name,
+                                 bool dest_uninitialized = false) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1108,23 +1110,17 @@
     __ movptr(src  , Address(rsp, 12+ 4));   // from
     __ movptr(dst  , Address(rsp, 12+ 8));   // to
     __ movl2ptr(count, Address(rsp, 12+12)); // count
-    if (t == T_OBJECT) {
-       gen_write_ref_array_pre_barrier(dst, count);
-    }
 
     if (entry != NULL) {
       *entry = __ pc(); // Entry point from generic arraycopy stub.
       BLOCK_COMMENT("Entry:");
     }
 
-    if (t == T_OBJECT) {
-      __ testl(count, count);
-      __ jcc(Assembler::zero, L_0_count);
-    }
+    // nooverlap_target expects arguments in rsi and rdi.
     __ mov(from, src);
     __ mov(to  , dst);
 
-    // arrays overlap test
+    // arrays overlap test: dispatch to disjoint stub if necessary.
     RuntimeAddress nooverlap(nooverlap_target);
     __ cmpptr(dst, src);
     __ lea(end, Address(src, count, sf, 0)); // src + count * elem_size
@@ -1132,6 +1128,12 @@
     __ cmpptr(dst, end);
     __ jump_cc(Assembler::aboveEqual, nooverlap);
 
+    if (t == T_OBJECT) {
+      __ testl(count, count);
+      __ jcc(Assembler::zero, L_0_count);
+      gen_write_ref_array_pre_barrier(dst, count, dest_uninitialized);
+    }
+
     // copy from high to low
     __ cmpl(count, 2<<shift); // Short arrays (< 8 bytes) copy by element
     __ jcc(Assembler::below, L_copy_4_bytes); // use unsigned cmp
@@ -1416,7 +1418,7 @@
   //    rax, ==  0  -  success
   //    rax, == -1^K - failure, where K is partial transfer count
   //
-  address generate_checkcast_copy(const char *name, address* entry) {
+  address generate_checkcast_copy(const char *name, address* entry, bool dest_uninitialized = false) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1451,8 +1453,10 @@
     __ movptr(to,         to_arg);
     __ movl2ptr(length, length_arg);
 
-    *entry = __ pc(); // Entry point from generic arraycopy stub.
-    BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc(); // Entry point from generic arraycopy stub.
+      BLOCK_COMMENT("Entry:");
+    }
 
     //---------------------------------------------------------------
     // Assembler stub will be used for this call to arraycopy
@@ -1475,7 +1479,7 @@
     Address elem_klass_addr(elem, oopDesc::klass_offset_in_bytes());
 
     // Copy from low to high addresses, indexed from the end of each array.
-    gen_write_ref_array_pre_barrier(to, count);
+    gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
     __ lea(end_from, end_from_addr);
     __ lea(end_to,   end_to_addr);
     assert(length == count, "");        // else fix next line:
@@ -2038,6 +2042,15 @@
         generate_conjoint_copy(T_OBJECT, true, Address::times_ptr,  entry,
                                &entry_oop_arraycopy, "oop_arraycopy");
 
+    StubRoutines::_oop_disjoint_arraycopy_uninit =
+        generate_disjoint_copy(T_OBJECT, true, Address::times_ptr, &entry,
+                               "oop_disjoint_arraycopy_uninit",
+                               /*dest_uninitialized*/true);
+    StubRoutines::_oop_arraycopy_uninit =
+        generate_conjoint_copy(T_OBJECT, true, Address::times_ptr,  entry,
+                               NULL, "oop_arraycopy_uninit",
+                               /*dest_uninitialized*/true);
+
     StubRoutines::_jlong_disjoint_arraycopy =
         generate_disjoint_long_copy(&entry, "jlong_disjoint_arraycopy");
     StubRoutines::_jlong_arraycopy =
@@ -2051,20 +2064,20 @@
     StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill");
     StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill");
 
-    StubRoutines::_arrayof_jint_disjoint_arraycopy  =
-        StubRoutines::_jint_disjoint_arraycopy;
-    StubRoutines::_arrayof_oop_disjoint_arraycopy   =
-        StubRoutines::_oop_disjoint_arraycopy;
-    StubRoutines::_arrayof_jlong_disjoint_arraycopy =
-        StubRoutines::_jlong_disjoint_arraycopy;
+    StubRoutines::_arrayof_jint_disjoint_arraycopy       = StubRoutines::_jint_disjoint_arraycopy;
+    StubRoutines::_arrayof_oop_disjoint_arraycopy        = StubRoutines::_oop_disjoint_arraycopy;
+    StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = StubRoutines::_oop_disjoint_arraycopy_uninit;
+    StubRoutines::_arrayof_jlong_disjoint_arraycopy      = StubRoutines::_jlong_disjoint_arraycopy;
 
-    StubRoutines::_arrayof_jint_arraycopy  = StubRoutines::_jint_arraycopy;
-    StubRoutines::_arrayof_oop_arraycopy   = StubRoutines::_oop_arraycopy;
-    StubRoutines::_arrayof_jlong_arraycopy = StubRoutines::_jlong_arraycopy;
+    StubRoutines::_arrayof_jint_arraycopy       = StubRoutines::_jint_arraycopy;
+    StubRoutines::_arrayof_oop_arraycopy        = StubRoutines::_oop_arraycopy;
+    StubRoutines::_arrayof_oop_arraycopy_uninit = StubRoutines::_oop_arraycopy_uninit;
+    StubRoutines::_arrayof_jlong_arraycopy      = StubRoutines::_jlong_arraycopy;
 
     StubRoutines::_checkcast_arraycopy =
-        generate_checkcast_copy("checkcast_arraycopy",
-                                  &entry_checkcast_arraycopy);
+        generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy);
+    StubRoutines::_checkcast_arraycopy_uninit =
+        generate_checkcast_copy("checkcast_arraycopy_uninit", NULL, /*dest_uninitialized*/true);
 
     StubRoutines::_unsafe_arraycopy =
         generate_unsafe_copy("unsafe_arraycopy",
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1057,20 +1057,6 @@
     return start;
   }
 
-  static address disjoint_byte_copy_entry;
-  static address disjoint_short_copy_entry;
-  static address disjoint_int_copy_entry;
-  static address disjoint_long_copy_entry;
-  static address disjoint_oop_copy_entry;
-
-  static address byte_copy_entry;
-  static address short_copy_entry;
-  static address int_copy_entry;
-  static address long_copy_entry;
-  static address oop_copy_entry;
-
-  static address checkcast_copy_entry;
-
   //
   // Verify that a register contains clean 32-bits positive value
   // (high 32-bits are 0) so it could be used in 64-bits shifts.
@@ -1173,34 +1159,35 @@
   // Generate code for an array write pre barrier
   //
   //     addr    -  starting address
-  //     count    -  element count
+  //     count   -  element count
+  //     tmp     - scratch register
   //
   //     Destroy no registers!
   //
-  void  gen_write_ref_array_pre_barrier(Register addr, Register count) {
+  void  gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
       case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
-        {
-          __ pusha();                      // push registers
-          if (count == c_rarg0) {
-            if (addr == c_rarg1) {
-              // exactly backwards!!
-              __ xchgptr(c_rarg1, c_rarg0);
-            } else {
-              __ movptr(c_rarg1, count);
-              __ movptr(c_rarg0, addr);
-            }
-
-          } else {
-            __ movptr(c_rarg0, addr);
-            __ movptr(c_rarg1, count);
-          }
-          __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), 2);
-          __ popa();
+        // With G1, don't generate the call if we statically know that the target in uninitialized
+        if (!dest_uninitialized) {
+           __ pusha();                      // push registers
+           if (count == c_rarg0) {
+             if (addr == c_rarg1) {
+               // exactly backwards!!
+               __ xchgptr(c_rarg1, c_rarg0);
+             } else {
+               __ movptr(c_rarg1, count);
+               __ movptr(c_rarg0, addr);
+             }
+           } else {
+             __ movptr(c_rarg0, addr);
+             __ movptr(c_rarg1, count);
+           }
+           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), 2);
+           __ popa();
         }
-        break;
+         break;
       case BarrierSet::CardTableModRef:
       case BarrierSet::CardTableExtension:
       case BarrierSet::ModRef:
@@ -1379,7 +1366,7 @@
   //   disjoint_byte_copy_entry is set to the no-overlap entry point
   //   used by generate_conjoint_byte_copy().
   //
-  address generate_disjoint_byte_copy(bool aligned, const char *name) {
+  address generate_disjoint_byte_copy(bool aligned, address* entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1399,9 +1386,11 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
-    disjoint_byte_copy_entry = __ pc();
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+    if (entry != NULL) {
+      *entry = __ pc();
+       // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     setup_arg_regs(); // from => rdi, to => rsi, count => rdx
                       // r9 and r10 may be used to save non-volatile registers
@@ -1479,7 +1468,8 @@
   // dwords or qwords that span cache line boundaries will still be loaded
   // and stored atomically.
   //
-  address generate_conjoint_byte_copy(bool aligned, const char *name) {
+  address generate_conjoint_byte_copy(bool aligned, address nooverlap_target,
+                                      address* entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1494,11 +1484,13 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
-    byte_copy_entry = __ pc();
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-
-    array_overlap_test(disjoint_byte_copy_entry, Address::times_1);
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
+
+    array_overlap_test(nooverlap_target, Address::times_1);
     setup_arg_regs(); // from => rdi, to => rsi, count => rdx
                       // r9 and r10 may be used to save non-volatile registers
 
@@ -1574,7 +1566,7 @@
   //   disjoint_short_copy_entry is set to the no-overlap entry point
   //   used by generate_conjoint_short_copy().
   //
-  address generate_disjoint_short_copy(bool aligned, const char *name) {
+  address generate_disjoint_short_copy(bool aligned, address *entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1593,9 +1585,11 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
-    disjoint_short_copy_entry = __ pc();
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
 
     setup_arg_regs(); // from => rdi, to => rsi, count => rdx
                       // r9 and r10 may be used to save non-volatile registers
@@ -1686,7 +1680,8 @@
   // or qwords that span cache line boundaries will still be loaded
   // and stored atomically.
   //
-  address generate_conjoint_short_copy(bool aligned, const char *name) {
+  address generate_conjoint_short_copy(bool aligned, address nooverlap_target,
+                                       address *entry, const char *name) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1701,11 +1696,13 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
-    short_copy_entry = __ pc();
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-
-    array_overlap_test(disjoint_short_copy_entry, Address::times_2);
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
+
+    array_overlap_test(nooverlap_target, Address::times_2);
     setup_arg_regs(); // from => rdi, to => rsi, count => rdx
                       // r9 and r10 may be used to save non-volatile registers
 
@@ -1773,7 +1770,8 @@
   //   disjoint_int_copy_entry is set to the no-overlap entry point
   //   used by generate_conjoint_int_oop_copy().
   //
-  address generate_disjoint_int_oop_copy(bool aligned, bool is_oop, const char *name) {
+  address generate_disjoint_int_oop_copy(bool aligned, bool is_oop, address* entry,
+                                         const char *name, bool dest_uninitialized = false) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1793,21 +1791,17 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
-    (is_oop ? disjoint_oop_copy_entry : disjoint_int_copy_entry) = __ pc();
-
-    if (is_oop) {
-      // no registers are destroyed by this call
-      gen_write_ref_array_pre_barrier(/* dest */ c_rarg1, /* count */ c_rarg2);
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
     }
 
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-
     setup_arg_regs(); // from => rdi, to => rsi, count => rdx
                       // r9 and r10 may be used to save non-volatile registers
-
     if (is_oop) {
       __ movq(saved_to, to);
+      gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
     }
 
     // 'from', 'to' and 'count' are now valid
@@ -1867,7 +1861,9 @@
   // the hardware handle it.  The two dwords within qwords that span
   // cache line boundaries will still be loaded and stored atomicly.
   //
-  address generate_conjoint_int_oop_copy(bool aligned, bool is_oop, const char *name) {
+  address generate_conjoint_int_oop_copy(bool aligned, bool is_oop, address nooverlap_target,
+                                         address *entry, const char *name,
+                                         bool dest_uninitialized = false) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1882,20 +1878,21 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
+    if (entry != NULL) {
+      *entry = __ pc();
+       // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
+    }
+
+    array_overlap_test(nooverlap_target, Address::times_4);
+    setup_arg_regs(); // from => rdi, to => rsi, count => rdx
+                      // r9 and r10 may be used to save non-volatile registers
+
     if (is_oop) {
       // no registers are destroyed by this call
-      gen_write_ref_array_pre_barrier(/* dest */ c_rarg1, /* count */ c_rarg2);
+      gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
     }
 
-    (is_oop ? oop_copy_entry : int_copy_entry) = __ pc();
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-
-    array_overlap_test(is_oop ? disjoint_oop_copy_entry : disjoint_int_copy_entry,
-                       Address::times_4);
-    setup_arg_regs(); // from => rdi, to => rsi, count => rdx
-                      // r9 and r10 may be used to save non-volatile registers
-
     assert_clean_int(count, rax); // Make sure 'count' is clean int.
     // 'from', 'to' and 'count' are now valid
     __ movptr(dword_count, count);
@@ -1959,7 +1956,8 @@
   //   disjoint_oop_copy_entry or disjoint_long_copy_entry is set to the
   //   no-overlap entry point used by generate_conjoint_long_oop_copy().
   //
-  address generate_disjoint_long_oop_copy(bool aligned, bool is_oop, const char *name) {
+  address generate_disjoint_long_oop_copy(bool aligned, bool is_oop, address *entry,
+                                          const char *name, bool dest_uninitialized = false) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -1978,20 +1976,19 @@
     // Save no-overlap entry point for generate_conjoint_long_oop_copy()
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
-    if (is_oop) {
-      disjoint_oop_copy_entry  = __ pc();
-      // no registers are destroyed by this call
-      gen_write_ref_array_pre_barrier(/* dest */ c_rarg1, /* count */ c_rarg2);
-    } else {
-      disjoint_long_copy_entry = __ pc();
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
     }
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
 
     setup_arg_regs(); // from => rdi, to => rsi, count => rdx
                       // r9 and r10 may be used to save non-volatile registers
-
     // 'from', 'to' and 'qword_count' are now valid
+    if (is_oop) {
+      // no registers are destroyed by this call
+      gen_write_ref_array_pre_barrier(to, qword_count, dest_uninitialized);
+    }
 
     // Copy from low to high addresses.  Use 'to' as scratch.
     __ lea(end_from, Address(from, qword_count, Address::times_8, -8));
@@ -2045,7 +2042,9 @@
   //   c_rarg1   - destination array address
   //   c_rarg2   - element count, treated as ssize_t, can be zero
   //
-  address generate_conjoint_long_oop_copy(bool aligned, bool is_oop, const char *name) {
+  address generate_conjoint_long_oop_copy(bool aligned, bool is_oop,
+                                          address nooverlap_target, address *entry,
+                                          const char *name, bool dest_uninitialized = false) {
     __ align(CodeEntryAlignment);
     StubCodeMark mark(this, "StubRoutines", name);
     address start = __ pc();
@@ -2059,31 +2058,21 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     assert_clean_int(c_rarg2, rax);    // Make sure 'count' is clean int.
 
-    address disjoint_copy_entry = NULL;
-    if (is_oop) {
-      assert(!UseCompressedOops, "shouldn't be called for compressed oops");
-      disjoint_copy_entry = disjoint_oop_copy_entry;
-      oop_copy_entry  = __ pc();
-      array_overlap_test(disjoint_oop_copy_entry, Address::times_8);
-    } else {
-      disjoint_copy_entry = disjoint_long_copy_entry;
-      long_copy_entry = __ pc();
-      array_overlap_test(disjoint_long_copy_entry, Address::times_8);
+    if (entry != NULL) {
+      *entry = __ pc();
+      // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+      BLOCK_COMMENT("Entry:");
     }
-    BLOCK_COMMENT("Entry:");
-    // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-
-    array_overlap_test(disjoint_copy_entry, Address::times_8);
+
+    array_overlap_test(nooverlap_target, Address::times_8);
     setup_arg_regs(); // from => rdi, to => rsi, count => rdx
                       // r9 and r10 may be used to save non-volatile registers
-
     // 'from', 'to' and 'qword_count' are now valid
-
     if (is_oop) {
       // Save to and count for store barrier
       __ movptr(saved_count, qword_count);
       // No registers are destroyed by this call
-      gen_write_ref_array_pre_barrier(to, saved_count);
+      gen_write_ref_array_pre_barrier(to, saved_count, dest_uninitialized);
     }
 
     __ jmp(L_copy_32_bytes);
@@ -2162,7 +2151,8 @@
   //    rax ==  0  -  success
   //    rax == -1^K - failure, where K is partial transfer count
   //
-  address generate_checkcast_copy(const char *name) {
+  address generate_checkcast_copy(const char *name, address *entry,
+                                  bool dest_uninitialized = false) {
 
     Label L_load_element, L_store_element, L_do_card_marks, L_done;
 
@@ -2216,8 +2206,10 @@
 #endif
 
     // Caller of this entry point must set up the argument registers.
-    checkcast_copy_entry  = __ pc();
-    BLOCK_COMMENT("Entry:");
+    if (entry != NULL) {
+      *entry = __ pc();
+      BLOCK_COMMENT("Entry:");
+    }
 
     // allocate spill slots for r13, r14
     enum {
@@ -2254,7 +2246,7 @@
     Address from_element_addr(end_from, count, TIMES_OOP, 0);
     Address   to_element_addr(end_to,   count, TIMES_OOP, 0);
 
-    gen_write_ref_array_pre_barrier(to, count);
+    gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
 
     // Copy from low to high addresses, indexed from the end of each array.
     __ lea(end_from, end_from_addr);
@@ -2334,7 +2326,9 @@
   // Examines the alignment of the operands and dispatches
   // to a long, int, short, or byte copy loop.
   //
-  address generate_unsafe_copy(const char *name) {
+  address generate_unsafe_copy(const char *name,
+                               address byte_copy_entry, address short_copy_entry,
+                               address int_copy_entry, address long_copy_entry) {
 
     Label L_long_aligned, L_int_aligned, L_short_aligned;
 
@@ -2432,7 +2426,10 @@
   //    rax ==  0  -  success
   //    rax == -1^K - failure, where K is partial transfer count
   //
-  address generate_generic_copy(const char *name) {
+  address generate_generic_copy(const char *name,
+                                address byte_copy_entry, address short_copy_entry,
+                                address int_copy_entry, address long_copy_entry,
+                                address oop_copy_entry, address checkcast_copy_entry) {
 
     Label L_failed, L_failed_0, L_objArray;
     Label L_copy_bytes, L_copy_shorts, L_copy_ints, L_copy_longs;
@@ -2725,33 +2722,75 @@
   }
 
   void generate_arraycopy_stubs() {
-    // Call the conjoint generation methods immediately after
-    // the disjoint ones so that short branches from the former
-    // to the latter can be generated.
-    StubRoutines::_jbyte_disjoint_arraycopy  = generate_disjoint_byte_copy(false, "jbyte_disjoint_arraycopy");
-    StubRoutines::_jbyte_arraycopy           = generate_conjoint_byte_copy(false, "jbyte_arraycopy");
-
-    StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, "jshort_disjoint_arraycopy");
-    StubRoutines::_jshort_arraycopy          = generate_conjoint_short_copy(false, "jshort_arraycopy");
-
-    StubRoutines::_jint_disjoint_arraycopy   = generate_disjoint_int_oop_copy(false, false, "jint_disjoint_arraycopy");
-    StubRoutines::_jint_arraycopy            = generate_conjoint_int_oop_copy(false, false, "jint_arraycopy");
-
-    StubRoutines::_jlong_disjoint_arraycopy  = generate_disjoint_long_oop_copy(false, false, "jlong_disjoint_arraycopy");
-    StubRoutines::_jlong_arraycopy           = generate_conjoint_long_oop_copy(false, false, "jlong_arraycopy");
+    address entry;
+    address entry_jbyte_arraycopy;
+    address entry_jshort_arraycopy;
+    address entry_jint_arraycopy;
+    address entry_oop_arraycopy;
+    address entry_jlong_arraycopy;
+    address entry_checkcast_arraycopy;
+
+    StubRoutines::_jbyte_disjoint_arraycopy  = generate_disjoint_byte_copy(false, &entry,
+                                                                           "jbyte_disjoint_arraycopy");
+    StubRoutines::_jbyte_arraycopy           = generate_conjoint_byte_copy(false, entry, &entry_jbyte_arraycopy,
+                                                                           "jbyte_arraycopy");
+
+    StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, &entry,
+                                                                            "jshort_disjoint_arraycopy");
+    StubRoutines::_jshort_arraycopy          = generate_conjoint_short_copy(false, entry, &entry_jshort_arraycopy,
+                                                                            "jshort_arraycopy");
+
+    StubRoutines::_jint_disjoint_arraycopy   = generate_disjoint_int_oop_copy(false, false, &entry,
+                                                                              "jint_disjoint_arraycopy");
+    StubRoutines::_jint_arraycopy            = generate_conjoint_int_oop_copy(false, false, entry,
+                                                                              &entry_jint_arraycopy, "jint_arraycopy");
+
+    StubRoutines::_jlong_disjoint_arraycopy  = generate_disjoint_long_oop_copy(false, false, &entry,
+                                                                               "jlong_disjoint_arraycopy");
+    StubRoutines::_jlong_arraycopy           = generate_conjoint_long_oop_copy(false, false, entry,
+                                                                               &entry_jlong_arraycopy, "jlong_arraycopy");
 
 
     if (UseCompressedOops) {
-      StubRoutines::_oop_disjoint_arraycopy  = generate_disjoint_int_oop_copy(false, true, "oop_disjoint_arraycopy");
-      StubRoutines::_oop_arraycopy           = generate_conjoint_int_oop_copy(false, true, "oop_arraycopy");
+      StubRoutines::_oop_disjoint_arraycopy  = generate_disjoint_int_oop_copy(false, true, &entry,
+                                                                              "oop_disjoint_arraycopy");
+      StubRoutines::_oop_arraycopy           = generate_conjoint_int_oop_copy(false, true, entry,
+                                                                              &entry_oop_arraycopy, "oop_arraycopy");
+      StubRoutines::_oop_disjoint_arraycopy_uninit  = generate_disjoint_int_oop_copy(false, true, &entry,
+                                                                                     "oop_disjoint_arraycopy_uninit",
+                                                                                     /*dest_uninitialized*/true);
+      StubRoutines::_oop_arraycopy_uninit           = generate_conjoint_int_oop_copy(false, true, entry,
+                                                                                     NULL, "oop_arraycopy_uninit",
+                                                                                     /*dest_uninitialized*/true);
     } else {
-      StubRoutines::_oop_disjoint_arraycopy  = generate_disjoint_long_oop_copy(false, true, "oop_disjoint_arraycopy");
-      StubRoutines::_oop_arraycopy           = generate_conjoint_long_oop_copy(false, true, "oop_arraycopy");
+      StubRoutines::_oop_disjoint_arraycopy  = generate_disjoint_long_oop_copy(false, true, &entry,
+                                                                               "oop_disjoint_arraycopy");
+      StubRoutines::_oop_arraycopy           = generate_conjoint_long_oop_copy(false, true, entry,
+                                                                               &entry_oop_arraycopy, "oop_arraycopy");
+      StubRoutines::_oop_disjoint_arraycopy_uninit  = generate_disjoint_long_oop_copy(false, true, &entry,
+                                                                                      "oop_disjoint_arraycopy_uninit",
+                                                                                      /*dest_uninitialized*/true);
+      StubRoutines::_oop_arraycopy_uninit           = generate_conjoint_long_oop_copy(false, true, entry,
+                                                                                      NULL, "oop_arraycopy_uninit",
+                                                                                      /*dest_uninitialized*/true);
     }
 
-    StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy");
-    StubRoutines::_unsafe_arraycopy    = generate_unsafe_copy("unsafe_arraycopy");
-    StubRoutines::_generic_arraycopy   = generate_generic_copy("generic_arraycopy");
+    StubRoutines::_checkcast_arraycopy        = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy);
+    StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy("checkcast_arraycopy_uninit", NULL,
+                                                                        /*dest_uninitialized*/true);
+
+    StubRoutines::_unsafe_arraycopy    = generate_unsafe_copy("unsafe_arraycopy",
+                                                              entry_jbyte_arraycopy,
+                                                              entry_jshort_arraycopy,
+                                                              entry_jint_arraycopy,
+                                                              entry_jlong_arraycopy);
+    StubRoutines::_generic_arraycopy   = generate_generic_copy("generic_arraycopy",
+                                                               entry_jbyte_arraycopy,
+                                                               entry_jshort_arraycopy,
+                                                               entry_jint_arraycopy,
+                                                               entry_oop_arraycopy,
+                                                               entry_jlong_arraycopy,
+                                                               entry_checkcast_arraycopy);
 
     StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
     StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
@@ -2776,6 +2815,9 @@
 
     StubRoutines::_arrayof_oop_disjoint_arraycopy    = StubRoutines::_oop_disjoint_arraycopy;
     StubRoutines::_arrayof_oop_arraycopy             = StubRoutines::_oop_arraycopy;
+
+    StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit    = StubRoutines::_oop_disjoint_arraycopy_uninit;
+    StubRoutines::_arrayof_oop_arraycopy_uninit             = StubRoutines::_oop_arraycopy_uninit;
   }
 
   void generate_math_stubs() {
@@ -3069,20 +3111,6 @@
   }
 }; // end class declaration
 
-address StubGenerator::disjoint_byte_copy_entry  = NULL;
-address StubGenerator::disjoint_short_copy_entry = NULL;
-address StubGenerator::disjoint_int_copy_entry   = NULL;
-address StubGenerator::disjoint_long_copy_entry  = NULL;
-address StubGenerator::disjoint_oop_copy_entry   = NULL;
-
-address StubGenerator::byte_copy_entry  = NULL;
-address StubGenerator::short_copy_entry = NULL;
-address StubGenerator::int_copy_entry   = NULL;
-address StubGenerator::long_copy_entry  = NULL;
-address StubGenerator::oop_copy_entry   = NULL;
-
-address StubGenerator::checkcast_copy_entry = NULL;
-
 void StubGenerator_generate(CodeBuffer* code, bool all) {
   StubGenerator g(code, all);
 }
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -3110,7 +3110,7 @@
     __ profile_call(rsi);
   }
 
-  __ movptr(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx)));
+  __ movptr(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx)));
   __ null_check(rcx_method_handle);
   __ prepare_to_jump_from_interpreted();
   __ jump_to_method_handle_entry(rcx_method_handle, rdx);
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -3145,7 +3145,7 @@
     __ profile_call(r13);
   }
 
-  __ load_heap_oop(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx)));
+  __ load_heap_oop(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx)));
   __ null_check(rcx_method_handle);
   __ prepare_to_jump_from_interpreted();
   __ jump_to_method_handle_entry(rcx_method_handle, rdx);
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -436,6 +436,13 @@
         UseCountLeadingZerosInstruction = true;
       }
     }
+
+    // On family 21 processors default is no sw prefetch
+    if ( cpu_family() == 21 ) {
+      if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) {
+        AllocatePrefetchStyle = 0;
+      }
+    }
   }
 
   if( is_intel() ) { // Intel cpus specific settings
--- a/hotspot/src/cpu/x86/vm/x86_32.ad	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
@@ -12658,17 +12658,46 @@
   ins_pipe( pipe_slow );
 %}
 
+// fast search of substring with known size.
+instruct string_indexof_con(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, immI int_cnt2,
+                            eBXRegI result, regXD vec, eAXRegI cnt2, eCXRegI tmp, eFlagsReg cr) %{
+  predicate(UseSSE42Intrinsics);
+  match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
+  effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
+
+  format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result   // KILL $vec, $cnt1, $cnt2, $tmp" %}
+  ins_encode %{
+    int icnt2 = (int)$int_cnt2$$constant;
+    if (icnt2 >= 8) {
+      // IndexOf for constant substrings with size >= 8 elements
+      // which don't need to be loaded through stack.
+      __ string_indexofC8($str1$$Register, $str2$$Register,
+                          $cnt1$$Register, $cnt2$$Register,
+                          icnt2, $result$$Register,
+                          $vec$$XMMRegister, $tmp$$Register);
+    } else {
+      // Small strings are loaded through stack if they cross page boundary.
+      __ string_indexof($str1$$Register, $str2$$Register,
+                        $cnt1$$Register, $cnt2$$Register,
+                        icnt2, $result$$Register,
+                        $vec$$XMMRegister, $tmp$$Register);
+    }
+  %}
+  ins_pipe( pipe_slow );
+%}
+
 instruct string_indexof(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, eAXRegI cnt2,
-                        eBXRegI result, regXD tmp1, eCXRegI tmp2, eFlagsReg cr) %{
+                        eBXRegI result, regXD vec, eCXRegI tmp, eFlagsReg cr) %{
   predicate(UseSSE42Intrinsics);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
-  effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp2, KILL cr);
-
-  format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp2, $tmp1" %}
+  effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
+
+  format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result   // KILL all" %}
   ins_encode %{
     __ string_indexof($str1$$Register, $str2$$Register,
-                      $cnt1$$Register, $cnt2$$Register, $result$$Register,
-                      $tmp1$$XMMRegister, $tmp2$$Register);
+                      $cnt1$$Register, $cnt2$$Register,
+                      (-1), $result$$Register,
+                      $vec$$XMMRegister, $tmp$$Register);
   %}
   ins_pipe( pipe_slow );
 %}
--- a/hotspot/src/cpu/x86/vm/x86_64.ad	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
@@ -11598,18 +11598,48 @@
   ins_pipe( pipe_slow );
 %}
 
+// fast search of substring with known size.
+instruct string_indexof_con(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2,
+                            rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr)
+%{
+  predicate(UseSSE42Intrinsics);
+  match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
+  effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
+
+  format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result   // KILL $vec, $cnt1, $cnt2, $tmp" %}
+  ins_encode %{
+    int icnt2 = (int)$int_cnt2$$constant;
+    if (icnt2 >= 8) {
+      // IndexOf for constant substrings with size >= 8 elements
+      // which don't need to be loaded through stack.
+      __ string_indexofC8($str1$$Register, $str2$$Register,
+                          $cnt1$$Register, $cnt2$$Register,
+                          icnt2, $result$$Register,
+                          $vec$$XMMRegister, $tmp$$Register);
+    } else {
+      // Small strings are loaded through stack if they cross page boundary.
+      __ string_indexof($str1$$Register, $str2$$Register,
+                        $cnt1$$Register, $cnt2$$Register,
+                        icnt2, $result$$Register,
+                        $vec$$XMMRegister, $tmp$$Register);
+    }
+  %}
+  ins_pipe( pipe_slow );
+%}
+
 instruct string_indexof(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2,
-                        rbx_RegI result, regD tmp1, rcx_RegI tmp2, rFlagsReg cr)
+                        rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr)
 %{
   predicate(UseSSE42Intrinsics);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
-  effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp2, KILL cr);
-
-  format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp1, $tmp2" %}
+  effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
+
+  format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result   // KILL all" %}
   ins_encode %{
     __ string_indexof($str1$$Register, $str2$$Register,
-                      $cnt1$$Register, $cnt2$$Register, $result$$Register,
-                      $tmp1$$XMMRegister, $tmp2$$Register);
+                      $cnt1$$Register, $cnt2$$Register,
+                      (-1), $result$$Register,
+                      $vec$$XMMRegister, $tmp$$Register);
   %}
   ins_pipe( pipe_slow );
 %}
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -2213,7 +2213,7 @@
   if (rp == NULL)
     return;
 
-  if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
+  if (Arguments::created_by_gamma_launcher()) {
     // Support for the gamma launcher.  Typical value for buf is
     // "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so".  If "/jre/lib/" appears at
     // the right place in the string, then assume we are installed in a JDK and
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -59,3 +59,12 @@
   VMError::report_coredump_status(buffer, success);
 }
 
+bool os::is_debugger_attached() {
+  // not implemented
+  return false;
+}
+
+void os::wait_for_keypress_at_exit(void) {
+  // don't do anything on posix platforms
+  return;
+}
--- a/hotspot/src/os/solaris/dtrace/libjvm_db.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c	Fri Mar 18 11:00:10 2011 -0700
@@ -524,6 +524,8 @@
   CHECK_FAIL(err);
   err = read_pointer(J, constantPool + nameIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &nameSymbol);
   CHECK_FAIL(err);
+  // The symbol is a CPSlot and has lower bit set to indicate metadata
+  nameSymbol &= (~1); // remove metadata lsb
   err = ps_pread(J->P, nameSymbol + OFFSET_Symbol_length, &nameSymbolLength, 2);
   CHECK_FAIL(err);
   nameString = (char*)calloc(nameSymbolLength + 1, 1);
@@ -535,6 +537,7 @@
   CHECK_FAIL(err);
   err = read_pointer(J, constantPool + signatureIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &signatureSymbol);
   CHECK_FAIL(err);
+  signatureSymbol &= (~1);  // remove metadata lsb
   err = ps_pread(J->P, signatureSymbol + OFFSET_Symbol_length, &signatureSymbolLength, 2);
   CHECK_FAIL(err);
   signatureString = (char*)calloc(signatureSymbolLength + 1, 1);
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -2511,7 +2511,7 @@
   assert(ret != 0, "cannot locate libjvm");
   realpath((char *)dlinfo.dli_fname, buf);
 
-  if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
+  if (Arguments::created_by_gamma_launcher()) {
     // Support for the gamma launcher.  Typical value for buf is
     // "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so".  If "/jre/lib/" appears at
     // the right place in the string, then assume we are installed in a JDK and
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -22,10 +22,8 @@
  *
  */
 
-#ifdef _WIN64
-// Must be at least Windows 2000 or XP to use VectoredExceptions
+// Must be at least Windows 2000 or XP to use VectoredExceptions and IsDebuggerPresent
 #define _WIN32_WINNT 0x500
-#endif
 
 // no precompiled headers
 #include "classfile/classLoader.hpp"
@@ -1788,7 +1786,7 @@
   }
 
   buf[0] = '\0';
-  if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
+  if (Arguments::created_by_gamma_launcher()) {
      // Support for the gamma launcher. Check for an
      // JAVA_HOME environment variable
      // and fix up the path so it looks like
@@ -3418,6 +3416,19 @@
 }
 
 
+bool os::is_debugger_attached() {
+  return IsDebuggerPresent() ? true : false;
+}
+
+
+void os::wait_for_keypress_at_exit(void) {
+  if (PauseAtExit) {
+    fprintf(stderr, "Press any key to continue...\n");
+    fgetc(stdin);
+  }
+}
+
+
 int os::message_box(const char* title, const char* message) {
   int result = MessageBox(NULL, message, title,
                           MB_YESNO | MB_ICONERROR | MB_SYSTEMMODAL | MB_DEFAULT_DESKTOP_ONLY);
--- a/hotspot/src/share/tools/hsdis/hsdis-demo.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/tools/hsdis/hsdis-demo.c	Fri Mar 18 11:00:10 2011 -0700
@@ -22,8 +22,6 @@
  *
  */
 
-#include "precompiled.hpp"
-
 /* hsdis-demo.c -- dump a range of addresses as native instructions
    This demonstrates the protocol required by the HotSpot PrintAssembly option.
 */
--- a/hotspot/src/share/tools/hsdis/hsdis.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/tools/hsdis/hsdis.c	Fri Mar 18 11:00:10 2011 -0700
@@ -22,8 +22,6 @@
  *
  */
 
-#include "precompiled.hpp"
-
 /* hsdis.c -- dump a range of addresses as native instructions
    This implements the plugin protocol required by the
    HotSpot PrintAssembly option.
--- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -209,7 +209,7 @@
     // limit this optimization to current block
     if (value != NULL && in_current_block(conv)) {
       set_canonical(new StoreField(x->obj(), x->offset(), x->field(), value, x->is_static(),
-                                       x->state_before(), x->is_loaded(), x->is_initialized()));
+                                   x->state_before(), x->needs_patching()));
       return;
     }
   }
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1456,12 +1456,12 @@
   BasicType field_type = field->type()->basic_type();
   ValueType* type = as_ValueType(field_type);
   // call will_link again to determine if the field is valid.
-  const bool is_loaded = holder->is_loaded() &&
-                         field->will_link(method()->holder(), code);
-  const bool is_initialized = is_loaded && holder->is_initialized();
+  const bool needs_patching = !holder->is_loaded() ||
+                              !field->will_link(method()->holder(), code) ||
+                              PatchALot;
 
   ValueStack* state_before = NULL;
-  if (!is_initialized || PatchALot) {
+  if (!holder->is_initialized() || needs_patching) {
     // save state before instruction for debug info when
     // deoptimization happens during patching
     state_before = copy_state_before();
@@ -1469,10 +1469,6 @@
 
   Value obj = NULL;
   if (code == Bytecodes::_getstatic || code == Bytecodes::_putstatic) {
-    // commoning of class constants should only occur if the class is
-    // fully initialized and resolved in this constant pool.  The will_link test
-    // above essentially checks if this class is resolved in this constant pool
-    // so, the is_initialized flag should be suffiect.
     if (state_before != NULL) {
       // build a patching constant
       obj = new Constant(new ClassConstant(holder), state_before);
@@ -1482,7 +1478,7 @@
   }
 
 
-  const int offset = is_loaded ? field->offset() : -1;
+  const int offset = !needs_patching ? field->offset() : -1;
   switch (code) {
     case Bytecodes::_getstatic: {
       // check for compile-time constants, i.e., initialized static final fields
@@ -1509,7 +1505,7 @@
           state_before = copy_state_for_exception();
         }
         push(type, append(new LoadField(append(obj), offset, field, true,
-                                        state_before, is_loaded, is_initialized)));
+                                        state_before, needs_patching)));
       }
       break;
     }
@@ -1518,7 +1514,7 @@
         if (state_before == NULL) {
           state_before = copy_state_for_exception();
         }
-        append(new StoreField(append(obj), offset, field, val, true, state_before, is_loaded, is_initialized));
+        append(new StoreField(append(obj), offset, field, val, true, state_before, needs_patching));
       }
       break;
     case Bytecodes::_getfield :
@@ -1526,8 +1522,8 @@
         if (state_before == NULL) {
           state_before = copy_state_for_exception();
         }
-        LoadField* load = new LoadField(apop(), offset, field, false, state_before, is_loaded, true);
-        Value replacement = is_loaded ? _memory->load(load) : load;
+        LoadField* load = new LoadField(apop(), offset, field, false, state_before, needs_patching);
+        Value replacement = !needs_patching ? _memory->load(load) : load;
         if (replacement != load) {
           assert(replacement->is_linked() || !replacement->can_be_linked(), "should already by linked");
           push(type, replacement);
@@ -1542,8 +1538,8 @@
         if (state_before == NULL) {
           state_before = copy_state_for_exception();
         }
-        StoreField* store = new StoreField(apop(), offset, field, val, false, state_before, is_loaded, true);
-        if (is_loaded) store = _memory->store(store);
+        StoreField* store = new StoreField(apop(), offset, field, val, false, state_before, needs_patching);
+        if (!needs_patching) store = _memory->store(store);
         if (store != NULL) {
           append(store);
         }
@@ -3308,22 +3304,23 @@
   Value exception = append_with_bci(new ExceptionObject(), SynchronizationEntryBCI);
   assert(exception->is_pinned(), "must be");
 
+  int bci = SynchronizationEntryBCI;
   if (compilation()->env()->dtrace_method_probes()) {
-    // Report exit from inline methods
+    // Report exit from inline methods.  We don't have a stream here
+    // so pass an explicit bci of SynchronizationEntryBCI.
     Values* args = new Values(1);
-    args->push(append(new Constant(new ObjectConstant(method()))));
-    append(new RuntimeCall(voidType, "dtrace_method_exit", CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), args));
+    args->push(append_with_bci(new Constant(new ObjectConstant(method())), bci));
+    append_with_bci(new RuntimeCall(voidType, "dtrace_method_exit", CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), args), bci);
   }
 
-  int bci = SynchronizationEntryBCI;
   if (lock) {
     assert(state()->locks_size() > 0 && state()->lock_at(state()->locks_size() - 1) == lock, "lock is missing");
     if (!lock->is_linked()) {
-      lock = append_with_bci(lock, -1);
+      lock = append_with_bci(lock, bci);
     }
 
     // exit the monitor in the context of the synchronized method
-    monitorexit(lock, SynchronizationEntryBCI);
+    monitorexit(lock, bci);
 
     // exit the context of the synchronized method
     if (!default_handler) {
--- a/hotspot/src/share/vm/c1/c1_Instruction.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -323,8 +323,6 @@
     CanTrapFlag,
     DirectCompareFlag,
     IsEliminatedFlag,
-    IsInitializedFlag,
-    IsLoadedFlag,
     IsSafepointFlag,
     IsStaticFlag,
     IsStrictfpFlag,
@@ -693,7 +691,7 @@
  public:
   // creation
   AccessField(Value obj, int offset, ciField* field, bool is_static,
-              ValueStack* state_before, bool is_loaded, bool is_initialized)
+              ValueStack* state_before, bool needs_patching)
   : Instruction(as_ValueType(field->type()->basic_type()), state_before)
   , _obj(obj)
   , _offset(offset)
@@ -701,16 +699,9 @@
   , _explicit_null_check(NULL)
   {
     set_needs_null_check(!is_static);
-    set_flag(IsLoadedFlag, is_loaded);
-    set_flag(IsInitializedFlag, is_initialized);
     set_flag(IsStaticFlag, is_static);
+    set_flag(NeedsPatchingFlag, needs_patching);
     ASSERT_VALUES
-      if (!is_loaded || (PatchALot && !field->is_volatile())) {
-      // need to patch if the holder wasn't loaded or we're testing
-      // using PatchALot.  Don't allow PatchALot for fields which are
-      // known to be volatile they aren't patchable.
-      set_flag(NeedsPatchingFlag, true);
-    }
     // pin of all instructions with memory access
     pin();
   }
@@ -721,11 +712,14 @@
   ciField* field() const                         { return _field; }
   BasicType field_type() const                   { return _field->type()->basic_type(); }
   bool is_static() const                         { return check_flag(IsStaticFlag); }
-  bool is_loaded() const                         { return check_flag(IsLoadedFlag); }
-  bool is_initialized() const                    { return check_flag(IsInitializedFlag); }
   NullCheck* explicit_null_check() const         { return _explicit_null_check; }
   bool needs_patching() const                    { return check_flag(NeedsPatchingFlag); }
 
+  // Unresolved getstatic and putstatic can cause initialization.
+  // Technically it occurs at the Constant that materializes the base
+  // of the static fields but it's simpler to model it here.
+  bool is_init_point() const                     { return is_static() && (needs_patching() || !_field->holder()->is_initialized()); }
+
   // manipulation
 
   // Under certain circumstances, if a previous NullCheck instruction
@@ -745,15 +739,15 @@
  public:
   // creation
   LoadField(Value obj, int offset, ciField* field, bool is_static,
-            ValueStack* state_before, bool is_loaded, bool is_initialized)
-  : AccessField(obj, offset, field, is_static, state_before, is_loaded, is_initialized)
+            ValueStack* state_before, bool needs_patching)
+  : AccessField(obj, offset, field, is_static, state_before, needs_patching)
   {}
 
   ciType* declared_type() const;
   ciType* exact_type() const;
 
   // generic
-  HASHING2(LoadField, is_loaded() && !field()->is_volatile(), obj()->subst(), offset())  // cannot be eliminated if not yet loaded or if volatile
+  HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset())  // cannot be eliminated if needs patching or if volatile
 };
 
 
@@ -764,8 +758,8 @@
  public:
   // creation
   StoreField(Value obj, int offset, ciField* field, Value value, bool is_static,
-             ValueStack* state_before, bool is_loaded, bool is_initialized)
-  : AccessField(obj, offset, field, is_static, state_before, is_loaded, is_initialized)
+             ValueStack* state_before, bool needs_patching)
+  : AccessField(obj, offset, field, is_static, state_before, needs_patching)
   , _value(value)
   {
     set_flag(NeedsWriteBarrierFlag, as_ValueType(field_type())->is_object());
--- a/hotspot/src/share/vm/c1/c1_LIR.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIR.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1156,7 +1156,7 @@
     return
       is_invokedynamic()  // An invokedynamic is always a MethodHandle call site.
       ||
-      (method()->holder()->name() == ciSymbol::java_dyn_MethodHandle() &&
+      (method()->holder()->name() == ciSymbol::java_lang_invoke_MethodHandle() &&
        methodOopDesc::is_method_handle_invoke_name(method()->name()->sid()));
   }
 
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1559,9 +1559,7 @@
                 (info ? new CodeEmitInfo(info) : NULL));
   }
 
-  if (is_volatile) {
-    assert(!needs_patching && x->is_loaded(),
-           "how do we know it's volatile if it's not loaded");
+  if (is_volatile && !needs_patching) {
     volatile_field_store(value.result(), address, info);
   } else {
     LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
@@ -1627,9 +1625,7 @@
     address = generate_address(object.result(), x->offset(), field_type);
   }
 
-  if (is_volatile) {
-    assert(!needs_patching && x->is_loaded(),
-           "how do we know it's volatile if it's not loaded");
+  if (is_volatile && !needs_patching) {
     volatile_field_load(address, reg, info);
   } else {
     LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
@@ -2516,7 +2512,7 @@
       __ load(new LIR_Address(tmp, call_site_offset, T_OBJECT), tmp);
 
       // Load target MethodHandle from CallSite object.
-      __ load(new LIR_Address(tmp, java_dyn_CallSite::target_offset_in_bytes(), T_OBJECT), receiver);
+      __ load(new LIR_Address(tmp, java_lang_invoke_CallSite::target_offset_in_bytes(), T_OBJECT), receiver);
 
       __ call_dynamic(target, receiver, result_register,
                       SharedRuntime::get_resolve_opt_virtual_call_stub(),
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -2703,7 +2703,7 @@
       assert(_fpu_stack_allocator != NULL, "must be present");
       opr = _fpu_stack_allocator->to_fpu_stack(opr);
 
-      assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation (only fpu_regnrHi is used)");
+      assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation (only fpu_regnrLo is used)");
 #endif
 #ifdef SPARC
       assert(opr->fpu_regnrLo() == opr->fpu_regnrHi() + 1, "assumed in calculation (only fpu_regnrHi is used)");
@@ -2715,7 +2715,12 @@
       assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation (only fpu_regnrHi is used)");
 #endif
 
+#ifdef VM_LITTLE_ENDIAN
+      VMReg rname_first = frame_map()->fpu_regname(opr->fpu_regnrLo());
+#else
       VMReg rname_first = frame_map()->fpu_regname(opr->fpu_regnrHi());
+#endif
+
 #ifdef _LP64
       first = new LocationValue(Location::new_reg_loc(Location::dbl, rname_first));
       second = &_int_0_scope_value;
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -426,10 +426,9 @@
 // been deoptimized. If that is the case we return the deopt blob
 // unpack_with_exception entry instead. This makes life for the exception blob easier
 // because making that same check and diverting is painful from assembly language.
-//
-
-
 JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* thread, oopDesc* ex, address pc, nmethod*& nm))
+  // Reset method handle flag.
+  thread->set_is_method_handle_return(false);
 
   Handle exception(thread, ex);
   nm = CodeCache::find_nmethod(pc);
@@ -480,11 +479,12 @@
     return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
   }
 
-  // ExceptionCache is used only for exceptions at call and not for implicit exceptions
+  // ExceptionCache is used only for exceptions at call sites and not for implicit exceptions
   if (guard_pages_enabled) {
     address fast_continuation = nm->handler_for_exception_and_pc(exception, pc);
     if (fast_continuation != NULL) {
-      if (fast_continuation == ExceptionCache::unwind_handler()) fast_continuation = NULL;
+      // Set flag if return address is a method handle call site.
+      thread->set_is_method_handle_return(nm->is_method_handle_return(pc));
       return fast_continuation;
     }
   }
@@ -522,14 +522,14 @@
     thread->set_exception_pc(pc);
 
     // the exception cache is used only by non-implicit exceptions
-    if (continuation == NULL) {
-      nm->add_handler_for_exception_and_pc(exception, pc, ExceptionCache::unwind_handler());
-    } else {
+    if (continuation != NULL) {
       nm->add_handler_for_exception_and_pc(exception, pc, continuation);
     }
   }
 
   thread->set_vm_result(exception());
+  // Set flag if return address is a method handle call site.
+  thread->set_is_method_handle_return(nm->is_method_handle_return(pc));
 
   if (TraceExceptions) {
     ttyLocker ttyl;
@@ -542,20 +542,19 @@
 JRT_END
 
 // Enter this method from compiled code only if there is a Java exception handler
-// in the method handling the exception
+// in the method handling the exception.
 // We are entering here from exception stub. We don't do a normal VM transition here.
 // We do it in a helper. This is so we can check to see if the nmethod we have just
 // searched for an exception handler has been deoptimized in the meantime.
-address  Runtime1::exception_handler_for_pc(JavaThread* thread) {
+address Runtime1::exception_handler_for_pc(JavaThread* thread) {
   oop exception = thread->exception_oop();
   address pc = thread->exception_pc();
   // Still in Java mode
-  debug_only(ResetNoHandleMark rnhm);
+  DEBUG_ONLY(ResetNoHandleMark rnhm);
   nmethod* nm = NULL;
   address continuation = NULL;
   {
     // Enter VM mode by calling the helper
-
     ResetNoHandleMark rnhm;
     continuation = exception_handler_for_pc_helper(thread, exception, pc, nm);
   }
@@ -563,11 +562,11 @@
 
   // Now check to see if the nmethod we were called from is now deoptimized.
   // If so we must return to the deopt blob and deoptimize the nmethod
-
   if (nm != NULL && caller_is_deopted()) {
     continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
   }
 
+  assert(continuation != NULL, "no handler found");
   return continuation;
 }
 
--- a/hotspot/src/share/vm/c1/c1_Runtime1.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -54,6 +54,7 @@
   stub(new_multi_array)              \
   stub(handle_exception_nofpu)         /* optimized version that does not preserve fpu registers */ \
   stub(handle_exception)             \
+  stub(handle_exception_from_callee) \
   stub(throw_array_store_exception)  \
   stub(throw_class_cast_exception)   \
   stub(throw_incompatible_class_change_error)   \
@@ -116,11 +117,11 @@
   static const char* _blob_names[];
 
   // stub generation
-  static void generate_blob_for(BufferBlob* blob, StubID id);
-  static OopMapSet* generate_code_for(StubID id, StubAssembler* masm);
+  static void       generate_blob_for(BufferBlob* blob, StubID id);
+  static OopMapSet* generate_code_for(StubID id, StubAssembler* sasm);
   static OopMapSet* generate_exception_throw(StubAssembler* sasm, address target, bool has_argument);
-  static void generate_handle_exception(StubAssembler *sasm, OopMapSet* oop_maps, OopMap* oop_map, bool ignore_fpu_registers = false);
-  static void generate_unwind_exception(StubAssembler *sasm);
+  static OopMapSet* generate_handle_exception(StubID id, StubAssembler* sasm);
+  static void       generate_unwind_exception(StubAssembler *sasm);
   static OopMapSet* generate_patching(StubAssembler* sasm, address target);
 
   static OopMapSet* generate_stub_call(StubAssembler* sasm, Register result, address entry,
--- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -141,7 +141,8 @@
 
   // visitor functions
   void do_StoreField     (StoreField*      x) {
-    if (!x->is_initialized()) {
+    if (x->is_init_point()) {
+      // putstatic is an initialization point so treat it as a wide kill
       kill_memory();
     } else {
       kill_field(x->field());
@@ -159,7 +160,8 @@
   void do_Local          (Local*           x) { /* nothing to do */ }
   void do_Constant       (Constant*        x) { /* nothing to do */ }
   void do_LoadField      (LoadField*       x) {
-    if (!x->is_initialized()) {
+    if (x->is_init_point()) {
+      // getstatic is an initialization point so treat it as a wide kill
       kill_memory();
     }
   }
--- a/hotspot/src/share/vm/ci/ciCallSite.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciCallSite.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 // Return the target MethodHandle of this CallSite.
 ciMethodHandle* ciCallSite::get_target() const {
   VM_ENTRY_MARK;
-  oop method_handle_oop = java_dyn_CallSite::target(get_oop());
+  oop method_handle_oop = java_lang_invoke_CallSite::target(get_oop());
   return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle();
 }
 
--- a/hotspot/src/share/vm/ci/ciCallSite.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciCallSite.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 
 // ciCallSite
 //
-// The class represents a java.dyn.CallSite object.
+// The class represents a java.lang.invoke.CallSite object.
 class ciCallSite : public ciInstance {
 public:
   ciCallSite(instanceHandle h_i) : ciInstance(h_i) {}
--- a/hotspot/src/share/vm/ci/ciField.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciField.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -177,7 +177,7 @@
     // Never trust strangely unstable finals:  System.out, etc.
     return false;
   // Even if general trusting is disabled, trust system-built closures in these packages.
-  if (holder->is_in_package("java/dyn") || holder->is_in_package("sun/dyn"))
+  if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke"))
     return true;
   return TrustFinalNonStaticFields;
 }
@@ -191,8 +191,9 @@
   // Check to see if the field is constant.
   if (_holder->is_initialized() && this->is_final()) {
     if (!this->is_static()) {
-      // A field can be constant if it's a final static field or if it's
-      // a final non-static field of a trusted class ({java,sun}.dyn).
+      // A field can be constant if it's a final static field or if
+      // it's a final non-static field of a trusted class (classes in
+      // java.lang.invoke and sun.invoke packages and subpackages).
       if (trust_final_non_static_fields(_holder)) {
         _is_constant = true;
         return;
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -769,7 +769,7 @@
 // signature-polymorphic MethodHandle methods, invokeExact or invokeGeneric.
 bool ciMethod::is_method_handle_invoke() const {
   if (!is_loaded()) {
-    bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() &&
+    bool flag = (holder()->name() == ciSymbol::java_lang_invoke_MethodHandle() &&
                  methodOopDesc::is_method_handle_invoke_name(name()->sid()));
     return flag;
   }
--- a/hotspot/src/share/vm/ci/ciMethodHandle.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciMethodHandle.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 
 // ciMethodHandle
 //
-// The class represents a java.dyn.MethodHandle object.
+// The class represents a java.lang.invoke.MethodHandle object.
 class ciMethodHandle : public ciInstance {
 private:
   ciMethod* _callee;
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -342,9 +342,9 @@
     return new (arena()) ciMethodData(h_md);
   } else if (o->is_instance()) {
     instanceHandle h_i(THREAD, (instanceOop)o);
-    if (java_dyn_CallSite::is_instance(o))
+    if (java_lang_invoke_CallSite::is_instance(o))
       return new (arena()) ciCallSite(h_i);
-    else if (java_dyn_MethodHandle::is_instance(o))
+    else if (java_lang_invoke_MethodHandle::is_instance(o))
       return new (arena()) ciMethodHandle(h_i);
     else
       return new (arena()) ciInstance(h_i);
--- a/hotspot/src/share/vm/ci/ciStreams.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciStreams.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -380,7 +380,7 @@
   bool ignore;
   // report as InvokeDynamic for invokedynamic, which is syntactically classless
   if (cur_bc() == Bytecodes::_invokedynamic)
-    return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_InvokeDynamic(), false);
+    return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_lang_invoke_InvokeDynamic(), false);
   return CURRENT_ENV->get_klass_by_index(cpool, get_method_holder_index(), ignore, _holder);
 }
 
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +146,14 @@
         break;
       case JVM_CONSTANT_MethodHandle :
       case JVM_CONSTANT_MethodType :
-        if (!EnableMethodHandles ||
-            _major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
+        if (_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
           classfile_parse_error(
-            (!EnableMethodHandles ?
-             "This JVM does not support constant tag %u in class file %s" :
-             "Class file version does not support constant tag %u in class file %s"),
+            "Class file version does not support constant tag %u in class file %s",
+            tag, CHECK);
+        }
+        if (!EnableMethodHandles) {
+          classfile_parse_error(
+            "This JVM does not support constant tag %u in class file %s",
             tag, CHECK);
         }
         if (tag == JVM_CONSTANT_MethodHandle) {
@@ -170,12 +172,14 @@
       case JVM_CONSTANT_InvokeDynamicTrans :  // this tag appears only in old classfiles
       case JVM_CONSTANT_InvokeDynamic :
         {
-          if (!EnableInvokeDynamic ||
-              _major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
+          if (_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
             classfile_parse_error(
-              (!EnableInvokeDynamic ?
-               "This JVM does not support constant tag %u in class file %s" :
-               "Class file version does not support constant tag %u in class file %s"),
+              "Class file version does not support constant tag %u in class file %s",
+              tag, CHECK);
+          }
+          if (!EnableInvokeDynamic) {
+            classfile_parse_error(
+              "This JVM does not support constant tag %u in class file %s",
               tag, CHECK);
           }
           cfs->guarantee_more(5, CHECK);  // bsm_index, nt, tag/access_flags
@@ -1616,8 +1620,13 @@
 
   AccessFlags access_flags;
   if (name == vmSymbols::class_initializer_name()) {
-    // We ignore the access flags for a class initializer. (JVM Spec. p. 116)
-    flags = JVM_ACC_STATIC;
+    // We ignore the other access flags for a valid class initializer.
+    // (JVM Spec 2nd ed., chapter 4.6)
+    if (_major_version < 51) { // backward compatibility
+      flags = JVM_ACC_STATIC;
+    } else if ((flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) {
+      flags &= JVM_ACC_STATIC | JVM_ACC_STRICT;
+    }
   } else {
     verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
   }
@@ -2797,11 +2806,11 @@
 
 // Force MethodHandle.vmentry to be an unmanaged pointer.
 // There is no way for a classfile to express this, so we must help it.
-void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
+void ClassFileParser::java_lang_invoke_MethodHandle_fix_pre(constantPoolHandle cp,
                                                     typeArrayHandle fields,
                                                     FieldAllocationCount *fac_ptr,
                                                     TRAPS) {
-  // Add fake fields for java.dyn.MethodHandle instances
+  // Add fake fields for java.lang.invoke.MethodHandle instances
   //
   // This is not particularly nice, but since there is no way to express
   // a native wordSize field in Java, we must do it at this level.
@@ -2818,9 +2827,10 @@
     }
   }
 
+  if (AllowTransitionalJSR292 && word_sig_index == 0)  return;
   if (word_sig_index == 0)
     THROW_MSG(vmSymbols::java_lang_VirtualMachineError(),
-              "missing I or J signature (for vmentry) in java.dyn.MethodHandle");
+              "missing I or J signature (for vmentry) in java.lang.invoke.MethodHandle");
 
   // Find vmentry field and change the signature.
   bool found_vmentry = false;
@@ -2857,9 +2867,10 @@
     }
   }
 
+  if (AllowTransitionalJSR292 && !found_vmentry)  return;
   if (!found_vmentry)
     THROW_MSG(vmSymbols::java_lang_VirtualMachineError(),
-              "missing vmentry byte field in java.dyn.MethodHandle");
+              "missing vmentry byte field in java.lang.invoke.MethodHandle");
 }
 
 
@@ -3224,9 +3235,18 @@
       java_lang_Class_fix_pre(&methods, &fac, CHECK_(nullHandle));
     }
 
-    // adjust the vmentry field declaration in java.dyn.MethodHandle
-    if (EnableMethodHandles && class_name == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) {
-      java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
+    // adjust the vmentry field declaration in java.lang.invoke.MethodHandle
+    if (EnableMethodHandles && class_name == vmSymbols::java_lang_invoke_MethodHandle() && class_loader.is_null()) {
+      java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
+    }
+    if (AllowTransitionalJSR292 &&
+        EnableMethodHandles && class_name == vmSymbols::java_dyn_MethodHandle() && class_loader.is_null()) {
+      java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
+    }
+    if (AllowTransitionalJSR292 &&
+        EnableMethodHandles && class_name == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) {
+      // allow vmentry field in MethodHandleImpl also
+      java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
     }
 
     // Add a fake "discovered" field if it is not present
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +162,9 @@
   // Adjust the next_nonstatic_oop_offset to place the fake fields
   // before any Java fields.
   void java_lang_Class_fix_post(int* next_nonstatic_oop_offset);
-  // Adjust the field allocation counts for java.dyn.MethodHandle to add
+  // Adjust the field allocation counts for java.lang.invoke.MethodHandle to add
   // a fake address (void*) field.
-  void java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
+  void java_lang_invoke_MethodHandle_fix_pre(constantPoolHandle cp,
                                      typeArrayHandle fields,
                                      FieldAllocationCount *fac_ptr, TRAPS);
 
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1332,7 +1332,7 @@
       }
 
       if (_compile_the_world_counter >= CompileTheWorldStartAt) {
-        if (k.is_null() || (exception_occurred && !CompileTheWorldIgnoreInitErrors)) {
+        if (k.is_null() || exception_occurred) {
           // If something went wrong (e.g. ExceptionInInitializerError) we skip this class
           tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_counter, buffer);
         } else {
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,28 @@
     return ik->find_local_field(name_symbol, signature_symbol, fd);
 }
 
+static bool find_hacked_field(instanceKlass* ik,
+                              Symbol* name_symbol, Symbol* signature_symbol,
+                              fieldDescriptor* fd,
+                              bool allow_super = false) {
+  bool found = find_field(ik, name_symbol, signature_symbol, fd, allow_super);
+  if (!found && AllowTransitionalJSR292) {
+    Symbol* backup_sig = SystemDictionary::find_backup_signature(signature_symbol);
+    if (backup_sig != NULL) {
+      found = find_field(ik, name_symbol, backup_sig, fd, allow_super);
+      if (TraceMethodHandles) {
+        ResourceMark rm;
+        tty->print_cr("MethodHandles: %s.%s: backup for %s => %s%s",
+                      ik->name()->as_C_string(), name_symbol->as_C_string(),
+                      signature_symbol->as_C_string(), backup_sig->as_C_string(),
+                      (found ? "" : " (NOT FOUND)"));
+      }
+    }
+  }
+  return found;
+}
+#define find_field find_hacked_field  /* remove after AllowTransitionalJSR292 */
+
 // Helpful routine for computing field offsets at run time rather than hardcoding them
 static void
 compute_offset(int &dest_offset,
@@ -2176,41 +2198,43 @@
 }
 
 
-// Support for java_dyn_MethodHandle
-
-int java_dyn_MethodHandle::_type_offset;
-int java_dyn_MethodHandle::_vmtarget_offset;
-int java_dyn_MethodHandle::_vmentry_offset;
-int java_dyn_MethodHandle::_vmslots_offset;
-
-int sun_dyn_MemberName::_clazz_offset;
-int sun_dyn_MemberName::_name_offset;
-int sun_dyn_MemberName::_type_offset;
-int sun_dyn_MemberName::_flags_offset;
-int sun_dyn_MemberName::_vmtarget_offset;
-int sun_dyn_MemberName::_vmindex_offset;
-
-int sun_dyn_DirectMethodHandle::_vmindex_offset;
-
-int sun_dyn_BoundMethodHandle::_argument_offset;
-int sun_dyn_BoundMethodHandle::_vmargslot_offset;
-
-int sun_dyn_AdapterMethodHandle::_conversion_offset;
-
-void java_dyn_MethodHandle::compute_offsets() {
+// Support for java_lang_invoke_MethodHandle
+
+int java_lang_invoke_MethodHandle::_type_offset;
+int java_lang_invoke_MethodHandle::_vmtarget_offset;
+int java_lang_invoke_MethodHandle::_vmentry_offset;
+int java_lang_invoke_MethodHandle::_vmslots_offset;
+
+int java_lang_invoke_MemberName::_clazz_offset;
+int java_lang_invoke_MemberName::_name_offset;
+int java_lang_invoke_MemberName::_type_offset;
+int java_lang_invoke_MemberName::_flags_offset;
+int java_lang_invoke_MemberName::_vmtarget_offset;
+int java_lang_invoke_MemberName::_vmindex_offset;
+
+int java_lang_invoke_DirectMethodHandle::_vmindex_offset;
+
+int java_lang_invoke_BoundMethodHandle::_argument_offset;
+int java_lang_invoke_BoundMethodHandle::_vmargslot_offset;
+
+int java_lang_invoke_AdapterMethodHandle::_conversion_offset;
+
+void java_lang_invoke_MethodHandle::compute_offsets() {
   klassOop k = SystemDictionary::MethodHandle_klass();
   if (k != NULL && EnableMethodHandles) {
-    compute_offset(_type_offset,      k, vmSymbols::type_name(),      vmSymbols::java_dyn_MethodType_signature(), true);
-    compute_offset(_vmtarget_offset,  k, vmSymbols::vmtarget_name(),  vmSymbols::object_signature(), true);
-    compute_offset(_vmentry_offset,   k, vmSymbols::vmentry_name(),   vmSymbols::machine_word_signature(), true);
+    bool allow_super = false;
+    if (AllowTransitionalJSR292)  allow_super = true;  // temporary, to access java.dyn.MethodHandleImpl
+    compute_offset(_type_offset,      k, vmSymbols::type_name(),      vmSymbols::java_lang_invoke_MethodType_signature(), allow_super);
+    compute_offset(_vmtarget_offset,  k, vmSymbols::vmtarget_name(),  vmSymbols::object_signature(),                      allow_super);
+    compute_offset(_vmentry_offset,   k, vmSymbols::vmentry_name(),   vmSymbols::machine_word_signature(),                allow_super);
 
     // Note:  MH.vmslots (if it is present) is a hoisted copy of MH.type.form.vmslots.
     // It is optional pending experiments to keep or toss.
-    compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), true);
+    compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), allow_super);
   }
 }
 
-void sun_dyn_MemberName::compute_offsets() {
+void java_lang_invoke_MemberName::compute_offsets() {
   klassOop k = SystemDictionary::MemberName_klass();
   if (k != NULL && EnableMethodHandles) {
     compute_offset(_clazz_offset,     k, vmSymbols::clazz_name(),     vmSymbols::class_signature());
@@ -2222,14 +2246,14 @@
   }
 }
 
-void sun_dyn_DirectMethodHandle::compute_offsets() {
+void java_lang_invoke_DirectMethodHandle::compute_offsets() {
   klassOop k = SystemDictionary::DirectMethodHandle_klass();
   if (k != NULL && EnableMethodHandles) {
     compute_offset(_vmindex_offset,   k, vmSymbols::vmindex_name(),   vmSymbols::int_signature(),    true);
   }
 }
 
-void sun_dyn_BoundMethodHandle::compute_offsets() {
+void java_lang_invoke_BoundMethodHandle::compute_offsets() {
   klassOop k = SystemDictionary::BoundMethodHandle_klass();
   if (k != NULL && EnableMethodHandles) {
     compute_offset(_vmargslot_offset, k, vmSymbols::vmargslot_name(), vmSymbols::int_signature(),    true);
@@ -2237,22 +2261,22 @@
   }
 }
 
-void sun_dyn_AdapterMethodHandle::compute_offsets() {
+void java_lang_invoke_AdapterMethodHandle::compute_offsets() {
   klassOop k = SystemDictionary::AdapterMethodHandle_klass();
   if (k != NULL && EnableMethodHandles) {
     compute_offset(_conversion_offset, k, vmSymbols::conversion_name(), vmSymbols::int_signature(), true);
   }
 }
 
-oop java_dyn_MethodHandle::type(oop mh) {
+oop java_lang_invoke_MethodHandle::type(oop mh) {
   return mh->obj_field(_type_offset);
 }
 
-void java_dyn_MethodHandle::set_type(oop mh, oop mtype) {
+void java_lang_invoke_MethodHandle::set_type(oop mh, oop mtype) {
   mh->obj_field_put(_type_offset, mtype);
 }
 
-int java_dyn_MethodHandle::vmslots(oop mh) {
+int java_lang_invoke_MethodHandle::vmslots(oop mh) {
   int vmslots_offset = _vmslots_offset;
   if (vmslots_offset != 0) {
 #ifdef ASSERT
@@ -2267,7 +2291,7 @@
 }
 
 // if MH.vmslots exists, hoist into it the value of type.form.vmslots
-void java_dyn_MethodHandle::init_vmslots(oop mh) {
+void java_lang_invoke_MethodHandle::init_vmslots(oop mh) {
   int vmslots_offset = _vmslots_offset;
   if (vmslots_offset != 0) {
     mh->int_field_put(vmslots_offset, compute_vmslots(mh));
@@ -2276,20 +2300,20 @@
 
 // fetch type.form.vmslots, which is the number of JVM stack slots
 // required to carry the arguments of this MH
-int java_dyn_MethodHandle::compute_vmslots(oop mh) {
+int java_lang_invoke_MethodHandle::compute_vmslots(oop mh) {
   oop mtype = type(mh);
   if (mtype == NULL)  return 0;  // Java code would get NPE
-  oop form = java_dyn_MethodType::form(mtype);
+  oop form = java_lang_invoke_MethodType::form(mtype);
   if (form == NULL)   return 0;  // Java code would get NPE
-  return java_dyn_MethodTypeForm::vmslots(form);
+  return java_lang_invoke_MethodTypeForm::vmslots(form);
 }
 
 // fetch the low-level entry point for this mh
-MethodHandleEntry* java_dyn_MethodHandle::vmentry(oop mh) {
+MethodHandleEntry* java_lang_invoke_MethodHandle::vmentry(oop mh) {
   return (MethodHandleEntry*) mh->address_field(_vmentry_offset);
 }
 
-void java_dyn_MethodHandle::set_vmentry(oop mh, MethodHandleEntry* me) {
+void java_lang_invoke_MethodHandle::set_vmentry(oop mh, MethodHandleEntry* me) {
   assert(_vmentry_offset != 0, "must be present");
 
   // This is always the final step that initializes a valid method handle:
@@ -2303,123 +2327,123 @@
 
 /// MemberName accessors
 
-oop sun_dyn_MemberName::clazz(oop mname) {
+oop java_lang_invoke_MemberName::clazz(oop mname) {
   assert(is_instance(mname), "wrong type");
   return mname->obj_field(_clazz_offset);
 }
 
-void sun_dyn_MemberName::set_clazz(oop mname, oop clazz) {
+void java_lang_invoke_MemberName::set_clazz(oop mname, oop clazz) {
   assert(is_instance(mname), "wrong type");
   mname->obj_field_put(_clazz_offset, clazz);
 }
 
-oop sun_dyn_MemberName::name(oop mname) {
+oop java_lang_invoke_MemberName::name(oop mname) {
   assert(is_instance(mname), "wrong type");
   return mname->obj_field(_name_offset);
 }
 
-void sun_dyn_MemberName::set_name(oop mname, oop name) {
+void java_lang_invoke_MemberName::set_name(oop mname, oop name) {
   assert(is_instance(mname), "wrong type");
   mname->obj_field_put(_name_offset, name);
 }
 
-oop sun_dyn_MemberName::type(oop mname) {
+oop java_lang_invoke_MemberName::type(oop mname) {
   assert(is_instance(mname), "wrong type");
   return mname->obj_field(_type_offset);
 }
 
-void sun_dyn_MemberName::set_type(oop mname, oop type) {
+void java_lang_invoke_MemberName::set_type(oop mname, oop type) {
   assert(is_instance(mname), "wrong type");
   mname->obj_field_put(_type_offset, type);
 }
 
-int sun_dyn_MemberName::flags(oop mname) {
+int java_lang_invoke_MemberName::flags(oop mname) {
   assert(is_instance(mname), "wrong type");
   return mname->int_field(_flags_offset);
 }
 
-void sun_dyn_MemberName::set_flags(oop mname, int flags) {
+void java_lang_invoke_MemberName::set_flags(oop mname, int flags) {
   assert(is_instance(mname), "wrong type");
   mname->int_field_put(_flags_offset, flags);
 }
 
-oop sun_dyn_MemberName::vmtarget(oop mname) {
+oop java_lang_invoke_MemberName::vmtarget(oop mname) {
   assert(is_instance(mname), "wrong type");
   return mname->obj_field(_vmtarget_offset);
 }
 
-void sun_dyn_MemberName::set_vmtarget(oop mname, oop ref) {
+void java_lang_invoke_MemberName::set_vmtarget(oop mname, oop ref) {
   assert(is_instance(mname), "wrong type");
   mname->obj_field_put(_vmtarget_offset, ref);
 }
 
-int sun_dyn_MemberName::vmindex(oop mname) {
+int java_lang_invoke_MemberName::vmindex(oop mname) {
   assert(is_instance(mname), "wrong type");
   return mname->int_field(_vmindex_offset);
 }
 
-void sun_dyn_MemberName::set_vmindex(oop mname, int index) {
+void java_lang_invoke_MemberName::set_vmindex(oop mname, int index) {
   assert(is_instance(mname), "wrong type");
   mname->int_field_put(_vmindex_offset, index);
 }
 
-oop java_dyn_MethodHandle::vmtarget(oop mh) {
+oop java_lang_invoke_MethodHandle::vmtarget(oop mh) {
   assert(is_instance(mh), "MH only");
   return mh->obj_field(_vmtarget_offset);
 }
 
-void java_dyn_MethodHandle::set_vmtarget(oop mh, oop ref) {
+void java_lang_invoke_MethodHandle::set_vmtarget(oop mh, oop ref) {
   assert(is_instance(mh), "MH only");
   mh->obj_field_put(_vmtarget_offset, ref);
 }
 
-int sun_dyn_DirectMethodHandle::vmindex(oop mh) {
+int java_lang_invoke_DirectMethodHandle::vmindex(oop mh) {
   assert(is_instance(mh), "DMH only");
   return mh->int_field(_vmindex_offset);
 }
 
-void sun_dyn_DirectMethodHandle::set_vmindex(oop mh, int index) {
+void java_lang_invoke_DirectMethodHandle::set_vmindex(oop mh, int index) {
   assert(is_instance(mh), "DMH only");
   mh->int_field_put(_vmindex_offset, index);
 }
 
-int sun_dyn_BoundMethodHandle::vmargslot(oop mh) {
+int java_lang_invoke_BoundMethodHandle::vmargslot(oop mh) {
   assert(is_instance(mh), "BMH only");
   return mh->int_field(_vmargslot_offset);
 }
 
-oop sun_dyn_BoundMethodHandle::argument(oop mh) {
+oop java_lang_invoke_BoundMethodHandle::argument(oop mh) {
   assert(is_instance(mh), "BMH only");
   return mh->obj_field(_argument_offset);
 }
 
-int sun_dyn_AdapterMethodHandle::conversion(oop mh) {
+int java_lang_invoke_AdapterMethodHandle::conversion(oop mh) {
   assert(is_instance(mh), "AMH only");
   return mh->int_field(_conversion_offset);
 }
 
-void sun_dyn_AdapterMethodHandle::set_conversion(oop mh, int conv) {
+void java_lang_invoke_AdapterMethodHandle::set_conversion(oop mh, int conv) {
   assert(is_instance(mh), "AMH only");
   mh->int_field_put(_conversion_offset, conv);
 }
 
 
-// Support for java_dyn_MethodType
-
-int java_dyn_MethodType::_rtype_offset;
-int java_dyn_MethodType::_ptypes_offset;
-int java_dyn_MethodType::_form_offset;
-
-void java_dyn_MethodType::compute_offsets() {
+// Support for java_lang_invoke_MethodType
+
+int java_lang_invoke_MethodType::_rtype_offset;
+int java_lang_invoke_MethodType::_ptypes_offset;
+int java_lang_invoke_MethodType::_form_offset;
+
+void java_lang_invoke_MethodType::compute_offsets() {
   klassOop k = SystemDictionary::MethodType_klass();
   if (k != NULL) {
     compute_offset(_rtype_offset,  k, vmSymbols::rtype_name(),  vmSymbols::class_signature());
     compute_offset(_ptypes_offset, k, vmSymbols::ptypes_name(), vmSymbols::class_array_signature());
-    compute_offset(_form_offset,   k, vmSymbols::form_name(),   vmSymbols::java_dyn_MethodTypeForm_signature());
+    compute_offset(_form_offset,   k, vmSymbols::form_name(),   vmSymbols::java_lang_invoke_MethodTypeForm_signature());
   }
 }
 
-void java_dyn_MethodType::print_signature(oop mt, outputStream* st) {
+void java_lang_invoke_MethodType::print_signature(oop mt, outputStream* st) {
   st->print("(");
   objArrayOop pts = ptypes(mt);
   for (int i = 0, limit = pts->length(); i < limit; i++) {
@@ -2429,7 +2453,7 @@
   java_lang_Class::print_signature(rtype(mt), st);
 }
 
-Symbol* java_dyn_MethodType::as_signature(oop mt, bool intern_if_not_found, TRAPS) {
+Symbol* java_lang_invoke_MethodType::as_signature(oop mt, bool intern_if_not_found, TRAPS) {
   ResourceMark rm;
   stringStream buffer(128);
   print_signature(mt, &buffer);
@@ -2444,103 +2468,83 @@
   return name;
 }
 
-oop java_dyn_MethodType::rtype(oop mt) {
+oop java_lang_invoke_MethodType::rtype(oop mt) {
   assert(is_instance(mt), "must be a MethodType");
   return mt->obj_field(_rtype_offset);
 }
 
-objArrayOop java_dyn_MethodType::ptypes(oop mt) {
+objArrayOop java_lang_invoke_MethodType::ptypes(oop mt) {
   assert(is_instance(mt), "must be a MethodType");
   return (objArrayOop) mt->obj_field(_ptypes_offset);
 }
 
-oop java_dyn_MethodType::form(oop mt) {
+oop java_lang_invoke_MethodType::form(oop mt) {
   assert(is_instance(mt), "must be a MethodType");
   return mt->obj_field(_form_offset);
 }
 
-oop java_dyn_MethodType::ptype(oop mt, int idx) {
+oop java_lang_invoke_MethodType::ptype(oop mt, int idx) {
   return ptypes(mt)->obj_at(idx);
 }
 
-int java_dyn_MethodType::ptype_count(oop mt) {
+int java_lang_invoke_MethodType::ptype_count(oop mt) {
   return ptypes(mt)->length();
 }
 
 
 
-// Support for java_dyn_MethodTypeForm
-
-int java_dyn_MethodTypeForm::_vmslots_offset;
-int java_dyn_MethodTypeForm::_erasedType_offset;
-int java_dyn_MethodTypeForm::_genericInvoker_offset;
-
-void java_dyn_MethodTypeForm::compute_offsets() {
+// Support for java_lang_invoke_MethodTypeForm
+
+int java_lang_invoke_MethodTypeForm::_vmslots_offset;
+int java_lang_invoke_MethodTypeForm::_erasedType_offset;
+int java_lang_invoke_MethodTypeForm::_genericInvoker_offset;
+
+void java_lang_invoke_MethodTypeForm::compute_offsets() {
   klassOop k = SystemDictionary::MethodTypeForm_klass();
   if (k != NULL) {
     compute_optional_offset(_vmslots_offset,    k, vmSymbols::vmslots_name(),    vmSymbols::int_signature(), true);
-    compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_dyn_MethodType_signature(), true);
-    compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_dyn_MethodHandle_signature(), true);
+    compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_lang_invoke_MethodType_signature(), true);
+    compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_lang_invoke_MethodHandle_signature(), true);
     if (_genericInvoker_offset == 0)  _genericInvoker_offset = -1;  // set to explicit "empty" value
   }
 }
 
-int java_dyn_MethodTypeForm::vmslots(oop mtform) {
+int java_lang_invoke_MethodTypeForm::vmslots(oop mtform) {
   assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
   return mtform->int_field(_vmslots_offset);
 }
 
-oop java_dyn_MethodTypeForm::erasedType(oop mtform) {
+oop java_lang_invoke_MethodTypeForm::erasedType(oop mtform) {
   assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
   return mtform->obj_field(_erasedType_offset);
 }
 
-oop java_dyn_MethodTypeForm::genericInvoker(oop mtform) {
+oop java_lang_invoke_MethodTypeForm::genericInvoker(oop mtform) {
   assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
   return mtform->obj_field(_genericInvoker_offset);
 }
 
 
-// Support for java_dyn_CallSite
-
-int java_dyn_CallSite::_target_offset;
-int java_dyn_CallSite::_caller_method_offset;
-int java_dyn_CallSite::_caller_bci_offset;
-
-void java_dyn_CallSite::compute_offsets() {
+// Support for java_lang_invoke_CallSite
+
+int java_lang_invoke_CallSite::_target_offset;
+
+void java_lang_invoke_CallSite::compute_offsets() {
   if (!EnableInvokeDynamic)  return;
   klassOop k = SystemDictionary::CallSite_klass();
   if (k != NULL) {
-    compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature());
-    compute_offset(_caller_method_offset, k, vmSymbols::vmmethod_name(), vmSymbols::sun_dyn_MemberName_signature());
-    compute_offset(_caller_bci_offset, k, vmSymbols::vmindex_name(), vmSymbols::int_signature());
+    compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
   }
 }
 
-oop java_dyn_CallSite::target(oop site) {
+oop java_lang_invoke_CallSite::target(oop site) {
   return site->obj_field(_target_offset);
 }
 
-void java_dyn_CallSite::set_target(oop site, oop target) {
+void java_lang_invoke_CallSite::set_target(oop site, oop target) {
   site->obj_field_put(_target_offset, target);
 }
 
-oop java_dyn_CallSite::caller_method(oop site) {
-  return site->obj_field(_caller_method_offset);
-}
-
-void java_dyn_CallSite::set_caller_method(oop site, oop ref) {
-  site->obj_field_put(_caller_method_offset, ref);
-}
-
-jint java_dyn_CallSite::caller_bci(oop site) {
-  return site->int_field(_caller_bci_offset);
-}
-
-void java_dyn_CallSite::set_caller_bci(oop site, jint bci) {
-  site->int_field_put(_caller_bci_offset, bci);
-}
-
 
 // Support for java_security_AccessControlContext
 
@@ -2877,16 +2881,16 @@
   java_lang_Thread::compute_offsets();
   java_lang_ThreadGroup::compute_offsets();
   if (EnableMethodHandles) {
-    java_dyn_MethodHandle::compute_offsets();
-    sun_dyn_MemberName::compute_offsets();
-    sun_dyn_DirectMethodHandle::compute_offsets();
-    sun_dyn_BoundMethodHandle::compute_offsets();
-    sun_dyn_AdapterMethodHandle::compute_offsets();
-    java_dyn_MethodType::compute_offsets();
-    java_dyn_MethodTypeForm::compute_offsets();
+    java_lang_invoke_MethodHandle::compute_offsets();
+    java_lang_invoke_MemberName::compute_offsets();
+    java_lang_invoke_DirectMethodHandle::compute_offsets();
+    java_lang_invoke_BoundMethodHandle::compute_offsets();
+    java_lang_invoke_AdapterMethodHandle::compute_offsets();
+    java_lang_invoke_MethodType::compute_offsets();
+    java_lang_invoke_MethodTypeForm::compute_offsets();
   }
   if (EnableInvokeDynamic) {
-    java_dyn_CallSite::compute_offsets();
+    java_lang_invoke_CallSite::compute_offsets();
   }
   java_security_AccessControlContext::compute_offsets();
   // Initialize reflection classes. The layouts of these classes
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -794,11 +794,11 @@
 };
 
 
-// Interface to java.dyn.MethodHandle objects
+// Interface to java.lang.invoke.MethodHandle objects
 
 class MethodHandleEntry;
 
-class java_dyn_MethodHandle: AllStatic {
+class java_lang_invoke_MethodHandle: AllStatic {
   friend class JavaClasses;
 
  private:
@@ -839,7 +839,7 @@
   static int vmslots_offset_in_bytes()          { return _vmslots_offset; }
 };
 
-class sun_dyn_DirectMethodHandle: public java_dyn_MethodHandle {
+class java_lang_invoke_DirectMethodHandle: public java_lang_invoke_MethodHandle {
   friend class JavaClasses;
 
  private:
@@ -864,7 +864,7 @@
   static int vmindex_offset_in_bytes()          { return _vmindex_offset; }
 };
 
-class sun_dyn_BoundMethodHandle: public java_dyn_MethodHandle {
+class java_lang_invoke_BoundMethodHandle: public java_lang_invoke_MethodHandle {
   friend class JavaClasses;
 
  private:
@@ -891,7 +891,7 @@
   static int vmargslot_offset_in_bytes()        { return _vmargslot_offset; }
 };
 
-class sun_dyn_AdapterMethodHandle: public sun_dyn_BoundMethodHandle {
+class java_lang_invoke_AdapterMethodHandle: public java_lang_invoke_BoundMethodHandle {
   friend class JavaClasses;
 
  private:
@@ -942,14 +942,14 @@
 };
 
 
-// Interface to sun.dyn.MemberName objects
+// Interface to java.lang.invoke.MemberName objects
 // (These are a private interface for Java code to query the class hierarchy.)
 
-class sun_dyn_MemberName: AllStatic {
+class java_lang_invoke_MemberName: AllStatic {
   friend class JavaClasses;
 
  private:
-  // From java.dyn.MemberName:
+  // From java.lang.invoke.MemberName:
   //    private Class<?>   clazz;       // class in which the method is defined
   //    private String     name;        // may be null if not yet materialized
   //    private Object     type;        // may be null if not yet materialized
@@ -1018,9 +1018,9 @@
 };
 
 
-// Interface to java.dyn.MethodType objects
+// Interface to java.lang.invoke.MethodType objects
 
-class java_dyn_MethodType: AllStatic {
+class java_lang_invoke_MethodType: AllStatic {
   friend class JavaClasses;
 
  private:
@@ -1052,7 +1052,7 @@
   static int form_offset_in_bytes()             { return _form_offset; }
 };
 
-class java_dyn_MethodTypeForm: AllStatic {
+class java_lang_invoke_MethodTypeForm: AllStatic {
   friend class JavaClasses;
 
  private:
@@ -1075,9 +1075,9 @@
 };
 
 
-// Interface to java.dyn.CallSite objects
+// Interface to java.lang.invoke.CallSite objects
 
-class java_dyn_CallSite: AllStatic {
+class java_lang_invoke_CallSite: AllStatic {
   friend class JavaClasses;
 
 private:
--- a/hotspot/src/share/vm/classfile/stackMapFrame.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/stackMapFrame.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -170,6 +170,44 @@
   return true;
 }
 
+bool StackMapFrame::has_flag_match_exception(
+    const StackMapFrame* target) const {
+  // We allow flags of {UninitThis} to assign to {} if-and-only-if the
+  // target frame does not depend upon the current type.
+  // This is slightly too strict, as we need only enforce that the
+  // slots that were initialized by the <init> (the things that were
+  // UninitializedThis before initialize_object() converted them) are unused.
+  // However we didn't save that information so we'll enforce this upon
+  // anything that might have been initialized.  This is a rare situation
+  // and javac never generates code that would end up here, but some profilers
+  // (such as NetBeans) might, when adding exception handlers in <init>
+  // methods to cover the invokespecial instruction.  See 7020118.
+
+  assert(max_locals() == target->max_locals() &&
+         stack_size() == target->stack_size(), "StackMap sizes must match");
+
+  VerificationType top = VerificationType::top_type();
+  VerificationType this_type = verifier()->current_type();
+
+  if (!flag_this_uninit() || target->flags() != 0) {
+    return false;
+  }
+
+  for (int i = 0; i < target->locals_size(); ++i) {
+    if (locals()[i] == this_type && target->locals()[i] != top) {
+      return false;
+    }
+  }
+
+  for (int i = 0; i < target->stack_size(); ++i) {
+    if (stack()[i] == this_type && target->stack()[i] != top) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
 bool StackMapFrame::is_assignable_to(const StackMapFrame* target, TRAPS) const {
   if (_max_locals != target->max_locals() || _stack_size != target->stack_size()) {
     return false;
@@ -182,7 +220,9 @@
   bool match_stack = is_assignable_to(
     _stack, target->stack(), _stack_size, CHECK_false);
   bool match_flags = (_flags | target->flags()) == target->flags();
-  return (match_locals && match_stack && match_flags);
+
+  return match_locals && match_stack &&
+    (match_flags || has_flag_match_exception(target));
 }
 
 VerificationType StackMapFrame::pop_stack_ex(VerificationType type, TRAPS) {
--- a/hotspot/src/share/vm/classfile/stackMapFrame.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/stackMapFrame.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -228,6 +228,8 @@
   bool is_assignable_to(
     VerificationType* src, VerificationType* target, int32_t len, TRAPS) const;
 
+  bool has_flag_match_exception(const StackMapFrame* target) const;
+
   // Debugging
   void print() const PRODUCT_RETURN;
 };
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -88,7 +88,7 @@
 void SymbolTable::unlink() {
   int removed = 0;
   int total = 0;
-  int memory_total = 0;
+  size_t memory_total = 0;
   for (int i = 0; i < the_table()->table_size(); ++i) {
     for (HashtableEntry<Symbol*>** p = the_table()->bucket_addr(i); *p != NULL; ) {
       HashtableEntry<Symbol*>* entry = *p;
@@ -112,8 +112,10 @@
   }
   symbols_removed += removed;
   symbols_counted += total;
-  if (PrintGCDetails) {
-    gclog_or_tty->print(" [Symbols=%d size=%dK] ", total,
+  // Exclude printing for normal PrintGCDetails because people parse
+  // this output.
+  if (PrintGCDetails && Verbose && WizardMode) {
+    gclog_or_tty->print(" [Symbols=%d size=" SIZE_FORMAT "K] ", total,
                         (memory_total*HeapWordSize)/1024);
   }
 }
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1887,27 +1887,99 @@
   0
 };
 
+Symbol* SystemDictionary::find_backup_symbol(Symbol* symbol,
+                                             const char* from_prefix,
+                                             const char* to_prefix) {
+  assert(AllowTransitionalJSR292, "");  // delete this subroutine
+  Symbol* backup_symbol = NULL;
+  size_t from_len = strlen(from_prefix);
+  if (strncmp((const char*) symbol->base(), from_prefix, from_len) != 0)
+    return NULL;
+  char buf[100];
+  size_t to_len = strlen(to_prefix);
+  size_t tail_len = symbol->utf8_length() - from_len;
+  size_t new_len = to_len + tail_len;
+  guarantee(new_len < sizeof(buf), "buf too small");
+  memcpy(buf, to_prefix, to_len);
+  memcpy(buf + to_len, symbol->base() + from_len, tail_len);
+  buf[new_len] = '\0';
+  vmSymbols::SID backup_sid = vmSymbols::find_sid(buf);
+  if (backup_sid != vmSymbols::NO_SID) {
+    backup_symbol = vmSymbols::symbol_at(backup_sid);
+  }
+  return backup_symbol;
+}
+
+Symbol* SystemDictionary::find_backup_class_name(Symbol* symbol) {
+  assert(AllowTransitionalJSR292, "");  // delete this subroutine
+  if (symbol == NULL)  return NULL;
+  Symbol* backup_symbol = find_backup_symbol(symbol, "java/lang/invoke/", "java/dyn/");  // AllowTransitionalJSR292 ONLY
+  if (backup_symbol == NULL)
+    backup_symbol = find_backup_symbol(symbol, "java/dyn/", "sun/dyn/");  // AllowTransitionalJSR292 ONLY
+  return backup_symbol;
+}
+
+Symbol* SystemDictionary::find_backup_signature(Symbol* symbol) {
+  assert(AllowTransitionalJSR292, "");  // delete this subroutine
+  if (symbol == NULL)  return NULL;
+  return find_backup_symbol(symbol, "Ljava/lang/invoke/", "Ljava/dyn/");
+}
+
 bool SystemDictionary::initialize_wk_klass(WKID id, int init_opt, TRAPS) {
   assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
   int  info = wk_init_info[id - FIRST_WKID];
   int  sid  = (info >> CEIL_LG_OPTION_LIMIT);
   Symbol* symbol = vmSymbols::symbol_at((vmSymbols::SID)sid);
   klassOop*    klassp = &_well_known_klasses[id];
-  bool must_load = (init_opt < SystemDictionary::Opt);
-  bool try_load  = true;
+  bool pre_load = (init_opt < SystemDictionary::Opt);
+  bool try_load = true;
   if (init_opt == SystemDictionary::Opt_Kernel) {
 #ifndef KERNEL
     try_load = false;
 #endif //KERNEL
   }
-  if ((*klassp) == NULL && try_load) {
+  Symbol* backup_symbol = NULL;  // symbol to try if the current symbol fails
+  if (init_opt == SystemDictionary::Pre_JSR292) {
+    if (!EnableMethodHandles)  try_load = false;  // do not bother to load such classes
+    if (AllowTransitionalJSR292) {
+      backup_symbol = find_backup_class_name(symbol);
+      if (try_load && PreferTransitionalJSR292) {
+        while (backup_symbol != NULL) {
+          (*klassp) = resolve_or_null(backup_symbol, CHECK_0); // try backup early
+          if (TraceMethodHandles) {
+            ResourceMark rm;
+            tty->print_cr("MethodHandles: try backup first for %s => %s (%s)",
+                          symbol->as_C_string(), backup_symbol->as_C_string(),
+                          ((*klassp) == NULL) ? "no such class" : "backup load succeeded");
+          }
+          if ((*klassp) != NULL)  return true;
+          backup_symbol = find_backup_class_name(backup_symbol);  // find next backup
+        }
+      }
+    }
+  }
+  if ((*klassp) != NULL)  return true;
+  if (!try_load)          return false;
+  while (symbol != NULL) {
+    bool must_load = (pre_load && (backup_symbol == NULL));
     if (must_load) {
       (*klassp) = resolve_or_fail(symbol, true, CHECK_0); // load required class
     } else {
       (*klassp) = resolve_or_null(symbol,       CHECK_0); // load optional klass
     }
+    if ((*klassp) != NULL)  return true;
+    // Go around again.  Example of long backup sequence:
+    // java.lang.invoke.MemberName, java.dyn.MemberName, sun.dyn.MemberName, ONLY if AllowTransitionalJSR292
+    if (TraceMethodHandles && (backup_symbol != NULL)) {
+      ResourceMark rm;
+      tty->print_cr("MethodHandles: backup for %s => %s",
+                    symbol->as_C_string(), backup_symbol->as_C_string());
+    }
+    symbol = backup_symbol;
+    if (AllowTransitionalJSR292)
+      backup_symbol = find_backup_class_name(symbol);
   }
-  return ((*klassp) != NULL);
+  return false;
 }
 
 void SystemDictionary::initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS) {
@@ -2348,6 +2420,8 @@
     if (THREAD->is_Compiler_thread())
       return NULL;              // do not attempt from within compiler
     bool for_invokeGeneric = (name_id == vmSymbols::VM_SYMBOL_ENUM_NAME(invokeGeneric_name));
+    if (AllowInvokeForInvokeGeneric && name_id == vmSymbols::VM_SYMBOL_ENUM_NAME(invoke_name))
+      for_invokeGeneric = true;
     bool found_on_bcp = false;
     Handle mt = find_method_handle_type(signature, accessing_klass,
                                         for_invokeGeneric,
@@ -2376,7 +2450,7 @@
   }
 }
 
-// Ask Java code to find or construct a java.dyn.MethodType for the given
+// Ask Java code to find or construct a java.lang.invoke.MethodType for the given
 // signature, as interpreted relative to the given class loader.
 // Because of class loader constraints, all method handle usage must be
 // consistent with this loader.
@@ -2430,25 +2504,33 @@
   }
   assert(arg == npts, "");
 
-  // call sun.dyn.MethodHandleNatives::findMethodType(Class rt, Class[] pts) -> MethodType
+  // call java.lang.invoke.MethodHandleNatives::findMethodType(Class rt, Class[] pts) -> MethodType
   JavaCallArguments args(Handle(THREAD, rt()));
   args.push_oop(pts());
   JavaValue result(T_OBJECT);
+  Symbol* findMethodHandleType_signature = vmSymbols::findMethodHandleType_signature();
+  if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodType_klass()->name() == vmSymbols::java_dyn_MethodType()) {
+    findMethodHandleType_signature = vmSymbols::findMethodHandleType_TRANS_signature();
+  }
   JavaCalls::call_static(&result,
                          SystemDictionary::MethodHandleNatives_klass(),
                          vmSymbols::findMethodHandleType_name(),
-                         vmSymbols::findMethodHandleType_signature(),
+                         findMethodHandleType_signature,
                          &args, CHECK_(empty));
   Handle method_type(THREAD, (oop) result.get_jobject());
 
   if (for_invokeGeneric) {
-    // call sun.dyn.MethodHandleNatives::notifyGenericMethodType(MethodType) -> void
+    // call java.lang.invoke.MethodHandleNatives::notifyGenericMethodType(MethodType) -> void
     JavaCallArguments args(Handle(THREAD, method_type()));
     JavaValue no_result(T_VOID);
+    Symbol* notifyGenericMethodType_signature = vmSymbols::notifyGenericMethodType_signature();
+    if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodType_klass()->name() == vmSymbols::java_dyn_MethodType()) {
+      notifyGenericMethodType_signature = vmSymbols::notifyGenericMethodType_TRANS_signature();
+    }
     JavaCalls::call_static(&no_result,
                            SystemDictionary::MethodHandleNatives_klass(),
                            vmSymbols::notifyGenericMethodType_name(),
-                           vmSymbols::notifyGenericMethodType_signature(),
+                           notifyGenericMethodType_signature,
                            &args, THREAD);
     if (HAS_PENDING_EXCEPTION) {
       // If the notification fails, just kill it.
@@ -2489,7 +2571,7 @@
     THROW_MSG_(vmSymbols::java_lang_LinkageError(), "bad signature", empty);
   }
 
-  // call sun.dyn.MethodHandleNatives::linkMethodHandleConstant(Class caller, int refKind, Class callee, String name, Object type) -> MethodHandle
+  // call java.lang.invoke.MethodHandleNatives::linkMethodHandleConstant(Class caller, int refKind, Class callee, String name, Object type) -> MethodHandle
   JavaCallArguments args;
   args.push_oop(caller->java_mirror());  // the referring class
   args.push_int(ref_kind);
@@ -2497,15 +2579,19 @@
   args.push_oop(name());
   args.push_oop(type());
   JavaValue result(T_OBJECT);
+  Symbol* linkMethodHandleConstant_signature = vmSymbols::linkMethodHandleConstant_signature();
+  if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodHandle_klass()->name() == vmSymbols::java_dyn_MethodHandle()) {
+    linkMethodHandleConstant_signature = vmSymbols::linkMethodHandleConstant_TRANS_signature();
+  }
   JavaCalls::call_static(&result,
                          SystemDictionary::MethodHandleNatives_klass(),
                          vmSymbols::linkMethodHandleConstant_name(),
-                         vmSymbols::linkMethodHandleConstant_signature(),
+                         linkMethodHandleConstant_signature,
                          &args, CHECK_(empty));
   return Handle(THREAD, (oop) result.get_jobject());
 }
 
-// Ask Java code to find or construct a java.dyn.CallSite for the given
+// Ask Java code to find or construct a java.lang.invoke.CallSite for the given
 // name and signature, as interpreted relative to the given class loader.
 Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
                                                 Symbol* name,
@@ -2516,13 +2602,13 @@
                                                 TRAPS) {
   Handle empty;
   guarantee(bootstrap_method.not_null() &&
-            java_dyn_MethodHandle::is_instance(bootstrap_method()),
+            java_lang_invoke_MethodHandle::is_instance(bootstrap_method()),
             "caller must supply a valid BSM");
 
   Handle caller_mname = MethodHandles::new_MemberName(CHECK_(empty));
   MethodHandles::init_MemberName(caller_mname(), caller_method());
 
-  // call sun.dyn.MethodHandleNatives::makeDynamicCallSite(bootm, name, mtype, info, caller_mname, caller_pos)
+  // call java.lang.invoke.MethodHandleNatives::makeDynamicCallSite(bootm, name, mtype, info, caller_mname, caller_pos)
   oop name_str_oop = StringTable::intern(name, CHECK_(empty)); // not a handle!
   JavaCallArguments args(Handle(THREAD, bootstrap_method()));
   args.push_oop(name_str_oop);
@@ -2531,14 +2617,21 @@
   args.push_oop(caller_mname());
   args.push_int(caller_bci);
   JavaValue result(T_OBJECT);
+  Symbol* makeDynamicCallSite_signature = vmSymbols::makeDynamicCallSite_signature();
+  if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodHandleNatives_klass()->name() == vmSymbols::sun_dyn_MethodHandleNatives()) {
+    makeDynamicCallSite_signature = vmSymbols::makeDynamicCallSite_TRANS_signature();
+  }
+  if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodHandleNatives_klass()->name() == vmSymbols::java_dyn_MethodHandleNatives()) {
+    makeDynamicCallSite_signature = vmSymbols::makeDynamicCallSite_TRANS2_signature();
+  }
   JavaCalls::call_static(&result,
                          SystemDictionary::MethodHandleNatives_klass(),
                          vmSymbols::makeDynamicCallSite_name(),
-                         vmSymbols::makeDynamicCallSite_signature(),
+                         makeDynamicCallSite_signature,
                          &args, CHECK_(empty));
   oop call_site_oop = (oop) result.get_jobject();
   assert(call_site_oop->is_oop()
-         /*&& java_dyn_CallSite::is_instance(call_site_oop)*/, "must be sane");
+         /*&& java_lang_invoke_CallSite::is_instance(call_site_oop)*/, "must be sane");
   if (TraceMethodHandles) {
 #ifndef PRODUCT
     tty->print_cr("Linked invokedynamic bci=%d site="INTPTR_FORMAT":", caller_bci, call_site_oop);
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -144,18 +144,18 @@
   template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \
                                                                               \
   /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
-  template(MethodHandle_klass,           java_dyn_MethodHandle,          Opt) \
-  template(MemberName_klass,             sun_dyn_MemberName,             Opt) \
-  template(MethodHandleImpl_klass,       sun_dyn_MethodHandleImpl,       Opt) \
-  template(MethodHandleNatives_klass,    sun_dyn_MethodHandleNatives,    Opt) \
-  template(AdapterMethodHandle_klass,    sun_dyn_AdapterMethodHandle,    Opt) \
-  template(BoundMethodHandle_klass,      sun_dyn_BoundMethodHandle,      Opt) \
-  template(DirectMethodHandle_klass,     sun_dyn_DirectMethodHandle,     Opt) \
-  template(MethodType_klass,             java_dyn_MethodType,            Opt) \
-  template(MethodTypeForm_klass,         java_dyn_MethodTypeForm,        Opt) \
-  template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Opt) \
-  template(Linkage_klass,                java_dyn_Linkage,               Opt) \
-  template(CallSite_klass,               java_dyn_CallSite,              Opt) \
+  template(MethodHandle_klass,           java_lang_invoke_MethodHandle,     Pre_JSR292) \
+  template(MemberName_klass,             java_lang_invoke_MemberName,       Pre_JSR292) \
+  template(MethodHandleImpl_klass,       sun_dyn_MethodHandleImpl,          Opt) /* AllowTransitionalJSR292 ONLY */ \
+  template(MethodHandleNatives_klass,    java_lang_invoke_MethodHandleNatives, Pre_JSR292) \
+  template(AdapterMethodHandle_klass,    java_lang_invoke_AdapterMethodHandle, Pre_JSR292) \
+  template(BoundMethodHandle_klass,      java_lang_invoke_BoundMethodHandle, Pre_JSR292) \
+  template(DirectMethodHandle_klass,     java_lang_invoke_DirectMethodHandle, Pre_JSR292) \
+  template(MethodType_klass,             java_lang_invoke_MethodType,       Pre_JSR292) \
+  template(MethodTypeForm_klass,         java_lang_invoke_MethodTypeForm,   Pre_JSR292) \
+  template(WrongMethodTypeException_klass, java_lang_invoke_WrongMethodTypeException, Pre_JSR292) \
+  template(Linkage_klass,                java_lang_invoke_Linkage,          Opt) /* AllowTransitionalJSR292 ONLY */ \
+  template(CallSite_klass,               java_lang_invoke_CallSite,         Pre_JSR292) \
   /* Note: MethodHandle must be first, and CallSite last in group */          \
                                                                               \
   template(StringBuffer_klass,           java_lang_StringBuffer,         Pre) \
@@ -207,6 +207,7 @@
 
   enum InitOption {
     Pre,                        // preloaded; error if not present
+    Pre_JSR292,                 // preloaded if EnableMethodHandles
 
     // Order is significant.  Options before this point require resolve_or_fail.
     // Options after this point will use resolve_or_null instead.
@@ -401,6 +402,7 @@
   }
 
   static klassOop check_klass_Pre(klassOop k) { return check_klass(k); }
+  static klassOop check_klass_Pre_JSR292(klassOop k) { return EnableInvokeDynamic ? check_klass(k) : k; }
   static klassOop check_klass_Opt(klassOop k) { return k; }
   static klassOop check_klass_Opt_Kernel(klassOop k) { return k; } //== Opt
   static klassOop check_klass_Opt_Only_JDK15(klassOop k) {
@@ -420,6 +422,8 @@
     initialize_wk_klasses_until((WKID) limit, start_id, THREAD);
   }
 
+  static Symbol* find_backup_symbol(Symbol* symbol, const char* from_prefix, const char* to_prefix);
+
 public:
   #define WK_KLASS_DECLARE(name, ignore_symbol, option) \
     static klassOop name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); }
@@ -441,6 +445,9 @@
 
   static void load_abstract_ownable_synchronizer_klass(TRAPS);
 
+  static Symbol* find_backup_class_name(Symbol* class_name_symbol);
+  static Symbol* find_backup_signature(Symbol* signature_symbol);
+
 private:
   // Tells whether ClassLoader.loadClassInternal is present
   static bool has_loadClassInternal()       { return _has_loadClassInternal; }
@@ -475,18 +482,18 @@
                                        Handle loader2, bool is_method, TRAPS);
 
   // JSR 292
-  // find the java.dyn.MethodHandles::invoke method for a given signature
+  // find the java.lang.invoke.MethodHandles::invoke method for a given signature
   static methodOop find_method_handle_invoke(Symbol* name,
                                              Symbol* signature,
                                              KlassHandle accessing_klass,
                                              TRAPS);
-  // ask Java to compute a java.dyn.MethodType object for a given signature
+  // ask Java to compute a java.lang.invoke.MethodType object for a given signature
   static Handle    find_method_handle_type(Symbol* signature,
                                            KlassHandle accessing_klass,
                                            bool for_invokeGeneric,
                                            bool& return_bcp_flag,
                                            TRAPS);
-  // ask Java to compute a java.dyn.MethodHandle object for a given CP entry
+  // ask Java to compute a java.lang.invoke.MethodHandle object for a given CP entry
   static Handle    link_method_handle_constant(KlassHandle caller,
                                                int ref_kind, //e.g., JVM_REF_invokeVirtual
                                                KlassHandle callee,
--- a/hotspot/src/share/vm/classfile/verificationType.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -128,6 +128,7 @@
 
   // Create verification types
   static VerificationType bogus_type() { return VerificationType(Bogus); }
+  static VerificationType top_type() { return bogus_type(); } // alias
   static VerificationType null_type() { return VerificationType(Null); }
   static VerificationType integer_type() { return VerificationType(Integer); }
   static VerificationType float_type() { return VerificationType(Float); }
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1671,13 +1671,19 @@
       VerificationType::long_type(),
       VerificationType::long2_type(), CHECK_VERIFY(this));
   } else if (tag.is_method_handle()) {
+    Symbol* methodHandle_name = vmSymbols::java_lang_invoke_MethodHandle();
+    if (AllowTransitionalJSR292 && !Universe::is_bootstrapping())
+      methodHandle_name = SystemDictionaryHandles::MethodHandle_klass()->name();
     current_frame->push_stack(
       VerificationType::reference_type(
-        vmSymbols::java_dyn_MethodHandle()), CHECK_VERIFY(this));
+        methodHandle_name), CHECK_VERIFY(this));
   } else if (tag.is_method_type()) {
+    Symbol* methodType_name = vmSymbols::java_lang_invoke_MethodType();
+    if (AllowTransitionalJSR292 && !Universe::is_bootstrapping())
+      methodType_name = SystemDictionaryHandles::MethodType_klass()->name();
     current_frame->push_stack(
       VerificationType::reference_type(
-        vmSymbols::java_dyn_MethodType()), CHECK_VERIFY(this));
+        methodType_name), CHECK_VERIFY(this));
   } else {
     verify_error(bci, "Invalid index in ldc");
     return;
--- a/hotspot/src/share/vm/classfile/vmSymbols.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +277,12 @@
   return sid;
 }
 
+vmSymbols::SID vmSymbols::find_sid(const char* symbol_name) {
+  Symbol* symbol = SymbolTable::probe(symbol_name, (int) strlen(symbol_name));
+  if (symbol == NULL)  return NO_SID;
+  return find_sid(symbol);
+}
+
 static vmIntrinsics::ID wrapper_intrinsic(BasicType type, bool unboxing) {
 #define TYPE2(type, unboxing) ((int)(type)*2 + ((unboxing) ? 1 : 0))
   switch (TYPE2(type, unboxing)) {
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -229,33 +229,60 @@
   template(base_name,                                 "base")                                     \
                                                                                                   \
   /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */                                   \
-  template(java_dyn_InvokeDynamic,                    "java/dyn/InvokeDynamic")                   \
-  template(java_dyn_Linkage,                          "java/dyn/Linkage")                         \
-  template(java_dyn_CallSite,                         "java/dyn/CallSite")                        \
-  template(java_dyn_MethodHandle,                     "java/dyn/MethodHandle")                    \
-  template(java_dyn_MethodType,                       "java/dyn/MethodType")                      \
-  template(java_dyn_WrongMethodTypeException,         "java/dyn/WrongMethodTypeException")        \
-  template(java_dyn_MethodType_signature,             "Ljava/dyn/MethodType;")                    \
-  template(java_dyn_MethodHandle_signature,           "Ljava/dyn/MethodHandle;")                  \
+  template(java_lang_invoke_InvokeDynamic,            "java/lang/invoke/InvokeDynamic")           \
+  template(java_lang_invoke_Linkage,                  "java/lang/invoke/Linkage")                 \
+  template(java_lang_invoke_CallSite,                 "java/lang/invoke/CallSite")                \
+  template(java_lang_invoke_MethodHandle,             "java/lang/invoke/MethodHandle")            \
+  template(java_lang_invoke_MethodType,               "java/lang/invoke/MethodType")              \
+  template(java_lang_invoke_WrongMethodTypeException, "java/lang/invoke/WrongMethodTypeException") \
+  template(java_lang_invoke_MethodType_signature,     "Ljava/lang/invoke/MethodType;")            \
+  template(java_lang_invoke_MethodHandle_signature,   "Ljava/lang/invoke/MethodHandle;")          \
   /* internal classes known only to the JVM: */                                                   \
-  template(java_dyn_MethodTypeForm,                   "java/dyn/MethodTypeForm")                  \
-  template(java_dyn_MethodTypeForm_signature,         "Ljava/dyn/MethodTypeForm;")                \
-  template(sun_dyn_MemberName,                        "sun/dyn/MemberName")                       \
-  template(sun_dyn_MemberName_signature,              "Lsun/dyn/MemberName;")                     \
-  template(sun_dyn_MethodHandleImpl,                  "sun/dyn/MethodHandleImpl")                 \
-  template(sun_dyn_MethodHandleNatives,               "sun/dyn/MethodHandleNatives")              \
-  template(sun_dyn_AdapterMethodHandle,               "sun/dyn/AdapterMethodHandle")              \
-  template(sun_dyn_BoundMethodHandle,                 "sun/dyn/BoundMethodHandle")                \
-  template(sun_dyn_DirectMethodHandle,                "sun/dyn/DirectMethodHandle")               \
-  /* internal up-calls made only by the JVM, via class sun.dyn.MethodHandleNatives: */            \
+  template(java_lang_invoke_MethodTypeForm,           "java/lang/invoke/MethodTypeForm")          \
+  template(java_lang_invoke_MethodTypeForm_signature, "Ljava/lang/invoke/MethodTypeForm;")        \
+  template(java_lang_invoke_MemberName,               "java/lang/invoke/MemberName")              \
+  template(java_lang_invoke_MethodHandleNatives,      "java/lang/invoke/MethodHandleNatives")     \
+  template(java_lang_invoke_AdapterMethodHandle,      "java/lang/invoke/AdapterMethodHandle")     \
+  template(java_lang_invoke_BoundMethodHandle,        "java/lang/invoke/BoundMethodHandle")       \
+  template(java_lang_invoke_DirectMethodHandle,       "java/lang/invoke/DirectMethodHandle")      \
+  /* temporary transitional public names from 6839872: */                                         \
+  template(java_dyn_InvokeDynamic,                    "java/dyn/InvokeDynamic")         /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_Linkage,                          "java/dyn/Linkage")               /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_CallSite,                         "java/dyn/CallSite")              /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_MethodHandle,                     "java/dyn/MethodHandle")          /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_MethodType,                       "java/dyn/MethodType")            /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_WrongMethodTypeException,         "java/dyn/WrongMethodTypeException") /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_MethodType_signature,             "Ljava/dyn/MethodType;")          /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_MethodHandle_signature,           "Ljava/dyn/MethodHandle;")        /* AllowTransitionalJSR292 ONLY */ \
+  /* temporary transitional internal names from 6839872: */                                       \
+  template(java_dyn_MethodTypeForm,                   "java/dyn/MethodTypeForm")        /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_MethodTypeForm_signature,         "Ljava/dyn/MethodTypeForm;")      /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_MemberName,                       "java/dyn/MemberName")            /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_MethodHandleNatives,              "java/dyn/MethodHandleNatives")   /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_AdapterMethodHandle,              "java/dyn/AdapterMethodHandle")   /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_BoundMethodHandle,                "java/dyn/BoundMethodHandle")     /* AllowTransitionalJSR292 ONLY */ \
+  template(java_dyn_DirectMethodHandle,               "java/dyn/DirectMethodHandle")    /* AllowTransitionalJSR292 ONLY */ \
+  /* temporary transitional internal names from EDR: */                                           \
+  template(sun_dyn_MemberName,                        "sun/dyn/MemberName")             /* AllowTransitionalJSR292 ONLY */ \
+  template(sun_dyn_MethodHandleImpl,                  "sun/dyn/MethodHandleImpl")       /* AllowTransitionalJSR292 ONLY */ \
+  template(sun_dyn_MethodHandleNatives,               "sun/dyn/MethodHandleNatives")    /* AllowTransitionalJSR292 ONLY */ \
+  template(sun_dyn_AdapterMethodHandle,               "sun/dyn/AdapterMethodHandle")    /* AllowTransitionalJSR292 ONLY */ \
+  template(sun_dyn_BoundMethodHandle,                 "sun/dyn/BoundMethodHandle")      /* AllowTransitionalJSR292 ONLY */ \
+  template(sun_dyn_DirectMethodHandle,                "sun/dyn/DirectMethodHandle")     /* AllowTransitionalJSR292 ONLY */ \
+  /* internal up-calls made only by the JVM, via class sun.invoke.MethodHandleNatives: */         \
   template(findMethodHandleType_name,                 "findMethodHandleType")                     \
-  template(findMethodHandleType_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/dyn/MethodType;") \
+  template(findMethodHandleType_signature,       "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/invoke/MethodType;") \
+  template(findMethodHandleType_TRANS_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/dyn/MethodType;") /* AllowTransitionalJSR292 ONLY */ \
   template(notifyGenericMethodType_name,              "notifyGenericMethodType")                  \
-  template(notifyGenericMethodType_signature,         "(Ljava/dyn/MethodType;)V")                 \
+  template(notifyGenericMethodType_signature,         "(Ljava/lang/invoke/MethodType;)V")         \
+  template(notifyGenericMethodType_TRANS_signature,   "(Ljava/dyn/MethodType;)V")       /* AllowTransitionalJSR292 ONLY */ \
   template(linkMethodHandleConstant_name,             "linkMethodHandleConstant")                 \
-  template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/dyn/MethodHandle;") \
+  template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;") \
+  template(linkMethodHandleConstant_TRANS_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/dyn/MethodHandle;") /* AllowTransitionalJSR292 ONLY */ \
   template(makeDynamicCallSite_name,                  "makeDynamicCallSite")                      \
-  template(makeDynamicCallSite_signature, "(Ljava/dyn/MethodHandle;Ljava/lang/String;Ljava/dyn/MethodType;Ljava/lang/Object;Lsun/dyn/MemberName;I)Ljava/dyn/CallSite;") \
+  template(makeDynamicCallSite_signature, "(Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;Ljava/lang/invoke/MemberName;I)Ljava/lang/invoke/CallSite;") \
+  template(makeDynamicCallSite_TRANS_signature, "(Ljava/dyn/MethodHandle;Ljava/lang/String;Ljava/dyn/MethodType;Ljava/lang/Object;Lsun/dyn/MemberName;I)Ljava/dyn/CallSite;") /* AllowTransitionalJSR292 ONLY */ \
+  template(makeDynamicCallSite_TRANS2_signature, "(Ljava/dyn/MethodHandle;Ljava/lang/String;Ljava/dyn/MethodType;Ljava/lang/Object;Ljava/dyn/MemberName;I)Ljava/dyn/CallSite;") /* AllowTransitionalJSR292 ONLY */ \
   NOT_LP64(  do_alias(machine_word_signature,         int_signature)  )                           \
   LP64_ONLY( do_alias(machine_word_signature,         long_signature) )                           \
                                                                                                   \
@@ -882,13 +909,15 @@
                                                                                                                           \
   do_intrinsic(_invoke,                   java_lang_reflect_Method, invoke_name, object_object_array_object_signature, F_R) \
   /*   (symbols invoke_name and invoke_signature defined above) */                                                      \
-  do_intrinsic(_checkSpreadArgument,      sun_dyn_MethodHandleImpl, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) \
+  do_intrinsic(_checkSpreadArgument,      java_lang_invoke_MethodHandleNatives, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) \
+  do_intrinsic(_checkSpreadArgument_TRANS,sun_dyn_MethodHandleImpl, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) /* AllowTransitionalJSR292 ONLY */ \
+  do_intrinsic(_checkSpreadArgument_TRANS2,java_dyn_MethodHandleNatives, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) /* AllowTransitionalJSR292 ONLY */ \
    do_name(    checkSpreadArgument_name,       "checkSpreadArgument")                                                   \
    do_name(    checkSpreadArgument_signature,  "(Ljava/lang/Object;I)V")                                                \
-  do_intrinsic(_invokeExact,              java_dyn_MethodHandle, invokeExact_name,   object_array_object_signature, F_RN) \
-  do_intrinsic(_invokeGeneric,            java_dyn_MethodHandle, invokeGeneric_name, object_array_object_signature, F_RN) \
-  do_intrinsic(_invokeVarargs,            java_dyn_MethodHandle, invokeVarargs_name, object_array_object_signature, F_R)  \
-  do_intrinsic(_invokeDynamic,            java_dyn_InvokeDynamic, star_name,         object_array_object_signature, F_SN) \
+  do_intrinsic(_invokeExact,              java_lang_invoke_MethodHandle, invokeExact_name,   object_array_object_signature, F_RN) \
+  do_intrinsic(_invokeGeneric,            java_lang_invoke_MethodHandle, invokeGeneric_name, object_array_object_signature, F_RN) \
+  do_intrinsic(_invokeVarargs,            java_lang_invoke_MethodHandle, invokeVarargs_name, object_array_object_signature, F_R)  \
+  do_intrinsic(_invokeDynamic,            java_lang_invoke_InvokeDynamic, star_name,         object_array_object_signature, F_SN) \
                                                                                                                         \
   /* unboxing methods: */                                                                                               \
   do_intrinsic(_booleanValue,             java_lang_Boolean,      booleanValue_name, void_boolean_signature, F_R)       \
@@ -995,6 +1024,7 @@
 
   // Returns symbol's SID if one is assigned, else NO_SID.
   static SID find_sid(Symbol* symbol);
+  static SID find_sid(const char* symbol_name);
 
 #ifndef PRODUCT
   // No need for this in the product:
--- a/hotspot/src/share/vm/code/codeCache.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/code/codeCache.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -939,9 +939,16 @@
                _heap->high(),
                _heap->high_boundary());
   st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
-               " adapters=" UINT32_FORMAT " free_code_cache=" SIZE_FORMAT
+               " adapters=" UINT32_FORMAT " free_code_cache=" SIZE_FORMAT "Kb"
                " largest_free_block=" SIZE_FORMAT,
-               CodeCache::nof_blobs(), CodeCache::nof_nmethods(),
-               CodeCache::nof_adapters(), CodeCache::unallocated_capacity(),
-               CodeCache::largest_free_block());
+               nof_blobs(), nof_nmethods(), nof_adapters(),
+               unallocated_capacity()/K, largest_free_block());
 }
+
+void CodeCache::log_state(outputStream* st) {
+  st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
+            " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'"
+            " largest_free_block='" SIZE_FORMAT "'",
+            nof_blobs(), nof_nmethods(), nof_adapters(),
+            unallocated_capacity(), largest_free_block());
+}
--- a/hotspot/src/share/vm/code/codeCache.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/code/codeCache.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -147,6 +147,7 @@
   static void verify();                          // verifies the code cache
   static void print_trace(const char* event, CodeBlob* cb, int size = 0) PRODUCT_RETURN;
   static void print_bounds(outputStream* st);    // Prints a summary of the bounds of the code cache
+  static void log_state(outputStream* st);
 
   // The full limits of the codeCache
   static address  low_bound()                    { return (address) _heap->low_boundary(); }
@@ -159,7 +160,7 @@
   static size_t  max_capacity()                  { return _heap->max_capacity(); }
   static size_t  unallocated_capacity()          { return _heap->unallocated_capacity(); }
   static size_t  largest_free_block()            { return _heap->largest_free_block(); }
-  static bool    needs_flushing()                { return unallocated_capacity() < CodeCacheFlushingMinimumFreeSpace; }
+  static bool    needs_flushing()                { return largest_free_block() < CodeCacheFlushingMinimumFreeSpace; }
 
   static bool needs_cache_clean()                { return _needs_cache_clean; }
   static void set_needs_cache_clean(bool v)      { _needs_cache_clean = v;    }
--- a/hotspot/src/share/vm/code/nmethod.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -170,7 +170,7 @@
   int pc_desc_resets;   // number of resets (= number of caches)
   int pc_desc_queries;  // queries to nmethod::find_pc_desc
   int pc_desc_approx;   // number of those which have approximate true
-  int pc_desc_repeats;  // number of _last_pc_desc hits
+  int pc_desc_repeats;  // number of _pc_descs[0] hits
   int pc_desc_hits;     // number of LRU cache hits
   int pc_desc_tests;    // total number of PcDesc examinations
   int pc_desc_searches; // total number of quasi-binary search steps
@@ -190,15 +190,10 @@
 } nmethod_stats;
 #endif //PRODUCT
 
+
 //---------------------------------------------------------------------------------
 
 
-// The _unwind_handler is a special marker address, which says that
-// for given exception oop and address, the frame should be removed
-// as the tuple cannot be caught in the nmethod
-address ExceptionCache::_unwind_handler = (address) -1;
-
-
 ExceptionCache::ExceptionCache(Handle exception, address pc, address handler) {
   assert(pc != NULL, "Must be non null");
   assert(exception.not_null(), "Must be non null");
@@ -283,40 +278,44 @@
 
 void PcDescCache::reset_to(PcDesc* initial_pc_desc) {
   if (initial_pc_desc == NULL) {
-    _last_pc_desc = NULL;  // native method
+    _pc_descs[0] = NULL; // native method; no PcDescs at all
     return;
   }
   NOT_PRODUCT(++nmethod_stats.pc_desc_resets);
   // reset the cache by filling it with benign (non-null) values
   assert(initial_pc_desc->pc_offset() < 0, "must be sentinel");
-  _last_pc_desc = initial_pc_desc + 1;  // first valid one is after sentinel
   for (int i = 0; i < cache_size; i++)
     _pc_descs[i] = initial_pc_desc;
 }
 
 PcDesc* PcDescCache::find_pc_desc(int pc_offset, bool approximate) {
   NOT_PRODUCT(++nmethod_stats.pc_desc_queries);
-  NOT_PRODUCT(if (approximate)  ++nmethod_stats.pc_desc_approx);
+  NOT_PRODUCT(if (approximate) ++nmethod_stats.pc_desc_approx);
+
+  // Note: one might think that caching the most recently
+  // read value separately would be a win, but one would be
+  // wrong.  When many threads are updating it, the cache
+  // line it's in would bounce between caches, negating
+  // any benefit.
 
   // In order to prevent race conditions do not load cache elements
   // repeatedly, but use a local copy:
   PcDesc* res;
 
-  // Step one:  Check the most recently returned value.
-  res = _last_pc_desc;
-  if (res == NULL)  return NULL;  // native method; no PcDescs at all
+  // Step one:  Check the most recently added value.
+  res = _pc_descs[0];
+  if (res == NULL) return NULL;  // native method; no PcDescs at all
   if (match_desc(res, pc_offset, approximate)) {
     NOT_PRODUCT(++nmethod_stats.pc_desc_repeats);
     return res;
   }
 
-  // Step two:  Check the LRU cache.
-  for (int i = 0; i < cache_size; i++) {
+  // Step two:  Check the rest of the LRU cache.
+  for (int i = 1; i < cache_size; ++i) {
     res = _pc_descs[i];
-    if (res->pc_offset() < 0)  break;  // optimization: skip empty cache
+    if (res->pc_offset() < 0) break;  // optimization: skip empty cache
     if (match_desc(res, pc_offset, approximate)) {
       NOT_PRODUCT(++nmethod_stats.pc_desc_hits);
-      _last_pc_desc = res;  // record this cache hit in case of repeat
       return res;
     }
   }
@@ -327,24 +326,23 @@
 
 void PcDescCache::add_pc_desc(PcDesc* pc_desc) {
   NOT_PRODUCT(++nmethod_stats.pc_desc_adds);
-  // Update the LRU cache by shifting pc_desc forward:
+  // Update the LRU cache by shifting pc_desc forward.
   for (int i = 0; i < cache_size; i++)  {
     PcDesc* next = _pc_descs[i];
     _pc_descs[i] = pc_desc;
     pc_desc = next;
   }
-  // Note:  Do not update _last_pc_desc.  It fronts for the LRU cache.
 }
 
 // adjust pcs_size so that it is a multiple of both oopSize and
 // sizeof(PcDesc) (assumes that if sizeof(PcDesc) is not a multiple
 // of oopSize, then 2*sizeof(PcDesc) is)
-static int  adjust_pcs_size(int pcs_size) {
+static int adjust_pcs_size(int pcs_size) {
   int nsize = round_to(pcs_size,   oopSize);
   if ((nsize % sizeof(PcDesc)) != 0) {
     nsize = pcs_size + sizeof(PcDesc);
   }
-  assert((nsize %  oopSize) == 0, "correct alignment");
+  assert((nsize % oopSize) == 0, "correct alignment");
   return nsize;
 }
 
@@ -767,7 +765,7 @@
 
 void* nmethod::operator new(size_t size, int nmethod_size) {
   // Always leave some room in the CodeCache for I2C/C2I adapters
-  if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) return NULL;
+  if (CodeCache::largest_free_block() < CodeCacheMinimumFreeSpace) return NULL;
   return CodeCache::allocate(nmethod_size);
 }
 
@@ -1185,14 +1183,17 @@
   set_stack_traversal_mark(NMethodSweeper::traversal_count());
 }
 
-// Tell if a non-entrant method can be converted to a zombie (i.e., there is no activations on the stack)
+// Tell if a non-entrant method can be converted to a zombie (i.e.,
+// there are no activations on the stack, not in use by the VM,
+// and not in use by the ServiceThread)
 bool nmethod::can_not_entrant_be_converted() {
   assert(is_not_entrant(), "must be a non-entrant method");
 
   // Since the nmethod sweeper only does partial sweep the sweeper's traversal
   // count can be greater than the stack traversal count before it hits the
   // nmethod for the second time.
-  return stack_traversal_mark()+1 < NMethodSweeper::traversal_count();
+  return stack_traversal_mark()+1 < NMethodSweeper::traversal_count() &&
+         !is_locked_by_vm();
 }
 
 void nmethod::inc_decompile_count() {
@@ -1299,6 +1300,7 @@
 // Common functionality for both make_not_entrant and make_zombie
 bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
   assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
+  assert(!is_zombie(), "should not already be a zombie");
 
   // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below.
   nmethodLocker nml(this);
@@ -1306,11 +1308,6 @@
   No_Safepoint_Verifier nsv;
 
   {
-    // If the method is already zombie there is nothing to do
-    if (is_zombie()) {
-      return false;
-    }
-
     // invalidate osr nmethod before acquiring the patching lock since
     // they both acquire leaf locks and we don't want a deadlock.
     // This logic is equivalent to the logic below for patching the
@@ -1380,13 +1377,12 @@
       flush_dependencies(NULL);
     }
 
-    {
-      // zombie only - if a JVMTI agent has enabled the CompiledMethodUnload event
-      // and it hasn't already been reported for this nmethod then report it now.
-      // (the event may have been reported earilier if the GC marked it for unloading).
-      Pause_No_Safepoint_Verifier pnsv(&nsv);
-      post_compiled_method_unload();
-    }
+    // zombie only - if a JVMTI agent has enabled the CompiledMethodUnload
+    // event and it hasn't already been reported for this nmethod then
+    // report it now. The event may have been reported earilier if the GC
+    // marked it for unloading). JvmtiDeferredEventQueue support means
+    // we no longer go to a safepoint here.
+    post_compiled_method_unload();
 
 #ifdef ASSERT
     // It's no longer safe to access the oops section since zombie
@@ -1571,7 +1567,7 @@
   if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) {
     assert(!unload_reported(), "already unloaded");
     JvmtiDeferredEvent event =
-      JvmtiDeferredEvent::compiled_method_unload_event(
+      JvmtiDeferredEvent::compiled_method_unload_event(this,
           _jmethod_id, insts_begin());
     if (SafepointSynchronize::is_at_safepoint()) {
       // Don't want to take the queueing lock. Add it as pending and
@@ -1886,7 +1882,7 @@
 
 
 oop nmethod::embeddedOop_at(u_char* p) {
-  RelocIterator iter(this, p, p + oopSize);
+  RelocIterator iter(this, p, p + 1);
   while (iter.next())
     if (iter.type() == relocInfo::oop_type) {
       return iter.oop_reloc()->oop_value();
@@ -2176,10 +2172,12 @@
   lock_nmethod(_nm);
 }
 
-void nmethodLocker::lock_nmethod(nmethod* nm) {
+// Only JvmtiDeferredEvent::compiled_method_unload_event()
+// should pass zombie_ok == true.
+void nmethodLocker::lock_nmethod(nmethod* nm, bool zombie_ok) {
   if (nm == NULL)  return;
   Atomic::inc(&nm->_lock_count);
-  guarantee(!nm->is_zombie(), "cannot lock a zombie method");
+  guarantee(zombie_ok || !nm->is_zombie(), "cannot lock a zombie method");
 }
 
 void nmethodLocker::unlock_nmethod(nmethod* nm) {
--- a/hotspot/src/share/vm/code/nmethod.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/code/nmethod.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -34,7 +34,6 @@
 class ExceptionCache : public CHeapObj {
   friend class VMStructs;
  private:
-  static address _unwind_handler;
   enum { cache_size = 16 };
   klassOop _exception_type;
   address  _pc[cache_size];
@@ -62,8 +61,6 @@
   bool    match_exception_with_space(Handle exception) ;
   address test_address(address addr);
   bool    add_address_and_handler(address addr, address handler) ;
-
-  static address unwind_handler() { return _unwind_handler; }
 };
 
 
@@ -72,14 +69,13 @@
   friend class VMStructs;
  private:
   enum { cache_size = 4 };
-  PcDesc* _last_pc_desc;         // most recent pc_desc found
   PcDesc* _pc_descs[cache_size]; // last cache_size pc_descs found
  public:
-  PcDescCache() { debug_only(_last_pc_desc = NULL); }
+  PcDescCache() { debug_only(_pc_descs[0] = NULL); }
   void    reset_to(PcDesc* initial_pc_desc);
   PcDesc* find_pc_desc(int pc_offset, bool approximate);
   void    add_pc_desc(PcDesc* pc_desc);
-  PcDesc* last_pc_desc() { return _last_pc_desc; }
+  PcDesc* last_pc_desc() { return _pc_descs[0]; }
 };
 
 
@@ -181,7 +177,7 @@
   unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes?
 
   // Protected by Patching_lock
-  unsigned char _state;                      // {alive, not_entrant, zombie, unloaded)
+  unsigned char _state;                      // {alive, not_entrant, zombie, unloaded}
 
 #ifdef ASSERT
   bool _oops_are_stale;  // indicates that it's no longer safe to access oops section
@@ -197,7 +193,10 @@
 
   NOT_PRODUCT(bool _has_debug_info; )
 
-  // Nmethod Flushing lock (if non-zero, then the nmethod is not removed)
+  // Nmethod Flushing lock. If non-zero, then the nmethod is not removed
+  // and is not made into a zombie. However, once the nmethod is made into
+  // a zombie, it will be locked one final time if CompiledMethodUnload
+  // event processing needs to be done.
   jint  _lock_count;
 
   // not_entrant method removal. Each mark_sweep pass will update
@@ -525,8 +524,9 @@
   void flush();
 
  public:
-  // If returning true, it is unsafe to remove this nmethod even though it is a zombie
-  // nmethod, since the VM might have a reference to it. Should only be called from a  safepoint.
+  // When true is returned, it is unsafe to remove this nmethod even if
+  // it is a zombie, since the VM or the ServiceThread might still be
+  // using it.
   bool is_locked_by_vm() const                    { return _lock_count >0; }
 
   // See comment at definition of _last_seen_on_stack
@@ -692,13 +692,20 @@
 
 };
 
-// Locks an nmethod so its code will not get removed, even if it is a zombie/not_entrant method
+// Locks an nmethod so its code will not get removed and it will not
+// be made into a zombie, even if it is a not_entrant method. After the
+// nmethod becomes a zombie, if CompiledMethodUnload event processing
+// needs to be done, then lock_nmethod() is used directly to keep the
+// generated code from being reused too early.
 class nmethodLocker : public StackObj {
   nmethod* _nm;
 
  public:
 
-  static void lock_nmethod(nmethod* nm);   // note: nm can be NULL
+  // note: nm can be NULL
+  // Only JvmtiDeferredEvent::compiled_method_unload_event()
+  // should pass zombie_ok == true.
+  static void lock_nmethod(nmethod* nm, bool zombie_ok = false);
   static void unlock_nmethod(nmethod* nm); // (ditto)
 
   nmethodLocker(address pc); // derive nm from pc
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1364,7 +1364,7 @@
       // We need this HandleMark to avoid leaking VM handles.
       HandleMark hm(thread);
 
-      if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) {
+      if (CodeCache::largest_free_block() < CodeCacheMinimumFreeSpace) {
         // the code cache is really full
         handle_full_code_cache();
       } else if (UseCodeCacheFlushing && CodeCache::needs_flushing()) {
@@ -1645,11 +1645,13 @@
   if (UseCompiler || AlwaysCompileLoopMethods ) {
     if (xtty != NULL) {
       xtty->begin_elem("code_cache_full");
+      CodeCache::log_state(xtty);
       xtty->stamp();
       xtty->end_elem();
     }
     warning("CodeCache is full. Compiler has been disabled.");
     warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize=");
+    CodeCache::print_bounds(tty);
 #ifndef PRODUCT
     if (CompileTheWorld || ExitOnFullCodeCache) {
       before_exit(JavaThread::current());
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -292,13 +292,15 @@
 void CMSCollector::ref_processor_init() {
   if (_ref_processor == NULL) {
     // Allocate and initialize a reference processor
-    _ref_processor = ReferenceProcessor::create_ref_processor(
-        _span,                               // span
-        _cmsGen->refs_discovery_is_atomic(), // atomic_discovery
-        _cmsGen->refs_discovery_is_mt(),     // mt_discovery
-        &_is_alive_closure,
-        ParallelGCThreads,
-        ParallelRefProcEnabled);
+    _ref_processor =
+      new ReferenceProcessor(_span,                               // span
+                             (ParallelGCThreads > 1) && ParallelRefProcEnabled, // mt processing
+                             (int) ParallelGCThreads,             // mt processing degree
+                             _cmsGen->refs_discovery_is_mt(),     // mt discovery
+                             (int) MAX2(ConcGCThreads, ParallelGCThreads), // mt discovery degree
+                             _cmsGen->refs_discovery_is_atomic(), // discovery is not atomic
+                             &_is_alive_closure,                  // closure for liveness info
+                             false);                              // next field updates do not need write barrier
     // Initialize the _ref_processor field of CMSGen
     _cmsGen->set_ref_processor(_ref_processor);
 
@@ -641,7 +643,7 @@
   }
 
   // Support for multi-threaded concurrent phases
-  if (CollectedHeap::use_parallel_gc_threads() && CMSConcurrentMTEnabled) {
+  if (CMSConcurrentMTEnabled) {
     if (FLAG_IS_DEFAULT(ConcGCThreads)) {
       // just for now
       FLAG_SET_DEFAULT(ConcGCThreads, (ParallelGCThreads + 3)/4);
@@ -1689,6 +1691,8 @@
     MutexLockerEx y(CGC_lock, Mutex::_no_safepoint_check_flag);
     _full_gc_requested = true;
     CGC_lock->notify();   // nudge CMS thread
+  } else {
+    assert(gc_count > full_gc_count, "Error: causal loop");
   }
 }
 
@@ -1988,17 +1992,16 @@
   // Temporarily widen the span of the weak reference processing to
   // the entire heap.
   MemRegion new_span(GenCollectedHeap::heap()->reserved_region());
-  ReferenceProcessorSpanMutator x(ref_processor(), new_span);
-
+  ReferenceProcessorSpanMutator rp_mut_span(ref_processor(), new_span);
   // Temporarily, clear the "is_alive_non_header" field of the
   // reference processor.
-  ReferenceProcessorIsAliveMutator y(ref_processor(), NULL);
-
+  ReferenceProcessorIsAliveMutator rp_mut_closure(ref_processor(), NULL);
   // Temporarily make reference _processing_ single threaded (non-MT).
-  ReferenceProcessorMTProcMutator z(ref_processor(), false);
-
+  ReferenceProcessorMTProcMutator rp_mut_mt_processing(ref_processor(), false);
   // Temporarily make refs discovery atomic
-  ReferenceProcessorAtomicMutator w(ref_processor(), true);
+  ReferenceProcessorAtomicMutator rp_mut_atomic(ref_processor(), true);
+  // Temporarily make reference _discovery_ single threaded (non-MT)
+  ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false);
 
   ref_processor()->set_enqueuing_is_done(false);
   ref_processor()->enable_discovery();
@@ -4263,9 +4266,7 @@
 
   // Refs discovery is already non-atomic.
   assert(!ref_processor()->discovery_is_atomic(), "Should be non-atomic");
-  // Mutate the Refs discovery so it is MT during the
-  // multi-threaded marking phase.
-  ReferenceProcessorMTMutator mt(ref_processor(), num_workers > 1);
+  assert(ref_processor()->discovery_is_mt(), "Discovery should be MT");
   DEBUG_ONLY(RememberKlassesChecker cmx(should_unload_classes());)
   conc_workers()->start_task(&tsk);
   while (tsk.yielded()) {
@@ -4318,6 +4319,8 @@
   ResourceMark rm;
   HandleMark   hm;
 
+  // Temporarily make refs discovery single threaded (non-MT)
+  ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false);
   MarkFromRootsClosure markFromRootsClosure(this, _span, &_markBitMap,
     &_markStack, &_revisitStack, CMSYield && asynch);
   // the last argument to iterate indicates whether the iteration
@@ -4356,10 +4359,6 @@
   verify_overflow_empty();
   _abort_preclean = false;
   if (CMSPrecleaningEnabled) {
-    // Precleaning is currently not MT but the reference processor
-    // may be set for MT.  Disable it temporarily here.
-    ReferenceProcessor* rp = ref_processor();
-    ReferenceProcessorMTProcMutator z(rp, false);
     _eden_chunk_index = 0;
     size_t used = get_eden_used();
     size_t capacity = get_eden_capacity();
@@ -4502,11 +4501,16 @@
          _collectorState == AbortablePreclean, "incorrect state");
   ResourceMark rm;
   HandleMark   hm;
+
+  // Precleaning is currently not MT but the reference processor
+  // may be set for MT.  Disable it temporarily here.
+  ReferenceProcessor* rp = ref_processor();
+  ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(rp, false);
+
   // Do one pass of scrubbing the discovered reference lists
   // to remove any reference objects with strongly-reachable
   // referents.
   if (clean_refs) {
-    ReferenceProcessor* rp = ref_processor();
     CMSPrecleanRefsYieldClosure yield_cl(this);
     assert(rp->span().equals(_span), "Spans should be equal");
     CMSKeepAliveClosure keep_alive(this, _span, &_markBitMap,
@@ -5576,8 +5580,10 @@
   // in the multi-threaded case, but we special-case n=1 here to get
   // repeatable measurements of the 1-thread overhead of the parallel code.
   if (n_workers > 1) {
-    // Make refs discovery MT-safe
-    ReferenceProcessorMTMutator mt(ref_processor(), true);
+    // Make refs discovery MT-safe, if it isn't already: it may not
+    // necessarily be so, since it's possible that we are doing
+    // ST marking.
+    ReferenceProcessorMTDiscoveryMutator mt(ref_processor(), true);
     GenCollectedHeap::StrongRootsScope srs(gch);
     workers->run_task(&tsk);
   } else {
@@ -5703,14 +5709,19 @@
                       CMSBitMap*       mark_bit_map,
                       AbstractWorkGang* workers,
                       OopTaskQueueSet* task_queues):
+    // XXX Should superclass AGTWOQ also know about AWG since it knows
+    // about the task_queues used by the AWG? Then it could initialize
+    // the terminator() object. See 6984287. The set_for_termination()
+    // below is a temporary band-aid for the regression in 6984287.
     AbstractGangTaskWOopQueues("Process referents by policy in parallel",
       task_queues),
     _task(task),
     _collector(collector), _span(span), _mark_bit_map(mark_bit_map)
-    {
-      assert(_collector->_span.equals(_span) && !_span.is_empty(),
-             "Inconsistency in _span");
-    }
+  {
+    assert(_collector->_span.equals(_span) && !_span.is_empty(),
+           "Inconsistency in _span");
+    set_for_termination(workers->active_workers());
+  }
 
   OopTaskQueueSet* task_queues() { return queues(); }
 
@@ -5872,8 +5883,7 @@
       // That is OK as long as the Reference lists are balanced (see
       // balance_all_queues() and balance_queues()).
 
-
-      rp->set_mt_degree(ParallelGCThreads);
+      rp->set_active_mt_degree(ParallelGCThreads);
       CMSRefProcTaskExecutor task_executor(*this);
       rp->process_discovered_references(&_is_alive_closure,
                                         &cmsKeepAliveClosure,
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1133,7 +1133,7 @@
     // rare that the cost of the CAS's involved is in the
     // noise. That's a measurement that should be done, and
     // the code simplified if that turns out to be the case.
-    return false;
+    return ConcGCThreads > 1;
   }
 
   // Override
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 volatile jint ConcurrentMarkSweepThread::_pending_yields      = 0;
 volatile jint ConcurrentMarkSweepThread::_pending_decrements  = 0;
 
-volatile bool ConcurrentMarkSweepThread::_icms_enabled   = false;
+volatile jint ConcurrentMarkSweepThread::_icms_disabled   = 0;
 volatile bool ConcurrentMarkSweepThread::_should_run     = false;
 // When icms is enabled, the icms thread is stopped until explicitly
 // started.
@@ -84,7 +84,7 @@
     }
   }
   _sltMonitor = SLT_lock;
-  set_icms_enabled(CMSIncrementalMode);
+  assert(!CMSIncrementalMode || icms_is_enabled(), "Error");
 }
 
 void ConcurrentMarkSweepThread::run() {
@@ -341,11 +341,11 @@
 
 void ConcurrentMarkSweepThread::icms_wait() {
   assert(UseConcMarkSweepGC && CMSIncrementalMode, "just checking");
-  if (_should_stop && icms_enabled()) {
+  if (_should_stop && icms_is_enabled()) {
     MutexLockerEx x(iCMS_lock, Mutex::_no_safepoint_check_flag);
     trace_state("pause_icms");
     _collector->stats().stop_cms_timer();
-    while(!_should_run && icms_enabled()) {
+    while(!_should_run && icms_is_enabled()) {
       iCMS_lock->wait(Mutex::_no_safepoint_check_flag);
     }
     _collector->stats().start_cms_timer();
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 class ConcurrentMarkSweepGeneration;
 class CMSCollector;
 
-// The Concurrent Mark Sweep GC Thread (could be several in the future).
+// The Concurrent Mark Sweep GC Thread
 class ConcurrentMarkSweepThread: public ConcurrentGCThread {
   friend class VMStructs;
   friend class ConcurrentMarkSweepGeneration;   // XXX should remove friendship
@@ -55,8 +55,6 @@
   static SurrogateLockerThread::SLT_msg_type _sltBuffer;
   static Monitor*                       _sltMonitor;
 
-  ConcurrentMarkSweepThread*            _next;
-
   static bool _should_terminate;
 
   enum CMS_flag_type {
@@ -84,7 +82,7 @@
   // Tracing messages, enabled by CMSTraceThreadState.
   static inline void trace_state(const char* desc);
 
-  static volatile bool _icms_enabled;   // iCMS enabled?
+  static volatile int _icms_disabled;   // a counter to track #iCMS disable & enable
   static volatile bool _should_run;     // iCMS may run
   static volatile bool _should_stop;    // iCMS should stop
 
@@ -214,10 +212,25 @@
 
   // Incremental mode is enabled globally by the flag CMSIncrementalMode.  It
   // must also be enabled/disabled dynamically to allow foreground collections.
-  static inline void enable_icms()              { _icms_enabled = true; }
-  static inline void disable_icms()             { _icms_enabled = false; }
-  static inline void set_icms_enabled(bool val) { _icms_enabled = val; }
-  static inline bool icms_enabled()             { return _icms_enabled; }
+#define ICMS_ENABLING_ASSERT                                                      \
+          assert((CMSIncrementalMode  && _icms_disabled >= 0) ||                  \
+                 (!CMSIncrementalMode && _icms_disabled <= 0), "Error")
+
+  static inline void enable_icms() {
+    ICMS_ENABLING_ASSERT;
+    Atomic::dec(&_icms_disabled);
+  }
+  static inline void disable_icms() {
+   ICMS_ENABLING_ASSERT;
+   Atomic::inc(&_icms_disabled);
+  }
+  static inline bool icms_is_disabled() {
+   ICMS_ENABLING_ASSERT;
+   return _icms_disabled > 0;
+  }
+  static inline bool icms_is_enabled() {
+   return !icms_is_disabled();
+  }
 };
 
 inline void ConcurrentMarkSweepThread::trace_state(const char* desc) {
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -192,14 +192,18 @@
          "total_collections() should be monotonically increasing");
 
   MutexLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
+  assert(_full_gc_count_before <= gch->total_full_collections(), "Error");
   if (gch->total_full_collections() == _full_gc_count_before) {
-    // Disable iCMS until the full collection is done.
+    // Disable iCMS until the full collection is done, and
+    // remember that we did so.
     CMSCollector::disable_icms();
+    _disabled_icms = true;
     // In case CMS thread was in icms_wait(), wake it up.
     CMSCollector::start_icms();
     // Nudge the CMS thread to start a concurrent collection.
     CMSCollector::request_full_gc(_full_gc_count_before);
   } else {
+    assert(_full_gc_count_before < gch->total_full_collections(), "Error");
     FullGCCount_lock->notify_all();  // Inform the Java thread its work is done
   }
 }
@@ -259,6 +263,8 @@
       FullGCCount_lock->wait(Mutex::_no_safepoint_check_flag);
     }
   }
-  // Enable iCMS back.
-  CMSCollector::enable_icms();
+  // Enable iCMS back if we disabled it earlier.
+  if (_disabled_icms) {
+    CMSCollector::enable_icms();
+  }
 }
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -128,11 +128,14 @@
 // VM operation to invoke a concurrent collection of the heap as a
 // GenCollectedHeap heap.
 class VM_GenCollectFullConcurrent: public VM_GC_Operation {
+  bool _disabled_icms;
  public:
   VM_GenCollectFullConcurrent(unsigned int gc_count_before,
                               unsigned int full_gc_count_before,
                               GCCause::Cause gc_cause)
-    : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */) {
+    : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
+      _disabled_icms(false)
+  {
     assert(FullGCCount_lock != NULL, "Error");
     assert(UseAsyncConcMarkSweepGC, "Else will hang caller");
   }
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -373,7 +373,7 @@
             // RSet updating while within an evacuation pause.
             // In this case worker_i should be the id of a GC worker thread
             assert(SafepointSynchronize::is_at_safepoint(), "not during an evacuation pause");
-            assert(worker_i < (int) DirtyCardQueueSet::num_par_ids(), "incorrect worker id");
+            assert(worker_i < (int) (ParallelGCThreads == 0 ? 1 : ParallelGCThreads), "incorrect worker id");
             into_cset_dcq->enqueue(entry);
           }
         }
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1828,7 +1828,7 @@
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
   _cleanup_list.verify_optional();
-  FreeRegionList local_free_list("Local Cleanup List");
+  FreeRegionList tmp_free_list("Tmp Free List");
 
   if (G1ConcRegionFreeingVerbose) {
     gclog_or_tty->print_cr("G1ConcRegionFreeing [complete cleanup] : "
@@ -1842,7 +1842,7 @@
     HeapRegion* hr = _cleanup_list.remove_head();
     assert(hr != NULL, "the list was not empty");
     hr->rem_set()->clear();
-    local_free_list.add_as_tail(hr);
+    tmp_free_list.add_as_tail(hr);
 
     // Instead of adding one region at a time to the secondary_free_list,
     // we accumulate them in the local list and move them a few at a
@@ -1850,20 +1850,20 @@
     // we do during this process. We'll also append the local list when
     // _cleanup_list is empty (which means we just removed the last
     // region from the _cleanup_list).
-    if ((local_free_list.length() % G1SecondaryFreeListAppendLength == 0) ||
+    if ((tmp_free_list.length() % G1SecondaryFreeListAppendLength == 0) ||
         _cleanup_list.is_empty()) {
       if (G1ConcRegionFreeingVerbose) {
         gclog_or_tty->print_cr("G1ConcRegionFreeing [complete cleanup] : "
                                "appending "SIZE_FORMAT" entries to the "
                                "secondary_free_list, clean list still has "
                                SIZE_FORMAT" entries",
-                               local_free_list.length(),
+                               tmp_free_list.length(),
                                _cleanup_list.length());
       }
 
       {
         MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag);
-        g1h->secondary_free_list_add_as_tail(&local_free_list);
+        g1h->secondary_free_list_add_as_tail(&tmp_free_list);
         SecondaryFreeList_lock->notify_all();
       }
 
@@ -1874,7 +1874,7 @@
       }
     }
   }
-  assert(local_free_list.is_empty(), "post-condition");
+  assert(tmp_free_list.is_empty(), "post-condition");
 }
 
 // Support closures for reference procssing in G1
@@ -2141,21 +2141,22 @@
   G1CMKeepAliveClosure g1_keep_alive(g1h, this, nextMarkBitMap());
   G1CMDrainMarkingStackClosure
     g1_drain_mark_stack(nextMarkBitMap(), &_markStack, &g1_keep_alive);
-
   // We use the work gang from the G1CollectedHeap and we utilize all
   // the worker threads.
-  int active_workers = MAX2(MIN2(g1h->workers()->total_workers(), (int)_max_task_num), 1);
+  int active_workers = g1h->workers() ? g1h->workers()->total_workers() : 1;
+  active_workers = MAX2(MIN2(active_workers, (int)_max_task_num), 1);
 
   G1RefProcTaskExecutor par_task_executor(g1h, this, nextMarkBitMap(),
                                           g1h->workers(), active_workers);
 
+
   if (rp->processing_is_mt()) {
     // Set the degree of MT here.  If the discovery is done MT, there
     // may have been a different number of threads doing the discovery
     // and a different number of discovered lists may have Ref objects.
     // That is OK as long as the Reference lists are balanced (see
     // balance_all_queues() and balance_queues()).
-    rp->set_mt_degree(active_workers);
+    rp->set_active_mt_degree(active_workers);
 
     rp->process_discovered_references(&g1_is_alive,
                                       &g1_keep_alive,
@@ -3182,7 +3183,7 @@
 
   template <class T> void do_oop_work(T* p) {
     assert( _g1h->is_in_g1_reserved((HeapWord*) p), "invariant");
-    assert(!_g1h->is_on_free_list(
+    assert(!_g1h->is_on_master_free_list(
                     _g1h->heap_region_containing((HeapWord*) p)), "invariant");
 
     oop obj = oopDesc::load_decode_heap_oop(p);
@@ -3403,7 +3404,7 @@
 void CMTask::push(oop obj) {
   HeapWord* objAddr = (HeapWord*) obj;
   assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
-  assert(!_g1h->is_on_free_list(
+  assert(!_g1h->is_on_master_free_list(
               _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant");
   assert(!_g1h->is_obj_ill(obj), "invariant");
   assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
@@ -3649,7 +3650,7 @@
                                (void*) obj);
 
       assert(_g1h->is_in_g1_reserved((HeapWord*) obj), "invariant" );
-      assert(!_g1h->is_on_free_list(
+      assert(!_g1h->is_on_master_free_list(
                   _g1h->heap_region_containing((HeapWord*) obj)), "invariant");
 
       scan_object(obj);
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -237,9 +237,9 @@
         // The following will finish freeing up any regions that we
         // found to be empty during cleanup. We'll do this part
         // without joining the suspendible set. If an evacuation pause
-        // takes places, then we would carry on freeing regions in
+        // takes place, then we would carry on freeing regions in
         // case they are needed by the pause. If a Full GC takes
-        // places, it would wait for us to process the regions
+        // place, it would wait for us to process the regions
         // reclaimed by cleanup.
 
         double cleanup_start_sec = os::elapsedTime();
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -479,7 +479,7 @@
 // Private methods.
 
 HeapRegion*
-G1CollectedHeap::new_region_try_secondary_free_list(size_t word_size) {
+G1CollectedHeap::new_region_try_secondary_free_list() {
   MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag);
   while (!_secondary_free_list.is_empty() || free_regions_coming()) {
     if (!_secondary_free_list.is_empty()) {
@@ -531,7 +531,7 @@
         gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : "
                                "forced to look at the secondary_free_list");
       }
-      res = new_region_try_secondary_free_list(word_size);
+      res = new_region_try_secondary_free_list();
       if (res != NULL) {
         return res;
       }
@@ -543,7 +543,7 @@
       gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : "
                              "res == NULL, trying the secondary_free_list");
     }
-    res = new_region_try_secondary_free_list(word_size);
+    res = new_region_try_secondary_free_list();
   }
   if (res == NULL && do_expand) {
     if (expand(word_size * HeapWordSize)) {
@@ -579,6 +579,9 @@
 
 int G1CollectedHeap::humongous_obj_allocate_find_first(size_t num_regions,
                                                        size_t word_size) {
+  assert(isHumongous(word_size), "word_size should be humongous");
+  assert(num_regions * HeapRegion::GrainWords >= word_size, "pre-condition");
+
   int first = -1;
   if (num_regions == 1) {
     // Only one region to allocate, no need to go through the slower
@@ -600,7 +603,7 @@
     // request. If we are only allocating one region we use the common
     // region allocation code (see above).
     wait_while_free_regions_coming();
-    append_secondary_free_list_if_not_empty();
+    append_secondary_free_list_if_not_empty_with_lock();
 
     if (free_regions() >= num_regions) {
       first = _hrs->find_contiguous(num_regions);
@@ -608,7 +611,7 @@
         for (int i = first; i < first + (int) num_regions; ++i) {
           HeapRegion* hr = _hrs->at(i);
           assert(hr->is_empty(), "sanity");
-          assert(is_on_free_list(hr), "sanity");
+          assert(is_on_master_free_list(hr), "sanity");
           hr->set_pending_removal(true);
         }
         _free_list.remove_all_pending(num_regions);
@@ -618,6 +621,126 @@
   return first;
 }
 
+HeapWord*
+G1CollectedHeap::humongous_obj_allocate_initialize_regions(int first,
+                                                           size_t num_regions,
+                                                           size_t word_size) {
+  assert(first != -1, "pre-condition");
+  assert(isHumongous(word_size), "word_size should be humongous");
+  assert(num_regions * HeapRegion::GrainWords >= word_size, "pre-condition");
+
+  // Index of last region in the series + 1.
+  int last = first + (int) num_regions;
+
+  // We need to initialize the region(s) we just discovered. This is
+  // a bit tricky given that it can happen concurrently with
+  // refinement threads refining cards on these regions and
+  // potentially wanting to refine the BOT as they are scanning
+  // those cards (this can happen shortly after a cleanup; see CR
+  // 6991377). So we have to set up the region(s) carefully and in
+  // a specific order.
+
+  // The word size sum of all the regions we will allocate.
+  size_t word_size_sum = num_regions * HeapRegion::GrainWords;
+  assert(word_size <= word_size_sum, "sanity");
+
+  // This will be the "starts humongous" region.
+  HeapRegion* first_hr = _hrs->at(first);
+  // The header of the new object will be placed at the bottom of
+  // the first region.
+  HeapWord* new_obj = first_hr->bottom();
+  // This will be the new end of the first region in the series that
+  // should also match the end of the last region in the seriers.
+  HeapWord* new_end = new_obj + word_size_sum;
+  // This will be the new top of the first region that will reflect
+  // this allocation.
+  HeapWord* new_top = new_obj + word_size;
+
+  // First, we need to zero the header of the space that we will be
+  // allocating. When we update top further down, some refinement
+  // threads might try to scan the region. By zeroing the header we
+  // ensure that any thread that will try to scan the region will
+  // come across the zero klass word and bail out.
+  //
+  // NOTE: It would not have been correct to have used
+  // CollectedHeap::fill_with_object() and make the space look like
+  // an int array. The thread that is doing the allocation will
+  // later update the object header to a potentially different array
+  // type and, for a very short period of time, the klass and length
+  // fields will be inconsistent. This could cause a refinement
+  // thread to calculate the object size incorrectly.
+  Copy::fill_to_words(new_obj, oopDesc::header_size(), 0);
+
+  // We will set up the first region as "starts humongous". This
+  // will also update the BOT covering all the regions to reflect
+  // that there is a single object that starts at the bottom of the
+  // first region.
+  first_hr->set_startsHumongous(new_top, new_end);
+
+  // Then, if there are any, we will set up the "continues
+  // humongous" regions.
+  HeapRegion* hr = NULL;
+  for (int i = first + 1; i < last; ++i) {
+    hr = _hrs->at(i);
+    hr->set_continuesHumongous(first_hr);
+  }
+  // If we have "continues humongous" regions (hr != NULL), then the
+  // end of the last one should match new_end.
+  assert(hr == NULL || hr->end() == new_end, "sanity");
+
+  // Up to this point no concurrent thread would have been able to
+  // do any scanning on any region in this series. All the top
+  // fields still point to bottom, so the intersection between
+  // [bottom,top] and [card_start,card_end] will be empty. Before we
+  // update the top fields, we'll do a storestore to make sure that
+  // no thread sees the update to top before the zeroing of the
+  // object header and the BOT initialization.
+  OrderAccess::storestore();
+
+  // Now that the BOT and the object header have been initialized,
+  // we can update top of the "starts humongous" region.
+  assert(first_hr->bottom() < new_top && new_top <= first_hr->end(),
+         "new_top should be in this region");
+  first_hr->set_top(new_top);
+
+  // Now, we will update the top fields of the "continues humongous"
+  // regions. The reason we need to do this is that, otherwise,
+  // these regions would look empty and this will confuse parts of
+  // G1. For example, the code that looks for a consecutive number
+  // of empty regions will consider them empty and try to
+  // re-allocate them. We can extend is_empty() to also include
+  // !continuesHumongous(), but it is easier to just update the top
+  // fields here. The way we set top for all regions (i.e., top ==
+  // end for all regions but the last one, top == new_top for the
+  // last one) is actually used when we will free up the humongous
+  // region in free_humongous_region().
+  hr = NULL;
+  for (int i = first + 1; i < last; ++i) {
+    hr = _hrs->at(i);
+    if ((i + 1) == last) {
+      // last continues humongous region
+      assert(hr->bottom() < new_top && new_top <= hr->end(),
+             "new_top should fall on this region");
+      hr->set_top(new_top);
+    } else {
+      // not last one
+      assert(new_top > hr->end(), "new_top should be above this region");
+      hr->set_top(hr->end());
+    }
+  }
+  // If we have continues humongous regions (hr != NULL), then the
+  // end of the last one should match new_end and its top should
+  // match new_top.
+  assert(hr == NULL ||
+         (hr->end() == new_end && hr->top() == new_top), "sanity");
+
+  assert(first_hr->used() == word_size * HeapWordSize, "invariant");
+  _summary_bytes_used += first_hr->used();
+  _humongous_set.add(first_hr);
+
+  return new_obj;
+}
+
 // If could fit into free regions w/o expansion, try.
 // Otherwise, if can expand, do so.
 // Otherwise, if using ex regions might help, try with ex given back.
@@ -653,121 +776,16 @@
     }
   }
 
+  HeapWord* result = NULL;
   if (first != -1) {
-    // Index of last region in the series + 1.
-    int last = first + (int) num_regions;
-
-    // We need to initialize the region(s) we just discovered. This is
-    // a bit tricky given that it can happen concurrently with
-    // refinement threads refining cards on these regions and
-    // potentially wanting to refine the BOT as they are scanning
-    // those cards (this can happen shortly after a cleanup; see CR
-    // 6991377). So we have to set up the region(s) carefully and in
-    // a specific order.
-
-    // The word size sum of all the regions we will allocate.
-    size_t word_size_sum = num_regions * HeapRegion::GrainWords;
-    assert(word_size <= word_size_sum, "sanity");
-
-    // This will be the "starts humongous" region.
-    HeapRegion* first_hr = _hrs->at(first);
-    // The header of the new object will be placed at the bottom of
-    // the first region.
-    HeapWord* new_obj = first_hr->bottom();
-    // This will be the new end of the first region in the series that
-    // should also match the end of the last region in the seriers.
-    HeapWord* new_end = new_obj + word_size_sum;
-    // This will be the new top of the first region that will reflect
-    // this allocation.
-    HeapWord* new_top = new_obj + word_size;
-
-    // First, we need to zero the header of the space that we will be
-    // allocating. When we update top further down, some refinement
-    // threads might try to scan the region. By zeroing the header we
-    // ensure that any thread that will try to scan the region will
-    // come across the zero klass word and bail out.
-    //
-    // NOTE: It would not have been correct to have used
-    // CollectedHeap::fill_with_object() and make the space look like
-    // an int array. The thread that is doing the allocation will
-    // later update the object header to a potentially different array
-    // type and, for a very short period of time, the klass and length
-    // fields will be inconsistent. This could cause a refinement
-    // thread to calculate the object size incorrectly.
-    Copy::fill_to_words(new_obj, oopDesc::header_size(), 0);
-
-    // We will set up the first region as "starts humongous". This
-    // will also update the BOT covering all the regions to reflect
-    // that there is a single object that starts at the bottom of the
-    // first region.
-    first_hr->set_startsHumongous(new_top, new_end);
-
-    // Then, if there are any, we will set up the "continues
-    // humongous" regions.
-    HeapRegion* hr = NULL;
-    for (int i = first + 1; i < last; ++i) {
-      hr = _hrs->at(i);
-      hr->set_continuesHumongous(first_hr);
-    }
-    // If we have "continues humongous" regions (hr != NULL), then the
-    // end of the last one should match new_end.
-    assert(hr == NULL || hr->end() == new_end, "sanity");
-
-    // Up to this point no concurrent thread would have been able to
-    // do any scanning on any region in this series. All the top
-    // fields still point to bottom, so the intersection between
-    // [bottom,top] and [card_start,card_end] will be empty. Before we
-    // update the top fields, we'll do a storestore to make sure that
-    // no thread sees the update to top before the zeroing of the
-    // object header and the BOT initialization.
-    OrderAccess::storestore();
-
-    // Now that the BOT and the object header have been initialized,
-    // we can update top of the "starts humongous" region.
-    assert(first_hr->bottom() < new_top && new_top <= first_hr->end(),
-           "new_top should be in this region");
-    first_hr->set_top(new_top);
-
-    // Now, we will update the top fields of the "continues humongous"
-    // regions. The reason we need to do this is that, otherwise,
-    // these regions would look empty and this will confuse parts of
-    // G1. For example, the code that looks for a consecutive number
-    // of empty regions will consider them empty and try to
-    // re-allocate them. We can extend is_empty() to also include
-    // !continuesHumongous(), but it is easier to just update the top
-    // fields here. The way we set top for all regions (i.e., top ==
-    // end for all regions but the last one, top == new_top for the
-    // last one) is actually used when we will free up the humongous
-    // region in free_humongous_region().
-    hr = NULL;
-    for (int i = first + 1; i < last; ++i) {
-      hr = _hrs->at(i);
-      if ((i + 1) == last) {
-        // last continues humongous region
-        assert(hr->bottom() < new_top && new_top <= hr->end(),
-               "new_top should fall on this region");
-        hr->set_top(new_top);
-      } else {
-        // not last one
-        assert(new_top > hr->end(), "new_top should be above this region");
-        hr->set_top(hr->end());
-      }
-    }
-    // If we have continues humongous regions (hr != NULL), then the
-    // end of the last one should match new_end and its top should
-    // match new_top.
-    assert(hr == NULL ||
-           (hr->end() == new_end && hr->top() == new_top), "sanity");
-
-    assert(first_hr->used() == word_size * HeapWordSize, "invariant");
-    _summary_bytes_used += first_hr->used();
-    _humongous_set.add(first_hr);
-
-    return new_obj;
+    result =
+      humongous_obj_allocate_initialize_regions(first, num_regions, word_size);
+    assert(result != NULL, "it should always return a valid result");
   }
 
   verify_region_sets_optional();
-  return NULL;
+
+  return result;
 }
 
 void
@@ -1389,7 +1407,7 @@
     g1_policy()->record_full_collection_start();
 
     wait_while_free_regions_coming();
-    append_secondary_free_list_if_not_empty();
+    append_secondary_free_list_if_not_empty_with_lock();
 
     gc_prologue(true);
     increment_total_collections(true /* full gc */);
@@ -1444,7 +1462,7 @@
     // how reference processing currently works in G1.
 
     // Temporarily make reference _discovery_ single threaded (non-MT).
-    ReferenceProcessorMTMutator rp_disc_ser(ref_processor(), false);
+    ReferenceProcessorMTDiscoveryMutator rp_disc_ser(ref_processor(), false);
 
     // Temporarily make refs discovery atomic
     ReferenceProcessorAtomicMutator rp_disc_atomic(ref_processor(), true);
@@ -2201,16 +2219,16 @@
 
   SharedHeap::ref_processing_init();
   MemRegion mr = reserved_region();
-  _ref_processor = ReferenceProcessor::create_ref_processor(
-                                         mr,    // span
-                                         false, // Reference discovery is not atomic
-                                         true,  // mt_discovery
-                                         &_is_alive_closure, // is alive closure
-                                                             // for efficiency
-                                         ParallelGCThreads,
-                                         ParallelRefProcEnabled,
-                                         true); // Setting next fields of discovered
-                                                // lists requires a barrier.
+  _ref_processor =
+    new ReferenceProcessor(mr,    // span
+                           ParallelRefProcEnabled && (ParallelGCThreads > 1),    // mt processing
+                           (int) ParallelGCThreads,   // degree of mt processing
+                           ParallelGCThreads > 1 || ConcGCThreads > 1,  // mt discovery
+                           (int) MAX2(ParallelGCThreads, ConcGCThreads), // degree of mt discovery
+                           false,                     // Reference discovery is not atomic
+                           &_is_alive_closure,        // is alive closure for efficiency
+                           true);                     // Setting next fields of discovered
+                                                      // lists requires a barrier.
 }
 
 size_t G1CollectedHeap::capacity() const {
@@ -3377,15 +3395,14 @@
 
     TraceMemoryManagerStats tms(false /* fullGC */);
 
-    // If there are any free regions available on the secondary_free_list
-    // make sure we append them to the free_list. However, we don't
-    // have to wait for the rest of the cleanup operation to
-    // finish. If it's still going on that's OK. If we run out of
-    // regions, the region allocation code will check the
-    // secondary_free_list and potentially wait if more free regions
-    // are coming (see new_region_try_secondary_free_list()).
+    // If the secondary_free_list is not empty, append it to the
+    // free_list. No need to wait for the cleanup operation to finish;
+    // the region allocation code will check the secondary_free_list
+    // and wait if necessary. If the G1StressConcRegionFreeing flag is
+    // set, skip this step so that the region allocation code has to
+    // get entries from the secondary_free_list.
     if (!G1StressConcRegionFreeing) {
-      append_secondary_free_list_if_not_empty();
+      append_secondary_free_list_if_not_empty_with_lock();
     }
 
     increment_gc_time_stamp();
@@ -5199,7 +5216,7 @@
   size_t rs_lengths = 0;
 
   while (cur != NULL) {
-    assert(!is_on_free_list(cur), "sanity");
+    assert(!is_on_master_free_list(cur), "sanity");
 
     if (non_young) {
       if (cur->is_young()) {
@@ -5474,8 +5491,6 @@
   _refine_cte_cl->set_concurrent(concurrent);
 }
 
-#ifdef ASSERT
-
 bool G1CollectedHeap::is_in_closed_subset(const void* p) const {
   HeapRegion* hr = heap_region_containing(p);
   if (hr == NULL) {
@@ -5484,7 +5499,6 @@
     return hr->is_in(p);
   }
 }
-#endif // ASSERT
 
 class VerifyRegionListsClosure : public HeapRegionClosure {
 private:
@@ -5546,13 +5560,10 @@
     return;
   }
 
-  {
-    MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag);
-    // Make sure we append the secondary_free_list on the free_list so
-    // that all free regions we will come across can be safely
-    // attributed to the free_list.
-    append_secondary_free_list();
-  }
+  // Make sure we append the secondary_free_list on the free_list so
+  // that all free regions we will come across can be safely
+  // attributed to the free_list.
+  append_secondary_free_list_if_not_empty_with_lock();
 
   // Finally, make sure that the region accounting in the lists is
   // consistent with what we see in the heap.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -56,7 +56,6 @@
 class ConcurrentMark;
 class ConcurrentMarkThread;
 class ConcurrentG1Refine;
-class ConcurrentZFThread;
 
 typedef OverflowTaskQueue<StarTask>         RefToScanQueue;
 typedef GenericTaskQueueSet<RefToScanQueue> RefToScanQueueSet;
@@ -64,12 +63,6 @@
 typedef int RegionIdx_t;   // needs to hold [ 0..max_regions() )
 typedef int CardIdx_t;     // needs to hold [ 0..CardsPerRegion )
 
-enum G1GCThreadGroups {
-  G1CRGroup = 0,
-  G1ZFGroup = 1,
-  G1CMGroup = 2
-};
-
 enum GCAllocPurpose {
   GCAllocForTenured,
   GCAllocForSurvived,
@@ -294,9 +287,9 @@
   // These are macros so that, if the assert fires, we get the correct
   // line number, file, etc.
 
-#define heap_locking_asserts_err_msg(__extra_message)                         \
+#define heap_locking_asserts_err_msg(_extra_message_)                         \
   err_msg("%s : Heap_lock locked: %s, at safepoint: %s, is VM thread: %s",    \
-          (__extra_message),                                                  \
+          (_extra_message_),                                                  \
           BOOL_TO_STR(Heap_lock->owned_by_self()),                            \
           BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()),               \
           BOOL_TO_STR(Thread::current()->is_VM_thread()))
@@ -307,11 +300,11 @@
            heap_locking_asserts_err_msg("should be holding the Heap_lock"));  \
   } while (0)
 
-#define assert_heap_locked_or_at_safepoint(__should_be_vm_thread)             \
+#define assert_heap_locked_or_at_safepoint(_should_be_vm_thread_)             \
   do {                                                                        \
     assert(Heap_lock->owned_by_self() ||                                      \
            (SafepointSynchronize::is_at_safepoint() &&                        \
-             ((__should_be_vm_thread) == Thread::current()->is_VM_thread())), \
+             ((_should_be_vm_thread_) == Thread::current()->is_VM_thread())), \
            heap_locking_asserts_err_msg("should be holding the Heap_lock or " \
                                         "should be at a safepoint"));         \
   } while (0)
@@ -338,10 +331,10 @@
                                    "should not be at a safepoint"));          \
   } while (0)
 
-#define assert_at_safepoint(__should_be_vm_thread)                            \
+#define assert_at_safepoint(_should_be_vm_thread_)                            \
   do {                                                                        \
     assert(SafepointSynchronize::is_at_safepoint() &&                         \
-              ((__should_be_vm_thread) == Thread::current()->is_VM_thread()), \
+              ((_should_be_vm_thread_) == Thread::current()->is_VM_thread()), \
            heap_locking_asserts_err_msg("should be at a safepoint"));         \
   } while (0)
 
@@ -371,35 +364,40 @@
   // will check whether there's anything available in the
   // secondary_free_list and/or wait for more regions to appear in that
   // list, if _free_regions_coming is set.
-  HeapRegion* new_region_try_secondary_free_list(size_t word_size);
+  HeapRegion* new_region_try_secondary_free_list();
 
-  // It will try to allocate a single non-humongous HeapRegion
-  // sufficient for an allocation of the given word_size.  If
-  // do_expand is true, it will attempt to expand the heap if
-  // necessary to satisfy the allocation request. Note that word_size
-  // is only used to make sure that we expand sufficiently but, given
-  // that the allocation request is assumed not to be humongous,
-  // having word_size is not strictly necessary (expanding by a single
-  // region will always be sufficient). But let's keep that parameter
-  // in case we need it in the future.
+  // Try to allocate a single non-humongous HeapRegion sufficient for
+  // an allocation of the given word_size. If do_expand is true,
+  // attempt to expand the heap if necessary to satisfy the allocation
+  // request.
   HeapRegion* new_region_work(size_t word_size, bool do_expand);
 
-  // It will try to allocate a new region to be used for allocation by
-  // mutator threads. It will not try to expand the heap if not region
-  // is available.
+  // Try to allocate a new region to be used for allocation by a
+  // mutator thread. Attempt to expand the heap if no region is
+  // available.
   HeapRegion* new_alloc_region(size_t word_size) {
     return new_region_work(word_size, false /* do_expand */);
   }
 
-  // It will try to allocate a new region to be used for allocation by
-  // a GC thread. It will try to expand the heap if no region is
-  // available.
+  // Try to allocate a new region to be used for allocation by a GC
+  // thread. Attempt to expand the heap if no region is available.
   HeapRegion* new_gc_alloc_region(int purpose, size_t word_size);
 
+  // Attempt to satisfy a humongous allocation request of the given
+  // size by finding a contiguous set of free regions of num_regions
+  // length and remove them from the master free list. Return the
+  // index of the first region or -1 if the search was unsuccessful.
   int humongous_obj_allocate_find_first(size_t num_regions, size_t word_size);
 
-  // Attempt to allocate an object of the given (very large) "word_size".
-  // Returns "NULL" on failure.
+  // Initialize a contiguous set of free regions of length num_regions
+  // and starting at index first so that they appear as a single
+  // humongous region.
+  HeapWord* humongous_obj_allocate_initialize_regions(int first,
+                                                      size_t num_regions,
+                                                      size_t word_size);
+
+  // Attempt to allocate a humongous object of the given size. Return
+  // NULL if unsuccessful.
   HeapWord* humongous_obj_allocate(size_t word_size);
 
   // The following two methods, allocate_new_tlab() and
@@ -776,7 +774,7 @@
   // Invoke "save_marks" on all heap regions.
   void save_marks();
 
-  // It frees a non-humongous region by initializing its contents and
+  // Frees a non-humongous region by initializing its contents and
   // adding it to the free list that's passed as a parameter (this is
   // usually a local list which will be appended to the master free
   // list later). The used bytes of freed regions are accumulated in
@@ -787,13 +785,13 @@
                    FreeRegionList* free_list,
                    bool par);
 
-  // It frees a humongous region by collapsing it into individual
-  // regions and calling free_region() for each of them. The freed
-  // regions will be added to the free list that's passed as a parameter
-  // (this is usually a local list which will be appended to the
-  // master free list later). The used bytes of freed regions are
-  // accumulated in pre_used. If par is true, the region's RSet will
-  // not be freed up. The assumption is that this will be done later.
+  // Frees a humongous region by collapsing it into individual regions
+  // and calling free_region() for each of them. The freed regions
+  // will be added to the free list that's passed as a parameter (this
+  // is usually a local list which will be appended to the master free
+  // list later). The used bytes of freed regions are accumulated in
+  // pre_used. If par is true, the region's RSet will not be freed
+  // up. The assumption is that this will be done later.
   void free_humongous_region(HeapRegion* hr,
                              size_t* pre_used,
                              FreeRegionList* free_list,
@@ -1046,13 +1044,13 @@
 #endif // HEAP_REGION_SET_FORCE_VERIFY
 
 #ifdef ASSERT
-  bool is_on_free_list(HeapRegion* hr) {
+  bool is_on_master_free_list(HeapRegion* hr) {
     return hr->containing_set() == &_free_list;
   }
 
-  bool is_on_humongous_set(HeapRegion* hr) {
+  bool is_in_humongous_set(HeapRegion* hr) {
     return hr->containing_set() == &_humongous_set;
-}
+  }
 #endif // ASSERT
 
   // Wrapper for the region list operations that can be called from
@@ -1066,7 +1064,9 @@
     _free_list.add_as_tail(&_secondary_free_list);
   }
 
-  void append_secondary_free_list_if_not_empty() {
+  void append_secondary_free_list_if_not_empty_with_lock() {
+    // If the secondary free list looks empty there's no reason to
+    // take the lock and then try to append it.
     if (!_secondary_free_list.is_empty()) {
       MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag);
       append_secondary_free_list();
@@ -1134,7 +1134,7 @@
     return _g1_committed;
   }
 
-  NOT_PRODUCT(bool is_in_closed_subset(const void* p) const;)
+  virtual bool is_in_closed_subset(const void* p) const;
 
   // Dirty card table entries covering a list of young regions.
   void dirtyCardsForYoungRegions(CardTableModRefBS* ct_bs, HeapRegion* list);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -81,6 +81,57 @@
 
 // </NEW PREDICTION>
 
+// Help class for avoiding interleaved logging
+class LineBuffer: public StackObj {
+
+private:
+  static const int BUFFER_LEN = 1024;
+  static const int INDENT_CHARS = 3;
+  char _buffer[BUFFER_LEN];
+  int _indent_level;
+  int _cur;
+
+  void vappend(const char* format, va_list ap) {
+    int res = vsnprintf(&_buffer[_cur], BUFFER_LEN - _cur, format, ap);
+    if (res != -1) {
+      _cur += res;
+    } else {
+      DEBUG_ONLY(warning("buffer too small in LineBuffer");)
+      _buffer[BUFFER_LEN -1] = 0;
+      _cur = BUFFER_LEN; // vsnprintf above should not add to _buffer if we are called again
+    }
+  }
+
+public:
+  explicit LineBuffer(int indent_level): _indent_level(indent_level), _cur(0) {
+    for (; (_cur < BUFFER_LEN && _cur < (_indent_level * INDENT_CHARS)); _cur++) {
+      _buffer[_cur] = ' ';
+    }
+  }
+
+#ifndef PRODUCT
+  ~LineBuffer() {
+    assert(_cur == _indent_level * INDENT_CHARS, "pending data in buffer - append_and_print_cr() not called?");
+  }
+#endif
+
+  void append(const char* format, ...) {
+    va_list ap;
+    va_start(ap, format);
+    vappend(format, ap);
+    va_end(ap);
+  }
+
+  void append_and_print_cr(const char* format, ...) {
+    va_list ap;
+    va_start(ap, format);
+    vappend(format, ap);
+    va_end(ap);
+    gclog_or_tty->print_cr("%s", _buffer);
+    _cur = _indent_level * INDENT_CHARS;
+  }
+};
+
 G1CollectorPolicy::G1CollectorPolicy() :
   _parallel_gc_threads(G1CollectedHeap::use_parallel_gc_threads()
     ? ParallelGCThreads : 1),
@@ -1016,10 +1067,8 @@
                                          bool summary) {
   double min = data[0], max = data[0];
   double total = 0.0;
-  int j;
-  for (j = 0; j < level; ++j)
-    gclog_or_tty->print("   ");
-  gclog_or_tty->print("[%s (ms):", str);
+  LineBuffer buf(level);
+  buf.append("[%s (ms):", str);
   for (uint i = 0; i < ParallelGCThreads; ++i) {
     double val = data[i];
     if (val < min)
@@ -1027,18 +1076,16 @@
     if (val > max)
       max = val;
     total += val;
-    gclog_or_tty->print("  %3.1lf", val);
+    buf.append("  %3.1lf", val);
   }
   if (summary) {
-    gclog_or_tty->print_cr("");
+    buf.append_and_print_cr("");
     double avg = total / (double) ParallelGCThreads;
-    gclog_or_tty->print(" ");
-    for (j = 0; j < level; ++j)
-      gclog_or_tty->print("   ");
-    gclog_or_tty->print("Avg: %5.1lf, Min: %5.1lf, Max: %5.1lf",
+    buf.append(" ");
+    buf.append("Avg: %5.1lf, Min: %5.1lf, Max: %5.1lf",
                         avg, min, max);
   }
-  gclog_or_tty->print_cr("]");
+  buf.append_and_print_cr("]");
 }
 
 void G1CollectorPolicy::print_par_sizes(int level,
@@ -1047,10 +1094,8 @@
                                         bool summary) {
   double min = data[0], max = data[0];
   double total = 0.0;
-  int j;
-  for (j = 0; j < level; ++j)
-    gclog_or_tty->print("   ");
-  gclog_or_tty->print("[%s :", str);
+  LineBuffer buf(level);
+  buf.append("[%s :", str);
   for (uint i = 0; i < ParallelGCThreads; ++i) {
     double val = data[i];
     if (val < min)
@@ -1058,34 +1103,28 @@
     if (val > max)
       max = val;
     total += val;
-    gclog_or_tty->print(" %d", (int) val);
+    buf.append(" %d", (int) val);
   }
   if (summary) {
-    gclog_or_tty->print_cr("");
+    buf.append_and_print_cr("");
     double avg = total / (double) ParallelGCThreads;
-    gclog_or_tty->print(" ");
-    for (j = 0; j < level; ++j)
-      gclog_or_tty->print("   ");
-    gclog_or_tty->print("Sum: %d, Avg: %d, Min: %d, Max: %d",
+    buf.append(" ");
+    buf.append("Sum: %d, Avg: %d, Min: %d, Max: %d",
                (int)total, (int)avg, (int)min, (int)max);
   }
-  gclog_or_tty->print_cr("]");
+  buf.append_and_print_cr("]");
 }
 
 void G1CollectorPolicy::print_stats (int level,
                                      const char* str,
                                      double value) {
-  for (int j = 0; j < level; ++j)
-    gclog_or_tty->print("   ");
-  gclog_or_tty->print_cr("[%s: %5.1lf ms]", str, value);
+  LineBuffer(level).append_and_print_cr("[%s: %5.1lf ms]", str, value);
 }
 
 void G1CollectorPolicy::print_stats (int level,
                                      const char* str,
                                      int value) {
-  for (int j = 0; j < level; ++j)
-    gclog_or_tty->print("   ");
-  gclog_or_tty->print_cr("[%s: %d]", str, value);
+  LineBuffer(level).append_and_print_cr("[%s: %d]", str, value);
 }
 
 double G1CollectorPolicy::avg_value (double* data) {
@@ -2060,17 +2099,11 @@
   _g1->collection_set_iterate(&cs_closure);
 }
 
-static void print_indent(int level) {
-  for (int j = 0; j < level+1; ++j)
-    gclog_or_tty->print("   ");
-}
-
 void G1CollectorPolicy::print_summary (int level,
                                        const char* str,
                                        NumberSeq* seq) const {
   double sum = seq->sum();
-  print_indent(level);
-  gclog_or_tty->print_cr("%-24s = %8.2lf s (avg = %8.2lf ms)",
+  LineBuffer(level + 1).append_and_print_cr("%-24s = %8.2lf s (avg = %8.2lf ms)",
                 str, sum / 1000.0, seq->avg());
 }
 
@@ -2078,8 +2111,7 @@
                                           const char* str,
                                           NumberSeq* seq) const {
   print_summary(level, str, seq);
-  print_indent(level + 5);
-  gclog_or_tty->print_cr("(num = %5d, std dev = %8.2lf ms, max = %8.2lf ms)",
+  LineBuffer(level + 6).append_and_print_cr("(num = %5d, std dev = %8.2lf ms, max = %8.2lf ms)",
                 seq->num(), seq->sd(), seq->maximum());
 }
 
@@ -2087,6 +2119,7 @@
                                         NumberSeq* other_times_ms,
                                         NumberSeq* calc_other_times_ms) const {
   bool should_print = false;
+  LineBuffer buf(level + 2);
 
   double max_sum = MAX2(fabs(other_times_ms->sum()),
                         fabs(calc_other_times_ms->sum()));
@@ -2095,8 +2128,7 @@
   double sum_ratio = max_sum / min_sum;
   if (sum_ratio > 1.1) {
     should_print = true;
-    print_indent(level + 1);
-    gclog_or_tty->print_cr("## CALCULATED OTHER SUM DOESN'T MATCH RECORDED ###");
+    buf.append_and_print_cr("## CALCULATED OTHER SUM DOESN'T MATCH RECORDED ###");
   }
 
   double max_avg = MAX2(fabs(other_times_ms->avg()),
@@ -2106,30 +2138,25 @@
   double avg_ratio = max_avg / min_avg;
   if (avg_ratio > 1.1) {
     should_print = true;
-    print_indent(level + 1);
-    gclog_or_tty->print_cr("## CALCULATED OTHER AVG DOESN'T MATCH RECORDED ###");
+    buf.append_and_print_cr("## CALCULATED OTHER AVG DOESN'T MATCH RECORDED ###");
   }
 
   if (other_times_ms->sum() < -0.01) {
-    print_indent(level + 1);
-    gclog_or_tty->print_cr("## RECORDED OTHER SUM IS NEGATIVE ###");
+    buf.append_and_print_cr("## RECORDED OTHER SUM IS NEGATIVE ###");
   }
 
   if (other_times_ms->avg() < -0.01) {
-    print_indent(level + 1);
-    gclog_or_tty->print_cr("## RECORDED OTHER AVG IS NEGATIVE ###");
+    buf.append_and_print_cr("## RECORDED OTHER AVG IS NEGATIVE ###");
   }
 
   if (calc_other_times_ms->sum() < -0.01) {
     should_print = true;
-    print_indent(level + 1);
-    gclog_or_tty->print_cr("## CALCULATED OTHER SUM IS NEGATIVE ###");
+    buf.append_and_print_cr("## CALCULATED OTHER SUM IS NEGATIVE ###");
   }
 
   if (calc_other_times_ms->avg() < -0.01) {
     should_print = true;
-    print_indent(level + 1);
-    gclog_or_tty->print_cr("## CALCULATED OTHER AVG IS NEGATIVE ###");
+    buf.append_and_print_cr("## CALCULATED OTHER AVG IS NEGATIVE ###");
   }
 
   if (should_print)
@@ -2210,10 +2237,9 @@
       }
     }
   } else {
-    print_indent(0);
-    gclog_or_tty->print_cr("none");
+    LineBuffer(1).append_and_print_cr("none");
   }
-  gclog_or_tty->print_cr("");
+  LineBuffer(0).append_and_print_cr("");
 }
 
 void G1CollectorPolicy::print_tracing_info() const {
@@ -2532,7 +2558,7 @@
     jint regions_added = parKnownGarbageCl.marked_regions_added();
     _hrSorted->incNumMarkedHeapRegions(regions_added);
     if (G1PrintParCleanupStats) {
-      gclog_or_tty->print("     Thread %d called %d times, added %d regions to list.\n",
+      gclog_or_tty->print_cr("     Thread %d called %d times, added %d regions to list.",
                  i, parKnownGarbageCl.invokes(), regions_added);
     }
   }
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -185,22 +185,22 @@
   G1CollectedHeap* _g1h;
   ModRefBarrierSet* _mrbs;
   CompactPoint _cp;
-  size_t _pre_used;
-  FreeRegionList _free_list;
   HumongousRegionSet _humongous_proxy_set;
 
   void free_humongous_region(HeapRegion* hr) {
     HeapWord* end = hr->end();
+    size_t dummy_pre_used;
+    FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
+
     assert(hr->startsHumongous(),
            "Only the start of a humongous region should be freed.");
-    _g1h->free_humongous_region(hr, &_pre_used, &_free_list,
+    _g1h->free_humongous_region(hr, &dummy_pre_used, &dummy_free_list,
                                 &_humongous_proxy_set, false /* par */);
-    // Do we also need to do this for the continues humongous regions
-    // we just collapsed?
     hr->prepare_for_compaction(&_cp);
     // Also clear the part of the card table that will be unused after
     // compaction.
     _mrbs->clear(MemRegion(hr->compaction_top(), end));
+    dummy_free_list.remove_all();
   }
 
 public:
@@ -208,8 +208,6 @@
   : _g1h(G1CollectedHeap::heap()),
     _mrbs(G1CollectedHeap::heap()->mr_bs()),
     _cp(NULL, cs, cs->initialize_threshold()),
-    _pre_used(0),
-    _free_list("Local Free List for G1MarkSweep"),
     _humongous_proxy_set("G1MarkSweep Humongous Proxy Set") { }
 
   void update_sets() {
@@ -219,7 +217,6 @@
                                             NULL, /* free_list */
                                             &_humongous_proxy_set,
                                             false /* par */);
-    _free_list.remove_all();
   }
 
   bool doHeapRegion(HeapRegion* hr) {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -86,28 +86,6 @@
   bool idempotent() { return true; }
 };
 
-class IntoCSRegionClosure: public HeapRegionClosure {
-  IntoCSOopClosure _blk;
-  G1CollectedHeap* _g1;
-public:
-  IntoCSRegionClosure(G1CollectedHeap* g1, OopsInHeapRegionClosure* blk) :
-    _g1(g1), _blk(g1, blk) {}
-  bool doHeapRegion(HeapRegion* r) {
-    if (!r->in_collection_set()) {
-      _blk.set_region(r);
-      if (r->isHumongous()) {
-        if (r->startsHumongous()) {
-          oop obj = oop(r->bottom());
-          obj->oop_iterate(&_blk);
-        }
-      } else {
-        r->oop_before_save_marks_iterate(&_blk);
-      }
-    }
-    return false;
-  }
-};
-
 class VerifyRSCleanCardOopClosure: public OopClosure {
   G1CollectedHeap* _g1;
 public:
@@ -329,7 +307,7 @@
     // is during RSet updating within an evacuation pause.
     // In this case worker_i should be the id of a GC worker thread.
     assert(SafepointSynchronize::is_at_safepoint(), "not during an evacuation pause");
-    assert(worker_i < (int) DirtyCardQueueSet::num_par_ids(), "should be a GC worker");
+    assert(worker_i < (int) (ParallelGCThreads == 0 ? 1 : ParallelGCThreads), "should be a GC worker");
 
     if (_g1rs->concurrentRefineOneCard(card_ptr, worker_i, true)) {
       // 'card_ptr' contains references that point into the collection
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -83,11 +83,15 @@
   }
 
   template <class T> void write_ref_array_pre_work(T* dst, int count);
-  virtual void write_ref_array_pre(oop* dst, int count) {
-    write_ref_array_pre_work(dst, count);
+  virtual void write_ref_array_pre(oop* dst, int count, bool dest_uninitialized) {
+    if (!dest_uninitialized) {
+      write_ref_array_pre_work(dst, count);
+    }
   }
-  virtual void write_ref_array_pre(narrowOop* dst, int count) {
-    write_ref_array_pre_work(dst, count);
+  virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) {
+    if (!dest_uninitialized) {
+      write_ref_array_pre_work(dst, count);
+    }
   }
 };
 
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -53,8 +53,8 @@
 class HeapRegionSetBase;
 
 #define HR_FORMAT "%d:["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
-#define HR_FORMAT_PARAMS(__hr) (__hr)->hrs_index(), (__hr)->bottom(), \
-                               (__hr)->top(), (__hr)->end()
+#define HR_FORMAT_PARAMS(_hr_) (_hr_)->hrs_index(), (_hr_)->bottom(), \
+                               (_hr_)->top(), (_hr_)->end()
 
 // A dirty card to oop closure for heap regions. It
 // knows how to get the G1 heap and how to use the bitmap
@@ -518,13 +518,13 @@
                    containing_set, _containing_set));
 
     _containing_set = containing_set;
-}
+  }
 
   HeapRegionSetBase* containing_set() { return _containing_set; }
 #else // ASSERT
   void set_containing_set(HeapRegionSetBase* containing_set) { }
 
-  // containing_set() is only used in asserts so there's not reason
+  // containing_set() is only used in asserts so there's no reason
   // to provide a dummy version of it.
 #endif // ASSERT
 
@@ -535,14 +535,15 @@
   bool pending_removal() { return _pending_removal; }
 
   void set_pending_removal(bool pending_removal) {
-    // We can only set pending_removal to true, if it's false and the
-    // region belongs to a set.
-    assert(!pending_removal ||
-           (!_pending_removal && containing_set() != NULL), "pre-condition");
-    // We can only set pending_removal to false, if it's true and the
-    // region does not belong to a set.
-    assert( pending_removal ||
-           ( _pending_removal && containing_set() == NULL), "pre-condition");
+    if (pending_removal) {
+      assert(!_pending_removal && containing_set() != NULL,
+             "can only set pending removal to true if it's false and "
+             "the region belongs to a region set");
+    } else {
+      assert( _pending_removal && containing_set() == NULL,
+              "can only set pending removal to false if it's true and "
+              "the region does not belong to a region set");
+    }
 
     _pending_removal = pending_removal;
   }
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -165,7 +165,7 @@
 
   assert(num_so_far <= num, "post-condition");
   if (num_so_far == num) {
-    // we find enough space for the humongous object
+    // we found enough space for the humongous object
     assert(from <= first && first < _regions.length(), "post-condition");
     assert(first < curr && (curr - first) == (int) num, "post-condition");
     for (int i = first; i < first + (int) num; ++i) {
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -76,7 +76,8 @@
   // that are available for allocation.
   size_t free_suffix();
 
-  // Finds a contiguous set of empty regions of length num.
+  // Find a contiguous set of empty regions of length num and return
+  // the index of the first region or -1 if the search was unsuccessful.
   int find_contiguous(size_t num);
 
   // Apply the "doHeapRegion" method of "blk" to all regions in "this",
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -42,7 +42,7 @@
   return region_num;
 }
 
-void HeapRegionSetBase::fill_in_ext_msg(hrl_ext_msg* msg, const char* message) {
+void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) {
   msg->append("[%s] %s "
               "ln: "SIZE_FORMAT" rn: "SIZE_FORMAT" "
               "cy: "SIZE_FORMAT" ud: "SIZE_FORMAT,
@@ -109,30 +109,30 @@
   // for the verification calls. If we do verification without the
   // appropriate locks and the set changes underneath our feet
   // verification might fail and send us on a wild goose chase.
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
 
   guarantee(( is_empty() && length() == 0 && region_num() == 0 &&
               total_used_bytes() == 0 && total_capacity_bytes() == 0) ||
             (!is_empty() && length() >= 0 && region_num() >= 0 &&
               total_used_bytes() >= 0 && total_capacity_bytes() >= 0),
-            hrl_ext_msg(this, "invariant"));
+            hrs_ext_msg(this, "invariant"));
 
   guarantee((!regions_humongous() && region_num() == length()) ||
             ( regions_humongous() && region_num() >= length()),
-            hrl_ext_msg(this, "invariant"));
+            hrs_ext_msg(this, "invariant"));
 
   guarantee(!regions_empty() || total_used_bytes() == 0,
-            hrl_ext_msg(this, "invariant"));
+            hrs_ext_msg(this, "invariant"));
 
   guarantee(total_used_bytes() <= total_capacity_bytes(),
-            hrl_ext_msg(this, "invariant"));
+            hrs_ext_msg(this, "invariant"));
 }
 
 void HeapRegionSetBase::verify_start() {
   // See comment in verify() about MT safety and verification.
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
   assert(!_verify_in_progress,
-         hrl_ext_msg(this, "verification should not be in progress"));
+         hrs_ext_msg(this, "verification should not be in progress"));
 
   // Do the basic verification first before we do the checks over the regions.
   HeapRegionSetBase::verify();
@@ -146,11 +146,11 @@
 
 void HeapRegionSetBase::verify_next_region(HeapRegion* hr) {
   // See comment in verify() about MT safety and verification.
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
   assert(_verify_in_progress,
-         hrl_ext_msg(this, "verification should be in progress"));
+         hrs_ext_msg(this, "verification should be in progress"));
 
-  guarantee(verify_region(hr, this), hrl_ext_msg(this, "region verification"));
+  guarantee(verify_region(hr, this), hrs_ext_msg(this, "region verification"));
 
   _calc_length               += 1;
   if (!hr->isHumongous()) {
@@ -164,28 +164,28 @@
 
 void HeapRegionSetBase::verify_end() {
   // See comment in verify() about MT safety and verification.
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
   assert(_verify_in_progress,
-         hrl_ext_msg(this, "verification should be in progress"));
+         hrs_ext_msg(this, "verification should be in progress"));
 
   guarantee(length() == _calc_length,
-            hrl_err_msg("[%s] length: "SIZE_FORMAT" should be == "
+            hrs_err_msg("[%s] length: "SIZE_FORMAT" should be == "
                         "calc length: "SIZE_FORMAT,
                         name(), length(), _calc_length));
 
   guarantee(region_num() == _calc_region_num,
-            hrl_err_msg("[%s] region num: "SIZE_FORMAT" should be == "
+            hrs_err_msg("[%s] region num: "SIZE_FORMAT" should be == "
                         "calc region num: "SIZE_FORMAT,
                         name(), region_num(), _calc_region_num));
 
   guarantee(total_capacity_bytes() == _calc_total_capacity_bytes,
-            hrl_err_msg("[%s] capacity bytes: "SIZE_FORMAT" should be == "
+            hrs_err_msg("[%s] capacity bytes: "SIZE_FORMAT" should be == "
                         "calc capacity bytes: "SIZE_FORMAT,
                         name(),
                         total_capacity_bytes(), _calc_total_capacity_bytes));
 
   guarantee(total_used_bytes() == _calc_total_used_bytes,
-            hrl_err_msg("[%s] used bytes: "SIZE_FORMAT" should be == "
+            hrs_err_msg("[%s] used bytes: "SIZE_FORMAT" should be == "
                         "calc used bytes: "SIZE_FORMAT,
                         name(), total_used_bytes(), _calc_total_used_bytes));
 
@@ -221,9 +221,9 @@
 //////////////////// HeapRegionSet ////////////////////
 
 void HeapRegionSet::update_from_proxy(HeapRegionSet* proxy_set) {
-  hrl_assert_mt_safety_ok(this);
-  hrl_assert_mt_safety_ok(proxy_set);
-  hrl_assert_sets_match(this, proxy_set);
+  hrs_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(proxy_set);
+  hrs_assert_sets_match(this, proxy_set);
 
   verify_optional();
   proxy_set->verify_optional();
@@ -231,19 +231,19 @@
   if (proxy_set->is_empty()) return;
 
   assert(proxy_set->length() <= _length,
-         hrl_err_msg("[%s] proxy set length: "SIZE_FORMAT" "
+         hrs_err_msg("[%s] proxy set length: "SIZE_FORMAT" "
                      "should be <= length: "SIZE_FORMAT,
                      name(), proxy_set->length(), _length));
   _length -= proxy_set->length();
 
   assert(proxy_set->region_num() <= _region_num,
-         hrl_err_msg("[%s] proxy set region num: "SIZE_FORMAT" "
+         hrs_err_msg("[%s] proxy set region num: "SIZE_FORMAT" "
                      "should be <= region num: "SIZE_FORMAT,
                      name(), proxy_set->region_num(), _region_num));
   _region_num -= proxy_set->region_num();
 
   assert(proxy_set->total_used_bytes() <= _total_used_bytes,
-         hrl_err_msg("[%s] proxy set used bytes: "SIZE_FORMAT" "
+         hrs_err_msg("[%s] proxy set used bytes: "SIZE_FORMAT" "
                      "should be <= used bytes: "SIZE_FORMAT,
                      name(), proxy_set->total_used_bytes(),
                      _total_used_bytes));
@@ -257,13 +257,13 @@
 
 //////////////////// HeapRegionLinkedList ////////////////////
 
-void HeapRegionLinkedList::fill_in_ext_msg_extra(hrl_ext_msg* msg) {
+void HeapRegionLinkedList::fill_in_ext_msg_extra(hrs_ext_msg* msg) {
   msg->append(" hd: "PTR_FORMAT" tl: "PTR_FORMAT, head(), tail());
 }
 
 void HeapRegionLinkedList::add_as_tail(HeapRegionLinkedList* from_list) {
-  hrl_assert_mt_safety_ok(this);
-  hrl_assert_mt_safety_ok(from_list);
+  hrs_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(from_list);
 
   verify_optional();
   from_list->verify_optional();
@@ -283,10 +283,10 @@
 #endif // ASSERT
 
   if (_tail != NULL) {
-    assert(length() >  0 && _head != NULL, hrl_ext_msg(this, "invariant"));
+    assert(length() >  0 && _head != NULL, hrs_ext_msg(this, "invariant"));
     _tail->set_next(from_list->_head);
   } else {
-    assert(length() == 0 && _head == NULL, hrl_ext_msg(this, "invariant"));
+    assert(length() == 0 && _head == NULL, hrs_ext_msg(this, "invariant"));
     _head = from_list->_head;
   }
   _tail = from_list->_tail;
@@ -301,12 +301,12 @@
 }
 
 void HeapRegionLinkedList::remove_all() {
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
   verify_optional();
 
   HeapRegion* curr = _head;
   while (curr != NULL) {
-    hrl_assert_region_ok(this, curr, this);
+    hrs_assert_region_ok(this, curr, this);
 
     HeapRegion* next = curr->next();
     curr->set_next(NULL);
@@ -319,9 +319,9 @@
 }
 
 void HeapRegionLinkedList::remove_all_pending(size_t target_count) {
-  hrl_assert_mt_safety_ok(this);
-  assert(target_count > 1, hrl_ext_msg(this, "pre-condition"));
-  assert(!is_empty(), hrl_ext_msg(this, "pre-condition"));
+  hrs_assert_mt_safety_ok(this);
+  assert(target_count > 1, hrs_ext_msg(this, "pre-condition"));
+  assert(!is_empty(), hrs_ext_msg(this, "pre-condition"));
 
   verify_optional();
   DEBUG_ONLY(size_t old_length = length();)
@@ -330,27 +330,27 @@
   HeapRegion* prev = NULL;
   size_t count = 0;
   while (curr != NULL) {
-    hrl_assert_region_ok(this, curr, this);
+    hrs_assert_region_ok(this, curr, this);
     HeapRegion* next = curr->next();
 
     if (curr->pending_removal()) {
       assert(count < target_count,
-             hrl_err_msg("[%s] should not come across more regions "
+             hrs_err_msg("[%s] should not come across more regions "
                          "pending for removal than target_count: "SIZE_FORMAT,
                          name(), target_count));
 
       if (prev == NULL) {
-        assert(_head == curr, hrl_ext_msg(this, "invariant"));
+        assert(_head == curr, hrs_ext_msg(this, "invariant"));
         _head = next;
       } else {
-        assert(_head != curr, hrl_ext_msg(this, "invariant"));
+        assert(_head != curr, hrs_ext_msg(this, "invariant"));
         prev->set_next(next);
       }
       if (next == NULL) {
-        assert(_tail == curr, hrl_ext_msg(this, "invariant"));
+        assert(_tail == curr, hrs_ext_msg(this, "invariant"));
         _tail = prev;
       } else {
-        assert(_tail != curr, hrl_ext_msg(this, "invariant"));
+        assert(_tail != curr, hrs_ext_msg(this, "invariant"));
       }
 
       curr->set_next(NULL);
@@ -371,10 +371,10 @@
   }
 
   assert(count == target_count,
-         hrl_err_msg("[%s] count: "SIZE_FORMAT" should be == "
+         hrs_err_msg("[%s] count: "SIZE_FORMAT" should be == "
                      "target_count: "SIZE_FORMAT, name(), count, target_count));
   assert(length() + target_count == old_length,
-         hrl_err_msg("[%s] new length should be consistent "
+         hrs_err_msg("[%s] new length should be consistent "
                      "new length: "SIZE_FORMAT" old length: "SIZE_FORMAT" "
                      "target_count: "SIZE_FORMAT,
                      name(), length(), old_length, target_count));
@@ -385,7 +385,7 @@
 void HeapRegionLinkedList::verify() {
   // See comment in HeapRegionSetBase::verify() about MT safety and
   // verification.
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
 
   // This will also do the basic verification too.
   verify_start();
@@ -399,7 +399,7 @@
 
     count += 1;
     guarantee(count < _unrealistically_long_length,
-              hrl_err_msg("[%s] the calculated length: "SIZE_FORMAT" "
+              hrs_err_msg("[%s] the calculated length: "SIZE_FORMAT" "
                           "seems very long, is there maybe a cycle? "
                           "curr: "PTR_FORMAT" prev0: "PTR_FORMAT" "
                           "prev1: "PTR_FORMAT" length: "SIZE_FORMAT,
@@ -410,7 +410,7 @@
     curr  = curr->next();
   }
 
-  guarantee(_tail == prev0, hrl_ext_msg(this, "post-condition"));
+  guarantee(_tail == prev0, hrs_ext_msg(this, "post-condition"));
 
   verify_end();
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -28,8 +28,8 @@
 #include "gc_implementation/g1/heapRegion.hpp"
 
 // Large buffer for some cases where the output might be larger than normal.
-#define HRL_ERR_MSG_BUFSZ 512
-typedef FormatBuffer<HRL_ERR_MSG_BUFSZ> hrl_err_msg;
+#define HRS_ERR_MSG_BUFSZ 512
+typedef FormatBuffer<HRS_ERR_MSG_BUFSZ> hrs_err_msg;
 
 // Set verification will be forced either if someone defines
 // HEAP_REGION_SET_FORCE_VERIFY to be 1, or in builds in which
@@ -45,10 +45,10 @@
 // (e.g., length, region num, used bytes sum) plus any shared
 // functionality (e.g., verification).
 
-class hrl_ext_msg;
+class hrs_ext_msg;
 
 class HeapRegionSetBase VALUE_OBJ_CLASS_SPEC {
-  friend class hrl_ext_msg;
+  friend class hrs_ext_msg;
 
 protected:
   static size_t calculate_region_num(HeapRegion* hr);
@@ -104,10 +104,10 @@
   virtual bool check_mt_safety() { return true; }
 
   // fill_in_ext_msg() writes the the values of the set's attributes
-  // in the custom err_msg (hrl_ext_msg). fill_in_ext_msg_extra()
+  // in the custom err_msg (hrs_ext_msg). fill_in_ext_msg_extra()
   // allows subclasses to append further information.
-  virtual void fill_in_ext_msg_extra(hrl_ext_msg* msg) { }
-  void fill_in_ext_msg(hrl_ext_msg* msg, const char* message);
+  virtual void fill_in_ext_msg_extra(hrs_ext_msg* msg) { }
+  void fill_in_ext_msg(hrs_ext_msg* msg, const char* message);
 
   // It updates the fields of the set to reflect hr being added to
   // the set.
@@ -170,9 +170,9 @@
 // the fields of the associated set. This can be very helpful in
 // diagnosing failures.
 
-class hrl_ext_msg : public hrl_err_msg {
+class hrs_ext_msg : public hrs_err_msg {
 public:
-  hrl_ext_msg(HeapRegionSetBase* set, const char* message) : hrl_err_msg("") {
+  hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") {
     set->fill_in_ext_msg(this, message);
   }
 };
@@ -180,25 +180,25 @@
 // These two macros are provided for convenience, to keep the uses of
 // these two asserts a bit more concise.
 
-#define hrl_assert_mt_safety_ok(_set_)                                        \
+#define hrs_assert_mt_safety_ok(_set_)                                        \
   do {                                                                        \
-    assert((_set_)->check_mt_safety(), hrl_ext_msg((_set_), "MT safety"));    \
+    assert((_set_)->check_mt_safety(), hrs_ext_msg((_set_), "MT safety"));    \
   } while (0)
 
-#define hrl_assert_region_ok(_set_, _hr_, _expected_)                         \
+#define hrs_assert_region_ok(_set_, _hr_, _expected_)                         \
   do {                                                                        \
     assert((_set_)->verify_region((_hr_), (_expected_)),                      \
-           hrl_ext_msg((_set_), "region verification"));                      \
+           hrs_ext_msg((_set_), "region verification"));                      \
   } while (0)
 
 //////////////////// HeapRegionSet ////////////////////
 
-#define hrl_assert_sets_match(_set1_, _set2_)                                 \
+#define hrs_assert_sets_match(_set1_, _set2_)                                 \
   do {                                                                        \
     assert(((_set1_)->regions_humongous() ==                                  \
                                             (_set2_)->regions_humongous()) && \
            ((_set1_)->regions_empty() == (_set2_)->regions_empty()),          \
-           hrl_err_msg("the contents of set %s and set %s should match",      \
+           hrs_err_msg("the contents of set %s and set %s should match",      \
                        (_set1_)->name(), (_set2_)->name()));                  \
   } while (0)
 
@@ -267,7 +267,7 @@
   HeapRegion* tail() { return _tail; }
 
 protected:
-  virtual void fill_in_ext_msg_extra(hrl_ext_msg* msg);
+  virtual void fill_in_ext_msg_extra(hrs_ext_msg* msg);
 
   // See the comment for HeapRegionSetBase::clear()
   virtual void clear();
@@ -309,10 +309,10 @@
   virtual void print_on(outputStream* out, bool print_contents = false);
 };
 
-//////////////////// HeapRegionLinkedList ////////////////////
+//////////////////// HeapRegionLinkedListIterator ////////////////////
 
-// Iterator class that provides a convenient way to iterator over the
-// regions in a HeapRegionLinkedList instance.
+// Iterator class that provides a convenient way to iterate over the
+// regions of a HeapRegionLinkedList instance.
 
 class HeapRegionLinkedListIterator : public StackObj {
 private:
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.inline.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.inline.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -42,8 +42,8 @@
 }
 
 inline void HeapRegionSetBase::add_internal(HeapRegion* hr) {
-  hrl_assert_region_ok(this, hr, NULL);
-  assert(hr->next() == NULL, hrl_ext_msg(this, "should not already be linked"));
+  hrs_assert_region_ok(this, hr, NULL);
+  assert(hr->next() == NULL, hrs_ext_msg(this, "should not already be linked"));
 
   update_for_addition(hr);
   hr->set_containing_set(this);
@@ -51,7 +51,7 @@
 
 inline void HeapRegionSetBase::update_for_removal(HeapRegion* hr) {
   // Assumes the caller has already verified the region.
-  assert(_length > 0, hrl_ext_msg(this, "pre-condition"));
+  assert(_length > 0, hrs_ext_msg(this, "pre-condition"));
   _length -= 1;
 
   size_t region_num_diff;
@@ -61,22 +61,22 @@
     region_num_diff = calculate_region_num(hr);
   }
   assert(region_num_diff <= _region_num,
-         hrl_err_msg("[%s] region's region num: "SIZE_FORMAT" "
+         hrs_err_msg("[%s] region's region num: "SIZE_FORMAT" "
                      "should be <= region num: "SIZE_FORMAT,
                      name(), region_num_diff, _region_num));
   _region_num -= region_num_diff;
 
   size_t used_bytes = hr->used();
   assert(used_bytes <= _total_used_bytes,
-         hrl_err_msg("[%s] region's used bytes: "SIZE_FORMAT" "
+         hrs_err_msg("[%s] region's used bytes: "SIZE_FORMAT" "
                      "should be <= used bytes: "SIZE_FORMAT,
                      name(), used_bytes, _total_used_bytes));
   _total_used_bytes -= used_bytes;
 }
 
 inline void HeapRegionSetBase::remove_internal(HeapRegion* hr) {
-  hrl_assert_region_ok(this, hr, this);
-  assert(hr->next() == NULL, hrl_ext_msg(this, "should already be unlinked"));
+  hrs_assert_region_ok(this, hr, this);
+  assert(hr->next() == NULL, hrs_ext_msg(this, "should already be unlinked"));
 
   hr->set_containing_set(NULL);
   update_for_removal(hr);
@@ -85,13 +85,13 @@
 //////////////////// HeapRegionSet ////////////////////
 
 inline void HeapRegionSet::add(HeapRegion* hr) {
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
   // add_internal() will verify the region.
   add_internal(hr);
 }
 
 inline void HeapRegionSet::remove(HeapRegion* hr) {
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
   // remove_internal() will verify the region.
   remove_internal(hr);
 }
@@ -101,8 +101,8 @@
   // No need to fo the MT safety check here given that this method
   // does not update the contents of the set but instead accumulates
   // the changes in proxy_set which is assumed to be thread-local.
-  hrl_assert_sets_match(this, proxy_set);
-  hrl_assert_region_ok(this, hr, this);
+  hrs_assert_sets_match(this, proxy_set);
+  hrs_assert_region_ok(this, hr, this);
 
   hr->set_containing_set(NULL);
   proxy_set->update_for_addition(hr);
@@ -111,10 +111,10 @@
 //////////////////// HeapRegionLinkedList ////////////////////
 
 inline void HeapRegionLinkedList::add_as_tail(HeapRegion* hr) {
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
   assert((length() == 0 && _head == NULL && _tail == NULL) ||
          (length() >  0 && _head != NULL && _tail != NULL),
-         hrl_ext_msg(this, "invariant"));
+         hrs_ext_msg(this, "invariant"));
   // add_internal() will verify the region.
   add_internal(hr);
 
@@ -128,10 +128,10 @@
 }
 
 inline HeapRegion* HeapRegionLinkedList::remove_head() {
-  hrl_assert_mt_safety_ok(this);
-  assert(!is_empty(), hrl_ext_msg(this, "the list should not be empty"));
+  hrs_assert_mt_safety_ok(this);
+  assert(!is_empty(), hrs_ext_msg(this, "the list should not be empty"));
   assert(length() > 0 && _head != NULL && _tail != NULL,
-         hrl_ext_msg(this, "invariant"));
+         hrs_ext_msg(this, "invariant"));
 
   // We need to unlink it first.
   HeapRegion* hr = _head;
@@ -147,7 +147,7 @@
 }
 
 inline HeapRegion* HeapRegionLinkedList::remove_head_or_null() {
-  hrl_assert_mt_safety_ok(this);
+  hrs_assert_mt_safety_ok(this);
 
   if (!is_empty()) {
     return remove_head();
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSets.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSets.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -52,7 +52,7 @@
                                             FreeList_lock->owned_by_self())) ||
             (!SafepointSynchronize::is_at_safepoint() &&
                                                 Heap_lock->owned_by_self()),
-            hrl_ext_msg(this, "master free list MT safety protocol"));
+            hrs_ext_msg(this, "master free list MT safety protocol"));
 
   return FreeRegionList::check_mt_safety();
 }
@@ -65,7 +65,7 @@
   // while holding the SecondaryFreeList_lock.
 
   guarantee(SecondaryFreeList_lock->owned_by_self(),
-            hrl_ext_msg(this, "secondary free list MT safety protocol"));
+            hrs_ext_msg(this, "secondary free list MT safety protocol"));
 
   return FreeRegionList::check_mt_safety();
 }
@@ -81,7 +81,7 @@
   return HeapRegionSet::verify_region_extra(hr);
 }
 
-//////////////////// HumongousRegionSet ////////////////////
+//////////////////// MasterHumongousRegionSet ////////////////////
 
 bool MasterHumongousRegionSet::check_mt_safety() {
   // Master Humongous Set MT safety protocol:
@@ -97,6 +97,6 @@
                                              OldSets_lock->owned_by_self())) ||
             (!SafepointSynchronize::is_at_safepoint() &&
                                                  Heap_lock->owned_by_self()),
-            hrl_ext_msg(this, "master humongous set MT safety protocol"));
+            hrs_ext_msg(this, "master humongous set MT safety protocol"));
   return HumongousRegionSet::check_mt_safety();
 }
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1530,13 +1530,15 @@
 {
   if (_ref_processor == NULL) {
     // Allocate and initialize a reference processor
-    _ref_processor = ReferenceProcessor::create_ref_processor(
-        _reserved,                  // span
-        refs_discovery_is_atomic(), // atomic_discovery
-        refs_discovery_is_mt(),     // mt_discovery
-        NULL,                       // is_alive_non_header
-        ParallelGCThreads,
-        ParallelRefProcEnabled);
+    _ref_processor =
+      new ReferenceProcessor(_reserved,                  // span
+                             ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
+                             (int) ParallelGCThreads,    // mt processing degree
+                             refs_discovery_is_mt(),     // mt discovery
+                             (int) ParallelGCThreads,    // mt discovery degree
+                             refs_discovery_is_atomic(), // atomic_discovery
+                             NULL,                       // is_alive_non_header
+                             false);                     // write barrier for next field updates
   }
 }
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +58,7 @@
 
 void PSMarkSweep::initialize() {
   MemRegion mr = Universe::heap()->reserved_region();
-  _ref_processor = new ReferenceProcessor(mr,
-                                          true,    // atomic_discovery
-                                          false);  // mt_discovery
+  _ref_processor = new ReferenceProcessor(mr);     // a vanilla ref proc
   _counters = new CollectorCounters("PSMarkSweep", 1);
 }
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -827,13 +827,15 @@
   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
 
   MemRegion mr = heap->reserved_region();
-  _ref_processor = ReferenceProcessor::create_ref_processor(
-    mr,                         // span
-    true,                       // atomic_discovery
-    true,                       // mt_discovery
-    &_is_alive_closure,
-    ParallelGCThreads,
-    ParallelRefProcEnabled);
+  _ref_processor =
+    new ReferenceProcessor(mr,            // span
+                           ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
+                           (int) ParallelGCThreads, // mt processing degree
+                           true,          // mt discovery
+                           (int) ParallelGCThreads, // mt discovery degree
+                           true,          // atomic_discovery
+                           &_is_alive_closure, // non-header is alive closure
+                           false);        // write barrier for next field updates
   _counters = new CollectorCounters("PSParallelCompact", 1);
 
   // Initialize static fields in ParCompactionManager.
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -411,7 +411,7 @@
 template <class T> void PSPromotionManager::process_array_chunk_work(
                                                  oop obj,
                                                  int start, int end) {
-  assert(start < end, "invariant");
+  assert(start <= end, "invariant");
   T* const base      = (T*)objArrayOop(obj)->base();
   T* p               = base + start;
   T* const chunk_end = base + end;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -796,13 +796,15 @@
 
   // Initialize ref handling object for scavenging.
   MemRegion mr = young_gen->reserved();
-  _ref_processor = ReferenceProcessor::create_ref_processor(
-    mr,                         // span
-    true,                       // atomic_discovery
-    true,                       // mt_discovery
-    NULL,                       // is_alive_non_header
-    ParallelGCThreads,
-    ParallelRefProcEnabled);
+  _ref_processor =
+    new ReferenceProcessor(mr,                         // span
+                           ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
+                           (int) ParallelGCThreads,    // mt processing degree
+                           true,                       // mt discovery
+                           (int) ParallelGCThreads,    // mt discovery degree
+                           true,                       // atomic_discovery
+                           NULL,                       // header provides liveness info
+                           false);                     // next field updates do not need write barrier
 
   // Cache the cardtable
   BarrierSet* bs = Universe::heap()->barrier_set();
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
     empty,                                                      // empty method (code: _return)
     accessor,                                                   // accessor method (code: _aload_0, _getfield, _(a|i)return)
     abstract,                                                   // abstract method (throws an AbstractMethodException)
-    method_handle,                                              // java.dyn.MethodHandles::invoke
+    method_handle,                                              // java.lang.invoke.MethodHandles::invoke
     java_lang_math_sin,                                         // implementation of java.lang.Math.sin   (x)
     java_lang_math_cos,                                         // implementation of java.lang.Math.cos   (x)
     java_lang_math_tan,                                         // implementation of java.lang.Math.tan   (x)
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -369,7 +369,10 @@
   }
 
   // create exception
-  THROW_MSG(vmSymbols::java_dyn_WrongMethodTypeException(), message);
+  Symbol* java_lang_invoke_WrongMethodTypeException = vmSymbols::java_lang_invoke_WrongMethodTypeException();
+  if (AllowTransitionalJSR292)
+    java_lang_invoke_WrongMethodTypeException = SystemDictionaryHandles::WrongMethodTypeException_klass()->name();
+  THROW_MSG(java_lang_invoke_WrongMethodTypeException, message);
 }
 IRT_END
 
@@ -794,7 +797,7 @@
   Handle info;  // optional argument(s) in JVM_CONSTANT_InvokeDynamic
   Handle bootm = SystemDictionary::find_bootstrap_method(caller_method, caller_bci,
                                                          main_index, info, CHECK);
-  if (!java_dyn_MethodHandle::is_instance(bootm())) {
+  if (!java_lang_invoke_MethodHandle::is_instance(bootm())) {
     THROW_MSG(vmSymbols::java_lang_IllegalStateException(),
               "no bootstrap method found for invokedynamic");
   }
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -217,11 +217,13 @@
   if (EnableMethodHandles &&
       klass() == SystemDictionary::MethodHandle_klass() &&
       methodOopDesc::is_method_handle_invoke_name(name)) {
-    if (!MethodHandles::enabled()) {
+    if (!THREAD->is_Compiler_thread() && !MethodHandles::enabled()) {
       // Make sure the Java part of the runtime has been booted up.
       klassOop natives = SystemDictionary::MethodHandleNatives_klass();
       if (natives == NULL || instanceKlass::cast(natives)->is_not_initialized()) {
-        SystemDictionary::resolve_or_fail(vmSymbols::sun_dyn_MethodHandleNatives(),
+        Symbol* natives_name = vmSymbols::java_lang_invoke_MethodHandleNatives();
+        if (natives != NULL && AllowTransitionalJSR292)  natives_name = Klass::cast(natives)->name();
+        SystemDictionary::resolve_or_fail(natives_name,
                                           Handle(),
                                           Handle(),
                                           true,
@@ -298,7 +300,7 @@
 }
 
 void LinkResolver::resolve_dynamic_method(methodHandle& resolved_method, KlassHandle& resolved_klass, constantPoolHandle pool, int index, TRAPS) {
-  // The class is java.dyn.MethodHandle
+  // The class is java.lang.invoke.MethodHandle
   resolved_klass = SystemDictionaryHandles::MethodHandle_klass();
 
   Symbol* method_name = vmSymbols::invokeExact_name();
--- a/hotspot/src/share/vm/memory/allocation.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/allocation.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -422,6 +422,9 @@
   return sum;                   // Return total consumed space.
 }
 
+void Arena::signal_out_of_memory(size_t sz, const char* whence) const {
+  vm_exit_out_of_memory(sz, whence);
+}
 
 // Grow a new Chunk
 void* Arena::grow( size_t x ) {
@@ -431,8 +434,9 @@
   Chunk *k = _chunk;            // Get filled-up chunk address
   _chunk = new (len) Chunk(len);
 
-  if (_chunk == NULL)
-      vm_exit_out_of_memory(len * Chunk::aligned_overhead_size(), "Arena::grow");
+  if (_chunk == NULL) {
+    signal_out_of_memory(len * Chunk::aligned_overhead_size(), "Arena::grow");
+  }
 
   if (k) k->set_next(_chunk);   // Append new chunk to end of linked list
   else _first = _chunk;
@@ -529,6 +533,7 @@
 // for debugging with UseMallocOnly
 void* Arena::internal_malloc_4(size_t x) {
   assert( (x&(sizeof(char*)-1)) == 0, "misaligned size" );
+  check_for_overflow(x, "Arena::internal_malloc_4");
   if (_hwm + x > _max) {
     return grow(x);
   } else {
--- a/hotspot/src/share/vm/memory/allocation.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/allocation.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -207,6 +207,15 @@
   debug_only(void* malloc(size_t size);)
   debug_only(void* internal_malloc_4(size_t x);)
   NOT_PRODUCT(void inc_bytes_allocated(size_t x);)
+
+  void signal_out_of_memory(size_t request, const char* whence) const;
+
+  void check_for_overflow(size_t request, const char* whence) const {
+    if (UINTPTR_MAX - request < (uintptr_t)_hwm) {
+      signal_out_of_memory(request, whence);
+    }
+ }
+
  public:
   Arena();
   Arena(size_t init_size);
@@ -220,6 +229,7 @@
     assert(is_power_of_2(ARENA_AMALLOC_ALIGNMENT) , "should be a power of 2");
     x = ARENA_ALIGN(x);
     debug_only(if (UseMallocOnly) return malloc(x);)
+    check_for_overflow(x, "Arena::Amalloc");
     NOT_PRODUCT(inc_bytes_allocated(x);)
     if (_hwm + x > _max) {
       return grow(x);
@@ -233,6 +243,7 @@
   void *Amalloc_4(size_t x) {
     assert( (x&(sizeof(char*)-1)) == 0, "misaligned size" );
     debug_only(if (UseMallocOnly) return malloc(x);)
+    check_for_overflow(x, "Arena::Amalloc_4");
     NOT_PRODUCT(inc_bytes_allocated(x);)
     if (_hwm + x > _max) {
       return grow(x);
@@ -253,6 +264,7 @@
     size_t delta = (((size_t)_hwm + DALIGN_M1) & ~DALIGN_M1) - (size_t)_hwm;
     x += delta;
 #endif
+    check_for_overflow(x, "Arena::Amalloc_D");
     NOT_PRODUCT(inc_bytes_allocated(x);)
     if (_hwm + x > _max) {
       return grow(x); // grow() returns a result aligned >= 8 bytes.
--- a/hotspot/src/share/vm/memory/barrierSet.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/barrierSet.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -35,9 +35,9 @@
                    start,            count);
 #endif
   if (UseCompressedOops) {
-    Universe::heap()->barrier_set()->write_ref_array_pre((narrowOop*)start, (int)count);
+    Universe::heap()->barrier_set()->write_ref_array_pre((narrowOop*)start, (int)count, false);
   } else {
-    Universe::heap()->barrier_set()->write_ref_array_pre(      (oop*)start, (int)count);
+    Universe::heap()->barrier_set()->write_ref_array_pre(      (oop*)start, (int)count, false);
   }
 }
 
--- a/hotspot/src/share/vm/memory/barrierSet.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,10 @@
     Uninit
   };
 
+  enum Flags {
+    None                = 0,
+    TargetUninitialized = 1
+  };
 protected:
   int _max_covered_regions;
   Name _kind;
@@ -128,8 +132,10 @@
   virtual void read_prim_array(MemRegion mr) = 0;
 
   // Below length is the # array elements being written
-  virtual void write_ref_array_pre(      oop* dst, int length) {}
-  virtual void write_ref_array_pre(narrowOop* dst, int length) {}
+  virtual void write_ref_array_pre(oop* dst, int length,
+                                   bool dest_uninitialized = false) {}
+  virtual void write_ref_array_pre(narrowOop* dst, int length,
+                                   bool dest_uninitialized = false) {}
   // Below count is the # array elements being written, starting
   // at the address "start", which may not necessarily be HeapWord-aligned
   inline void write_ref_array(HeapWord* start, size_t count);
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,10 +293,11 @@
   // Determine maximum size of gen0
 
   size_t max_new_size = 0;
-  if (FLAG_IS_CMDLINE(MaxNewSize)) {
+  if (FLAG_IS_CMDLINE(MaxNewSize) || FLAG_IS_ERGO(MaxNewSize)) {
     if (MaxNewSize < min_alignment()) {
       max_new_size = min_alignment();
-    } else if (MaxNewSize >= max_heap_byte_size()) {
+    }
+    if (MaxNewSize >= max_heap_byte_size()) {
       max_new_size = align_size_down(max_heap_byte_size() - min_alignment(),
                                      min_alignment());
       warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or "
@@ -333,7 +334,7 @@
   assert(max_new_size > 0, "All paths should set max_new_size");
 
   // Given the maximum gen0 size, determine the initial and
-  // minimum sizes.
+  // minimum gen0 sizes.
 
   if (max_heap_byte_size() == min_heap_byte_size()) {
     // The maximum and minimum heap sizes are the same so
@@ -396,7 +397,7 @@
   }
 
   if (PrintGCDetails && Verbose) {
-    gclog_or_tty->print_cr("Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
+    gclog_or_tty->print_cr("1: Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
       SIZE_FORMAT "  Maximum gen0 " SIZE_FORMAT,
       min_gen0_size(), initial_gen0_size(), max_gen0_size());
   }
@@ -448,7 +449,7 @@
   // At this point the minimum, initial and maximum sizes
   // of the overall heap and of gen0 have been determined.
   // The maximum gen1 size can be determined from the maximum gen0
-  // and maximum heap size since not explicit flags exits
+  // and maximum heap size since no explicit flags exits
   // for setting the gen1 maximum.
   _max_gen1_size = max_heap_byte_size() - _max_gen0_size;
   _max_gen1_size =
@@ -494,13 +495,13 @@
           "generation sizes: using maximum heap = " SIZE_FORMAT
           " -XX:OldSize flag is being ignored",
           max_heap_byte_size());
-  }
+    }
     // If there is an inconsistency between the OldSize and the minimum and/or
     // initial size of gen0, since OldSize was explicitly set, OldSize wins.
     if (adjust_gen0_sizes(&_min_gen0_size, &_min_gen1_size,
                           min_heap_byte_size(), OldSize)) {
       if (PrintGCDetails && Verbose) {
-        gclog_or_tty->print_cr("Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
+        gclog_or_tty->print_cr("2: Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
               SIZE_FORMAT "  Maximum gen0 " SIZE_FORMAT,
               min_gen0_size(), initial_gen0_size(), max_gen0_size());
       }
@@ -509,7 +510,7 @@
     if (adjust_gen0_sizes(&_initial_gen0_size, &_initial_gen1_size,
                          initial_heap_byte_size(), OldSize)) {
       if (PrintGCDetails && Verbose) {
-        gclog_or_tty->print_cr("Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
+        gclog_or_tty->print_cr("3: Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
           SIZE_FORMAT "  Maximum gen0 " SIZE_FORMAT,
           min_gen0_size(), initial_gen0_size(), max_gen0_size());
       }
--- a/hotspot/src/share/vm/memory/generation.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/generation.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,14 +83,11 @@
 }
 
 // By default we get a single threaded default reference processor;
-// generations needing multi-threaded refs discovery override this method.
+// generations needing multi-threaded refs processing or discovery override this method.
 void Generation::ref_processor_init() {
   assert(_ref_processor == NULL, "a reference processor already exists");
   assert(!_reserved.is_empty(), "empty generation?");
-  _ref_processor =
-    new ReferenceProcessor(_reserved,                  // span
-                           refs_discovery_is_atomic(), // atomic_discovery
-                           refs_discovery_is_mt());    // mt_discovery
+  _ref_processor = new ReferenceProcessor(_reserved);    // a vanilla reference processor
   if (_ref_processor == NULL) {
     vm_exit_during_initialization("Could not allocate ReferenceProcessor object");
   }
--- a/hotspot/src/share/vm/memory/heap.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/heap.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -316,12 +316,19 @@
 }
 
 size_t CodeHeap::largest_free_block() const {
+  // First check unused space excluding free blocks.
+  size_t free_sz = size(_free_segments);
+  size_t unused  = max_capacity() - allocated_capacity() - free_sz;
+  if (unused >= free_sz)
+    return unused;
+
+  // Now check largest free block.
   size_t len = 0;
   for (FreeBlock* b = _freelist; b != NULL; b = b->link()) {
     if (b->length() > len)
       len = b->length();
   }
-  return size(len);
+  return MAX2(unused, size(len));
 }
 
 // Free list management
--- a/hotspot/src/share/vm/memory/referenceProcessor.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -102,40 +102,17 @@
             "Unrecongnized RefDiscoveryPolicy");
 }
 
-ReferenceProcessor*
-ReferenceProcessor::create_ref_processor(MemRegion          span,
-                                         bool               atomic_discovery,
-                                         bool               mt_discovery,
-                                         BoolObjectClosure* is_alive_non_header,
-                                         int                parallel_gc_threads,
-                                         bool               mt_processing,
-                                         bool               dl_needs_barrier) {
-  int mt_degree = 1;
-  if (parallel_gc_threads > 1) {
-    mt_degree = parallel_gc_threads;
-  }
-  ReferenceProcessor* rp =
-    new ReferenceProcessor(span, atomic_discovery,
-                           mt_discovery, mt_degree,
-                           mt_processing && (parallel_gc_threads > 0),
-                           dl_needs_barrier);
-  if (rp == NULL) {
-    vm_exit_during_initialization("Could not allocate ReferenceProcessor object");
-  }
-  rp->set_is_alive_non_header(is_alive_non_header);
-  rp->setup_policy(false /* default soft ref policy */);
-  return rp;
-}
-
 ReferenceProcessor::ReferenceProcessor(MemRegion span,
-                                       bool      atomic_discovery,
+                                       bool      mt_processing,
+                                       int       mt_processing_degree,
                                        bool      mt_discovery,
-                                       int       mt_degree,
-                                       bool      mt_processing,
+                                       int       mt_discovery_degree,
+                                       bool      atomic_discovery,
+                                       BoolObjectClosure* is_alive_non_header,
                                        bool      discovered_list_needs_barrier)  :
   _discovering_refs(false),
   _enqueuing_is_done(false),
-  _is_alive_non_header(NULL),
+  _is_alive_non_header(is_alive_non_header),
   _discovered_list_needs_barrier(discovered_list_needs_barrier),
   _bs(NULL),
   _processing_is_mt(mt_processing),
@@ -144,8 +121,8 @@
   _span = span;
   _discovery_is_atomic = atomic_discovery;
   _discovery_is_mt     = mt_discovery;
-  _num_q               = mt_degree;
-  _max_num_q           = mt_degree;
+  _num_q               = MAX2(1, mt_processing_degree);
+  _max_num_q           = MAX2(_num_q, mt_discovery_degree);
   _discoveredSoftRefs  = NEW_C_HEAP_ARRAY(DiscoveredList, _max_num_q * subclasses_of_ref);
   if (_discoveredSoftRefs == NULL) {
     vm_exit_during_initialization("Could not allocated RefProc Array");
@@ -163,6 +140,7 @@
   if (discovered_list_needs_barrier) {
     _bs = Universe::heap()->barrier_set();
   }
+  setup_policy(false /* default soft ref policy */);
 }
 
 #ifndef PRODUCT
@@ -405,15 +383,14 @@
   { }
 
   virtual void work(unsigned int work_id) {
-    assert(work_id < (unsigned int)_ref_processor.num_q(), "Index out-of-bounds");
+    assert(work_id < (unsigned int)_ref_processor.max_num_q(), "Index out-of-bounds");
     // Simplest first cut: static partitioning.
     int index = work_id;
     // The increment on "index" must correspond to the maximum number of queues
     // (n_queues) with which that ReferenceProcessor was created.  That
     // is because of the "clever" way the discovered references lists were
-    // allocated and are indexed into.  That number is ParallelGCThreads
-    // currently.  Assert that.
-    assert(_n_queues == (int) ParallelGCThreads, "Different number not expected");
+    // allocated and are indexed into.
+    assert(_n_queues == (int) _ref_processor.max_num_q(), "Different number not expected");
     for (int j = 0;
          j < subclasses_of_ref;
          j++, index += _n_queues) {
@@ -672,7 +649,7 @@
     }
   }
   NOT_PRODUCT(
-    if (PrintGCDetails && TraceReferenceGC) {
+    if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) {
       gclog_or_tty->print_cr(" Dropped %d active Refs out of %d "
         "Refs in discovered list " INTPTR_FORMAT,
         iter.removed(), iter.processed(), (address)refs_list.head());
@@ -711,7 +688,7 @@
   // Now close the newly reachable set
   complete_gc->do_void();
   NOT_PRODUCT(
-    if (PrintGCDetails && TraceReferenceGC) {
+    if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) {
       gclog_or_tty->print_cr(" Dropped %d active Refs out of %d "
         "Refs in discovered list " INTPTR_FORMAT,
         iter.removed(), iter.processed(), (address)refs_list.head());
@@ -951,7 +928,7 @@
   }
   if (PrintReferenceGC && PrintGCDetails) {
     size_t total = 0;
-    for (int i = 0; i < _num_q; ++i) {
+    for (int i = 0; i < _max_num_q; ++i) {
       total += refs_lists[i].length();
     }
     gclog_or_tty->print(", %u refs", total);
@@ -967,7 +944,7 @@
       RefProcPhase1Task phase1(*this, refs_lists, policy, true /*marks_oops_alive*/);
       task_executor->execute(phase1);
     } else {
-      for (int i = 0; i < _num_q; i++) {
+      for (int i = 0; i < _max_num_q; i++) {
         process_phase1(refs_lists[i], policy,
                        is_alive, keep_alive, complete_gc);
       }
@@ -983,7 +960,7 @@
     RefProcPhase2Task phase2(*this, refs_lists, !discovery_is_atomic() /*marks_oops_alive*/);
     task_executor->execute(phase2);
   } else {
-    for (int i = 0; i < _num_q; i++) {
+    for (int i = 0; i < _max_num_q; i++) {
       process_phase2(refs_lists[i], is_alive, keep_alive, complete_gc);
     }
   }
@@ -994,7 +971,7 @@
     RefProcPhase3Task phase3(*this, refs_lists, clear_referent, true /*marks_oops_alive*/);
     task_executor->execute(phase3);
   } else {
-    for (int i = 0; i < _num_q; i++) {
+    for (int i = 0; i < _max_num_q; i++) {
       process_phase3(refs_lists[i], clear_referent,
                      is_alive, keep_alive, complete_gc);
     }
@@ -1008,7 +985,7 @@
   //   for (int j = 0; j < _num_q; j++) {
   //     int index = i * _max_num_q + j;
   for (int i = 0; i < _max_num_q * subclasses_of_ref; i++) {
-    if (TraceReferenceGC && PrintGCDetails && ((i % _num_q) == 0)) {
+    if (TraceReferenceGC && PrintGCDetails && ((i % _max_num_q) == 0)) {
       gclog_or_tty->print_cr(
         "\nScrubbing %s discovered list of Null referents",
         list_name(i));
@@ -1350,7 +1327,7 @@
   {
     TraceTime tt("Preclean WeakReferences", PrintGCDetails && PrintReferenceGC,
               false, gclog_or_tty);
-    for (int i = 0; i < _num_q; i++) {
+    for (int i = 0; i < _max_num_q; i++) {
       if (yield->should_return()) {
         return;
       }
@@ -1363,7 +1340,7 @@
   {
     TraceTime tt("Preclean FinalReferences", PrintGCDetails && PrintReferenceGC,
               false, gclog_or_tty);
-    for (int i = 0; i < _num_q; i++) {
+    for (int i = 0; i < _max_num_q; i++) {
       if (yield->should_return()) {
         return;
       }
@@ -1376,7 +1353,7 @@
   {
     TraceTime tt("Preclean PhantomReferences", PrintGCDetails && PrintReferenceGC,
               false, gclog_or_tty);
-    for (int i = 0; i < _num_q; i++) {
+    for (int i = 0; i < _max_num_q; i++) {
       if (yield->should_return()) {
         return;
       }
@@ -1433,7 +1410,7 @@
   complete_gc->do_void();
 
   NOT_PRODUCT(
-    if (PrintGCDetails && PrintReferenceGC) {
+    if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) {
       gclog_or_tty->print_cr(" Dropped %d Refs out of %d "
         "Refs in discovered list " INTPTR_FORMAT,
         iter.removed(), iter.processed(), (address)refs_list.head());
--- a/hotspot/src/share/vm/memory/referenceProcessor.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/memory/referenceProcessor.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
   bool        _enqueuing_is_done;     // true if all weak references enqueued
   bool        _processing_is_mt;      // true during phases when
                                       // reference processing is MT.
-  int         _next_id;               // round-robin counter in
+  int         _next_id;               // round-robin mod _num_q counter in
                                       // support of work distribution
 
   // For collectors that do not keep GC marking information
@@ -103,7 +103,8 @@
 
  public:
   int num_q()                            { return _num_q; }
-  void set_mt_degree(int v)              { _num_q = v; }
+  int max_num_q()                        { return _max_num_q; }
+  void set_active_mt_degree(int v)       { _num_q = v; }
   DiscoveredList* discovered_soft_refs() { return _discoveredSoftRefs; }
   static oop  sentinel_ref()             { return _sentinelRef; }
   static oop* adr_sentinel_ref()         { return &_sentinelRef; }
@@ -216,6 +217,7 @@
                                    VoidClosure*       complete_gc,
                                    YieldClosure*      yield);
 
+  // round-robin mod _num_q (not: _not_ mode _max_num_q)
   int next_id() {
     int id = _next_id;
     if (++_next_id == _num_q) {
@@ -256,23 +258,15 @@
     _max_num_q(0),
     _processing_is_mt(false),
     _next_id(0)
-  {}
-
-  ReferenceProcessor(MemRegion span, bool atomic_discovery,
-                     bool mt_discovery,
-                     int mt_degree = 1,
-                     bool mt_processing = false,
-                     bool discovered_list_needs_barrier = false);
+  { }
 
-  // Allocates and initializes a reference processor.
-  static ReferenceProcessor* create_ref_processor(
-    MemRegion          span,
-    bool               atomic_discovery,
-    bool               mt_discovery,
-    BoolObjectClosure* is_alive_non_header = NULL,
-    int                parallel_gc_threads = 1,
-    bool               mt_processing = false,
-    bool               discovered_list_needs_barrier = false);
+  // Default parameters give you a vanilla reference processor.
+  ReferenceProcessor(MemRegion span,
+                     bool mt_processing = false, int mt_processing_degree = 1,
+                     bool mt_discovery  = false, int mt_discovery_degree  = 1,
+                     bool atomic_discovery = true,
+                     BoolObjectClosure* is_alive_non_header = NULL,
+                     bool discovered_list_needs_barrier = false);
 
   // RefDiscoveryPolicy values
   enum DiscoveryPolicy {
@@ -397,20 +391,20 @@
 // A utility class to temporarily change the MT'ness of
 // reference discovery for the given ReferenceProcessor
 // in the scope that contains it.
-class ReferenceProcessorMTMutator: StackObj {
+class ReferenceProcessorMTDiscoveryMutator: StackObj {
  private:
   ReferenceProcessor* _rp;
   bool                _saved_mt;
 
  public:
-  ReferenceProcessorMTMutator(ReferenceProcessor* rp,
-                              bool mt):
+  ReferenceProcessorMTDiscoveryMutator(ReferenceProcessor* rp,
+                                       bool mt):
     _rp(rp) {
     _saved_mt = _rp->discovery_is_mt();
     _rp->set_mt_discovery(mt);
   }
 
-  ~ReferenceProcessorMTMutator() {
+  ~ReferenceProcessorMTDiscoveryMutator() {
     _rp->set_mt_discovery(_saved_mt);
   }
 };
--- a/hotspot/src/share/vm/oops/constantPoolOop.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/constantPoolOop.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1175,8 +1175,15 @@
 
   case JVM_CONSTANT_UnresolvedClass:
   {
-    Symbol* k = from_cp->unresolved_klass_at(from_i);
-    to_cp->unresolved_klass_at_put(to_i, k);
+    // Can be resolved after checking tag, so check the slot first.
+    CPSlot entry = from_cp->slot_at(from_i);
+    if (entry.is_oop()) {
+      assert(entry.get_oop()->is_klass(), "must be");
+      // Already resolved
+      to_cp->klass_at_put(to_i, (klassOop)entry.get_oop());
+    } else {
+      to_cp->unresolved_klass_at_put(to_i, entry.get_symbol());
+    }
   } break;
 
   case JVM_CONSTANT_UnresolvedClassInError:
@@ -1189,8 +1196,14 @@
 
   case JVM_CONSTANT_UnresolvedString:
   {
-    Symbol* s = from_cp->unresolved_string_at(from_i);
-    to_cp->unresolved_string_at_put(to_i, s);
+    // Can be resolved after checking tag, so check the slot first.
+    CPSlot entry = from_cp->slot_at(from_i);
+    if (entry.is_oop()) {
+      // Already resolved (either string or pseudo-string)
+      to_cp->string_at_put(to_i, entry.get_oop());
+    } else {
+      to_cp->unresolved_string_at_put(to_i, entry.get_symbol());
+    }
   } break;
 
   case JVM_CONSTANT_Utf8:
--- a/hotspot/src/share/vm/oops/cpCacheOop.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/cpCacheOop.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -190,7 +190,7 @@
   );
 
   void set_dynamic_call(
-    Handle call_site,                            // Resolved java.dyn.CallSite (f1)
+    Handle call_site,                            // Resolved java.lang.invoke.CallSite (f1)
     methodHandle signature_invoker               // determines signature information
   );
 
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -735,7 +735,12 @@
 static int call_class_initializer_impl_counter = 0;   // for debugging
 
 methodOop instanceKlass::class_initializer() {
-  return find_method(vmSymbols::class_initializer_name(), vmSymbols::void_method_signature());
+  methodOop clinit = find_method(
+      vmSymbols::class_initializer_name(), vmSymbols::void_method_signature());
+  if (clinit != NULL && clinit->has_valid_initializer_flags()) {
+    return clinit;
+  }
+  return NULL;
 }
 
 void instanceKlass::call_class_initializer_impl(instanceKlassHandle this_oop, TRAPS) {
@@ -2415,7 +2420,7 @@
     st->cr();
   } else if (as_klassOop() == SystemDictionary::MethodType_klass()) {
     st->print(BULLET"signature: ");
-    java_dyn_MethodType::print_signature(obj, st);
+    java_lang_invoke_MethodType::print_signature(obj, st);
     st->cr();
   }
 }
@@ -2446,7 +2451,7 @@
     }
   } else if (as_klassOop() == SystemDictionary::MethodType_klass()) {
     st->print(" = ");
-    java_dyn_MethodType::print_signature(obj, st);
+    java_lang_invoke_MethodType::print_signature(obj, st);
   } else if (java_lang_boxing_object::is_instance(obj)) {
     st->print(" = ");
     java_lang_boxing_object::print(obj, st);
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -193,8 +193,8 @@
   typeArrayOop    _inner_classes;
   // Implementors of this interface (not valid if it overflows)
   klassOop        _implementors[implementors_limit];
-  // invokedynamic bootstrap method (a java.dyn.MethodHandle)
-  oop             _bootstrap_method;
+  // invokedynamic bootstrap method (a java.lang.invoke.MethodHandle)
+  oop             _bootstrap_method;  // AllowTransitionalJSR292 ONLY
   // Annotations for this class, or null if none.
   typeArrayOop    _class_annotations;
   // Annotation objects (byte arrays) for fields, or null if no annotations.
@@ -529,7 +529,7 @@
                                                         _enclosing_method_method_index = method_index; }
 
   // JSR 292 support
-  oop bootstrap_method() const                        { return _bootstrap_method; }
+  oop bootstrap_method() const                        { return _bootstrap_method; }  // AllowTransitionalJSR292 ONLY
   void set_bootstrap_method(oop mh)                   { oop_store(&_bootstrap_method, mh); }
 
   // jmethodID support
@@ -817,7 +817,7 @@
   oop* adr_signers() const           { return (oop*)&this->_signers;}
   oop* adr_inner_classes() const     { return (oop*)&this->_inner_classes;}
   oop* adr_implementors() const      { return (oop*)&this->_implementors[0];}
-  oop* adr_bootstrap_method() const  { return (oop*)&this->_bootstrap_method;}
+  oop* adr_bootstrap_method() const  { return (oop*)&this->_bootstrap_method;}  // AllowTransitionalJSR292 ONLY
   oop* adr_methods_jmethod_ids() const             { return (oop*)&this->_methods_jmethod_ids;}
   oop* adr_methods_cached_itable_indices() const   { return (oop*)&this->_methods_cached_itable_indices;}
   oop* adr_class_annotations() const   { return (oop*)&this->_class_annotations;}
--- a/hotspot/src/share/vm/oops/klassVtable.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -883,7 +883,7 @@
   int ime_num = 0;
 
   // Skip first methodOop if it is a class initializer
-  int i = ((methodOop)methods()->obj_at(0))->name() != vmSymbols::class_initializer_name() ? 0 : 1;
+  int i = ((methodOop)methods()->obj_at(0))->is_static_initializer() ? 1 : 0;
 
   // m, method_name, method_signature, klass reset each loop so they
   // don't need preserving across check_signature_loaders call
@@ -1121,7 +1121,7 @@
     assert(index < methods->length(), "should find index for resolve_invoke");
   }
   // Adjust for <clinit>, which is left out of table if first method
-  if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->name() == vmSymbols::class_initializer_name()) {
+  if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->is_static_initializer()) {
     index--;
   }
   return index;
@@ -1135,7 +1135,7 @@
 
   int index = itable_index;
   // Adjust for <clinit>, which is left out of table if first method
-  if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->name() == vmSymbols::class_initializer_name()) {
+  if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->is_static_initializer()) {
     index++;
   }
 
--- a/hotspot/src/share/vm/oops/methodDataOop.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/methodDataOop.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -228,7 +228,7 @@
     return byte_offset_of(DataLayout, _header._struct._bci);
   }
   static ByteSize cell_offset(int index) {
-    return byte_offset_of(DataLayout, _cells[index]);
+    return byte_offset_of(DataLayout, _cells) + in_ByteSize(index * cell_size);
   }
   // Return a value which, when or-ed as a byte into _flags, sets the flag.
   static int flag_number_to_byte_constant(int flag_number) {
--- a/hotspot/src/share/vm/oops/methodKlass.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/methodKlass.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -103,6 +103,12 @@
   m->backedge_counter()->init();
   m->clear_number_of_breakpoints();
 
+#ifdef TIERED
+  m->set_rate(0);
+  m->set_prev_event_count(0);
+  m->set_prev_time(0);
+#endif
+
   assert(m->is_parsable(), "must be parsable here.");
   assert(m->size() == size, "wrong size for object");
   // We should not publish an uprasable object's reference
--- a/hotspot/src/share/vm/oops/methodOop.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/methodOop.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -466,7 +466,20 @@
 
 
 bool methodOopDesc::is_initializer() const {
-  return name() == vmSymbols::object_initializer_name() || name() == vmSymbols::class_initializer_name();
+  return name() == vmSymbols::object_initializer_name() || is_static_initializer();
+}
+
+bool methodOopDesc::has_valid_initializer_flags() const {
+  return (is_static() ||
+          instanceKlass::cast(method_holder())->major_version() < 51);
+}
+
+bool methodOopDesc::is_static_initializer() const {
+  // For classfiles version 51 or greater, ensure that the clinit method is
+  // static.  Non-static methods with the name "<clinit>" are not static
+  // initializers. (older classfiles exempted for backward compatibility)
+  return name() == vmSymbols::class_initializer_name() &&
+         has_valid_initializer_flags();
 }
 
 
@@ -842,7 +855,7 @@
   case vmSymbols::VM_SYMBOL_ENUM_NAME(invokeGeneric_name):
     return true;
   }
-  if (AllowTransitionalJSR292
+  if ((AllowTransitionalJSR292 || AllowInvokeForInvokeGeneric)
       && name_sid == vmSymbols::VM_SYMBOL_ENUM_NAME(invoke_name))
     return true;
   return false;
@@ -852,7 +865,7 @@
 enum {
   _imcp_invoke_name = 1,        // utf8: 'invokeExact' or 'invokeGeneric'
   _imcp_invoke_signature,       // utf8: (variable Symbol*)
-  _imcp_method_type_value,      // string: (variable java/dyn/MethodType, sic)
+  _imcp_method_type_value,      // string: (variable java/lang/invoke/MethodType, sic)
   _imcp_limit
 };
 
@@ -1078,7 +1091,8 @@
   vmSymbols::SID  name_id = vmSymbols::find_sid(name());
   if (name_id == vmSymbols::NO_SID)  return;
   vmSymbols::SID   sig_id = vmSymbols::find_sid(signature());
-  if (klass_id != vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle)
+  if (klass_id != vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_MethodHandle)
+      && !(klass_id == vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle) && AllowTransitionalJSR292)
       && sig_id == vmSymbols::NO_SID)  return;
   jshort flags = access_flags().as_short();
 
@@ -1104,7 +1118,8 @@
     break;
 
   // Signature-polymorphic methods: MethodHandle.invoke*, InvokeDynamic.*.
-  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle):
+  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle):  // AllowTransitionalJSR292 ONLY
+  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_MethodHandle):
     if (is_static() || !is_native())  break;
     switch (name_id) {
     case vmSymbols::VM_SYMBOL_ENUM_NAME(invokeGeneric_name):
@@ -1114,11 +1129,12 @@
       id = vmIntrinsics::_invokeExact;
       break;
     case vmSymbols::VM_SYMBOL_ENUM_NAME(invoke_name):
-      if (AllowTransitionalJSR292)  id = vmIntrinsics::_invokeExact;
+      if (AllowInvokeForInvokeGeneric)   id = vmIntrinsics::_invokeGeneric;
+      else if (AllowTransitionalJSR292)  id = vmIntrinsics::_invokeExact;
       break;
     }
     break;
-  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_InvokeDynamic):
+  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_InvokeDynamic):
     if (!is_static() || !is_native())  break;
     id = vmIntrinsics::_invokeDynamic;
     break;
--- a/hotspot/src/share/vm/oops/methodOop.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/oops/methodOop.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -84,6 +84,11 @@
 // | invocation_counter                                   |
 // | backedge_counter                                     |
 // |------------------------------------------------------|
+// |           prev_time (tiered only, 64 bit wide)       |
+// |                                                      |
+// |------------------------------------------------------|
+// |                  rate (tiered)                       |
+// |------------------------------------------------------|
 // | code                           (pointer)             |
 // | i2i                            (pointer)             |
 // | adapter                        (pointer)             |
@@ -124,6 +129,11 @@
   InvocationCounter _invocation_counter;         // Incremented before each activation of the method - used to trigger frequency-based optimizations
   InvocationCounter _backedge_counter;           // Incremented before each backedge taken - used to trigger frequencey-based optimizations
 
+#ifdef TIERED
+  jlong             _prev_time;                   // Previous time the rate was acquired
+  float             _rate;                        // Events (invocation and backedge counter increments) per millisecond
+#endif
+
 #ifndef PRODUCT
   int               _compiled_invocation_count;  // Number of nmethod invocations so far (for perf. debugging)
 #endif
@@ -304,6 +314,17 @@
   InvocationCounter* invocation_counter() { return &_invocation_counter; }
   InvocationCounter* backedge_counter()   { return &_backedge_counter; }
 
+#ifdef TIERED
+  // We are reusing interpreter_invocation_count as a holder for the previous event count!
+  // We can do that since interpreter_invocation_count is not used in tiered.
+  int prev_event_count() const                   { return _interpreter_invocation_count;  }
+  void set_prev_event_count(int count)           { _interpreter_invocation_count = count; }
+  jlong prev_time() const                        { return _prev_time; }
+  void set_prev_time(jlong time)                 { _prev_time = time; }
+  float rate() const                             { return _rate; }
+  void set_rate(float rate)                      { _rate = rate; }
+#endif
+
   int invocation_count();
   int backedge_count();
 
@@ -497,6 +518,13 @@
   // returns true if the method is an initializer (<init> or <clinit>).
   bool is_initializer() const;
 
+  // returns true if the method is static OR if the classfile version < 51
+  bool has_valid_initializer_flags() const;
+
+  // returns true if the method name is <clinit> and the method has
+  // valid static initializer flags.
+  bool is_static_initializer() const;
+
   // compiled code support
   // NOTE: code() is inherently racy as deopt can be clearing code
   // simultaneously. Use with caution.
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -487,7 +487,7 @@
     if (caller_jvms->method()->is_method_handle_adapter())
       new_depth_adjust -= 1;  // don't count actions in MH or indy adapter frames
     else if (callee_method->is_method_handle_invoke()) {
-      new_depth_adjust -= 1;  // don't count method handle calls from java.dyn implem
+      new_depth_adjust -= 1;  // don't count method handle calls from java.lang.invoke implem
     }
     if (new_depth_adjust != 0 && PrintInlining) {
       stringStream nm1; caller_jvms->method()->print_name(&nm1);
--- a/hotspot/src/share/vm/opto/callGenerator.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
   Node* call_site = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw);
 
   // Load the target MethodHandle from the CallSite object.
-  Node* target_mh_adr = kit.basic_plus_adr(call_site, call_site, java_dyn_CallSite::target_offset_in_bytes());
+  Node* target_mh_adr = kit.basic_plus_adr(call_site, call_site, java_lang_invoke_CallSite::target_offset_in_bytes());
   Node* target_mh = kit.make_load(kit.control(), target_mh_adr, TypeInstPtr::BOTTOM, T_OBJECT);
 
   address resolve_stub = SharedRuntime::get_resolve_opt_virtual_call_stub();
@@ -725,7 +725,7 @@
   Node* call_site     = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw);
 
   // Load the target MethodHandle from the CallSite object.
-  Node* target_adr = kit.basic_plus_adr(call_site, call_site, java_dyn_CallSite::target_offset_in_bytes());
+  Node* target_adr = kit.basic_plus_adr(call_site, call_site, java_lang_invoke_CallSite::target_offset_in_bytes());
   Node* target_mh  = kit.make_load(kit.control(), target_adr, TypeInstPtr::BOTTOM, T_OBJECT);
 
   // Check if the MethodHandle is still the same.
--- a/hotspot/src/share/vm/opto/library_call.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
                              RegionNode* region);
   Node* generate_current_thread(Node* &tls_output);
   address basictype2arraycopy(BasicType t, Node *src_offset, Node *dest_offset,
-                              bool disjoint_bases, const char* &name);
+                              bool disjoint_bases, const char* &name, bool dest_uninitialized);
   Node* load_mirror_from_klass(Node* klass);
   Node* load_klass_from_mirror_common(Node* mirror, bool never_see_null,
                                       int nargs,
@@ -212,26 +212,26 @@
                                 AllocateNode* alloc,
                                 Node* src,  Node* src_offset,
                                 Node* dest, Node* dest_offset,
-                                Node* dest_size);
+                                Node* dest_size, bool dest_uninitialized);
   void generate_slow_arraycopy(const TypePtr* adr_type,
                                Node* src,  Node* src_offset,
                                Node* dest, Node* dest_offset,
-                               Node* copy_length);
+                               Node* copy_length, bool dest_uninitialized);
   Node* generate_checkcast_arraycopy(const TypePtr* adr_type,
                                      Node* dest_elem_klass,
                                      Node* src,  Node* src_offset,
                                      Node* dest, Node* dest_offset,
-                                     Node* copy_length);
+                                     Node* copy_length, bool dest_uninitialized);
   Node* generate_generic_arraycopy(const TypePtr* adr_type,
                                    Node* src,  Node* src_offset,
                                    Node* dest, Node* dest_offset,
-                                   Node* copy_length);
+                                   Node* copy_length, bool dest_uninitialized);
   void generate_unchecked_arraycopy(const TypePtr* adr_type,
                                     BasicType basic_elem_type,
                                     bool disjoint_bases,
                                     Node* src,  Node* src_offset,
                                     Node* dest, Node* dest_offset,
-                                    Node* copy_length);
+                                    Node* copy_length, bool dest_uninitialized);
   bool inline_unsafe_CAS(BasicType type);
   bool inline_unsafe_ordered_store(BasicType type);
   bool inline_fp_conversions(vmIntrinsics::ID id);
@@ -1193,7 +1193,7 @@
   Node* result;
   // Disable the use of pcmpestri until it can be guaranteed that
   // the load doesn't cross into the uncommited space.
-  if (false && Matcher::has_match_rule(Op_StrIndexOf) &&
+  if (Matcher::has_match_rule(Op_StrIndexOf) &&
       UseSSE42Intrinsics) {
     // Generate SSE4.2 version of indexOf
     // We currently only have match rules that use SSE4.2
@@ -1211,14 +1211,14 @@
       return true;
     }
 
+    ciInstanceKlass* str_klass = env()->String_klass();
+    const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(str_klass);
+
     // Make the merge point
-    RegionNode* result_rgn = new (C, 3) RegionNode(3);
-    Node*       result_phi = new (C, 3) PhiNode(result_rgn, TypeInt::INT);
+    RegionNode* result_rgn = new (C, 4) RegionNode(4);
+    Node*       result_phi = new (C, 4) PhiNode(result_rgn, TypeInt::INT);
     Node* no_ctrl  = NULL;
 
-    ciInstanceKlass* klass = env()->String_klass();
-    const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(klass);
-
     // Get counts for string and substr
     Node* source_cnta = basic_plus_adr(receiver, receiver, count_offset);
     Node* source_cnt  = make_load(no_ctrl, source_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
@@ -1236,6 +1236,17 @@
     }
 
     if (!stopped()) {
+      // Check for substr count == 0
+      cmp = _gvn.transform( new(C, 3) CmpINode(substr_cnt, intcon(0)) );
+      bol = _gvn.transform( new(C, 2) BoolNode(cmp, BoolTest::eq) );
+      Node* if_zero = generate_slow_guard(bol, NULL);
+      if (if_zero != NULL) {
+        result_phi->init_req(3, intcon(0));
+        result_rgn->init_req(3, if_zero);
+      }
+    }
+
+    if (!stopped()) {
       result = make_string_method_node(Op_StrIndexOf, receiver, source_cnt, argument, substr_cnt);
       result_phi->init_req(1, result);
       result_rgn->init_req(1, control());
@@ -1244,8 +1255,8 @@
     record_for_igvn(result_rgn);
     result = _gvn.transform(result_phi);
 
-  } else { //Use LibraryCallKit::string_indexOf
-    // don't intrinsify is argument isn't a constant string.
+  } else { // Use LibraryCallKit::string_indexOf
+    // don't intrinsify if argument isn't a constant string.
     if (!argument->is_Con()) {
      return false;
     }
@@ -1281,7 +1292,7 @@
     // No null check on the argument is needed since it's a constant String oop.
     _sp -= 2;
     if (stopped()) {
-     return true;
+      return true;
     }
 
     // The null string as a pattern always returns 0 (match at beginning of string)
@@ -4081,7 +4092,8 @@
   const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;
   bool disjoint_bases = true;
   generate_unchecked_arraycopy(raw_adr_type, T_LONG, disjoint_bases,
-                               src, NULL, dest, NULL, countx);
+                               src, NULL, dest, NULL, countx,
+                               /*dest_uninitialized*/true);
 
   // If necessary, emit some card marks afterwards.  (Non-arrays only.)
   if (card_mark) {
@@ -4295,7 +4307,7 @@
 // Note:  The condition "disjoint" applies also for overlapping copies
 // where an descending copy is permitted (i.e., dest_offset <= src_offset).
 static address
-select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name) {
+select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool dest_uninitialized) {
   int selector =
     (aligned  ? COPYFUNC_ALIGNED  : COPYFUNC_UNALIGNED) +
     (disjoint ? COPYFUNC_DISJOINT : COPYFUNC_CONJOINT);
@@ -4304,6 +4316,10 @@
   name = #xxx_arraycopy; \
   return StubRoutines::xxx_arraycopy(); }
 
+#define RETURN_STUB_PARM(xxx_arraycopy, parm) {           \
+  name = #xxx_arraycopy; \
+  return StubRoutines::xxx_arraycopy(parm); }
+
   switch (t) {
   case T_BYTE:
   case T_BOOLEAN:
@@ -4340,10 +4356,10 @@
   case T_ARRAY:
   case T_OBJECT:
     switch (selector) {
-    case COPYFUNC_CONJOINT | COPYFUNC_UNALIGNED:  RETURN_STUB(oop_arraycopy);
-    case COPYFUNC_CONJOINT | COPYFUNC_ALIGNED:    RETURN_STUB(arrayof_oop_arraycopy);
-    case COPYFUNC_DISJOINT | COPYFUNC_UNALIGNED:  RETURN_STUB(oop_disjoint_arraycopy);
-    case COPYFUNC_DISJOINT | COPYFUNC_ALIGNED:    RETURN_STUB(arrayof_oop_disjoint_arraycopy);
+    case COPYFUNC_CONJOINT | COPYFUNC_UNALIGNED:  RETURN_STUB_PARM(oop_arraycopy, dest_uninitialized);
+    case COPYFUNC_CONJOINT | COPYFUNC_ALIGNED:    RETURN_STUB_PARM(arrayof_oop_arraycopy, dest_uninitialized);
+    case COPYFUNC_DISJOINT | COPYFUNC_UNALIGNED:  RETURN_STUB_PARM(oop_disjoint_arraycopy, dest_uninitialized);
+    case COPYFUNC_DISJOINT | COPYFUNC_ALIGNED:    RETURN_STUB_PARM(arrayof_oop_disjoint_arraycopy, dest_uninitialized);
     }
   default:
     ShouldNotReachHere();
@@ -4351,6 +4367,7 @@
   }
 
 #undef RETURN_STUB
+#undef RETURN_STUB_PARM
 }
 
 //------------------------------basictype2arraycopy----------------------------
@@ -4358,7 +4375,8 @@
                                             Node* src_offset,
                                             Node* dest_offset,
                                             bool disjoint_bases,
-                                            const char* &name) {
+                                            const char* &name,
+                                            bool dest_uninitialized) {
   const TypeInt* src_offset_inttype  = gvn().find_int_type(src_offset);;
   const TypeInt* dest_offset_inttype = gvn().find_int_type(dest_offset);;
 
@@ -4384,7 +4402,7 @@
     disjoint = true;
   }
 
-  return select_arraycopy_function(t, aligned, disjoint, name);
+  return select_arraycopy_function(t, aligned, disjoint, name, dest_uninitialized);
 }
 
 
@@ -4440,7 +4458,8 @@
     // The component types are not the same or are not recognized.  Punt.
     // (But, avoid the native method wrapper to JVM_ArrayCopy.)
     generate_slow_arraycopy(TypePtr::BOTTOM,
-                            src, src_offset, dest, dest_offset, length);
+                            src, src_offset, dest, dest_offset, length,
+                            /*dest_uninitialized*/false);
     return true;
   }
 
@@ -4553,7 +4572,7 @@
 
   Node* original_dest      = dest;
   AllocateArrayNode* alloc = NULL;  // used for zeroing, if needed
-  bool  must_clear_dest    = false;
+  bool  dest_uninitialized = false;
 
   // See if this is the initialization of a newly-allocated array.
   // If so, we will take responsibility here for initializing it to zero.
@@ -4576,12 +4595,14 @@
     adr_type = TypeRawPtr::BOTTOM;  // all initializations are into raw memory
     // From this point on, every exit path is responsible for
     // initializing any non-copied parts of the object to zero.
-    must_clear_dest = true;
+    // Also, if this flag is set we make sure that arraycopy interacts properly
+    // with G1, eliding pre-barriers. See CR 6627983.
+    dest_uninitialized = true;
   } else {
     // No zeroing elimination here.
     alloc             = NULL;
     //original_dest   = dest;
-    //must_clear_dest = false;
+    //dest_uninitialized = false;
   }
 
   // Results are placed here:
@@ -4613,10 +4634,10 @@
   Node* checked_value   = NULL;
 
   if (basic_elem_type == T_CONFLICT) {
-    assert(!must_clear_dest, "");
+    assert(!dest_uninitialized, "");
     Node* cv = generate_generic_arraycopy(adr_type,
                                           src, src_offset, dest, dest_offset,
-                                          copy_length);
+                                          copy_length, dest_uninitialized);
     if (cv == NULL)  cv = intcon(-1);  // failure (no stub available)
     checked_control = control();
     checked_i_o     = i_o();
@@ -4636,7 +4657,7 @@
     }
 
     // copy_length is 0.
-    if (!stopped() && must_clear_dest) {
+    if (!stopped() && dest_uninitialized) {
       Node* dest_length = alloc->in(AllocateNode::ALength);
       if (_gvn.eqv_uncast(copy_length, dest_length)
           || _gvn.find_int_con(dest_length, 1) <= 0) {
@@ -4662,7 +4683,7 @@
     result_memory->init_req(zero_path, memory(adr_type));
   }
 
-  if (!stopped() && must_clear_dest) {
+  if (!stopped() && dest_uninitialized) {
     // We have to initialize the *uncopied* part of the array to zero.
     // The copy destination is the slice dest[off..off+len].  The other slices
     // are dest_head = dest[0..off] and dest_tail = dest[off+len..dest.length].
@@ -4698,7 +4719,7 @@
       { PreserveJVMState pjvms(this);
         didit = generate_block_arraycopy(adr_type, basic_elem_type, alloc,
                                          src, src_offset, dest, dest_offset,
-                                         dest_size);
+                                         dest_size, dest_uninitialized);
         if (didit) {
           // Present the results of the block-copying fast call.
           result_region->init_req(bcopy_path, control());
@@ -4774,7 +4795,7 @@
       Node* cv = generate_checkcast_arraycopy(adr_type,
                                               dest_elem_klass,
                                               src, src_offset, dest, dest_offset,
-                                              ConvI2X(copy_length));
+                                              ConvI2X(copy_length), dest_uninitialized);
       if (cv == NULL)  cv = intcon(-1);  // failure (no stub available)
       checked_control = control();
       checked_i_o     = i_o();
@@ -4797,7 +4818,7 @@
     PreserveJVMState pjvms(this);
     generate_unchecked_arraycopy(adr_type, copy_type, disjoint_bases,
                                  src, src_offset, dest, dest_offset,
-                                 ConvI2X(copy_length));
+                                 ConvI2X(copy_length), dest_uninitialized);
 
     // Present the results of the fast call.
     result_region->init_req(fast_path, control());
@@ -4876,7 +4897,7 @@
     set_memory(slow_mem, adr_type);
     set_i_o(slow_i_o);
 
-    if (must_clear_dest) {
+    if (dest_uninitialized) {
       generate_clear_array(adr_type, dest, basic_elem_type,
                            intcon(0), NULL,
                            alloc->in(AllocateNode::AllocSize));
@@ -4884,7 +4905,7 @@
 
     generate_slow_arraycopy(adr_type,
                             src, src_offset, dest, dest_offset,
-                            copy_length);
+                            copy_length, /*dest_uninitialized*/false);
 
     result_region->init_req(slow_call_path, control());
     result_i_o   ->init_req(slow_call_path, i_o());
@@ -5128,7 +5149,7 @@
                                          AllocateNode* alloc,
                                          Node* src,  Node* src_offset,
                                          Node* dest, Node* dest_offset,
-                                         Node* dest_size) {
+                                         Node* dest_size, bool dest_uninitialized) {
   // See if there is an advantage from block transfer.
   int scale = exact_log2(type2aelembytes(basic_elem_type));
   if (scale >= LogBytesPerLong)
@@ -5173,7 +5194,7 @@
 
   bool disjoint_bases = true;   // since alloc != NULL
   generate_unchecked_arraycopy(adr_type, T_LONG, disjoint_bases,
-                               sptr, NULL, dptr, NULL, countx);
+                               sptr, NULL, dptr, NULL, countx, dest_uninitialized);
 
   return true;
 }
@@ -5186,7 +5207,8 @@
 LibraryCallKit::generate_slow_arraycopy(const TypePtr* adr_type,
                                         Node* src,  Node* src_offset,
                                         Node* dest, Node* dest_offset,
-                                        Node* copy_length) {
+                                        Node* copy_length, bool dest_uninitialized) {
+  assert(!dest_uninitialized, "Invariant");
   Node* call = make_runtime_call(RC_NO_LEAF | RC_UNCOMMON,
                                  OptoRuntime::slow_arraycopy_Type(),
                                  OptoRuntime::slow_arraycopy_Java(),
@@ -5204,10 +5226,10 @@
                                              Node* dest_elem_klass,
                                              Node* src,  Node* src_offset,
                                              Node* dest, Node* dest_offset,
-                                             Node* copy_length) {
+                                             Node* copy_length, bool dest_uninitialized) {
   if (stopped())  return NULL;
 
-  address copyfunc_addr = StubRoutines::checkcast_arraycopy();
+  address copyfunc_addr = StubRoutines::checkcast_arraycopy(dest_uninitialized);
   if (copyfunc_addr == NULL) { // Stub was not generated, go slow path.
     return NULL;
   }
@@ -5245,9 +5267,9 @@
 LibraryCallKit::generate_generic_arraycopy(const TypePtr* adr_type,
                                            Node* src,  Node* src_offset,
                                            Node* dest, Node* dest_offset,
-                                           Node* copy_length) {
+                                           Node* copy_length, bool dest_uninitialized) {
+  assert(!dest_uninitialized, "Invariant");
   if (stopped())  return NULL;
-
   address copyfunc_addr = StubRoutines::generic_arraycopy();
   if (copyfunc_addr == NULL) { // Stub was not generated, go slow path.
     return NULL;
@@ -5268,7 +5290,7 @@
                                              bool disjoint_bases,
                                              Node* src,  Node* src_offset,
                                              Node* dest, Node* dest_offset,
-                                             Node* copy_length) {
+                                             Node* copy_length, bool dest_uninitialized) {
   if (stopped())  return;               // nothing to do
 
   Node* src_start  = src;
@@ -5283,7 +5305,7 @@
   const char* copyfunc_name = "arraycopy";
   address     copyfunc_addr =
       basictype2arraycopy(basic_elem_type, src_offset, dest_offset,
-                          disjoint_bases, copyfunc_name);
+                          disjoint_bases, copyfunc_name, dest_uninitialized);
 
   // Call it.  Note that the count_ix value is not scaled to a byte-size.
   make_runtime_call(RC_LEAF|RC_NO_FP,
--- a/hotspot/src/share/vm/opto/memnode.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1559,21 +1559,24 @@
             phase->C->has_unsafe_access(),
             "Field accesses must be precise" );
     // For oop loads, we expect the _type to be precise
-    if (OptimizeStringConcat && klass == phase->C->env()->String_klass() &&
+    if (klass == phase->C->env()->String_klass() &&
         adr->is_AddP() && off != Type::OffsetBot) {
-      // For constant Strings treat the fields as compile time constants.
+      // For constant Strings treat the final fields as compile time constants.
       Node* base = adr->in(AddPNode::Base);
       const TypeOopPtr* t = phase->type(base)->isa_oopptr();
       if (t != NULL && t->singleton()) {
-        ciObject* string = t->const_oop();
-        ciConstant constant = string->as_instance()->field_value_by_offset(off);
-        if (constant.basic_type() == T_INT) {
-          return TypeInt::make(constant.as_int());
-        } else if (constant.basic_type() == T_ARRAY) {
-          if (adr->bottom_type()->is_ptr_to_narrowoop()) {
-            return TypeNarrowOop::make_from_constant(constant.as_object());
-          } else {
-            return TypeOopPtr::make_from_constant(constant.as_object());
+        ciField* field = phase->C->env()->String_klass()->get_field_by_offset(off, false);
+        if (field != NULL && field->is_final()) {
+          ciObject* string = t->const_oop();
+          ciConstant constant = string->as_instance()->field_value(field);
+          if (constant.basic_type() == T_INT) {
+            return TypeInt::make(constant.as_int());
+          } else if (constant.basic_type() == T_ARRAY) {
+            if (adr->bottom_type()->is_ptr_to_narrowoop()) {
+              return TypeNarrowOop::make_from_constant(constant.as_object());
+            } else {
+              return TypeOopPtr::make_from_constant(constant.as_object());
+            }
           }
         }
       }
@@ -4077,6 +4080,7 @@
     n = base_memory();
     assert(Node::in_dump()
            || n == NULL || n->bottom_type() == Type::TOP
+           || n->adr_type() == NULL // address is TOP
            || n->adr_type() == TypePtr::BOTTOM
            || n->adr_type() == TypeRawPtr::BOTTOM
            || Compile::current()->AliasLevel() == 0,
--- a/hotspot/src/share/vm/opto/output.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/opto/output.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1028,7 +1028,7 @@
 
 // helper for Fill_buffer bailout logic
 static void turn_off_compiler(Compile* C) {
-  if (CodeCache::unallocated_capacity() >= CodeCacheMinimumFreeSpace*10) {
+  if (CodeCache::largest_free_block() >= CodeCacheMinimumFreeSpace*10) {
     // Do not turn off compilation if a single giant method has
     // blown the code cache size.
     C->record_failure("excessive request to CodeCache");
--- a/hotspot/src/share/vm/opto/parse3.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/opto/parse3.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
         return;
     }
     else {
-      // final non-static field of a trusted class ({java,sun}.dyn
-      // classes).
+      // final non-static field of a trusted class (classes in
+      // java.lang.invoke and sun.invoke packages and subpackages).
       if (obj->is_Con()) {
         const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();
         ciObject* constant_oop = oop_ptr->const_oop();
--- a/hotspot/src/share/vm/opto/type.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/opto/type.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -3386,7 +3386,22 @@
         instance_id = InstanceBot;
         tary = TypeAry::make(Type::BOTTOM, tary->_size);
       }
+    } else // Non integral arrays.
+    // Must fall to bottom if exact klasses in upper lattice
+    // are not equal or super klass is exact.
+    if ( above_centerline(ptr) && klass() != tap->klass() &&
+         // meet with top[] and bottom[] are processed further down:
+         tap ->_klass != NULL  && this->_klass != NULL   &&
+         // both are exact and not equal:
+        ((tap ->_klass_is_exact && this->_klass_is_exact) ||
+         // 'tap'  is exact and super or unrelated:
+         (tap ->_klass_is_exact && !tap->klass()->is_subtype_of(klass())) ||
+         // 'this' is exact and super or unrelated:
+         (this->_klass_is_exact && !klass()->is_subtype_of(tap->klass())))) {
+      tary = TypeAry::make(Type::BOTTOM, tary->_size);
+      return make( NotNull, NULL, tary, lazy_klass, false, off, InstanceBot );
     }
+
     bool xk = false;
     switch (tap->ptr()) {
     case AnyNull:
@@ -3766,7 +3781,7 @@
   // Oops, need to compute _klass and cache it
   ciKlass* k_ary = compute_klass();
 
-  if( this != TypeAryPtr::OOPS ) {
+  if( this != TypeAryPtr::OOPS && this->dual() != TypeAryPtr::OOPS ) {
     // The _klass field acts as a cache of the underlying
     // ciKlass for this array type.  In order to set the field,
     // we need to cast away const-ness.
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1805,6 +1805,10 @@
 
 void JvmtiExport::post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) {
   JavaThread* thread = JavaThread::current();
+  // In theory everyone coming thru here is in_vm but we need to be certain
+  // because a callee will do a vm->native transition
+  ThreadInVMfromUnknown __tiv;
+
   EVT_TRIG_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED,
                  ("JVMTI [%s] method dynamic code generated event triggered",
                  JvmtiTrace::safe_get_thread_name(thread)));
@@ -1826,19 +1830,18 @@
 }
 
 void JvmtiExport::post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end) {
-  // In theory everyone coming thru here is in_vm but we need to be certain
-  // because a callee will do a vm->native transition
-  ThreadInVMfromUnknown __tiv;
   jvmtiPhase phase = JvmtiEnv::get_phase();
   if (phase == JVMTI_PHASE_PRIMORDIAL || phase == JVMTI_PHASE_START) {
     post_dynamic_code_generated_internal(name, code_begin, code_end);
-    return;
+  } else {
+    // It may not be safe to post the event from this thread.  Defer all
+    // postings to the service thread so that it can perform them in a safe
+    // context and in-order.
+    MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
+    JvmtiDeferredEvent event = JvmtiDeferredEvent::dynamic_code_generated_event(
+        name, code_begin, code_end);
+    JvmtiDeferredEventQueue::enqueue(event);
   }
-
-  // Blocks until everything now in the queue has been posted
-  JvmtiDeferredEventQueue::flush_queue(Thread::current());
-
-  post_dynamic_code_generated_internal(name, code_begin, code_end);
 }
 
 
--- a/hotspot/src/share/vm/prims/jvmtiExport.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -140,12 +140,12 @@
                                       char sig_type, jvalue *value);
 
 
- private:
   // posts a DynamicCodeGenerated event (internal/private implementation).
   // The public post_dynamic_code_generated* functions make use of the
-  // internal implementation.
+  // internal implementation.  Also called from JvmtiDeferredEvent::post()
   static void post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) KERNEL_RETURN;
 
+ private:
 
   // GenerateEvents support to allow posting of CompiledMethodLoad and
   // DynamicCodeGenerated events for a given environment.
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -918,31 +918,61 @@
 JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event(
     nmethod* nm) {
   JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_LOAD);
-  event.set_compiled_method_load(nm);
-  nmethodLocker::lock_nmethod(nm); // will be unlocked when posted
+  event._event_data.compiled_method_load = nm;
+  // Keep the nmethod alive until the ServiceThread can process
+  // this deferred event.
+  nmethodLocker::lock_nmethod(nm);
   return event;
 }
 
 JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_unload_event(
-    jmethodID id, const void* code) {
+    nmethod* nm, jmethodID id, const void* code) {
   JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_UNLOAD);
-  event.set_compiled_method_unload(id, code);
+  event._event_data.compiled_method_unload.nm = nm;
+  event._event_data.compiled_method_unload.method_id = id;
+  event._event_data.compiled_method_unload.code_begin = code;
+  // Keep the nmethod alive until the ServiceThread can process
+  // this deferred event. This will keep the memory for the
+  // generated code from being reused too early. We pass
+  // zombie_ok == true here so that our nmethod that was just
+  // made into a zombie can be locked.
+  nmethodLocker::lock_nmethod(nm, true /* zombie_ok */);
+  return event;
+}
+JvmtiDeferredEvent JvmtiDeferredEvent::dynamic_code_generated_event(
+      const char* name, const void* code_begin, const void* code_end) {
+  JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_DYNAMIC_CODE_GENERATED);
+  event._event_data.dynamic_code_generated.name = name;
+  event._event_data.dynamic_code_generated.code_begin = code_begin;
+  event._event_data.dynamic_code_generated.code_end = code_end;
   return event;
 }
 
 void JvmtiDeferredEvent::post() {
+  assert(ServiceThread::is_service_thread(Thread::current()),
+         "Service thread must post enqueued events");
   switch(_type) {
-    case TYPE_COMPILED_METHOD_LOAD:
-      JvmtiExport::post_compiled_method_load(compiled_method_load());
-      nmethodLocker::unlock_nmethod(compiled_method_load());
+    case TYPE_COMPILED_METHOD_LOAD: {
+      nmethod* nm = _event_data.compiled_method_load;
+      JvmtiExport::post_compiled_method_load(nm);
+      // done with the deferred event so unlock the nmethod
+      nmethodLocker::unlock_nmethod(nm);
       break;
-    case TYPE_COMPILED_METHOD_UNLOAD:
+    }
+    case TYPE_COMPILED_METHOD_UNLOAD: {
+      nmethod* nm = _event_data.compiled_method_unload.nm;
       JvmtiExport::post_compiled_method_unload(
-        compiled_method_unload_method_id(),
-        compiled_method_unload_code_begin());
+        _event_data.compiled_method_unload.method_id,
+        _event_data.compiled_method_unload.code_begin);
+      // done with the deferred event so unlock the nmethod
+      nmethodLocker::unlock_nmethod(nm);
       break;
-    case TYPE_FLUSH:
-      JvmtiDeferredEventQueue::flush_complete(flush_state_addr());
+    }
+    case TYPE_DYNAMIC_CODE_GENERATED:
+      JvmtiExport::post_dynamic_code_generated_internal(
+        _event_data.dynamic_code_generated.name,
+        _event_data.dynamic_code_generated.code_begin,
+        _event_data.dynamic_code_generated.code_end);
       break;
     default:
       ShouldNotReachHere();
@@ -1065,54 +1095,4 @@
   }
 }
 
-enum {
-  // Random - used for debugging
-  FLUSHING  = 0x50403020,
-  FLUSHED   = 0x09080706
-};
-
-void JvmtiDeferredEventQueue::flush_queue(Thread* thread) {
-
-  volatile int flush_state = FLUSHING;
-
-  JvmtiDeferredEvent flush(JvmtiDeferredEvent::TYPE_FLUSH);
-  flush.set_flush_state_addr((int*)&flush_state);
-
-  if (ServiceThread::is_service_thread(thread)) {
-    // If we are the service thread we have to post all preceding events
-    // Use the flush event as a token to indicate when we can stop
-    JvmtiDeferredEvent event;
-    {
-      MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
-      enqueue(flush);
-      event = dequeue();
-    }
-    while (!event.is_flush_event() ||
-           event.flush_state_addr() != &flush_state) {
-      event.post();
-      {
-        MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
-        event = dequeue();
-      }
-    }
-  } else {
-    // Wake up the service thread so it will process events.  When it gets
-    // to the flush event it will set 'flush_complete' and notify us.
-    MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
-    enqueue(flush);
-    while (flush_state != FLUSHED) {
-      assert(flush_state == FLUSHING || flush_state == FLUSHED,
-             "only valid values for this");
-      Service_lock->wait(Mutex::_no_safepoint_check_flag);
-    }
-  }
-}
-
-void JvmtiDeferredEventQueue::flush_complete(int* state_addr) {
-  assert(state_addr != NULL && *state_addr == FLUSHING, "must be");
-  MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
-  *state_addr = FLUSHED;
-  Service_lock->notify_all();
-}
-
 #endif // ndef KERNEL
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -451,59 +451,26 @@
     TYPE_NONE,
     TYPE_COMPILED_METHOD_LOAD,
     TYPE_COMPILED_METHOD_UNLOAD,
-    TYPE_FLUSH // pseudo-event used to implement flush_queue()
+    TYPE_DYNAMIC_CODE_GENERATED
   } Type;
 
   Type _type;
   union {
     nmethod* compiled_method_load;
     struct {
+      nmethod* nm;
       jmethodID method_id;
       const void* code_begin;
     } compiled_method_unload;
-    int* flush_state_addr;
+    struct {
+      const char* name;
+      const void* code_begin;
+      const void* code_end;
+    } dynamic_code_generated;
   } _event_data;
 
   JvmtiDeferredEvent(Type t) : _type(t) {}
 
-  void set_compiled_method_load(nmethod* nm) {
-    assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be");
-    _event_data.compiled_method_load = nm;
-  }
-
-  nmethod* compiled_method_load() const {
-    assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be");
-    return _event_data.compiled_method_load;
-  }
-
-  void set_compiled_method_unload(jmethodID id, const void* code) {
-    assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be");
-    _event_data.compiled_method_unload.method_id = id;
-    _event_data.compiled_method_unload.code_begin = code;
-  }
-
-  jmethodID compiled_method_unload_method_id() const {
-    assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be");
-    return _event_data.compiled_method_unload.method_id;
-  }
-
-  const void* compiled_method_unload_code_begin() const {
-    assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be");
-    return _event_data.compiled_method_unload.code_begin;
-  }
-
-  bool is_flush_event() const { return _type == TYPE_FLUSH; }
-
-  int* flush_state_addr() const {
-    assert(is_flush_event(), "must be");
-    return _event_data.flush_state_addr;
-  }
-
-  void set_flush_state_addr(int* flag) {
-    assert(is_flush_event(), "must be");
-    _event_data.flush_state_addr = flag;
-  }
-
  public:
 
   JvmtiDeferredEvent() : _type(TYPE_NONE) {}
@@ -511,8 +478,11 @@
   // Factory methods
   static JvmtiDeferredEvent compiled_method_load_event(nmethod* nm)
     KERNEL_RETURN_(JvmtiDeferredEvent());
-  static JvmtiDeferredEvent compiled_method_unload_event(
+  static JvmtiDeferredEvent compiled_method_unload_event(nmethod* nm,
       jmethodID id, const void* code) KERNEL_RETURN_(JvmtiDeferredEvent());
+  static JvmtiDeferredEvent dynamic_code_generated_event(
+      const char* name, const void* begin, const void* end)
+          KERNEL_RETURN_(JvmtiDeferredEvent());
 
   // Actually posts the event.
   void post() KERNEL_RETURN;
@@ -548,25 +518,12 @@
   // Transfers events from the _pending_list to the _queue.
   static void process_pending_events() KERNEL_RETURN;
 
-  static void flush_complete(int* flush_state) KERNEL_RETURN;
-
  public:
   // Must be holding Service_lock when calling these
   static bool has_events() KERNEL_RETURN_(false);
   static void enqueue(const JvmtiDeferredEvent& event) KERNEL_RETURN;
   static JvmtiDeferredEvent dequeue() KERNEL_RETURN_(JvmtiDeferredEvent());
 
-  // This call blocks until all events enqueued prior to this call
-  // have been posted.  The Service_lock is acquired and waited upon.
-  //
-  // Implemented by creating a "flush" event and placing it in the queue.
-  // When the flush event is "posted" it will call flush_complete(), which
-  // will release the caller.
-  //
-  // Can be called by any thread (maybe even the service thread itself).
-  // Not necessary for the caller to be a JavaThread.
-  static void flush_queue(Thread* current) KERNEL_RETURN;
-
   // Used to enqueue events without using a lock, for times (such as during
   // safepoint) when we can't or don't want to lock the Service_lock.
   //
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1084,7 +1084,10 @@
       jbyte old_tag = old_cp->tag_at(old_i).value();
       switch (old_tag) {
       case JVM_CONSTANT_Class:
+      case JVM_CONSTANT_UnresolvedClass:
         // revert the copy to JVM_CONSTANT_UnresolvedClass
+        // May be resolving while calling this so do the same for
+        // JVM_CONSTANT_UnresolvedClass (klass_name_at() deals with transition)
         (*merge_cp_p)->unresolved_klass_at_put(old_i,
           old_cp->klass_name_at(old_i));
         break;
--- a/hotspot/src/share/vm/prims/methodHandleWalk.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/methodHandleWalk.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -36,7 +36,7 @@
 // MethodHandleChain
 
 void MethodHandleChain::set_method_handle(Handle mh, TRAPS) {
-  if (!java_dyn_MethodHandle::is_instance(mh()))  lose("bad method handle", CHECK);
+  if (!java_lang_invoke_MethodHandle::is_instance(mh()))  lose("bad method handle", CHECK);
 
   // set current method handle and unpack partially
   _method_handle = mh;
@@ -47,21 +47,21 @@
   _conversion    = -1;
   _last_invoke   = Bytecodes::_nop;  //arbitrary non-garbage
 
-  if (sun_dyn_DirectMethodHandle::is_instance(mh())) {
+  if (java_lang_invoke_DirectMethodHandle::is_instance(mh())) {
     set_last_method(mh(), THREAD);
     return;
   }
-  if (sun_dyn_AdapterMethodHandle::is_instance(mh())) {
+  if (java_lang_invoke_AdapterMethodHandle::is_instance(mh())) {
     _conversion = AdapterMethodHandle_conversion();
     assert(_conversion != -1, "bad conv value");
-    assert(sun_dyn_BoundMethodHandle::is_instance(mh()), "also BMH");
+    assert(java_lang_invoke_BoundMethodHandle::is_instance(mh()), "also BMH");
   }
-  if (sun_dyn_BoundMethodHandle::is_instance(mh())) {
+  if (java_lang_invoke_BoundMethodHandle::is_instance(mh())) {
     if (!is_adapter())          // keep AMH and BMH separate in this model
       _is_bound = true;
     _arg_slot = BoundMethodHandle_vmargslot();
     oop target = MethodHandle_vmtarget_oop();
-    if (!is_bound() || java_dyn_MethodHandle::is_instance(target)) {
+    if (!is_bound() || java_lang_invoke_MethodHandle::is_instance(target)) {
       _arg_type = compute_bound_arg_type(target, NULL, _arg_slot, CHECK);
     } else if (target != NULL && target->is_method()) {
       methodOop m = (methodOop) target;
@@ -100,13 +100,12 @@
 BasicType MethodHandleChain::compute_bound_arg_type(oop target, methodOop m, int arg_slot, TRAPS) {
   // There is no direct indication of whether the argument is primitive or not.
   // It is implied by the _vmentry code, and by the MethodType of the target.
-  // FIXME: Make it explicit MethodHandleImpl refactors out from MethodHandle
   BasicType arg_type = T_VOID;
   if (target != NULL) {
-    oop mtype = java_dyn_MethodHandle::type(target);
+    oop mtype = java_lang_invoke_MethodHandle::type(target);
     int arg_num = MethodHandles::argument_slot_to_argnum(mtype, arg_slot);
     if (arg_num >= 0) {
-      oop ptype = java_dyn_MethodType::ptype(mtype, arg_num);
+      oop ptype = java_lang_invoke_MethodType::ptype(mtype, arg_num);
       arg_type = java_lang_Class::as_BasicType(ptype);
     }
   } else if (m != NULL) {
@@ -205,28 +204,28 @@
       int arg_slot = chain().adapter_arg_slot();
       SlotState* arg_state = slot_state(arg_slot);
       if (arg_state == NULL
-          && conv_op > sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW) {
+          && conv_op > java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW) {
         lose("bad argument index", CHECK_(empty));
       }
 
       // perform the adapter action
       switch (chain().adapter_conversion_op()) {
-      case sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY:
+      case java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY:
         // No changes to arguments; pass the bits through.
         break;
 
-      case sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW: {
+      case java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW: {
         // To keep the verifier happy, emit bitwise ("raw") conversions as needed.
         // See MethodHandles::same_basic_type_for_arguments for allowed conversions.
         Handle incoming_mtype(THREAD, chain().method_type_oop());
         oop outgoing_mh_oop = chain().vmtarget_oop();
-        if (!java_dyn_MethodHandle::is_instance(outgoing_mh_oop))
+        if (!java_lang_invoke_MethodHandle::is_instance(outgoing_mh_oop))
           lose("outgoing target not a MethodHandle", CHECK_(empty));
-        Handle outgoing_mtype(THREAD, java_dyn_MethodHandle::type(outgoing_mh_oop));
+        Handle outgoing_mtype(THREAD, java_lang_invoke_MethodHandle::type(outgoing_mh_oop));
         outgoing_mh_oop = NULL;  // GC safety
 
-        int nptypes = java_dyn_MethodType::ptype_count(outgoing_mtype());
-        if (nptypes != java_dyn_MethodType::ptype_count(incoming_mtype()))
+        int nptypes = java_lang_invoke_MethodType::ptype_count(outgoing_mtype());
+        if (nptypes != java_lang_invoke_MethodType::ptype_count(incoming_mtype()))
           lose("incoming and outgoing parameter count do not agree", CHECK_(empty));
 
         for (int i = 0, slot = _outgoing.length() - 1; slot >= 0; slot--) {
@@ -236,8 +235,8 @@
 
           klassOop  in_klass  = NULL;
           klassOop  out_klass = NULL;
-          BasicType inpbt  = java_lang_Class::as_BasicType(java_dyn_MethodType::ptype(incoming_mtype(), i), &in_klass);
-          BasicType outpbt = java_lang_Class::as_BasicType(java_dyn_MethodType::ptype(outgoing_mtype(), i), &out_klass);
+          BasicType inpbt  = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::ptype(incoming_mtype(), i), &in_klass);
+          BasicType outpbt = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::ptype(outgoing_mtype(), i), &out_klass);
           assert(inpbt == arg.basic_type(), "sanity");
 
           if (inpbt != outpbt) {
@@ -255,8 +254,8 @@
           i++;  // We need to skip void slots at the top of the loop.
         }
 
-        BasicType inrbt  = java_lang_Class::as_BasicType(java_dyn_MethodType::rtype(incoming_mtype()));
-        BasicType outrbt = java_lang_Class::as_BasicType(java_dyn_MethodType::rtype(outgoing_mtype()));
+        BasicType inrbt  = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::rtype(incoming_mtype()));
+        BasicType outrbt = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::rtype(outgoing_mtype()));
         if (inrbt != outrbt) {
           if (inrbt == T_INT && outrbt == T_VOID) {
             // See comments in MethodHandles::same_basic_type_for_arguments.
@@ -268,7 +267,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_CHECK_CAST: {
+      case java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST: {
         // checkcast the Nth outgoing argument in place
         klassOop dest_klass = NULL;
         BasicType dest = java_lang_Class::as_BasicType(chain().adapter_arg_oop(), &dest_klass);
@@ -281,7 +280,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM: {
+      case java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM: {
         // i2l, etc., on the Nth outgoing argument in place
         BasicType src = chain().adapter_conversion_src_type(),
                   dest = chain().adapter_conversion_dest_type();
@@ -306,7 +305,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM: {
+      case java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM: {
         // checkcast to wrapper type & call intValue, etc.
         BasicType dest = chain().adapter_conversion_dest_type();
         ArgToken arg = arg_state->_arg;
@@ -324,7 +323,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_PRIM_TO_REF: {
+      case java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF: {
         // call wrapper type.valueOf
         BasicType src = chain().adapter_conversion_src_type();
         ArgToken arg = arg_state->_arg;
@@ -340,7 +339,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS: {
+      case java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS: {
         int dest_arg_slot = chain().adapter_conversion_vminfo();
         if (!slot_has_argument(dest_arg_slot)) {
           lose("bad swap index", CHECK_(empty));
@@ -353,7 +352,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_ROT_ARGS: {
+      case java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS: {
         int dest_arg_slot = chain().adapter_conversion_vminfo();
         if (!slot_has_argument(dest_arg_slot) || arg_slot == dest_arg_slot) {
           lose("bad rotate index", CHECK_(empty));
@@ -379,7 +378,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_DUP_ARGS: {
+      case java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS: {
         int dup_slots = chain().adapter_conversion_stack_pushes();
         if (dup_slots <= 0) {
           lose("bad dup count", CHECK_(empty));
@@ -393,7 +392,7 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_DROP_ARGS: {
+      case java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS: {
         int drop_slots = -chain().adapter_conversion_stack_pushes();
         if (drop_slots <= 0) {
           lose("bad drop count", CHECK_(empty));
@@ -407,12 +406,12 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_COLLECT_ARGS: { //NYI, may GC
+      case java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS: { //NYI, may GC
         lose("unimplemented", CHECK_(empty));
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS: {
+      case java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS: {
         klassOop array_klass_oop = NULL;
         BasicType array_type = java_lang_Class::as_BasicType(chain().adapter_arg_oop(),
                                                              &array_klass_oop);
@@ -470,8 +469,8 @@
         break;
       }
 
-      case sun_dyn_AdapterMethodHandle::OP_FLYBY: //NYI, runs Java code
-      case sun_dyn_AdapterMethodHandle::OP_RICOCHET: //NYI, runs Java code
+      case java_lang_invoke_AdapterMethodHandle::OP_FLYBY: //NYI, runs Java code
+      case java_lang_invoke_AdapterMethodHandle::OP_RICOCHET: //NYI, runs Java code
         lose("unimplemented", CHECK_(empty));
         break;
 
@@ -533,7 +532,7 @@
 //
 void MethodHandleWalker::walk_incoming_state(TRAPS) {
   Handle mtype(THREAD, chain().method_type_oop());
-  int nptypes = java_dyn_MethodType::ptype_count(mtype());
+  int nptypes = java_lang_invoke_MethodType::ptype_count(mtype());
   _outgoing_argc = nptypes;
   int argp = nptypes - 1;
   if (argp >= 0) {
@@ -542,7 +541,7 @@
   for (int i = 0; i < nptypes; i++) {
     klassOop  arg_type_klass = NULL;
     BasicType arg_type = java_lang_Class::as_BasicType(
-                java_dyn_MethodType::ptype(mtype(), i), &arg_type_klass);
+                java_lang_invoke_MethodType::ptype(mtype(), i), &arg_type_klass);
     int index = new_local_index(arg_type);
     ArgToken arg = make_parameter(arg_type, arg_type_klass, index, CHECK);
     debug_only(arg_type_klass = (klassOop) NULL);
@@ -556,7 +555,7 @@
   // call make_parameter at the end of the list for the return type
   klassOop  ret_type_klass = NULL;
   BasicType ret_type = java_lang_Class::as_BasicType(
-              java_dyn_MethodType::rtype(mtype()), &ret_type_klass);
+              java_lang_invoke_MethodType::rtype(mtype()), &ret_type_klass);
   ArgToken  ret = make_parameter(ret_type, ret_type_klass, -1, CHECK);
   // ignore ret; client can catch it if needed
 }
@@ -631,7 +630,7 @@
   // Get return type klass.
   Handle first_mtype(THREAD, chain().method_type_oop());
   // _rklass is NULL for primitives.
-  _rtype = java_lang_Class::as_BasicType(java_dyn_MethodType::rtype(first_mtype()), &_rklass);
+  _rtype = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::rtype(first_mtype()), &_rklass);
   if (_rtype == T_ARRAY)  _rtype = T_OBJECT;
 
   int params = _callee->size_of_parameters();  // Incoming arguments plus receiver.
@@ -960,6 +959,16 @@
   if (m == NULL) {
     // Get the intrinsic methodOop.
     m = vmIntrinsics::method_for(iid);
+    if (m == NULL && iid == vmIntrinsics::_checkSpreadArgument && AllowTransitionalJSR292) {
+      m = vmIntrinsics::method_for(vmIntrinsics::_checkSpreadArgument_TRANS);
+      if (m == NULL)
+        // sun.dyn.MethodHandleImpl not found, look for java.dyn.MethodHandleNatives:
+        m = vmIntrinsics::method_for(vmIntrinsics::_checkSpreadArgument_TRANS2);
+    }
+    if (m == NULL) {
+      ArgToken zero;
+      lose(vmIntrinsics::name_at(iid), CHECK_(zero));
+    }
   }
 
   klassOop  klass   = m->method_holder();
@@ -1396,7 +1405,7 @@
 void print_method_handle(oop mh) {
   if (!mh->is_oop()) {
     tty->print_cr("*** not a method handle: "INTPTR_FORMAT, (intptr_t)mh);
-  } else if (java_dyn_MethodHandle::is_instance(mh)) {
+  } else if (java_lang_invoke_MethodHandle::is_instance(mh)) {
     //MethodHandlePrinter::print(mh);
   } else {
     tty->print("*** not a method handle: ");
--- a/hotspot/src/share/vm/prims/methodHandleWalk.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/methodHandleWalk.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,13 @@
   void set_last_method(oop target, TRAPS);
   static BasicType compute_bound_arg_type(oop target, methodOop m, int arg_slot, TRAPS);
 
-  oop MethodHandle_type_oop()     { return java_dyn_MethodHandle::type(method_handle_oop()); }
-  oop MethodHandle_vmtarget_oop() { return java_dyn_MethodHandle::vmtarget(method_handle_oop()); }
-  int MethodHandle_vmslots()      { return java_dyn_MethodHandle::vmslots(method_handle_oop()); }
-  int DirectMethodHandle_vmindex()     { return sun_dyn_DirectMethodHandle::vmindex(method_handle_oop()); }
-  oop BoundMethodHandle_argument_oop() { return sun_dyn_BoundMethodHandle::argument(method_handle_oop()); }
-  int BoundMethodHandle_vmargslot()    { return sun_dyn_BoundMethodHandle::vmargslot(method_handle_oop()); }
-  int AdapterMethodHandle_conversion() { return sun_dyn_AdapterMethodHandle::conversion(method_handle_oop()); }
+  oop MethodHandle_type_oop()          { return java_lang_invoke_MethodHandle::type(method_handle_oop()); }
+  oop MethodHandle_vmtarget_oop()      { return java_lang_invoke_MethodHandle::vmtarget(method_handle_oop()); }
+  int MethodHandle_vmslots()           { return java_lang_invoke_MethodHandle::vmslots(method_handle_oop()); }
+  int DirectMethodHandle_vmindex()     { return java_lang_invoke_DirectMethodHandle::vmindex(method_handle_oop()); }
+  oop BoundMethodHandle_argument_oop() { return java_lang_invoke_BoundMethodHandle::argument(method_handle_oop()); }
+  int BoundMethodHandle_vmargslot()    { return java_lang_invoke_BoundMethodHandle::vmargslot(method_handle_oop()); }
+  int AdapterMethodHandle_conversion() { return java_lang_invoke_AdapterMethodHandle::conversion(method_handle_oop()); }
 
 public:
   MethodHandleChain(Handle root, TRAPS)
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -163,9 +163,9 @@
     // or it may use the klass/index form; both forms mean the same thing.
     methodOop m = decode_methodOop(methodOop(vmtarget), decode_flags_result);
     if ((decode_flags_result & _dmf_has_receiver) != 0
-        && java_dyn_MethodType::is_instance(mtype)) {
+        && java_lang_invoke_MethodType::is_instance(mtype)) {
       // Extract receiver type restriction from mtype.ptypes[0].
-      objArrayOop ptypes = java_dyn_MethodType::ptypes(mtype);
+      objArrayOop ptypes = java_lang_invoke_MethodType::ptypes(mtype);
       oop ptype0 = (ptypes == NULL || ptypes->length() < 1) ? oop(NULL) : ptypes->obj_at(0);
       if (java_lang_Class::is_instance(ptype0))
         receiver_limit_result = java_lang_Class::as_klassOop(ptype0);
@@ -199,18 +199,18 @@
 // (MemberName is the non-operational name used for queries and setup.)
 
 methodOop MethodHandles::decode_DirectMethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result) {
-  oop vmtarget = sun_dyn_DirectMethodHandle::vmtarget(mh);
-  int vmindex  = sun_dyn_DirectMethodHandle::vmindex(mh);
-  oop mtype    = sun_dyn_DirectMethodHandle::type(mh);
+  oop vmtarget = java_lang_invoke_DirectMethodHandle::vmtarget(mh);
+  int vmindex  = java_lang_invoke_DirectMethodHandle::vmindex(mh);
+  oop mtype    = java_lang_invoke_DirectMethodHandle::type(mh);
   return decode_vmtarget(vmtarget, vmindex, mtype, receiver_limit_result, decode_flags_result);
 }
 
 methodOop MethodHandles::decode_BoundMethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result) {
-  assert(sun_dyn_BoundMethodHandle::is_instance(mh), "");
+  assert(java_lang_invoke_BoundMethodHandle::is_instance(mh), "");
   assert(mh->klass() != SystemDictionary::AdapterMethodHandle_klass(), "");
   for (oop bmh = mh;;) {
     // Bound MHs can be stacked to bind several arguments.
-    oop target = java_dyn_MethodHandle::vmtarget(bmh);
+    oop target = java_lang_invoke_MethodHandle::vmtarget(bmh);
     if (target == NULL)  return NULL;
     decode_flags_result |= MethodHandles::_dmf_binds_argument;
     klassOop tk = target->klass();
@@ -218,7 +218,7 @@
       bmh = target;
       continue;
     } else {
-      if (java_dyn_MethodHandle::is_subclass(tk)) {
+      if (java_lang_invoke_MethodHandle::is_subclass(tk)) {
         //assert(tk == SystemDictionary::DirectMethodHandle_klass(), "end of BMH chain must be DMH");
         return decode_MethodHandle(target, receiver_limit_result, decode_flags_result);
       } else {
@@ -240,9 +240,9 @@
   assert(mh->klass() == SystemDictionary::AdapterMethodHandle_klass(), "");
   for (oop amh = mh;;) {
     // Adapter MHs can be stacked to convert several arguments.
-    int conv_op = adapter_conversion_op(sun_dyn_AdapterMethodHandle::conversion(amh));
+    int conv_op = adapter_conversion_op(java_lang_invoke_AdapterMethodHandle::conversion(amh));
     decode_flags_result |= (_dmf_adapter_lsb << conv_op) & _DMF_ADAPTER_MASK;
-    oop target = java_dyn_MethodHandle::vmtarget(amh);
+    oop target = java_lang_invoke_MethodHandle::vmtarget(amh);
     if (target == NULL)  return NULL;
     klassOop tk = target->klass();
     if (tk == SystemDictionary::AdapterMethodHandle_klass()) {
@@ -258,14 +258,14 @@
 methodOop MethodHandles::decode_MethodHandle(oop mh, klassOop& receiver_limit_result, int& decode_flags_result) {
   if (mh == NULL)  return NULL;
   klassOop mhk = mh->klass();
-  assert(java_dyn_MethodHandle::is_subclass(mhk), "must be a MethodHandle");
+  assert(java_lang_invoke_MethodHandle::is_subclass(mhk), "must be a MethodHandle");
   if (mhk == SystemDictionary::DirectMethodHandle_klass()) {
     return decode_DirectMethodHandle(mh, receiver_limit_result, decode_flags_result);
   } else if (mhk == SystemDictionary::BoundMethodHandle_klass()) {
     return decode_BoundMethodHandle(mh, receiver_limit_result, decode_flags_result);
   } else if (mhk == SystemDictionary::AdapterMethodHandle_klass()) {
     return decode_AdapterMethodHandle(mh, receiver_limit_result, decode_flags_result);
-  } else if (sun_dyn_BoundMethodHandle::is_subclass(mhk)) {
+  } else if (java_lang_invoke_BoundMethodHandle::is_subclass(mhk)) {
     // could be a JavaMethodHandle (but not an adapter MH)
     return decode_BoundMethodHandle(mh, receiver_limit_result, decode_flags_result);
   } else {
@@ -308,7 +308,7 @@
   } else if (xk == SystemDictionary::MemberName_klass()) {
     // Note: This only works if the MemberName has already been resolved.
     return decode_MemberName(x, receiver_limit_result, decode_flags_result);
-  } else if (java_dyn_MethodHandle::is_subclass(xk)) {
+  } else if (java_lang_invoke_MethodHandle::is_subclass(xk)) {
     return decode_MethodHandle(x, receiver_limit_result, decode_flags_result);
   } else if (xk == SystemDictionary::reflect_Method_klass()) {
     oop clazz  = java_lang_reflect_Method::clazz(x);
@@ -327,7 +327,7 @@
   } else {
     // unrecognized object
     assert(!x->is_method(), "already checked");
-    assert(!sun_dyn_MemberName::is_instance(x), "already checked");
+    assert(!java_lang_invoke_MemberName::is_instance(x), "already checked");
   }
   return NULL;
 }
@@ -336,15 +336,15 @@
 int MethodHandles::decode_MethodHandle_stack_pushes(oop mh) {
   if (mh->klass() == SystemDictionary::DirectMethodHandle_klass())
     return 0;                   // no push/pop
-  int this_vmslots = java_dyn_MethodHandle::vmslots(mh);
+  int this_vmslots = java_lang_invoke_MethodHandle::vmslots(mh);
   int last_vmslots = 0;
   oop last_mh = mh;
   for (;;) {
-    oop target = java_dyn_MethodHandle::vmtarget(last_mh);
+    oop target = java_lang_invoke_MethodHandle::vmtarget(last_mh);
     if (target->klass() == SystemDictionary::DirectMethodHandle_klass()) {
-      last_vmslots = java_dyn_MethodHandle::vmslots(target);
+      last_vmslots = java_lang_invoke_MethodHandle::vmslots(target);
       break;
-    } else if (!java_dyn_MethodHandle::is_instance(target)) {
+    } else if (!java_lang_invoke_MethodHandle::is_instance(target)) {
       // might be klass or method
       assert(target->is_method(), "must get here with a direct ref to method");
       last_vmslots = methodOop(target)->size_of_parameters();
@@ -361,16 +361,16 @@
 
 // MemberName support
 
-// import sun_dyn_MemberName.*
+// import java_lang_invoke_MemberName.*
 enum {
-  IS_METHOD      = sun_dyn_MemberName::MN_IS_METHOD,
-  IS_CONSTRUCTOR = sun_dyn_MemberName::MN_IS_CONSTRUCTOR,
-  IS_FIELD       = sun_dyn_MemberName::MN_IS_FIELD,
-  IS_TYPE        = sun_dyn_MemberName::MN_IS_TYPE,
-  SEARCH_SUPERCLASSES = sun_dyn_MemberName::MN_SEARCH_SUPERCLASSES,
-  SEARCH_INTERFACES   = sun_dyn_MemberName::MN_SEARCH_INTERFACES,
+  IS_METHOD      = java_lang_invoke_MemberName::MN_IS_METHOD,
+  IS_CONSTRUCTOR = java_lang_invoke_MemberName::MN_IS_CONSTRUCTOR,
+  IS_FIELD       = java_lang_invoke_MemberName::MN_IS_FIELD,
+  IS_TYPE        = java_lang_invoke_MemberName::MN_IS_TYPE,
+  SEARCH_SUPERCLASSES = java_lang_invoke_MemberName::MN_SEARCH_SUPERCLASSES,
+  SEARCH_INTERFACES   = java_lang_invoke_MemberName::MN_SEARCH_INTERFACES,
   ALL_KINDS      = IS_METHOD | IS_CONSTRUCTOR | IS_FIELD | IS_TYPE,
-  VM_INDEX_UNINITIALIZED = sun_dyn_MemberName::VM_INDEX_UNINITIALIZED
+  VM_INDEX_UNINITIALIZED = java_lang_invoke_MemberName::VM_INDEX_UNINITIALIZED
 };
 
 Handle MethodHandles::new_MemberName(TRAPS) {
@@ -405,10 +405,10 @@
   if (!do_dispatch || (flags & IS_CONSTRUCTOR) || m->can_be_statically_bound())
     vmindex = methodOopDesc::nonvirtual_vtable_index; // implies never any dispatch
   assert(vmindex != VM_INDEX_UNINITIALIZED, "Java sentinel value");
-  sun_dyn_MemberName::set_vmtarget(mname_oop, vmtarget);
-  sun_dyn_MemberName::set_vmindex(mname_oop,  vmindex);
-  sun_dyn_MemberName::set_flags(mname_oop,    flags);
-  sun_dyn_MemberName::set_clazz(mname_oop,    Klass::cast(m->method_holder())->java_mirror());
+  java_lang_invoke_MemberName::set_vmtarget(mname_oop, vmtarget);
+  java_lang_invoke_MemberName::set_vmindex(mname_oop,  vmindex);
+  java_lang_invoke_MemberName::set_flags(mname_oop,    flags);
+  java_lang_invoke_MemberName::set_clazz(mname_oop,    Klass::cast(m->method_holder())->java_mirror());
 }
 
 void MethodHandles::init_MemberName(oop mname_oop, klassOop field_holder, AccessFlags mods, int offset) {
@@ -416,21 +416,21 @@
   oop vmtarget = field_holder;
   int vmindex  = offset;  // determines the field uniquely when combined with static bit
   assert(vmindex != VM_INDEX_UNINITIALIZED, "bad alias on vmindex");
-  sun_dyn_MemberName::set_vmtarget(mname_oop, vmtarget);
-  sun_dyn_MemberName::set_vmindex(mname_oop,  vmindex);
-  sun_dyn_MemberName::set_flags(mname_oop,    flags);
-  sun_dyn_MemberName::set_clazz(mname_oop,    Klass::cast(field_holder)->java_mirror());
+  java_lang_invoke_MemberName::set_vmtarget(mname_oop, vmtarget);
+  java_lang_invoke_MemberName::set_vmindex(mname_oop,  vmindex);
+  java_lang_invoke_MemberName::set_flags(mname_oop,    flags);
+  java_lang_invoke_MemberName::set_clazz(mname_oop,    Klass::cast(field_holder)->java_mirror());
 }
 
 
 methodOop MethodHandles::decode_MemberName(oop mname, klassOop& receiver_limit_result, int& decode_flags_result) {
-  int flags  = sun_dyn_MemberName::flags(mname);
+  int flags  = java_lang_invoke_MemberName::flags(mname);
   if ((flags & (IS_METHOD | IS_CONSTRUCTOR)) == 0)  return NULL;  // not invocable
-  oop vmtarget = sun_dyn_MemberName::vmtarget(mname);
-  int vmindex  = sun_dyn_MemberName::vmindex(mname);
+  oop vmtarget = java_lang_invoke_MemberName::vmtarget(mname);
+  int vmindex  = java_lang_invoke_MemberName::vmindex(mname);
   if (vmindex == VM_INDEX_UNINITIALIZED)  return NULL; // not resolved
   methodOop m = decode_vmtarget(vmtarget, vmindex, NULL, receiver_limit_result, decode_flags_result);
-  oop clazz = sun_dyn_MemberName::clazz(mname);
+  oop clazz = java_lang_invoke_MemberName::clazz(mname);
   if (clazz != NULL && java_lang_Class::is_instance(clazz)) {
     klassOop klass = java_lang_Class::as_klassOop(clazz);
     if (klass != NULL)  receiver_limit_result = klass;
@@ -442,8 +442,8 @@
 Symbol* MethodHandles::convert_to_signature(oop type_str,
                                             bool polymorphic,
                                             TRAPS) {
-  if (java_dyn_MethodType::is_instance(type_str)) {
-    return java_dyn_MethodType::as_signature(type_str, polymorphic, CHECK_NULL);
+  if (java_lang_invoke_MethodType::is_instance(type_str)) {
+    return java_lang_invoke_MethodType::as_signature(type_str, polymorphic, CHECK_NULL);
   } else if (java_lang_Class::is_instance(type_str)) {
     return java_lang_Class::as_signature(type_str, false, CHECK_NULL);
   } else if (java_lang_String::is_instance(type_str)) {
@@ -461,7 +461,7 @@
 // Resolving it plants a vmtarget/vmindex in it,
 // which refers dirctly to JVM internals.
 void MethodHandles::resolve_MemberName(Handle mname, TRAPS) {
-  assert(sun_dyn_MemberName::is_instance(mname()), "");
+  assert(java_lang_invoke_MemberName::is_instance(mname()), "");
 #ifdef ASSERT
   // If this assert throws, renegotiate the sentinel value used by the Java code,
   // so that it is distinct from any valid vtable index value, and any special
@@ -472,12 +472,12 @@
   const int sentinel_limit = methodOopDesc::highest_unused_vtable_index_value - sentinel_slop;
   assert(VM_INDEX_UNINITIALIZED < sentinel_limit, "Java sentinel != JVM sentinels");
 #endif
-  if (sun_dyn_MemberName::vmindex(mname()) != VM_INDEX_UNINITIALIZED)
+  if (java_lang_invoke_MemberName::vmindex(mname()) != VM_INDEX_UNINITIALIZED)
     return;  // already resolved
-  oop defc_oop = sun_dyn_MemberName::clazz(mname());
-  oop name_str = sun_dyn_MemberName::name(mname());
-  oop type_str = sun_dyn_MemberName::type(mname());
-  int flags    = sun_dyn_MemberName::flags(mname());
+  oop defc_oop = java_lang_invoke_MemberName::clazz(mname());
+  oop name_str = java_lang_invoke_MemberName::name(mname());
+  oop type_str = java_lang_invoke_MemberName::type(mname());
+  int flags    = java_lang_invoke_MemberName::flags(mname());
 
   if (defc_oop == NULL || name_str == NULL || type_str == NULL) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "nothing to resolve");
@@ -510,7 +510,7 @@
 
   // convert the external string or reflective type to an internal signature
   TempNewSymbol type = convert_to_signature(type_str, polymorphic_signature, CHECK);
-  if (java_dyn_MethodType::is_instance(type_str) && polymorphic_signature) {
+  if (java_lang_invoke_MethodType::is_instance(type_str) && polymorphic_signature) {
     polymorphic_method_type = Handle(THREAD, type_str);  //preserve exactly
   }
 
@@ -557,9 +557,9 @@
         vmtarget = result.resolved_klass()->as_klassOop();
       }
       int mods = (m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS);
-      sun_dyn_MemberName::set_vmtarget(mname(), vmtarget);
-      sun_dyn_MemberName::set_vmindex(mname(),  vmindex);
-      sun_dyn_MemberName::set_modifiers(mname(), mods);
+      java_lang_invoke_MemberName::set_vmtarget(mname(), vmtarget);
+      java_lang_invoke_MemberName::set_vmindex(mname(),  vmindex);
+      java_lang_invoke_MemberName::set_modifiers(mname(), mods);
       DEBUG_ONLY(int junk; klassOop junk2);
       assert(decode_MemberName(mname(), junk2, junk) == result.resolved_method()(),
              "properly stored for later decoding");
@@ -586,9 +586,9 @@
       oop vmtarget = m();
       int vmindex  = methodOopDesc::nonvirtual_vtable_index;
       int mods     = (m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS);
-      sun_dyn_MemberName::set_vmtarget(mname(), vmtarget);
-      sun_dyn_MemberName::set_vmindex(mname(),  vmindex);
-      sun_dyn_MemberName::set_modifiers(mname(), mods);
+      java_lang_invoke_MemberName::set_vmtarget(mname(), vmtarget);
+      java_lang_invoke_MemberName::set_vmindex(mname(),  vmindex);
+      java_lang_invoke_MemberName::set_modifiers(mname(), mods);
       DEBUG_ONLY(int junk; klassOop junk2);
       assert(decode_MemberName(mname(), junk2, junk) == result.resolved_method()(),
              "properly stored for later decoding");
@@ -605,9 +605,9 @@
       int vmindex  = fd.offset();
       int mods     = (fd.access_flags().as_short() & JVM_RECOGNIZED_FIELD_MODIFIERS);
       if (vmindex == VM_INDEX_UNINITIALIZED)  break;  // should not happen
-      sun_dyn_MemberName::set_vmtarget(mname(),  vmtarget);
-      sun_dyn_MemberName::set_vmindex(mname(),   vmindex);
-      sun_dyn_MemberName::set_modifiers(mname(), mods);
+      java_lang_invoke_MemberName::set_vmtarget(mname(),  vmtarget);
+      java_lang_invoke_MemberName::set_vmindex(mname(),   vmindex);
+      java_lang_invoke_MemberName::set_modifiers(mname(), mods);
       return;
     }
   default:
@@ -618,11 +618,11 @@
   if (polymorphic_method_type.not_null()) {
     // Look on a non-null class loader.
     Handle cur_class_loader;
-    const int nptypes = java_dyn_MethodType::ptype_count(polymorphic_method_type());
+    const int nptypes = java_lang_invoke_MethodType::ptype_count(polymorphic_method_type());
     for (int i = 0; i <= nptypes; i++) {
       oop type_mirror;
-      if (i < nptypes)  type_mirror = java_dyn_MethodType::ptype(polymorphic_method_type(), i);
-      else              type_mirror = java_dyn_MethodType::rtype(polymorphic_method_type());
+      if (i < nptypes)  type_mirror = java_lang_invoke_MethodType::ptype(polymorphic_method_type(), i);
+      else              type_mirror = java_lang_invoke_MethodType::rtype(polymorphic_method_type());
       klassOop example_type = java_lang_Class::as_klassOop(type_mirror);
       if (example_type == NULL)  continue;
       oop class_loader = Klass::cast(example_type)->class_loader();
@@ -639,9 +639,9 @@
       }
       if (m != NULL) {
         int mods = (m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS);
-        sun_dyn_MemberName::set_vmtarget(mname(),  m);
-        sun_dyn_MemberName::set_vmindex(mname(),   m->vtable_index());
-        sun_dyn_MemberName::set_modifiers(mname(), mods);
+        java_lang_invoke_MemberName::set_vmtarget(mname(),  m);
+        java_lang_invoke_MemberName::set_vmindex(mname(),   m->vtable_index());
+        java_lang_invoke_MemberName::set_modifiers(mname(), mods);
         return;
       }
     }
@@ -653,17 +653,17 @@
 // Resolving it plants a vmtarget/vmindex in it,
 // which refers directly to JVM internals.
 void MethodHandles::expand_MemberName(Handle mname, int suppress, TRAPS) {
-  assert(sun_dyn_MemberName::is_instance(mname()), "");
-  oop vmtarget = sun_dyn_MemberName::vmtarget(mname());
-  int vmindex  = sun_dyn_MemberName::vmindex(mname());
+  assert(java_lang_invoke_MemberName::is_instance(mname()), "");
+  oop vmtarget = java_lang_invoke_MemberName::vmtarget(mname());
+  int vmindex  = java_lang_invoke_MemberName::vmindex(mname());
   if (vmtarget == NULL || vmindex == VM_INDEX_UNINITIALIZED) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "nothing to expand");
   }
 
-  bool have_defc = (sun_dyn_MemberName::clazz(mname()) != NULL);
-  bool have_name = (sun_dyn_MemberName::name(mname()) != NULL);
-  bool have_type = (sun_dyn_MemberName::type(mname()) != NULL);
-  int flags      = sun_dyn_MemberName::flags(mname());
+  bool have_defc = (java_lang_invoke_MemberName::clazz(mname()) != NULL);
+  bool have_name = (java_lang_invoke_MemberName::name(mname()) != NULL);
+  bool have_type = (java_lang_invoke_MemberName::type(mname()) != NULL);
+  int flags      = java_lang_invoke_MemberName::flags(mname());
 
   if (suppress != 0) {
     if (suppress & _suppress_defc)  have_defc = true;
@@ -687,16 +687,16 @@
         if (receiver_limit != NULL && receiver_limit != defc
             && Klass::cast(receiver_limit)->is_subtype_of(defc))
           defc = receiver_limit;
-        sun_dyn_MemberName::set_clazz(mname(), Klass::cast(defc)->java_mirror());
+        java_lang_invoke_MemberName::set_clazz(mname(), Klass::cast(defc)->java_mirror());
       }
       if (!have_name) {
         //not java_lang_String::create_from_symbol; let's intern member names
         Handle name = StringTable::intern(m->name(), CHECK);
-        sun_dyn_MemberName::set_name(mname(), name());
+        java_lang_invoke_MemberName::set_name(mname(), name());
       }
       if (!have_type) {
         Handle type = java_lang_String::create_from_symbol(m->signature(), CHECK);
-        sun_dyn_MemberName::set_type(mname(), type());
+        java_lang_invoke_MemberName::set_type(mname(), type());
       }
       return;
     }
@@ -711,16 +711,16 @@
       if (!defc->find_field_from_offset(vmindex, is_static, &fd))
         break;                  // cannot expand
       if (!have_defc) {
-        sun_dyn_MemberName::set_clazz(mname(), defc->java_mirror());
+        java_lang_invoke_MemberName::set_clazz(mname(), defc->java_mirror());
       }
       if (!have_name) {
         //not java_lang_String::create_from_symbol; let's intern member names
         Handle name = StringTable::intern(fd.name(), CHECK);
-        sun_dyn_MemberName::set_name(mname(), name());
+        java_lang_invoke_MemberName::set_name(mname(), name());
       }
       if (!have_type) {
         Handle type = java_lang_String::create_from_symbol(fd.signature(), CHECK);
-        sun_dyn_MemberName::set_type(mname(), type());
+        java_lang_invoke_MemberName::set_type(mname(), type());
       }
       return;
     }
@@ -775,7 +775,7 @@
         --rskip;
       } else if (rfill < rlimit) {
         oop result = results->obj_at(rfill++);
-        if (!sun_dyn_MemberName::is_instance(result))
+        if (!java_lang_invoke_MemberName::is_instance(result))
           return -99;  // caller bug!
         MethodHandles::init_MemberName(result, st.klass()->as_klassOop(), st.access_flags(), st.offset());
       } else if (++overflow >= overflow_limit) {
@@ -823,7 +823,7 @@
         --rskip;
       } else if (rfill < rlimit) {
         oop result = results->obj_at(rfill++);
-        if (!sun_dyn_MemberName::is_instance(result))
+        if (!java_lang_invoke_MemberName::is_instance(result))
           return -99;  // caller bug!
         MethodHandles::init_MemberName(result, m, true);
       } else if (++overflow >= overflow_limit) {
@@ -857,9 +857,9 @@
 // Sanitize out methodOops, klassOops, and any other non-Java data.
 // This is for debugging and reflection.
 oop MethodHandles::encode_target(Handle mh, int format, TRAPS) {
-  assert(java_dyn_MethodHandle::is_instance(mh()), "must be a MH");
+  assert(java_lang_invoke_MethodHandle::is_instance(mh()), "must be a MH");
   if (format == ETF_HANDLE_OR_METHOD_NAME) {
-    oop target = java_dyn_MethodHandle::vmtarget(mh());
+    oop target = java_lang_invoke_MethodHandle::vmtarget(mh());
     if (target == NULL) {
       return NULL;                // unformed MH
     }
@@ -874,10 +874,10 @@
       if (target->klass() == SystemDictionary::DirectMethodHandle_klass()) {
         return target;
       }
-      if (!java_dyn_MethodHandle::is_instance(target)){
+      if (!java_lang_invoke_MethodHandle::is_instance(target)){
         return NULL;                // unformed MH
       }
-      target = java_dyn_MethodHandle::vmtarget(target);
+      target = java_lang_invoke_MethodHandle::vmtarget(target);
     }
   }
   // cases of metadata in MH.vmtarget:
@@ -904,7 +904,7 @@
       instanceKlassHandle mname_klass(THREAD, SystemDictionary::MemberName_klass());
       mname_klass->initialize(CHECK_NULL);
       Handle mname = mname_klass->allocate_instance_handle(CHECK_NULL);
-      sun_dyn_MemberName::set_vmindex(mname(), VM_INDEX_UNINITIALIZED);
+      java_lang_invoke_MemberName::set_vmindex(mname(), VM_INDEX_UNINITIALIZED);
       bool do_dispatch = ((decode_flags & MethodHandles::_dmf_does_dispatch) != 0);
       init_MemberName(mname(), m, do_dispatch);
       expand_MemberName(mname, 0, CHECK_NULL);
@@ -923,6 +923,7 @@
   "java/lang/Null",
   //"java/lang/Nothing",
   "sun/dyn/empty/Empty",
+  "sun/invoke/empty/Empty",
   NULL
 };
 
@@ -1025,7 +1026,7 @@
                                             int first_ptype_pos,
                                             KlassHandle insert_ptype,
                                             TRAPS) {
-  objArrayHandle ptypes(THREAD, java_dyn_MethodType::ptypes(mtype()));
+  objArrayHandle ptypes(THREAD, java_lang_invoke_MethodType::ptypes(mtype()));
   int pnum = first_ptype_pos;
   int pmax = ptypes->length();
   int mnum = 0;                 // method argument
@@ -1036,7 +1037,7 @@
     if (ss.at_return_type()) {
       if (pnum != pmax)
         { err = "too many arguments"; break; }
-      ptype_oop = java_dyn_MethodType::rtype(mtype());
+      ptype_oop = java_lang_invoke_MethodType::rtype(mtype());
     } else {
       if (pnum >= pmax)
         { err = "not enough arguments"; break; }
@@ -1111,7 +1112,7 @@
   }
 
   if (m_needs_receiver && err == NULL) {
-    objArrayOop ptypes = java_dyn_MethodType::ptypes(mtype());
+    objArrayOop ptypes = java_lang_invoke_MethodType::ptypes(mtype());
     if (ptypes->length() < first_ptype_pos)
       { err = "receiver argument is missing"; goto die; }
     if (has_bound_recv)
@@ -1131,15 +1132,15 @@
 
 void MethodHandles::verify_vmslots(Handle mh, TRAPS) {
   // Verify vmslots.
-  int check_slots = argument_slot_count(java_dyn_MethodHandle::type(mh()));
-  if (java_dyn_MethodHandle::vmslots(mh()) != check_slots) {
+  int check_slots = argument_slot_count(java_lang_invoke_MethodHandle::type(mh()));
+  if (java_lang_invoke_MethodHandle::vmslots(mh()) != check_slots) {
     THROW_MSG(vmSymbols::java_lang_InternalError(), "bad vmslots in BMH");
   }
 }
 
 void MethodHandles::verify_vmargslot(Handle mh, int argnum, int argslot, TRAPS) {
   // Verify that argslot points at the given argnum.
-  int check_slot = argument_slot(java_dyn_MethodHandle::type(mh()), argnum);
+  int check_slot = argument_slot(java_lang_invoke_MethodHandle::type(mh()), argnum);
   if (argslot != check_slot || argslot < 0) {
     const char* fmt = "for argnum of %d, vmargslot is %d, should be %d";
     size_t msglen = strlen(fmt) + 3*11 + 1;
@@ -1160,8 +1161,8 @@
                                                     int delete_argnum,
                                                     oop dst_mtype, int dst_beg, int dst_end,
                                                     bool raw) {
-  objArrayOop src_ptypes = java_dyn_MethodType::ptypes(src_mtype);
-  objArrayOop dst_ptypes = java_dyn_MethodType::ptypes(dst_mtype);
+  objArrayOop src_ptypes = java_lang_invoke_MethodType::ptypes(src_mtype);
+  objArrayOop dst_ptypes = java_lang_invoke_MethodType::ptypes(dst_mtype);
 
   int src_max = src_ptypes->length();
   int dst_max = dst_ptypes->length();
@@ -1224,8 +1225,8 @@
   }
 
   // Now compare return types also.
-  oop src_rtype = java_dyn_MethodType::rtype(src_mtype);
-  oop dst_rtype = java_dyn_MethodType::rtype(dst_mtype);
+  oop src_rtype = java_lang_invoke_MethodType::rtype(src_mtype);
+  oop dst_rtype = java_lang_invoke_MethodType::rtype(dst_mtype);
   if (src_rtype != dst_rtype) {
     err = check_return_type_change(dst_rtype, src_rtype, raw); // note reversal!
     if (err != NULL)  return err;
@@ -1314,7 +1315,7 @@
 // then return a negative number.  Otherwise, the result
 // is in the range [0..vmslots] inclusive.
 int MethodHandles::argument_slot(oop method_type, int arg) {
-  objArrayOop ptypes = java_dyn_MethodType::ptypes(method_type);
+  objArrayOop ptypes = java_lang_invoke_MethodType::ptypes(method_type);
   int argslot = 0;
   int len = ptypes->length();
   if (arg < -1 || arg >= len)  return -99;
@@ -1328,7 +1329,7 @@
 
 // Given a slot number, return the argument number.
 int MethodHandles::argument_slot_to_argnum(oop method_type, int query_argslot) {
-  objArrayOop ptypes = java_dyn_MethodType::ptypes(method_type);
+  objArrayOop ptypes = java_lang_invoke_MethodType::ptypes(method_type);
   int argslot = 0;
   int len = ptypes->length();
   for (int i = len-1; i >= 0; i--) {
@@ -1394,11 +1395,11 @@
 
 void MethodHandles::verify_DirectMethodHandle(Handle mh, methodHandle m, TRAPS) {
   // Verify type.
-  Handle mtype(THREAD, java_dyn_MethodHandle::type(mh()));
+  Handle mtype(THREAD, java_lang_invoke_MethodHandle::type(mh()));
   verify_method_type(m, mtype, false, KlassHandle(), CHECK);
 
   // Verify vmslots.
-  if (java_dyn_MethodHandle::vmslots(mh()) != m->size_of_parameters()) {
+  if (java_lang_invoke_MethodHandle::vmslots(mh()) != m->size_of_parameters()) {
     THROW_MSG(vmSymbols::java_lang_InternalError(), "bad vmslots in DMH");
   }
 }
@@ -1410,7 +1411,7 @@
     THROW(vmSymbols::java_lang_InternalError());
   }
 
-  java_dyn_MethodHandle::init_vmslots(mh());
+  java_lang_invoke_MethodHandle::init_vmslots(mh());
 
   if (VerifyMethodHandles) {
     // The privileged code which invokes this routine should not make
@@ -1470,8 +1471,8 @@
 
   if (me == NULL) { THROW(vmSymbols::java_lang_InternalError()); }
 
-  sun_dyn_DirectMethodHandle::set_vmtarget(mh(), vmtarget);
-  sun_dyn_DirectMethodHandle::set_vmindex(mh(),  vmindex);
+  java_lang_invoke_DirectMethodHandle::set_vmtarget(mh(), vmtarget);
+  java_lang_invoke_DirectMethodHandle::set_vmindex(mh(),  vmindex);
   DEBUG_ONLY(int flags; klassOop rlimit);
   assert(MethodHandles::decode_method(mh(), rlimit, flags) == m(),
          "properly stored for later decoding");
@@ -1482,15 +1483,15 @@
   assert(decode_MethodHandle_stack_pushes(mh()) == 0, "DMH does not move stack");
 
   // Done!
-  java_dyn_MethodHandle::set_vmentry(mh(), me);
+  java_lang_invoke_MethodHandle::set_vmentry(mh(), me);
 }
 
 void MethodHandles::verify_BoundMethodHandle_with_receiver(Handle mh,
                                                            methodHandle m,
                                                            TRAPS) {
   // Verify type.
-  oop receiver = sun_dyn_BoundMethodHandle::argument(mh());
-  Handle mtype(THREAD, java_dyn_MethodHandle::type(mh()));
+  oop receiver = java_lang_invoke_BoundMethodHandle::argument(mh());
+  Handle mtype(THREAD, java_lang_invoke_MethodHandle::type(mh()));
   KlassHandle bound_recv_type;
   if (receiver != NULL)  bound_recv_type = KlassHandle(THREAD, receiver->klass());
   verify_method_type(m, mtype, true, bound_recv_type, CHECK);
@@ -1498,11 +1499,11 @@
   int receiver_pos = m->size_of_parameters() - 1;
 
   // Verify MH.vmargslot, which should point at the bound receiver.
-  verify_vmargslot(mh, -1, sun_dyn_BoundMethodHandle::vmargslot(mh()), CHECK);
+  verify_vmargslot(mh, -1, java_lang_invoke_BoundMethodHandle::vmargslot(mh()), CHECK);
   //verify_vmslots(mh, CHECK);
 
   // Verify vmslots.
-  if (java_dyn_MethodHandle::vmslots(mh()) != receiver_pos) {
+  if (java_lang_invoke_MethodHandle::vmslots(mh()) != receiver_pos) {
     THROW_MSG(vmSymbols::java_lang_InternalError(), "bad vmslots in BMH (receiver)");
   }
 }
@@ -1520,7 +1521,7 @@
 
   KlassHandle receiver_klass;
   {
-    oop receiver_oop = sun_dyn_BoundMethodHandle::argument(mh());
+    oop receiver_oop = java_lang_invoke_BoundMethodHandle::argument(mh());
     if (receiver_oop != NULL)
       receiver_klass = KlassHandle(THREAD, receiver_oop->klass());
   }
@@ -1531,31 +1532,31 @@
   if (m.is_null())      { THROW(vmSymbols::java_lang_InternalError()); }
   if (m->is_abstract()) { THROW(vmSymbols::java_lang_AbstractMethodError()); }
 
-  java_dyn_MethodHandle::init_vmslots(mh());
+  java_lang_invoke_MethodHandle::init_vmslots(mh());
 
   if (VerifyMethodHandles) {
     verify_BoundMethodHandle_with_receiver(mh, m, CHECK);
   }
 
-  sun_dyn_BoundMethodHandle::set_vmtarget(mh(), m());
+  java_lang_invoke_BoundMethodHandle::set_vmtarget(mh(), m());
 
   DEBUG_ONLY(int junk; klassOop junk2);
   assert(MethodHandles::decode_method(mh(), junk2, junk) == m(), "properly stored for later decoding");
   assert(decode_MethodHandle_stack_pushes(mh()) == 1, "BMH pushes one stack slot");
 
   // Done!
-  java_dyn_MethodHandle::set_vmentry(mh(), MethodHandles::entry(MethodHandles::_bound_ref_direct_mh));
+  java_lang_invoke_MethodHandle::set_vmentry(mh(), MethodHandles::entry(MethodHandles::_bound_ref_direct_mh));
 }
 
 void MethodHandles::verify_BoundMethodHandle(Handle mh, Handle target, int argnum,
                                              bool direct_to_method, TRAPS) {
   Handle ptype_handle(THREAD,
-                           java_dyn_MethodType::ptype(java_dyn_MethodHandle::type(target()), argnum));
+                           java_lang_invoke_MethodType::ptype(java_lang_invoke_MethodHandle::type(target()), argnum));
   KlassHandle ptype_klass;
   BasicType ptype = java_lang_Class::as_BasicType(ptype_handle(), &ptype_klass);
   int slots_pushed = type2size[ptype];
 
-  oop argument = sun_dyn_BoundMethodHandle::argument(mh());
+  oop argument = java_lang_invoke_BoundMethodHandle::argument(mh());
 
   const char* err = NULL;
 
@@ -1623,9 +1624,9 @@
 
   if (err == NULL) {
     // Verify the rest of the method type.
-    err = check_method_type_insertion(java_dyn_MethodHandle::type(mh()),
+    err = check_method_type_insertion(java_lang_invoke_MethodHandle::type(mh()),
                                       argnum, ptype_handle(),
-                                      java_dyn_MethodHandle::type(target()));
+                                      java_lang_invoke_MethodHandle::type(target()));
   }
 
   if (err != NULL) {
@@ -1635,20 +1636,20 @@
 
 void MethodHandles::init_BoundMethodHandle(Handle mh, Handle target, int argnum, TRAPS) {
   // Check arguments.
-  if (mh.is_null() || target.is_null() || !java_dyn_MethodHandle::is_instance(target())) {
+  if (mh.is_null() || target.is_null() || !java_lang_invoke_MethodHandle::is_instance(target())) {
     THROW(vmSymbols::java_lang_InternalError());
   }
 
-  java_dyn_MethodHandle::init_vmslots(mh());
+  java_lang_invoke_MethodHandle::init_vmslots(mh());
 
   if (VerifyMethodHandles) {
     int insert_after = argnum - 1;
-    verify_vmargslot(mh, insert_after, sun_dyn_BoundMethodHandle::vmargslot(mh()), CHECK);
+    verify_vmargslot(mh, insert_after, java_lang_invoke_BoundMethodHandle::vmargslot(mh()), CHECK);
     verify_vmslots(mh, CHECK);
   }
 
   // Get bound type and required slots.
-  oop ptype_oop = java_dyn_MethodType::ptype(java_dyn_MethodHandle::type(target()), argnum);
+  oop ptype_oop = java_lang_invoke_MethodType::ptype(java_lang_invoke_MethodHandle::type(target()), argnum);
   BasicType ptype = java_lang_Class::as_BasicType(ptype_oop);
   int slots_pushed = type2size[ptype];
 
@@ -1659,12 +1660,12 @@
   bool direct_to_method = false;
   if (OptimizeMethodHandles &&
       target->klass() == SystemDictionary::DirectMethodHandle_klass() &&
-      (argnum == 0 || sun_dyn_DirectMethodHandle::vmindex(target()) < 0)) {
+      (argnum == 0 || java_lang_invoke_DirectMethodHandle::vmindex(target()) < 0)) {
     int decode_flags = 0; klassOop receiver_limit_oop = NULL;
     methodHandle m(THREAD, decode_method(target(), receiver_limit_oop, decode_flags));
     if (m.is_null()) { THROW_MSG(vmSymbols::java_lang_InternalError(), "DMH failed to decode"); }
     DEBUG_ONLY(int m_vmslots = m->size_of_parameters() - slots_pushed); // pos. of 1st arg.
-    assert(sun_dyn_BoundMethodHandle::vmslots(mh()) == m_vmslots, "type w/ m sig");
+    assert(java_lang_invoke_BoundMethodHandle::vmslots(mh()) == m_vmslots, "type w/ m sig");
     if (argnum == 0 && (decode_flags & _dmf_has_receiver) != 0) {
       KlassHandle receiver_limit(THREAD, receiver_limit_oop);
       init_BoundMethodHandle_with_receiver(mh, m,
@@ -1677,11 +1678,11 @@
     // to bind another argument and still invoke the methodOop directly.
     if (!(decode_flags & _dmf_does_dispatch)) {
       direct_to_method = true;
-      sun_dyn_BoundMethodHandle::set_vmtarget(mh(), m());
+      java_lang_invoke_BoundMethodHandle::set_vmtarget(mh(), m());
     }
   }
   if (!direct_to_method)
-    sun_dyn_BoundMethodHandle::set_vmtarget(mh(), target());
+    java_lang_invoke_BoundMethodHandle::set_vmtarget(mh(), target());
 
   if (VerifyMethodHandles) {
     verify_BoundMethodHandle(mh, target, argnum, direct_to_method, CHECK);
@@ -1703,7 +1704,7 @@
   }
 
   // Done!
-  java_dyn_MethodHandle::set_vmentry(mh(), me);
+  java_lang_invoke_MethodHandle::set_vmentry(mh(), me);
 }
 
 static void throw_InternalError_for_bad_conversion(int conversion, const char* err, TRAPS) {
@@ -1713,8 +1714,8 @@
 }
 
 void MethodHandles::verify_AdapterMethodHandle(Handle mh, int argnum, TRAPS) {
-  jint conversion = sun_dyn_AdapterMethodHandle::conversion(mh());
-  int  argslot    = sun_dyn_AdapterMethodHandle::vmargslot(mh());
+  jint conversion = java_lang_invoke_AdapterMethodHandle::conversion(mh());
+  int  argslot    = java_lang_invoke_AdapterMethodHandle::vmargslot(mh());
 
   verify_vmargslot(mh, argnum, argslot, CHECK);
   verify_vmslots(mh, CHECK);
@@ -1731,10 +1732,10 @@
   BasicType dest = adapter_conversion_dest_type(conversion);
   int vminfo     = adapter_conversion_vminfo(conversion); // should be zero
 
-  Handle argument(THREAD,  sun_dyn_AdapterMethodHandle::argument(mh()));
-  Handle target(THREAD,    sun_dyn_AdapterMethodHandle::vmtarget(mh()));
-  Handle src_mtype(THREAD, java_dyn_MethodHandle::type(mh()));
-  Handle dst_mtype(THREAD, java_dyn_MethodHandle::type(target()));
+  Handle argument(THREAD,  java_lang_invoke_AdapterMethodHandle::argument(mh()));
+  Handle target(THREAD,    java_lang_invoke_AdapterMethodHandle::vmtarget(mh()));
+  Handle src_mtype(THREAD, java_lang_invoke_MethodHandle::type(mh()));
+  Handle dst_mtype(THREAD, java_lang_invoke_MethodHandle::type(target()));
 
   const char* err = NULL;
 
@@ -1760,7 +1761,7 @@
       break;
     case _adapter_flyby:
     case _adapter_ricochet:
-      if (!java_dyn_MethodHandle::is_instance(argument()))
+      if (!java_lang_invoke_MethodHandle::is_instance(argument()))
         { err = "MethodHandle adapter argument required"; break; }
       break;
     default:
@@ -1806,9 +1807,9 @@
           err = "adapter requires src/dest conversion subfields for swap"; break;
         }
         int swap_size = type2size[src];
-        oop src_mtype  = sun_dyn_AdapterMethodHandle::type(mh());
-        oop dest_mtype = sun_dyn_AdapterMethodHandle::type(target());
-        int slot_limit = sun_dyn_AdapterMethodHandle::vmslots(target());
+        oop src_mtype  = java_lang_invoke_AdapterMethodHandle::type(mh());
+        oop dest_mtype = java_lang_invoke_AdapterMethodHandle::type(target());
+        int slot_limit = java_lang_invoke_AdapterMethodHandle::vmslots(target());
         int src_slot   = argslot;
         int dest_slot  = vminfo;
         bool rotate_up = (src_slot > dest_slot); // upward rotation
@@ -1821,8 +1822,8 @@
         } else if (ek == _adapter_swap_args && !(src_slot > dest_slot)) {
           err = "source of swap must be deeper in stack";
         } else if (ek == _adapter_swap_args) {
-          err = check_argument_type_change(java_dyn_MethodType::ptype(src_mtype, dest_arg),
-                                           java_dyn_MethodType::ptype(dest_mtype, src_arg),
+          err = check_argument_type_change(java_lang_invoke_MethodType::ptype(src_mtype, dest_arg),
+                                           java_lang_invoke_MethodType::ptype(dest_mtype, src_arg),
                                            dest_arg);
         } else if (ek == _adapter_rot_args) {
           if (rotate_up) {
@@ -1830,8 +1831,8 @@
             // rotate up: [dest_slot..src_slot-ss] --> [dest_slot+ss..src_slot]
             // that is:   [src_arg+1..dest_arg] --> [src_arg..dest_arg-1]
             for (int i = src_arg+1; i <= dest_arg && err == NULL; i++) {
-              err = check_argument_type_change(java_dyn_MethodType::ptype(src_mtype, i),
-                                               java_dyn_MethodType::ptype(dest_mtype, i-1),
+              err = check_argument_type_change(java_lang_invoke_MethodType::ptype(src_mtype, i),
+                                               java_lang_invoke_MethodType::ptype(dest_mtype, i-1),
                                                i);
             }
           } else { // rotate down
@@ -1839,15 +1840,15 @@
             // rotate down: [src_slot+ss..dest_slot] --> [src_slot..dest_slot-ss]
             // that is:     [dest_arg..src_arg-1] --> [dst_arg+1..src_arg]
             for (int i = dest_arg; i <= src_arg-1 && err == NULL; i++) {
-              err = check_argument_type_change(java_dyn_MethodType::ptype(src_mtype, i),
-                                               java_dyn_MethodType::ptype(dest_mtype, i+1),
+              err = check_argument_type_change(java_lang_invoke_MethodType::ptype(src_mtype, i),
+                                               java_lang_invoke_MethodType::ptype(dest_mtype, i+1),
                                                i);
             }
           }
         }
         if (err == NULL)
-          err = check_argument_type_change(java_dyn_MethodType::ptype(src_mtype, src_arg),
-                                           java_dyn_MethodType::ptype(dest_mtype, dest_arg),
+          err = check_argument_type_change(java_lang_invoke_MethodType::ptype(src_mtype, src_arg),
+                                           java_lang_invoke_MethodType::ptype(dest_mtype, dest_arg),
                                            src_arg);
       }
       break;
@@ -1918,8 +1919,8 @@
   if (err == NULL) {
     // Make sure this adapter does not push too deeply.
     int slots_pushed = stack_move / stack_move_unit();
-    int this_vmslots = java_dyn_MethodHandle::vmslots(mh());
-    int target_vmslots = java_dyn_MethodHandle::vmslots(target());
+    int this_vmslots = java_lang_invoke_MethodHandle::vmslots(mh());
+    int target_vmslots = java_lang_invoke_MethodHandle::vmslots(target());
     if (slots_pushed != (target_vmslots - this_vmslots)) {
       err = "stack_move inconsistent with previous and current MethodType vmslots";
     } else if (slots_pushed > 0)  {
@@ -1961,7 +1962,7 @@
     case _adapter_check_cast:
       {
         // The actual value being checked must be a reference:
-        err = check_argument_type_change(java_dyn_MethodType::ptype(src_mtype(), argnum),
+        err = check_argument_type_change(java_lang_invoke_MethodType::ptype(src_mtype(), argnum),
                                          object_java_mirror(), argnum);
         if (err != NULL)  break;
 
@@ -1985,9 +1986,9 @@
 }
 
 void MethodHandles::init_AdapterMethodHandle(Handle mh, Handle target, int argnum, TRAPS) {
-  oop  argument   = sun_dyn_AdapterMethodHandle::argument(mh());
-  int  argslot    = sun_dyn_AdapterMethodHandle::vmargslot(mh());
-  jint conversion = sun_dyn_AdapterMethodHandle::conversion(mh());
+  oop  argument   = java_lang_invoke_AdapterMethodHandle::argument(mh());
+  int  argslot    = java_lang_invoke_AdapterMethodHandle::vmargslot(mh());
+  jint conversion = java_lang_invoke_AdapterMethodHandle::conversion(mh());
   jint conv_op    = adapter_conversion_op(conversion);
 
   // adjust the adapter code to the internal EntryKind enumeration:
@@ -1995,11 +1996,11 @@
   EntryKind ek_opt  = ek_orig;  // may be optimized
 
   // Finalize the vmtarget field (Java initialized it to null).
-  if (!java_dyn_MethodHandle::is_instance(target())) {
+  if (!java_lang_invoke_MethodHandle::is_instance(target())) {
     throw_InternalError_for_bad_conversion(conversion, "bad target", THREAD);
     return;
   }
-  sun_dyn_AdapterMethodHandle::set_vmtarget(mh(), target());
+  java_lang_invoke_AdapterMethodHandle::set_vmtarget(mh(), target());
 
   if (VerifyMethodHandles) {
     verify_AdapterMethodHandle(mh, argnum, CHECK);
@@ -2083,7 +2084,7 @@
   case _adapter_rot_args:
     {
       int swap_slots = type2size[src];
-      int slot_limit = sun_dyn_AdapterMethodHandle::vmslots(mh());
+      int slot_limit = java_lang_invoke_AdapterMethodHandle::vmslots(mh());
       int src_slot   = argslot;
       int dest_slot  = vminfo;
       int rotate     = (ek_orig == _adapter_swap_args) ? 0 : (src_slot > dest_slot) ? 1 : -1;
@@ -2147,10 +2148,10 @@
   jint new_conversion = adapter_conversion(conv_op, src, dest, stack_move, vminfo);
 
   // Finalize the conversion field.  (Note that it is final to Java code.)
-  sun_dyn_AdapterMethodHandle::set_conversion(mh(), new_conversion);
+  java_lang_invoke_AdapterMethodHandle::set_conversion(mh(), new_conversion);
 
   // Done!
-  java_dyn_MethodHandle::set_vmentry(mh(), entry(ek_opt));
+  java_lang_invoke_MethodHandle::set_vmentry(mh(), entry(ek_opt));
 
   // There should be enough memory barriers on exit from native methods
   // to ensure that the MH is fully initialized to all threads before
@@ -2158,7 +2159,7 @@
 }
 
 //
-// Here are the native methods on sun.dyn.MethodHandleImpl.
+// Here are the native methods on sun.invoke.MethodHandleImpl.
 // They are the private interface between this JVM and the HotSpot-specific
 // Java code that implements JSR 292 method handles.
 //
@@ -2168,7 +2169,7 @@
 
 // direct method handles for invokestatic or invokespecial
 // void init(DirectMethodHandle self, MemberName ref, boolean doDispatch, Class<?> caller);
-JVM_ENTRY(void, MHI_init_DMH(JNIEnv *env, jobject igcls, jobject mh_jh,
+JVM_ENTRY(void, MHN_init_DMH(JNIEnv *env, jobject igcls, jobject mh_jh,
                              jobject target_jh, jboolean do_dispatch, jobject caller_jh)) {
   ResourceMark rm;              // for error messages
 
@@ -2177,13 +2178,13 @@
   Handle mh(THREAD, JNIHandles::resolve_non_null(mh_jh));
 
   // Early returns out of this method leave the DMH in an unfinished state.
-  assert(java_dyn_MethodHandle::vmentry(mh()) == NULL, "must be safely null");
+  assert(java_lang_invoke_MethodHandle::vmentry(mh()) == NULL, "must be safely null");
 
   // which method are we really talking about?
   if (target_jh == NULL) { THROW(vmSymbols::java_lang_InternalError()); }
   oop target_oop = JNIHandles::resolve_non_null(target_jh);
-  if (sun_dyn_MemberName::is_instance(target_oop) &&
-      sun_dyn_MemberName::vmindex(target_oop) == VM_INDEX_UNINITIALIZED) {
+  if (java_lang_invoke_MemberName::is_instance(target_oop) &&
+      java_lang_invoke_MemberName::vmindex(target_oop) == VM_INDEX_UNINITIALIZED) {
     Handle mname(THREAD, target_oop);
     MethodHandles::resolve_MemberName(mname, CHECK);
     target_oop = mname(); // in case of GC
@@ -2232,7 +2233,7 @@
 JVM_END
 
 // bound method handles
-JVM_ENTRY(void, MHI_init_BMH(JNIEnv *env, jobject igcls, jobject mh_jh,
+JVM_ENTRY(void, MHN_init_BMH(JNIEnv *env, jobject igcls, jobject mh_jh,
                              jobject target_jh, int argnum)) {
   ResourceMark rm;              // for error messages
 
@@ -2241,12 +2242,12 @@
   Handle mh(THREAD, JNIHandles::resolve_non_null(mh_jh));
 
   // Early returns out of this method leave the BMH in an unfinished state.
-  assert(java_dyn_MethodHandle::vmentry(mh()) == NULL, "must be safely null");
+  assert(java_lang_invoke_MethodHandle::vmentry(mh()) == NULL, "must be safely null");
 
   if (target_jh == NULL) { THROW(vmSymbols::java_lang_InternalError()); }
   Handle target(THREAD, JNIHandles::resolve_non_null(target_jh));
 
-  if (!java_dyn_MethodHandle::is_instance(target())) {
+  if (!java_lang_invoke_MethodHandle::is_instance(target())) {
     // Target object is a reflective method.  (%%% Do we need this alternate path?)
     Untested("init_BMH of non-MH");
     if (argnum != 0) { THROW(vmSymbols::java_lang_InternalError()); }
@@ -2269,7 +2270,7 @@
 JVM_END
 
 // adapter method handles
-JVM_ENTRY(void, MHI_init_AMH(JNIEnv *env, jobject igcls, jobject mh_jh,
+JVM_ENTRY(void, MHN_init_AMH(JNIEnv *env, jobject igcls, jobject mh_jh,
                              jobject target_jh, int argnum)) {
   // This is the guy we are initializing:
   if (mh_jh == NULL || target_jh == NULL) {
@@ -2279,14 +2280,14 @@
   Handle target(THREAD, JNIHandles::resolve_non_null(target_jh));
 
   // Early returns out of this method leave the AMH in an unfinished state.
-  assert(java_dyn_MethodHandle::vmentry(mh()) == NULL, "must be safely null");
+  assert(java_lang_invoke_MethodHandle::vmentry(mh()) == NULL, "must be safely null");
 
   MethodHandles::init_AdapterMethodHandle(mh, target, argnum, CHECK);
 }
 JVM_END
 
 // method type forms
-JVM_ENTRY(void, MHI_init_MT(JNIEnv *env, jobject igcls, jobject erased_jh)) {
+JVM_ENTRY(void, MHN_init_MT(JNIEnv *env, jobject igcls, jobject erased_jh)) {
   if (erased_jh == NULL)  return;
   if (TraceMethodHandles) {
     tty->print("creating MethodType form ");
@@ -2307,9 +2308,9 @@
 JVM_END
 
 // debugging and reflection
-JVM_ENTRY(jobject, MHI_getTarget(JNIEnv *env, jobject igcls, jobject mh_jh, jint format)) {
+JVM_ENTRY(jobject, MHN_getTarget(JNIEnv *env, jobject igcls, jobject mh_jh, jint format)) {
   Handle mh(THREAD, JNIHandles::resolve(mh_jh));
-  if (!java_dyn_MethodHandle::is_instance(mh())) {
+  if (!java_lang_invoke_MethodHandle::is_instance(mh())) {
     THROW_NULL(vmSymbols::java_lang_IllegalArgumentException());
   }
   oop target = MethodHandles::encode_target(mh, format, CHECK_NULL);
@@ -2317,7 +2318,7 @@
 }
 JVM_END
 
-JVM_ENTRY(jint, MHI_getConstant(JNIEnv *env, jobject igcls, jint which)) {
+JVM_ENTRY(jint, MHN_getConstant(JNIEnv *env, jobject igcls, jint which)) {
   switch (which) {
   case MethodHandles::GC_JVM_PUSH_LIMIT:
     guarantee(MethodHandlePushLimit >= 2 && MethodHandlePushLimit <= 0xFF,
@@ -2341,36 +2342,36 @@
     template(MethodHandles,ETF_DIRECT_HANDLE) \
     template(MethodHandles,ETF_METHOD_NAME) \
     template(MethodHandles,ETF_REFLECT_METHOD) \
-    template(sun_dyn_MemberName,MN_IS_METHOD) \
-    template(sun_dyn_MemberName,MN_IS_CONSTRUCTOR) \
-    template(sun_dyn_MemberName,MN_IS_FIELD) \
-    template(sun_dyn_MemberName,MN_IS_TYPE) \
-    template(sun_dyn_MemberName,MN_SEARCH_SUPERCLASSES) \
-    template(sun_dyn_MemberName,MN_SEARCH_INTERFACES) \
-    template(sun_dyn_MemberName,VM_INDEX_UNINITIALIZED) \
-    template(sun_dyn_AdapterMethodHandle,OP_RETYPE_ONLY) \
-    template(sun_dyn_AdapterMethodHandle,OP_RETYPE_RAW) \
-    template(sun_dyn_AdapterMethodHandle,OP_CHECK_CAST) \
-    template(sun_dyn_AdapterMethodHandle,OP_PRIM_TO_PRIM) \
-    template(sun_dyn_AdapterMethodHandle,OP_REF_TO_PRIM) \
-    template(sun_dyn_AdapterMethodHandle,OP_PRIM_TO_REF) \
-    template(sun_dyn_AdapterMethodHandle,OP_SWAP_ARGS) \
-    template(sun_dyn_AdapterMethodHandle,OP_ROT_ARGS) \
-    template(sun_dyn_AdapterMethodHandle,OP_DUP_ARGS) \
-    template(sun_dyn_AdapterMethodHandle,OP_DROP_ARGS) \
-    template(sun_dyn_AdapterMethodHandle,OP_COLLECT_ARGS) \
-    template(sun_dyn_AdapterMethodHandle,OP_SPREAD_ARGS) \
-    template(sun_dyn_AdapterMethodHandle,OP_FLYBY) \
-    template(sun_dyn_AdapterMethodHandle,OP_RICOCHET) \
-    template(sun_dyn_AdapterMethodHandle,CONV_OP_LIMIT) \
-    template(sun_dyn_AdapterMethodHandle,CONV_OP_MASK) \
-    template(sun_dyn_AdapterMethodHandle,CONV_VMINFO_MASK) \
-    template(sun_dyn_AdapterMethodHandle,CONV_VMINFO_SHIFT) \
-    template(sun_dyn_AdapterMethodHandle,CONV_OP_SHIFT) \
-    template(sun_dyn_AdapterMethodHandle,CONV_DEST_TYPE_SHIFT) \
-    template(sun_dyn_AdapterMethodHandle,CONV_SRC_TYPE_SHIFT) \
-    template(sun_dyn_AdapterMethodHandle,CONV_STACK_MOVE_SHIFT) \
-    template(sun_dyn_AdapterMethodHandle,CONV_STACK_MOVE_MASK) \
+    template(java_lang_invoke_MemberName,MN_IS_METHOD) \
+    template(java_lang_invoke_MemberName,MN_IS_CONSTRUCTOR) \
+    template(java_lang_invoke_MemberName,MN_IS_FIELD) \
+    template(java_lang_invoke_MemberName,MN_IS_TYPE) \
+    template(java_lang_invoke_MemberName,MN_SEARCH_SUPERCLASSES) \
+    template(java_lang_invoke_MemberName,MN_SEARCH_INTERFACES) \
+    template(java_lang_invoke_MemberName,VM_INDEX_UNINITIALIZED) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_RETYPE_ONLY) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_RETYPE_RAW) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_CHECK_CAST) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_PRIM_TO_PRIM) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_REF_TO_PRIM) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_PRIM_TO_REF) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_SWAP_ARGS) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_ROT_ARGS) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_DUP_ARGS) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_DROP_ARGS) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_COLLECT_ARGS) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_SPREAD_ARGS) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_FLYBY) \
+    template(java_lang_invoke_AdapterMethodHandle,OP_RICOCHET) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_OP_LIMIT) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_OP_MASK) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_VMINFO_MASK) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_VMINFO_SHIFT) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_OP_SHIFT) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_DEST_TYPE_SHIFT) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_SRC_TYPE_SHIFT) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_STACK_MOVE_SHIFT) \
+    template(java_lang_invoke_AdapterMethodHandle,CONV_STACK_MOVE_MASK) \
     /*end*/
 
 #define ONE_PLUS(scope,value) 1+
@@ -2386,7 +2387,7 @@
 #undef EACH_NAMED_CON
 #endif
 
-JVM_ENTRY(jint, MHI_getNamedCon(JNIEnv *env, jobject igcls, jint which, jobjectArray box_jh)) {
+JVM_ENTRY(jint, MHN_getNamedCon(JNIEnv *env, jobject igcls, jint which, jobjectArray box_jh)) {
 #ifndef PRODUCT
   if (which >= 0 && which < con_value_count) {
     int con = con_values[which];
@@ -2406,7 +2407,7 @@
 JVM_END
 
 // void init(MemberName self, AccessibleObject ref)
-JVM_ENTRY(void, MHI_init_Mem(JNIEnv *env, jobject igcls, jobject mname_jh, jobject target_jh)) {
+JVM_ENTRY(void, MHN_init_Mem(JNIEnv *env, jobject igcls, jobject mname_jh, jobject target_jh)) {
   if (mname_jh == NULL || target_jh == NULL) { THROW(vmSymbols::java_lang_InternalError()); }
   Handle mname(THREAD, JNIHandles::resolve_non_null(mname_jh));
   oop target_oop = JNIHandles::resolve_non_null(target_jh);
@@ -2415,7 +2416,7 @@
 JVM_END
 
 // void expand(MemberName self)
-JVM_ENTRY(void, MHI_expand_Mem(JNIEnv *env, jobject igcls, jobject mname_jh)) {
+JVM_ENTRY(void, MHN_expand_Mem(JNIEnv *env, jobject igcls, jobject mname_jh)) {
   if (mname_jh == NULL) { THROW(vmSymbols::java_lang_InternalError()); }
   Handle mname(THREAD, JNIHandles::resolve_non_null(mname_jh));
   MethodHandles::expand_MemberName(mname, 0, CHECK);
@@ -2423,14 +2424,14 @@
 JVM_END
 
 // void resolve(MemberName self, Class<?> caller)
-JVM_ENTRY(void, MHI_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh, jclass caller_jh)) {
+JVM_ENTRY(void, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh, jclass caller_jh)) {
   if (mname_jh == NULL) { THROW(vmSymbols::java_lang_InternalError()); }
   Handle mname(THREAD, JNIHandles::resolve_non_null(mname_jh));
 
   // The trusted Java code that calls this method should already have performed
   // access checks on behalf of the given caller.  But, we can verify this.
   if (VerifyMethodHandles && caller_jh != NULL) {
-    klassOop reference_klass = java_lang_Class::as_klassOop(sun_dyn_MemberName::clazz(mname()));
+    klassOop reference_klass = java_lang_Class::as_klassOop(java_lang_invoke_MemberName::clazz(mname()));
     if (reference_klass != NULL) {
       // Emulate LinkResolver::check_klass_accessability.
       klassOop caller = java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(caller_jh));
@@ -2448,7 +2449,7 @@
 
 //  static native int getMembers(Class<?> defc, String matchName, String matchSig,
 //          int matchFlags, Class<?> caller, int skip, MemberName[] results);
-JVM_ENTRY(jint, MHI_getMembers(JNIEnv *env, jobject igcls,
+JVM_ENTRY(jint, MHN_getMembers(JNIEnv *env, jobject igcls,
                                jclass clazz_jh, jstring name_jh, jstring sig_jh,
                                int mflags, jclass caller_jh, jint skip, jobjectArray results_jh)) {
   if (clazz_jh == NULL || results_jh == NULL)  return -1;
@@ -2487,14 +2488,14 @@
 }
 JVM_END
 
-JVM_ENTRY(void, MHI_registerBootstrap(JNIEnv *env, jobject igcls, jclass caller_jh, jobject bsm_jh)) {
+JVM_ENTRY(void, MHN_registerBootstrap(JNIEnv *env, jobject igcls, jclass caller_jh, jobject bsm_jh)) {
   instanceKlassHandle ik = MethodHandles::resolve_instance_klass(caller_jh, THREAD);
   if (!AllowTransitionalJSR292) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "registerBootstrapMethod is only supported in JSR 292 EDR");
   }
   ik->link_class(CHECK);
-  if (!java_dyn_MethodHandle::is_instance(JNIHandles::resolve(bsm_jh))) {
+  if (!java_lang_invoke_MethodHandle::is_instance(JNIHandles::resolve(bsm_jh))) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "method handle");
   }
   const char* err = NULL;
@@ -2522,29 +2523,28 @@
 }
 JVM_END
 
-JVM_ENTRY(jobject, MHI_getBootstrap(JNIEnv *env, jobject igcls, jclass caller_jh)) {
+JVM_ENTRY(jobject, MHN_getBootstrap(JNIEnv *env, jobject igcls, jclass caller_jh)) {
+  if (!AllowTransitionalJSR292)
+    THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(), "getBootstrap: transitional only");
   instanceKlassHandle ik = MethodHandles::resolve_instance_klass(caller_jh, THREAD);
   return JNIHandles::make_local(THREAD, ik->bootstrap_method());
 }
 JVM_END
 
-JVM_ENTRY(void, MHI_setCallSiteTarget(JNIEnv *env, jobject igcls, jobject site_jh, jobject target_jh)) {
-  // No special action required, yet.
-  oop site_oop = JNIHandles::resolve(site_jh);
-  if (!java_dyn_CallSite::is_instance(site_oop))
-    THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "not a CallSite");
-  java_dyn_CallSite::set_target(site_oop, JNIHandles::resolve(target_jh));
+JVM_ENTRY(void, MHN_setCallSiteTarget(JNIEnv *env, jobject igcls, jobject site_jh, jobject target_jh)) {
+  if (!AllowTransitionalJSR292)
+    THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "setCallSite: transitional only");
 }
 JVM_END
 
 
 /// JVM_RegisterMethodHandleMethods
 
-#define ADR "J"
-
 #define LANG "Ljava/lang/"
-#define JDYN "Ljava/dyn/"
-#define IDYN "Lsun/dyn/"
+#define JLINV "Ljava/lang/invoke/" /* standard package */
+#define JDYN "Ljava/dyn/" /* alternative package to JLINV if AllowTransitionalJSR292 */
+#define IDYN "Lsun/dyn/"  /* alternative package to JDYN if AllowTransitionalJSR292 */
+// FIXME: After AllowTransitionalJSR292 is removed, replace JDYN and IDYN by JLINV.
 
 #define OBJ   LANG"Object;"
 #define CLS   LANG"Class;"
@@ -2552,7 +2552,6 @@
 #define CST   JDYN"CallSite;"
 #define MT    JDYN"MethodType;"
 #define MH    JDYN"MethodHandle;"
-#define MHI   IDYN"MethodHandleImpl;"
 #define MEM   IDYN"MemberName;"
 #define AMH   IDYN"AdapterMethodHandle;"
 #define BMH   IDYN"BoundMethodHandle;"
@@ -2561,32 +2560,58 @@
 #define CC (char*)  /*cast a literal from (const char*)*/
 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
 
-// These are the native methods on sun.dyn.MethodHandleNatives.
+// These are the native methods on sun.invoke.MethodHandleNatives.
 static JNINativeMethod methods[] = {
   // void init(MemberName self, AccessibleObject ref)
-  {CC"init",                    CC"("AMH""MH"I)V",              FN_PTR(MHI_init_AMH)},
-  {CC"init",                    CC"("BMH""OBJ"I)V",             FN_PTR(MHI_init_BMH)},
-  {CC"init",                    CC"("DMH""OBJ"Z"CLS")V",        FN_PTR(MHI_init_DMH)},
-  {CC"init",                    CC"("MT")V",                    FN_PTR(MHI_init_MT)},
-  {CC"init",                    CC"("MEM""OBJ")V",              FN_PTR(MHI_init_Mem)},
-  {CC"expand",                  CC"("MEM")V",                   FN_PTR(MHI_expand_Mem)},
-  {CC"resolve",                 CC"("MEM""CLS")V",              FN_PTR(MHI_resolve_Mem)},
-  {CC"getTarget",               CC"("MH"I)"OBJ,                 FN_PTR(MHI_getTarget)},
-  {CC"getConstant",             CC"(I)I",                       FN_PTR(MHI_getConstant)},
+  {CC"init",                    CC"("AMH""MH"I)V",              FN_PTR(MHN_init_AMH)},
+  {CC"init",                    CC"("BMH""OBJ"I)V",             FN_PTR(MHN_init_BMH)},
+  {CC"init",                    CC"("DMH""OBJ"Z"CLS")V",        FN_PTR(MHN_init_DMH)},
+  {CC"init",                    CC"("MT")V",                    FN_PTR(MHN_init_MT)},
+  {CC"init",                    CC"("MEM""OBJ")V",              FN_PTR(MHN_init_Mem)},
+  {CC"expand",                  CC"("MEM")V",                   FN_PTR(MHN_expand_Mem)},
+  {CC"resolve",                 CC"("MEM""CLS")V",              FN_PTR(MHN_resolve_Mem)},
+  {CC"getTarget",               CC"("MH"I)"OBJ,                 FN_PTR(MHN_getTarget)},
+  {CC"getConstant",             CC"(I)I",                       FN_PTR(MHN_getConstant)},
   //  static native int getNamedCon(int which, Object[] name)
-  {CC"getNamedCon",             CC"(I["OBJ")I",                 FN_PTR(MHI_getNamedCon)},
+  {CC"getNamedCon",             CC"(I["OBJ")I",                 FN_PTR(MHN_getNamedCon)},
   //  static native int getMembers(Class<?> defc, String matchName, String matchSig,
   //          int matchFlags, Class<?> caller, int skip, MemberName[] results);
-  {CC"getMembers",              CC"("CLS""STRG""STRG"I"CLS"I["MEM")I",  FN_PTR(MHI_getMembers)}
+  {CC"getMembers",              CC"("CLS""STRG""STRG"I"CLS"I["MEM")I",  FN_PTR(MHN_getMembers)}
 };
 
 // More entry points specifically for EnableInvokeDynamic.
+// FIXME: Remove methods2 after AllowTransitionalJSR292 is removed.
 static JNINativeMethod methods2[] = {
-  {CC"registerBootstrap",       CC"("CLS MH")V",                FN_PTR(MHI_registerBootstrap)},
-  {CC"getBootstrap",            CC"("CLS")"MH,                  FN_PTR(MHI_getBootstrap)},
-  {CC"setCallSiteTarget",       CC"("CST MH")V",                FN_PTR(MHI_setCallSiteTarget)}
+  {CC"registerBootstrap",       CC"("CLS MH")V",                FN_PTR(MHN_registerBootstrap)},
+  {CC"getBootstrap",            CC"("CLS")"MH,                  FN_PTR(MHN_getBootstrap)},
+  {CC"setCallSiteTarget",       CC"("CST MH")V",                FN_PTR(MHN_setCallSiteTarget)}
 };
 
+static void hack_signatures(JNINativeMethod* methods, jint num_methods, const char* from_sig, const char* to_sig) {
+  for (int i = 0; i < num_methods; i++) {
+    const char* sig = methods[i].signature;
+    if (!strstr(sig, from_sig))  continue;
+    size_t buflen = strlen(sig) + 100;
+    char* buf = NEW_C_HEAP_ARRAY(char, buflen);
+    char* bufp = buf;
+    const char* sigp = sig;
+    size_t from_len = strlen(from_sig), to_len = strlen(to_sig);
+    while (*sigp != '\0') {
+      assert(bufp < buf + buflen - to_len - 1, "oob");
+      if (strncmp(sigp, from_sig, from_len) != 0) {
+        *bufp++ = *sigp++;
+      } else {
+        strcpy(bufp, to_sig);
+        bufp += to_len;
+        sigp += from_len;
+      }
+    }
+    *bufp = '\0';
+    methods[i].signature = buf;  // replace with new signature
+    if (TraceMethodHandles)
+      tty->print_cr("MethodHandleNatives: %s: change signature %s => %s", methods[i].name, sig, buf);
+  }
+}
 
 // This one function is exported, used by NativeLookup.
 
@@ -2600,45 +2625,78 @@
     return;  // bind nothing
   }
 
+  if (SystemDictionary::MethodHandleNatives_klass() != NULL &&
+      SystemDictionary::MethodHandleNatives_klass() != java_lang_Class::as_klassOop(JNIHandles::resolve(MHN_class))) {
+    warning("multiple versions of MethodHandleNatives in boot classpath; consider using -XX:+PreferTransitionalJSR292");
+    THROW_MSG(vmSymbols::java_lang_InternalError(), "multiple versions of MethodHandleNatives in boot classpath; consider using -XX:+PreferTransitionalJSR292");
+  }
+
   bool enable_MH = true;
 
-  {
+  // Loop control.  FIXME: Replace by dead reckoning after AllowTransitionalJSR292 is removed.
+  bool registered_natives = false;
+  bool try_plain = true, try_JDYN = true, try_IDYN = true;
+  for (;;) {
     ThreadToNativeFromVM ttnfv(thread);
 
+    if      (try_plain) { try_plain = false; }
+    else if (try_JDYN)  { try_JDYN  = false; hack_signatures(methods, sizeof(methods)/sizeof(JNINativeMethod), IDYN, JDYN); }
+    else if (try_IDYN)  { try_IDYN  = false; hack_signatures(methods, sizeof(methods)/sizeof(JNINativeMethod), JDYN, JLINV); }
+    else                { break; }
     int status = env->RegisterNatives(MHN_class, methods, sizeof(methods)/sizeof(JNINativeMethod));
     if (env->ExceptionOccurred()) {
-      MethodHandles::set_enabled(false);
-      warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
-      enable_MH = false;
       env->ExceptionClear();
+      // and try again...
+    } else {
+      registered_natives = true;
+      break;
     }
   }
+  if (!registered_natives) {
+    MethodHandles::set_enabled(false);
+    warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
+    enable_MH = false;
+  }
 
   if (enable_MH) {
+    bool found_raise_exception = false;
+    KlassHandle MHN_klass = SystemDictionaryHandles::MethodHandleNatives_klass();
     KlassHandle MHI_klass = SystemDictionaryHandles::MethodHandleImpl_klass();
-    if (MHI_klass.not_null()) {
+    // Loop control.  FIXME: Replace by dead reckoning after AllowTransitionalJSR292 is removed.
+    bool try_MHN = true, try_MHI = AllowTransitionalJSR292;
+    for (;;) {
+      KlassHandle try_klass;
+      if      (try_MHN) { try_MHN = false; try_klass = MHN_klass; }
+      else if (try_MHI) { try_MHI = false; try_klass = MHI_klass; }
+      else              { break; }
+      if (try_klass.is_null())  continue;
       TempNewSymbol raiseException_name = SymbolTable::new_symbol("raiseException", CHECK);
       TempNewSymbol raiseException_sig = SymbolTable::new_symbol("(ILjava/lang/Object;Ljava/lang/Object;)V", CHECK);
-      methodOop raiseException_method  = instanceKlass::cast(MHI_klass->as_klassOop())
+      methodOop raiseException_method  = instanceKlass::cast(try_klass->as_klassOop())
                     ->find_method(raiseException_name, raiseException_sig);
       if (raiseException_method != NULL && raiseException_method->is_static()) {
         MethodHandles::set_raise_exception_method(raiseException_method);
-      } else {
-        warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
-        enable_MH = false;
+        found_raise_exception = true;
+        break;
       }
-    } else {
+    }
+    if (!found_raise_exception) {
+      warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
       enable_MH = false;
     }
   }
 
   if (enable_MH) {
-    // We need to link the MethodHandleImpl klass before we generate
-    // the method handle adapters as the _raise_exception adapter uses
-    // one of its methods (and its c2i-adapter).
-    KlassHandle    k  = SystemDictionaryHandles::MethodHandleImpl_klass();
-    instanceKlass* ik = instanceKlass::cast(k());
-    ik->link_class(CHECK);
+    if (AllowTransitionalJSR292) {
+      // We need to link the MethodHandleImpl klass before we generate
+      // the method handle adapters as the _raise_exception adapter uses
+      // one of its methods (and its c2i-adapter).
+      klassOop k = SystemDictionary::MethodHandleImpl_klass();
+      if (k != NULL) {
+        instanceKlass* ik = instanceKlass::cast(k);
+        ik->link_class(CHECK);
+      }
+    }
 
     MethodHandles::generate_adapters();
     MethodHandles::set_enabled(true);
@@ -2649,16 +2707,14 @@
     return;  // bind nothing
   }
 
-  {
+  if (AllowTransitionalJSR292) {
     ThreadToNativeFromVM ttnfv(thread);
 
     int status = env->RegisterNatives(MHN_class, methods2, sizeof(methods2)/sizeof(JNINativeMethod));
     if (env->ExceptionOccurred()) {
-      MethodHandles::set_enabled(false);
-      warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
+      // Don't do this, since it's too late:
+      //   MethodHandles::set_enabled(false)
       env->ExceptionClear();
-    } else {
-      MethodHandles::set_enabled(true);
     }
   }
 }
--- a/hotspot/src/share/vm/prims/methodHandles.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/methodHandles.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -37,8 +37,8 @@
 
 class MethodHandles: AllStatic {
   // JVM support for MethodHandle, MethodType, and related types
-  // in java.dyn and java.dyn.hotspot.
-  // See also  javaClasses for layouts java_dyn_Method{Handle,Type,Type::Form}.
+  // in java.lang.invoke and sun.invoke.
+  // See also  javaClasses for layouts java_lang_invoke_Method{Handle,Type,Type::Form}.
  public:
   enum EntryKind {
     _raise_exception,           // stub for error generation from other stubs
@@ -54,21 +54,21 @@
     _bound_long_direct_mh,
 
     _adapter_mh_first,     // adapter sequence goes here...
-    _adapter_retype_only   = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY,
-    _adapter_retype_raw    = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW,
-    _adapter_check_cast    = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_CHECK_CAST,
-    _adapter_prim_to_prim  = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM,
-    _adapter_ref_to_prim   = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM,
-    _adapter_prim_to_ref   = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_PRIM_TO_REF,
-    _adapter_swap_args     = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS,
-    _adapter_rot_args      = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_ROT_ARGS,
-    _adapter_dup_args      = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_DUP_ARGS,
-    _adapter_drop_args     = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_DROP_ARGS,
-    _adapter_collect_args  = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_COLLECT_ARGS,
-    _adapter_spread_args   = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS,
-    _adapter_flyby         = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_FLYBY,
-    _adapter_ricochet      = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_RICOCHET,
-    _adapter_mh_last       = _adapter_mh_first + sun_dyn_AdapterMethodHandle::CONV_OP_LIMIT - 1,
+    _adapter_retype_only   = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY,
+    _adapter_retype_raw    = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW,
+    _adapter_check_cast    = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST,
+    _adapter_prim_to_prim  = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM,
+    _adapter_ref_to_prim   = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM,
+    _adapter_prim_to_ref   = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF,
+    _adapter_swap_args     = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS,
+    _adapter_rot_args      = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS,
+    _adapter_dup_args      = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS,
+    _adapter_drop_args     = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS,
+    _adapter_collect_args  = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS,
+    _adapter_spread_args   = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS,
+    _adapter_flyby         = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_FLYBY,
+    _adapter_ricochet      = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_RICOCHET,
+    _adapter_mh_last       = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::CONV_OP_LIMIT - 1,
 
     // Optimized adapter types
 
@@ -107,16 +107,16 @@
   static void set_enabled(bool z);
 
  private:
-  enum {  // import sun_dyn_AdapterMethodHandle::CONV_OP_*
-    CONV_OP_LIMIT         = sun_dyn_AdapterMethodHandle::CONV_OP_LIMIT,
-    CONV_OP_MASK          = sun_dyn_AdapterMethodHandle::CONV_OP_MASK,
-    CONV_VMINFO_MASK      = sun_dyn_AdapterMethodHandle::CONV_VMINFO_MASK,
-    CONV_VMINFO_SHIFT     = sun_dyn_AdapterMethodHandle::CONV_VMINFO_SHIFT,
-    CONV_OP_SHIFT         = sun_dyn_AdapterMethodHandle::CONV_OP_SHIFT,
-    CONV_DEST_TYPE_SHIFT  = sun_dyn_AdapterMethodHandle::CONV_DEST_TYPE_SHIFT,
-    CONV_SRC_TYPE_SHIFT   = sun_dyn_AdapterMethodHandle::CONV_SRC_TYPE_SHIFT,
-    CONV_STACK_MOVE_SHIFT = sun_dyn_AdapterMethodHandle::CONV_STACK_MOVE_SHIFT,
-    CONV_STACK_MOVE_MASK  = sun_dyn_AdapterMethodHandle::CONV_STACK_MOVE_MASK
+  enum {  // import java_lang_invoke_AdapterMethodHandle::CONV_OP_*
+    CONV_OP_LIMIT         = java_lang_invoke_AdapterMethodHandle::CONV_OP_LIMIT,
+    CONV_OP_MASK          = java_lang_invoke_AdapterMethodHandle::CONV_OP_MASK,
+    CONV_VMINFO_MASK      = java_lang_invoke_AdapterMethodHandle::CONV_VMINFO_MASK,
+    CONV_VMINFO_SHIFT     = java_lang_invoke_AdapterMethodHandle::CONV_VMINFO_SHIFT,
+    CONV_OP_SHIFT         = java_lang_invoke_AdapterMethodHandle::CONV_OP_SHIFT,
+    CONV_DEST_TYPE_SHIFT  = java_lang_invoke_AdapterMethodHandle::CONV_DEST_TYPE_SHIFT,
+    CONV_SRC_TYPE_SHIFT   = java_lang_invoke_AdapterMethodHandle::CONV_SRC_TYPE_SHIFT,
+    CONV_STACK_MOVE_SHIFT = java_lang_invoke_AdapterMethodHandle::CONV_STACK_MOVE_SHIFT,
+    CONV_STACK_MOVE_MASK  = java_lang_invoke_AdapterMethodHandle::CONV_STACK_MOVE_MASK
   };
 
   static bool _enabled;
@@ -471,7 +471,7 @@
 };
 
 
-// Access methods for the "entry" field of a java.dyn.MethodHandle.
+// Access methods for the "entry" field of a java.lang.invoke.MethodHandle.
 // The field is primarily a jump target for compiled calls.
 // However, we squirrel away some nice pointers for other uses,
 // just before the jump target.
--- a/hotspot/src/share/vm/prims/nativeLookup.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/nativeLookup.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,29 +107,30 @@
   void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass);
 }
 
+#define CC (char*)  /* cast a literal from (const char*) */
+#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
+
+static JNINativeMethod lookup_special_native_methods[] = {
+  // Next two functions only exist for compatibility with 1.3.1 and earlier.
+  { CC"Java_java_io_ObjectOutputStream_getPrimitiveFieldValues",   NULL, FN_PTR(JVM_GetPrimitiveFieldValues)     },  // intercept ObjectOutputStream getPrimitiveFieldValues for faster serialization
+  { CC"Java_java_io_ObjectInputStream_setPrimitiveFieldValues",    NULL, FN_PTR(JVM_SetPrimitiveFieldValues)     },  // intercept ObjectInputStream setPrimitiveFieldValues for faster serialization
+
+  { CC"Java_sun_misc_Unsafe_registerNatives",                      NULL, FN_PTR(JVM_RegisterUnsafeMethods)       },
+  { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },
+  { CC"Java_sun_dyn_MethodHandleNatives_registerNatives",          NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },  // AllowTransitionalJSR292
+  { CC"Java_java_dyn_MethodHandleNatives_registerNatives",         NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },  // AllowTransitionalJSR292
+  { CC"Java_sun_misc_Perf_registerNatives",                        NULL, FN_PTR(JVM_RegisterPerfMethods)         }
+};
+
 static address lookup_special_native(char* jni_name) {
-  // NB: To ignore the jni prefix and jni postfix strstr is used matching.
-  if (!JDK_Version::is_gte_jdk14x_version()) {
-    // These functions only exist for compatibility with 1.3.1 and earlier
-    // Intercept ObjectOutputStream getPrimitiveFieldValues for faster serialization
-    if (strstr(jni_name, "Java_java_io_ObjectOutputStream_getPrimitiveFieldValues") != NULL) {
-      return CAST_FROM_FN_PTR(address, JVM_GetPrimitiveFieldValues);
-    }
-    // Intercept ObjectInputStream setPrimitiveFieldValues for faster serialization
-    if (strstr(jni_name, "Java_java_io_ObjectInputStream_setPrimitiveFieldValues") != NULL) {
-      return CAST_FROM_FN_PTR(address, JVM_SetPrimitiveFieldValues);
+  int i = !JDK_Version::is_gte_jdk14x_version() ? 0 : 2;  // see comment in lookup_special_native_methods
+  int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod);
+  for (; i < count; i++) {
+    // NB: To ignore the jni prefix and jni postfix strstr is used matching.
+    if (strstr(jni_name, lookup_special_native_methods[i].name) != NULL) {
+      return CAST_FROM_FN_PTR(address, lookup_special_native_methods[i].fnPtr);
     }
   }
-  if (strstr(jni_name, "Java_sun_misc_Unsafe_registerNatives") != NULL) {
-    return CAST_FROM_FN_PTR(address, JVM_RegisterUnsafeMethods);
-  }
-  if (strstr(jni_name, "Java_sun_dyn_MethodHandleNatives_registerNatives") != NULL) {
-    return CAST_FROM_FN_PTR(address, JVM_RegisterMethodHandleMethods);
-  }
-  if (strstr(jni_name, "Java_sun_misc_Perf_registerNatives") != NULL) {
-    return CAST_FROM_FN_PTR(address, JVM_RegisterPerfMethods);
-  }
-
   return NULL;
 }
 
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -110,6 +110,8 @@
 
 inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) {
   jlong byte_offset = field_offset_to_byte_offset(field_offset);
+  // Don't allow unsafe to be used to read or write the header word of oops
+  assert(p == NULL || field_offset >= oopDesc::header_size(), "offset must be outside of header");
 #ifdef ASSERT
   if (p != NULL) {
     assert(byte_offset >= 0 && byte_offset <= (jlong)MAX_OBJECT_SIZE, "sane offset");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,450 @@
+/*
+* Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+*/
+
+#include "precompiled.hpp"
+#include "runtime/advancedThresholdPolicy.hpp"
+#include "runtime/simpleThresholdPolicy.inline.hpp"
+
+#ifdef TIERED
+// Print an event.
+void AdvancedThresholdPolicy::print_specific(EventType type, methodHandle mh, methodHandle imh,
+                                             int bci, CompLevel level) {
+  tty->print(" rate: ");
+  if (mh->prev_time() == 0) tty->print("n/a");
+  else tty->print("%f", mh->rate());
+
+  tty->print(" k: %.2lf,%.2lf", threshold_scale(CompLevel_full_profile, Tier3LoadFeedback),
+                                threshold_scale(CompLevel_full_optimization, Tier4LoadFeedback));
+
+}
+
+void AdvancedThresholdPolicy::initialize() {
+  // Turn on ergonomic compiler count selection
+  if (FLAG_IS_DEFAULT(CICompilerCountPerCPU) && FLAG_IS_DEFAULT(CICompilerCount)) {
+    FLAG_SET_DEFAULT(CICompilerCountPerCPU, true);
+  }
+  int count = CICompilerCount;
+  if (CICompilerCountPerCPU) {
+    // Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n
+    int log_cpu = log2_intptr(os::active_processor_count());
+    int loglog_cpu = log2_intptr(MAX2(log_cpu, 1));
+    count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2;
+  }
+
+  set_c1_count(MAX2(count / 3, 1));
+  set_c2_count(MAX2(count - count / 3, 1));
+
+  // Some inlining tuning
+#ifdef X86
+  if (FLAG_IS_DEFAULT(InlineSmallCode)) {
+    FLAG_SET_DEFAULT(InlineSmallCode, 2000);
+  }
+#endif
+
+#ifdef SPARC
+  if (FLAG_IS_DEFAULT(InlineSmallCode)) {
+    FLAG_SET_DEFAULT(InlineSmallCode, 2500);
+  }
+#endif
+
+
+  set_start_time(os::javaTimeMillis());
+}
+
+// update_rate() is called from select_task() while holding a compile queue lock.
+void AdvancedThresholdPolicy::update_rate(jlong t, methodOop m) {
+  if (is_old(m)) {
+    // We don't remove old methods from the queue,
+    // so we can just zero the rate.
+    m->set_rate(0);
+    return;
+  }
+
+  // We don't update the rate if we've just came out of a safepoint.
+  // delta_s is the time since last safepoint in milliseconds.
+  jlong delta_s = t - SafepointSynchronize::end_of_last_safepoint();
+  jlong delta_t = t - (m->prev_time() != 0 ? m->prev_time() : start_time()); // milliseconds since the last measurement
+  // How many events were there since the last time?
+  int event_count = m->invocation_count() + m->backedge_count();
+  int delta_e = event_count - m->prev_event_count();
+
+  // We should be running for at least 1ms.
+  if (delta_s >= TieredRateUpdateMinTime) {
+    // And we must've taken the previous point at least 1ms before.
+    if (delta_t >= TieredRateUpdateMinTime && delta_e > 0) {
+      m->set_prev_time(t);
+      m->set_prev_event_count(event_count);
+      m->set_rate((float)delta_e / (float)delta_t); // Rate is events per millisecond
+    } else
+      if (delta_t > TieredRateUpdateMaxTime && delta_e == 0) {
+        // If nothing happened for 25ms, zero the rate. Don't modify prev values.
+        m->set_rate(0);
+      }
+  }
+}
+
+// Check if this method has been stale from a given number of milliseconds.
+// See select_task().
+bool AdvancedThresholdPolicy::is_stale(jlong t, jlong timeout, methodOop m) {
+  jlong delta_s = t - SafepointSynchronize::end_of_last_safepoint();
+  jlong delta_t = t - m->prev_time();
+  if (delta_t > timeout && delta_s > timeout) {
+    int event_count = m->invocation_count() + m->backedge_count();
+    int delta_e = event_count - m->prev_event_count();
+    // Return true if there were no events.
+    return delta_e == 0;
+  }
+  return false;
+}
+
+// We don't remove old methods from the compile queue even if they have
+// very low activity. See select_task().
+bool AdvancedThresholdPolicy::is_old(methodOop method) {
+  return method->invocation_count() > 50000 || method->backedge_count() > 500000;
+}
+
+double AdvancedThresholdPolicy::weight(methodOop method) {
+  return (method->rate() + 1) * ((method->invocation_count() + 1) *  (method->backedge_count() + 1));
+}
+
+// Apply heuristics and return true if x should be compiled before y
+bool AdvancedThresholdPolicy::compare_methods(methodOop x, methodOop y) {
+  if (x->highest_comp_level() > y->highest_comp_level()) {
+    // recompilation after deopt
+    return true;
+  } else
+    if (x->highest_comp_level() == y->highest_comp_level()) {
+      if (weight(x) > weight(y)) {
+        return true;
+      }
+    }
+  return false;
+}
+
+// Is method profiled enough?
+bool AdvancedThresholdPolicy::is_method_profiled(methodOop method) {
+  methodDataOop mdo = method->method_data();
+  if (mdo != NULL) {
+    int i = mdo->invocation_count_delta();
+    int b = mdo->backedge_count_delta();
+    return call_predicate_helper<CompLevel_full_profile>(i, b, 1);
+  }
+  return false;
+}
+
+// Called with the queue locked and with at least one element
+CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
+  CompileTask *max_task = NULL;
+  methodOop max_method;
+  jlong t = os::javaTimeMillis();
+  // Iterate through the queue and find a method with a maximum rate.
+  for (CompileTask* task = compile_queue->first(); task != NULL;) {
+    CompileTask* next_task = task->next();
+    methodOop method = (methodOop)JNIHandles::resolve(task->method_handle());
+    methodDataOop mdo = method->method_data();
+    update_rate(t, method);
+    if (max_task == NULL) {
+      max_task = task;
+      max_method = method;
+    } else {
+      // If a method has been stale for some time, remove it from the queue.
+      if (is_stale(t, TieredCompileTaskTimeout, method) && !is_old(method)) {
+        if (PrintTieredEvents) {
+          print_event(KILL, method, method, task->osr_bci(), (CompLevel)task->comp_level());
+        }
+        CompileTaskWrapper ctw(task); // Frees the task
+        compile_queue->remove(task);
+        method->clear_queued_for_compilation();
+        task = next_task;
+        continue;
+      }
+
+      // Select a method with a higher rate
+      if (compare_methods(method, max_method)) {
+        max_task = task;
+        max_method = method;
+      }
+    }
+    task = next_task;
+  }
+
+  if (max_task->comp_level() == CompLevel_full_profile && is_method_profiled(max_method)) {
+    max_task->set_comp_level(CompLevel_limited_profile);
+    if (PrintTieredEvents) {
+      print_event(UPDATE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level());
+    }
+  }
+
+  return max_task;
+}
+
+double AdvancedThresholdPolicy::threshold_scale(CompLevel level, int feedback_k) {
+  double queue_size = CompileBroker::queue_size(level);
+  int comp_count = compiler_count(level);
+  double k = queue_size / (feedback_k * comp_count) + 1;
+  return k;
+}
+
+// Call and loop predicates determine whether a transition to a higher
+// compilation level should be performed (pointers to predicate functions
+// are passed to common()).
+// Tier?LoadFeedback is basically a coefficient that determines of
+// how many methods per compiler thread can be in the queue before
+// the threshold values double.
+bool AdvancedThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level) {
+  switch(cur_level) {
+  case CompLevel_none:
+  case CompLevel_limited_profile: {
+    double k = threshold_scale(CompLevel_full_profile, Tier3LoadFeedback);
+    return loop_predicate_helper<CompLevel_none>(i, b, k);
+  }
+  case CompLevel_full_profile: {
+    double k = threshold_scale(CompLevel_full_optimization, Tier4LoadFeedback);
+    return loop_predicate_helper<CompLevel_full_profile>(i, b, k);
+  }
+  default:
+    return true;
+  }
+}
+
+bool AdvancedThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level) {
+  switch(cur_level) {
+  case CompLevel_none:
+  case CompLevel_limited_profile: {
+    double k = threshold_scale(CompLevel_full_profile, Tier3LoadFeedback);
+    return call_predicate_helper<CompLevel_none>(i, b, k);
+  }
+  case CompLevel_full_profile: {
+    double k = threshold_scale(CompLevel_full_optimization, Tier4LoadFeedback);
+    return call_predicate_helper<CompLevel_full_profile>(i, b, k);
+  }
+  default:
+    return true;
+  }
+}
+
+// If a method is old enough and is still in the interpreter we would want to
+// start profiling without waiting for the compiled method to arrive.
+// We also take the load on compilers into the account.
+bool AdvancedThresholdPolicy::should_create_mdo(methodOop method, CompLevel cur_level) {
+  if (cur_level == CompLevel_none &&
+      CompileBroker::queue_size(CompLevel_full_optimization) <=
+      Tier3DelayOn * compiler_count(CompLevel_full_optimization)) {
+    int i = method->invocation_count();
+    int b = method->backedge_count();
+    double k = Tier0ProfilingStartPercentage / 100.0;
+    return call_predicate_helper<CompLevel_none>(i, b, k) || loop_predicate_helper<CompLevel_none>(i, b, k);
+  }
+  return false;
+}
+
+// Create MDO if necessary.
+void AdvancedThresholdPolicy::create_mdo(methodHandle mh, TRAPS) {
+  if (mh->is_native() || mh->is_abstract() || mh->is_accessor()) return;
+  if (mh->method_data() == NULL) {
+    methodOopDesc::build_interpreter_method_data(mh, THREAD);
+    if (HAS_PENDING_EXCEPTION) {
+      CLEAR_PENDING_EXCEPTION;
+    }
+  }
+}
+
+
+/*
+ * Method states:
+ *   0 - interpreter (CompLevel_none)
+ *   1 - pure C1 (CompLevel_simple)
+ *   2 - C1 with invocation and backedge counting (CompLevel_limited_profile)
+ *   3 - C1 with full profiling (CompLevel_full_profile)
+ *   4 - C2 (CompLevel_full_optimization)
+ *
+ * Common state transition patterns:
+ * a. 0 -> 3 -> 4.
+ *    The most common path. But note that even in this straightforward case
+ *    profiling can start at level 0 and finish at level 3.
+ *
+ * b. 0 -> 2 -> 3 -> 4.
+ *    This case occures when the load on C2 is deemed too high. So, instead of transitioning
+ *    into state 3 directly and over-profiling while a method is in the C2 queue we transition to
+ *    level 2 and wait until the load on C2 decreases. This path is disabled for OSRs.
+ *
+ * c. 0 -> (3->2) -> 4.
+ *    In this case we enqueue a method for compilation at level 3, but the C1 queue is long enough
+ *    to enable the profiling to fully occur at level 0. In this case we change the compilation level
+ *    of the method to 2, because it'll allow it to run much faster without full profiling while c2
+ *    is compiling.
+ *
+ * d. 0 -> 3 -> 1 or 0 -> 2 -> 1.
+ *    After a method was once compiled with C1 it can be identified as trivial and be compiled to
+ *    level 1. These transition can also occur if a method can't be compiled with C2 but can with C1.
+ *
+ * e. 0 -> 4.
+ *    This can happen if a method fails C1 compilation (it will still be profiled in the interpreter)
+ *    or because of a deopt that didn't require reprofiling (compilation won't happen in this case because
+ *    the compiled version already exists).
+ *
+ * Note that since state 0 can be reached from any other state via deoptimization different loops
+ * are possible.
+ *
+ */
+
+// Common transition function. Given a predicate determines if a method should transition to another level.
+CompLevel AdvancedThresholdPolicy::common(Predicate p, methodOop method, CompLevel cur_level) {
+  if (is_trivial(method)) return CompLevel_simple;
+
+  CompLevel next_level = cur_level;
+  int i = method->invocation_count();
+  int b = method->backedge_count();
+
+  switch(cur_level) {
+  case CompLevel_none:
+    // If we were at full profile level, would we switch to full opt?
+    if (common(p, method, CompLevel_full_profile) == CompLevel_full_optimization) {
+      next_level = CompLevel_full_optimization;
+    } else if ((this->*p)(i, b, cur_level)) {
+      // C1-generated fully profiled code is about 30% slower than the limited profile
+      // code that has only invocation and backedge counters. The observation is that
+      // if C2 queue is large enough we can spend too much time in the fully profiled code
+      // while waiting for C2 to pick the method from the queue. To alleviate this problem
+      // we introduce a feedback on the C2 queue size. If the C2 queue is sufficiently long
+      // we choose to compile a limited profiled version and then recompile with full profiling
+      // when the load on C2 goes down.
+      if (CompileBroker::queue_size(CompLevel_full_optimization) >
+          Tier3DelayOn * compiler_count(CompLevel_full_optimization)) {
+        next_level = CompLevel_limited_profile;
+      } else {
+        next_level = CompLevel_full_profile;
+      }
+    }
+    break;
+  case CompLevel_limited_profile:
+    if (is_method_profiled(method)) {
+      // Special case: we got here because this method was fully profiled in the interpreter.
+      next_level = CompLevel_full_optimization;
+    } else {
+      methodDataOop mdo = method->method_data();
+      if (mdo != NULL) {
+        if (mdo->would_profile()) {
+          if (CompileBroker::queue_size(CompLevel_full_optimization) <=
+              Tier3DelayOff * compiler_count(CompLevel_full_optimization) &&
+              (this->*p)(i, b, cur_level)) {
+            next_level = CompLevel_full_profile;
+          }
+        } else {
+          next_level = CompLevel_full_optimization;
+        }
+      }
+    }
+    break;
+  case CompLevel_full_profile:
+    {
+      methodDataOop mdo = method->method_data();
+      if (mdo != NULL) {
+        if (mdo->would_profile()) {
+          int mdo_i = mdo->invocation_count_delta();
+          int mdo_b = mdo->backedge_count_delta();
+          if ((this->*p)(mdo_i, mdo_b, cur_level)) {
+            next_level = CompLevel_full_optimization;
+          }
+        } else {
+          next_level = CompLevel_full_optimization;
+        }
+      }
+    }
+    break;
+  }
+  return next_level;
+}
+
+// Determine if a method should be compiled with a normal entry point at a different level.
+CompLevel AdvancedThresholdPolicy::call_event(methodOop method,  CompLevel cur_level) {
+  CompLevel osr_level = (CompLevel) method->highest_osr_comp_level();
+  CompLevel next_level = common(&AdvancedThresholdPolicy::call_predicate, method, cur_level);
+
+  // If OSR method level is greater than the regular method level, the levels should be
+  // equalized by raising the regular method level in order to avoid OSRs during each
+  // invocation of the method.
+  if (osr_level == CompLevel_full_optimization && cur_level == CompLevel_full_profile) {
+    methodDataOop mdo = method->method_data();
+    guarantee(mdo != NULL, "MDO should not be NULL");
+    if (mdo->invocation_count() >= 1) {
+      next_level = CompLevel_full_optimization;
+    }
+  } else {
+    next_level = MAX2(osr_level, next_level);
+  }
+
+  return next_level;
+}
+
+// Determine if we should do an OSR compilation of a given method.
+CompLevel AdvancedThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) {
+  if (cur_level == CompLevel_none) {
+    // If there is a live OSR method that means that we deopted to the interpreter
+    // for the transition.
+    CompLevel osr_level = (CompLevel)method->highest_osr_comp_level();
+    if (osr_level > CompLevel_none) {
+      return osr_level;
+    }
+  }
+  return common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level);
+}
+
+// Update the rate and submit compile
+void AdvancedThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, TRAPS) {
+  int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();
+  update_rate(os::javaTimeMillis(), mh());
+  CompileBroker::compile_method(mh, bci, level, mh, hot_count, "tiered", THREAD);
+}
+
+
+// Handle the invocation event.
+void AdvancedThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh,
+                                                      CompLevel level, TRAPS) {
+  if (should_create_mdo(mh(), level)) {
+    create_mdo(mh, THREAD);
+  }
+  if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, InvocationEntryBci)) {
+    CompLevel next_level = call_event(mh(), level);
+    if (next_level != level) {
+      compile(mh, InvocationEntryBci, next_level, THREAD);
+    }
+  }
+}
+
+// Handle the back branch event. Notice that we can compile the method
+// with a regular entry from here.
+void AdvancedThresholdPolicy::method_back_branch_event(methodHandle mh, methodHandle imh,
+                                                       int bci, CompLevel level, TRAPS) {
+  if (should_create_mdo(mh(), level)) {
+    create_mdo(mh, THREAD);
+  }
+
+  // If the method is already compiling, quickly bail out.
+  if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, bci)) {
+    // Use loop event as an opportinity to also check there's been
+    // enough calls.
+    CompLevel cur_level = comp_level(mh());
+    CompLevel next_level = call_event(mh(), cur_level);
+    CompLevel next_osr_level = loop_event(mh(), level);
+    if (next_osr_level  == CompLevel_limited_profile) {
+      next_osr_level = CompLevel_full_profile; // OSRs are supposed to be for very hot methods.
+    }
+    next_level = MAX2(next_level,
+                      next_osr_level < CompLevel_full_optimization ? next_osr_level : cur_level);
+    bool is_compiling = false;
+    if (next_level != cur_level) {
+      compile(mh, InvocationEntryBci, next_level, THREAD);
+      is_compiling = true;
+    }
+
+    // Do the OSR version
+    if (!is_compiling && next_osr_level != level) {
+      compile(mh, bci, next_osr_level, THREAD);
+    }
+  }
+}
+
+#endif // TIERED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+*/
+
+#ifndef SHARE_VM_RUNTIME_ADVANCEDTHRESHOLDPOLICY_HPP
+#define SHARE_VM_RUNTIME_ADVANCEDTHRESHOLDPOLICY_HPP
+
+#include "runtime/simpleThresholdPolicy.hpp"
+
+#ifdef TIERED
+class CompileTask;
+class CompileQueue;
+
+/*
+ *  The system supports 5 execution levels:
+ *  * level 0 - interpreter
+ *  * level 1 - C1 with full optimization (no profiling)
+ *  * level 2 - C1 with invocation and backedge counters
+ *  * level 3 - C1 with full profiling (level 2 + MDO)
+ *  * level 4 - C2
+ *
+ * Levels 0, 2 and 3 periodically notify the runtime about the current value of the counters
+ * (invocation counters and backedge counters). The frequency of these notifications is
+ * different at each level. These notifications are used by the policy to decide what transition
+ * to make.
+ *
+ * Execution starts at level 0 (interpreter), then the policy can decide either to compile the
+ * method at level 3 or level 2. The decision is based on the following factors:
+ *    1. The length of the C2 queue determines the next level. The observation is that level 2
+ * is generally faster than level 3 by about 30%, therefore we would want to minimize the time
+ * a method spends at level 3. We should only spend the time at level 3 that is necessary to get
+ * adequate profiling. So, if the C2 queue is long enough it is more beneficial to go first to
+ * level 2, because if we transitioned to level 3 we would be stuck there until our C2 compile
+ * request makes its way through the long queue. When the load on C2 recedes we are going to
+ * recompile at level 3 and start gathering profiling information.
+ *    2. The length of C1 queue is used to dynamically adjust the thresholds, so as to introduce
+ * additional filtering if the compiler is overloaded. The rationale is that by the time a
+ * method gets compiled it can become unused, so it doesn't make sense to put too much onto the
+ * queue.
+ *
+ * After profiling is completed at level 3 the transition is made to level 4. Again, the length
+ * of the C2 queue is used as a feedback to adjust the thresholds.
+ *
+ * After the first C1 compile some basic information is determined about the code like the number
+ * of the blocks and the number of the loops. Based on that it can be decided that a method
+ * is trivial and compiling it with C1 will yield the same code. In this case the method is
+ * compiled at level 1 instead of 4.
+ *
+ * We also support profiling at level 0. If C1 is slow enough to produce the level 3 version of
+ * the code and the C2 queue is sufficiently small we can decide to start profiling in the
+ * interpreter (and continue profiling in the compiled code once the level 3 version arrives).
+ * If the profiling at level 0 is fully completed before level 3 version is produced, a level 2
+ * version is compiled instead in order to run faster waiting for a level 4 version.
+ *
+ * Compile queues are implemented as priority queues - for each method in the queue we compute
+ * the event rate (the number of invocation and backedge counter increments per unit of time).
+ * When getting an element off the queue we pick the one with the largest rate. Maintaining the
+ * rate also allows us to remove stale methods (the ones that got on the queue but stopped
+ * being used shortly after that).
+*/
+
+/* Command line options:
+ * - Tier?InvokeNotifyFreqLog and Tier?BackedgeNotifyFreqLog control the frequency of method
+ *   invocation and backedge notifications. Basically every n-th invocation or backedge a mutator thread
+ *   makes a call into the runtime.
+ *
+ * - Tier?CompileThreshold, Tier?BackEdgeThreshold, Tier?MinInvocationThreshold control
+ *   compilation thresholds.
+ *   Level 2 thresholds are not used and are provided for option-compatibility and potential future use.
+ *   Other thresholds work as follows:
+ *
+ *   Transition from interpreter (level 0) to C1 with full profiling (level 3) happens when
+ *   the following predicate is true (X is the level):
+ *
+ *   i > TierXInvocationThreshold * s || (i > TierXMinInvocationThreshold * s  && i + b > TierXCompileThreshold * s),
+ *
+ *   where $i$ is the number of method invocations, $b$ number of backedges and $s$ is the scaling
+ *   coefficient that will be discussed further.
+ *   The intuition is to equalize the time that is spend profiling each method.
+ *   The same predicate is used to control the transition from level 3 to level 4 (C2). It should be
+ *   noted though that the thresholds are relative. Moreover i and b for the 0->3 transition come
+ *   from methodOop and for 3->4 transition they come from MDO (since profiled invocations are
+ *   counted separately).
+ *
+ *   OSR transitions are controlled simply with b > TierXBackEdgeThreshold * s predicates.
+ *
+ * - Tier?LoadFeedback options are used to automatically scale the predicates described above depending
+ *   on the compiler load. The scaling coefficients are computed as follows:
+ *
+ *   s = queue_size_X / (TierXLoadFeedback * compiler_count_X) + 1,
+ *
+ *   where queue_size_X is the current size of the compiler queue of level X, and compiler_count_X
+ *   is the number of level X compiler threads.
+ *
+ *   Basically these parameters describe how many methods should be in the compile queue
+ *   per compiler thread before the scaling coefficient increases by one.
+ *
+ *   This feedback provides the mechanism to automatically control the flow of compilation requests
+ *   depending on the machine speed, mutator load and other external factors.
+ *
+ * - Tier3DelayOn and Tier3DelayOff parameters control another important feedback loop.
+ *   Consider the following observation: a method compiled with full profiling (level 3)
+ *   is about 30% slower than a method at level 2 (just invocation and backedge counters, no MDO).
+ *   Normally, the following transitions will occur: 0->3->4. The problem arises when the C2 queue
+ *   gets congested and the 3->4 transition is delayed. While the method is the C2 queue it continues
+ *   executing at level 3 for much longer time than is required by the predicate and at suboptimal speed.
+ *   The idea is to dynamically change the behavior of the system in such a way that if a substantial
+ *   load on C2 is detected we would first do the 0->2 transition allowing a method to run faster.
+ *   And then when the load decreases to allow 2->3 transitions.
+ *
+ *   Tier3Delay* parameters control this switching mechanism.
+ *   Tier3DelayOn is the number of methods in the C2 queue per compiler thread after which the policy
+ *   no longer does 0->3 transitions but does 0->2 transitions instead.
+ *   Tier3DelayOff switches the original behavior back when the number of methods in the C2 queue
+ *   per compiler thread falls below the specified amount.
+ *   The hysteresis is necessary to avoid jitter.
+ *
+ * - TieredCompileTaskTimeout is the amount of time an idle method can spend in the compile queue.
+ *   Basically, since we use the event rate d(i + b)/dt as a value of priority when selecting a method to
+ *   compile from the compile queue, we also can detect stale methods for which the rate has been
+ *   0 for some time in the same iteration. Stale methods can appear in the queue when an application
+ *   abruptly changes its behavior.
+ *
+ * - TieredStopAtLevel, is used mostly for testing. It allows to bypass the policy logic and stick
+ *   to a given level. For example it's useful to set TieredStopAtLevel = 1 in order to compile everything
+ *   with pure c1.
+ *
+ * - Tier0ProfilingStartPercentage allows the interpreter to start profiling when the inequalities in the
+ *   0->3 predicate are already exceeded by the given percentage but the level 3 version of the
+ *   method is still not ready. We can even go directly from level 0 to 4 if c1 doesn't produce a compiled
+ *   version in time. This reduces the overall transition to level 4 and decreases the startup time.
+ *   Note that this behavior is also guarded by the Tier3Delay mechanism: when the c2 queue is too long
+ *   these is not reason to start profiling prematurely.
+ *
+ * - TieredRateUpdateMinTime and TieredRateUpdateMaxTime are parameters of the rate computation.
+ *   Basically, the rate is not computed more frequently than TieredRateUpdateMinTime and is considered
+ *   to be zero if no events occurred in TieredRateUpdateMaxTime.
+ */
+
+
+class AdvancedThresholdPolicy : public SimpleThresholdPolicy {
+  jlong _start_time;
+
+  // Call and loop predicates determine whether a transition to a higher compilation
+  // level should be performed (pointers to predicate functions are passed to common().
+  // Predicates also take compiler load into account.
+  typedef bool (AdvancedThresholdPolicy::*Predicate)(int i, int b, CompLevel cur_level);
+  bool call_predicate(int i, int b, CompLevel cur_level);
+  bool loop_predicate(int i, int b, CompLevel cur_level);
+  // Common transition function. Given a predicate determines if a method should transition to another level.
+  CompLevel common(Predicate p, methodOop method, CompLevel cur_level);
+  // Transition functions.
+  // call_event determines if a method should be compiled at a different
+  // level with a regular invocation entry.
+  CompLevel call_event(methodOop method, CompLevel cur_level);
+  // loop_event checks if a method should be OSR compiled at a different
+  // level.
+  CompLevel loop_event(methodOop method, CompLevel cur_level);
+  // Has a method been long around?
+  // We don't remove old methods from the compile queue even if they have
+  // very low activity (see select_task()).
+  inline bool is_old(methodOop method);
+  // Was a given method inactive for a given number of milliseconds.
+  // If it is, we would remove it from the queue (see select_task()).
+  inline bool is_stale(jlong t, jlong timeout, methodOop m);
+  // Compute the weight of the method for the compilation scheduling
+  inline double weight(methodOop method);
+  // Apply heuristics and return true if x should be compiled before y
+  inline bool compare_methods(methodOop x, methodOop y);
+  // Compute event rate for a given method. The rate is the number of event (invocations + backedges)
+  // per millisecond.
+  inline void update_rate(jlong t, methodOop m);
+  // Compute threshold scaling coefficient
+  inline double threshold_scale(CompLevel level, int feedback_k);
+  // If a method is old enough and is still in the interpreter we would want to
+  // start profiling without waiting for the compiled method to arrive. This function
+  // determines whether we should do that.
+  inline bool should_create_mdo(methodOop method, CompLevel cur_level);
+  // Create MDO if necessary.
+  void create_mdo(methodHandle mh, TRAPS);
+  // Is method profiled enough?
+  bool is_method_profiled(methodOop method);
+
+protected:
+  void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
+
+  void set_start_time(jlong t) { _start_time = t;    }
+  jlong start_time() const     { return _start_time; }
+
+  // Submit a given method for compilation (and update the rate).
+  virtual void submit_compile(methodHandle mh, int bci, CompLevel level, TRAPS);
+  // event() from SimpleThresholdPolicy would call these.
+  virtual void method_invocation_event(methodHandle method, methodHandle inlinee,
+                                       CompLevel level, TRAPS);
+  virtual void method_back_branch_event(methodHandle method, methodHandle inlinee,
+                                        int bci, CompLevel level, TRAPS);
+public:
+  AdvancedThresholdPolicy() : _start_time(0) { }
+  // Select task is called by CompileBroker. We should return a task or NULL.
+  virtual CompileTask* select_task(CompileQueue* compile_queue);
+  virtual void initialize();
+};
+
+#endif // TIERED
+
+#endif // SHARE_VM_RUNTIME_ADVANCEDTHRESHOLDPOLICY_HPP
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -78,6 +78,7 @@
 const char*  Arguments::_java_vendor_url_bug    = DEFAULT_VENDOR_URL_BUG;
 const char*  Arguments::_sun_java_launcher      = DEFAULT_JAVA_LAUNCHER;
 int    Arguments::_sun_java_launcher_pid        = -1;
+bool   Arguments::_created_by_gamma_launcher    = false;
 
 // These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*)
 bool   Arguments::_AlwaysCompileLoopMethods     = AlwaysCompileLoopMethods;
@@ -241,6 +242,7 @@
                            JDK_Version::jdk_update(6,24), JDK_Version::jdk(8) },
   { "MaxLiveObjectEvacuationRatio",
                            JDK_Version::jdk_update(6,24), JDK_Version::jdk(8) },
+  { "ForceSharedSpaces",   JDK_Version::jdk_update(6,25), JDK_Version::jdk(8) },
   { NULL, JDK_Version(0), JDK_Version(0) }
 };
 
@@ -1002,31 +1004,10 @@
   }
 }
 
-void Arguments::check_compressed_oops_compat() {
-#ifdef _LP64
-  assert(UseCompressedOops, "Precondition");
-  // Is it on by default or set on ergonomically
-  bool is_on_by_default = FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops);
-
-  // If dumping an archive or forcing its use, disable compressed oops if possible
-  if (DumpSharedSpaces || RequireSharedSpaces) {
-    if (is_on_by_default) {
-      FLAG_SET_DEFAULT(UseCompressedOops, false);
-      return;
-    } else {
-      vm_exit_during_initialization(
-        "Class Data Sharing is not supported with compressed oops yet", NULL);
-    }
-  } else if (UseSharedSpaces) {
-    // UseSharedSpaces is on by default. With compressed oops, we turn it off.
-    FLAG_SET_DEFAULT(UseSharedSpaces, false);
-  }
-#endif
-}
-
 void Arguments::set_tiered_flags() {
+  // With tiered, set default policy to AdvancedThresholdPolicy, which is 3.
   if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
-    FLAG_SET_DEFAULT(CompilationPolicyChoice, 2);
+    FLAG_SET_DEFAULT(CompilationPolicyChoice, 3);
   }
   if (CompilationPolicyChoice < 2) {
     vm_exit_during_initialization(
@@ -1121,40 +1102,28 @@
     set_parnew_gc_flags();
   }
 
+  // MaxHeapSize is aligned down in collectorPolicy
+  size_t max_heap = align_size_down(MaxHeapSize,
+                                    CardTableRS::ct_max_alignment_constraint());
+
   // Now make adjustments for CMS
-  size_t young_gen_per_worker;
-  intx new_ratio;
-  size_t min_new_default;
-  intx tenuring_default;
-  if (CMSUseOldDefaults) {  // old defaults: "old" as of 6.0
-    if FLAG_IS_DEFAULT(CMSYoungGenPerWorker) {
-      FLAG_SET_ERGO(intx, CMSYoungGenPerWorker, 4*M);
-    }
-    young_gen_per_worker = 4*M;
-    new_ratio = (intx)15;
-    min_new_default = 4*M;
-    tenuring_default = (intx)0;
-  } else { // new defaults: "new" as of 6.0
-    young_gen_per_worker = CMSYoungGenPerWorker;
-    new_ratio = (intx)7;
-    min_new_default = 16*M;
-    tenuring_default = (intx)4;
-  }
-
-  // Preferred young gen size for "short" pauses
+  intx   tenuring_default = (intx)6;
+  size_t young_gen_per_worker = CMSYoungGenPerWorker;
+
+  // Preferred young gen size for "short" pauses:
+  // upper bound depends on # of threads and NewRatio.
   const uintx parallel_gc_threads =
     (ParallelGCThreads == 0 ? 1 : ParallelGCThreads);
   const size_t preferred_max_new_size_unaligned =
-    ScaleForWordSize(young_gen_per_worker * parallel_gc_threads);
-  const size_t preferred_max_new_size =
+    MIN2(max_heap/(NewRatio+1), ScaleForWordSize(young_gen_per_worker * parallel_gc_threads));
+  size_t preferred_max_new_size =
     align_size_up(preferred_max_new_size_unaligned, os::vm_page_size());
 
   // Unless explicitly requested otherwise, size young gen
-  // for "short" pauses ~ 4M*ParallelGCThreads
+  // for "short" pauses ~ CMSYoungGenPerWorker*ParallelGCThreads
 
   // If either MaxNewSize or NewRatio is set on the command line,
   // assume the user is trying to set the size of the young gen.
-
   if (FLAG_IS_DEFAULT(MaxNewSize) && FLAG_IS_DEFAULT(NewRatio)) {
 
     // Set MaxNewSize to our calculated preferred_max_new_size unless
@@ -1167,49 +1136,13 @@
     }
     if (PrintGCDetails && Verbose) {
       // Too early to use gclog_or_tty
-      tty->print_cr("Ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize);
+      tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize);
     }
 
-    // Unless explicitly requested otherwise, prefer a large
-    // Old to Young gen size so as to shift the collection load
-    // to the old generation concurrent collector
-
-    // If this is only guarded by FLAG_IS_DEFAULT(NewRatio)
-    // then NewSize and OldSize may be calculated.  That would
-    // generally lead to some differences with ParNewGC for which
-    // there was no obvious reason.  Also limit to the case where
-    // MaxNewSize has not been set.
-
-    FLAG_SET_ERGO(intx, NewRatio, MAX2(NewRatio, new_ratio));
-
     // Code along this path potentially sets NewSize and OldSize
 
-    // Calculate the desired minimum size of the young gen but if
-    // NewSize has been set on the command line, use it here since
-    // it should be the final value.
-    size_t min_new;
-    if (FLAG_IS_DEFAULT(NewSize)) {
-      min_new = align_size_up(ScaleForWordSize(min_new_default),
-                              os::vm_page_size());
-    } else {
-      min_new = NewSize;
-    }
-    size_t prev_initial_size = InitialHeapSize;
-    if (prev_initial_size != 0 && prev_initial_size < min_new + OldSize) {
-      FLAG_SET_ERGO(uintx, InitialHeapSize, min_new + OldSize);
-      // Currently minimum size and the initial heap sizes are the same.
-      set_min_heap_size(InitialHeapSize);
-      if (PrintGCDetails && Verbose) {
-        warning("Initial heap size increased to " SIZE_FORMAT " M from "
-                SIZE_FORMAT " M; use -XX:NewSize=... for finer control.",
-                InitialHeapSize/M, prev_initial_size/M);
-      }
-    }
-
-    // MaxHeapSize is aligned down in collectorPolicy
-    size_t max_heap =
-      align_size_down(MaxHeapSize,
-                      CardTableRS::ct_max_alignment_constraint());
+    assert(max_heap >= InitialHeapSize, "Error");
+    assert(max_heap >= NewSize, "Error");
 
     if (PrintGCDetails && Verbose) {
       // Too early to use gclog_or_tty
@@ -1218,7 +1151,11 @@
            " max_heap: " SIZE_FORMAT,
            min_heap_size(), InitialHeapSize, max_heap);
     }
-    if (max_heap > min_new) {
+    size_t min_new = preferred_max_new_size;
+    if (FLAG_IS_CMDLINE(NewSize)) {
+      min_new = NewSize;
+    }
+    if (max_heap > min_new && min_heap_size() > min_new) {
       // Unless explicitly requested otherwise, make young gen
       // at least min_new, and at most preferred_max_new_size.
       if (FLAG_IS_DEFAULT(NewSize)) {
@@ -1226,18 +1163,17 @@
         FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
         if (PrintGCDetails && Verbose) {
           // Too early to use gclog_or_tty
-          tty->print_cr("Ergo set NewSize: " SIZE_FORMAT, NewSize);
+          tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
         }
       }
       // Unless explicitly requested otherwise, size old gen
-      // so that it's at least 3X of NewSize to begin with;
-      // later NewRatio will decide how it grows; see above.
+      // so it's NewRatio x of NewSize.
       if (FLAG_IS_DEFAULT(OldSize)) {
         if (max_heap > NewSize) {
-          FLAG_SET_ERGO(uintx, OldSize, MIN2(3*NewSize, max_heap - NewSize));
+          FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
           if (PrintGCDetails && Verbose) {
             // Too early to use gclog_or_tty
-            tty->print_cr("Ergo set OldSize: " SIZE_FORMAT, OldSize);
+            tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
           }
         }
       }
@@ -1381,7 +1317,7 @@
 void Arguments::set_ergonomics_flags() {
   // Parallel GC is not compatible with sharing. If one specifies
   // that they want sharing explicitly, do not set ergonomics flags.
-  if (DumpSharedSpaces || ForceSharedSpaces) {
+  if (DumpSharedSpaces || RequireSharedSpaces) {
     return;
   }
 
@@ -1656,6 +1592,9 @@
 
 void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
   _sun_java_launcher = strdup(launcher);
+  if (strcmp("gamma", _sun_java_launcher) == 0) {
+    _created_by_gamma_launcher = true;
+  }
 }
 
 bool Arguments::created_by_java_launcher() {
@@ -1663,6 +1602,10 @@
   return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
 }
 
+bool Arguments::created_by_gamma_launcher() {
+  return _created_by_gamma_launcher;
+}
+
 //===========================================================================================================
 // Parsing of main arguments
 
@@ -1681,13 +1624,13 @@
 }
 
 bool Arguments::verify_min_value(intx val, intx min, const char* name) {
-  // Returns true if given value is greater than specified min threshold
+  // Returns true if given value is at least specified min threshold
   // false, otherwise.
   if (val >= min ) {
       return true;
   }
   jio_fprintf(defaultStream::error_stream(),
-              "%s of " INTX_FORMAT " is invalid; must be greater than " INTX_FORMAT "\n",
+              "%s of " INTX_FORMAT " is invalid; must be at least " INTX_FORMAT "\n",
               name, val, min);
   return false;
 }
@@ -1837,33 +1780,6 @@
 
   status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit");
 
-  // Check whether user-specified sharing option conflicts with GC or page size.
-  // Both sharing and large pages are enabled by default on some platforms;
-  // large pages override sharing only if explicitly set on the command line.
-  const bool cannot_share = UseConcMarkSweepGC || CMSIncrementalMode ||
-          UseG1GC || UseParNewGC || UseParallelGC || UseParallelOldGC ||
-          UseLargePages && FLAG_IS_CMDLINE(UseLargePages);
-  if (cannot_share) {
-    // Either force sharing on by forcing the other options off, or
-    // force sharing off.
-    if (DumpSharedSpaces || ForceSharedSpaces) {
-      jio_fprintf(defaultStream::error_stream(),
-                  "Using Serial GC and default page size because of %s\n",
-                  ForceSharedSpaces ? "-Xshare:on" : "-Xshare:dump");
-      force_serial_gc();
-      FLAG_SET_DEFAULT(UseLargePages, false);
-    } else {
-      if (UseSharedSpaces && Verbose) {
-        jio_fprintf(defaultStream::error_stream(),
-                    "Turning off use of shared archive because of "
-                    "choice of garbage collector or large pages\n");
-      }
-      no_shared_spaces();
-    }
-  } else if (UseLargePages && (UseSharedSpaces || DumpSharedSpaces)) {
-    FLAG_SET_DEFAULT(UseLargePages, false);
-  }
-
   status = status && check_gc_consistency();
   status = status && check_stack_pages();
 
@@ -1941,6 +1857,8 @@
     status = false;
   }
 
+  status = status && verify_min_value(ParGCArrayScanChunk, 1, "ParGCArrayScanChunk");
+
 #ifndef SERIALGC
   if (UseG1GC) {
     status = status && verify_percentage(InitiatingHeapOccupancyPercent,
@@ -2404,9 +2322,6 @@
     } else if (match_option(option, "-Xshare:on", &tail)) {
       FLAG_SET_CMDLINE(bool, UseSharedSpaces, true);
       FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true);
-#ifdef TIERED
-      FLAG_SET_CMDLINE(bool, ForceSharedSpaces, true);
-#endif // TIERED
     // -Xshare:auto
     } else if (match_option(option, "-Xshare:auto", &tail)) {
       FLAG_SET_CMDLINE(bool, UseSharedSpaces, true);
@@ -2790,10 +2705,6 @@
   if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) {
     FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1);
   }
-  // Temporary disable bulk zeroing reduction with G1. See CR 6627983.
-  if (UseG1GC) {
-    FLAG_SET_DEFAULT(ReduceBulkZeroing, false);
-  }
 #endif
 
   // If we are running in a headless jre, force java.awt.headless property
@@ -2907,6 +2818,36 @@
   return JNI_OK;
 }
 
+void Arguments::set_shared_spaces_flags() {
+  // Check whether class data sharing settings conflict with GC, compressed oops
+  // or page size, and fix them up.  Explicit sharing options override other
+  // settings.
+  const bool cannot_share = UseConcMarkSweepGC || CMSIncrementalMode ||
+    UseG1GC || UseParNewGC || UseParallelGC || UseParallelOldGC ||
+    UseCompressedOops || UseLargePages && FLAG_IS_CMDLINE(UseLargePages);
+  const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
+  const bool might_share = must_share || UseSharedSpaces;
+  if (cannot_share) {
+    if (must_share) {
+      warning("selecting serial gc and disabling large pages %s"
+              "because of %s", "" LP64_ONLY("and compressed oops "),
+              DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
+      force_serial_gc();
+      FLAG_SET_CMDLINE(bool, UseLargePages, false);
+      LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false));
+    } else {
+      if (UseSharedSpaces && Verbose) {
+        warning("turning off use of shared archive because of "
+                "choice of garbage collector or large pages");
+      }
+      no_shared_spaces();
+    }
+  } else if (UseLargePages && might_share) {
+    // Disable large pages to allow shared spaces.  This is sub-optimal, since
+    // there may not even be a shared archive to use.
+    FLAG_SET_DEFAULT(UseLargePages, false);
+  }
+}
 
 // Parse entry point called from JNI_CreateJavaVM
 
@@ -3054,9 +2995,7 @@
   // Set flags based on ergonomics.
   set_ergonomics_flags();
 
-  if (UseCompressedOops) {
-    check_compressed_oops_compat();
-  }
+  set_shared_spaces_flags();
 
   // Check the GC selections again.
   if (!check_gc_consistency()) {
@@ -3074,22 +3013,17 @@
   }
 
 #ifndef KERNEL
-  if (UseConcMarkSweepGC) {
-    // Set flags for CMS and ParNew.  Check UseConcMarkSweep first
-    // to ensure that when both UseConcMarkSweepGC and UseParNewGC
-    // are true, we don't call set_parnew_gc_flags() as well.
+  // Set heap size based on available physical memory
+  set_heap_size();
+  // Set per-collector flags
+  if (UseParallelGC || UseParallelOldGC) {
+    set_parallel_gc_flags();
+  } else if (UseConcMarkSweepGC) { // should be done before ParNew check below
     set_cms_and_parnew_gc_flags();
-  } else {
-    // Set heap size based on available physical memory
-    set_heap_size();
-    // Set per-collector flags
-    if (UseParallelGC || UseParallelOldGC) {
-      set_parallel_gc_flags();
-    } else if (UseParNewGC) {
-      set_parnew_gc_flags();
-    } else if (UseG1GC) {
-      set_g1_gc_flags();
-    }
+  } else if (UseParNewGC) {  // skipped if CMS is set above
+    set_parnew_gc_flags();
+  } else if (UseG1GC) {
+    set_g1_gc_flags();
   }
 #endif // KERNEL
 
@@ -3106,7 +3040,11 @@
   // Turn off biased locking for locking debug mode flags,
   // which are subtlely different from each other but neither works with
   // biased locking.
-  if (!UseFastLocking || UseHeavyMonitors) {
+  if (UseHeavyMonitors
+#ifdef COMPILER1
+      || !UseFastLocking
+#endif // COMPILER1
+    ) {
     if (!FLAG_IS_DEFAULT(UseBiasedLocking) && UseBiasedLocking) {
       // flag set to true on command line; warn the user that they
       // can't enable biased locking here
@@ -3155,6 +3093,16 @@
     }
   }
 
+  // set PauseAtExit if the gamma launcher was used and a debugger is attached
+  // but only if not already set on the commandline
+  if (Arguments::created_by_gamma_launcher() && os::is_debugger_attached()) {
+    bool set = false;
+    CommandLineFlags::wasSetOnCmdline("PauseAtExit", &set);
+    if (!set) {
+      FLAG_SET_DEFAULT(PauseAtExit, true);
+    }
+  }
+
   return JNI_OK;
 }
 
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -257,6 +257,9 @@
   // sun.java.launcher.pid, private property
   static int    _sun_java_launcher_pid;
 
+  // was this VM created by the gamma launcher
+  static bool   _created_by_gamma_launcher;
+
   // Option flags
   static bool   _has_profile;
   static bool   _has_alloc_profile;
@@ -298,8 +301,6 @@
 
   // Tiered
   static void set_tiered_flags();
-  // Check compressed oops compatibility with other flags
-  static void check_compressed_oops_compat();
   // CMS/ParNew garbage collectors
   static void set_parnew_gc_flags();
   static void set_cms_and_parnew_gc_flags();
@@ -309,6 +310,7 @@
   static void set_g1_gc_flags();
   // GC ergonomics
   static void set_ergonomics_flags();
+  static void set_shared_spaces_flags();
   // Setup heap size
   static void set_heap_size();
   // Based on automatic selection criteria, should the
@@ -444,6 +446,8 @@
   static const char* sun_java_launcher()    { return _sun_java_launcher; }
   // Was VM created by a Java launcher?
   static bool created_by_java_launcher();
+  // Was VM created by the gamma Java launcher?
+  static bool created_by_gamma_launcher();
   // -Dsun.java.launcher.pid
   static int sun_java_launcher_pid()        { return _sun_java_launcher_pid; }
 
--- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 #include "oops/methodOop.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/nativeLookup.hpp"
+#include "runtime/advancedThresholdPolicy.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/frame.hpp"
 #include "runtime/handles.inline.hpp"
@@ -72,8 +73,15 @@
     Unimplemented();
 #endif
     break;
+  case 3:
+#ifdef TIERED
+    CompilationPolicy::set_policy(new AdvancedThresholdPolicy());
+#else
+    Unimplemented();
+#endif
+    break;
   default:
-    fatal("CompilationPolicyChoice must be in the range: [0-2]");
+    fatal("CompilationPolicyChoice must be in the range: [0-3]");
   }
   CompilationPolicy::policy()->initialize();
 }
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -101,9 +101,9 @@
   _frame_pcs                 = frame_pcs;
   _register_block            = NEW_C_HEAP_ARRAY(intptr_t, RegisterMap::reg_count * 2);
   _return_type               = return_type;
+  _initial_fp                = 0;
   // PD (x86 only)
   _counter_temp              = 0;
-  _initial_fp                = 0;
   _unpack_kind               = 0;
   _sender_sp_temp            = 0;
 
@@ -459,18 +459,9 @@
                                       frame_sizes,
                                       frame_pcs,
                                       return_type);
-#if defined(IA32) || defined(AMD64)
-  // We need a way to pass fp to the unpacking code so the skeletal frames
-  // come out correct. This is only needed for x86 because of c2 using ebp
-  // as an allocatable register. So this update is useless (and harmless)
-  // on the other platforms. It would be nice to do this in a different
-  // way but even the old style deoptimization had a problem with deriving
-  // this value. NEEDS_CLEANUP
-  // Note: now that c1 is using c2's deopt blob we must do this on all
-  // x86 based platforms
-  intptr_t** fp_addr = (intptr_t**) (((address)info) + info->initial_fp_offset_in_bytes());
-  *fp_addr = array->sender().fp(); // was adapter_caller
-#endif /* IA32 || AMD64 */
+  // On some platforms, we need a way to pass fp to the unpacking code
+  // so the skeletal frames come out correct.
+  info->set_initial_fp((intptr_t) array->sender().fp());
 
   if (array->frames() > 1) {
     if (VerifyStack && TraceDeoptimization) {
--- a/hotspot/src/share/vm/runtime/deoptimization.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/deoptimization.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -136,12 +136,12 @@
     address*  _frame_pcs;                 // Array of frame pc's, in bytes, for unrolling the stack
     intptr_t* _register_block;            // Block for storing callee-saved registers.
     BasicType _return_type;               // Tells if we have to restore double or long return value
+    intptr_t  _initial_fp;                // FP of the sender frame
     // The following fields are used as temps during the unpacking phase
     // (which is tight on registers, especially on x86). They really ought
     // to be PD variables but that involves moving this class into its own
     // file to use the pd include mechanism. Maybe in a later cleanup ...
     intptr_t  _counter_temp;              // SHOULD BE PD VARIABLE (x86 frame count temp)
-    intptr_t  _initial_fp;                // SHOULD BE PD VARIABLE (x86/c2 initial ebp)
     intptr_t  _unpack_kind;               // SHOULD BE PD VARIABLE (x86 unpack kind)
     intptr_t  _sender_sp_temp;            // SHOULD BE PD VARIABLE (x86 sender_sp)
    public:
@@ -165,6 +165,8 @@
     // Returns the total size of frames
     int size_of_frames() const;
 
+    void set_initial_fp(intptr_t fp) { _initial_fp = fp; }
+
     // Accessors used by the code generator for the unpack stub.
     static int size_of_deoptimized_frame_offset_in_bytes() { return offset_of(UnrollBlock, _size_of_deoptimized_frame); }
     static int caller_adjustment_offset_in_bytes()         { return offset_of(UnrollBlock, _caller_adjustment);         }
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1540,12 +1540,8 @@
   product(bool, AlwaysPreTouch, false,                                      \
           "It forces all freshly committed pages to be pre-touched.")       \
                                                                             \
-  product(bool, CMSUseOldDefaults, false,                                   \
-          "A flag temporarily introduced to allow reverting to some "       \
-          "older default settings; older as of 6.0")                        \
-                                                                            \
-  product(intx, CMSYoungGenPerWorker, 16*M,                                 \
-          "The amount of young gen chosen by default per GC worker "        \
+  product_pd(intx, CMSYoungGenPerWorker,                                    \
+          "The maximum size of young gen chosen by default per GC worker "  \
           "thread available")                                               \
                                                                             \
   product(bool, GCOverheadReporting, false,                                 \
@@ -2610,9 +2606,6 @@
   develop(bool, CompileTheWorldPreloadClasses, true,                        \
           "Preload all classes used by a class before start loading")       \
                                                                             \
-  notproduct(bool, CompileTheWorldIgnoreInitErrors, false,                  \
-          "Compile all methods although class initializer failed")          \
-                                                                            \
   notproduct(intx, CompileTheWorldSafepointInterval, 100,                   \
           "Force a safepoint every n compiles so sweeper can keep up")      \
                                                                             \
@@ -3656,9 +3649,6 @@
   product(bool, RequireSharedSpaces, false,                                 \
           "Require shared spaces in the permanent generation")              \
                                                                             \
-  product(bool, ForceSharedSpaces, false,                                   \
-          "Require shared spaces in the permanent generation")              \
-                                                                            \
   product(bool, DumpSharedSpaces, false,                                    \
            "Special mode: JVM reads a class list, loads classes, builds "   \
             "shared spaces, and dumps the shared spaces to a file to be "   \
@@ -3722,6 +3712,13 @@
   experimental(bool, AllowTransitionalJSR292, true,                         \
           "recognize pre-PFD formats of invokedynamic")                     \
                                                                             \
+  experimental(bool, PreferTransitionalJSR292, false,                       \
+          "prefer pre-PFD APIs on boot class path, if they exist")          \
+                                                                            \
+  experimental(bool, AllowInvokeForInvokeGeneric, false,                    \
+          "accept MethodHandle.invoke and MethodHandle.invokeGeneric "      \
+          "as equivalent methods")                                          \
+                                                                            \
   develop(bool, TraceInvokeDynamic, false,                                  \
           "trace internal invoke dynamic operations")                       \
                                                                             \
@@ -3733,6 +3730,9 @@
           "The file to create and for whose removal to await when pausing " \
           "at startup. (default: ./vm.paused.<pid>)")                       \
                                                                             \
+  diagnostic(bool, PauseAtExit, false,                                      \
+          "Pause and wait for keypress on exit if a debugger is attached")  \
+                                                                            \
   product(bool, ExtendedDTraceProbes,    false,                             \
           "Enable performance-impacting dtrace probes")                     \
                                                                             \
--- a/hotspot/src/share/vm/runtime/java.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/java.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -551,6 +551,7 @@
 
 void vm_direct_exit(int code) {
   notify_vm_shutdown();
+  os::wait_for_keypress_at_exit();
   ::exit(code);
 }
 
@@ -577,11 +578,13 @@
 void vm_shutdown()
 {
   vm_perform_shutdown_actions();
+  os::wait_for_keypress_at_exit();
   os::shutdown();
 }
 
 void vm_abort(bool dump_core) {
   vm_perform_shutdown_actions();
+  os::wait_for_keypress_at_exit();
   os::abort(dump_core);
   ShouldNotReachHere();
 }
--- a/hotspot/src/share/vm/runtime/os.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/os.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -633,10 +633,10 @@
       *q = (u_char)freeBlockPad;
     }
     if (PrintMalloc && tty != NULL)
-      fprintf(stderr, "os::free " SIZE_FORMAT " bytes --> " PTR_FORMAT "\n", size, memblock);
+      fprintf(stderr, "os::free " SIZE_FORMAT " bytes --> " PTR_FORMAT "\n", size, (uintptr_t)memblock);
   } else if (PrintMalloc && tty != NULL) {
     // tty->print_cr("os::free %p", memblock);
-    fprintf(stderr, "os::free " PTR_FORMAT "\n", memblock);
+    fprintf(stderr, "os::free " PTR_FORMAT "\n", (uintptr_t)memblock);
   }
 #endif
   ::free((char*)memblock - space_before);
--- a/hotspot/src/share/vm/runtime/os.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/os.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -492,6 +492,12 @@
   static void print_location(outputStream* st, intptr_t x, bool verbose = false);
   static size_t lasterror(char *buf, size_t len);
 
+  // Determines whether the calling process is being debugged by a user-mode debugger.
+  static bool is_debugger_attached();
+
+  // wait for a key press if PauseAtExit is set
+  static void wait_for_keypress_at_exit(void);
+
   // The following two functions are used by fatal error handler to trace
   // native (C) frames. They are not part of frame.hpp/frame.cpp because
   // frame.hpp/cpp assume thread is JavaThread, and also because different
--- a/hotspot/src/share/vm/runtime/serviceThread.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/serviceThread.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -70,11 +70,10 @@
     java_lang_Thread::set_priority(thread_oop(), NearMaxPriority);
     java_lang_Thread::set_daemon(thread_oop());
     thread->set_threadObj(thread_oop());
+    _instance = thread;
 
     Threads::add(thread);
     Thread::start(thread);
-
-    _instance = thread;
   }
 }
 
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -431,25 +431,24 @@
 // previous frame depending on the return address.
 
 address SharedRuntime::raw_exception_handler_for_return_address(JavaThread* thread, address return_address) {
-  assert(frame::verify_return_pc(return_address), "must be a return pc");
-
-  // Reset MethodHandle flag.
+  assert(frame::verify_return_pc(return_address), err_msg("must be a return address: " INTPTR_FORMAT, return_address));
+
+  // Reset method handle flag.
   thread->set_is_method_handle_return(false);
 
-  // the fastest case first
+  // The fastest case first
   CodeBlob* blob = CodeCache::find_blob(return_address);
-  if (blob != NULL && blob->is_nmethod()) {
-    nmethod* code = (nmethod*)blob;
-    assert(code != NULL, "nmethod must be present");
-    // Check if the return address is a MethodHandle call site.
-    thread->set_is_method_handle_return(code->is_method_handle_return(return_address));
+  nmethod* nm = (blob != NULL) ? blob->as_nmethod_or_null() : NULL;
+  if (nm != NULL) {
+    // Set flag if return address is a method handle call site.
+    thread->set_is_method_handle_return(nm->is_method_handle_return(return_address));
     // native nmethods don't have exception handlers
-    assert(!code->is_native_method(), "no exception handler");
-    assert(code->header_begin() != code->exception_begin(), "no exception handler");
-    if (code->is_deopt_pc(return_address)) {
+    assert(!nm->is_native_method(), "no exception handler");
+    assert(nm->header_begin() != nm->exception_begin(), "no exception handler");
+    if (nm->is_deopt_pc(return_address)) {
       return SharedRuntime::deopt_blob()->unpack_with_exception();
     } else {
-      return code->exception_begin();
+      return nm->exception_begin();
     }
   }
 
@@ -462,22 +461,9 @@
     return Interpreter::rethrow_exception_entry();
   }
 
-  // Compiled code
-  if (CodeCache::contains(return_address)) {
-    CodeBlob* blob = CodeCache::find_blob(return_address);
-    if (blob->is_nmethod()) {
-      nmethod* code = (nmethod*)blob;
-      assert(code != NULL, "nmethod must be present");
-      // Check if the return address is a MethodHandle call site.
-      thread->set_is_method_handle_return(code->is_method_handle_return(return_address));
-      assert(code->header_begin() != code->exception_begin(), "no exception handler");
-      return code->exception_begin();
-    }
-    if (blob->is_runtime_stub()) {
-      ShouldNotReachHere();   // callers are responsible for skipping runtime stub frames
-    }
-  }
+  guarantee(blob == NULL || !blob->is_runtime_stub(), "caller should have skipped stub");
   guarantee(!VtableStubs::contains(return_address), "NULL exceptions in vtables should have been handled already!");
+
 #ifndef PRODUCT
   { ResourceMark rm;
     tty->print_cr("No exception handler found for exception at " INTPTR_FORMAT " - potential problems:", return_address);
@@ -485,6 +471,7 @@
     tty->print_cr("b) other problem");
   }
 #endif // PRODUCT
+
   ShouldNotReachHere();
   return NULL;
 }
--- a/hotspot/src/share/vm/runtime/stubRoutines.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,30 +80,36 @@
 jint    StubRoutines::_fpu_subnormal_bias2[3]                   = { 0, 0, 0 };
 
 // Compiled code entry points default values
-// The dafault functions don't have separate disjoint versions.
+// The default functions don't have separate disjoint versions.
 address StubRoutines::_jbyte_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jbyte_copy);
 address StubRoutines::_jshort_arraycopy         = CAST_FROM_FN_PTR(address, StubRoutines::jshort_copy);
 address StubRoutines::_jint_arraycopy           = CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
 address StubRoutines::_jlong_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jlong_copy);
 address StubRoutines::_oop_arraycopy            = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy);
+address StubRoutines::_oop_arraycopy_uninit     = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy_uninit);
 address StubRoutines::_jbyte_disjoint_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jbyte_copy);
 address StubRoutines::_jshort_disjoint_arraycopy         = CAST_FROM_FN_PTR(address, StubRoutines::jshort_copy);
 address StubRoutines::_jint_disjoint_arraycopy           = CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
 address StubRoutines::_jlong_disjoint_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jlong_copy);
 address StubRoutines::_oop_disjoint_arraycopy            = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy);
+address StubRoutines::_oop_disjoint_arraycopy_uninit     = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy_uninit);
 
 address StubRoutines::_arrayof_jbyte_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jbyte_copy);
 address StubRoutines::_arrayof_jshort_arraycopy = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jshort_copy);
 address StubRoutines::_arrayof_jint_arraycopy   = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jint_copy);
 address StubRoutines::_arrayof_jlong_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jlong_copy);
 address StubRoutines::_arrayof_oop_arraycopy    = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy);
+address StubRoutines::_arrayof_oop_arraycopy_uninit      = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy_uninit);
 address StubRoutines::_arrayof_jbyte_disjoint_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jbyte_copy);
 address StubRoutines::_arrayof_jshort_disjoint_arraycopy = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jshort_copy);
 address StubRoutines::_arrayof_jint_disjoint_arraycopy   = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jint_copy);
 address StubRoutines::_arrayof_jlong_disjoint_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jlong_copy);
-address StubRoutines::_arrayof_oop_disjoint_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy);
+address StubRoutines::_arrayof_oop_disjoint_arraycopy    = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy);
+address StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy_uninit);
+
 
 address StubRoutines::_checkcast_arraycopy               = NULL;
+address StubRoutines::_checkcast_arraycopy_uninit        = NULL;
 address StubRoutines::_unsafe_arraycopy                  = NULL;
 address StubRoutines::_generic_arraycopy                 = NULL;
 
@@ -282,12 +288,12 @@
 // Default versions of arraycopy functions
 //
 
-static void gen_arraycopy_barrier_pre(oop* dest, size_t count) {
+static void gen_arraycopy_barrier_pre(oop* dest, size_t count, bool dest_uninitialized) {
     assert(count != 0, "count should be non-zero");
     assert(count <= (size_t)max_intx, "count too large");
     BarrierSet* bs = Universe::heap()->barrier_set();
     assert(bs->has_write_ref_array_pre_opt(), "Must have pre-barrier opt");
-    bs->write_ref_array_pre(dest, (int)count);
+    bs->write_ref_array_pre(dest, (int)count, dest_uninitialized);
 }
 
 static void gen_arraycopy_barrier(oop* dest, size_t count) {
@@ -330,7 +336,17 @@
   SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
 #endif // !PRODUCT
   assert(count != 0, "count should be non-zero");
-  gen_arraycopy_barrier_pre(dest, count);
+  gen_arraycopy_barrier_pre(dest, count, /*dest_uninitialized*/false);
+  Copy::conjoint_oops_atomic(src, dest, count);
+  gen_arraycopy_barrier(dest, count);
+JRT_END
+
+JRT_LEAF(void, StubRoutines::oop_copy_uninit(oop* src, oop* dest, size_t count))
+#ifndef PRODUCT
+  SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
+#endif // !PRODUCT
+  assert(count != 0, "count should be non-zero");
+  gen_arraycopy_barrier_pre(dest, count, /*dest_uninitialized*/true);
   Copy::conjoint_oops_atomic(src, dest, count);
   gen_arraycopy_barrier(dest, count);
 JRT_END
@@ -368,11 +384,20 @@
   SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
 #endif // !PRODUCT
   assert(count != 0, "count should be non-zero");
-  gen_arraycopy_barrier_pre((oop *) dest, count);
+  gen_arraycopy_barrier_pre((oop *) dest, count, /*dest_uninitialized*/false);
   Copy::arrayof_conjoint_oops(src, dest, count);
   gen_arraycopy_barrier((oop *) dest, count);
 JRT_END
 
+JRT_LEAF(void, StubRoutines::arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count))
+#ifndef PRODUCT
+  SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
+#endif // !PRODUCT
+  assert(count != 0, "count should be non-zero");
+  gen_arraycopy_barrier_pre((oop *) dest, count, /*dest_uninitialized*/true);
+  Copy::arrayof_conjoint_oops(src, dest, count);
+  gen_arraycopy_barrier((oop *) dest, count);
+JRT_END
 
 address StubRoutines::select_fill_function(BasicType t, bool aligned, const char* &name) {
 #define RETURN_STUB(xxx_fill) { \
--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -164,12 +164,12 @@
   static address _jshort_arraycopy;
   static address _jint_arraycopy;
   static address _jlong_arraycopy;
-  static address _oop_arraycopy;
+  static address _oop_arraycopy, _oop_arraycopy_uninit;
   static address _jbyte_disjoint_arraycopy;
   static address _jshort_disjoint_arraycopy;
   static address _jint_disjoint_arraycopy;
   static address _jlong_disjoint_arraycopy;
-  static address _oop_disjoint_arraycopy;
+  static address _oop_disjoint_arraycopy, _oop_disjoint_arraycopy_uninit;
 
   // arraycopy operands aligned on zero'th element boundary
   // These are identical to the ones aligned aligned on an
@@ -179,15 +179,15 @@
   static address _arrayof_jshort_arraycopy;
   static address _arrayof_jint_arraycopy;
   static address _arrayof_jlong_arraycopy;
-  static address _arrayof_oop_arraycopy;
+  static address _arrayof_oop_arraycopy, _arrayof_oop_arraycopy_uninit;
   static address _arrayof_jbyte_disjoint_arraycopy;
   static address _arrayof_jshort_disjoint_arraycopy;
   static address _arrayof_jint_disjoint_arraycopy;
   static address _arrayof_jlong_disjoint_arraycopy;
-  static address _arrayof_oop_disjoint_arraycopy;
+  static address _arrayof_oop_disjoint_arraycopy, _arrayof_oop_disjoint_arraycopy_uninit;
 
   // these are recommended but optional:
-  static address _checkcast_arraycopy;
+  static address _checkcast_arraycopy, _checkcast_arraycopy_uninit;
   static address _unsafe_arraycopy;
   static address _generic_arraycopy;
 
@@ -286,26 +286,36 @@
   static address jshort_arraycopy() { return _jshort_arraycopy; }
   static address jint_arraycopy()   { return _jint_arraycopy; }
   static address jlong_arraycopy()  { return _jlong_arraycopy; }
-  static address oop_arraycopy()    { return _oop_arraycopy; }
+  static address oop_arraycopy(bool dest_uninitialized = false) {
+    return dest_uninitialized ? _oop_arraycopy_uninit : _oop_arraycopy;
+  }
   static address jbyte_disjoint_arraycopy()  { return _jbyte_disjoint_arraycopy; }
   static address jshort_disjoint_arraycopy() { return _jshort_disjoint_arraycopy; }
   static address jint_disjoint_arraycopy()   { return _jint_disjoint_arraycopy; }
   static address jlong_disjoint_arraycopy()  { return _jlong_disjoint_arraycopy; }
-  static address oop_disjoint_arraycopy()    { return _oop_disjoint_arraycopy; }
+  static address oop_disjoint_arraycopy(bool dest_uninitialized = false) {
+    return dest_uninitialized ?  _oop_disjoint_arraycopy_uninit : _oop_disjoint_arraycopy;
+  }
 
   static address arrayof_jbyte_arraycopy()  { return _arrayof_jbyte_arraycopy; }
   static address arrayof_jshort_arraycopy() { return _arrayof_jshort_arraycopy; }
   static address arrayof_jint_arraycopy()   { return _arrayof_jint_arraycopy; }
   static address arrayof_jlong_arraycopy()  { return _arrayof_jlong_arraycopy; }
-  static address arrayof_oop_arraycopy()    { return _arrayof_oop_arraycopy; }
+  static address arrayof_oop_arraycopy(bool dest_uninitialized = false) {
+    return dest_uninitialized ? _arrayof_oop_arraycopy_uninit : _arrayof_oop_arraycopy;
+  }
 
   static address arrayof_jbyte_disjoint_arraycopy()  { return _arrayof_jbyte_disjoint_arraycopy; }
   static address arrayof_jshort_disjoint_arraycopy() { return _arrayof_jshort_disjoint_arraycopy; }
   static address arrayof_jint_disjoint_arraycopy()   { return _arrayof_jint_disjoint_arraycopy; }
   static address arrayof_jlong_disjoint_arraycopy()  { return _arrayof_jlong_disjoint_arraycopy; }
-  static address arrayof_oop_disjoint_arraycopy()    { return _arrayof_oop_disjoint_arraycopy; }
+  static address arrayof_oop_disjoint_arraycopy(bool dest_uninitialized = false) {
+    return dest_uninitialized ? _arrayof_oop_disjoint_arraycopy_uninit : _arrayof_oop_disjoint_arraycopy;
+  }
 
-  static address checkcast_arraycopy()     { return _checkcast_arraycopy; }
+  static address checkcast_arraycopy(bool dest_uninitialized = false) {
+    return dest_uninitialized ? _checkcast_arraycopy_uninit : _checkcast_arraycopy;
+  }
   static address unsafe_arraycopy()        { return _unsafe_arraycopy; }
   static address generic_arraycopy()       { return _generic_arraycopy; }
 
@@ -352,17 +362,19 @@
   // Default versions of the above arraycopy functions for platforms which do
   // not have specialized versions
   //
-  static void jbyte_copy (jbyte*  src, jbyte*  dest, size_t count);
-  static void jshort_copy(jshort* src, jshort* dest, size_t count);
-  static void jint_copy  (jint*   src, jint*   dest, size_t count);
-  static void jlong_copy (jlong*  src, jlong*  dest, size_t count);
-  static void oop_copy   (oop*    src, oop*    dest, size_t count);
+  static void jbyte_copy     (jbyte*  src, jbyte*  dest, size_t count);
+  static void jshort_copy    (jshort* src, jshort* dest, size_t count);
+  static void jint_copy      (jint*   src, jint*   dest, size_t count);
+  static void jlong_copy     (jlong*  src, jlong*  dest, size_t count);
+  static void oop_copy       (oop*    src, oop*    dest, size_t count);
+  static void oop_copy_uninit(oop*    src, oop*    dest, size_t count);
 
-  static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count);
-  static void arrayof_jshort_copy(HeapWord* src, HeapWord* dest, size_t count);
-  static void arrayof_jint_copy  (HeapWord* src, HeapWord* dest, size_t count);
-  static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count);
-  static void arrayof_oop_copy   (HeapWord* src, HeapWord* dest, size_t count);
+  static void arrayof_jbyte_copy     (HeapWord* src, HeapWord* dest, size_t count);
+  static void arrayof_jshort_copy    (HeapWord* src, HeapWord* dest, size_t count);
+  static void arrayof_jint_copy      (HeapWord* src, HeapWord* dest, size_t count);
+  static void arrayof_jlong_copy     (HeapWord* src, HeapWord* dest, size_t count);
+  static void arrayof_oop_copy       (HeapWord* src, HeapWord* dest, size_t count);
+  static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count);
 };
 
 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP
--- a/hotspot/src/share/vm/runtime/sweeper.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/sweeper.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -426,9 +426,7 @@
       tty->vprint(format, ap);
       va_end(ap);
     }
-    tty->print_cr(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
-                  " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
-                  CodeCache::nof_blobs(), CodeCache::nof_nmethods(), CodeCache::nof_adapters(), CodeCache::unallocated_capacity());
+    CodeCache::log_state(tty); tty->cr();
   }
 
   if (LogCompilation && (xtty != NULL)) {
@@ -440,9 +438,7 @@
       xtty->vprint(format, ap);
       va_end(ap);
     }
-    xtty->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
-                " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
-                CodeCache::nof_blobs(), CodeCache::nof_nmethods(), CodeCache::nof_adapters(), CodeCache::unallocated_capacity());
+    CodeCache::log_state(xtty);
     xtty->stamp();
     xtty->end_elem();
   }
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -3644,6 +3644,7 @@
   if (ShowMessageBoxOnError && is_error_reported()) {
     os::infinite_sleep();
   }
+  os::wait_for_keypress_at_exit();
 
   if (JDK_Version::is_jdk12x_version()) {
     // We are the last thread running, so check if finalizers should be run.
--- a/hotspot/src/share/vm/utilities/debug.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/debug.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_UTILITIES_DEBUG_HPP
 #define SHARE_VM_UTILITIES_DEBUG_HPP
 
+#include "prims/jvm.h"
 #include "utilities/globalDefinitions.hpp"
 
 #include <stdarg.h>
@@ -48,7 +49,7 @@
 FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) {
   va_list argp;
   va_start(argp, format);
-  vsnprintf(_buf, bufsz, format, argp);
+  jio_vsnprintf(_buf, bufsz, format, argp);
   va_end(argp);
 }
 
@@ -61,7 +62,7 @@
 
   va_list argp;
   va_start(argp, format);
-  vsnprintf(buf_end, bufsz - len, format, argp);
+  jio_vsnprintf(buf_end, bufsz - len, format, argp);
   va_end(argp);
 }
 
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1185,7 +1185,7 @@
 // '%d' formats to indicate a 64-bit quantity; commonly "l" (in LP64) or "ll"
 // (in ILP32).
 
-#define BOOL_TO_STR(__b) (__b) ? "true" : "false"
+#define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false")
 
 // Format 32-bit quantities.
 #define INT32_FORMAT  "%d"
--- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -77,6 +77,7 @@
 # endif
 
 #ifdef LINUX
+#define __STDC_LIMIT_MACROS
 #include <inttypes.h>
 #include <signal.h>
 #include <ucontext.h>
--- a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -148,6 +148,17 @@
 #endif
 #endif
 
+// On solaris 8, UINTPTR_MAX is defined as empty.
+// Everywhere else it's an actual value.
+#if UINTPTR_MAX - 1 == -1
+#undef UINTPTR_MAX
+#ifdef _LP64
+#define UINTPTR_MAX UINT64_MAX
+#else
+#define UINTPTR_MAX UINT32_MAX
+#endif /* ifdef _LP64 */
+#endif
+
 // Additional Java basic types
 
 typedef unsigned char      jubyte;
--- a/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -41,6 +41,7 @@
 # include <stdio.h> // for va_list
 # include <time.h>
 # include <fcntl.h>
+# include <limits.h>
 // Need this on windows to get the math constants (e.g., M_PI).
 #define _USE_MATH_DEFINES
 # include <math.h>
@@ -99,6 +100,14 @@
 typedef signed   int ssize_t;
 #endif
 
+#ifndef UINTPTR_MAX
+#ifdef _WIN64
+#define UINTPTR_MAX _UI64_MAX
+#else
+#define UINTPTR_MAX _UI32_MAX
+#endif
+#endif
+
 //----------------------------------------------------------------------------------------------------
 // Additional Java basic types
 
--- a/hotspot/src/share/vm/utilities/macros.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/macros.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -161,6 +161,14 @@
 #define NOT_WINDOWS(code) code
 #endif
 
+#ifdef _WIN64
+#define WIN64_ONLY(code) code
+#define NOT_WIN64(code)
+#else
+#define WIN64_ONLY(code)
+#define NOT_WIN64(code) code
+#endif
+
 #if defined(IA32) || defined(AMD64)
 #define X86
 #define X86_ONLY(code) code
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -802,7 +802,7 @@
     first_error_tid = mytid;
     set_error_reported();
 
-    if (ShowMessageBoxOnError) {
+    if (ShowMessageBoxOnError || PauseAtExit) {
       show_message_box(buffer, sizeof(buffer));
 
       // User has asked JVM to abort. Reset ShowMessageBoxOnError so the
--- a/hotspot/src/share/vm/utilities/workgroup.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/workgroup.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -156,7 +156,7 @@
     tty->print_cr("/nFinished work gang %s: %d/%d sequence %d",
                   name(), finished_workers(), total_workers(),
                   _sequence_number);
-    }
+  }
 }
 
 void AbstractWorkGang::stop() {
--- a/hotspot/src/share/vm/utilities/workgroup.hpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/hotspot/src/share/vm/utilities/workgroup.hpp	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,20 @@
 # include "thread_windows.inline.hpp"
 #endif
 
+// Task class hierarchy:
+//   AbstractGangTask
+//     AbstractGangTaskWOopQueues
+//
+// Gang/Group class hierarchy:
+//   AbstractWorkGang
+//     WorkGang
+//       FlexibleWorkGang
+//         YieldingFlexibleWorkGang (defined in another file)
+//
+// Worker class hierarchy:
+//   GangWorker (subclass of WorkerThread)
+//     YieldingFlexibleGangWorker   (defined in another file)
+
 // Forward declarations of classes defined here
 
 class WorkGang;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/6942326/Test.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,409 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6942326
+ * @summary x86 code in string_indexof() could read beyond reserved heap space
+ *
+ * @run main/othervm/timeout=300 -Xmx32m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=exclude,Test,main -XX:CompileCommand=exclude,Test,test_varsub_indexof -XX:CompileCommand=exclude,Test,test_varstr_indexof -XX:CompileCommand=exclude,Test,test_missub_indexof -XX:CompileCommand=exclude,Test,test_consub_indexof -XX:CompileCommand=exclude,Test,test_conmis_indexof -XX:CompileCommand=exclude,Test,test_subcon Test
+ *
+ */
+
+public class Test {
+
+    static String[] strings = new String[1024];
+    private static final int ITERATIONS = 100000;
+
+    public static void main(String[] args) {
+
+        long start_total = System.currentTimeMillis();
+
+        // search variable size substring in string (33 chars).
+        String a = " 1111111111111xx1111111111111xx11y"; // +1 to execute a.substring(1) first
+        String b =  "1111111111111xx1111111111111xx11y";
+        test_varsub_indexof(a, b);
+
+        // search variable size substring in string (32 chars).
+        a = " 1111111111111xx1111111111111xx1y";
+        b =  "1111111111111xx1111111111111xx1y";
+        test_varsub_indexof(a, b);
+
+        // search variable size substring in string (17 chars).
+        a = " 1111111111111xx1y";
+        b =  "1111111111111xx1y";
+        test_varsub_indexof(a, b);
+
+        // search variable size substring in string (16 chars).
+        a = " 111111111111xx1y";
+        b =  "111111111111xx1y";
+        test_varsub_indexof(a, b);
+
+        // search variable size substring in string (8 chars).
+        a = " 1111xx1y";
+        b =  "1111xx1y";
+        test_varsub_indexof(a, b);
+
+        // search variable size substring in string (7 chars).
+        a = " 111xx1y";
+        b =  "111xx1y";
+        test_varsub_indexof(a, b);
+
+
+
+        // search substring (17 chars) in variable size string.
+        a =                 "1111111111111xx1x";
+        b = " 1111111111111xx1111111111111xx1x"; // +1 to execute b.substring(1) first
+        test_varstr_indexof(a, b);
+
+        // search substring (16 chars) in variable size string.
+        a =                  "111111111111xx1x";
+        b = " 1111111111111xx1111111111111xx1x";
+        test_varstr_indexof(a, b);
+
+        // search substring (9 chars) in variable size string.
+        a =                         "11111xx1x";
+        b = " 1111111111111xx1111111111111xx1x";
+        test_varstr_indexof(a, b);
+
+        // search substring (8 chars) in variable size string.
+        a =                          "1111xx1x";
+        b = " 1111111111111xx1111111111111xx1x";
+        test_varstr_indexof(a, b);
+
+        // search substring (4 chars) in variable size string.
+        a =                              "xx1x";
+        b = " 1111111111111xx1111111111111xx1x";
+        test_varstr_indexof(a, b);
+
+        // search substring (3 chars) in variable size string.
+        a =                               "x1x";
+        b = " 1111111111111xx1111111111111xx1x";
+        test_varstr_indexof(a, b);
+
+        // search substring (2 chars) in variable size string.
+        a =                                "1y";
+        b = " 1111111111111xx1111111111111xx1y";
+        test_varstr_indexof(a, b);
+
+
+
+        // search non matching variable size substring in string (33 chars).
+        a = " 1111111111111xx1111111111111xx11z"; // +1 to execute a.substring(1) first
+        b =  "1111111111111xx1111111111111xx11y";
+        test_missub_indexof(a, b);
+
+        // search non matching variable size substring in string (32 chars).
+        a = " 1111111111111xx1111111111111xx1z";
+        b =  "1111111111111xx1111111111111xx1y";
+        test_missub_indexof(a, b);
+
+        // search non matching variable size substring in string (17 chars).
+        a = " 1111111111111xx1z";
+        b =  "1111111111111xx1y";
+        test_missub_indexof(a, b);
+
+        // search non matching variable size substring in string (16 chars).
+        a = " 111111111111xx1z";
+        b =  "111111111111xx1y";
+        test_missub_indexof(a, b);
+
+        // search non matching variable size substring in string (8 chars).
+        a = " 1111xx1z";
+        b =  "1111xx1y";
+        test_missub_indexof(a, b);
+
+        // search non matching variable size substring in string (7 chars).
+        a = " 111xx1z";
+        b =  "111xx1y";
+        test_missub_indexof(a, b);
+
+
+
+        // Testing constant substring search in variable size string.
+
+        // search constant substring (17 chars).
+        b = " 1111111111111xx1111111111111xx1x"; // +1 to execute b.substring(1) first
+        TestCon tc = new TestCon17();
+        test_consub_indexof(tc, b);
+
+        // search constant substring (16 chars).
+        b = " 1111111111111xx1111111111111xx1x";
+        tc = new TestCon16();
+        test_consub_indexof(tc, b);
+
+        // search constant substring (9 chars).
+        b = " 1111111111111xx1111111111111xx1x";
+        tc = new TestCon9();
+        test_consub_indexof(tc, b);
+
+        // search constant substring (8 chars).
+        b = " 1111111111111xx1111111111111xx1x";
+        tc = new TestCon8();
+        test_consub_indexof(tc, b);
+
+        // search constant substring (4 chars).
+        b = " 1111111111111xx1111111111111xx1x";
+        tc = new TestCon4();
+        test_consub_indexof(tc, b);
+
+        // search constant substring (3 chars).
+        b = " 1111111111111xx1111111111111xx1x";
+        tc = new TestCon3();
+        test_consub_indexof(tc, b);
+
+        // search constant substring (2 chars).
+        b = " 1111111111111xx1111111111111xx1y";
+        tc = new TestCon2();
+        test_consub_indexof(tc, b);
+
+        // search constant substring (1 chars).
+        b = " 1111111111111xx1111111111111xx1y";
+        tc = new TestCon1();
+        test_consub_indexof(tc, b);
+
+
+        // search non matching constant substring (17 chars).
+        b = " 1111111111111xx1111111111111xx1z"; // +1 to execute b.substring(1) first
+        tc = new TestCon17();
+        test_conmis_indexof(tc, b);
+
+        // search non matching constant substring (16 chars).
+        b = " 1111111111111xx1111111111111xx1z";
+        tc = new TestCon16();
+        test_conmis_indexof(tc, b);
+
+        // search non matching constant substring (9 chars).
+        b = " 1111111111111xx1111111111111xx1z";
+        tc = new TestCon9();
+        test_conmis_indexof(tc, b);
+
+        // search non matching constant substring (8 chars).
+        b = " 1111111111111xx1111111111111xx1z";
+        tc = new TestCon8();
+        test_conmis_indexof(tc, b);
+
+        // search non matching constant substring (4 chars).
+        b = " 1111111111111xx1111111111111xx1z";
+        tc = new TestCon4();
+        test_conmis_indexof(tc, b);
+
+        // search non matching constant substring (3 chars).
+        b = " 1111111111111xx1111111111111xx1z";
+        tc = new TestCon3();
+        test_conmis_indexof(tc, b);
+
+        // search non matching constant substring (2 chars).
+        b = " 1111111111111xx1111111111111xx1z";
+        tc = new TestCon2();
+        test_conmis_indexof(tc, b);
+
+        // search non matching constant substring (1 chars).
+        b = " 1111111111111xx1111111111111xx1z";
+        tc = new TestCon1();
+        test_conmis_indexof(tc, b);
+
+        long end_total = System.currentTimeMillis();
+        System.out.println("End run time: " + (end_total - start_total));
+
+    }
+
+    public static long test_init(String a, String b) {
+        for (int i = 0; i < 512; i++) {
+            strings[i * 2] = new String(b.toCharArray());
+            strings[i * 2 + 1] = new String(a.toCharArray());
+        }
+        System.out.print(a.length() + " " + b.length() + " ");
+        return System.currentTimeMillis();
+    }
+
+    public static void test_end(String a, String b, int v, int expected, long start) {
+        long end = System.currentTimeMillis();
+        int res = (v/ITERATIONS);
+        System.out.print(" " + res);
+        System.out.println(" time:" + (end - start));
+        if (res != expected) {
+            System.out.println("wrong indexOf result: " + res + ", expected " + expected);
+            System.out.println("\"" + b + "\".indexOf(\"" + a + "\")");
+            System.exit(97);
+        }
+    }
+
+    public static int test_subvar() {
+        int s = 0;
+        int v = 0;
+        for (int i = 0; i < ITERATIONS; i++) {
+            v += strings[s].indexOf(strings[s + 1]);
+            s += 2;
+            if (s >= strings.length) s = 0;
+        }
+        return v;
+    }
+
+    public static void test_varsub_indexof(String a, String b) {
+        System.out.println("Start search variable size substring in string (" + b.length() + " chars)");
+        long start_it = System.currentTimeMillis();
+        int limit = 1; // last a.length() == 1
+        while (a.length() > limit) {
+            a = a.substring(1);
+            long start = test_init(a, b);
+            int v = test_subvar();
+            test_end(a, b, v, (b.length() - a.length()), start);
+        }
+        long end_it = System.currentTimeMillis();
+        System.out.println("End search variable size substring in string (" + b.length() + " chars), time: " + (end_it - start_it));
+    }
+
+    public static void test_varstr_indexof(String a, String b) {
+        System.out.println("Start search substring (" + a.length() + " chars) in variable size string");
+        long start_it = System.currentTimeMillis();
+        int limit = a.length();
+        while (b.length() > limit) {
+            b = b.substring(1);
+            long start = test_init(a, b);
+            int v = test_subvar();
+            test_end(a, b, v, (b.length() - a.length()), start);
+        }
+        long end_it = System.currentTimeMillis();
+        System.out.println("End search substring (" + a.length() + " chars) in variable size string, time: " + (end_it - start_it));
+    }
+
+    public static void test_missub_indexof(String a, String b) {
+        System.out.println("Start search non matching variable size substring in string (" + b.length() + " chars)");
+        long start_it = System.currentTimeMillis();
+        int limit = 1; // last a.length() == 1
+        while (a.length() > limit) {
+            a = a.substring(1);
+            long start = test_init(a, b);
+            int v = test_subvar();
+            test_end(a, b, v, (-1), start);
+        }
+        long end_it = System.currentTimeMillis();
+        System.out.println("End search non matching variable size substring in string (" + b.length() + " chars), time: " + (end_it - start_it));
+    }
+
+
+
+    public static void test_consub_indexof(TestCon tc, String b) {
+        System.out.println("Start search constant substring (" + tc.constr().length() + " chars)");
+        long start_it = System.currentTimeMillis();
+        int limit = tc.constr().length();
+        while (b.length() > limit) {
+            b = b.substring(1);
+            long start = test_init(tc.constr(), b);
+            int v = test_subcon(tc);
+            test_end(tc.constr(), b, v, (b.length() - tc.constr().length()), start);
+        }
+        long end_it = System.currentTimeMillis();
+        System.out.println("End search constant substring (" + tc.constr().length() + " chars), time: " + (end_it - start_it));
+    }
+
+    public static void test_conmis_indexof(TestCon tc, String b) {
+        System.out.println("Start search non matching constant substring (" + tc.constr().length() + " chars)");
+        long start_it = System.currentTimeMillis();
+        int limit = tc.constr().length();
+        while (b.length() > limit) {
+            b = b.substring(1);
+            long start = test_init(tc.constr(), b);
+            int v = test_subcon(tc);
+            test_end(tc.constr(), b, v, (-1), start);
+        }
+        long end_it = System.currentTimeMillis();
+        System.out.println("End search non matching constant substring (" + tc.constr().length() + " chars), time: " + (end_it - start_it));
+    }
+
+    public static int test_subcon(TestCon tc) {
+        int s = 0;
+        int v = 0;
+        for (int i = 0; i < ITERATIONS; i++) {
+            v += tc.indexOf(strings[s]);
+            s += 2;
+            if (s >= strings.length) s = 0;
+        }
+        return v;
+    }
+
+    private interface TestCon {
+        public String constr();
+        public int indexOf(String str);
+    }
+
+    // search constant substring (17 chars).
+    private final static class TestCon17 implements TestCon {
+        private static final String constr = "1111111111111xx1x";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+
+    // search constant substring (16 chars).
+    private final static class TestCon16 implements TestCon {
+        private static final String constr = "111111111111xx1x";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+
+    // search constant substring (9 chars).
+    private final static class TestCon9 implements TestCon {
+        private static final String constr = "11111xx1x";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+
+    // search constant substring (8 chars).
+    private final static class TestCon8 implements TestCon {
+        private static final String constr = "1111xx1x";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+
+    // search constant substring (4 chars).
+    private final static class TestCon4 implements TestCon {
+        private static final String constr = "xx1x";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+
+    // search constant substring (3 chars).
+    private final static class TestCon3 implements TestCon {
+        private static final String constr = "x1x";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+
+    // search constant substring (2 chars).
+    private final static class TestCon2 implements TestCon {
+        private static final String constr = "1y";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+
+
+    // search constant substring (1 chars).
+    private final static class TestCon1 implements TestCon {
+        private static final String constr = "y";
+        public String constr() { return constr; }
+        public int indexOf(String str) { return str.indexOf(constr); }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/6878713/Test6878713.sh	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+##
+## @test
+## @bug 6878713
+## @summary Verifier heap corruption, relating to backward jsrs
+## @run shell/timeout=120 Test6878713.sh
+##
+
+if [ "${TESTSRC}" = "" ]
+then TESTSRC=.
+fi
+
+if [ "${TESTJAVA}" = "" ]
+then
+  PARENT=`dirname \`which java\``
+  TESTJAVA=`dirname ${PARENT}`
+  echo "TESTJAVA not set, selecting " ${TESTJAVA}
+  echo "If this is incorrect, try setting the variable manually."
+fi
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+BIT_FLAG=""
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux )
+    NULL=/dev/null
+    PS=":"
+    FS="/"
+    ## for solaris, linux it's HOME
+    FILE_LOCATION=$HOME
+    if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
+    then
+        BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT | grep -v '^#'`
+    fi
+    ;;
+  Windows_* )
+    NULL=NUL
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+JEMMYPATH=${CPAPPEND}
+CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
+
+THIS_DIR=`pwd`
+
+${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -version
+
+${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar
+
+${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} OOMCrashClass1960_2 > test.out 2>&1
+
+if [ -s core -o -s "hs_*.log" ]
+then
+    cat hs*.log
+    echo "Test Failed"
+    exit 1
+else
+    echo "Test Passed"
+    exit 0
+fi
Binary file hotspot/test/runtime/6878713/testcase.jar has changed
--- a/jaxp/.hgtags	Wed Mar 16 17:21:52 2011 -0700
+++ b/jaxp/.hgtags	Fri Mar 18 11:00:10 2011 -0700
@@ -107,3 +107,5 @@
 ab107c1bc4b918404b191838c455e9b2892389f3 jdk7-b130
 eab6f27131e4e2f0af0016b35b18ae65cdd249d9 jdk7-b131
 abe04c59a556a3821c30bd8839e3c74f5d4281d1 jdk7-b132
+8e1148c7911b02e00a727461525f239da025cab7 jdk7-b133
+d56b326ae0544fc16c3e0d0285876f3c82054db2 jdk7-b134
--- a/jaxp/jaxp.properties	Wed Mar 16 17:21:52 2011 -0700
+++ b/jaxp/jaxp.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -25,13 +25,13 @@
 
 drops.master.copy.base=${drops.dir}
 
-jaxp_src.bundle.name=jaxp-1_4_5-dev.zip
-jaxp_src.bundle.md5.checksum=84e2c26853262c9144133c6ff7ef5dc9
+jaxp_src.bundle.name=jaxp-1_4_5-dev1.zip
+jaxp_src.bundle.md5.checksum=53c95613c29852a12b93e7249f1aa227
 jaxp_src.master.bundle.dir=${drops.master.copy.base}
 jaxp_src.master.bundle.url.base=http://download.java.net/jaxp/1.4.5/dev
 
-jaxp_tests.bundle.name=jaxp-1_4_5-dev-unittests.zip
-jaxp_tests.bundle.md5.checksum=0377e715fa21814cb8006768c5967dc5
+jaxp_tests.bundle.name=jaxp-1_4_5-dev1-unittests.zip
+jaxp_tests.bundle.md5.checksum=754aaba2f4944f69bfea91dec11daf4c
 jaxp_tests.master.bundle.dir=${drops.master.copy.base}
 jaxp_tests.master.bundle.url.base=http://download.java.net/jaxp/1.4.5/dev
 
--- a/jaxp/make/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jaxp/make/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -136,7 +136,7 @@
 else
   ANT = ant
   ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
-    $(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH")
+    $(error "'ant' not found; please set ANT_HOME or put 'ant' on your PATH")
   endif
 endif
 
--- a/jaxws/.hgtags	Wed Mar 16 17:21:52 2011 -0700
+++ b/jaxws/.hgtags	Fri Mar 18 11:00:10 2011 -0700
@@ -107,3 +107,5 @@
 ba1fac1c2083196422a12130db174334179a4d44 jdk7-b130
 438abc0356cd97d91b25f67cd1abc9883e22f6ed jdk7-b131
 0e57c3272d377eee04cc32c898e9a558051516b0 jdk7-b132
+359d0c8c00a02d3a094c19f8a485b2217c99a4e0 jdk7-b133
+545de8303fec939db3892f7c324dd7df197e8f09 jdk7-b134
--- a/jaxws/make/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jaxws/make/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -136,7 +136,7 @@
 else
   ANT = ant
   ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
-    $(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH")
+    $(error "'ant' not found; please set ANT_HOME or put 'ant' on your PATH")
   endif
 endif
 
--- a/jdk/.hgtags	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/.hgtags	Fri Mar 18 11:00:10 2011 -0700
@@ -107,3 +107,5 @@
 bdc069d3f9101f89ec3f81c2950ee2d68fa846d3 jdk7-b130
 8ac52c85f9e91336dc00b52ef90b42eecf3230b3 jdk7-b131
 6bbc7a4734952ae7604578f270e1566639fa8752 jdk7-b132
+5e5f68a01d12a4432172f384d5201f3a05254493 jdk7-b133
+554adcfb615e63e62af530b1c10fcf7813a75b26 jdk7-b134
--- a/jdk/make/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -74,7 +74,6 @@
 import_product    -- copy in the product components \n\
 import_fastdebug  -- copy in the fastdebug components \n\
 import_debug      -- copy in the debug components \n\
-modules           -- build the jdk and jre module images (experimental) \n\
 create_links      -- create softlinks in Solaris 32bit build to 64bit dirs \n\
 "
 
@@ -261,7 +260,6 @@
 # Release engineering targets.
 #
 include $(BUILDDIR)/common/Release.gmk
-include $(BUILDDIR)/common/Modules.gmk
 
 #
 # Cscope targets.
--- a/jdk/make/com/sun/crypto/provider/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/crypto/provider/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -249,7 +249,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunjce_provider.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/com/sun/java/pack/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/java/pack/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = pack200
 PACKAGE = com.sun.java.util.jar.pack
 LIBRARY = unpack
 PRODUCT = sun
@@ -156,7 +155,6 @@
 endif
 	$(CP) $(TEMPDIR)/unpack200$(EXE_SUFFIX) $(UNPACK_EXE)
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 
 ifeq ($(PLATFORM), windows) 
 $(RES):: $(VERSIONINFO_RESOURCE)
--- a/jdk/make/com/sun/java/pack/prop/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/java/pack/prop/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 # to a collision of rules with Classes.gmk and Library.gmk
 
 BUILDDIR = ../../../../..
-MODULE  = pack200
 PACKAGE = com.sun.java.util.jar.pack
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/cosnaming/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/jndi/cosnaming/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = jndi-cosnaming
 PACKAGE = com.sun.jndi.cosnaming
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/dns/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/jndi/dns/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = jndi-dns
 PACKAGE = com.sun.jndi.dns
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/ldap/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/jndi/ldap/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = jndi-ldap
 PACKAGE = com.sun.jndi.ldap
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/rmi/registry/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/jndi/rmi/registry/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../../..
-MODULE  = jndi-rmiregistry
 PACKAGE = com.sun.jndi.rmi.registry
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/nio/sctp/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/nio/sctp/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = sctp
 PACKAGE = com.sun.nio.sctp
 LIBRARY = sctp
 PRODUCT = sun
--- a/jdk/make/com/sun/org/apache/xml/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/org/apache/xml/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../../..
-MODULE  = security-xmldsig
 PACKAGE = com.sun.org.apache.xml
 PRODUCT = xml
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/rowset/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/rowset/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = jdbc-enterprise
 PACKAGE = com.sun.rowset
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/script/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/script/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../../..
-MODULE  = scripting-rhino
 PACKAGE = com.sun.script
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/security/auth/module/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/security/auth/module/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -26,7 +26,6 @@
 # Makefile for building auth modules.
 
 BUILDDIR = ../../../../..
-MODULE  = security-auth
 PACKAGE = com.sun.security.auth.module
 PRODUCT = sun
 
--- a/jdk/make/com/sun/servicetag/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/servicetag/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -22,7 +22,6 @@
 # questions.
 
 BUILDDIR = ../../..
-MODULE  = servicetag
 PACKAGE = com.sun.servicetag
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/tools/attach/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/com/sun/tools/attach/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../../../..
-MODULE  = attach
 PACKAGE = com.sun.tools.attach
 LIBRARY = attach
 PRODUCT = sun
@@ -66,8 +65,7 @@
 	@$(MKDIR) -p $(@D)
 	@$(RM) $@
 	@$(CAT) $< | $(SED) -e "s/^#\[$(PLATFORM)\]//" > $@
-	@$(install-module-file)
-                                                                                                
+
 .PHONY: copy-files
 
 
--- a/jdk/make/common/Defs.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/Defs.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 # 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,9 +224,6 @@
 # for generated class files
 CLASSBINDIR         = $(OUTPUTDIR)/classes
 DEMOCLASSDIR        = $(OUTPUTDIR)/democlasses
-# for modules
-MODULES_DIR         = $(OUTPUTDIR)/modules
-ABS_MODULES_DIR     = $(ABS_OUTPUTDIR)/modules
 # for generated tool class files
 BUILDTOOLCLASSDIR   = $(OUTPUTDIR)/btclasses
 # for build tool jar files
@@ -297,22 +294,6 @@
   endif
 endif
 
-#
-# Build units may or may not define MODULE.  Default to "other".
-#
-# MODULE variable defines the lowest-level module name that
-# might or might not be the name of the modules created in
-# the modules build (see make/modules/modules.config and
-# modules.group).
-#
-MODULES_TEMPDIR     = $(OUTPUTDIR)/tmp/modules
-ABS_MODULES_TEMPDIR = $(ABS_OUTPUTDIR)/tmp/modules
-
-ifndef MODULE
-  MODULE = other
-endif
-override MODULE_DEST_DIR = $(MODULES_TEMPDIR)/$(MODULE)
-
 # the use of += above makes a space separated list which we need to 
 # remove for filespecs.
 #
@@ -422,52 +403,13 @@
 #
 include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
 
-#
-# Macros to find the module that $@ belongs to
-#
-
 UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))
-MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \
-		      -e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \
-		      -e 's%.*\/lib\/%lib\/%' \
-	              -e 's%.*\/bin\/%bin\/%' \
-	              -e 's%.*\/include\/%include\/%' \
-		      -e 's%.*\/demo\/%demo\/%' \
-		      -e 's%.*\/sample\/%sample\/%'
-
-# Install a file to its module
-define install-module-file
-dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
-$(CP) -f $@ $(MODULE_DEST_DIR)/$$dest
-endef
-
-# Install all files from the directory to its module
-define install-module-dir
-dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
-$(CP) -rf $(@D)/* $(MODULE_DEST_DIR)/$$dest
-endef
-
-# chmod the file in its module
-define chmod-module-file
-dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(CHMOD) $1 $(MODULE_DEST_DIR)/$$dest
-endef
-
-# install a sym link in its module
-define install-module-sym-link
-dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(LN) -sf $1 $(MODULE_DEST_DIR)/$$dest
-endef
-
 
 # Run MAKE $@ for a launcher:
 #   $(call make-launcher, name, mainclass, java-args, main-args)
 define make-launcher
 $(CD) $(BUILDDIR)/launchers && \
 $(MAKE) -f Makefile.launcher \
-        MODULE=$(MODULE) \
         PROGRAM=$(strip $1) \
         MAIN_CLASS=$(strip $2) \
         MAIN_JAVA_ARGS="$(strip $3)" \
@@ -488,28 +430,18 @@
 define install-file
 $(prep-target)
 $(CP) $< $@
-@$(install-module-file)
 endef
 
 define chmod-file
 $(CHMOD) $1 $@
-@$(call chmod-module-file, $1)
 endef
 
 define install-sym-link
 $(LN) -s $1 $@
-@$(call install-module-sym-link, $1)
-endef
-
-#
-# Marcos for files not belonging to any module 
-define install-non-module-file
-$(prep-target)
-$(CP) $< $@
 endef
 
 define install-manifest-file
-$(install-non-module-file)
+$(install-file)
 endef
 
 # Cleanup rule for after debug java run (hotspot.log file is left around)
@@ -556,6 +488,10 @@
   COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
 endif
 
+ifndef OPENJDK
+include $(JDK_TOPDIR)/make/closed/common/Defs.gmk
+endif
+
 # Install of imported file (JDK_IMPORT_PATH, or some other external location)
 define install-importonly-file
 @$(ECHO) "ASSEMBLY_IMPORT: $@"
@@ -577,7 +513,6 @@
 
 define install-import-file
 $(install-importonly-file)
-@$(install-module-file)
 endef
 
 .PHONY: all build clean clobber
--- a/jdk/make/common/Demo.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/Demo.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -25,8 +25,6 @@
 
 # JDK Demo building jar file.
   
-MODULE = demos
-
 # Some names are defined with LIBRARY inside the Defs.gmk file
 LIBRARY=$(DEMONAME)
 OBJDIR=$(TEMPDIR)/$(DEMONAME)
@@ -120,8 +118,11 @@
 DEMO_ALL_NATIVE_SOURCES += $(filter %.hpp,$(DEMO_ALL_FILES))
 
 # If we have java sources, then define the jar file we will create
+ifndef DEMO_JAR_NAME
+  DEMO_JAR_NAME = $(DEMONAME).jar
+endif
 ifneq ($(strip $(DEMO_JAVA_SOURCES)),)
-  DEMO_JAR            = $(DEMO_DESTDIR)/$(DEMONAME).jar
+  DEMO_JAR            = $(DEMO_DESTDIR)/$(DEMO_JAR_NAME)
 endif
 
 # If we have native sources, define the native library we will create
@@ -254,6 +255,17 @@
 	$(MKDIR) -p $(DEMO_JAR_IMAGE)
 	$(JAVAC_CMD) -d $(DEMO_JAR_IMAGE) -sourcepath $(DEMO_BUILD_SRCDIR) \
 	    @$(DEMO_JAVAC_INPUT)
+  ifeq ($(DEMO_INCL_SRC),true)
+	$(CP) $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) $(DEMO_JAR_IMAGE)
+  endif
+  ifeq ($(DEMO_ONLY_SRC),true)
+	$(RM) -r $(DEMO_JAR_IMAGE)
+	$(MKDIR) -p $(DEMO_JAR_IMAGE)
+	$(CP) -r $(DEMO_BUILD_SRCDIR)/* $(DEMO_JAR_IMAGE)
+    ifneq ($(DEMO_TOPFILES),)
+	$(CP) $(DEMO_ROOT)/$(DEMO_TOPFILES) $(DEMO_JAR_IMAGE)
+    endif
+  endif
 	$(BOOT_JAR_CMD) -cfm $@ $(DEMO_MANIFEST) \
 	     -C $(DEMO_JAR_IMAGE) . \
 	     $(BOOT_JAR_JFLAGS)
@@ -326,9 +338,9 @@
 ifdef DEMO_IS_APPLET
 	@$(ECHO) "Expanding jar file into demos area at $(DEMO_DESTDIR)"
 	( $(CD) $(DEMO_DESTDIR) && \
-	  $(BOOT_JAR_CMD) -xfv $(DEMONAME).jar \
+	  $(BOOT_JAR_CMD) -xfv $(DEMO_JAR_NAME) \
 	     $(BOOT_JAR_JFLAGS) && \
-	  $(RM) -r META-INF $(DEMONAME).jar  && \
+	  $(RM) -r META-INF $(DEMO_JAR_NAME) && \
 	  $(java-vm-cleanup) )
 	@( $(CD) $(DEMO_DESTDIR) && $(java-vm-cleanup) )
 	@$(ECHO) "Expanding source into demos area at $(DEMO_DESTDIR)"
--- a/jdk/make/common/Library.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/Library.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -168,18 +168,9 @@
 	  $(OTHER_LCF) $(JAVALIB) $(LDLIBS)
 	$(CP) $(OBJDIR)/$(@F) $@
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 	$(CP) $(OBJDIR)/$(LIBRARY).map $(@D)
 	$(CP) $(OBJDIR)/$(LIBRARY).pdb $(@D)
 
-$(ACTUAL_LIBRARY):: $(ACTUAL_LIBRARY_DIR)/$(LIBRARY).map $(ACTUAL_LIBRARY_DIR)/$(LIBRARY).pdb
-
-$(ACTUAL_LIBRARY_DIR)/%.map: FORCE
-	$(install-module-file)
-
-$(ACTUAL_LIBRARY_DIR)/%.pdb: FORCE
-	$(install-module-file)
-
 endif # LIBRARY
 
 $(OBJDIR)/$(LIBRARY).lcf: $(OBJDIR)/$(LIBRARY).res $(COMPILE_FILES_o) $(FILES_m)
@@ -235,7 +226,6 @@
 else # LIBRARY
 	$(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 ifeq ($(WRITE_LIBVERSION),true)
 	$(MCS) -d -a "$(FULL_VERSION)" $@
 endif # WRITE_LIBVERSION
--- a/jdk/make/common/Modules.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,454 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jdk-module-image
-JRE_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jre-module-image
-
-#
-# modules   Target to build jdk and jre module image
-#
-#           There is one jar file per module containing classes only.
-#           All module jars are currently placed under jre/lib directory.
-#
-# Open issues that need further investigation:
-# 1. Classes in jre/lib/ext/dnsns.jar are currently put in jre/lib/jndi-dns
-#    module.  META-INF/services file is not installed.
-# 2. Signed jars
-#    For JDK build, signed jars are copied to the build.
-#    All jars in the module image are unsigned.
-
-MODULE_IMAGEBINDIR = bin
-
-#
-# Targets.
-#
-INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre
-INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk
-ifeq ($(PLATFORM), solaris)
-  ifeq ($(ARCH_DATA_MODEL), 64)
-    INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre-sol64
-    INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk-sol64
-  endif
-endif
-
-modules modules-clobber \
-initial-module-image-jre initial-module-image-jdk \
-initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
-trim-module-image-jre trim-module-image-jdk \
-process-module-image-jre process-module-image-jdk ::
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-
-# Order is important here, trim jre after jdk image is created
-modules:: gen-modules \
-	 sanity-module-images post-sanity-module-images  \
-	 $(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \
-	 trim-module-image-jre trim-module-image-jdk \
-	 process-module-image-jre process-module-image-jdk
-
-# Don't use these
-module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre
-module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk
-
-#
-# Paths to these files we need
-JDK_MODULE_DOCFILES   = $(IMAGE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%)
-JRE_MODULE_DOCFILES   = $(IMAGE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%)
-
-###### RULES
-
-# JDK files
-$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
-	$(process-doc-file)
-
-# JRE files 
-$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
-	$(process-doc-file)
-ifeq ($(PLATFORM), windows)
-$(JRE_MODULE_IMAGE_DIR)/README.txt: $(SHARE_JRE_DOC_SRC)/README
-	$(process-doc-file)
-endif
-
-######################################################
-# JRE Image
-######################################################
-
-MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list
-
-# Modules in the jre/lib/security directory
-POLICY_MODULES = US_export_policy local_policy
-
-# Modules in the modules/ext directory
-EXT_MODULES = localedata security-sunec security-sunjce
-
-# Build PKCS#11 on all platforms except 64-bit Windows.
-PKCS11 = security-sunpkcs11
-ifeq ($(ARCH_DATA_MODEL), 64)
-  ifeq ($(PLATFORM), windows)
-    PKCS11 =
-  endif
-endif
-
-EXT_MODULES += $(PKCS11)
-
-# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform.
-ifeq ($(PLATFORM), windows)
-  ifneq ($(ARCH_DATA_MODEL), 64)
-    EXT_MODULES += security-sunmscapi
-  endif
-endif
-
-# Modules for JDK only
-JDK_MODULES = tools
-
-gen-modules:
-	$(CD) modules; $(MAKE) all
-
-initial-module-image-jre-setup:
-	$(RM) -r $(JRE_MODULE_IMAGE_DIR)
-	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)
-
-# 64-bit solaris jre image contains only the 64-bit add-on files.
-initial-module-image-jre-sol64:: initial-module-image-jre-setup
-	@# Use tar instead of cp to preserve the symbolic links
-	for dir in bin lib ; do \
-	  ( $(CD) $(OUTPUTDIR) && \
-		$(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
-		($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
-	done
-	@# Remove some files from the jre area
-	for t in $(NOTJRETOOLS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
-	done
-	$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'`
-	$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'`
-
-# Construct an initial jre image (initial jdk jre) no trimming or stripping
-initial-module-image-jre:: initial-module-image-jre-setup \
-		    $(JRE_MODULE_DOCFILES) \
-		    $(BUILDMETAINDEX_JARFILE)
-	@# Copy in bin directory
-	$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
-	@# CTE plugin security change require new empty directory lib/applet
-	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet
-	@# Copy files but not .jar in lib directory 
-	$(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
-	@#
-	@# copy modules to jre/lib
-	@#
-	for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
-	    $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \
-	done
-	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext
-	for m in $(EXT_MODULES) ; do \
-           $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \
-        done
-	for m in $(POLICY_MODULES) ; do \
-           $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \
-        done
-	@# Remove jdk modules
-	for m in $(JDK_MODULES) ; do \
-           $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \
-        done
-
-	@# Make sure all directories are read/execute for everyone
-	$(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d`
-	@# Remove some files from the jre area
-	for t in $(NOTJRETOOLS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
-	done
-	@# Remove orb.idl and ir.idl from jre
-	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
-	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
-	@# Generate meta-index to make boot and extension class loaders lazier
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
-	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
-		-o meta-index *.jar
-	@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup)
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \
-	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
-		-o meta-index *.jar
-	@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
-ifeq ($(PLATFORM), windows)
-	@# Remove certain *.lib files
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
-            $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
-                  awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
-  ifeq ($(ARCH_DATA_MODEL), 32)
-	@# The Java Kernel JRE image ships with a special VM.  It is not included
-	@# in the full JRE image, so remove it.  Also, is it only for 32-bit windows.
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel
-  endif
-endif # Windows
-ifneq ($(PLATFORM), windows)
-	$(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES))
-endif # !windows
-
-# Trim out any extra files not for the jre shipment but wanted in the jdk jre.
-#   (Note the jdk WILL want the jre image before this trimming)
-#   Removes server VM on Windows 32bit.
-#   Remove certain shared libraries that should not be in the jre image
-#      but should be in the jdk jre image.
-trim-module-image-jre::
-ifeq ($(PLATFORM), windows)
-  ifeq ($(ARCH_DATA_MODEL), 32)
-	$(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server
-  endif
-  ifdef NOTJRE_SHARED_LIBS
-	for l in $(NOTJRE_SHARED_LIBS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \
-	done ;
-  endif
-else # PLATFORM
-  ifdef NOTJRE_SHARED_LIBS
-	for l in $(NOTJRE_SHARED_LIBS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
-	done ;
-  endif
-endif # PLATFORM
-
-# Get list of all Elf files in the jre
-JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list
-$(JRE_MODULE_ELF_LIST):
-	@$(prep-target)
-ifneq ($(PLATFORM), windows)
-	$(RM) $@
-	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
-	$(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
-	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-endif
-
-# Post process the image (strips and mcs on Elf files we are shipping)
-#   (Note the jdk WILL want the jre image before this processing)
-process-module-image-jre:: $(JRE_MODULE_ELF_LIST)
-ifneq ($(POST_STRIP_PROCESS), )
-	for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
-	  $(POST_STRIP_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-ifneq ($(POST_MCS_PROCESS), )
-	for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
-	  $(POST_MCS_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-	$(RM) $(JRE_MODULE_ELF_LIST)
-
-######################################################
-# JDK Image
-######################################################
-# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
-
-initial-module-image-jdk-setup:
-	$(RM) -r $(JDK_MODULE_IMAGE_DIR)
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre
-	($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \
-	      | $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre )
-	$(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man
-	$(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d`
-
-initial-module-image-jdk64-bindemos:
-	for dir in bin demo ; do \
-	  ( $(CD) $(OUTPUTDIR) && \
-		$(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
-		($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
-        done
-
-# Solaris 64 bit image is special
-initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \
-			  initial-module-image-jdk64-bindemos
-
-# DB files to add
-ifeq ($(OPENJDK),true)
-
-initial-module-image-jdk-db:
-
-else
-
-# Create the list of db *.zip files to bundle with jdk
-ABS_DB_PATH  :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
-DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
-
-initial-module-image-jdk-db: $(DB_ZIP_LIST)
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db
-	for d in $(DB_ZIP_LIST); do \
-          ($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
-	done
-
-endif
-
-# Standard jdk image
-initial-module-image-jdk:: initial-module-image-jdk-setup \
-		    initial-module-image-jdk-db \
-		    $(JDK_MODULE_DOCFILES)
-	$(MKDIR) $(JDK_MODULE_IMAGE_DIR)/lib
-	@#
-	@# copy jdk modules to jdk/lib
-	@#
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/lib
-	for m in $(JDK_MODULES) ; do \
-	    $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JDK_MODULE_IMAGE_DIR)/lib ; \
-        done
-  ifeq ($(PLATFORM), windows)
-	@#
-	@# lib/
-	@#
-	$(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
-	$(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
-	@#
-	@# bin/
-	@#
-	@# copy all EXE files and only certain DLL files from BINDIR
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin
-	$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-	$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-    ifeq ($(COMPILER_VERSION), VS2010)
-	$(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-    endif
-    ifeq ($(ARCH_DATA_MODEL), 32)
-      ifeq ($(COMPILER_VERSION), VS2003)
-	$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-      endif
-    endif
-  else # PLATFORM
-	@#
-	@# bin/
-	@#
-	($(CD) $(BINDIR)/.. && $(TAR) cf - \
-	    `$(FIND) bin \( -type f -o -type l \) -print `) | \
-	    ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -)
-  endif # PLATFORM
-	@#
-	@# lib/ct.sym
-	@#
-	$(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
-	$(JAVAC_CMD) -XDprocess.packages -proc:only \
-	    -processor com.sun.tools.javac.sym.CreateSymbols \
-	    -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
-	    -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
-	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
-	$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
-	    -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
-	$(CP) $(LIBDIR)/ct.sym $(JDK_MODULE_IMAGE_DIR)/lib/ct.sym
-	@#
-	@# CORBA supported orb.idl and ir.idl should be copied to lib
-	@#
-	$(CP) $(LIBDIR)/orb.idl $(JDK_MODULE_IMAGE_DIR)/lib/orb.idl
-	$(CP) $(LIBDIR)/ir.idl $(JDK_MODULE_IMAGE_DIR)/lib/ir.idl
-  ifeq ($(PLATFORM), linux)
-	@#
-	@# on Linux copy jexec from jre/lib to /lib
-	@#
-	$(CP) $(LIBDIR)/jexec $(JDK_MODULE_IMAGE_DIR)/lib/jexec
-  endif # PLATFORM
-	@#
-	@# demo, include
-	@#
-	$(CP) -r -f $(DEMODIR) $(JDK_MODULE_IMAGE_DIR)
-	$(CP) -r -f $(SAMPLEDIR) $(JDK_MODULE_IMAGE_DIR)
-	$(CP) -r $(INCLUDEDIR) $(JDK_MODULE_IMAGE_DIR)
-	@#
-	@# Swing BeanInfo generation
-	@#
-	$(CD) javax/swing/beaninfo && $(MAKE) JDK_IMAGE_DIR=$(JDK_MODULE_IMAGE_DIR) swing-1.2-beans
-ifneq ($(PLATFORM), windows)
-	$(call copy-man-pages,$(JDK_MODULE_IMAGE_DIR),$(JDK_MAN_PAGES))
-endif # !windows
-
-# Trim out files we don't want to ship
-trim-module-image-jdk::
-	@# Remove tools that should not be part of SDK.
-	for t in $(NOTJDKTOOLS); do \
-	    $(RM) $(JDK_MODULE_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX); \
-	done
-
-# Get list of Elf files in the jdk
-JDK_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jdk-elf-files.list
-$(JDK_MODULE_ELF_LIST):
-	@$(prep-target)
-ifneq ($(PLATFORM), windows)
-	$(RM) $@
-	$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
-	$(FILE) `$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \
-	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-	file `$(FIND) $(JDK_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
-	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-endif
-
-# Post process the image (strips and mcs on files we are shipping)
-process-module-image-jdk:: $(JDK_MODULE_ELF_LIST)
-ifneq ($(POST_STRIP_PROCESS), )
-	for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
-	  $(POST_STRIP_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-ifneq ($(POST_MCS_PROCESS), )
-	for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
-	  $(POST_MCS_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-	$(RM) $(JDK_MODULE_ELF_LIST)
-
-######################################################
-# clobber
-######################################################
-modules-clobber::
-	$(RM) -r $(JDK_MODULE_IMAGE_DIR)
-	$(RM) -r $(JRE_MODULE_IMAGE_DIR)
-
-#
-# TODO - nop for now
-sanity-module-images post-sanity-module-images:
-
-modules modules-clobber::
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-	@$(java-vm-cleanup)
-
-.PHONY: modules module-image-jre module-image-jdk \
-	initial-module-image-jre initial-module-image-jdk \
-	initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
-        initial-module-image-jdk-setup \
-	initial-module-image-jdk-db \
-        initial-module-image-jdk64-bindemos \
-        initial-module-image-jre-setup \
-	trim-module-image-jre trim-module-image-jdk \
-	process-module-image-jre process-module-image-jdk \
-	install-previous-jre install-previous-jdk \
-	modules-clobber
-
-# Force rule
-FRC:
-
--- a/jdk/make/common/Program.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/Program.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -186,7 +186,6 @@
 	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
 	    $(FILES_o) $(THREADLIBS) $(LDLIBS)
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 
 endif # PLATFORM
 
--- a/jdk/make/common/Release.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/Release.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
 # 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,9 +60,10 @@
 #
 # Include the exported private packages in ct.sym.
 # This is an interim solution until the ct.sym is replaced
-# with a new module system (being discussed for JDK 7).
+# with a new module system (being discussed for JDK 8).
 #
-EXPORTED_PRIVATE_PKGS = com.sun.servicetag
+EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
+                        com.oracle.net
 
 # 64-bit solaris has a few special cases. We define the variable
 # SOLARIS64 for use in this Makefile to easily test those cases
@@ -85,9 +86,8 @@
   IMAGE_DOCLIST_JDK = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
   IMAGE_DOCLIST_JRE = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
 else
-  # Where to find these files
-  SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdk
-  SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jre
+  # make/closed/common/Defs.gmk for closed location of SHARE_JDK_DOC_SRC
+
   IMAGE_DOCLIST_JDK = COPYRIGHT README.html  THIRDPARTYLICENSEREADME.txt
   IMAGE_DOCLIST_JRE = COPYRIGHT Welcome.html THIRDPARTYLICENSEREADME.txt
   ifeq ($(PLATFORM), windows)
--- a/jdk/make/common/Sanity.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/Sanity.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -71,8 +71,7 @@
     sane-cacerts \
     sane-ant_version \
     sane-zip_version \
-    sane-msvcrt_path \
-    sane-build_modules
+    sane-msvcrt_path
 
 # The rules sanity-* have a one-to-one correspondence with the major targets
 # Each sanity-* rule should have no body to ensure that the post-sanity-* is the
--- a/jdk/make/common/Subdirs.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/Subdirs.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -40,9 +40,6 @@
 #
 # By default, subdirs specified in the SUBDIRS and all SUBDIRS_* 
 # variables will be built.
-# 
-# BUILD_MODULES variable can be used to specify one or more groups
-# to be built (BUILD_MODULES=all will build all groups).
 #
 # Variables of the currently supported groups are:
 #  SUBDIRS_desktop    
@@ -53,15 +50,12 @@
 # 
 # Change to the above list also need to update 
 # make/common/shared/Sanity.gmk.  NOTE: this list is subject
-# to change till the JDK 7 SE profiles/modules are finalized.
+# to change.
 # 
 # Eventually we want to restructure the make directory
 # according to these grouping (e.g. make/desktop/...) and
 # the SUBDIRS_<group> variables would not be needed.
 # 
-# To build the desktop and tools groups only, you can do:
-# gnumake BUILD_MODULES="desktop tools" ...
-# 
 
 # Iterate the subdirectories specified in $1.
 # - cd into each subdir and make them
@@ -96,77 +90,51 @@
 
 #
 # Iterate the list specified in SUBDIRS_<group> only if
-# SUBDIRS_<group> is set and <group> or "all" is specified
-# in the BUILD_MODULES variable
+# SUBDIRS_<group> is set.
 #
 ifdef SUBDIRS_desktop 
-  ifneq (,$(findstring desktop, $(BUILD_MODULES)))
-      define subdirs-desktop-loop
-         @$(call subdirs-group-loop,SUBDIRS_desktop)
-      endef
-  else
-    define subdirs-desktop-loop
-    endef
-  endif
+  define subdirs-desktop-loop
+      @$(call subdirs-group-loop,SUBDIRS_desktop)
+  endef
 else   
   define subdirs-desktop-loop
   endef
 endif   # SUBDIRS_desktop 
 
 ifdef SUBDIRS_enterprise 
-  ifneq (,$(findstring enterprise, $(BUILD_MODULES)))
-      define subdirs-enterprise-loop
-         @$(call subdirs-group-loop,SUBDIRS_enterprise)
-      endef
-  else
-    define subdirs-enterprise-loop
-    endef
-  endif
+  define subdirs-enterprise-loop
+      @$(call subdirs-group-loop,SUBDIRS_enterprise)
+  endef
 else   
 define subdirs-enterprise-loop
 endef
 endif   # SUBDIRS_enterprise 
 
 ifdef SUBDIRS_management 
-  ifneq (,$(findstring management, $(BUILD_MODULES)))
-      define subdirs-management-loop
-         @$(call subdirs-group-loop,SUBDIRS_management)
-      endef
-  else
-    define subdirs-management-loop
-    endef
-  endif
+  define subdirs-management-loop
+      @$(call subdirs-group-loop,SUBDIRS_management)
+  endef
 else   
-define subdirs-management-loop
-endef
+  define subdirs-management-loop
+  endef
 endif   # SUBDIRS_management 
 
 ifdef SUBDIRS_misc 
-  ifneq (,$(findstring misc, $(BUILD_MODULES)))
-      define subdirs-misc-loop
-         @$(call subdirs-group-loop,SUBDIRS_misc)
-      endef
-  else
-    define subdirs-misc-loop
-    endef
-  endif
+  define subdirs-misc-loop
+      @$(call subdirs-group-loop,SUBDIRS_misc)
+  endef
 else   
-define subdirs-misc-loop
-endef
+  define subdirs-misc-loop
+  endef
 endif   # SUBDIRS_misc 
 
 ifdef SUBDIRS_tools 
-  ifneq (,$(findstring tools, $(BUILD_MODULES)))
-      define subdirs-tools-loop
-         @$(call subdirs-group-loop,SUBDIRS_tools)
-      endef
-  else
-    define subdirs-tools-loop
-    endef
-  endif
+  define subdirs-tools-loop
+      @$(call subdirs-group-loop,SUBDIRS_tools)
+  endef
 else   
-define subdirs-tools-loop
-endef
+  define subdirs-tools-loop
+  endef
 endif   # SUBDIRS_tools 
 
 #
@@ -175,30 +143,6 @@
 SUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \
 	      $(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools)
 
-ifndef BUILD_MODULES
-define SUBDIRS-loop
-  @$(call subdirs-group-loop,SUBDIRS_all)
-endef
-
-else
-
-ifneq (,$(findstring all, $(BUILD_MODULES)))
 define SUBDIRS-loop
   @$(call subdirs-group-loop,SUBDIRS_all)
 endef
-
-else # BUILD_MODULES set 
-#
-# Iterate SUBDIRS and the groups specified in BUILD_MODULES
-#
-define SUBDIRS-loop
-  @$(call subdirs-group-loop,SUBDIRS)
-  @$(subdirs-desktop-loop)
-  @$(subdirs-enterprise-loop)
-  @$(subdirs-management-loop)
-  @$(subdirs-misc-loop)
-  @$(subdirs-tools-loop)
-endef
-
-endif
-endif # BUILD_MODULES
--- a/jdk/make/common/shared/Compiler-msvc.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/shared/Compiler-msvc.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -153,6 +153,9 @@
   ifndef COMPILER_VERSION
     COMPILER_VERSION := $(error COMPILER_VERSION cannot be empty here)
   endif
+  ifneq ($(COMPILER_VERSION),VS2010)
+    COMPILER_VERSION := $(error COMPILER_VERSION must be VS2010)
+  endif
   
   # Shared library generation flag
   SHARED_LIBRARY_FLAG = -LD
--- a/jdk/make/common/shared/Defs-java.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/shared/Defs-java.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
 # 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 @@
   JAVA_MEM_FLAGS   += -Xms$(MIN_VM_MEMORY)m -XX:PermSize=32m -XX:MaxPermSize=160m
 endif
 
-# 
+#
 # All java tools (javac, javah, and javadoc) run faster with certain java
 #    options, this macro should be used with all these tools.
 #    In particular, the client VM makes these tools run faster when
@@ -122,6 +122,17 @@
   JAVACFLAGS  += -Werror
 endif
 
+#
+# Some licensees do not get the Security Source bundles.  We will
+# fall back on the prebuilt jce.jar so that we can do a best
+# attempt at building.  If sources exist, we always want to
+# build/use the most recent source instead of an older jce.jar, whether
+# built implicitly/explicitly.
+#
+ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),)
+  JCEFLAGS = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
+endif
+
 # Add the source level
 SOURCE_LANGUAGE_VERSION = 7
 LANGUAGE_VERSION = -source $(SOURCE_LANGUAGE_VERSION)
@@ -132,11 +143,11 @@
 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 JAVACFLAGS  += $(CLASS_VERSION)
 JAVACFLAGS  += -encoding ascii
-JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)"
+JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCEFLAGS)"
 JAVACFLAGS  += $(OTHER_JAVACFLAGS)
 
 # Needed for javah
-JAVAHFLAGS += -bootclasspath $(CLASSBINDIR)
+JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCEFLAGS)"
 
 # Needed for javadoc to ensure it builds documentation
 # against the newly built classes
--- a/jdk/make/common/shared/Defs-javadoc.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/shared/Defs-javadoc.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -64,7 +64,7 @@
 # Macro to construct the copyright line
 #   (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81)
 define CopyrightLine # optionalurl optionalfirstyear optionaladdress
-$(if $(strip $1),<a href=\"$(strip $1)\">Copyright</a>,Copyright) \
+$(if $(strip $1),<a href="$(strip $1)">Copyright</a>,Copyright) \
 $(COPYRIGHT_SYMBOL) $(if $2,$2${COMMA},) $(COPYRIGHT_YEAR),\
 $(FULL_COMPANY_NAME). $3 All rights reserved.
 endef
--- a/jdk/make/common/shared/Defs.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/shared/Defs.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -218,7 +218,11 @@
 else
   LAUNCHER_NAME = java
   PRODUCT_NAME = Java(TM)
-  PRODUCT_SUFFIX = SE Runtime Environment
+  ifeq ($(J4B), true)
+    PRODUCT_SUFFIX = SE Runtime Environment for Business
+  else
+    PRODUCT_SUFFIX = SE Runtime Environment
+  endif
   JDK_RC_PLATFORM_NAME = Platform SE
   COMPANY_NAME = Oracle Corporation
 endif
--- a/jdk/make/common/shared/Platform.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/shared/Platform.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -148,7 +148,7 @@
   # Suffix for file bundles used in previous release
   BUNDLE_FILE_SUFFIX=.tar
   # How much RAM does this machine have:
-  MB_OF_MEMORY=$(shell /etc/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
+  MB_OF_MEMORY=$(shell /usr/sbin/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
 endif
 
 # Platform settings specific to Linux
--- a/jdk/make/common/shared/Sanity.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/common/shared/Sanity.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -113,7 +113,7 @@
   ALSA_INCLUDE=/usr/include/alsa/version.h
   ALSA_LIBRARY=/usr/lib/libasound.so
   _ALSA_VERSION := $(shell $(EGREP) SND_LIB_VERSION_STR $(ALSA_INCLUDE) | \
-           $(SED) -e 's@.*\"\(.*\)\".*@\1@' )
+           $(SED) -e 's@.*"\(.*\)".*@\1@' )
   ALSA_VERSION := $(call GetVersion,$(_ALSA_VERSION))
 endif
 
@@ -221,8 +221,7 @@
 	sane-zip_version \
 	sane-unzip_version \
  	sane-msvcrt_path \
-        sane-freetype \
-        sane-build_modules
+        sane-freetype
 
 ######################################################
 # check for COPYRIGHT_YEAR variable
@@ -334,12 +333,12 @@
 ifneq ($(PLATFORM), windows)
 	@if [ "$(LC_ALL)" != "" -a "$(LC_ALL)" != "C" ]; then \
 	  $(ECHO) "WARNING: LC_ALL has been set to $(LC_ALL), this can cause build failures. \n" \
-	    "        Try setting LC_ALL to \"C\". \n" \
+	    "        Try setting LC_ALL to 'C'. \n" \
 	    "" >> $(WARNING_FILE) ; \
         fi
 	@if [ "$(LANG)" != "" -a "$(LANG)" != "C" ]; then \
 	  $(ECHO) "WARNING: LANG has been set to $(LANG), this can cause build failures. \n" \
-	    "        Try setting LANG to \"C\". \n" \
+	    "        Try setting LANG to 'C'. \n" \
 	    "" >> $(WARNING_FILE) ; \
         fi
 endif
@@ -832,21 +831,6 @@
 endif
 
 ######################################################
-# if specified, BUILD_MODULES must contain valid values.
-######################################################
-MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools"
-sane-build_modules:
-ifdef BUILD_MODULES
-	@for m in $(BUILD_MODULES) ; do \
-            valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \
-            if [ "x$$valid" = "x" ] ; then \
-                $(ECHO) "ERROR: $$m set in the BUILD_MODULES variable is invalid.\n" \
-                "" >> $(ERROR_FILE); \
-            fi \
-	done
-endif
-
-######################################################
 # CUPS_HEADERS_PATH must be valid
 ######################################################
 sane-cups:
@@ -1126,7 +1110,7 @@
 #    be checked when this represents a full control build (i.e. the
 #    HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory).
 $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
-	@$(install-non-module-file)
+	@$(install-file)
 	@$(RM) $@.IMPORT
 	@if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \
 	  $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \
@@ -1140,7 +1124,7 @@
 	fi
 
 $(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
-	@$(install-non-module-file)
+	@$(install-file)
 	@$(RM) $@.IMPORT
 	@if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \
 	  $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \
@@ -1343,9 +1327,9 @@
 	fi
 	@if [ "$(LINK_CHECK)" != "same" ]; then \
 	  $(ECHO) "WARNING: To build Java 2 SDK $(JDK_VERSION) you need : \n" \
-	    "      $(REQUIRED_COMPILER_VERSION) - link.exe version \"$(REQUIRED_LINK_VER)\" \n" \
+	    "      $(REQUIRED_COMPILER_VERSION) - link.exe version '$(REQUIRED_LINK_VER)' \n" \
 	      "      Specifically the $(REQUIRED_COMPILER_NAME) link.exe. \n " \
-	    "      $(YOU_ARE_USING) Linker version \"$(LINK_VER)\" \n" \
+	    "      $(YOU_ARE_USING) Linker version '$(LINK_VER)' \n" \
 	    "" >> $(WARNING_FILE) ; \
 	fi
 endif
--- a/jdk/make/docs/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/docs/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -43,7 +43,7 @@
 BUG_SUBMIT_URL = http://bugs.sun.com/services/bugreport/index.jsp
 
 # Common line for how to submit a bug or rfe
-BUG_SUBMIT_LINE = <a href=\"$(BUG_SUBMIT_URL)\">Submit a bug or feature</a>
+BUG_SUBMIT_LINE = <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a>
 
 # Url to devdocs page
 #   Was: http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html
@@ -166,21 +166,32 @@
 
 # Common bottom argument
 define CommonBottom # year
-<font size=\"-1\"><br> $(call CopyrightLine,,$1,)</font>
+<font size="-1"><br> $(call CopyrightLine,,$1,)</font>
 endef
 
 # Common trademark bottom argument (Not sure why this is used sometimes)
 define CommonTrademarkBottom # year
-<font size=\"-1\">\
+<font size="-1">\
 $(BUG_SUBMIT_LINE)<br>$(JAVA_TRADEMARK_LINE)<br>\
 $(call CopyrightLine,,$1,$(COMPANY_ADDRESS))\
 </font>
 endef
 
+# Common echo of option
+define OptionOnly # opt
+$(PRINTF) "%s\n" "$1"
+endef
+define OptionPair # opt arg
+$(PRINTF) "%s '%s'\n" "$1" '$2'
+endef
+define OptionTrip # opt arg arg
+$(PRINTF) "%s '%s' '%s'\n" "$1" '$2' '$3'
+endef
+
 # Core api bottom argument (with special sauce)
-COREAPI_BOTTOM = <font size=\"-1\"> $(BUG_SUBMIT_LINE)\
+COREAPI_BOTTOM = <font size="-1"> $(BUG_SUBMIT_LINE)\
 <br>For further API reference and developer documentation, \
-see <a href=\"$(DEV_DOCS_URL)\" target=\"_blank\">Java SE Documentation</a>. \
+see <a href="$(DEV_DOCS_URL)" target="_blank">Java SE Documentation</a>. \
 That documentation contains more detailed, developer-targeted descriptions, \
 with conceptual overviews, definitions of terms, workarounds, \
 and working code examples.<br>\
@@ -212,11 +223,11 @@
     DRAFT_WINTITLE = $(BUILD_NUMBER)
     # Early access top text (not used in FCS releases)
     COREAPI_TOP_EARLYACCESS = \
-<div style=\"background-color: \#EEEEEE\"> \
-<div style=\"padding: 6px; margin-top: 2px; margin-bottom: 6px; \
+<div style="background-color: \#EEEEEE"> \
+<div style="padding: 6px; margin-top: 2px; margin-bottom: 6px; \
 margin-left: 6px; margin-right: 6px; text-align: justify; \
 font-size: 80%; font-family: Helvetica, Arial, sans-serif; \
-font-weight: normal;\"> \
+font-weight: normal;"> \
 Please note that the specifications and other information \
 contained herein are not final and are subject to change. \
 The information is being made available to you solely for purpose of \
@@ -281,15 +292,9 @@
 COREAPI_HEADER = \
 <strong>Java$(TRADEMARK)&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(JDK_MINOR_VERSION)</strong>
 
-# Ignored tags
-IGNORED_TAGS =	beaninfo revised since.unbundled spec specdefault Note ToDo
-
 # Java language specification cite
-JLS3_CITE = <a href=\"$(JLS3_URL)\"> \
-		The Java Language Specification, Third Edition</a>
-TAG_JLS3 = -tag 'jls3:a:See <cite>$(JLS3_CITE)</cite>:'
-
-TAGS = $(IGNORED_TAGS:%=-tag %:X) $(TAG_JLS3)
+TAG_JLS3 = jls3:a:See <cite><a href="$(JLS3_URL)"> \
+The Java Language Specification, Third Edition</a></cite>:
 
 # Overview file for core apis
 COREAPI_OVERVIEW = $(SHARE_SRC)/classes/overview-core.html
@@ -314,19 +319,26 @@
 # Create file with javadoc options in it
 $(COREAPI_OPTIONS_FILE): $(COREAPI_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "$(TAGS)"						; \
-	  $(ECHO) "-encoding ISO-8859-1"				; \
-	  $(ECHO) "-splitIndex"						; \
-	  $(ECHO) "-overview $(COREAPI_OVERVIEW)" 			; \
-	  $(ECHO) "-doctitle '$(COREAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(COREAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(COREAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ISO-8859-1)			; \
+	  $(call OptionPair,-tag,beaninfo:X)				; \
+	  $(call OptionPair,-tag,revised:X)				; \
+	  $(call OptionPair,-tag,since.unbundled:X)			; \
+	  $(call OptionPair,-tag,spec:X)				; \
+	  $(call OptionPair,-tag,specdefault:X)				; \
+	  $(call OptionPair,-tag,Note:X)				; \
+	  $(call OptionPair,-tag,ToDo:X)				; \
+          $(call OptionPair,-tag,$(TAG_JLS3)) 				; \
+	  $(call OptionOnly,-splitIndex)				; \
+	  $(call OptionPair,-overview,$(COREAPI_OVERVIEW))		; \
+	  $(call OptionPair,-doctitle,$(COREAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)) ;\
+	  $(call OptionPair,-header,$(COREAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(COREAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
         ) >> $@
 ifdef COREAPI_TOP_EARLYACCESS
-	@$(ECHO) "-top '$(COREAPI_TOP_EARLYACCESS)'" >> $@
+	@$(call OptionPair,-top,$(COREAPI_TOP_EARLYACCESS)) >> $@
 endif
 
 # Create a file with the package names in it
@@ -375,16 +387,16 @@
 # Create file with javadoc options in it
 $(MIRROR_OPTIONS_FILE): $(MIRROR_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-overview $(MIRROR_OVERVIEW)" 			; \
-	  $(ECHO) "-doctitle '$(MIRROR_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(MIRROR_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-group $(MIRROR_GROUPNAME) $(MIRROR_REGEXP)"		; \
-	  $(ECHO) "-linkoffline $(MIRROR2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-overview,$(MIRROR_OVERVIEW))		; \
+	  $(call OptionPair,-doctitle,$(MIRROR_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(MIRROR_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)) 	; \
+	  $(call OptionTrip,-group,$(MIRROR_GROUPNAME),$(MIRROR_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(MIRROR2COREAPI),$(COREAPI_DOCSDIR)); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -432,16 +444,16 @@
 # Create file with javadoc options in it
 $(DOCLETAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-breakiterator"					; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-doctitle '$(DOCLETAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(DOCLETAPI_HEADER)$(DRAFT_HEADER)'"	; \
-	  $(ECHO) "-bottom '$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM)'"	; \
-	  $(ECHO) "-group $(DOCLETAPI_GROUPNAME) $(DOCLETAPI_REGEXP)"	; \
-	  $(ECHO) "-linkoffline $(DOCLETAPI2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-breakiterator)				; \
+	  $(call OptionPair,-doctitle,$(DOCLETAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(DOCLETAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-group,$(DOCLETAPI_GROUPNAME),$(DOCLETAPI_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(DOCLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -492,13 +504,13 @@
 # Create file with javadoc options in it
 $(TAGLETAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nonavbar"						; \
-	  $(ECHO) "-noindex"						; \
-	  $(ECHO) "-bottom '$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM)'"			; \
-	  $(ECHO) "-linkoffline $(TAGLETAPI2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nonavbar)					; \
+	  $(call OptionOnly,-noindex)					; \
+	  $(call OptionPair,-bottom,$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(TAGLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -543,16 +555,16 @@
 # Create file with javadoc options in it
 $(DOMAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-splitIndex"						; \
-	  $(ECHO) "-doctitle '$(DOMAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(DOMAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-group $(DOMAPI_GROUPNAME) $(DOMAPI_REGEXP)"		; \
-	  $(ECHO) "-linkoffline $(DOMAPI2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-splitIndex)				; \
+	  $(call OptionPair,-doctitle,$(DOMAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(DOMAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-group,$(DOMAPI_GROUPNAME),$(DOMAPI_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(DOMAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -605,15 +617,15 @@
 # Create file with javadoc options in it
 $(JDI_OPTIONS_FILE): $(JDI_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-overview $(JDI_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(JDI_DOCTITLE)'"				; \
-	  $(ECHO) "-windowtitle '$(JDI_WINDOWTITLE) $(DRAFT_WINTITLE)'"	; \
-	  $(ECHO) "-header '$(JDI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JDI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JDI2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-overview,$(JDI_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(JDI_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(JDI_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(JDI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JDI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JDI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -693,15 +705,15 @@
 # Create file with javadoc options in it
 $(JAAS_OPTIONS_FILE): $(JAAS_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-overview $(JAAS_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(JAAS_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(JAAS_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
-	  $(ECHO) "-header '$(JAAS_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JAAS_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JAAS2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-overview,$(JAAS_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(JAAS_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(JAAS_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(JAAS_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JAAS_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JAAS2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -745,16 +757,16 @@
 # Create file with javadoc options in it
 $(JGSS_OPTIONS_FILE): $(JGSS_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-overview $(JGSS_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(JGSS_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(JGSS_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
-	  $(ECHO) "-header '$(JGSS_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JGSS_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JGSS2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-overview,$(JGSS_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(JGSS_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(JGSS_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(JGSS_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JGSS_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JGSS2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -797,15 +809,15 @@
 # Create file with javadoc options in it
 $(SMARTCARDIO_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(SMARTCARDIO_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(SMARTCARDIO_HEADER)$(DRAFT_HEADER)'"	; \
-	  $(ECHO) "-bottom '$(SMARTCARDIO_BOTTOM)$(DRAFT_BOTTOM)'"	; \
-	  $(ECHO) "-linkoffline $(SMARTCARDIO2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(SMARTCARDIO_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(SMARTCARDIO_HEADER)$(DRAFT_HEADER)); \
+	  $(call OptionPair,-bottom,$(SMARTCARDIO_BOTTOM)$(DRAFT_BOTTOM)); \
+	  $(call OptionTrip,-linkoffline,$(SMARTCARDIO2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -847,15 +859,15 @@
 # Create file with javadoc options in it
 $(HTTPSERVER_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(HTTPSERVER_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(HTTPSERVER_HEADER)$(DRAFT_HEADER)'"	; \
-	  $(ECHO) "-bottom '$(HTTPSERVER_BOTTOM)$(DRAFT_BOTTOM)'"	; \
-	  $(ECHO) "-linkoffline $(HTTPSERVER2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(HTTPSERVER_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(HTTPSERVER_HEADER)$(DRAFT_HEADER)); \
+	  $(call OptionPair,-bottom,$(HTTPSERVER_BOTTOM)$(DRAFT_BOTTOM)); \
+	  $(call OptionTrip,-linkoffline,$(HTTPSERVER2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -907,16 +919,16 @@
 # Create file with javadoc options in it
 $(MGMT_OPTIONS_FILE): $(MGMT_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-overview $(MGMT_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(MGMT_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(MGMT_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
-	  $(ECHO) "-header '$(MGMT_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(MGMT_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(MGMT2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-overview,$(MGMT_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(MGMT_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(MGMT_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(MGMT_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(MGMT_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(MGMT2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -958,15 +970,15 @@
 # Create file with javadoc options in it
 $(ATTACH_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(ATTACH_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(ATTACH_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(ATTACH_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(ATTACH2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(ATTACH_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(ATTACH_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(ATTACH_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(ATTACH2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1008,15 +1020,15 @@
 # Create file with javadoc options in it
 $(JCONSOLE_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(JCONSOLE_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(JCONSOLE_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JCONSOLE2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(JCONSOLE_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(JCONSOLE_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JCONSOLE2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1063,15 +1075,15 @@
 # Create file with javadoc options in it
 $(TREEAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-doctitle '$(TREEAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(TREEAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-group $(TREEAPI_GROUPNAME) $(TREEAPI_REGEXP)"	; \
-	  $(ECHO) "-linkoffline $(TREEAPI2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(TREEAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-group,$(TREEAPI_GROUPNAME),$(TREEAPI_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(TREEAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1113,15 +1125,15 @@
 # Create file with javadoc options in it
 $(SCTPAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(SCTPAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(SCTPAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(SCTPAPI2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(SCTPAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(SCTPAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(SCTPAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1163,15 +1175,15 @@
 # Create file with javadoc options in it
 $(TRACING_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(TRACING_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(TRACING_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(TRACING_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(TRACING_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(TRACING2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(TRACING_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(TRACING_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(TRACING_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(TRACING_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(TRACING2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
--- a/jdk/make/docs/NON_CORE_PKGS.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/docs/NON_CORE_PKGS.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -91,8 +91,6 @@
 TRACING_PKGS     = com.sun.tracing         \
                    com.sun.tracing.dtrace
 
-ORACLENET_PKGS   = com.oracle.net
-
 # non-core packages in rt.jar
 NON_CORE_PKGS    = $(DOMAPI_PKGS) \
                    $(MGMT_PKGS) \
@@ -103,6 +101,5 @@
                    $(HTTPSERVER_PKGS) \
                    $(SMARTCARDIO_PKGS) \
                    $(TRACING_PKGS) \
-                   $(SCTPAPI_PKGS) \
-                   $(ORACLENET_PKGS)
+                   $(SCTPAPI_PKGS)
 
--- a/jdk/make/java/awt/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/awt/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = java.awt
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/fdlibm/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/fdlibm/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -31,7 +31,6 @@
 #
 
 BUILDDIR     = ../..
-MODULE       = base
 LIBRARY      = fdlibm
 PRODUCT      = java
 
--- a/jdk/make/java/instrument/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/instrument/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -27,7 +27,6 @@
 # agent, supporting java.lang.instrument
 
 BUILDDIR = ../..
-MODULE  = instrument
 PACKAGE = sun.instrument
 LIBRARY = instrument
 PRODUCT = sun
--- a/jdk/make/java/java/FILES_java.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/java/FILES_java.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -466,7 +466,6 @@
     java/security/ProtectionDomain.java \
     java/net/URLClassLoader.java \
     java/net/URLConnection.java \
-    sun/misc/BootClassLoaderHook.java \
     sun/misc/Launcher.java \
     sun/misc/MetaIndex.java \
     sun/misc/URLClassPath.java \
--- a/jdk/make/java/java/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/java/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.lang
 LIBRARY = java
 PRODUCT = java
@@ -244,7 +243,7 @@
 
 $(GENSRCDIR)/java/lang/UNIXProcess.java: \
     $(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.$(PLATFORM)
-	$(install-non-module-file)
+	$(install-file)
 
 clean:: 
 	$(RM) $(GENSRCDIR)/java/lang/UNIXProcess.java
@@ -318,7 +317,6 @@
 	$(BOOT_JAVA_CMD) -jar $(GENERATECURRENCYDATA_JARFILE) -o $@.temp \
 		< $(SHARE_SRC)/classes/java/util/CurrencyData.properties
 	$(MV) $@.temp $@
-	$(install-module-file)
 	$(call chmod-file, 444)
 
 clean:: 
@@ -373,7 +371,7 @@
 		-usecharforbyte 11 4 1
 
 $(GENSRCDIR)/java/lang/%.java : $(CHARACTERDATA)/%.java.template
-	$(install-non-module-file)
+	$(install-file)
 
 clean::
 	$(RM) $(GENSRCDIR)/java/lang/CharacterDataLatin1.java 
--- a/jdk/make/java/java_crw_demo/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/java_crw_demo/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -25,7 +25,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = demos
 LIBRARY = java_crw_demo
 PRODUCT = sun
 LIBRARY_OUTPUT = java_crw_demo
--- a/jdk/make/java/java_hprof_demo/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/java_hprof_demo/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = instrument
 LIBRARY = hprof
 PRODUCT = sun
 LIBRARY_OUTPUT = hprof_jvmti
--- a/jdk/make/java/jli/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/jli/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -30,7 +30,6 @@
 # its manifestations (java, javaw, javac, ...).
 #
 BUILDDIR = ../..
-MODULE  = base
 LIBRARY = jli
 PRODUCT = java
 
--- a/jdk/make/java/jvm/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/jvm/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE   = base
 
 include $(BUILDDIR)/common/Defs.gmk
 
@@ -39,10 +38,10 @@
 	  $(INCLUDEDIR)/classfile_constants.h
 
 $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
-	$(install-non-module-file)
+	$(install-file)
 
 $(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
-	$(install-non-module-file)
+	$(install-file)
 
 JVMCFG = $(LIBDIR)/$(LIBARCH)/jvm.cfg
 
--- a/jdk/make/java/logging/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/logging/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = logging
 PACKAGE = java.util.logging
 PRODUCT = java
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/main/java/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/main/java/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PROGRAM = java
 PRODUCT = java
 
--- a/jdk/make/java/main/javaw/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/main/javaw/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PROGRAM = javaw
 PRODUCT = java
 
--- a/jdk/make/java/management/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/management/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = management
 PACKAGE = java.lang.management
 LIBRARY = management
 PRODUCT = java
--- a/jdk/make/java/net/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/net/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.net
 LIBRARY = net
 PRODUCT = sun
--- a/jdk/make/java/nio/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/nio/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = nio
 PACKAGE = java.nio
 LIBRARY = nio
 PRODUCT = java
@@ -304,11 +303,7 @@
 # Rules
 #
 
-SUBDIRS_management = mxbean
-include $(BUILDDIR)/common/Subdirs.gmk
-
 build: sources
-	$(SUBDIRS-loop)
 
 clean clobber::
 	$(RM) -r $(NIO_GEN) $(SNIO_GEN)
@@ -821,7 +816,7 @@
 	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
 
 $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
-	$(install-non-module-file)
+	$(install-file)
 
 $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
 	$(prep-target)
--- a/jdk/make/java/nio/mxbean/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../../..
-MODULE   = management
-PACKAGE  = java.nio
-PRODUCT  = java
-include $(BUILDDIR)/common/Defs.gmk
-
-FILES_java = java/nio/BufferPoolMXBean.java
-
-include $(BUILDDIR)/common/Classes.gmk
--- a/jdk/make/java/npt/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/npt/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -26,7 +26,6 @@
 BUILDDIR = ../..
 
 # It's currently used by jpda and hprof.  Put it in base module for now.
-MODULE  = base
 LIBRARY = npt
 PRODUCT = sun
 LIBRARY_OUTPUT = npt
--- a/jdk/make/java/redist/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/redist/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -35,7 +35,6 @@
 # 
 
 BUILDDIR = ../..
-MODULE   = base
 PRODUCT  = java
 include $(BUILDDIR)/common/Defs.gmk
 
@@ -122,32 +121,26 @@
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME)  $@
-	@$(install-module-file)
 
 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME)  $@
-	@$(install-module-file)
 
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
-	@$(install-module-file)
 
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)  $@
-	@$(install-module-file)
 
 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME)  $@
-	@$(install-module-file)
 
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
-	@$(install-module-file)
 
 #  Windows     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Windows
 else # PLATFORM
@@ -291,7 +284,7 @@
 
 $(LIBDIR)/jce.jar: \
 	    $(BUILDDIR)/closed/tools/crypto/jce/jce.jar
-	$(install-non-module-file)
+	$(install-file)
 $(LIBDIR)/security/US_export_policy.jar: \
 	    $(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar
 	$(install-file)
--- a/jdk/make/java/redist/fonts/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/redist/fonts/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = font
 PRODUCT  = java
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/java/redist/sajdi/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/redist/sajdi/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = sajdi
 PRODUCT  = java
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/java/security/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/security/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.security
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/sql/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/sql/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdbc-base
 PACKAGE = java.sql
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/text/base/FILES_java.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/text/base/FILES_java.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -136,6 +136,7 @@
         sun/text/resources/CollationData_sl.java \
         sun/text/resources/CollationData_sq.java \
         sun/text/resources/CollationData_sr.java \
+        sun/text/resources/CollationData_sr_Latn.java \
         sun/text/resources/CollationData_sv.java \
         sun/text/resources/CollationData_tr.java \
         sun/text/resources/CollationData_uk.java \
@@ -251,6 +252,10 @@
         sun/text/resources/FormatData_sr_CS.java \
         sun/text/resources/FormatData_sr_ME.java \
         sun/text/resources/FormatData_sr_RS.java \
+        sun/text/resources/FormatData_sr_Latn.java \
+        sun/text/resources/FormatData_sr_Latn_BA.java \
+        sun/text/resources/FormatData_sr_Latn_ME.java \
+        sun/text/resources/FormatData_sr_Latn_RS.java \
         sun/text/resources/FormatData_sv.java \
         sun/text/resources/FormatData_sv_SE.java \
         sun/text/resources/FormatData_tr.java \
--- a/jdk/make/java/text/base/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/text/base/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PACKAGE = java.text
 PRODUCT = sun
 
--- a/jdk/make/java/util/FILES_properties.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/util/FILES_properties.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -65,6 +65,7 @@
         sun/util/resources/LocaleNames_sl.properties \
         sun/util/resources/LocaleNames_sq.properties \
         sun/util/resources/LocaleNames_sr.properties \
+        sun/util/resources/LocaleNames_sr_Latn.properties \
         sun/util/resources/LocaleNames_sv.properties \
         sun/util/resources/LocaleNames_tr.properties \
         sun/util/resources/LocaleNames_uk.properties \
@@ -111,6 +112,9 @@
         sun/util/resources/CalendarData_sl.properties \
         sun/util/resources/CalendarData_sq.properties \
         sun/util/resources/CalendarData_sr.properties \
+        sun/util/resources/CalendarData_sr_Latn_BA.properties \
+        sun/util/resources/CalendarData_sr_Latn_ME.properties \
+        sun/util/resources/CalendarData_sr_Latn_RS.properties \
         sun/util/resources/CalendarData_sv.properties \
         sun/util/resources/CalendarData_tr.properties \
         sun/util/resources/CalendarData_uk.properties \
@@ -186,6 +190,7 @@
         sun/util/resources/CurrencyNames_nl_NL.properties \
         sun/util/resources/CurrencyNames_no_NO.properties \
         sun/util/resources/CurrencyNames_pl_PL.properties \
+        sun/util/resources/CurrencyNames_pt.properties \
         sun/util/resources/CurrencyNames_pt_BR.properties \
         sun/util/resources/CurrencyNames_pt_PT.properties \
         sun/util/resources/CurrencyNames_ro_RO.properties \
@@ -196,6 +201,10 @@
         sun/util/resources/CurrencyNames_sr_BA.properties \
         sun/util/resources/CurrencyNames_sr_CS.properties \
         sun/util/resources/CurrencyNames_sr_ME.properties \
+        sun/util/resources/CurrencyNames_sr_RS.properties \
+        sun/util/resources/CurrencyNames_sr_Latn_BA.properties \
+        sun/util/resources/CurrencyNames_sr_Latn_ME.properties \
+        sun/util/resources/CurrencyNames_sr_Latn_RS.properties \
         sun/util/resources/CurrencyNames_sv.properties \
         sun/util/resources/CurrencyNames_sv_SE.properties \
         sun/util/resources/CurrencyNames_tr_TR.properties \
--- a/jdk/make/java/verify/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/verify/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PRODUCT = java
 LIBRARY = verify
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/zip/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/java/zip/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.util.zip
 LIBRARY = zip
 PRODUCT = sun
--- a/jdk/make/javax/crypto/Defs-jce.gmk	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/crypto/Defs-jce.gmk	Fri Mar 18 11:00:10 2011 -0700
@@ -83,7 +83,7 @@
 
 define release-warning
 	@$(ECHO) \
-	    "\n***The jar files built by the \"release\" target must***" \
+	    "\n***The jar files built by the 'release' target must***" \
 	    "\n***still be checked into the closed workspace!     ***" \
 	    $(README-MAKEFILE_WARNING)
 endef
--- a/jdk/make/javax/crypto/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/crypto/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -108,7 +108,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = javax.crypto
 PRODUCT = sun
 
@@ -294,7 +293,7 @@
 
 $(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar:		\
 	    $(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar
-	$(install-non-module-file)
+	$(install-file)
 
 $(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar:			\
 	    policy/limited/default_local.policy				\
@@ -415,7 +414,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/jce.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 #
 # Install the appropriate policy file, depending on the type of build.
@@ -435,7 +434,7 @@
 	    $(POLICY_DESTDIR)/local_policy.jar
 	$(CP) $^ $(POLICY_DESTDIR)
 
-install-limited: install-limited-jars install-module-files
+install-limited: install-limited-jars
 ifndef OPENJDK
 	$(release-warning)
 endif
@@ -449,7 +448,7 @@
 	    $(POLICY_DESTDIR)/local_policy.jar
 	$(CP) $^ $(POLICY_DESTDIR)
 
-install-unlimited: install-unlimited-jars install-module-files
+install-unlimited: install-unlimited-jars
 ifndef OPENJDK
 	$(release-warning)
 endif
@@ -466,16 +465,9 @@
 	    $(PREBUILT_DIR)/jce/local_policy.jar \
 	    $(POLICY_DESTDIR)
 
-install-prebuilt: install-prebuilt-jars install-module-files
+install-prebuilt: install-prebuilt-jars
 endif
 
-install-module-files: \
-	   $(POLICY_DESTDIR)/US_export_policy.jar \
-	   $(POLICY_DESTDIR)/local_policy.jar
-
-$(POLICY_DESTDIR)/%.jar :
-	$(install-module-file)
-
 # =====================================================
 # Support routines.
 #
--- a/jdk/make/javax/imageio/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/imageio/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = imageio
 PACKAGE = javax.imageio
 PRODUCT = jiio
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/javax/print/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/print/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = print
 PACKAGE = javax.print
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/javax/sound/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/sound/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = sound
 PACKAGE = javax.sound
 LIBRARY = jsound
 PRODUCT = sun
--- a/jdk/make/javax/sound/jsoundalsa/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/sound/jsoundalsa/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = sound
 PACKAGE = javax.sound
 LIBRARY = jsoundalsa
 PRODUCT = sun
--- a/jdk/make/javax/sound/jsoundds/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/sound/jsoundds/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = sound
 PACKAGE = javax.sound
 LIBRARY = jsoundds
 PRODUCT = sun
--- a/jdk/make/javax/sql/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/sql/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdbc-enterprise
 PACKAGE = javax.sql
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/javax/swing/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/swing/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR  = ../..
-MODULE    = swing
 PACKAGE   = javax.swing
 PRODUCT   = com
 SWING_SRC = $(SHARE_SRC)/classes/javax/swing
--- a/jdk/make/javax/swing/plaf/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/javax/swing/plaf/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR  = ../../..
-MODULE    = swing
 PACKAGE   = javax.swing.plaf
 PRODUCT   = com
 SWING_SRC = $(SHARE_SRC)/classes/javax/swing
--- a/jdk/make/jpda/back/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/jpda/back/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = debugging
 LIBRARY = jdwp
 PRODUCT = jpda
 
--- a/jdk/make/jpda/transport/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/jpda/transport/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = debugging
 PRODUCT = jpda
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/jpda/transport/shmem/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/jpda/transport/shmem/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = debugging
 LIBRARY  = dt_shmem
 PRODUCT = jbug
 
--- a/jdk/make/jpda/transport/socket/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/jpda/transport/socket/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = debugging
 LIBRARY = dt_socket
 PRODUCT = jbug
 
--- a/jdk/make/jpda/tty/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/jpda/tty/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdb
 PACKAGE = com.sun.tools.example.debug.tty
 PRODUCT = jpda
 PROGRAM = jdb
--- a/jdk/make/launchers/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/launchers/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ..
-MODULE  = tools
 PACKAGE = launchers
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
@@ -38,7 +37,6 @@
 define make-corba-launcher
 $(CD) $(BUILDDIR)/launchers && \
 $(MAKE) -f Makefile.launcher \
-        MODULE=corba \
         PROGRAM=$(strip $1) \
         MAIN_CLASS=$(strip $2) \
         MAIN_JAVA_ARGS="$(strip $3)" \
--- a/jdk/make/mkdemo/jfc/SwingSet2/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mkdemo/jfc/SwingSet2/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -37,6 +37,7 @@
 DEMO_MAINCLASS  = $(DEMONAME)
 DEMO_MANIFEST_ATTR = SplashScreen-Image: resources/images/splash.png
 DEMO_DESTDIR    = $(DEMODIR)/jfc/$(DEMONAME)
+DEMO_INCL_SRC   = true
 
 #
 # Demo jar building rules.
--- a/jdk/make/mkdemo/jpda/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mkdemo/jpda/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -32,6 +32,8 @@
 DEMO_PKGDIR     = com/sun/tools/example
 DEMO_TOPFILES   = ./com/sun/tools/example/README
 DEMO_DESTDIR    = $(DEMODIR)/jpda
+DEMO_JAR_NAME   = examples.jar
+DEMO_ONLY_SRC   = true
 
 #
 # Demo jar building rules.
--- a/jdk/make/mkdemo/jvmti/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mkdemo/jvmti/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = demos
 PRODUCT = demos
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/mkdemo/management/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mkdemo/management/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = demos
 PRODUCT = demos
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/mksample/dtrace/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/dtrace/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/jmx/jmx-scandir/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/jmx/jmx-scandir/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nbproject/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/nbproject/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nio/file/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/nio/file/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nio/multicast/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/nio/multicast/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nio/server/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/nio/server/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/scripting/scriptpad/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/scripting/scriptpad/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/webservices/EbayClient/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/webservices/EbayClient/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/webservices/EbayServer/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/mksample/webservices/EbayServer/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/modules/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ..
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Modularizing the JDK
-# - Post jdk build process until the source tree is restructured
-#   for modules build
-# - <outputdir>/modules/<module> will be created for each module.
-#
-# Steps:
-# 0. During jdk build before this makefile is invoked, classes, 
-#    resource files, and other non-class files such as native libraries,
-#    properties file, images, etc are created.
-#
-#    Non-class files are copied to <outputdir>/tmp/modules/<MODULE>
-#    directory in this step to prepare for the post-build modularization. 
-#
-#    The MODULE variable defined in other makefiles specifies 
-#    the lowest-level module that the non-class files belong to.
-#    The name might or might not be the same as the name of the modules 
-#    in the resulting <outputdir>/modules directory.
-#    
-# 1. Unpack all jars in the <builddir>/lib directory to a temporary 
-#    location (<outputdir>/tmp/modules/classes) to prepare for modules
-#    creation.
-#
-# 2. Run ClassAnalyzer tool to analyze all jdk classes and generate
-#    class list for all modules and also perform dependency analysis. 
-#
-#    Input configuration files :-
-#
-#    modules.config : defines the low-level modules and specifies 
-#       what classes and resource files each module includes.
-#    modules.group  : defines the module groups and its members.
-#    jdk7.depconfig : lists the dynamic dependencies including
-#       use of reflection Class.forName and JNI FindClass and
-#       service provider.
-#    optional.depconfig : lists the optional dependencies
-#
-# 3. Create one directory for each module (<outputdir>/modules/<module>)
-#    based on the output files from (2).
-#       
-#    modules.list lists the modules to be created for the modules
-#    build and its members. For each module (m) in modules.list,
-#    a. create $m/lib/$m.jar with all classes and resource files
-#       listed in $m.classlist and $m.resources respectively.
-#    b. copy all non-class files from its members to 
-#       <outputdir>/modules/$m.
-
-
-MAINMANIFEST=$(JDK_TOPDIR)/make/tools/manifest.mf
-MODULE_JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp
-
-TMP = $(ABS_MODULES_TEMPDIR)
-MODULE_CLASSLIST = $(ABS_MODULES_TEMPDIR)/classlist
-MODULE_CLASSES = $(ABS_MODULES_TEMPDIR)/classes
-MODULES_LIST = $(MODULE_CLASSLIST)/modules.list
-
-all:: unpack-jars gen-classlist modularize
-
-JAR_LIST := $(shell $(FIND) $(ABS_OUTPUTDIR)/lib -name \*.jar -print) 
-unpack-jars:
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-	$(RM) -rf $(MODULE_CLASSES)
-	$(MKDIR) -p $(MODULE_CLASSES)
-	$(CP) -rf $(CLASSBINDIR)/* $(MODULE_CLASSES)
-	@for jf in  $(JAR_LIST) ; do \
-	   $(CD) $(MODULE_CLASSES) && $(BOOT_JAR_CMD) xf $$jf $(BOOT_JAR_JFLAGS);\
-	done
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-gen-classlist:
-	$(CD) tools && $(MAKE) all
-
-modularize: $(MODULE_JAR_MANIFEST_FILE)
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-	@$(RM) -rf $(MODULES_DIR)
-
-	@# create jar file for modules and
-	@# copy other files from all members of this module 
-	for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
-   	   $(ECHO) "Creating module $$m" ; \
-   	   $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.classlist > $(TMP)/tmp.cf ; \
-	   if [ -f $(MODULE_CLASSLIST)/$$m.resources ] ; then \
-   	       $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.resources >> $(TMP)/tmp.cf ; \
-           fi ; \
-           $(MKDIR) -p $(ABS_MODULES_DIR)/$$m/lib; \
-	   $(CD) $(MODULE_CLASSES) && \
-               $(BOOT_JAR_CMD) c0mf $(MODULE_JAR_MANIFEST_FILE) \
-		   $(ABS_MODULES_DIR)/$$m/lib/$$m.jar \
-	           @$(TMP)/tmp.cf \
-                   $(BOOT_JAR_JFLAGS); \
-	   for s in `$(GREP) "^$$m" $(MODULES_LIST)` ; do \
-               if [ -d $(TMP)/$$s ] ; then \
-               	   $(CP) -rf $(TMP)/$$s/*  $(ABS_MODULES_DIR)/$$m; \
-		   $(RM) -rf $(ABS_MODULES_DIR)/$$m/classes; \
-	       fi \
-	   done \
-        done
-	@$(CD) $(MODULE_CLASSES) && $(java-vm-cleanup)
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-$(MODULE_JAR_MANIFEST_FILE):
-	$(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) > $@
-
-clean clobber::
-	$(RM) -rf $(MODULE_CLASSLIST)
-	$(RM) -rf $(MODULES_DIR)
-	$(RM) $(MODULE_JAR_MANIFEST_FILE)
--- a/jdk/make/modules/bootmodule.roots	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# List of root classes/methods, each line of the following syntax:
-# <class name> 
-# <method name> <signature>|*
-# exclude <class>|<method> 
-
-# The boot module generated based on this rootset does not support
-# - security permission check
-# - non-standard charset
-# - logging output
-# - resource bundles
-#   including error output from the launcher 
-
-# VM preloaded classes
-java.lang.Object
-java.lang.String
-java.lang.Class
-java.lang.Cloneable
-java.lang.ClassLoader
-java.lang.System
-java.lang.Throwable
-java.lang.Error
-java.lang.ThreadDeath
-java.lang.Exception
-java.lang.RuntimeException
-java.security.ProtectionDomain
-java.security.AccessControlContext
-java.lang.ClassNotFoundException
-java.lang.NoClassDefFoundError
-java.lang.ClassCastException
-java.lang.ArrayStoreException
-java.lang.VirtualMachineError
-java.lang.OutOfMemoryError
-java.lang.StackOverflowError
-java.lang.IllegalMonitorStateException
-java.lang.ref.Reference
-java.lang.ref.SoftReference
-java.lang.ref.WeakReference
-java.lang.ref.FinalReference
-java.lang.ref.PhantomReference
-java.lang.ref.Finalizer
-java.lang.Runnable
-java.lang.Thread
-java.lang.ThreadGroup
-java.util.Properties
-java.lang.reflect.AccessibleObject
-java.lang.reflect.Member
-java.lang.reflect.Field
-java.lang.reflect.Method
-java.lang.reflect.Constructor
-java.lang.reflect.Type
-sun.reflect.MagicAccessorImpl
-sun.reflect.MethodAccessorImpl
-sun.reflect.ConstructorAccessorImpl
-sun.reflect.DelegatingClassLoader
-sun.reflect.ConstantPool
-sun.reflect.UnsafeStaticFieldAccessorImpl
-java.util.Vector
-java.lang.StringBuffer
-java.lang.StackTraceElement
-java.nio.Buffer
-java.lang.Boolean
-java.lang.Character
-java.lang.Float
-java.lang.Double
-java.lang.Byte
-java.lang.Short
-java.lang.Integer
-java.lang.Long
-java.lang.NullPointerException
-java.lang.ArithmeticException
-java.lang.Compiler
-
-
-# Root methods
-java.lang.ClassLoader.getSystemClassLoader ()Ljava/lang/ClassLoader;
-java.lang.System.initializeSystemClass ()V
-sun.launcher.LauncherHelper.checkAndLoadMain (ZZLjava/lang/String;)Ljava/lang/Object;
-
-# The tool doesn't automatically find superclasses and parse the method
-# if overridden as it tries to reduce unnecessary classes being pulled in.
-# The following forces the dependency to be included the result.
-sun.net.www.protocol.file.Handler.<init> ()V
-sun.net.www.protocol.jar.Handler.<init> ()V
-sun.net.www.protocol.file.Handler.openConnection *
-sun.net.www.protocol.jar.Handler.openConnection *
-sun.misc.URLClassPath$JarLoader.<init>  (Ljava/net/URL;Ljava/net/URLStreamHandler;Ljava/util/HashMap;)V
-sun.misc.URLClassPath$FileLoader.<init> (Ljava/net/URL;)V
-sun.misc.URLClassPath$FileLoader.getClassPath *
-sun.misc.URLClassPath$FileLoader.getResource *
-sun.misc.URLClassPath$JarLoader.getResource *
-sun.misc.URLClassPath$JarLoader.getClassPath *
-
-# permission collections
-java.io.FilePermission.newPermissionCollection ()Ljava/security/PermissionCollection;
-java.security.BasicPermission.newPermissionCollection ()Ljava/security/PermissionCollection;
-
-# native
-java.io.UnixFileSystem
-java.io.UnixFileSystem.<init> ()V
-java.io.UnixFileSystem.canonicalize *
-java.io.Win32FileSystem
-java.io.Win32FileSystem.<init> ()V
-java.io.Win32FileSystem.canonicalize *
-java.io.WinNTFileSystem
-java.io.WinNTFileSystem.<init> ()V
-java.io.WinNTFileSystem.canonicalize *
-
-# missing
-java.util.HashMap.<init> ()V
-java.util.HashMap$EntrySet.iterator *
-
-# Called from native GetStringPlatformChars (jni_util.c)
-java.lang.String.getBytes *
-
-# charset
-sun.nio.cs.US_ASCII.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_8.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_8.newDecoder  *
-sun.nio.cs.UTF_16.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_16.newDecoder  *
-sun.nio.cs.UTF_32.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_32.newDecoder  *
-
-# hashcode
-java.util.jar.Attributes$Name.hashCode *
-
-# nio
-sun.nio.ByteBuffered
-sun.nio.ch.DirectBuffer
-java.nio.DirectByteBuffer
-java.nio.MappedByteBuffer
-java.nio.DirectLongBufferU
-
-# resource files
-sun.launcher.resources.launcher
-
-sun.misc.Launcher$AppClassLoader.getPermissions *
-sun.misc.Launcher$AppClassLoader.loadClass  (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$AppClassLoader.findClass  (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$ExtClassLoader.getPermissions *
-sun.misc.Launcher$ExtClassLoader.loadClass  (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$ExtClassLoader.findClass  (Ljava/lang/String;)Ljava/lang/Class;
-java.lang.ClassLoader.checkPackageAccess *
-java.lang.ClassLoader.findClass *
-java.lang.ClassLoader.defineClass *
-java.net.URLClassLoader.getPermissions *
-java.net.URLClassLoader.findClass *
-java.net.URLClassLoader.defineClass *
-java.security.SecureClassLoader.defineClass *
-# need to parse superclasses <init>
-java.security.SecureClassLoader.<init> ()V
-
-exclude sun.security.provider.PolicyFile.<init>
-exclude java.lang.ClassLoader.compareCerts
-exclude java.security.cert.Certificate.equals
-# unsigned jars - no verifier
-exclude java.util.jar.JarFile.initializeVerifier
-exclude java.util.jar.JarVerifier 
-exclude sun.security.util.SignatureFileVerifier.<init>
-
-
-# what about other charset
-exclude sun.misc.Service
-exclude java.util.ServiceLoader
-
-# exclude support for localized messages
-exclude java.util.ResourceBundle.getBundle
-exclude java.text.MessageFormat
-exclude sun.util.logging.PlatformLogger$LoggerProxy.format *
-
-# exclude nio and miscellaneous classes
-exclude java.nio.channels.**
-exclude sun.misc.FloatingDecimal
-exclude sun.misc.FormattedFloatingDecimal
-exclude sun.misc.FDBigInt 
--- a/jdk/make/modules/jdk7.depconfig	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,473 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# private java.lang.Object createInetSocketAddress(java.lang.String, int)
-@ClassForName
-  com.sun.jndi.ldap.Connection -> java.net.InetSocketAddress
-  com.sun.jndi.ldap.Connection -> java.net.SocketAddress
-
-# com.sun.jndi.ldap.VersionHelper
-@ClassForName(optional)
-  com.sun.jndi.ldap.VersionHelper -> com.sun.jndi.ldap.VersionHelper*
-
-# private static void initMethodHandles()
-@ClassForName
-  com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.CORBA.Stub
-  com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.PortableRemoteObject
-
-# com.sun.naming.internal.ResourceManager$AppletParameter
-@ClassForName(optional)
-  com.sun.naming.internal.ResourceManager$AppletParameter -> java.applet.Applet
-
-# private static boolean loadProviderAsService()
-@Provider
-  com.sun.net.httpserver.spi.HttpServerProvider -> META-INF/services/com.sun.net.httpserver.spi.HttpServerProvider
-
-# com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT
-@ClassForName
-  com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT -> javax.xml.XMLConstants
-
-# public static java.beans.PersistenceDelegate getPersistenceDelegate(java.lang.Class)
-@ClassForName
-  java.beans.MetaData -> java.beans.*_PersistenceDelegate
-
-# private static java.lang.reflect.Method getNanosMethod()
-@ClassForName(optional)
-  java.beans.java_sql_Timestamp_PersistenceDelegate -> java.sql.Timestamp
-
-# java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate
-@ClassForName
-  java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate -> java.util.Collections$CheckedCollection
-
-# java.beans.java_util_Collections$CheckedMap_PersistenceDelegate
-@ClassForName
-  java.beans.java_util_Collections$CheckedMap_PersistenceDelegate -> java.util.Collections$CheckedMap
-
-# private static java.lang.Object getType(java.lang.Object)
-@ClassForName
-  java.beans.java_util_EnumMap_PersistenceDelegate -> java.util.EnumMap
-
-# private java.lang.Integer getAxis(java.lang.Object)
-@ClassForName
-  java.beans.javax_swing_Box_PersistenceDelegate -> javax.swing.BoxLayout
-
-# java.lang.Double
-@Inline
-  java.lang.Double -> sun.misc.FloatConsts
-  java.lang.Double -> sun.misc.DoubleConsts
-
-# java.lang.Float
-@Inline
-  java.lang.Float -> sun.misc.FloatConsts
-  java.lang.Float -> sun.misc.DoubleConsts
-
-# java.net.DefaultDatagramSocketImplFactory
-@ClassForName(optional)
-  java.net.DefaultDatagramSocketImplFactory -> java.net.*DatagramSocketImpl
-
-# private static sun.net.spi.nameservice.NameService createNSProvider(java.lang.String)
-@Provider
-  java.net.InetAddress -> META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor
-
-# static java.net.InetAddressImpl create()
-@ClassForName
-  java.net.InetAddressImplFactory -> java.net.*Inet[46]AddressImpl
-
-# private static void init()
-@NativeFindClass
-  java.net.PlainDatagramSocketImpl -> java.io.FileDescriptor
-
-# java.net.ProxySelector
-@ClassForName
-  java.net.ProxySelector -> sun.net.spi.DefaultProxySelector
-
-# static java.net.URLStreamHandler getURLStreamHandler(java.lang.String)
-@ClassForName(optional)
-  java.net.URL -> sun.net.www.protocol.*.Handler
-
-# private java.net.ContentHandler lookupContentHandlerClassFor(java.lang.String)
-@ClassForName
-  java.net.URLConnection -> sun.net.www.content.*
-
-# private static java.nio.channels.spi.AsynchronousChannelProvider loadProviderAsService()
-@Provider
-  java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder -> META-INF/services/java.nio.channels.spi.AsynchronousChannelProvider
-
-# private static boolean loadProviderFromProperty()
-@ClassForName
-  java.nio.channels.spi.SelectorProvider -> sun.nio.ch.DefaultSelectorProvider
-
-# private static boolean loadProviderAsService()
-@Provider
-  java.nio.channels.spi.SelectorProvider -> META-INF/services/java.nio.channels.spi.SelectorProvider
-
-# private static java.util.Iterator providers()
-@Provider
-  java.nio.charset.Charset -> META-INF/services/java.nio.charset.spi.CharsetProvider
-
-# private static void probeExtendedProvider()
-@ClassForName(optional)
-  java.nio.charset.Charset -> sun.nio.cs.ext.ExtendedCharsets
-
-# public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String, ?>, java.lang.ClassLoader)
-@Provider
-  java.nio.file.FileSystems -> META-INF/services/java.nio.file.FileSystemProvider
-
-# private static java.util.List<java.nio.file.spi.FileTypeDetector> loadInstalledDetectors()
-@Provider
-  java.nio.file.Files$DefaultFileTypeDetectorHolder -> META-INF/services/java.nio.file.spi.FileTypeDetector
-
-# public static java.util.List<java.nio.file.spi.FileSystemProvider> installedProviders()
-@Provider
-  java.nio.file.spi.FileSystemProvider -> META-INF/services/java.nio.file.FileSystemProvider
-
-# private static java.rmi.server.RMIClassLoaderSpi initializeProvider()
-@Provider
-  java.rmi.server.RMIClassLoader -> META-INF/services/java.rmi.server.RMIClassLoaderSpi
-
-# private static void initializeSystemScope()
-@ClassForName(optional)
-  java.security.IdentityScope -> sun.security.provider.IdentityDatabase
-
-# static java.security.Policy getPolicyNoCheck()
-@ClassForName
-  java.security.Policy -> sun.security.provider.PolicyFile
-
-# private static java.lang.Class getSpiClass(java.lang.String)
-@ClassForName
-  java.security.Security -> java.security.*Spi
-
-# private static void invalidateSMCache(java.lang.String)
-@ClassForName
-  java.security.Security -> java.lang.SecurityManager
-
-# private static void loadInitialDrivers()
-@Provider
-  java.sql.DriverManager -> META-INF/services/java.sql.Driver
-
-# private static java.text.BreakIterator createBreakInstance(java.util.Locale, int, java.lang.String, java.lang.String)
-@Provider
-  java.text.BreakIterator -> META-INF/services/java.util.spi.BreakIteratorProvider
-
-# public static java.text.Collator getInstance(java.util.Locale)
-@Provider
-  java.text.Collator -> META-INF/services/java.util.spi.CollatorProvider
-
-# private static java.text.DateFormat get(int, int, int, java.util.Locale)
-@Provider
-  java.text.DateFormat -> META-INF/services/java.util.spi.DateNameProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
-  java.text.DateFormatSymbols -> META-INF/services/java.util.spi.DateFormatSymbolsProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
-  java.text.DecimalFormatSymbols -> META-INF/services/java.util.spi.DecimalFormatSymbolsProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
-  java.text.NumberFormat -> META-INF/services/java.util.spi.NumberFormatProvider
-
-# public java.lang.String getDisplayName(java.util.Locale)
-@Provider
-  java.util.Currency -> META-INF/services/java.util.spi.CurrencyNameProvider
-
-# java.util.Formatter
-@Inline
-  java.util.Formatter -> sun.misc.DoubleConsts
-
-# java.util.Locale
-@Inline
-  java.util.Locale -> java.util.LocaleISOData
-
-# private java.lang.String getDisplayString(java.lang.String, java.util.Locale, int)
-@Provider
-  java.util.Locale -> META-INF/services/java.util.spi.LocaleNameProvider
-
-# private static java.util.prefs.PreferencesFactory factory1()
-@ClassForName
-  java.util.prefs.Preferences -> java.util.prefs.WindowsPreferencesFactory
-  java.util.prefs.Preferences -> java.util.prefs.FileSystemPreferencesFactory
-
-# private static java.util.prefs.PreferencesFactory factory1()
-@Provider
-  java.util.prefs.Preferences -> META-INF/services/java.util.prefs.PreferencesFactory
-
-# public void registerApplicationClasspathSpis()
-@Provider
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.IIOServiceProvider
-
-# private void registerInstalledProviders()
-@Provider
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageWriterSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderWriterSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageTranscoderSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageInputStreamSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageOutputStreamSpi
-
-# public javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String, byte[], int, int)
-@Provider
-  javax.naming.ldap.StartTlsRequest -> META-INF/services/javax.naming.ldap.StartTlsResponse
-
-# private static java.util.ArrayList getAllLookupServices()
-@Provider
-  javax.print.PrintServiceLookup -> META-INF/services/javax.print.PrintServiceLookup
-
-# private static java.util.ArrayList getAllFactories()
-@Provider
-  javax.print.StreamPrintServiceFactory -> META-INF/services/javax.print.StreamPrintServiceFactory
-
-# private void initEngines(java.lang.ClassLoader)
-@Provider
-  javax.script.ScriptEngineManager -> META-INF/services/javax.script.ScriptEngineFactory
-
-# private void initializeInputMethodLocatorList()
-@Provider
-  sun.awt.im.ExecutableInputMethodManager -> META-INF/services/java.awt.im.spi.InputMethodDescriptor
-
-# private static java.lang.Class getConverterClass(int, java.lang.String)
-@ClassForName(optional)
-  sun.io.Converters -> sun.io.*
-
-# public static sun.java2d.cmm.PCMM getModule()
-@Provider
-  sun.java2d.cmm.CMSManager -> META-INF/services/sun.java2d.cmm.PCMM
-
-# public static sun.java2d.pipe.RenderingEngine getInstance()
-@Provider
-  sun.java2d.pipe.RenderingEngine -> META-INF/services/sun.java2d.pipe.RenderingEngine
-
-# public static sun.java2d.pipe.RenderingEngine getInstance()
-@ClassForName(optional)
-  sun.java2d.pipe.RenderingEngine -> sun.dc.DuctusRenderingEngine
-
-# sun.misc.FloatingDecimal
-@Inline
-  sun.misc.FloatingDecimal -> sun.misc.FloatConsts
-  sun.misc.FloatingDecimal -> sun.misc.DoubleConsts
-
-# sun.misc.FormattedFloatingDecimal
-@Inline
-  sun.misc.FormattedFloatingDecimal -> sun.misc.FloatConsts
-  sun.misc.FormattedFloatingDecimal -> sun.misc.DoubleConsts
-
-# sun.misc.FpUtils
-@Inline
-  sun.misc.FpUtils -> sun.misc.FloatConsts
-  sun.misc.FpUtils -> sun.misc.DoubleConsts
-
-# public java.net.URLStreamHandler createURLStreamHandler(java.lang.String)
-@ClassForName(optional)
-  sun.misc.Launcher$Factory -> sun.net.www.protocol.*.Handler
-
-# private static sun.net.NetHooks$Provider loadProvider(java.lang.String)
-@ClassForName(optional)
-  sun.net.NetHooks -> sun.net.spi.SdpProvider
-
-# sun.net.idn.StringPrep
-@Inline
-  sun.net.idn.StringPrep -> sun.net.idn.UCharacterDirection
-
-# private static boolean init()
-@NativeFindClass
-  sun.net.spi.DefaultProxySelector -> java.net.Proxy
-  sun.net.spi.DefaultProxySelector -> java.net.Proxy$Type
-  sun.net.spi.DefaultProxySelector -> java.net.InetSocketAddress
-
-# private static java.nio.channels.Channel createChannel()
-@ClassForName
-  sun.nio.ch.InheritedChannel -> java.io.FileDescriptor
-
-# private static void initDBBConstructor()
-@ClassForName
-  sun.nio.ch.Util -> java.nio.DirectByteBuffer
-
-# private static void initDBBRConstructor()
-@ClassForName
-  sun.nio.ch.Util -> java.nio.DirectByteBufferR
-
-# private java.nio.charset.Charset lookup(java.lang.String)
-@ClassForName(optional)
-  sun.nio.cs.FastCharsetProvider -> sun.nio.cs.*
-
-# sun.nio.cs.ext.ExtendedCharsets
-@ClassForName(optional)
-  sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.*
-
-# sun.nio.cs.ext.ExtendedCharsets
-@ClassForName(optional)
-  sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.*
-
-# public static java.nio.file.spi.FileSystemProvider create()
-@ClassForName
-  sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.SolarisFileSystemProvider
-  sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.LinuxFileSystemProvider
-
-# sun.rmi.server.MarshalInputStream
-@ClassForName
-  sun.rmi.server.MarshalInputStream -> sun.rmi.server.Activation$ActivationSystemImpl_Stub
-  sun.rmi.server.MarshalInputStream -> sun.rmi.registry.RegistryImpl_Stub
-
-# private java.security.Provider doLoadProvider()
-@ClassForName(optional)
-  sun.security.jca.ProviderConfig -> sun.security.pkcs11.SunPKCS11
-  sun.security.jca.ProviderConfig -> sun.security.provider.Sun
-  sun.security.jca.ProviderConfig -> sun.security.rsa.SunRsaSign
-  sun.security.jca.ProviderConfig -> sun.security.ec.SunEC
-  sun.security.jca.ProviderConfig -> com.sun.net.ssl.internal.ssl.Provider
-  sun.security.jca.ProviderConfig -> com.sun.crypto.provider.SunJCE
-  sun.security.jca.ProviderConfig -> sun.security.jgss.SunProvider
-  sun.security.jca.ProviderConfig -> com.sun.security.sasl.Provider
-  sun.security.jca.ProviderConfig -> org.jcp.xml.dsig.internal.dom.XMLDSigRI
-  sun.security.jca.ProviderConfig -> sun.security.smartcardio.SunPCSC
-  sun.security.jca.ProviderConfig -> sun.security.mscapi.SunMSCAPI
-
-# public static java.security.Provider getSunProvider()
-@ClassForName
-  sun.security.jca.Providers -> sun.security.provider.Sun
-  sun.security.jca.Providers -> sun.security.provider.VerificationProvider
-
-# private static sun.security.jgss.spi.MechanismFactory getMechFactoryImpl(java.security.Provider, java.lang.String, org.ietf.jgss.Oid, sun.security.jgss.GSSCaller)
-@ClassForName
-  sun.security.jgss.ProviderList -> sun.security.jgss.spi.MechanismFactory
-
-# sun.security.jgss.wrapper.SunNativeProvider
-@NativeFindClass
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.Oid
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.GSSException
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSNameElement
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSCredElement
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.NativeGSSContext
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.SunNativeProvider
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.MessageProp
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.ChannelBinding
-  sun.security.jgss.wrapper.SunNativeProvider -> java.net.InetAddress
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSLibStub
-
-# static void ensureLoaded()
-@NativeFindClass
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.Krb5
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.Ticket
-  sun.security.krb5.Credentials -> sun.security.krb5.PrincipalName
-  sun.security.krb5.Credentials -> sun.security.util.DerValue
-  sun.security.krb5.Credentials -> sun.security.krb5.EncryptionKey
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.TicketFlags
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.KerberosTime
-
-# public static java.lang.String getDefaultCacheName()
-@ClassForName(optional)
-  sun.security.krb5.internal.ccache.FileCredentialsCache -> com.sun.security.auth.module.UnixSystem
-
-# sun.security.pkcs.PKCS9Attribute
-@ClassForName
-  sun.security.pkcs.PKCS9Attribute -> sun.security.util.ObjectIdentifier
-  sun.security.pkcs.PKCS9Attribute -> java.util.Date
-  sun.security.pkcs.PKCS9Attribute -> sun.security.pkcs.SignerInfo
-  sun.security.pkcs.PKCS9Attribute -> sun.security.x509.CertificateExtensions
-
-# protected T engineGetKeySpec(java.security.Key, java.lang.Class<T>)
-@ClassForName
-  sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPublicKeySpec
-  sun.security.provider.DSAKeyFactory -> java.security.spec.X509EncodedKeySpec
-  sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPrivateKeySpec
-  sun.security.provider.DSAKeyFactory -> java.security.spec.PKCS8EncodedKeySpec
-
-# protected T engineGetParameterSpec(java.lang.Class<T>)
-@ClassForName
-  sun.security.provider.DSAParameters -> java.security.spec.DSAParameterSpec
-
-# sun.security.provider.VerificationProvider
-@ClassForName(optional)
-  sun.security.provider.VerificationProvider -> sun.security.provider.Sun
-  sun.security.provider.VerificationProvider -> sun.security.rsa.SunRsaSign
-
-# sun.security.provider.certpath.URICertStore$LDAP
-@ClassForName(optional)
-  sun.security.provider.certpath.URICertStore$LDAP -> sun.security.provider.certpath.ldap.LDAPCertStoreHelper
-
-# sun.security.smartcardio.PCSC
-@NativeFindClass
-  sun.security.smartcardio.PCSC -> sun.security.smartcardio.PCSCException
-
-# sun.security.ssl.HandshakeMessage
-@ClassForName
-  sun.security.ssl.HandshakeMessage -> java.security.MessageDigest$Delegate
-
-# sun.security.ssl.JsseJce
-@ClassForName(optional)
-  sun.security.ssl.JsseJce -> sun.security.krb5.PrincipalName
-
-# sun.security.x509.OIDMap$OIDInfo
-@ClassForName
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectKeyIdentifierExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.KeyUsageExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PrivateKeyUsageExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectAlternativeNameExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuerAlternativeNameExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.BasicConstraintsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLNumberExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLReasonCodeExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NameConstraintsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyMappingsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityKeyIdentifierExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyConstraintsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NetscapeCertTypeExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificatePoliciesExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.ExtendedKeyUsageExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.InhibitAnyPolicyExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLDistributionPointsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificateIssuerExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectInfoAccessExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityInfoAccessExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuingDistributionPointExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.DeltaCRLIndicatorExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.FreshestCRLExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.OCSPNoCheckExtension
-
-# sun.util.LocaleServiceProviderPool$AllAvailableLocales
-@Provider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.BreakIteratorProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.CollatorProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatSymbolsProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DecimalFormatSymbolsProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.NumberFormatProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.CurrencyNameProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.LocaleNameProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.TimeZoneNameProvider
-
-# private static final java.lang.String[] retrieveDisplayNames(sun.util.resources.OpenListResourceBundle, java.lang.String, java.util.Locale)
-@Provider
-  sun.util.TimeZoneNameUtility -> META-INF/services/java.util.spi.TimeZoneNamePProvider
-
-# public static sun.util.calendar.CalendarSystem forName(java.lang.String)
-@ClassForName
-  sun.util.calendar.CalendarSystem -> sun.util.calendar.Gregorian
-  sun.util.calendar.CalendarSystem -> sun.util.calendar.LocalGregorianCalendar
-  sun.util.calendar.CalendarSystem -> sun.util.calendar.JulianCalendar
-
-# sun.util.logging.LoggingSupport
-@ClassForName(optional)
-  sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl
--- a/jdk/make/modules/modules.config	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,928 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// These classes are not referenced in the JDK but we can't
-// remove them for compatibility reason.  Define this module
-// first so that other modules don't need to exclude these clases
-module private-legacy {
-    include sun.misc.Cache*,
-            sun.misc.ClassLoaderUtil,
-            sun.misc.Compare,
-            sun.misc.ConditionLock,
-            sun.misc.CRC16,
-            sun.misc.Lock,
-            sun.misc.Regexp,
-            sun.misc.RequestProcessor,
-            sun.misc.Sort,
-            sun.misc.Request,
-            sun.misc.Timeable,
-            sun.misc.Timer,
-            sun.misc.TimerThread,
-            sun.misc.TimerTickThread,
-            sun.misc.UCDecoder,
-            sun.misc.UCEncoder,
-            sun.misc.UUDecoder,
-            sun.misc.UUEncoder,
-            com.sun.net.ssl.SSLContext,
-            sun.net.NetworkServer,
-            sun.net.URLCanonicalizer,
-            sun.reflect.misc.ConstructorUtil,
-            sun.reflect.FieldInfo,
-            sun.reflect.SignatureIterator,
-            sun.reflect.generics.reflectiveObjects.NotImplementedException,
-            sunw.io.Serializable,
-            sunw.util.EventListener,
-            sunw.util.EventObject;
-}
-
-// Deprecated classes that aren't referenced/used go here.
-module deprecated {
-    // add deprecated security classes once b78 is promoted
-}
-
-/**************************************************************************/
-
-module base {
-    // core classes
-    include java.lang.*,
-            java.lang.annotation.*,
-            java.lang.ref.*,
-            java.lang.reflect.*,
-            java.math.*,
-            java.net.*,
-            java.util.*,
-            java.util.concurrent.**,
-            java.util.jar.*,
-            java.util.regex.*,
-            java.util.spi.*,
-            java.util.zip.*,
-            java.text.**;
-
-    exclude java.util.jar.Pack200*,
-            java.util.XMLUtils,
-            java.text.Bidi;
-
-    include java.io.*, java.nio.*, java.nio.charset.**;
-    exclude java.io.TempFileHelper, java.nio.BufferPoolMXBean;
-
-    // security APIs
-    // javax.crypto and javax.security.auth are included to avoid inconsistent
-    // spliting of JCA and JAAS. This adds about 85k. Also note that some deprecated
-    // classes must be included for now (see 6876158, 6876170)
-    include java.security.*,
-            java.security.cert.*,
-            java.security.interfaces.*,
-            java.security.spec.*,
-            javax.security.auth.**,
-            javax.crypto.**;
-
-    // Sun and RSA security providers (except LDAP CertStore)
-    // roots sun.security.provider.* sun.security.provider.certpath.* sun.security.rsa.*
-    include com.sun.security.auth.PrincipalComparator,
-            com.sun.security.auth.SubjectCodeSource,
-            com.sun.security.auth.login.**,
-            com.sun.security.auth.Policy*,
-            sun.security.action.*,
-            sun.security.ec.*,
-            sun.security.jca.*,
-            sun.security.pkcs.*,
-            sun.security.provider.*,
-            sun.security.provider.certpath.*,
-            sun.security.rsa.*,
-            sun.security.util.*,
-            sun.security.validator.*,
-            sun.security.x509.*,
-            sun.security.timestamp.*;
-
-    // this list is based on the classlist generated from the rootset
-    // need investigation
-    exclude sun.security.ec.ECD*,
-            sun.security.ec.ECKeyPairGenerator,
-            sun.security.ec.SunEC*,
-            sun.security.pkcs.PKCS10*,
-            sun.security.pkcs.EncodingException,
-            sun.security.util.AuthResources_*,
-            sun.security.util.Resources_*,
-            sun.security.util.BigInt,
-            sun.security.util.HostnameChecker,
-            sun.security.x509.CertAndKeyGen,
-            sun.security.util.PathList;
-
-    // Kerberos not needed
-    exclude javax.security.auth.kerberos.**,
-            sun.security.jgss.**,
-            sun.security.krb5.**,
-            sun.security.ssl.Kerberos*,
-            org.ietf.jgss.**;
-
-   // property events and annotations
-   include java.beans.ChangeListenerMap,
-           java.beans.IndexedPropertyChangeEvent,
-           java.beans.PropertyChange*,
-           java.beans.PropertyVetoException,
-           java.beans.VetoableChange*,
-           java.beans.ConstructorProperties;
-
-    // mandatory charsets
-    include sun.nio.cs.*;
-
-    exclude sun.nio.cs.AbstractCharsetProvider,
-            sun.nio.cs.CharsetMapping,
-            sun.nio.cs.IBM*,
-            sun.nio.cs.ISO*,
-            sun.nio.cs.KOI8_*,
-            sun.nio.cs.MS125*,
-            sun.nio.cs.UTF_32*,
-            sun.nio.cs.SingleByteDecoder,
-            sun.nio.cs.SingleByteEncoder;
-
-    allow   sun.nio.cs.ISO_8859_1,
-            sun.nio.cs.ISO_8859_15,
-            sun.nio.cs.MS1252;
-
-    include sun.text.*,
-            sun.text.normalizer.*;
-
-    // resource files
-    include sun/text/resources/*.icu;
-
-    exclude sun.text.bidi.*,
-            sun.text.CharArrayCodePointIterator,
-            sun.text.CharSequenceCodePointIterator,
-            sun.text.CharacterIteratorCodePointIterator,
-            sun.text.CodePointIterator;
-
-    include sun.util.*,
-            sun.util.calendar.*,
-            sun.util.logging.*,
-            sun.util.resources.LocaleData,
-            sun.util.resources.LocaleNamesBundle,
-            sun.util.resources.OpenListResourceBundle;
-
-    // US_en locale
-    include sun.text.resources.BreakIteratorInfo,
-            sun.text.resources.FormatData,
-            sun.text.resources.FormatData_en_US,
-            sun.util.resources.CalendarData,
-            sun.util.resources.CalendarData_en,
-            sun.util.resources.TimeZoneNames,
-            sun.util.resources.TimeZoneNames_en,
-            sun.util.resources.TimeZoneNamesBundle,
-            sun.util.resources.LocaleNames,
-            sun.util.resources.LocaleNames_en,
-            sun.util.resources.LocalenamesBundles,
-            sun.util.resources.CurrencyNames,
-            sun.util.resources.CurrencyNames_en_US,
-            sun.util.EmptyListResourceBundle;
-
-    // resources file needed by
-    // - sun.misc.ExtensionInfo
-    // - sun.security.provider.PolicyFile
-    // - com.sun.security.auth.PolicyFile
-    include sun.misc.resources.Messages,
-            sun.security.util.Resources,
-            sun.security.util.AuthResources;
-
-    // java.nio.channels and java.nio.file not in base
-    include sun.nio.ch.Interruptible,
-            sun.nio.ch.DirectBuffer,
-            sun.nio.ByteBuffered;
-
-    include sun.reflect.**;
-
-    // protocol handlers
-    include sun.net.www.protocol.file.*,
-            sun.net.www.protocol.jar.*,
-            sun.net.www.protocol.http.*;
-
-    include sun.net.*,
-            sun.net.spi.*,
-            sun.net.idn.*,
-            sun.net.util.*,
-            sun.net.www.*,
-            sun.net.www.http.*,
-            sun.net.spi.nameservice.*;
-
-    // resource file for sun.net.idn
-    include sun/net/idn/*;
-
-    // classes in net-compat
-    exclude sun.net.Telnet*, sun.net.TransferProtocolClient;
-
-    // classes in deploy
-    exclude sun.net.www.protocol.http.AuthCacheBridge;
-
-    // classes in security-jsse
-    exclude java.net.SecureCacheResponse;
-
-    // launcher
-    include sun.launcher.LauncherHelper, sun.launcher.resources.launcher;
-
-    include sun.misc.*;
-    exclude sun.misc.FIFOQueueEnumerator,
-            sun.misc.LIFOQueueEnumerator,
-            sun.misc.GC,
-            sun.misc.PerformanceLogger,
-            sun.misc.Queue,
-            sun.misc.QueueElement,
-            sun.misc.Ref,
-            sun.misc.VMSupport;
-
-    // On Windows, OSEnvironment dependency
-    include sun.io.Win32ErrorMode;
-}
-
-/**************************************************************************/
-
-module charsets {
-    include sun.nio.cs.ext.**;
-
-    include sun.nio.cs.AbstractCharsetProvider,
-            sun.nio.cs.CharsetMapping,
-            sun.nio.cs.IBM*,
-            sun.nio.cs.ISO*,
-            sun.nio.cs.KOI8_*,
-            sun.nio.cs.MS125*,
-            sun.nio.cs.SingleByte*,
-            sun.nio.cs.UTF_32*;
-
-    exclude sun.nio.cs.ISO_8859_1,
-            sun.nio.cs.MS1252;
-
-    // legacy sun.io converters
-    include sun.io.*;
-}
-
-/**************************************************************************/
-
-// For now, retains the current JRE extensions where localedata.jar in jre/lib/ext 
-module localedata {
-    include sun.util.resources.*_ar,
-            sun.util.resources.*_ar_*,
-            sun.util.resources.*_hi,
-            sun.util.resources.*_hi_*,
-            sun.util.resources.*_iw,
-            sun.util.resources.*_iw_*,
-            sun.util.resources.*_ja,
-            sun.util.resources.*_ja_*,
-            sun.util.resources.*_ko,
-            sun.util.resources.*_ko_*,
-            sun.util.resources.*_th,
-            sun.util.resources.*_th_*,
-            sun.util.resources.*_vi,
-            sun.util.resources.*_vi_*,
-            sun.util.resources.*_zh,
-            sun.util.resources.*_zh_*;
-    include sun.text.resources.*_ar,
-            sun.text.resources.*_ar_*,
-            sun.text.resources.*_hi,
-            sun.text.resources.*_hi_*,
-            sun.text.resources.*_iw,
-            sun.text.resources.*_iw_*,
-            sun.text.resources.*_ja,
-            sun.text.resources.*_ja_*,
-            sun.text.resources.*_ko,
-            sun.text.resources.*_ko_*,
-            sun.text.resources.*_th,
-            sun.text.resources.*_th_*,
-            sun.text.resources.*_vi,
-            sun.text.resources.*_vi_*,
-            sun.text.resources.*_zh,
-            sun.text.resources.*_zh_*;
-}
-
-module resources {
-    include sun.text.resources.*, sun.util.resources.*, sun.misc.resources.*;
-}
-
-/**************************************************************************/
-
-module nio {
-    include java.nio.channels.**, java.nio.file.**, com.sun.nio.file.**;
-
-    // this is excluded from base
-    include java.io.TempFileHelper;
-
-    // provider implementations and their dependencies
-    include sun.nio.ch.*, sun.nio.fs.**;
-    exclude sun.nio.ch.Sctp*;
-}
-
-/**************************************************************************/
-
-module pack200 {
-    include java.util.jar.Pack200*, com.sun.java.util.jar.pack.**;
-}
-
-/**************************************************************************/
-
-module logging {
-    include java.util.logging.*, sun.util.logging.**;
-    exclude java.util.logging.PlatformLoggingMXBean;
-
-    // Formatter for HTTP messages
-    include sun.net.www.protocol.http.logging.*;
-}
-
-/**************************************************************************/
-
-module management-snmp {
-    include com.sun.jmx.snmp.**, sun.management.snmp.**;
-}
-
-module management-iiop {
-    include com.sun.jmx.remote.protocol.iiop.*;
-
-    // stubs and ties
-    include javax.management.remote.rmi._*,
-            org.omg.stub.javax.management.remote.rmi.**;
-}
-
-module management {
-    include java.lang.management.*, com.sun.management.**, sun.management.**;
-    include javax.management.**, com.sun.jmx.**;
-
-    // other management interfaces
-    include java.nio.BufferPoolMXBean;
-    include java.util.logging.PlatformLoggingMXBean;
-
-    // supporting classes in sun.misc
-    include sun.misc.VMSupport;
-}
-
-/**************************************************************************/
-
-module tracing {
-    // tracing
-    include com.sun.tracing.**, sun.tracing.**;
-}
-
-module instrument {
-    // java.lang.instrument
-    include java.lang.instrument.*, sun.instrument.*;
-
-    // HPROF support
-    include com.sun.demo.jvmti.hprof.*;
-
-    include tracing;
-}
-
-/**************************************************************************/
-
-module rmi-activation {
-    include java.rmi.activation.**,
-            sun.rmi.server.Act*,
-            sun.rmi.server.InactiveGroupException;
-}
-
-module rmic {
-    // rmic is included in tools
-    include sun.rmi.rmic.**;
-}
-
-module rmi {
-    include java.rmi.**, sun.rmi.**, com.sun.rmi.**;
-
-    // SSL factories are in rmi
-    include javax.rmi.ssl.**;
-
-    // supporting classes in sun.misc and dependencies
-    include sun.misc.GC;
-}
-
-/**************************************************************************/
-
-module prefs {
-    include java.util.prefs.*;
-}
-
-/**************************************************************************/
-
-module security-jsse {
-    include javax.net.**,
-            javax.security.cert.*,
-            java.net.SecureCacheResponse,
-            com.sun.net.ssl.**,
-            com.sun.security.cert.internal.x509.*,
-            sun.security.ssl.*,
-            sun.net.www.protocol.https.**,
-            sun.security.internal.interfaces.Tls*,
-            sun.security.internal.spec.Tls*,
-            sun.security.util.HostnameChecker;
-}
-
-module security-sunpkcs11 {
-    include sun.security.pkcs11.**;
-}
-
-module security-sunjce {
-    include com.sun.crypto.provider.*;
-}
-
-module security-sunec {
-    include sun.security.ec.*;
-}
-
-module security-sunmscapi {
-    include sun.security.mscapi.*;
-}
-
-module security-kerberos {
-    include javax.security.auth.kerberos.*,
-            com.sun.security.jgss.**,
-            com.sun.security.auth.module.Krb5LoginModule,
-            com.sun.security.sasl.gsskerb.**,             // GSSAPI SASL mechanism
-            sun.security.jgss.**,
-            sun.security.ssl.krb5.**,
-            sun.security.krb5.**,
-            org.ietf.jgss.**,
-            sun.net.www.protocol.http.spnego.*;
-}
-
-module security-sasl {
-    include javax.security.sasl.**,
-            com.sun.security.sasl.**;
-}
-
-module security-xmldsig {
-    include javax.xml.crypto.**,
-            org.jcp.xml.dsig.**,
-            com.sun.org.apache.xml.internal.security.**;
-}
-
-module security-smartcardio {
-    include javax.smartcardio.**, sun.security.smartcardio.**;
-}
-
-module security-auth {
-    include com.sun.security.auth.**, sun.security.util.AuthResources_*;
-}
-
-module security-misc {
-    include security-auth;
-
-    include sun.security.pkcs.*,
-            sun.security.pkcs12.*;
-
-    // this class is a candidate to be removed.
-    include sun.security.util.BigInt;
-}
-
-module security-resources {
-    include sun.security.util.Resources_*;
-}
-
-module security-compat {
-    include java.security.acl.*, sun.security.acl.*;
-}
-
-/**************************************************************************/
-
-module jndi-ldap {
-    include javax.naming.ldap.**,
-            com.sun.jndi.ldap.**,
-            com.sun.jndi.url.ldap.*,
-            com.sun.jndi.url.ldaps.*,
-            sun.security.provider.certpath.ldap.**;
-}
-
-module jndi-rmiregistry {
-    include com.sun.jndi.rmi.**, com.sun.jndi.url.rmi.**;
-}
-
-module jndi-dns {
-    include net-dns;
-    include com.sun.jndi.dns.**, com.sun.jndi.url.dns.**;
-}
-
-module jndi-cosnaming {
-    include com.sun.jndi.cosnaming.**,
-            com.sun.jndi.toolkit.corba.**,
-            com.sun.jndi.url.corbaname.**,
-            com.sun.jndi.url.iiop.**,
-            com.sun.jndi.url.iiopname.**;
-}
-
-// framework/API and classes used by providers
-module jndi {
-    include javax.naming.**,
-            com.sun.naming.**,
-            com.sun.jndi.toolkit.ctx.**,
-            com.sun.jndi.toolkit.dir.**,
-            com.sun.jndi.toolkit.url.**;
-}
-
-/**************************************************************************/
-
-module jdbc-base {
-    include java.sql.**, javax.sql.*;
-    exclude javax.sql.XA*;
-}
-
-module jdbc-enterprise {
-    include javax.sql.**, com.sun.rowset.**;
-}
-
-module jdbc-odbc {
-    include sun.jdbc.odbc.**;
-}
-
-/**************************************************************************/
-
-module scripting {
-    include javax.script.**;
-
-    // supporting classes for scripting engines
-    include com.sun.script.util.**;
-}
-
-module scripting-rhino {
-    include com.sun.script.javascript.**, sun.org.mozilla.javascript.**;
-}
-
-/**************************************************************************/
-
-module httpserver {
-    include com.sun.net.httpserver.**, sun.net.httpserver.**;
-}
-
-/**************************************************************************/
-
-module sctp {
-    // API and dependencies
-    include com.sun.nio.sctp.**, sun.nio.ch.Sctp*;
-}
-
-/**************************************************************************/
-
-module langtools {
-    include javax.tools.**, javax.lang.model.**, javax.annotation.processing.**;
-
-    // include mirror API for now
-    include com.sun.mirror.**;
-
-    // include the JSR292 APIs for now
-    include java.dyn.**, sun.dyn.**;
-}
-
-/**************************************************************************/
-
-module beans {
-    include java.beans.**, com.sun.beans.**, sun.beans.**;
-}
-
-/**************************************************************************/
-
-module jaxp-parsers-api {
-    include javax.xml.*, javax.xml.parsers.**,
-            org.w3c.dom.**, org.w3c.sax.**, org.xml.sax.**;
-}
-
-module jaxp-api {
-    include javax.xml.**;
-    exclude javax.xml.crypto.**,   // XML-DSIG
-            javax.xml.bind.**,     // JAX-WS
-            javax.xml.soap.**,
-            javax.xml.ws.**;
-}
-
-module jaxp-xerces-impl {
-    include com.sun.org.apache.xerces.internal.**;
-
-    // include in xerces-impl due to circular dependencies
-    include com.sun.org.apache.xml.internal.serialize.**,
-            com.sun.xml.internal.stream.**;
-    exclude com.sun.xml.internal.stream.buffer.**;  // JAX-WS
-}
-
-// required by Xerces and JAX-WS
-module jaxp-xerces-resolver {
-    include com.sun.org.apache.xml.internal.resolver.**;
-}
-
-module jaxp-xalan {
-    include com.sun.org.apache.xalan.internal.**,
-            com.sun.org.apache.xpath.internal.**,
-            com.sun.org.apache.xml.internal.dtm.**,
-            com.sun.org.apache.xml.internal.res.**,
-            com.sun.org.apache.xml.internal.serializer.**,
-            com.sun.org.apache.xml.internal.utils.**,
-            com.sun.org.apache.bcel.internal.**,
-            com.sun.org.apache.regexp.internal.**,
-            com.sun.java_cup.internal.**;
-}
-
-/**************************************************************************/
-
-module jaxws-tools {
-    include com.sun.codemodel.**,
-            com.sun.xml.internal.dtdparser.**,
-            com.sun.xml.internal.rngom.**,
-            com.sun.xml.internal.xsom.**,
-            com.sun.istack.internal.tools.**,
-            com.sun.istack.internal.ws.**,
-            com.sun.tools.internal.xjc.**,
-            com.sun.tools.internal.ws.**,
-            com.sun.tools.internal.jxc.**,
-            org.relaxng.datatype.**;
-}
-
-module jaxws {
-    include javax.jws.**,
-            javax.xml.bind.**,
-            javax.xml.soap.**,
-            javax.xml.ws.**,
-            org.relaxng.**,
-            com.sun.istack.internal.*,
-            com.sun.istack.internal.localization.*,
-            com.sun.xml.internal.**;
-
-    // include JAF in this module
-    include javax.activation.**, com.sun.activation.**;
-
-    include META-INF/mailcap.default,
-            META-INF/mimetypes.default;
-}
-
-/**************************************************************************/
-module enterprise-base {
-    include javax.transaction.**,  // JTA
-            javax.annotation.*;    // Common annotations (JSR-250)
-}
-
-/**************************************************************************/
-module corba {
-    include javax.activity.**,
-            javax.rmi.*,
-            javax.rmi.CORBA.*,
-            javax.transaction.**,
-            com.sun.corba.**,
-            com.sun.org.omg.**,
-            org.omg.**,
-            sun.corba.**;
-
-    // JMX remote API
-    exclude org.omg.stub.javax.management.**;
-}
-
-/**************************************************************************/
-
-module applet {
-    include java.applet.**,
-            sun.applet.**;
-}
-
-module awt {
-    include java.awt.**,
-            sun.awt.**,
-            com.sun.awt.**;
-}
-
-module font {
-    include sun.font.**;
-}
-
-module imageio {
-    include javax.imageio.**,
-            com.sun.imageio.**;
-}
-
-module java2d {
-    include sun.dc.**,
-            sun.java2d.**,
-            com.sun.image.**;
-}
-
-module media {
-    include com.sun.media.**;
-}
-
-module print {
-    include javax.print.**,
-            sun.print.**;
-}
-
-module sound {
-    include javax.sound.**;
-}
-
-module swing {
-    include javax.swing.**,
-            sun.swing.**,
-            // sajdi also contains classes in subpackages of com.sun.java.swing;
-            // so use '*' instead of '**' 
-            com.sun.java.swing.*,
-            com.sun.java.swing.plaf.**,
-            com.sun.swing.**;
-}
-
-module client {
-    include applet,
-            awt,
-            font,
-            imageio,
-            java2d,
-            media,
-            print,
-            sound,
-            swing;
-
-    include javax.accessibility.*,
-            sun.audio.**,
-            com.sun.accessibility.**;
-
-    // Bidi class in client module for now
-    include java.text.Bidi, sun.text.bidi.*;
-
-    // PerformanceLogger and dependencies
-    include sun.misc.Ref, sun.misc.PerformanceLogger;
-
-    // misc. dependencies that we need to examine
-    include sun.text.CodePointIterator,
-            sun.text.Char*,
-            sun.misc.Queue*,
-            sun.misc.FIFOQueueEnumerator,
-            sun.misc.LIFOQueueEnumerator;
-
-    // content handlers
-    include sun.net.www.content.audio.**,
-            sun.net.www.content.image.**;
-}
-
-/**************************************************************************/
-
-module deploy {
-
-    // For now, all plugin and JNLP
-    include com.sun.java.browser.**,
-            netscape.**,
-            sun.plugin.**,
-            sun.plugin2.**,,
-            com.sun.deploy.**,
-            com.sun.javaws.**,
-            javax.jnlp.*,
-            com.sun.jnlp.*;
-
-    // Hook for http authentication
-    include sun.net.www.protocol.http.AuthCacheBridge;
-}
-
-/**************************************************************************/
-
-module net-dns {
-    include sun.net.dns.**;                 // to access DNS config.
-    include sun.net.spi.nameservice.dns.**; // for DNS-only name service.
-}
-
-module net-compat {
-    // NTLM authentication support
-    include sun.net.www.protocol.http.ntlm.*;
-
-    // ftp and mail clients
-    include sun.net.ftp.**, sun.net.smtp.**;
-
-    // Legacy protocol handlers
-    include sun.net.www.protocol.**;
-
-    // Legacy content handlers
-    include sun.net.www.content.**;
-
-    include sun.net.Telnet*,
-            sun.net.TransferProtocolClient;
-}
-
-/**************************************************************************/
-
-// jar-tool and security-tools are JRE tools
-module jar-tool {
-    include sun.tools.jar.**;
-}
-
-module policytool {
-    include sun.security.tools.policytool.*;
-}
-
-module security-tools {
-    include sun.security.tools.**;
-
-    // Used by security tools
-    include sun.security.util.PathList, sun.security.x509.CertAndKeyGen;
-
-    exclude sun.security.tools.JarBASE64Encoder,
-            sun.security.tools.JarSigner,
-            sun.security.tools.JarSignerParameters,
-            sun.security.tools.JarSignerResources*,
-            sun.security.tools.SignatureFile,
-            sun.security.tools.TimestampedSigner;
-}
-
-module jconsole {
-    include sun.tools.jconsole.**,
-            com.sun.tools.jconsole.*;
-}
-
-module serialver {
-    include sun.tools.serialver.**;
-}
-
-module gui-tools {
-    include jconsole,
-            serialver;
-
-    include com.sun.tools.example.debug.bdi.**,
-            com.sun.tools.example.debug.gui.**,
-            com.sun.tools.internal.xjc.**;
-}
-
-module attach {
-    include com.sun.tools.attach.**,
-            sun.tools.attach.**;
-}
-
-module debugging {
-    include com.sun.jdi.**, com.sun.tools.jdi.**;
-}
-
-module jdb {
-    include com.sun.tools.example.debug.**;
-}
-
-module sajdi {
-    include sun.jvm.hotspot.**,
-            com.sun.java.swing.ui.**,
-            com.sun.java.swing.action.**;
-
-    include toolbarButtonGraphics/**;
-    include sa.properties;
-}
-
-module tools {
-    include attach,
-            debugging,
-            jaxws-tools,
-            jdb,
-            rmic,
-            sajdi;
-
-    // include gui-tools in tools module unless the tool binaries
-    // are modified to load the new gui-tools.jar
-    include gui-tools;
-
-    include com.sun.tools.**, sun.tools.**, sun.security.tools.**,
-            com.sun.jarsigner.**,
-            com.sun.javac.**,
-            com.sun.javadoc.**, com.sun.source.**,
-            sun.jvmstat.**;
-}
-
-/**************************************************************************/
-
-module servicetag {
-    include com.sun.servicetag.**;
-}
-
-/**************************************************************************/
-
-// these classes will be removed from JRE - see 6909002
-module inputmethods-ext {
-    include com.sun.inputmethods.internal.**;
-}
-
-/**************************************************************************/
-
-// Workaround for US export and local policy files 
-// They are currently in signed jars under the jre/lib/security directory
-module US_export_policy {
-    include default_US_export.policy;
-}
-
-module local_policy {
-    include default_local.policy,
-            exempt_local.policy;
-}
-
-/**************************************************************************/
-
-module other {
-    include **;
-}
--- a/jdk/make/modules/modules.group	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Example:
- *    module jdbc {
- *        include jdbc-base, jdbc-enterprise, jdbc-odbc;
- *    }
- */
--- a/jdk/make/modules/optional.depconfig	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please 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 final java.nio.channels.SocketChannel getChannel()
-@Optional
-  sun.security.ssl.BaseSSLSocketImpl -> java.nio.channels.SocketChannel
-
-# public XMLDecoder(java.io.InputStream)
-# public XMLDecoder(java.io.InputStream, java.lang.Object)
-# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener)
-# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader)
-# public XMLDecoder(org.xml.sax.InputSource)
-@Optional
-  java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler
-  java.beans.XMLDecoder -> org.xml.sax.InputSource
-
-# public static org.xml.sax.helpers.DefaultHandler createHandler(java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader)
-@Optional
-  java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler
-  java.beans.XMLDecoder -> org.xml.sax.helpers.DefaultHandler
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
-  java.net.SocketInputStream -> java.nio.channels.FileChannel
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
-  java.net.SocketOutputStream -> java.nio.channels.FileChannel
-
-# public Scanner(java.io.File)
-# public Scanner(java.io.File, java.lang.String)
-@Optional
-  java.util.Scanner -> java.nio.channels.ReadableByteChannel
-  java.util.Scanner -> java.nio.channels.Channels
-
-# public Scanner(java.nio.file.FileRef)
-# public Scanner(java.nio.file.FileRef, java.lang.String)
-@Optional
-  java.util.Scanner -> java.nio.file.FileRef
-  java.util.Scanner -> java.nio.file.OpenOption
-
-# public Scanner(java.nio.channels.ReadableByteChannel)
-# public Scanner(java.nio.channels.ReadableByteChannel, java.lang.String)
-@Optional
-  java.util.Scanner -> java.nio.channels.ReadableByteChannel
-  java.util.Scanner -> java.nio.channels.Channels
-
-# private static void loadSnmpAgent(java.lang.String, java.util.Properties)
-@Optional
-  sun.management.Agent -> sun.management.snmp.AdaptorBootstrap
-
-# public void connect()
-@Optional
-  sun.net.www.protocol.http.HttpURLConnection -> java.net.SecureCacheResponse
-
-# private static sun.security.util.PermissionFactory<?> permissionFactory()
-@Optional
-  sun.security.util.SecurityConstants$AWT -> sun.awt.AWTPermissionFactory
-
-# sun.util.logging.LoggingSupport
-@Optional
-  sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl
-
-# public java.nio.channels.DatagramChannel getChannel()
-@Optional
-  java.net.DatagramSocket -> java.nio.channels.DatagramChannel
-
-# public java.nio.channels.SocketChannel getChannel()
-@Optional
-  java.net.Socket -> java.nio.channels.SocketChannel
-
-# public java.nio.channels.ServerSocketChannel getChannel()
-@Optional
-  java.net.ServerSocket -> java.nio.channels.ServerSocketChannel
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
-  java.io.RandomAccessFile -> java.nio.channels.FileChannel
-  java.io.RandomAccessFile -> sun.nio.ch.FileChannelImpl
-
-# public static sun.nio.cs.StreamDecoder forDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int)
-@Optional
-  sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel
-
-# private static java.nio.channels.FileChannel getChannel(java.io.FileInputStream)
-# StreamDecoder(java.io.InputStream, java.lang.Object, java.nio.charset.CharsetDecoder)
-@Optional
-  sun.nio.cs.StreamDecoder -> java.nio.channels.FileChannel
-
-# StreamDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int)
-@Optional
-  sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel
-
-# public static java.io.File createTemporaryFile(java.lang.String, java.lang.String, java.nio.file.attribute.FileAttribute<?>[])
-@Optional
-  java.io.File -> java.io.TempFileHelper
-  java.io.File -> java.nio.file.attribute.FileAttribute
-
-# public java.nio.file.Path toPath()
-@Optional
-  java.io.File -> java.nio.file.Paths
-  java.io.File -> java.nio.file.Path
-
-# public static sun.nio.cs.StreamEncoder forEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int)
-# private StreamEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int)
-@Optional
-  sun.nio.cs.StreamEncoder -> java.nio.channels.WritableByteChannel
-
-# public java.nio.channels.FileChannel getChannel()
-@Optional
-  java.io.FileOutputStream -> java.nio.channels.FileChannel
-  java.io.FileOutputStream -> sun.nio.ch.FileChannelImpl
-
-# public java.nio.channels.FileChannel getChannel()
-@Optional
-  java.io.FileInputStream -> java.nio.channels.FileChannel
-  java.io.FileInputStream -> sun.nio.ch.FileChannelImpl
-
-# public void loadFromXML(java.io.InputStream)
-# public void storeToXML(java.io.OutputStream, java.lang.String, java.lang.String)
-@Optional
-  java.util.Properties -> java.util.XMLUtils
-
-# public static java.nio.channels.Channel inheritedChannel()
-@Optional
-  java.lang.System -> java.nio.channels.Channel
-  java.lang.System -> java.nio.channels.spi.SelectorProvider
--- a/jdk/make/modules/tools/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building the classanalyzer tool
-#
-
-BUILDDIR = ../..
-include $(BUILDDIR)/common/Defs.gmk
-
-PKGDIR = com/sun/classanalyzer
-BUILDTOOL_SOURCE_ROOT = src
-BUILDTOOL_MAIN        = $(PKGDIR)/ClassAnalyzer.java
-BUILTTOOL_MAINCLASS   = $(subst /,.,$(BUILDTOOL_MAIN:%.java=%))
-
-BUILDTOOL_MAIN_SOURCE_FILE = $(BUILDTOOL_SOURCE_ROOT)/$(BUILDTOOL_MAIN)
-BUILDTOOL_MANIFEST_FILE    = $(BUILDTOOLCLASSDIR)/classanalyzer_manifest.mf
-
-FILES_java := $(shell $(CD) $(BUILDTOOL_SOURCE_ROOT) \
-    && $(FIND) $(PKGDIR) -type f -print)
-
-FILES_class = $(FILES_java:%.java=$(BUILDTOOLCLASSDIR)/%.class)
-
-CLASSANALYZER_JAR_FILE     = $(BUILDTOOLJARDIR)/classanalyzer.jar
-
-#
-# ClassAnalyzer depends on the com.sun.tools.classfile API.
-# The tool is compiled with the latest version of the classfile 
-# library in the langtools repo to make sure that synchronized
-# change is made if the classfile API is changed. 
-#
-# If langtools repo exists, build its own copy of the
-# classfile library and use it for compile time and runtime.
-# If not exist (the top level repo is not a forest), use 
-# the built jdk tools that imports tools.jar from the latest
-# promoted build.
-#
-# If the classfile API is changed but not yet in a promoted build,
-# the build might fail and the tool would need the langtools repo
-# to build in that case.
-#
-ifndef LANGTOOLS_TOPDIR
-  LANGTOOLS_TOPDIR=$(JDK_TOPDIR)/../langtools
-endif
-
-LANGTOOLS_TOPDIR_EXISTS := $(shell \
-  if [ -d $(LANGTOOLS_TOPDIR) ] ; then \
-    echo true; \
-  else \
-    echo false; \
-  fi)
-
-CLASSFILE_SRC = $(LANGTOOLS_TOPDIR)/src/share/classes
-CLASSFILE_PKGDIR = com/sun/tools/classfile
-
-ifeq ($(LANGTOOLS_TOPDIR_EXISTS), true)
-  FILES_classfile_java := $(shell \
-       $(CD) $(CLASSFILE_SRC) && \
-           $(FIND) $(CLASSFILE_PKGDIR) -name '*.java' -print)
-  FILES_classfile_class = $(FILES_classfile_java:%.java=$(BUILDTOOLCLASSDIR)/%.class)
-  CLASSFILE_JAR_FILE = $(BUILDTOOLJARDIR)/classfile.jar
-  BUILDTOOL_JAVAC    = $(BOOT_JAVAC_CMD) $(JAVAC_JVM_FLAGS) \
-                          $(BOOT_JAVACFLAGS) -classpath $(CLASSFILE_JAR_FILE)
-  BUILDTOOL_JAVA     = $(BOOT_JAVA_CMD) $(JAVA_TOOLS_FLAGS) \
-                          -Xbootclasspath/p:$(CLASSFILE_JAR_FILE)
-else
-  # if langtools doesn't exist, use tools from the built jdk
-  BUILDTOOL_JAVAC = $(BINDIR)/javac $(JAVAC_JVM_FLAGS) \
-                       $(BOOT_JAVACFLAGS)
-  BUILDTOOL_JAVA  = $(BINDIR)/java $(JAVA_TOOLS_FLAGS)
-endif
-
-# Location of the output modules.list, <module>.classlist
-# and other output files generated by the class analyzer tool.
-#
-MODULE_CLASSLIST = $(MODULES_TEMPDIR)/classlist
-
-all build: classanalyzer gen-classlist
-
-classanalyzer: $(CLASSFILE_JAR_FILE) $(CLASSANALYZER_JAR_FILE) 
-
-gen-classlist:
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-	@$(RM) -rf $(MODULE_CLASSLIST)
-	@$(MKDIR) -p $(MODULE_CLASSLIST)
-	$(BUILDTOOL_JAVA) \
-                -Dclassanalyzer.debug \
-                -jar $(CLASSANALYZER_JAR_FILE) \
-                -jdkhome $(OUTPUTDIR) \
-                -config ../modules.config \
-                -config ../modules.group \
-                -depconfig ../jdk7.depconfig \
-                -depconfig ../optional.depconfig \
-                -showdynamic \
-                -output $(MODULE_CLASSLIST)
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-$(BUILDTOOL_MANIFEST_FILE): $(BUILDTOOL_MAIN_SOURCE_FILE)
-	@$(prep-target)
-	$(ECHO) "Main-Class: $(BUILTTOOL_MAINCLASS)" > $@
-
-$(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR)/%.class : $(CLASSFILE_SRC)/$(CLASSFILE_PKGDIR)/%.java
-	@$(prep-target)
-	@$(BUILDTOOL_JAVAC) \
-            -sourcepath $(CLASSFILE_SRC) \
-            -d $(BUILDTOOLCLASSDIR) $<
-
-$(BUILDTOOLCLASSDIR)/%.class : $(BUILDTOOL_SOURCE_ROOT)/%.java
-	@$(prep-target)
-	$(BUILDTOOL_JAVAC) \
-            -sourcepath $(BUILDTOOL_SOURCE_ROOT) \
-            -d $(BUILDTOOLCLASSDIR) $<
-
-$(CLASSANALYZER_JAR_FILE): $(BUILDTOOL_MANIFEST_FILE) $(FILES_class)
-	@$(prep-target)
-	$(BOOT_JAR_CMD) cfm $@ $(BUILDTOOL_MANIFEST_FILE) \
-	    -C $(BUILDTOOLCLASSDIR) $(PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@
-	@$(java-vm-cleanup)
-
-$(BUILDTOOLJARDIR)/classfile.jar: $(FILES_classfile_class)
-	@$(prep-target)
-	$(CD) $(BUILDTOOLCLASSDIR) && \
-	    $(BOOT_JAR_CMD) cf $@ \
-	        $(CLASSFILE_PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@
-	@$(java-vm-cleanup)
-
-clean clobber::
-	@$(RM) -rf $(BUILDTOOLCLASSDIR)/$(PKGDIR)
-	@$(RM) -rf $(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR)
-	@$(RM) $(BUILDTOOL_MANIFEST_FILE)
-	@$(RM) $(CLASSANALYZER_JAR_FILE)
-	@$(RM) $(CLASSFILE_JAR_FILE)
--- a/jdk/make/modules/tools/build.xml	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-  This code is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License version 2 only, as
-  published by the Free Software Foundation.  Oracle designates this
-  particular file as subject to the "Classpath" exception as provided
-  by Oracle in the LICENSE file that accompanied this code.
-
-  This code is distributed in the hope that it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-  version 2 for more details (a copy is included in the LICENSE file that
-  accompanied this code).
-
-  You should have received a copy of the GNU General Public License version
-  2 along with this work; if not, write to the Free Software Foundation,
-  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-  or visit www.oracle.com if you need additional information or have any
-  questions.
--->
-
-<project name="classanalyzer" default="build" basedir=".">
-</project>
--- a/jdk/make/modules/tools/nbproject/project.properties	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-application.title=classanalyzer
-application.vendor=mchung
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-
-cp.extra=${tools.jar} 
-
-debug.classpath=\
-    ${run.classpath}
-debug.test.classpath=\
-    ${run.test.classpath}
-
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/classanalyzer.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-
-excludes=
-
-file.reference.tools.jar=${jdk.home}/lib/tools.jar
-file.reference.tools-src=src
-includes=**
-jar.compress=false
-javac.classpath=\
-    ${file.reference.tools.jar}
-javac.deprecation=false
-javac.source=1.5
-javac.target=1.5
-javac.test.classpath=
-javadoc.author=false
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=false
-javadoc.use=false
-javadoc.version=false
-main.class=com.sun.classanalyzer.ClassAnalyzer
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-platform.active=JDK_1.6
-run.classpath=\
-    ${javac.classpath}:\
-    ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=-Xmx256m
-run.test.classpath=
-source.encoding=UTF-8
-src.dir=${file.reference.tools-src}
--- a/jdk/make/modules/tools/nbproject/project.xml	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- 
-  This code is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License version 2 only, as
-  published by the Free Software Foundation.  Oracle designates this
-  particular file as subject to the "Classpath" exception as provided
-  by Oracle in the LICENSE file that accompanied this code.
- 
-  This code is distributed in the hope that it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-  version 2 for more details (a copy is included in the LICENSE file that
-  accompanied this code).
- 
-  You should have received a copy of the GNU General Public License version
-  2 along with this work; if not, write to the Free Software Foundation,
-  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- 
-  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-  or visit www.oracle.com if you need additional information or have any
-  questions.
--->
-
-<project xmlns="http://www.netbeans.org/ns/project/1">
-    <type>org.netbeans.modules.java.j2seproject</type>
-    <configuration>
-        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
-            <name>classanalyzer</name>
-            <explicit-platform explicit-source-supported="true"/>
-            <source-roots>
-                <root id="src.dir"/>
-            </source-roots>
-            <test-roots/>
-        </data>
-    </configuration>
-</project>
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,627 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.Map;
-
-import com.sun.classanalyzer.Module.Reference;
-import java.util.LinkedList;
-import java.util.TreeMap;
-
-/**
- *
- * @author Mandy Chung
- */
-public abstract class AnnotatedDependency implements Comparable<AnnotatedDependency> {
-
-    final Klass from;
-    final List<String> classes;
-    protected boolean optional;
-    String description;
-    Klass.Method method;
-    private List<Filter> filters = null;
-
-    public AnnotatedDependency(Klass klass) {
-        this(klass, false);
-    }
-
-    public AnnotatedDependency(Klass klass, boolean optional) {
-        this.from = klass;
-        this.classes = new ArrayList<String>();
-        this.optional = optional;
-    }
-
-    abstract String getTag();
-
-    abstract boolean isDynamic();
-
-    void setMethod(Klass.Method m) {
-        this.method = m;
-    }
-
-    void addElement(String element, List<String> value) {
-        if (element.equals("value")) {
-            addValue(value);
-        } else if (element.equals("description")) {
-            description = value.get(0);
-        } else if (element.equals("optional")) {
-            optional = value.get(0).equals("1") || Boolean.parseBoolean(value.get(0));
-        }
-    }
-
-    void addValue(List<String> value) {
-        for (String s : value) {
-            if ((s = s.trim()).length() > 0) {
-                classes.add(s);
-            }
-        }
-    }
-
-    List<String> getValue() {
-        return classes;
-    }
-
-    boolean isOptional() {
-        return optional;
-    }
-
-    boolean isEmpty() {
-        return classes.isEmpty();
-    }
-
-    boolean matches(String classname) {
-        synchronized (this) {
-            // initialize filters
-            if (filters == null) {
-                filters = new ArrayList<Filter>();
-                for (String pattern : classes) {
-                    filters.add(new Filter(pattern));
-                }
-
-            }
-        }
-
-        for (Filter f : filters) {
-            if (f.matches(classname)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        for (String v : getValue()) {
-            if (sb.length() == 0) {
-                sb.append(getTag());
-                sb.append("\n");
-            } else {
-                sb.append("\n");
-            }
-            sb.append("  ");
-            sb.append(from.getClassName()).append(" -> ");
-            sb.append(v);
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public int compareTo(AnnotatedDependency o) {
-        if (from == o.from) {
-            if (this.getClass().getName().equals(o.getClass().getName())) {
-                String s1 = classes.isEmpty() ? "" : classes.get(0);
-                String s2 = o.classes.isEmpty() ? "" : o.classes.get(0);
-                return s1.compareTo(s2);
-            } else {
-                return this.getClass().getName().compareTo(o.getClass().getName());
-            }
-
-        } else {
-            return from.compareTo(o.from);
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        int hashcode = 7 + 73 * from.hashCode();
-        for (String s : classes) {
-            hashcode ^= s.hashCode();
-        }
-        return hashcode;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof AnnotatedDependency)) {
-            return false;
-        }
-        AnnotatedDependency other = (AnnotatedDependency) obj;
-        boolean ret = this.from.equals(other.from) && this.classes.size() == other.classes.size();
-        if (ret == true) {
-            for (int i = 0; i < this.classes.size(); i++) {
-                ret = ret && this.classes.get(i).equals(other.classes.get(i));
-            }
-        }
-        return ret;
-    }
-
-    static class ClassForName extends AnnotatedDependency {
-
-        public ClassForName(Klass klass, boolean optional) {
-            super(klass, optional);
-        }
-
-        @Override
-        String getTag() {
-            if (this.optional) {
-                return TAG + "(optional)";
-            } else {
-                return TAG;
-            }
-        }
-
-        @Override
-        boolean isDynamic() {
-            return true;
-        }
-        static final String TYPE = "sun.annotation.ClassForName";
-        static final String TAG = "@ClassForName";
-    }
-
-    static class NativeFindClass extends AnnotatedDependency {
-
-        public NativeFindClass(Klass klass, boolean optional) {
-            super(klass, optional);
-        }
-
-        @Override
-        String getTag() {
-            if (this.optional) {
-                return TAG + "(optional)";
-            } else {
-                return TAG;
-            }
-        }
-
-        @Override
-        boolean isDynamic() {
-            return true;
-        }
-        static final String TYPE = "sun.annotation.NativeFindClass";
-        static final String TAG = "@NativeFindClass";
-    }
-
-    static class Provider extends AnnotatedDependency {
-
-        private List<String> services = new ArrayList<String>();
-
-        Provider(Klass klass) {
-            super(klass, true);
-        }
-
-        @Override
-        boolean isDynamic() {
-            return true;
-        }
-
-        public List<String> services() {
-            return services;
-        }
-
-        @Override
-        void addElement(String element, List<String> value) {
-            if (element.equals("service")) {
-                List<String> configFiles = new ArrayList<String>();
-                for (String s : value) {
-                    if ((s = s.trim()).length() > 0) {
-                        configFiles.add(metaInfPath + s);
-                    }
-                }
-                addValue(configFiles);
-            }
-        }
-
-        @Override
-        void addValue(List<String> value) {
-            for (String s : value) {
-                if ((s = s.trim()).length() > 0) {
-                    if (s.startsWith("META-INF")) {
-                        services.add(s);
-                        readServiceConfiguration(s, classes);
-                    } else {
-                        throw new RuntimeException("invalid value" + s);
-                    }
-                }
-            }
-        }
-
-        boolean isEmpty() {
-            return services.isEmpty();
-        }
-        static final String metaInfPath =
-                "META-INF" + File.separator + "services" + File.separator;
-
-        static void readServiceConfiguration(String config, List<String> names) {
-            BufferedReader br = null;
-            try {
-                InputStream is = ClassPath.open(config);
-                if (is != null) {
-                    // Properties doesn't perserve the order of the input file
-                    br = new BufferedReader(new InputStreamReader(is, "utf-8"));
-                    int lc = 1;
-                    while ((lc = parseLine(br, lc, names)) >= 0);
-                }
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            } finally {
-                if (br != null) {
-                    try {
-                        br.close();
-                    } catch (IOException ex) {
-                        throw new RuntimeException(ex);
-                    }
-                }
-            }
-        }
-
-        // Parse a single line from the given configuration file, adding the name
-        // on the line to the names list.
-        //
-        private static int parseLine(BufferedReader r, int lc, List<String> names) throws IOException {
-            String ln = r.readLine();
-            if (ln == null) {
-                return -1;
-            }
-            int ci = ln.indexOf('#');
-            if (ci >= 0) {
-                ln = ln.substring(0, ci);
-            }
-            ln = ln.trim();
-            int n = ln.length();
-            if (n != 0) {
-                if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) {
-                    throw new RuntimeException("Illegal configuration-file syntax");
-                }
-                int cp = ln.codePointAt(0);
-                if (!Character.isJavaIdentifierStart(cp)) {
-                    throw new RuntimeException("Illegal provider-class name: " + ln);
-                }
-                for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
-                    cp = ln.codePointAt(i);
-                    if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) {
-                        throw new RuntimeException("Illegal provider-class name: " + ln);
-                    }
-                }
-                if (!names.contains(ln)) {
-                    names.add(ln);
-                }
-            }
-            return lc + 1;
-        }
-
-        @Override
-        String getTag() {
-            return TAG;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof AnnotatedDependency)) {
-                return false;
-            }
-            Provider other = (Provider) obj;
-            boolean ret = this.from.equals(other.from) &&
-                    this.services.size() == other.services.size();
-            if (ret == true) {
-                for (int i = 0; i < this.services.size(); i++) {
-                    ret = ret && this.services.get(i).equals(other.services.get(i));
-                }
-            }
-            return ret;
-        }
-
-        @Override
-        public int hashCode() {
-            int hashcode = 7 + 73 * from.hashCode();
-            for (String s : services) {
-                hashcode ^= s.hashCode();
-            }
-            return hashcode;
-        }
-
-        @Override
-        public List<String> getValue() {
-            List<String> result = new ArrayList<String>();
-            result.addAll(services);
-            return result;
-        }
-        static final String TYPE = "sun.annotation.Provider";
-        static final String TAG = "@Provider";
-    }
-
-    static class OptionalDependency extends AnnotatedDependency {
-
-        static boolean isOptional(Klass from, Klass to) {
-            synchronized (OptionalDependency.class) {
-                if (optionalDepsMap == null) {
-                    // Build a map of classes to its optional dependencies
-                    initDependencies();
-                }
-            }
-            for (Reference ref : optionalDepsMap.keySet()) {
-                if (ref.referrer() == from && ref.referree() == to) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        OptionalDependency(Klass klass) {
-            super(klass, true);
-        }
-
-        @Override
-        boolean isDynamic() {
-            return false;
-        }
-
-        @Override
-        String getTag() {
-            return TAG;
-        }
-        static final String TYPE = "sun.annotation.Optional";
-        static final String TAG = "@Optional";
-    }
-
-    static class CompilerInline extends AnnotatedDependency {
-
-        public CompilerInline(Klass klass) {
-            super(klass);
-        }
-
-        @Override
-        String getTag() {
-            return TAG;
-        }
-
-        @Override
-        boolean isDynamic() {
-            return false;
-        }
-        static final String TYPE = "sun.annotation.Inline";
-        static final String TAG = "@Inline";
-    }
-
-    static class Filter {
-
-        final String pattern;
-        final String regex;
-
-        Filter(String pattern) {
-            this.pattern = pattern;
-
-            boolean isRegex = false;
-            for (int i = 0; i < pattern.length(); i++) {
-                char p = pattern.charAt(i);
-                if (p == '*' || p == '[' || p == ']') {
-                    isRegex = true;
-                    break;
-                }
-            }
-
-            if (isRegex) {
-                this.regex = convertToRegex(pattern);
-            } else {
-                this.regex = null;
-            }
-        }
-
-        private String convertToRegex(String pattern) {
-            StringBuilder sb = new StringBuilder();
-            int i = 0;
-            int index = 0;
-            int plen = pattern.length();
-            while (i < plen) {
-                char p = pattern.charAt(i);
-                if (p == '*') {
-                    sb.append("(").append(pattern.substring(index, i)).append(")");
-                    if (i + 1 < plen && pattern.charAt(i + 1) == '*') {
-                        sb.append(".*");
-                        index = i + 2;
-                    } else {
-                        sb.append("[^\\.]*");
-                        index = i + 1;
-                    }
-                } else if (p == '[') {
-                    int j = i + 1;
-                    while (j < plen) {
-                        if (pattern.charAt(j) == ']') {
-                            break;
-                        }
-                        j++;
-                    }
-                    if (j >= plen || pattern.charAt(j) != ']') {
-                        throw new RuntimeException("Malformed pattern " + pattern);
-                    }
-                    sb.append("(").append(pattern.substring(index, i)).append(")");
-                    sb.append(pattern.substring(i, j + 1));
-                    index = j + 1;
-                    i = j;
-                }
-                i++;
-            }
-            if (index < plen) {
-                sb.append("(").append(pattern.substring(index, plen)).append(")");
-            }
-            return sb.toString();
-        }
-
-        boolean matches(String name) {
-            if (regex == null) {
-                // the pattern is not a regex
-                return name.equals(pattern);
-            } else {
-                return name.matches(regex);
-            }
-        }
-    }
-
-    static boolean isValidType(String type) {
-        if (type.endsWith("(optional)")) {
-            int len = type.length() - "(optional)".length();
-            type = type.substring(0, len);
-        }
-        return type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG) ||
-                type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG) ||
-                type.equals(Provider.TYPE) || type.equals(Provider.TAG) ||
-                type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG) ||
-                type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG);
-    }
-
-    static AnnotatedDependency newAnnotatedDependency(String tag, String value, Klass klass) {
-        AnnotatedDependency dep = newAnnotatedDependency(tag, klass);
-        if (dep != null) {
-            dep.addValue(Collections.singletonList(value));
-        }
-        return dep;
-    }
-    static List<AnnotatedDependency> annotatedDependencies = new LinkedList<AnnotatedDependency>();
-    static List<AnnotatedDependency> optionalDependencies = new LinkedList<AnnotatedDependency>();
-
-    static AnnotatedDependency newAnnotatedDependency(String type, Klass klass) {
-        boolean optional = false;
-        if (type.endsWith("(optional)")) {
-            optional = true;
-            int len = type.length() - "(optional)".length();
-            type = type.substring(0, len);
-        }
-
-        if (type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG)) {
-            return newOptionalDependency(klass);
-        }
-
-        AnnotatedDependency dep;
-        if (type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG)) {
-            dep = new ClassForName(klass, optional);
-        } else if (type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG)) {
-            dep = new NativeFindClass(klass, optional);
-        } else if (type.equals(Provider.TYPE) || type.equals(Provider.TAG)) {
-            dep = new Provider(klass);
-        } else if (type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG)) {
-            dep = new CompilerInline(klass);
-        } else {
-            return null;
-        }
-        klass.addAnnotatedDep(dep);
-        annotatedDependencies.add(dep);
-        return dep;
-    }
-
-    static OptionalDependency newOptionalDependency(Klass klass) {
-        OptionalDependency dep = new OptionalDependency(klass);
-        optionalDependencies.add(dep);
-        return dep;
-    }
-    static Map<Reference, Set<AnnotatedDependency>> annotatedDepsMap = null;
-    static Map<Reference, Set<AnnotatedDependency>> optionalDepsMap = null;
-
-    static Map<Reference, Set<AnnotatedDependency>> getReferences(Module m) {
-        // ensure it's initialized
-        initDependencies();
-
-        Map<Reference, Set<AnnotatedDependency>> result = new TreeMap<Reference, Set<AnnotatedDependency>>();
-        for (Reference ref : annotatedDepsMap.keySet()) {
-            if (m.contains(ref.referrer()) && m.isModuleDependence(ref.referree())) {
-                result.put(ref, annotatedDepsMap.get(ref));
-            }
-        }
-        return result;
-    }
-
-    static Set<Module.Dependency> getDependencies(Module m) {
-        // ensure it's initialized
-        initDependencies();
-
-        Set<Module.Dependency> deps = new TreeSet<Module.Dependency>();
-        for (Reference ref : annotatedDepsMap.keySet()) {
-            if (m.contains(ref.referrer())) {
-                Module other = m.getModuleDependence(ref.referree());
-                if (other != null) {
-                    for (AnnotatedDependency ad : annotatedDepsMap.get(ref)) {
-                        Module.Dependency d = new Module.Dependency(other, ad.isOptional(), ad.isDynamic());
-                        deps.add(d);
-                    }
-                }
-            }
-        }
-        return deps;
-    }
-
-    synchronized static void initDependencies() {
-        if (annotatedDepsMap != null) {
-            return;
-        }
-
-        // Build a map of references to its dependencies
-        annotatedDepsMap = new TreeMap<Reference, Set<AnnotatedDependency>>();
-        optionalDepsMap = new TreeMap<Reference, Set<AnnotatedDependency>>();
-
-        for (Klass k : Klass.getAllClasses()) {
-            for (AnnotatedDependency ad : annotatedDependencies) {
-                if (ad.matches(k.getClassName())) {
-                    Reference ref = new Reference(ad.from, k);
-                    Set<AnnotatedDependency> set = annotatedDepsMap.get(ref);
-                    if (set == null) {
-                        set = new TreeSet<AnnotatedDependency>();
-                        annotatedDepsMap.put(ref, set);
-                    }
-                    set.add(ad);
-                }
-            }
-
-            for (AnnotatedDependency ad : optionalDependencies) {
-                if (ad.matches(k.getClassName())) {
-                    Reference ref = new Reference(ad.from, k);
-                    Set<AnnotatedDependency> set = optionalDepsMap.get(ref);
-                    if (set == null) {
-                        set = new TreeSet<AnnotatedDependency>();
-                        optionalDepsMap.put(ref, set);
-                    }
-                    set.add(ad);
-                }
-            }
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.Annotation;
-import com.sun.tools.classfile.ExtendedAnnotation;
-import com.sun.tools.classfile.Annotation.Annotation_element_value;
-import com.sun.tools.classfile.Annotation.Array_element_value;
-import com.sun.tools.classfile.Annotation.Class_element_value;
-import com.sun.tools.classfile.Annotation.Enum_element_value;
-import com.sun.tools.classfile.Annotation.Primitive_element_value;
-import com.sun.tools.classfile.ConstantPoolException;
-import com.sun.tools.classfile.Descriptor;
-import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.sun.classanalyzer.AnnotatedDependency.*;
-import java.io.File;
-import java.io.PrintWriter;
-import java.util.Map;
-import java.util.Set;
-
-/**
- *
- * @author Mandy Chung
- */
-public class AnnotationParser {
-
-    static boolean parseAnnotation = false;
-    static void setParseAnnotation(boolean newValue) {
-        parseAnnotation = newValue;
-    }
-
-    private final ClassFileParser cfparser;
-    public AnnotationParser(ClassFileParser cfparser) {
-        this.cfparser = cfparser;
-    }
-
-    private AnnotatedDependency addAnnotation(Annotation annot, Klass.Method method) {
-        String type = getType(annot.type_index);
-        AnnotatedDependency dep = AnnotatedDependency.newAnnotatedDependency(type, cfparser.this_klass);
-        if (dep != null) {
-            for (int i = 0; i < annot.num_element_value_pairs; i++) {
-                Element element = getElement(annot.element_value_pairs[i]);
-                dep.addElement(element.name, element.value);
-            }
-            dep.setMethod(method);
-        }
-        return dep;
-    }
-
-    private AnnotatedDependency addAnnotation(ExtendedAnnotation annot, Klass.Method method) {
-        return addAnnotation(annot.annotation, method);
-    }
-
-    class Element {
-
-        String name;
-        List<String> value;
-
-        Element(String name) {
-            this.name = name;
-            this.value = new ArrayList<String>();
-        }
-
-        void add(String v) {
-            value.add(v);
-        }
-    }
-
-    Element getElement(Annotation.element_value_pair pair) {
-        Element element = new Element(getName(pair.element_name_index));
-        evp.parse(pair.value, element);
-        return element;
-    }
-
-    private String getType(int index) {
-        try {
-            Descriptor d = new Descriptor(index);
-            return d.getFieldType(cfparser.classfile.constant_pool);
-        } catch (ConstantPoolException ignore) {
-        } catch (InvalidDescriptor ignore) {
-        }
-        return "Unknown";
-    }
-
-    private String getName(int index) {
-        return cfparser.constantPoolParser.stringValue(index);
-    }
-    element_value_Parser evp = new element_value_Parser();
-
-    class element_value_Parser implements Annotation.element_value.Visitor<Void, Element> {
-
-        public Void parse(Annotation.element_value value, Element element) {
-            value.accept(this, element);
-            return null;
-        }
-
-        public Void visitPrimitive(Primitive_element_value ev, Element element) {
-            String value = getName(ev.const_value_index);
-            element.add(value);
-            return null;
-        }
-
-        public Void visitEnum(Enum_element_value ev, Element element) {
-            String value = getName(ev.type_name_index) + "." + getName(ev.const_name_index);
-            element.add(value);
-            return null;
-        }
-
-        public Void visitClass(Class_element_value ev, Element element) {
-            String value = getName(ev.class_info_index) + ".class";
-            element.add(value);
-            return null;
-        }
-
-        public Void visitAnnotation(Annotation_element_value ev, Element element) {
-            // AnnotationParser.this.addAnnotation(ev.annotation_value);
-            throw new UnsupportedOperationException("Not supported: " + ev);
-        }
-
-        public Void visitArray(Array_element_value ev, Element element) {
-            for (int i = 0; i < ev.num_values; i++) {
-                parse(ev.values[i], element);
-            }
-            return null;
-        }
-    }
-
-    void parseAttributes(Attributes attributes, Klass.Method method) {
-        if (!parseAnnotation) {
-            return;
-        }
-
-        visitRuntimeAnnotations((RuntimeVisibleAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleAnnotations), method);
-        visitRuntimeAnnotations((RuntimeInvisibleAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleAnnotations), method);
-        visitRuntimeTypeAnnotations((RuntimeVisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleTypeAnnotations), method);
-        visitRuntimeTypeAnnotations((RuntimeInvisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleTypeAnnotations), method);
-        visitRuntimeParameterAnnotations((RuntimeVisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleParameterAnnotations), method);
-        visitRuntimeParameterAnnotations((RuntimeInvisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleParameterAnnotations), method);
-    }
-
-    public void visitRuntimeAnnotations(RuntimeAnnotations_attribute attr, Klass.Method method) {
-        if (attr == null) {
-            return;
-        }
-
-        for (int i = 0; i < attr.annotations.length; i++) {
-            addAnnotation(attr.annotations[i], method);
-        }
-    }
-
-    public void visitRuntimeTypeAnnotations(RuntimeTypeAnnotations_attribute attr, Klass.Method method) {
-        if (attr == null) {
-            return;
-        }
-
-        for (int i = 0; i < attr.annotations.length; i++) {
-            addAnnotation(attr.annotations[i], method);
-        }
-    }
-
-    public void visitRuntimeParameterAnnotations(RuntimeParameterAnnotations_attribute attr, Klass.Method method) {
-        if (attr == null) {
-            return;
-        }
-
-        for (int param = 0; param < attr.parameter_annotations.length; param++) {
-            for (int i = 0; i < attr.parameter_annotations[param].length; i++) {
-                addAnnotation(attr.parameter_annotations[param][i], method);
-            }
-        }
-    }
-
-    void parseAttributes(Attributes attributes) {
-        parseAttributes(attributes, null);
-    }
-
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-        String output = ".";
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-output")) {
-                output = args[i++];
-            } else {
-                usage();
-            }
-        }
-        if (jdkhome == null) {
-            usage();
-        }
-
-        // parse annotation and code attribute to find all references
-        // to Class.forName etc
-        CodeAttributeParser.setParseCodeAttribute(true);
-        AnnotationParser.setParseAnnotation(true);
-
-        ClassPath.setJDKHome(jdkhome);
-        ClassPath.parseAllClassFiles();
-
-        PrintWriter writer = new PrintWriter(new File(output, "jdk7.depconfig"));
-
-        try {
-            for (Klass k : Klass.getAllClasses()) {
-                for (AnnotatedDependency dep : k.getAnnotatedDeps()) {
-                    if (dep.isEmpty()) {
-                        continue;
-                    }
-                    writer.format("# %s \n", dep.method == null ? dep.from : dep.method);
-                    writer.format("%s\n\n", dep);
-                }
-            }
-        } finally {
-            writer.close();
-        }
-
-        writer = new PrintWriter(new File(output, "optional.depconfig"));
-        try {
-            AnnotatedDependency prev = null;
-            for (AnnotatedDependency dep : AnnotatedDependency.optionalDependencies) {
-                if (prev != null && !dep.equals(prev)) {
-                    writer.format("%s\n\n", prev);
-                }
-                writer.format("# %s \n", dep.method == null ? dep.from : dep.method);
-                prev = dep;
-            }
-            if (prev != null) {
-                writer.format("%s\n\n", prev);
-            }
-        } finally {
-            writer.close();
-        }
-
-        writer = new PrintWriter(new File(output, "runtime.references"));
-        try {
-            for (Map.Entry<String, Set<Klass.Method>> entry : CodeAttributeParser.runtimeReferences.entrySet()) {
-                writer.format("References to %s\n", entry.getKey());
-                Klass prev = null;
-                for (Klass.Method m : entry.getValue()) {
-                    if (prev == null || prev != m.getKlass()) {
-                        writer.format("  %-50s # %s\n", m.getKlass(), m);
-                    } else if (prev == m.getKlass()) {
-                        writer.format("  %-50s # %s\n", "", m);
-                    }
-                    prev = m.getKlass();
-                }
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void usage() {
-        System.out.println("Usage: AnnotationParser <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-depconfig <output file for annotated dependencies>");
-        System.out.println("\t-optional <output file for optional dependencies>");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,819 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.File;
-import java.util.ArrayDeque;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.ConstantPool.*;
-import static com.sun.tools.classfile.ConstantPool.*;
-import com.sun.tools.classfile.Instruction.TypeKind;
-import com.sun.tools.classfile.Type.*;
-
-/**
- * Generate the module config for the boot module with
- * a given set of roots (classes or methods) and exclude list.
- *
- * This tool does method-level dependency analysis starting
- * from the root set and follows references transitively as follows:
- * <ul>
- * <li>For a given class, it will parse the ClassFile to
- *     find its superclass and superinterfaces and also
- *     its static initializer &lt;clinit&gt;.</li>
- * <li>For each method, it will parse its Code attribute
- *     to look for a Methodref, Fieldref, and InterfaceMethodref.
- *     </li>
- * <li>For each Fieldref, it will include the type of
- *     the field in the dependency.</li>
- * <li>For each MethodRef, it will follow all references in
- *     that method.</li>
- * <li>For each InterfaceMethodref, it will follow all references in
- *     that method defined its implementation classes in
- *     the resulting dependency list.</li>
- * </ul>
- *
- * Limitation:
- * <ul>
- * <li>For each Methodref, it only parses the method of
- *     the specified type.  It doesn't analyze the class hierarchy
- *     and follow references of its subclasses since it ends up
- *     pulls in many unnecessary dependencies.  For now,
- *     the list of subclasses and methods need to be listed in
- *     the root set.</li>
- * </ul>
- *
- * @author Mandy Chung
- */
-public class BootAnalyzer {
-
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-        String config = null;
-        String output = ".";
-        boolean printClassList = false;
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-config")) {
-                config = args[i++];
-            } else if (arg.equals("-output")) {
-                output = args[i++];
-            } else if (arg.equals("-classlist")) {
-                printClassList = true;
-            } else {
-                usage();
-            }
-        }
-
-
-
-        if (jdkhome == null || config == null) {
-            usage();
-        }
-
-        File jre = new File(jdkhome, "jre");
-        if (jre.exists()) {
-            ClassPath.setJDKHome(jdkhome);
-        } else {
-            File classes = new File(jdkhome, "classes");
-            if (classes.exists()) {
-                ClassPath.setClassPath(classes.getCanonicalPath());
-            } else {
-                throw new RuntimeException("Invalid jdkhome: " + jdkhome);
-            }
-        }
-
-        parseConfigFile(config);
-        followRoots();
-
-        // create output directory if it doesn't exist
-        File dir = new File(output);
-        if (!dir.isDirectory()) {
-            if (!dir.exists()) {
-                boolean created = dir.mkdir();
-                if (!created) {
-                    throw new RuntimeException("Unable to create `" + dir + "'");
-                }
-            }
-        }
-
-        String bootmodule = "boot";
-        String bootconfig = resolve(dir, bootmodule, "config");
-        printBootConfig(bootconfig, bootmodule);
-
-        List<ModuleConfig> list = ModuleConfig.readConfigurationFile(bootconfig);
-        Module module = Module.addModule(list.get(0));
-        for (Klass k : Klass.getAllClasses()) {
-            module.addKlass(k);
-        }
-        module.fixupDependencies();
-
-        if (printClassList) {
-            module.printClassListTo(resolve(dir, bootmodule, "classlist"));
-            module.printSummaryTo(resolve(dir, bootmodule, "summary"));
-        }
-    }
-
-    // print boot.config file as an input to the ClassAnalyzer
-    private static void printBootConfig(String output, String bootmodule) throws IOException {
-
-        File f = new File(output);
-        PrintWriter writer = new PrintWriter(f);
-        try {
-            int count = 0;
-            writer.format("module %s {%n", bootmodule);
-            for (Klass k : Klass.getAllClasses()) {
-                if (count++ == 0) {
-                    writer.format("%4s%7s %s", "", "include", k);
-                } else {
-                    writer.format(",%n");
-                    writer.format("%4s%7s %s", "", "", k);
-                }
-            }
-            writer.format(";%n}%n");
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static String resolve(File dir, String mname, String suffix) {
-        File f = new File(dir, mname + "." + suffix);
-        return f.toString();
-
-    }
-    static List<MethodDescriptor> methods = new LinkedList<MethodDescriptor>();
-    static Deque<MethodDescriptor> pending = new ArrayDeque<MethodDescriptor>();
-    static Deque<MethodDescriptor> interfaceMethodRefs = new ArrayDeque<MethodDescriptor>();
-    static Filter filter = new Filter();
-
-    private static void followRoots() throws IOException {
-        MethodDescriptor md = null;
-
-        while ((md = pending.poll()) != null) {
-            if (!methods.contains(md)) {
-                methods.add(md);
-                if (md.classname.isEmpty()) {
-                    trace("Warning: class missing %s%n", md);
-                    continue;
-                }
-
-                if (filter.isExcluded(md.classname)) {
-                    trace("excluded %s%n", md);
-                } else {
-                    KlassInfo kinfo = getKlassInfo(md.classname);
-                    if (kinfo.classname.contains("$")) {
-                        int pos = kinfo.classname.lastIndexOf('$');
-                        String outer = kinfo.classname.substring(0, pos);
-                        if (!cache.containsKey(outer)) {
-                            trace("  include outer class %s%n", outer);
-                            getKlassInfo(outer).ensureParse();
-                        }
-                    }
-
-                    kinfo.ensureParse();
-                    if (md.methodname.length() > 0) {
-                        if (filter.isExcluded(md.name)) {
-                            trace("excluded %s%n", md);
-                        } else {
-                            if (md.interfaceMethodRef) {
-                                trace("interface methodref %s%n", md);
-                                interfaceMethodRefs.add(md);
-                            } else {
-                                List<String> descriptors = kinfo.parse(md);
-                                if (descriptors.isEmpty()) {
-                                    if (kinfo.getSuperclass() != null) {
-                                        String sn = kinfo.getSuperclass().classname;
-                                        MethodDescriptor superMD = new MethodDescriptor(sn + "." + md.methodname, md.descriptor, false);
-                                        if (!methods.contains(superMD) && !pending.contains(superMD)) {
-                                            trace("  delegated %s to %s%n", md, superMD);
-                                            pending.add(superMD);
-                                        }
-                                    } else if (kinfo.isClass()) {
-                                        trace("  %s (not found)%n", md);
-                                    } else {
-                                        trace("  %s (interface)%n", md);
-                                    }
-                                } else {
-                                    if (md.descriptor.equals("*")) {
-                                        trace("  parsed %s : ", md.name);
-                                        for (String s : descriptors) {
-                                            trace(" %s", s);
-                                        }
-                                        trace("%n");
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            if (pending.isEmpty()) {
-                for (Klass k : Klass.getAllClasses()) {
-                    if (k.getFileSize() == 0) {
-                        getKlassInfo(k.getClassName()).ensureParse();
-                    }
-                }
-                while ((md = interfaceMethodRefs.poll()) != null) {
-                    addSubClassMethods(md);
-                }
-            }
-        }
-    }
-
-    static void addSubClassMethods(MethodDescriptor md) throws IOException {
-        for (KlassInfo kinfo : getSubClasses(md.classname)) {
-            String methodname = kinfo.classname + "." + md.methodname;
-            MethodDescriptor other = new MethodDescriptor(methodname, md.descriptor, false);
-            if (!methods.contains(other) && !pending.contains(other)) {
-                trace("Warning: subclass from %s to %s%n", md.classname, other);
-                pending.add(other);
-            }
-        }
-    }
-    private final static String privilegedActionInterf = "java.security.PrivilegedAction";
-    private final static String privilegedExceptionActionInterf = "java.security.PrivilegedExceptionAction";
-
-    static boolean isPrivilegedAction(String classname) {
-        if (classname.isEmpty()) {
-            return false;
-        }
-        KlassInfo kinfo = getKlassInfo(classname);
-        for (KlassInfo ki : kinfo.getInterfaces()) {
-            String interf = ki.classname;
-            if (interf.equals(privilegedActionInterf) ||
-                    interf.equals(privilegedExceptionActionInterf)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    static Map<String, KlassInfo> cache = new HashMap<String, KlassInfo>();
-
-    static KlassInfo getKlassInfo(String classname) {
-        classname = classname.replace('/', '.');
-
-        KlassInfo kinfo = cache.get(classname);
-        if (kinfo == null) {
-            kinfo = new KlassInfo(classname);
-            cache.put(classname, kinfo);
-        }
-        return kinfo;
-    }
-
-    static class KlassInfo {
-
-        final String classname;
-        private ClassFileParser parser;
-        private KlassInfo superclass;
-        private List<KlassInfo> interfaces = new LinkedList<KlassInfo>();
-
-        KlassInfo(String classname) {
-            this.classname = classname;
-        }
-
-        boolean isClass() {
-            ensureParse();
-            return parser.classfile.isClass();
-        }
-
-        KlassInfo getSuperclass() {
-            ensureParse();
-            return superclass;
-        }
-
-        List<KlassInfo> getInterfaces() {
-            ensureParse();
-            return java.util.Collections.unmodifiableList(interfaces);
-        }
-
-        void ensureParse() {
-            try {
-                getClassFileParser();
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        synchronized ClassFileParser getClassFileParser() throws IOException {
-            if (parser == null) {
-                parser = ClassPath.parserForClass(classname);
-                if (parser != null) {
-                    parseClassFile();
-                    List<String> descriptors = parse(new MethodDescriptor(classname + ".<clinit>", "()V", false));
-                }
-            }
-            return parser;
-        }
-
-        List<String> parse(MethodDescriptor md) {
-            ensureParse();
-            try {
-                List<String> descriptors = new LinkedList<String>();
-                for (Method m : parser.classfile.methods) {
-                    String name = m.getName(parser.classfile.constant_pool);
-                    String desc = parser.constantPoolParser.getDescriptor(m.descriptor.index);
-                    if (name.equals(md.methodname)) {
-                        if (md.descriptor.equals("*") || md.descriptor.equals(desc)) {
-                            parseMethod(parser, m);
-                            descriptors.add(desc);
-                        }
-                    }
-                }
-                return descriptors;
-            } catch (ConstantPoolException ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-
-        private void parseClassFile() throws IOException {
-            parser.parseClassInfo();
-
-            ClassFile classfile = parser.classfile;
-            try {
-                if (classfile.super_class > 0) {
-                    superclass = getKlassInfo(classfile.getSuperclassName());
-                }
-                if (classfile.interfaces != null) {
-                    for (int i = 0; i < classfile.interfaces.length; i++) {
-                        interfaces.add(getKlassInfo(classfile.getInterfaceName(i)));
-                    }
-                }
-            } catch (ConstantPoolException ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-
-    static List<KlassInfo> getSubClasses(String classname) throws IOException {
-        List<KlassInfo> result = new LinkedList<KlassInfo>();
-        List<KlassInfo> list = new LinkedList<KlassInfo>();
-        list.addAll(cache.values());
-        for (KlassInfo kinfo : list) {
-            if (kinfo.getSuperclass() != null && classname.equals(kinfo.getSuperclass().classname)) {
-                result.add(kinfo);
-            }
-            for (KlassInfo interf : kinfo.getInterfaces()) {
-                if (classname.equals(interf.classname)) {
-                    result.add(kinfo);
-                }
-            }
-        }
-        return result;
-    }
-
-    private static void parseConfigFile(String config) throws IOException {
-        FileInputStream in = new FileInputStream(config);
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line;
-            int lineNumber = 0;
-            while ((line = reader.readLine()) != null) {
-                lineNumber++;
-                if ((line = line.trim()).length() > 0) {
-                    if (line.startsWith("#")) {
-                        continue;
-                    }
-
-                    String[] s = line.split("\\s+");
-                    if ("exclude".equals(s[0])) {
-                        filter.exclude(s[1]);
-                    } else {
-                        String name = s[0].replace('/', '.');
-                        if (name.length() > 0) {
-                            String classname = name.replace('/', '.');
-                            if (s.length == 2) {
-                                // method name
-                                int pos = classname.lastIndexOf('.');
-                                classname = classname.substring(0, pos);
-                            }
-
-                            KlassInfo kinfo = getKlassInfo(classname);
-                            if (kinfo.getClassFileParser() != null) {
-                                // class exists
-                                MethodDescriptor md = (s.length == 1) ? new MethodDescriptor(name) : new MethodDescriptor(name, s[1], false);
-                                if (!pending.contains(md)) {
-                                    pending.add(md);
-                                }
-                            } else {
-                                // class not found
-                                trace("Class %s not found%n", classname);
-                            }
-                        }
-                    }
-                }
-            }
-
-        } finally {
-            in.close();
-        }
-    }
-
-    private static void parseMethod(ClassFileParser cfparser, Method m) {
-        Klass.Method kmethod = cfparser.parseMethod(m);
-        Code_attribute c_attr = (Code_attribute) m.attributes.get(Attribute.Code);
-        if (c_attr != null) {
-            LineNumberTable_attribute lineNumTable =
-                    (LineNumberTable_attribute) c_attr.attributes.get(Attribute.LineNumberTable);
-            InstructorVisitor visitor = new InstructorVisitor(cfparser, lineNumTable);
-            trace("parseMethod %s %s %n", cfparser.this_klass, kmethod);
-            for (Instruction instr : c_attr.getInstructions()) {
-                try {
-                    instr.accept(visitor, kmethod);
-                } catch (ArrayIndexOutOfBoundsException e) {
-                    throw new RuntimeException("error at or after byte " + instr.getPC());
-                }
-
-            }
-
-            if (c_attr.exception_table_langth > 0) {
-                for (int i = 0; i <
-                        c_attr.exception_table.length; i++) {
-                    Code_attribute.Exception_data handler = c_attr.exception_table[i];
-                    int catch_type = handler.catch_type;
-                    if (catch_type > 0) {
-                        visitor.addConstantPoolRef(catch_type, kmethod, handler.start_pc);
-                    }
-
-                }
-            }
-        }
-    }
-
-    static class MethodDescriptor {
-
-        final String name;
-        final String classname;
-        final String methodname;
-        final String descriptor;
-        final boolean interfaceMethodRef;
-
-        MethodDescriptor(String classname) {
-            this.classname = classname.replace('/', '.');
-            this.name = this.classname;
-            this.methodname = "";
-            this.descriptor = "";
-            this.interfaceMethodRef = false;
-            if (this.classname.length() == 1) {
-                throw new RuntimeException("invalid " + this);
-            }
-        }
-
-        MethodDescriptor(String name, String descriptor, boolean interfaceMethodRef) {
-            name = name.replace('/', '.');
-            this.name = name;
-            int pos = name.lastIndexOf('.');
-            this.classname = name.substring(0, pos);
-            this.methodname = name.substring(pos + 1, name.length());
-            this.descriptor = descriptor;
-            this.interfaceMethodRef = interfaceMethodRef;
-            if (this.classname.length() == 1) {
-                throw new RuntimeException("invalid " + this);
-            }
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            MethodDescriptor m = (MethodDescriptor) obj;
-
-            return this.name.equals(m.name) &&
-                    this.descriptor.equals(m.descriptor);
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 7;
-            hash = 97 * hash + (this.name != null ? this.name.hashCode() : 0);
-            hash = 97 * hash + (this.descriptor != null ? this.descriptor.hashCode() : 0);
-            return hash;
-        }
-
-        public String toString() {
-            if (descriptor.isEmpty()) {
-                return name;
-            } else {
-                return name + " : " + descriptor;
-            }
-        }
-    }
-
-    static class Filter {
-
-        private Set<String> excludes = new TreeSet<String>();
-
-        Filter exclude(String pattern) {
-            excludes.add(pattern);
-            return this;
-        }
-
-        boolean isExcluded(String klass) {
-            for (String pattern : excludes) {
-                if (matches(klass, pattern)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        private boolean matches(String klass, String pattern) {
-            int pos = klass.lastIndexOf('.');
-            String packageName = pos > 0 ? klass.substring(0, pos) : "<unnamed>";
-            if (pattern.endsWith("**")) {
-                String p = pattern.substring(0, pattern.length() - 2);
-                return klass.startsWith(p);
-            } else if (pattern.endsWith("*")) {
-                pos = pattern.lastIndexOf('.');
-                String pkg = pos > 0 ? pattern.substring(0, pos) : "<unnamed>";
-                if (packageName.equals(pkg)) {
-                    // package name has to be exact match
-                    String p = pattern.substring(0, pattern.length() - 1);
-                    return klass.startsWith(p);
-                } else {
-                    return false;
-                }
-            } else {
-                // exact match or inner class
-                return klass.equals(pattern) || klass.startsWith(pattern + "$");
-            }
-        }
-    }
-
-    static class InstructorVisitor implements Instruction.KindVisitor<Void, Klass.Method> {
-
-        private final ClassFileParser parser;
-        private final LineNumberTable_attribute lineNumTable;
-
-        InstructorVisitor(ClassFileParser parser, LineNumberTable_attribute lineNumTable) {
-            this.parser = parser;
-            this.lineNumTable = lineNumTable;
-        }
-
-        int getLineNumber(int pc) {
-            if (lineNumTable != null) {
-                int start_pc = 0;
-                int lineno = 0;
-                for (int i = 0; i < lineNumTable.line_number_table_length; i++) {
-                    int cur_start_pc = lineNumTable.line_number_table[i].start_pc;
-                    if (pc == 0 && cur_start_pc == 0) {
-                        return lineNumTable.line_number_table[i].line_number;
-                    } else if (pc >= start_pc && pc < cur_start_pc) {
-                        return lineno;
-                    }
-                    start_pc = cur_start_pc;
-                    lineno = lineNumTable.line_number_table[i].line_number;
-                }
-            }
-            return 0;
-        }
-
-        void addConstantPoolRef(int index, Klass.Method m, int pc) {
-            try {
-                CPInfo cpInfo = parser.classfile.constant_pool.get(index);
-                String name = cpInfo.accept(typeFinder, null);
-                if (name != null) {
-                    trace("   %s %s at line %d%n", parser.constantPoolParser.tagName(index), name, getLineNumber(pc));
-                }
-            } catch (InvalidIndex ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-
-        public Void visitNoOperands(Instruction instr, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitArrayType(Instruction instr, TypeKind kind, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitBranch(Instruction instr, int offset, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitConstantPoolRef(Instruction instr, int index, Klass.Method m) {
-            addConstantPoolRef(index, m, instr.getPC());
-            return null;
-        }
-
-        public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Klass.Method m) {
-            addConstantPoolRef(index, m, instr.getPC());
-            return null;
-        }
-
-        public Void visitLocal(Instruction instr, int index, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitLocalAndValue(Instruction instr, int index, int value, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitValue(Instruction instr, int value, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitUnknown(Instruction instr, Klass.Method m) {
-            return null;
-        }
-        private ConstantPool.Visitor<String, Void> typeFinder = new ConstantPool.Visitor<String, Void>() {
-
-            String getClassName(CPRefInfo info, Void p) {
-                try {
-                    return parser.checkClassName(info.getClassName()).replace('/', '.');
-                } catch (ConstantPoolException ex) {
-                    throw new RuntimeException(ex);
-                }
-            }
-
-            boolean addReferencedClass(String name) {
-                if (Klass.findKlass(name) == null) {
-                    MethodDescriptor md = new MethodDescriptor(name);
-                    if (!methods.contains(md) && !pending.contains(md)) {
-                        pending.add(md);
-                    }
-                    return true;
-                }
-                return false;
-            }
-            private String privilegedActionClass = "";
-
-            void cachePrivilegedAction(String classname) {
-                trace("   found PrivilegedAction %s%n", classname);
-                privilegedActionClass = classname;
-            }
-
-            void doPrivilegedCall(String method) {
-                if (privilegedActionClass.length() > 0) {
-                    MethodDescriptor md = new MethodDescriptor(privilegedActionClass + ".run", "*", false);
-                    if (!methods.contains(md) && !pending.contains(md)) {
-                        trace("   doPrivileged %s%n", md);
-                        pending.add(md);
-                    }
-                }
-            }
-
-            private String addMethodDescriptor(CPRefInfo info, Void p) {
-                try {
-                    String classname = getClassName(info, null);
-                    String method = classname + "." + info.getNameAndTypeInfo().getName();
-                    String descriptor = info.getNameAndTypeInfo().getType();
-
-                    if (method.endsWith(".<init>") && isPrivilegedAction(classname)) {
-                        cachePrivilegedAction(classname);
-                    }
-                    if (method.equals("java.security.AccessController.doPrivileged")) {
-                        doPrivilegedCall(method);
-                        return method;
-                    }
-
-                    boolean interfaceMethodRef = info instanceof CONSTANT_InterfaceMethodref_info;
-                    MethodDescriptor md = new MethodDescriptor(method, descriptor, interfaceMethodRef);
-                    if (!methods.contains(md) && !pending.contains(md)) {
-                        pending.add(md);
-                    }
-                    return method;
-                } catch (ConstantPoolException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-
-            public String visitClass(CONSTANT_Class_info info, Void p) {
-                try {
-                    String classname = parser.checkClassName(info.getName()).replace('/', '.');
-                    if (classname.length() > 0) {
-                        addReferencedClass(classname);
-                    }
-                    return classname;
-                } catch (ConstantPoolException ex) {
-                    throw new RuntimeException(ex);
-                }
-            }
-
-            public String visitDouble(CONSTANT_Double_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitFieldref(CONSTANT_Fieldref_info info, Void p) {
-                try {
-                    String classname = getClassName(info, p);
-                    if (classname.length() > 0) {
-                        addReferencedClass(classname);
-                    }
-
-                    String type = info.getNameAndTypeInfo().getType();
-                    String fieldType = parser.checkClassName(type).replace('/', '.');
-                    if (fieldType.length() > 0) {
-                        addReferencedClass(classname);
-                    }
-                    return parser.constantPoolParser.stringValue(info);
-                } catch (ConstantPoolException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-
-            public String visitFloat(CONSTANT_Float_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitInteger(CONSTANT_Integer_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
-                return addMethodDescriptor(info, p);
-            }
-
-            public String visitLong(CONSTANT_Long_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitMethodref(CONSTANT_Methodref_info info, Void p) {
-                return addMethodDescriptor(info, p);
-            }
-
-            public String visitString(CONSTANT_String_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitUtf8(CONSTANT_Utf8_info info, Void p) {
-                return null;
-            }
-        };
-    }
-    static boolean traceOn = System.getProperty("classanalyzer.debug") != null;
-
-    private static void trace(String format, Object... args) {
-        if (traceOn) {
-            System.out.format(format, args);
-        }
-    }
-
-    private static void usage() {
-        System.out.println("Usage: BootAnalyzer <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-config  <roots for the boot module>");
-        System.out.println("\t-output  <output dir>");
-        System.out.println("\t-classlist print class list and summary");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * A simple tool to check module dependencies against a known list of
- * dependencies. The tool fails (by throwing a RuntimeException) is an
- * unexpected dependency is detected.
- */
-
-public class CheckDeps {
-
-    /**
-     * Represents a dependency from one module to another module. The dependency
-     * may be optional.
-     */
-    static class Dependency {
-        private final String module;
-        private final String other;
-        private final boolean optional;
-
-        private Dependency(String module, String other, boolean optional) {
-            this.module = module;
-            this.other = other;
-            this.optional = optional;
-        }
-
-        String module()      { return module; }
-        String other()       { return other; }
-        boolean isOptional() { return optional; }
-
-        /**
-         * Parses a dependency in one of the following forms:
-         *   a -> b
-         *   [optional] a -> b
-         */
-        static Dependency fromString(String s) {
-            String[] components = s.split(" ");
-            int count = components.length;
-            if (count != 3 && count != 4)
-                throw new IllegalArgumentException(s);
-            boolean optional = (count == 4);
-            if (optional && !components[0].equals("[optional]"))
-                throw new IllegalArgumentException(s);
-            String arrow = optional ? components[2] : components[1];
-            if (!arrow.equals("->"))
-                throw new IllegalArgumentException(s);
-            String module = optional ? components[1] : components[0];
-            String other = optional ? components[3] : components[2];
-            return new Dependency(module, other, optional);
-        }
-
-        @Override public String toString() {
-            StringBuilder sb = new StringBuilder();
-            if (optional)
-                sb.append("[optional] ");
-            sb.append(module);
-            sb.append(" -> ");
-            sb.append(other);
-            return sb.toString();
-        }
-    }
-
-    /**
-     * Represents the "tail"
-     */
-    static class DependencyTail {
-        private final String module;
-        private final boolean optional;
-
-        DependencyTail(String module, boolean optional) {
-            this.module = module;
-            this.optional = optional;
-        }
-        String module()      { return module; }
-        boolean isOptional() { return optional; }
-    }
-
-    static void usage() {
-        System.out.println("java CheckDeps file1 file2");
-        System.out.println("  where file1 is the expected dependencies and file2 is");
-        System.out.println("  the actual dependencies. Both files are assumed to be");
-        System.out.println("  in modules.summary format (see ClassAnalyzer tool).");
-        System.out.println();
-        System.out.println("Example usages:");
-        System.out.println("  java CheckDeps make/modules/modules.summary " +
-            "$(OUTPUTDIR)/modules.summary");
-        System.exit(-1);
-    }
-
-    public static void main(String[] args) throws IOException {
-        if (args.length != 2)
-            usage();
-
-        // maps a module to the list of modules that it depends on
-        Map<String,List<DependencyTail>> expected =
-            new HashMap<String,List<DependencyTail>>();
-
-        // parse the expected dependencies file
-        Scanner s;
-        s = new Scanner(new FileInputStream(args[0]));
-        try {
-            while (s.hasNextLine()) {
-                Dependency ref = Dependency.fromString(s.nextLine());
-                if (ref != null) {
-                    String module = ref.module();
-                    List<DependencyTail> list = expected.get(module);
-                    if (list == null) {
-                        list = new ArrayList<DependencyTail>();
-                        expected.put(module, list);
-                    }
-                    list.add(new DependencyTail(ref.other(), ref.isOptional()));
-                }
-            }
-        } finally {
-            s.close();
-        }
-
-        // parse the actual dependencies file, checking each dependency
-        // against the expected list.
-        boolean fail = false;
-        s = new Scanner(new FileInputStream(args[1]));
-        try {
-            while (s.hasNextLine()) {
-                Dependency dep = Dependency.fromString(s.nextLine());
-
-                // check if this dependency is expected
-                List<DependencyTail> list = expected.get(dep.module());
-                DependencyTail tail = null;
-                if (list != null) {
-                    for (DependencyTail t: list) {
-                        if (t.module().equals(dep.other())) {
-                            tail = t;
-                            break;
-                        }
-                    }
-                }
-                if (tail == null) {
-                    System.err.println("Unexpected dependency: " + dep);
-                    fail = true;
-                } else {
-                    // hard dependency when optional dependency is expected
-                    if (tail.isOptional() != dep.isOptional()) {
-                        if (tail.isOptional()) {
-                            System.err.println("Unexpected dependency: " + dep);
-                            fail = true;
-                        }
-                    }
-                }
-            }
-        } finally {
-            s.close();
-        }
-
-        if (fail)
-            throw new RuntimeException("Unexpected dependencies found");
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import com.sun.classanalyzer.AnnotatedDependency.*;
-import com.sun.classanalyzer.Module.Dependency;
-import com.sun.classanalyzer.Module.PackageInfo;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.io.File;
-import java.io.PrintWriter;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ClassAnalyzer {
-
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-        String cpath = null;
-        List<String> configs = new ArrayList<String>();
-        List<String> depconfigs = new ArrayList<String>();
-        String output = ".";
-        boolean mergeModules = true;
-        boolean showDynamic = false;
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-cpath")) {
-                if (i < args.length) {
-                    cpath = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-config")) {
-                if (i < args.length) {
-                    configs.add(args[i++]);
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-depconfig")) {
-                if (i < args.length) {
-                    depconfigs.add(args[i++]);
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-output")) {
-                if (i < args.length) {
-                    output = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-base")) {
-                ModuleConfig.setBaseModule(args[i++]);
-            } else if (arg.equals("-nomerge")) {
-                // analyze the fine-grained module dependencies
-                mergeModules = false;
-            } else if (arg.equals("-showdynamic")) {
-                showDynamic = true;
-            } else {
-                System.err.println("Invalid option: " + arg);
-                usage();
-            }
-        }
-
-        if ((jdkhome == null && cpath == null) || (jdkhome != null && cpath != null)) {
-            usage();
-        }
-        if (configs.isEmpty()) {
-            usage();
-        }
-
-        if (jdkhome != null) {
-            ClassPath.setJDKHome(jdkhome);
-        } else if (cpath != null) {
-            ClassPath.setClassPath(cpath);
-        }
-
-        // create output directory if it doesn't exist
-        File dir = new File(output);
-        if (!dir.isDirectory()) {
-            if (!dir.exists()) {
-                boolean created = dir.mkdir();
-                if (!created) {
-                    throw new RuntimeException("Unable to create `" + dir + "'");
-                }
-            }
-        }
-
-        buildModules(configs, depconfigs, mergeModules);
-
-        // generate output files
-        for (Module m : modules) {
-            // only generate reports for top-level modules
-            if (m.group() == m) {
-                m.printClassListTo(resolve(dir, m.name(), "classlist"));
-                m.printResourceListTo(resolve(dir, m.name(), "resources"));
-                m.printSummaryTo(resolve(dir, m.name(), "summary"));
-                m.printDependenciesTo(resolve(dir, m.name(), "dependencies"), showDynamic);
-            }
-        }
-
-        // Generate other summary reports
-        printModulesSummary(dir, showDynamic);
-        printModulesDot(dir, showDynamic);
-        printModulesList(dir);
-        printPackagesSummary(dir);
-    }
-    private static List<Module> modules = new ArrayList<Module>();
-
-    static void buildModules(List<String> configs,
-            List<String> depconfigs,
-            boolean mergeModules) throws IOException {
-        // create modules based on the input config files
-        for (String file : configs) {
-            for (ModuleConfig mconfig : ModuleConfig.readConfigurationFile(file)) {
-                modules.add(Module.addModule(mconfig));
-            }
-        }
-
-        // parse class files
-        ClassPath.parseAllClassFiles();
-
-        // Add additional dependencies if specified
-        if (depconfigs != null && depconfigs.size() > 0) {
-            DependencyConfig.parse(depconfigs);
-        }
-
-        // process the roots and dependencies to get the classes for each module
-        for (Module m : modules) {
-            m.processRootsAndReferences();
-        }
-
-        // update the dependencies for classes that were subsequently allocated
-        // to modules
-        for (Module m : modules) {
-            m.fixupDependencies();
-        }
-
-        if (mergeModules) {
-            Module.buildModuleMembers();
-        }
-    }
-
-    private static void printModulesSummary(File dir, boolean showDynamic) throws IOException {
-        // print summary of dependencies
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.summary"));
-        try {
-            for (Module m : modules) {
-                // only show top-level module dependencies
-                if (m.group() == m) {
-                    for (Dependency dep : m.dependents()) {
-                        if (!showDynamic && dep.dynamic && dep.optional) {
-                            continue;
-                        }
-                        if (dep.module == null || !dep.module.isBase()) {
-
-                            String prefix = "";
-                            if (dep.optional) {
-                                if (dep.dynamic) {
-                                    prefix = "[dynamic] ";
-                                } else {
-                                    prefix = "[optional] ";
-                                }
-                            }
-
-                            Module other = dep != null ? dep.module : null;
-                            writer.format("%s%s -> %s%n", prefix, m, other);
-                        }
-                    }
-                }
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void printModulesDot(File dir, boolean showDynamic) throws IOException {
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.dot"));
-        try {
-            writer.println("digraph jdk {");
-            for (Module m : modules) {
-                if (m.group() == m) {
-                    for (Dependency dep : m.dependents()) {
-                        if (!showDynamic && dep.dynamic && dep.optional) {
-                            continue;
-                        }
-                        if (dep.module == null || !dep.module.isBase()) {
-                            String style = "";
-                            String color = "";
-                            String property = "";
-                            if (dep.optional) {
-                                style = "style=dotted";
-                            }
-                            if (dep.dynamic) {
-                                color = "color=red";
-                            }
-                            if (style.length() > 0 || color.length() > 0) {
-                                String comma = "";
-                                if (style.length() > 0 && color.length() > 0) {
-                                    comma = ", ";
-                                }
-                                property = String.format(" [%s%s%s]", style, comma, color);
-                            }
-                            Module other = dep != null ? dep.module : null;
-                            writer.format("    \"%s\" -> \"%s\"%s;%n", m, other, property);
-                        }
-                    }
-                }
-            }
-            writer.println("}");
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void printMembers(Module m, PrintWriter writer) {
-        for (Module member : m.members()) {
-            if (!member.isEmpty()) {
-                writer.format("%s ", member);
-                printMembers(member, writer);
-            }
-        }
-    }
-
-    private static void printModulesList(File dir) throws IOException {
-        // print module group / members relationship
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.list"));
-        try {
-            for (Module m : modules) {
-                if (m.group() == m && !m.isEmpty()) {
-                    writer.format("%s ", m);
-                    printMembers(m, writer);
-                    writer.println();
-                }
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void printPackagesSummary(File dir) throws IOException {
-        // print package / module relationship
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.pkginfo"));
-        try {
-            Map<String, Set<Module>> packages = new TreeMap<String, Set<Module>>();
-            Set<String> splitPackages = new TreeSet<String>();
-
-            for (Module m : modules) {
-                if (m.group() == m) {
-                    for (PackageInfo info : m.getPackageInfos()) {
-                        Set<Module> value = packages.get(info.pkgName);
-                        if (value == null) {
-                            value = new TreeSet<Module>();
-                            packages.put(info.pkgName, value);
-                        } else {
-                            // package in more than one module
-                            splitPackages.add(info.pkgName);
-                        }
-                        value.add(m);
-                    }
-                }
-            }
-
-            // packages that are splitted among multiple modules
-            writer.println("Packages splitted across modules:-\n");
-            writer.format("%-60s  %s\n", "Package", "Module");
-
-            for (String pkgname : splitPackages) {
-                writer.format("%-60s", pkgname);
-                for (Module m : packages.get(pkgname)) {
-                    writer.format("  %s", m);
-                }
-                writer.println();
-            }
-
-            writer.println("\nPackage-private dependencies:-");
-            for (String pkgname : splitPackages) {
-                for (Klass k : Klass.getAllClasses()) {
-                    if (k.getPackageName().equals(pkgname)) {
-                        Module m = k.getModule();
-                        // check if this klass references a package-private
-                        // class that is in a different module
-                        for (Klass other : k.getReferencedClasses()) {
-                            if (other.getModule() != m &&
-                                    !other.isPublic() &&
-                                    other.getPackageName().equals(pkgname)) {
-                                String from = k.getClassName() + " (" + m + ")";
-                                writer.format("%-60s -> %s (%s)\n", from, other, other.getModule());
-                            }
-                        }
-                    }
-                }
-            }
-        } finally {
-            writer.close();
-        }
-
-    }
-
-    private static String resolve(File dir, String mname, String suffix) {
-        File f = new File(dir, mname + "." + suffix);
-        return f.toString();
-
-    }
-
-    private static void usage() {
-        System.out.println("Usage: ClassAnalyzer <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-cpath   <classpath> where classes and jars will be parsed");
-        System.out.println("\t         Either -jdkhome or -cpath option can be used.");
-        System.out.println("\t-config  <module config file>");
-        System.out.println("\t         This option can be repeated for multiple module config files");
-        System.out.println("\t-output  <output dir>");
-        System.out.println("\t-nomerge specify not to merge modules");
-        System.out.println("\t-showdynamic show dynamic dependencies in the reports");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,629 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.Type.*;
-import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
-import static com.sun.tools.classfile.AccessFlags.*;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ClassFileParser {
-
-    final Klass this_klass;
-    final ClassFile classfile;
-    final ConstantPoolParser constantPoolParser;
-    final AnnotationParser annotationParser;
-    final CodeAttributeParser codeAttributeParser;
-    private final boolean buildDeps;
-
-    protected ClassFileParser(InputStream in, long size, boolean buildDeps) throws IOException {
-        try {
-            this.classfile = ClassFile.read(in);
-            this.this_klass = getKlass(this.classfile);
-            this.buildDeps = buildDeps;
-            this.constantPoolParser = new ConstantPoolParser(this);
-            this.annotationParser = new AnnotationParser(this);
-            this.codeAttributeParser = new CodeAttributeParser(this);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    private Klass getKlass(ClassFile cf) throws ConstantPoolException {
-        Klass k = Klass.getKlass(cf.getName());
-        k.setAccessFlags(cf.access_flags.flags);
-        k.setFileSize(cf.byteLength());
-        return k;
-    }
-
-    public static ClassFileParser newParser(InputStream in, long size, boolean buildDeps) throws IOException {
-        return new ClassFileParser(in, size, buildDeps);
-    }
-
-    public static ClassFileParser newParser(String classPathname, boolean buildDeps) throws IOException {
-        return newParser(new File(classPathname), buildDeps);
-    }
-
-    public static ClassFileParser newParser(File f, boolean buildDeps) throws IOException {
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
-        try {
-            return newParser(in, f.length(), buildDeps);
-        } finally {
-            in.close();
-        }
-    }
-
-    public void parseDependency(boolean publicAPIs) throws IOException {
-        if (publicAPIs && !classfile.access_flags.is(ACC_PUBLIC)) {
-            // process public APIs only
-            return;
-        }
-
-        parseClassInfo();
-        if (!publicAPIs) {
-            // parse all references in the classfile
-            constantPoolParser.parseDependency();
-        }
-        parseMethods(publicAPIs);
-        parseFields(publicAPIs);
-    }
-
-    void parseClassInfo() throws IOException {
-        ConstantPool cpool = classfile.constant_pool;
-        try {
-            Signature_attribute sigAttr = (Signature_attribute) classfile.attributes.get(Attribute.Signature);
-            if (sigAttr == null) {
-                // use info from class file header
-                if (classfile.isClass() && classfile.super_class != 0) {
-                    String sn = classfile.getSuperclassName();
-                    addExtends(sn);
-                }
-                for (int i = 0; i < classfile.interfaces.length; i++) {
-                    String interf = classfile.getInterfaceName(i);
-                    if (classfile.isClass()) {
-                        addImplements(interf);
-                    } else {
-                        addExtends(interf);
-                    }
-                }
-            } else {
-                Type t = sigAttr.getParsedSignature().getType(cpool);
-                // The signature parser cannot disambiguate between a
-                // FieldType and a ClassSignatureType that only contains a superclass type.
-                if (t instanceof Type.ClassSigType) {
-                    Type.ClassSigType cst = Type.ClassSigType.class.cast(t);
-                    if (cst.superclassType != null) {
-                        for (Klass k : getKlass(cst.superclassType)) {
-                            addExtends(k);
-                        }
-                    }
-                    if (cst.superinterfaceTypes != null) {
-                        for (Type t1 : cst.superinterfaceTypes) {
-                            for (Klass k : getKlass(t1)) {
-                                addImplements(k);
-                            }
-                        }
-                    }
-                } else {
-                    for (Klass k : getKlass(t)) {
-                        addExtends(k);
-                    }
-                }
-            }
-            // parse attributes
-            annotationParser.parseAttributes(classfile.attributes);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    private void parseFields(boolean publicAPIs) throws IOException {
-        ConstantPool cpool = classfile.constant_pool;
-        for (Field f : classfile.fields) {
-            try {
-                AccessFlags flags = f.access_flags;
-                if (publicAPIs && !flags.is(ACC_PUBLIC) && !flags.is(ACC_PROTECTED)) {
-                    continue;
-                }
-                String fieldname = f.getName(cpool);
-                Signature_attribute sigAttr = (Signature_attribute) f.attributes.get(Attribute.Signature);
-
-                if (sigAttr == null) {
-                    Set<Klass> types = parseDescriptor(f.descriptor);
-                    String info = getFlag(flags) + " " + f.descriptor.getFieldType(cpool) + " " + fieldname;
-                    addFieldTypes(types, info, flags);
-                } else {
-                    Type t = sigAttr.getParsedSignature().getType(cpool);
-                    String info = getFlag(flags) + " " + t + " " + fieldname;
-                    addFieldTypes(getKlass(t), info, flags);
-                }
-                // parse attributes
-                annotationParser.parseAttributes(f.attributes);
-            } catch (ConstantPoolException ex) {
-                throw new RuntimeException(ex);
-            } catch (InvalidDescriptor ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-
-    private void parseMethods(boolean publicAPIs) {
-        for (Method m : classfile.methods) {
-            if (publicAPIs && !m.access_flags.is(ACC_PUBLIC) && !m.access_flags.is(ACC_PROTECTED)) {
-                // only interest in the API level
-                return;
-            }
-
-            parseMethod(m);
-        }
-    }
-
-    String checkClassName(String classname) {
-        int i = 0;
-        while (i < classname.length()) {
-            switch (classname.charAt(i)) {
-                case 'Z':
-                case 'B':
-                case 'C':
-                case 'S':
-                case 'I':
-                case 'J':
-                case 'F':
-                case 'D':
-                    return "";
-                case 'L':
-                    if (!classname.endsWith(";")) {
-                        throw new RuntimeException("Invalid classname " + classname);
-                    }
-                    return classname.substring(i + 1, classname.length() - 1);
-                case '[':
-                    i++;
-                    break;
-                default:
-                    if (classname.endsWith(";")) {
-                        throw new RuntimeException("Invalid classname " + classname);
-                    }
-                    return classname;
-
-            }
-        }
-        throw new RuntimeException("Invalid classname " + classname);
-    }
-
-    private void addExtends(String classname) throws IOException {
-        if (!buildDeps) {
-            return;
-        }
-
-        addExtends(Klass.getKlass(classname));
-    }
-
-    private void addExtends(Klass k) {
-        if (!buildDeps) {
-            return;
-        }
-
-        ResolutionInfo resInfo = ResolutionInfo.resolvedExtends(this_klass, k);
-        resInfo.setPublicAccess(classfile.access_flags.is(ACC_PUBLIC));
-        this_klass.addDep(k, resInfo);
-        k.addReferrer(this_klass, resInfo);
-    }
-
-    private void addImplements(String classname) throws IOException {
-        if (!buildDeps) {
-            return;
-        }
-
-        addImplements(Klass.getKlass(classname));
-    }
-
-    private void addImplements(Klass k) {
-        if (!buildDeps) {
-            return;
-        }
-
-        ResolutionInfo resInfo = ResolutionInfo.resolvedImplements(this_klass, k);
-        resInfo.setPublicAccess(classfile.access_flags.is(ACC_PUBLIC));
-
-        this_klass.addDep(k, resInfo);
-
-        k.addReferrer(this_klass, resInfo);
-    }
-
-    private Set<Klass> getKlass(Type type) throws IOException {
-        Set<Klass> refTypes = new TreeSet<Klass>();
-        if (!buildDeps) {
-            return refTypes;
-        }
-
-        type.accept(typevisitor, refTypes);
-        return refTypes;
-    }
-    private Type.Visitor<Void, Set<Klass>> typevisitor = new Type.Visitor<Void, Set<Klass>>() {
-
-        public Void visitSimpleType(SimpleType type, Set<Klass> klasses) {
-            // nop
-            return null;
-        }
-
-        public Void visitArrayType(ArrayType type, Set<Klass> klasses) {
-            try {
-                klasses.addAll(getKlass(type.elemType));
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-            return null;
-
-        }
-
-        public Void visitMethodType(MethodType type, Set<Klass> klasses) {
-            throw new InternalError("Unexpected type " + type);
-        }
-
-        public Void visitClassSigType(ClassSigType type, Set<Klass> klasses) {
-            try {
-                if (type.superclassType != null) {
-                    klasses.addAll(getKlass(type.superclassType));
-                }
-                if (type.superinterfaceTypes != null) {
-                    for (Type t : type.superinterfaceTypes) {
-                        klasses.addAll(getKlass(t));
-                    }
-                }
-                if (type.typeParamTypes != null) {
-                    for (Type t : type.typeParamTypes) {
-                        klasses.addAll(getKlass(t));
-                    }
-                }
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-            return null;
-        }
-
-        public Void visitClassType(ClassType type, Set<Klass> klasses) {
-            klasses.add(Klass.getKlass(type.getBinaryName()));
-            if (type.typeArgs != null) {
-                for (Type t : type.typeArgs) {
-                    try {
-                        klasses.addAll(getKlass(t));
-                    } catch (IOException ex) {
-                        throw new RuntimeException(ex);
-                    }
-                }
-            }
-            return null;
-
-        }
-
-        public Void visitTypeParamType(TypeParamType type, Set<Klass> klasses) {
-            try {
-                if (type.classBound != null) {
-                    klasses.addAll(getKlass(type.classBound));
-                }
-                if (type.interfaceBounds != null) {
-                    for (Type t : type.interfaceBounds) {
-                        klasses.addAll(getKlass(t));
-                    }
-                }
-
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-
-            return null;
-
-        }
-
-        public Void visitWildcardType(WildcardType type, Set<Klass> klasses) {
-            if (type.boundType != null) {
-                try {
-                    klasses.addAll(getKlass(type.boundType));
-                } catch (IOException ex) {
-                    throw new RuntimeException(ex);
-                }
-            }
-            return null;
-
-        }
-    };
-
-    private void printMethod(Method m) {
-        try {
-            System.out.println("parsing " + m.getName(classfile.constant_pool) + "(" +
-                    m.descriptor.getParameterTypes(classfile.constant_pool) + ") return type " +
-                    m.descriptor.getReturnType(classfile.constant_pool));
-
-        } catch (ConstantPoolException ex) {
-        } catch (InvalidDescriptor ex) {
-        }
-    }
-
-    private static StringBuilder appendWord(StringBuilder sb, String word) {
-        if (sb.length() > 0) {
-            sb.append(" ");
-        }
-        sb.append(word);
-        return sb;
-    }
-
-    private static String getFlag(AccessFlags flags) {
-        StringBuilder modifier = new StringBuilder();
-        if (flags.is(ACC_PUBLIC)) {
-            modifier.append("public");
-        }
-        if (flags.is(ACC_PRIVATE)) {
-            modifier.append("private");
-        }
-        if (flags.is(ACC_PROTECTED)) {
-            modifier.append("protected");
-        }
-        if (flags.is(ACC_STATIC)) {
-            appendWord(modifier, "static");
-        }
-        if (flags.is(ACC_FINAL)) {
-            appendWord(modifier, "final");
-        }
-        if (flags.is(ACC_SYNCHRONIZED)) {
-            // return "synchronized";
-        }
-        if (flags.is(0x80)) {
-            // return (t == Type.Field ? "transient" : null);
-            // return "transient";
-        }
-        if (flags.is(ACC_VOLATILE)) {
-            // return "volatile";
-        }
-        if (flags.is(ACC_NATIVE)) {
-            // return "native";
-        }
-        if (flags.is(ACC_ABSTRACT)) {
-            appendWord(modifier, "abstract");
-        }
-        if (flags.is(ACC_STRICT)) {
-            // return "strictfp";
-        }
-        if (flags.is(ACC_MODULE)) {
-            appendWord(modifier, "module");
-        }
-        return modifier.toString();
-    }
-
-    private Klass.Method toKlassMethod(Method m, Descriptor d) {
-        try {
-            ConstantPool cpool = classfile.constant_pool;
-            String methodname = m.getName(cpool);
-            StringBuilder sb = new StringBuilder();
-            sb.append(getFlag(m.access_flags));
-            if (methodname.equals("<init>")) {
-                String s = this_klass.getBasename() + d.getParameterTypes(cpool);
-                appendWord(sb, s);
-            } else if (methodname.equals("<clinit>")) {
-                // <clinit>
-                appendWord(sb, methodname);
-            } else {
-                String s = d.getReturnType(cpool) + " " + methodname + d.getParameterTypes(cpool);
-                appendWord(sb, s);
-            }
-            String signature = sb.toString().replace('/', '.');
-            return this_klass.getMethod(methodname, signature);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        } catch (InvalidDescriptor ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    Klass.Method parseMethod(Method m) {
-        AccessFlags flags = m.access_flags;
-        Descriptor d;
-        List<? extends Type> methodExceptions = null;
-        try {
-            ConstantPool cpool = classfile.constant_pool;
-            Klass.Method kmethod;
-            Signature_attribute sigAttr = (Signature_attribute) m.attributes.get(Attribute.Signature);
-            if (sigAttr == null) {
-                d = m.descriptor;
-                Set<Klass> types = parseDescriptor(d);
-
-                kmethod = toKlassMethod(m, d);
-                addMethodTypes(types, kmethod, flags);
-            } else {
-                Type.MethodType methodType;
-                Signature methodSig = sigAttr.getParsedSignature();
-                d = methodSig;
-                try {
-                    kmethod = toKlassMethod(m, d);
-                    methodType = (Type.MethodType) methodSig.getType(cpool);
-                    addMethodTypes(getKlass(methodType.returnType), kmethod, flags);
-                    if (methodType.paramTypes != null) {
-                        for (Type t : methodType.paramTypes) {
-                            addMethodTypes(getKlass(t), kmethod, flags);
-                        }
-                    }
-                    if (methodType.typeParamTypes != null) {
-                        for (Type t : methodType.typeParamTypes) {
-                            addMethodTypes(getKlass(t), kmethod, flags);
-                        }
-                    }
-
-                    methodExceptions = methodType.throwsTypes;
-                    if (methodExceptions != null) {
-                        if (methodExceptions.size() == 0) {
-                            methodExceptions = null;
-                        } else {
-                            for (Type t : methodExceptions) {
-                                addCheckedExceptionTypes(getKlass(t), kmethod, flags);
-                            }
-                        }
-                    }
-                } catch (ConstantPoolException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-
-            Attribute e_attr = m.attributes.get(Attribute.Exceptions);
-            if (e_attr != null && methodExceptions == null) {
-                // if there are generic exceptions, there must be erased exceptions
-                if (e_attr instanceof Exceptions_attribute) {
-                    Exceptions_attribute exceptions = (Exceptions_attribute) e_attr;
-                    for (int i = 0; i < exceptions.number_of_exceptions; i++) {
-                        String classname = checkClassName(exceptions.getException(i, classfile.constant_pool));
-                        if (classname.length() > 0 && buildDeps) {
-                            Klass to = Klass.getKlass(classname);
-                            ResolutionInfo resInfo = ResolutionInfo.resolvedCheckedException(this_klass, to, kmethod);
-                            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-                            this_klass.addDep(to, resInfo);
-                            to.addReferrer(this_klass, resInfo);
-                        }
-                    }
-                } else {
-                    throw new RuntimeException("Invalid attribute: " + e_attr);
-                }
-            }
-
-            Code_attribute c_attr = (Code_attribute) m.attributes.get(Attribute.Code);
-            if (c_attr != null) {
-                codeAttributeParser.parse(c_attr, kmethod);
-            }
-            kmethod.isAbstract = classfile.access_flags.is(ACC_ABSTRACT);
-            kmethod.setCodeLength(m.byteLength());
-
-            // parse annotation attributes
-            annotationParser.parseAttributes(m.attributes, kmethod);
-            return kmethod;
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    private void addFieldTypes(Set<Klass> types, String info, AccessFlags flags) {
-        if (types.isEmpty() || !buildDeps) {
-            return;
-        }
-
-        for (Klass to : types) {
-            ResolutionInfo resInfo = ResolutionInfo.resolvedField(this_klass, to, info);
-            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-            this_klass.addDep(to, resInfo);
-            to.addReferrer(this_klass, resInfo);
-        }
-    }
-
-    private void addReferencedTypes(Method m, Descriptor d, AccessFlags flags) {
-        Set<Klass> types = parseDescriptor(d);
-
-        Klass.Method method = toKlassMethod(m, d);
-        addMethodTypes(types, method, flags);
-    }
-
-    private void addMethodTypes(Set<Klass> types, Klass.Method method, AccessFlags flags) {
-        if (types.isEmpty() || !buildDeps) {
-            return;
-        }
-        for (Klass to : types) {
-            ResolutionInfo resInfo = ResolutionInfo.resolvedMethodSignature(this_klass, to, method);
-            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-            this_klass.addDep(to, resInfo);
-            to.addReferrer(this_klass, resInfo);
-        }
-    }
-
-    private void addCheckedExceptionTypes(Set<Klass> types, Klass.Method method, AccessFlags flags) {
-        if (types.isEmpty() || !buildDeps) {
-            return;
-        }
-        for (Klass to : types) {
-            ResolutionInfo resInfo = ResolutionInfo.resolvedCheckedException(this_klass, to, method);
-            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-            this_klass.addDep(to, resInfo);
-            to.addReferrer(this_klass, resInfo);
-        }
-    }
-
-    private Set<Klass> parseDescriptor(Descriptor d) {
-        Set<Klass> types = new TreeSet<Klass>();
-        try {
-            String desc = d.getValue(classfile.constant_pool);
-            int p = 0;
-            while (p < desc.length()) {
-                String type;
-                char ch;
-                switch (ch = desc.charAt(p++)) {
-                    case '(':
-                    case ')':
-                    case '[':
-                    case 'B':
-                    case 'C':
-                    case 'D':
-                    case 'F':
-                    case 'I':
-                    case 'J':
-                    case 'S':
-                    case 'Z':
-                    case 'V':
-                        continue;
-                    case 'L':
-                        int sep = desc.indexOf(';', p);
-                        if (sep == -1) {
-                            throw new RuntimeException("Invalid descriptor: " + (p - 1) + " " + desc);
-                        }
-                        type = checkClassName(desc.substring(p, sep));
-                        p = sep + 1;
-                        break;
-                    default:
-                        throw new RuntimeException("Invalid descriptor: " + (p - 1) + " " + desc);
-                }
-
-                if (!type.isEmpty() && buildDeps) {
-                    Klass to = Klass.getKlass(type);
-                    types.add(to);
-
-                }
-            }
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-        return types;
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-/**
- *
- * @author mchung
- */
-public class ClassPath {
-
-    public class FileInfo {
-
-        File file;
-        JarFile jarfile;
-        int classCount;
-        long filesize;
-
-        FileInfo(File f) throws IOException {
-            this.file = f;
-            this.classCount = 0;
-            if (file.getName().endsWith(".jar")) {
-                this.filesize = file.length();
-                jarfile = new JarFile(f);
-            }
-        }
-
-        File getFile() {
-            return file;
-        }
-
-        JarFile getJarFile() {
-            return jarfile;
-        }
-
-        String getName() throws IOException {
-            return file.getCanonicalPath();
-        }
-    }
-    private List<FileInfo> fileList = new ArrayList<FileInfo>();
-    private static ClassPath instance = new ClassPath();
-
-    static List<FileInfo> getFileInfos() {
-        return instance.fileList;
-    }
-
-    static ClassPath setJDKHome(String jdkhome) throws IOException {
-        List<File> files = new ArrayList<File>();
-        File jre = new File(jdkhome, "jre");
-        File lib = new File(jdkhome, "lib");
-        if (jre.exists() && jre.isDirectory()) {
-            listFiles(new File(jre, "lib"), ".jar", files);
-        } else if (lib.exists() && lib.isDirectory()) {
-            // either a JRE or a jdk build image
-            listFiles(lib, ".jar", files);
-
-            File classes = new File(jdkhome, "classes");
-            if (classes.exists() && classes.isDirectory()) {
-                // jdk build outputdir
-                instance.add(classes);
-            }
-        } else {
-            throw new RuntimeException("\"" + jdkhome + "\" not a JDK home");
-        }
-
-        for (File f : files) {
-            instance.add(f);
-        }
-        return instance;
-    }
-
-    static ClassPath setClassPath(String path) throws IOException {
-        if (path.endsWith(".class")) {
-            // one class file
-            File f = new File(path);
-            if (!f.exists()) {
-                throw new RuntimeException("Classfile \"" + f + "\" doesn't exist");
-            }
-
-            instance.add(f);
-        } else {
-            List<File> jarFiles = new ArrayList<File>();
-            String[] locs = path.split(File.pathSeparator);
-            for (String p : locs) {
-                File f = new File(p);
-                if (!f.exists()) {
-                    throw new RuntimeException("\"" + f + "\" doesn't exist");
-                }
-
-                if (f.isDirectory()) {
-                    instance.add(f);  // add the directory to look up .class files
-                    listFiles(f, ".jar", jarFiles);
-                } else if (p.endsWith(".jar")) {
-                    // jar files
-                    jarFiles.add(f);
-                } else {
-                    throw new RuntimeException("Invalid file \"" + f);
-                }
-            }
-            // add jarFiles if any
-            for (File f : jarFiles) {
-                instance.add(f);
-            }
-        }
-
-        return instance;
-    }
-
-    private void add(File f) throws IOException {
-        fileList.add(new FileInfo(f));
-    }
-
-    public static InputStream open(String pathname) throws IOException {
-        for (FileInfo fi : instance.fileList) {
-            if (fi.getName().endsWith(".jar")) {
-                String path = pathname.replace(File.separatorChar, '/');
-                JarEntry e = fi.jarfile.getJarEntry(path);
-                if (e != null) {
-                    return fi.jarfile.getInputStream(e);
-                }
-            } else if (fi.getFile().isDirectory()) {
-                File f = new File(fi.getFile(), pathname);
-                if (f.exists()) {
-                    return new FileInputStream(f);
-                }
-            } else if (fi.file.isFile()) {
-                if (fi.getName().endsWith(File.separator + pathname)) {
-                    return new FileInputStream(fi.file);
-                }
-            }
-        }
-        return null;
-    }
-
-    static ClassFileParser parserForClass(String classname) throws IOException {
-        String pathname = classname.replace('.', File.separatorChar) + ".class";
-
-        ClassFileParser cfparser = null;
-        for (FileInfo fi : instance.fileList) {
-            if (fi.getName().endsWith(".class")) {
-                if (fi.getName().endsWith(File.separator + pathname)) {
-                    cfparser = ClassFileParser.newParser(fi.getFile(), true);
-                    break;
-                }
-            } else if (fi.getName().endsWith(".jar")) {
-                JarEntry e = fi.jarfile.getJarEntry(classname.replace('.', '/') + ".class");
-                if (e != null) {
-                    cfparser = ClassFileParser.newParser(fi.jarfile.getInputStream(e), e.getSize(), true);
-                    break;
-                }
-            } else if (fi.getFile().isDirectory()) {
-                File f = new File(fi.getFile(), pathname);
-                if (f.exists()) {
-                    cfparser = ClassFileParser.newParser(f, true);
-                    break;
-                }
-            }
-        }
-        return cfparser;
-    }
-
-    public static void parseAllClassFiles() throws IOException {
-        instance.parseFiles();
-    }
-
-    private void parseFiles() throws IOException {
-        Set<Klass> classes = new HashSet<Klass>();
-
-        int count = 0;
-        for (FileInfo fi : fileList) {
-            // filter out public generated classes (i.e. not public API)
-            // javax.management.remote.rmi._RMIConnectionImpl_Tie
-            // javax.management.remote.rmi._RMIServerImpl_Tie
-            if (fi.getName().endsWith(".class")) {
-                parseClass(fi);
-            } else if (fi.getName().endsWith(".jar")) {
-                Enumeration<JarEntry> entries = fi.jarfile.entries();
-                while (entries.hasMoreElements()) {
-                    JarEntry e = entries.nextElement();
-                    if (e.getName().endsWith(".class")) {
-                        ClassFileParser cfparser = ClassFileParser.newParser(fi.jarfile.getInputStream(e), e.getSize(), true);
-                        cfparser.parseDependency(false);
-                        fi.classCount++;
-                    } else if (!e.isDirectory() && ResourceFile.isResource(e.getName())) {
-                        ResourceFile.addResource(e.getName(), fi.jarfile.getInputStream(e));
-                    }
-                }
-            } else if (fi.getFile().isDirectory()) {
-                List<File> files = new ArrayList<File>();
-                listFiles(fi.getFile(), "", files);
-                for (File f : files) {
-                    if (f.getName().endsWith(".class")) {
-                        parseClass(fi, f);
-                    } else if (!f.isDirectory() && ResourceFile.isResource(f.getCanonicalPath())) {
-                        String pathname = f.getCanonicalPath();
-                        String dir = fi.getName();
-                        if (!pathname.startsWith(dir)) {
-                            throw new RuntimeException("Incorrect pathname " + pathname);
-                        }
-                        String name = pathname.substring(dir.length() + 1, pathname.length());
-                        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
-                        try {
-                            ResourceFile.addResource(name, in);
-                        } finally {
-                            in.close();
-                        }
-                    }
-                }
-            } else {
-                // should not reach here
-                throw new RuntimeException("Unexpected class path: " + fi.getFile());
-            }
-        }
-    }
-
-    private void parseClass(FileInfo fi) throws IOException {
-        parseClass(fi, fi.getFile());
-    }
-
-    private void parseClass(FileInfo fi, File f) throws IOException {
-        ClassFileParser cfparser = ClassFileParser.newParser(f, true);
-        cfparser.parseDependency(false);
-        fi.classCount++;
-        // need to update the filesize for this directory
-        fi.filesize += fi.getFile().length();
-
-    }
-
-    public static void listFiles(File path, String suffix, List<File> result) {
-        if (path.isDirectory()) {
-            File[] children = path.listFiles();
-            for (File c : children) {
-                listFiles(c, suffix, result);
-            }
-
-        } else {
-            if (suffix.isEmpty() || path.getName().endsWith(suffix)) {
-                result.add(path);
-            }
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import com.sun.classanalyzer.Klass.Method;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.Instruction.*;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class CodeAttributeParser {
-    private final ClassFileParser cfparser;
-    private final ConstantPool cpool;
-    private final ConstantPoolParser constantPoolParser;
-
-
-    static final Map<String, Set<Method>> runtimeReferences =
-            new HashMap<String, Set<Method>>();
-
-
-    CodeAttributeParser(ClassFileParser parser) {
-        this.cfparser = parser;
-        this.cpool = cfparser.classfile.constant_pool;
-        this.constantPoolParser = cfparser.constantPoolParser;
-    }
-
-    static boolean parseCodeAttribute = false; // by default don't parse code attribute
-    static void setParseCodeAttribute(boolean newValue) {
-        parseCodeAttribute = newValue;
-    }
-
-    void parse(Code_attribute attr, Klass.Method method) {
-        if (!parseCodeAttribute) {
-            return;
-        }
-
-        for (Instruction instr : attr.getInstructions()) {
-            try {
-                instr.accept(instructionVisitor, method);
-            } catch (ArrayIndexOutOfBoundsException e) {
-                throw new RuntimeException("error at or after byte " + instr.getPC());
-            }
-
-        }
-
-        if (attr.exception_table_langth > 0) {
-            for (int i = 0; i <
-                    attr.exception_table.length; i++) {
-                Code_attribute.Exception_data handler = attr.exception_table[i];
-                int catch_type = handler.catch_type;
-                if (catch_type > 0) {
-                    addMethodReference(catch_type, method);
-                }
-
-            }
-        }
-
-    }
-
-
-    private void addMethodReference(int index, Klass.Method m) {
-        String method = constantPoolParser.getMethodName(index);
-
-        if (method != null &&
-               (method.equals("java.lang.Class.forName") ||
-                method.equals("java.lang.Class.loadClass") ||
-                method.startsWith("java.util.ServiceLoader.load") ||
-                method.equals("sun.misc.Service.providers"))) {
-            Set<Method> refs = runtimeReferences.get(method);
-            if (refs == null) {
-                refs = new TreeSet<Method>();
-                runtimeReferences.put(method, refs);
-            }
-            refs.add(m);
-        }
-    }
-
-    Instruction.KindVisitor<Void, Klass.Method> instructionVisitor =
-            new Instruction.KindVisitor<Void, Klass.Method>() {
-
-                public Void visitNoOperands(Instruction instr, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitArrayType(Instruction instr, TypeKind kind, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitBranch(Instruction instr, int offset, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitConstantPoolRef(Instruction instr, int index, Klass.Method m) {
-                    addMethodReference(index, m);
-                    return null;
-                }
-
-                public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Klass.Method m) {
-                    addMethodReference(index, m);
-                    return null;
-                }
-
-                public Void visitLocal(Instruction instr, int index, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitLocalAndValue(Instruction instr, int index, int value, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitValue(Instruction instr, int value, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitUnknown(Instruction instr, Klass.Method m) {
-                    return null;
-                }
-            };
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ConstantPoolAnalyzer {
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            }
-        }
-        if (jdkhome == null) {
-            usage();
-        }
-        ClassPath.setJDKHome(jdkhome);
-        ClassPath.parseAllClassFiles();
-    }
-
-    private static void usage() {
-        System.out.println("Usage: ConstantPoolAnalyzer <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-cpath <classpath> where classes and jars will be parsed");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,377 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.ConstantPool.*;
-import static com.sun.tools.classfile.ConstantPool.*;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ConstantPoolParser {
-
-    private final ClassFileParser cfparser;
-    private final StringValueVisitor visitor;
-    private final ConstantPool cpool;
-
-    ConstantPoolParser(ClassFileParser parser) {
-        this.cfparser = parser;
-        this.cpool = cfparser.classfile.constant_pool;
-        this.visitor = new StringValueVisitor();
-    }
-
-    public String stringValue(CPInfo cpInfo) {
-        return visitor.visit(cpInfo);
-    }
-
-    public String stringValue(int constant_pool_index) {
-        try {
-            return stringValue(cpool.get(constant_pool_index));
-        } catch (ConstantPool.InvalidIndex e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public void parseDependency() {
-        ConstantPool.Visitor<Integer, Void> v = new ConstantPool.Visitor<Integer, Void>() {
-
-            public Integer visitClass(CONSTANT_Class_info info, Void p) {
-                try {
-                    String classname = cfparser.checkClassName(info.getName());
-                    if (classname.isEmpty()) {
-                        return 1;
-                    }
-
-                    Klass from = cfparser.this_klass;
-                    Klass to = Klass.getKlass(classname);
-                    ResolutionInfo resInfo = ResolutionInfo.resolvedConstantPool(from, to, info.name_index);
-
-                    from.addDep(to, resInfo);
-                    to.addReferrer(from, resInfo);
-                } catch (ConstantPoolException ex) {
-                    throw new RuntimeException(ex);
-                }
-                return 1;
-            }
-
-            public Integer visitDouble(CONSTANT_Double_info info, Void p) {
-                // skip
-                return 2;
-            }
-
-            public Integer visitFieldref(CONSTANT_Fieldref_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitFloat(CONSTANT_Float_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitInteger(CONSTANT_Integer_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitLong(CONSTANT_Long_info info, Void p) {
-                // skip
-                return 2;
-            }
-
-            public Integer visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitMethodref(CONSTANT_Methodref_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitString(CONSTANT_String_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitUtf8(CONSTANT_Utf8_info info, Void p) {
-                // skip
-                return 1;
-            }
-        };
-        int cpx = 1;
-        while (cpx < cpool.size()) {
-            try {
-                CPInfo cpInfo = cpool.get(cpx);
-                cpx += cpInfo.accept(v, null);
-            } catch (ConstantPool.InvalidIndex ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-
-    int getTag(int index) {
-        try {
-            return cpool.get(index).getTag();
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    String getDescriptor(int index) {
-        CPInfo cpInfo;
-        try {
-            cpInfo = cpool.get(index);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-
-        int tag = cpInfo.getTag();
-        switch (tag) {
-            case CONSTANT_Methodref:
-            case CONSTANT_InterfaceMethodref:
-            case CONSTANT_Fieldref:
-                // simplify references within this class
-                CPRefInfo ref = (CPRefInfo) cpInfo;
-                try {
-                    return ref.getNameAndTypeInfo().getType();
-                } catch (ConstantPoolException ex) {
-                }
-        }
-        return stringValue(cpInfo);
-    }
-
-    String getMethodName(int index) {
-        try {
-            CPInfo cpInfo = cpool.get(index);
-            if (cpInfo.getTag() == CONSTANT_Methodref ||
-                    cpInfo.getTag() == CONSTANT_InterfaceMethodref) {
-
-                // simplify references within this class
-                CPRefInfo ref = (CPRefInfo) cpInfo;
-                String classname;
-                if (ref.class_index == cfparser.classfile.this_class) {
-                    classname = cfparser.this_klass.getClassName();
-                } else {
-                    classname = cfparser.checkClassName(ref.getClassName()).replace('/', '.');
-                }
-                String methodname = ref.getNameAndTypeInfo().getName();
-                return classname + "." + methodname;
-            } else {
-                return null;
-            }
-        } catch (InvalidIndex ex) {
-            throw new RuntimeException(ex);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-
-    }
-
-    class StringValueVisitor implements ConstantPool.Visitor<String, Void> {
-
-        public StringValueVisitor() {
-        }
-
-        public String visit(CPInfo info) {
-            return info.accept(this, null);
-        }
-
-        public String visitClass(CONSTANT_Class_info info, Void p) {
-            return getCheckedName(info);
-        }
-
-        String getCheckedName(CONSTANT_Class_info info) {
-            try {
-                return checkName(info.getName());
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        public String visitDouble(CONSTANT_Double_info info, Void p) {
-            return info.value + "d";
-        }
-
-        public String visitFieldref(CONSTANT_Fieldref_info info, Void p) {
-            return visitRef(info, p);
-        }
-
-        public String visitFloat(CONSTANT_Float_info info, Void p) {
-            return info.value + "f";
-        }
-
-        public String visitInteger(CONSTANT_Integer_info info, Void p) {
-            return String.valueOf(info.value);
-        }
-
-        public String visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
-            return visitRef(info, p);
-        }
-
-        public String visitLong(CONSTANT_Long_info info, Void p) {
-            return info.value + "l";
-        }
-
-        public String visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-            return getCheckedName(info) + ":" + getType(info);
-        }
-
-        String getCheckedName(CONSTANT_NameAndType_info info) {
-            try {
-                return checkName(info.getName());
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        String getType(CONSTANT_NameAndType_info info) {
-            try {
-                return info.getType();
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        public String visitMethodref(CONSTANT_Methodref_info info, Void p) {
-            return visitRef(info, p);
-        }
-
-        public String visitString(CONSTANT_String_info info, Void p) {
-            try {
-                int string_index = info.string_index;
-                return cpool.getUTF8Info(string_index).accept(this, p);
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        public String visitUtf8(CONSTANT_Utf8_info info, Void p) {
-            String s = info.value;
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0; i < s.length(); i++) {
-                char c = s.charAt(i);
-                switch (c) {
-                    case '\t':
-                        sb.append('\\').append('t');
-                        break;
-                    case '\n':
-                        sb.append('\\').append('n');
-                        break;
-                    case '\r':
-                        sb.append('\\').append('r');
-                        break;
-                    case '\"':
-                        sb.append('\\').append('\"');
-                        break;
-                    default:
-                        sb.append(c);
-                }
-            }
-            return sb.toString();
-        }
-
-        String visitRef(CPRefInfo info, Void p) {
-            String cn = getCheckedClassName(info);
-            String nat;
-            try {
-                nat = info.getNameAndTypeInfo().accept(this, p);
-            } catch (ConstantPoolException e) {
-                nat = e.getMessage();
-            }
-            return cn + "." + nat;
-        }
-
-        String getCheckedClassName(CPRefInfo info) {
-            try {
-                return checkName(info.getClassName());
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-    /* If name is a valid binary name, return it; otherwise quote it. */
-
-    private static String checkName(String name) {
-        if (name == null) {
-            return "null";
-        }
-
-        int len = name.length();
-        if (len == 0) {
-            return "\"\"";
-        }
-
-        int cc = '/';
-        int cp;
-        for (int k = 0; k < len; k += Character.charCount(cp)) {
-            cp = name.codePointAt(k);
-            if ((cc == '/' && !Character.isJavaIdentifierStart(cp)) || (cp != '/' && !Character.isJavaIdentifierPart(cp))) {
-                return "\"" + name + "\"";
-            }
-            cc = cp;
-        }
-        return name;
-    }
-
-    String tagName(int index) {
-        try {
-            int tag = cpool.get(index).getTag();
-            switch (tag) {
-                case CONSTANT_Utf8:
-                    return "Utf8";
-                case CONSTANT_Integer:
-                    return "int";
-                case CONSTANT_Float:
-                    return "float";
-                case CONSTANT_Long:
-                    return "long";
-                case CONSTANT_Double:
-                    return "double";
-                case CONSTANT_Class:
-                    return "class";
-                case CONSTANT_String:
-                    return "String";
-                case CONSTANT_Fieldref:
-                    return "Field";
-                case CONSTANT_Methodref:
-                    return "Method";
-                case CONSTANT_InterfaceMethodref:
-                    return "InterfaceMethod";
-                case CONSTANT_NameAndType:
-                    return "NameAndType";
-                default:
-                    return "(unknown tag)";
-            }
-        } catch (InvalidIndex e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.List;
-
-/**
- * Config file specifying additional dependency
- * Each line consists of:
- * <tag> <classname> -> <value>
- * where <tag> can be:
- *    @ClassForName and <value> is its dependency
- *    @Provider and <value> is the service name
- *    @Providers and <value> is the list of the service names
- *
- * @author Mandy Chung
- */
-public class DependencyConfig {
-    private DependencyConfig() {
-    }
-
-    static void parse(List<String> configs) throws IOException {
-        for (String s : configs) {
-            parse(s);
-        }
-    }
-
-    private static void parse(String config) throws IOException {
-        // parse configuration file
-        FileInputStream in = new FileInputStream(config);
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line;
-            int lineNumber = 0;
-            String type = null;
-            while ((line = reader.readLine()) != null) {
-                lineNumber++;
-                line = line.trim();
-                if (line.length() == 0 || line.charAt(0) == '#') {
-                    continue;
-                }
-                if (line.charAt(0) == '@') {
-                    if (AnnotatedDependency.isValidType(line)) {
-                        type = line;
-                        continue;
-                    } else {
-                        throw new RuntimeException(config + ", line " +
-                            lineNumber + ", invalid annotation type.");
-                    }
-                }
-                String[] s = line.split("\\s+");
-                if (s.length < 3 || !s[1].equals("->")) {
-                    throw new RuntimeException(config + ", line " +
-                            lineNumber + ", is malformed");
-                }
-                String classname = s[0].trim();
-                String value = s[2].trim();
-
-                Klass k = Klass.findKlass(classname);
-                if (k == null) {
-                    // System.out.println("Warning: " + classname + " cannot be found");
-                    continue;
-                }
-                AnnotatedDependency dep = AnnotatedDependency.newAnnotatedDependency(type, value, k);
-                if (dep == null) {
-                    throw new RuntimeException(config + ", line " +
-                            lineNumber + ", is malformed. Fail to construct the dependency.");
-                }
-            }
-
-        } finally {
-            in.close();
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,357 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import com.sun.tools.classfile.AccessFlags;
-
-/**
- *
- * @author Mandy Chung
- */
-public class Klass implements Comparable<Klass> {
-    private final String classname;
-    private final String packagename;
-    private Module module;
-    private boolean isJavaLangObject;
-    private String[] paths;
-    private Map<String, Set<Method>> methods;
-    private AccessFlags accessFlags;
-    private long filesize;
-
-    private SortedMap<Klass, Set<ResolutionInfo>> deps;
-    private SortedMap<Klass, Set<ResolutionInfo>> referrers;
-    private List<AnnotatedDependency> annotatedDeps;
-    private Set<String> classForNameRefs;
-
-    private Klass(String classname) {
-        this.classname = classname;
-        this.paths = classname.replace('.', '/').split("/");
-        this.isJavaLangObject = classname.equals("java.lang.Object");
-        this.deps = new TreeMap<Klass, Set<ResolutionInfo>>();
-        this.referrers = new TreeMap<Klass, Set<ResolutionInfo>>();
-        this.methods = new HashMap<String, Set<Method>>();
-        this.annotatedDeps = new ArrayList<AnnotatedDependency>();
-        this.classForNameRefs = new TreeSet<String>();
-
-        int pos = classname.lastIndexOf('.');
-        this.packagename = (pos > 0) ? classname.substring(0, pos) : "<unnamed>";
-    }
-
-    String getBasename() {
-        return paths[paths.length - 1];
-    }
-
-    String getClassName() {
-        return classname;
-    }
-
-    String getPackageName() {
-        return packagename;
-    }
-
-    String getClassFilePathname() {
-        StringBuilder sb = new StringBuilder(paths[0]);
-        for (int i = 1; i < paths.length; i++) {
-            String p = paths[i];
-            sb.append(File.separator).append(p);
-        }
-        return sb.append(".class").toString();
-    }
-
-    boolean isPublic() {
-        return accessFlags == null || accessFlags.is(AccessFlags.ACC_PUBLIC);
-    }
-
-    Module getModule() {
-        return module;
-    }
-
-    void setModule(Module m) {
-        if (module != null) {
-            throw new RuntimeException("Module for " + this + " already set");
-        }
-        this.module = m;
-    }
-
-    Set<Klass> getReferencedClasses() {
-        return deps.keySet();
-    }
-
-    Set<Klass> getReferencingClasses() {
-        return referrers.keySet();
-    }
-
-    void setAccessFlags(int flags) {
-        this.accessFlags = new AccessFlags(flags);
-    }
-
-    void setFileSize(long size) {
-        this.filesize = size;
-    }
-
-    long getFileSize() {
-        return this.filesize;
-    }
-
-    boolean exists() {
-        return filesize > 0;
-    }
-
-    boolean skip(Klass k) {
-        // skip if either class is a root or same class
-        return k.isJavaLangObject || this == k || k.classname.equals(classname);
-    }
-
-    void addDep(Method callee, ResolutionInfo resInfo) {
-        addDep(callee.getKlass(), resInfo);
-    }
-
-    void addDep(Klass ref, ResolutionInfo ri) {
-        if (skip(ref)) {
-            return;
-        }
-        Set<ResolutionInfo> resInfos;
-        if (!deps.containsKey(ref)) {
-            resInfos = new TreeSet<ResolutionInfo>();
-            deps.put(ref, resInfos);
-        } else {
-            resInfos = deps.get(ref);
-        }
-        resInfos.add(ri);
-    }
-
-    void addReferrer(Method caller, ResolutionInfo resInfo) {
-        addReferrer(caller.getKlass(), resInfo);
-    }
-
-    void addReferrer(Klass k, ResolutionInfo ri) {
-        if (skip(k)) {
-            return;
-        }
-        Set<ResolutionInfo> resInfos;
-        if (!referrers.containsKey(k)) {
-            resInfos = new TreeSet<ResolutionInfo>();
-            referrers.put(k, resInfos);
-        } else {
-            resInfos = referrers.get(k);
-        }
-        resInfos.add(ri);
-    }
-
-    Method getMethod(String name) {
-        return getMethod(name, "");
-    }
-
-    Method getMethod(String name, String signature) {
-        Set<Method> set;
-        if (methods.containsKey(name)) {
-            set = methods.get(name);
-        } else {
-            set = new TreeSet<Method>();
-            methods.put(name, set);
-        }
-
-        for (Method m : set) {
-            if (m.getName().equals(name) && m.getSignature().equals(signature)) {
-                return m;
-            }
-        }
-        Method m = new Method(this, name, signature);
-        set.add(m);
-        return m;
-    }
-
-    @Override
-    public String toString() {
-        return classname;
-    }
-
-    @Override
-    public int compareTo(Klass o) {
-        return classname.compareTo(o.classname);
-    }
-
-    void addAnnotatedDep(AnnotatedDependency dep) {
-        annotatedDeps.add(dep);
-    }
-
-    void addClassForNameReference(String method) {
-        classForNameRefs.add(method);
-    }
-
-    List<AnnotatedDependency> getAnnotatedDeps() {
-        return annotatedDeps;
-    }
-
-    private static Map<String, Klass> classes = new TreeMap<String, Klass>();
-    static Set<Klass> getAllClasses() {
-        return new TreeSet<Klass>(classes.values());
-    }
-
-    static Klass findKlassFromPathname(String filename) {
-        String name = filename;
-        if (filename.endsWith(".class")) {
-            name = filename.substring(0, filename.length() - 6);
-        }
-
-        // trim ".class"
-        name = name.replace('/', '.');
-        for (Klass k : classes.values()) {
-            if (name.endsWith(k.getClassName())) {
-                return k;
-            }
-        }
-        return null;
-    }
-
-    static Klass findKlass(String classname) {
-        return classes.get(classname);
-    }
-
-    static Klass getKlass(String name) {
-        Klass k;
-        String classname = name.replace('/', '.');
-        if (classname.charAt(classname.length() - 1) == ';') {
-            classname = classname.substring(0, classname.length() - 1);
-        }
-        if (classes.containsKey(classname)) {
-            k = classes.get(classname);
-        } else {
-            k = new Klass(classname);
-            classes.put(classname, k);
-        }
-        return k;
-    }
-
-    public class Method implements Comparable<Method> {
-
-        private final Klass k;
-        private final String method;
-        private final String signature;
-        private long codeLength;
-        // non-primitive types only
-        private final List<Klass> argTypes;
-        private final Klass returnType;
-        boolean isAbstract = false;
-        boolean marked = false;
-
-        public Method(Klass k, String method, String signature) {
-            this(k, method, signature, null, null);
-        }
-
-        public Method(Klass k, String method, String signature, Klass returnType, List<Klass> argTypes) {
-            this.k = k;
-            this.method = method;
-            this.signature = signature;
-            this.argTypes = argTypes;
-            this.returnType = returnType;
-            this.codeLength = 0;
-        }
-
-        public Klass getKlass() {
-            return k;
-        }
-
-        public String getName() {
-            return method;
-        }
-
-        public String getSignature() {
-            return signature;
-        }
-
-        public Klass getReturnType() {
-            return returnType;
-        }
-
-        public List<Klass> argTypes() {
-            return argTypes;
-        }
-
-        public void setCodeLength(long len) {
-            this.codeLength = len;
-        }
-
-        public long getCodeLength() {
-            return codeLength;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (o instanceof Method) {
-                return compareTo((Method) o) == 0;
-            } else {
-                return false;
-            }
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 3;
-            hash = 71 * hash + (this.k != null ? this.k.hashCode() : 0);
-            hash = 71 * hash + (this.method != null ? this.method.hashCode() : 0);
-            return hash;
-        }
-
-        @Override
-        public String toString() {
-            if (signature.isEmpty()) {
-                return k.classname + "." + method;
-            } else {
-                return signature;
-            }
-        }
-
-        public String toHtmlString() {
-            return toString().replace("<", "&lt;").replace(">", "&gt;");
-        }
-
-        boolean isClinit() {
-            return method.equals("<clinit>");
-        }
-
-        public int compareTo(Method m) {
-            if (k == m.getKlass()) {
-                if (method.equals(m.method)) {
-                    return signature.compareTo(m.signature);
-                } else {
-                    return method.compareTo(m.method);
-                }
-            } else {
-                return k.compareTo(m.getKlass());
-            }
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,693 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import com.sun.classanalyzer.AnnotatedDependency.OptionalDependency;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayDeque;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class Module implements Comparable<Module> {
-
-    private static Map<String, Module> modules = new LinkedHashMap<String, Module>();
-
-    public static Module addModule(ModuleConfig config) {
-        String name = config.module;
-        if (modules.containsKey(name)) {
-            throw new RuntimeException("module \"" + name + "\" already exists");
-        }
-
-        Module m = new Module(config);
-        modules.put(name, m);
-        return m;
-    }
-
-    public static Module findModule(String name) {
-        return modules.get(name);
-    }
-
-    static Collection<Module> getAllModules() {
-        return Collections.unmodifiableCollection(modules.values());
-    }
-    private final String name;
-    private final ModuleConfig config;
-    private final Set<Klass> classes;
-    private final Set<ResourceFile> resources;
-    private final Set<Reference> unresolved;
-    private final Set<Dependency> dependents;
-    private final Map<String, PackageInfo> packages;
-    private final Set<Module> members;
-    private Module group;
-    private boolean isBaseModule;
-
-    private Module(ModuleConfig config) {
-        this.name = config.module;
-        this.isBaseModule = config.isBase;
-        this.classes = new TreeSet<Klass>();
-        this.resources = new TreeSet<ResourceFile>();
-        this.config = config;
-        this.unresolved = new HashSet<Reference>();
-        this.dependents = new TreeSet<Dependency>();
-        this.packages = new TreeMap<String, PackageInfo>();
-        this.members = new TreeSet<Module>();
-        this.group = this; // initialize to itself
-    }
-
-    String name() {
-        return name;
-    }
-
-    Module group() {
-        return group;
-    }
-
-    boolean isBase() {
-        return isBaseModule;
-    }
-
-    Set<Module> members() {
-        return members;
-    }
-
-    boolean contains(Klass k) {
-        return k != null && classes.contains(k);
-    }
-
-    boolean isEmpty() {
-        return classes.isEmpty() && resources.isEmpty();
-    }
-
-    /**
-     * Returns an Iterable of Dependency, only one for each dependent
-     * module of the strongest dependency (i.e.
-     * hard static > hard dynamic > optional static > optional dynamic
-     */
-    Iterable<Dependency> dependents() {
-        Map<Module, Dependency> deps = new LinkedHashMap<Module, Dependency>();
-        for (Dependency dep : dependents) {
-            Dependency d = deps.get(dep.module);
-            if (d == null || dep.compareTo(d) > 0) {
-                deps.put(dep.module, dep);
-            }
-        }
-        return deps.values();
-    }
-
-    @Override
-    public int compareTo(Module o) {
-        if (o == null) {
-            return -1;
-        }
-        return name.compareTo(o.name);
-    }
-
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    void addKlass(Klass k) {
-        classes.add(k);
-        k.setModule(this);
-
-        // update package statistics
-        String pkg = k.getPackageName();
-        PackageInfo pkginfo = packages.get(pkg);
-        if (pkginfo == null) {
-            pkginfo = new PackageInfo(pkg);
-            packages.put(pkg, pkginfo);
-        }
-        if (k.exists()) {
-            // only count the class that is parsed
-            pkginfo.add(k.getFileSize());
-        }
-    }
-
-    void addResource(ResourceFile res) {
-        resources.add(res);
-        res.setModule(this);
-    }
-
-    void processRootsAndReferences() {
-        // start with the root set
-        Deque<Klass> pending = new ArrayDeque<Klass>();
-        for (Klass k : Klass.getAllClasses()) {
-            if (k.getModule() != null) {
-                continue;
-            }
-            String classname = k.getClassName();
-            if (config.matchesRoot(classname) && !config.isExcluded(classname)) {
-                addKlass(k);
-                pending.add(k);
-            }
-        }
-
-        // follow all references
-        Klass k;
-        while ((k = pending.poll()) != null) {
-            if (!classes.contains(k)) {
-                addKlass(k);
-            }
-            for (Klass other : k.getReferencedClasses()) {
-                Module otherModule = other.getModule();
-                if (otherModule != null && otherModule != this) {
-                    // this module is dependent on otherModule
-                    addDependency(k, other);
-                    continue;
-                }
-
-                if (!classes.contains(other)) {
-                    if (config.isExcluded(other.getClassName())) {
-                        // reference to an excluded class
-                        unresolved.add(new Reference(k, other));
-                    } else {
-                        pending.add(other);
-                    }
-                }
-            }
-        }
-
-        // add other matching classes that don't require dependency analysis
-        for (Klass c : Klass.getAllClasses()) {
-            if (c.getModule() == null) {
-                String classname = c.getClassName();
-                if (config.matchesIncludes(classname) && !config.isExcluded(classname)) {
-                    addKlass(c);
-                    // dependencies
-                    for (Klass other : c.getReferencedClasses()) {
-                        Module otherModule = other.getModule();
-                        if (otherModule == null) {
-                            unresolved.add(new Reference(c, other));
-                        } else {
-                            if (otherModule != this) {
-                                // this module is dependent on otherModule
-                                addDependency(c, other);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-
-        // add other matching classes that don't require dependency analysis
-        for (ResourceFile res : ResourceFile.getAllResources()) {
-            if (res.getModule() == null) {
-                String name = res.getName();
-                if (config.matchesIncludes(name) && !config.isExcluded(name)) {
-                    addResource(res);
-                }
-            }
-        }
-    }
-
-    void addDependency(Klass from, Klass to) {
-        Dependency dep = new Dependency(from, to);
-        dependents.add(dep);
-    }
-
-    void fixupDependencies() {
-        // update dependencies for classes that were allocated to modules after
-        // this module was processed.
-        for (Reference ref : unresolved) {
-            Module m = ref.referree().getModule();
-            if (m == null || m != this) {
-                addDependency(ref.referrer, ref.referree);
-            }
-        }
-
-        fixupAnnotatedDependencies();
-    }
-
-    private void fixupAnnotatedDependencies() {
-        // add dependencies that this klass may depend on due to the AnnotatedDependency
-        dependents.addAll(AnnotatedDependency.getDependencies(this));
-    }
-
-    boolean isModuleDependence(Klass k) {
-        Module m = k.getModule();
-        return m == null || (!classes.contains(k) && !m.isBase());
-    }
-
-    Module getModuleDependence(Klass k) {
-        if (isModuleDependence(k)) {
-            Module m = k.getModule();
-            if (group == this && m != null) {
-                // top-level module
-                return m.group;
-            } else {
-                return m;
-            }
-        }
-        return null;
-    }
-
-    <P> void visit(Set<Module> visited, Visitor<P> visitor, P p) {
-        if (!visited.contains(this)) {
-            visited.add(this);
-            visitor.preVisit(this, p);
-            for (Module m : members) {
-                m.visit(visited, visitor, p);
-                visitor.postVisit(this, m, p);
-            }
-        } else {
-            throw new RuntimeException("Cycle detected: module " + this.name);
-        }
-    }
-
-    void addMember(Module m) {
-        // merge class list
-        for (Klass k : m.classes) {
-            classes.add(k);
-        }
-
-        // merge resource list
-        for (ResourceFile res : m.resources) {
-            resources.add(res);
-        }
-
-        // merge the package statistics
-        for (PackageInfo pinfo : m.getPackageInfos()) {
-            String packageName = pinfo.pkgName;
-            PackageInfo pkginfo = packages.get(packageName);
-            if (pkginfo == null) {
-                pkginfo = new PackageInfo(packageName);
-                packages.put(packageName, pkginfo);
-            }
-            pkginfo.add(pinfo);
-        }
-    }
-
-    static void buildModuleMembers() {
-        // set up module member relationship
-        for (Module m : modules.values()) {
-            m.group = m; // initialize to itself
-            for (String name : m.config.members()) {
-                Module member = modules.get(name);
-                if (member == null) {
-                    throw new RuntimeException("module \"" + name + "\" doesn't exist");
-                }
-                m.members.add(member);
-            }
-        }
-
-        // set up the top-level module
-        Visitor<Module> groupSetter = new Visitor<Module>() {
-
-            public void preVisit(Module m, Module p) {
-                m.group = p;
-                if (p.isBaseModule) {
-                    // all members are also base
-                    m.isBaseModule = true;
-                }
-            }
-
-            public void postVisit(Module m, Module child, Module p) {
-                // nop - breadth-first search
-            }
-        };
-
-        // propagate the top-level module to all its members
-        for (Module p : modules.values()) {
-            for (Module m : p.members) {
-                if (m.group == m) {
-                    m.visit(new TreeSet<Module>(), groupSetter, p);
-                }
-            }
-        }
-
-        Visitor<Module> mergeClassList = new Visitor<Module>() {
-
-            public void preVisit(Module m, Module p) {
-                // nop - depth-first search
-            }
-
-            public void postVisit(Module m, Module child, Module p) {
-                m.addMember(child);
-            }
-        };
-
-        Set<Module> visited = new TreeSet<Module>();
-        for (Module m : modules.values()) {
-            if (m.group() == m) {
-                if (m.members().size() > 0) {
-                    // merge class list from all its members
-                    m.visit(visited, mergeClassList, m);
-                }
-
-                // clear the dependencies before fixup
-                m.dependents.clear();
-
-                // fixup dependencies
-                for (Klass k : m.classes) {
-                    for (Klass other : k.getReferencedClasses()) {
-                        if (m.isModuleDependence(other)) {
-                            // this module is dependent on otherModule
-                            m.addDependency(k, other);
-                        }
-                    }
-                }
-
-                // add dependencies that this klass may depend on due to the AnnotatedDependency
-                m.fixupAnnotatedDependencies();
-            }
-        }
-    }
-
-    class PackageInfo implements Comparable {
-
-        final String pkgName;
-        int count;
-        long filesize;
-
-        PackageInfo(String name) {
-            this.pkgName = name;
-            this.count = 0;
-            this.filesize = 0;
-        }
-
-        void add(PackageInfo pkg) {
-            this.count += pkg.count;
-            this.filesize += pkg.filesize;
-        }
-
-        void add(long size) {
-            count++;
-            filesize += size;
-
-        }
-
-        @Override
-        public int compareTo(Object o) {
-            return pkgName.compareTo(((PackageInfo) o).pkgName);
-        }
-    }
-
-    Set<PackageInfo> getPackageInfos() {
-        return new TreeSet<PackageInfo>(packages.values());
-    }
-
-    void printSummaryTo(String output) throws IOException {
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            long total = 0L;
-            int count = 0;
-            writer.format("%10s\t%10s\t%s\n", "Bytes", "Classes", "Package name");
-            for (String pkg : packages.keySet()) {
-                PackageInfo info = packages.get(pkg);
-                if (info.count > 0) {
-                    writer.format("%10d\t%10d\t%s\n", info.filesize, info.count, pkg);
-                    total += info.filesize;
-                    count += info.count;
-                }
-            }
-
-            writer.format("\nTotal: %d bytes (uncompressed) %d classes\n", total, count);
-        } finally {
-            writer.close();
-        }
-
-    }
-
-    void printClassListTo(String output) throws IOException {
-        // no file created if the module doesn't have any class nor resource
-        if (isEmpty()) {
-            return;
-        }
-
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            for (Klass c : classes) {
-                if (c.exists()) {
-                    writer.format("%s\n", c.getClassFilePathname());
-                } else {
-                    trace("%s in module %s missing\n", c, this);
-                }
-            }
-
-        } finally {
-            writer.close();
-        }
-    }
-
-    void printResourceListTo(String output) throws IOException {
-        // no file created if the module doesn't have any resource file
-        if (resources.isEmpty()) {
-            return;
-        }
-
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            for (ResourceFile res : resources) {
-                writer.format("%s\n", res.getPathname());
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    void printDependenciesTo(String output, boolean showDynamic) throws IOException {
-        // no file created if the module doesn't have any class
-        if (isEmpty()) {
-            return;
-        }
-
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            // classes that this klass may depend on due to the AnnotatedDependency
-            Map<Reference, Set<AnnotatedDependency>> annotatedDeps = AnnotatedDependency.getReferences(this);
-
-            for (Klass klass : classes) {
-                Set<Klass> references = klass.getReferencedClasses();
-                for (Klass other : references) {
-                    String classname = klass.getClassName();
-                    boolean optional = OptionalDependency.isOptional(klass, other);
-                    if (optional) {
-                        classname = "[optional] " + classname;
-                    }
-
-                    Module m = getModuleDependence(other);
-                    if (m != null || other.getModule() == null) {
-                        writer.format("%-40s -> %s (%s)", classname, other, m);
-                        Reference ref = new Reference(klass, other);
-                        if (annotatedDeps.containsKey(ref)) {
-                            for (AnnotatedDependency ad : annotatedDeps.get(ref)) {
-                                writer.format(" %s", ad.getTag());
-                            }
-                            // printed; so remove the dependency from the annotated deps list
-                            annotatedDeps.remove(ref);
-                        }
-                        writer.format("\n");
-                    }
-                }
-            }
-
-
-            // print remaining dependencies specified in AnnotatedDependency list
-            if (annotatedDeps.size() > 0) {
-                for (Map.Entry<Reference, Set<AnnotatedDependency>> entry : annotatedDeps.entrySet()) {
-                    Reference ref = entry.getKey();
-                    Module m = getModuleDependence(ref.referree);
-                    if (m != null || ref.referree.getModule() == null) {
-                        String classname = ref.referrer.getClassName();
-                        boolean optional = true;
-                        boolean dynamic = true;
-                        String tag = "";
-                        for (AnnotatedDependency ad : entry.getValue()) {
-                            if (optional && !ad.isOptional()) {
-                                optional = false;
-                                tag = ad.getTag();
-                            }
-                            if (!ad.isDynamic()) {
-                                dynamic = false;
-                            }
-                        }
-                        if (!showDynamic && optional && dynamic) {
-                            continue;
-                        }
-                        if (optional) {
-                            if (dynamic) {
-                                classname = "[dynamic] " + classname;
-                            } else {
-                                classname = "[optional] " + classname;
-                            }
-                        }
-                        writer.format("%-40s -> %s (%s) %s%n", classname, ref.referree, m, tag);
-                    }
-                }
-            }
-
-        } finally {
-            writer.close();
-        }
-    }
-
-    static class Dependency implements Comparable<Dependency> {
-
-        final Module module;
-        final boolean optional;
-        final boolean dynamic;
-
-        Dependency(Klass from, Klass to) {
-            // static dependency
-            this.module = to.getModule() != null ? to.getModule().group() : null;
-            this.optional = OptionalDependency.isOptional(from, to);
-            this.dynamic = false;
-        }
-
-        Dependency(Module m, boolean optional, boolean dynamic) {
-            this.module = m != null ? m.group() : null;
-            this.optional = optional;
-            this.dynamic = dynamic;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof Dependency)) {
-                return false;
-            }
-            if (this == obj) {
-                return true;
-            }
-
-            Dependency d = (Dependency) obj;
-            if (this.module != d.module) {
-                return false;
-            } else {
-                return this.optional == d.optional && this.dynamic == d.dynamic;
-            }
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 3;
-            hash = 19 * hash + (this.module != null ? this.module.hashCode() : 0);
-            hash = 19 * hash + (this.optional ? 1 : 0);
-            hash = 19 * hash + (this.dynamic ? 1 : 0);
-            return hash;
-        }
-
-        @Override
-        public int compareTo(Dependency d) {
-            if (this.equals(d)) {
-                return 0;
-            }
-
-            // Hard static > hard dynamic > optional static > optional dynamic
-            if (this.module == d.module) {
-                if (this.optional == d.optional) {
-                    return this.dynamic ? -1 : 1;
-                } else {
-                    return this.optional ? -1 : 1;
-                }
-            } else if (this.module != null && d.module != null) {
-                return (this.module.compareTo(d.module));
-            } else {
-                return (this.module == null) ? -1 : 1;
-            }
-        }
-
-        @Override
-        public String toString() {
-            String s = module.name();
-            if (dynamic && optional) {
-                s += " (dynamic)";
-            } else if (optional) {
-                s += " (optional)";
-            }
-            return s;
-        }
-    }
-
-    static class Reference implements Comparable<Reference> {
-
-        private final Klass referrer, referree;
-
-        Reference(Klass referrer, Klass referree) {
-            this.referrer = referrer;
-            this.referree = referree;
-        }
-
-        Klass referrer() {
-            return referrer;
-        }
-
-        Klass referree() {
-            return referree;
-        }
-
-        @Override
-        public int hashCode() {
-            return referrer.hashCode() ^ referree.hashCode();
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof Reference)) {
-                return false;
-            }
-            if (this == obj) {
-                return true;
-            }
-
-            Reference r = (Reference) obj;
-            return (this.referrer.equals(r.referrer) &&
-                    this.referree.equals(r.referree));
-        }
-
-        @Override
-        public int compareTo(Reference r) {
-            int ret = referrer.compareTo(r.referrer);
-            if (ret == 0) {
-                ret = referree.compareTo(r.referree);
-            }
-            return ret;
-        }
-    }
-
-    interface Visitor<P> {
-
-        public void preVisit(Module m, P param);
-
-        public void postVisit(Module m, Module child, P param);
-    }
-    private static boolean traceOn = System.getProperty("classanalyzer.debug") != null;
-
-    private static void trace(String format, Object... params) {
-        System.err.format(format, params);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,562 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Pattern;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ModuleConfig {
-
-    private static String baseModuleName = "base";
-    private final Set<String> roots;
-    private final Set<String> includes;
-    private final Filter filter;
-    private List<String> members;
-    final String module;
-    final boolean isBase;
-
-    private ModuleConfig(String name) throws IOException {
-        this.roots = new TreeSet<String>();
-        this.includes = new TreeSet<String>();
-        this.module = name;
-        this.isBase = name.equals(baseModuleName);
-        this.filter = new Filter(this);
-    }
-
-    List<String> members() {
-        if (members == null) {
-            members = new LinkedList<String>();
-
-            for (String s : includes) {
-                if (!s.contains("*") && Module.findModule(s) != null) {
-                    // module member
-                    members.add(s);
-                }
-            }
-        }
-        return members;
-    }
-
-    boolean matchesRoot(String name) {
-        for (String pattern : roots) {
-            if (matches(name, pattern)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    boolean matchesIncludes(String name) {
-        for (String pattern : includes) {
-            if (matches(name, pattern)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    boolean isExcluded(String name) {
-        return filter.isExcluded(name);
-    }
-
-    boolean matchesPackage(String packageName, String pattern) {
-        int pos = pattern.lastIndexOf('.');
-        String pkg = pos > 0 ? pattern.substring(0, pos) : "<unnamed>";
-        return packageName.equals(pkg);
-    }
-
-
-    boolean matches(String name, String pattern) {
-        if (pattern.contains("**") && !pattern.endsWith("**")) {
-            throw new UnsupportedOperationException("Not yet implemented");
-        }
-
-        String javaName = name;
-
-        boolean isResourceFile = name.indexOf('/') >= 0;
-        if (isResourceFile) {
-            // it's a resource file; convert the name as a java
-            javaName = name.replace('/', '.');
-        }
-        if (pattern.indexOf('/') < 0) {
-            // if the pattern doesn't contain '/
-            return matchesJavaName(javaName, pattern);
-        } else {
-            if (isResourceFile) {
-                // the pattern is for matching resource file
-                return matchesNameWithSlash(name, pattern);
-            } else {
-                return false;
-            }
-        }
-    }
-
-    boolean matchesJavaName(String name, String pattern) {
-        int pos = name.lastIndexOf('.');
-        String packageName = pos > 0 ? name.substring(0, pos) : "<unnamed>";
-        if (pattern.endsWith("**")) {
-            String p = pattern.substring(0, pattern.length() - 2);
-            return name.startsWith(p);
-        } else if (pattern.endsWith("*") && pattern.indexOf('*') == pattern.lastIndexOf('*')) {
-            if (matchesPackage(packageName, pattern)) {
-                // package name has to be exact match
-                String p = pattern.substring(0, pattern.length() - 1);
-                return name.startsWith(p);
-            } else {
-                return false;
-            }
-        } else if (pattern.contains("*")) {
-            String basename = pos > 0 ? name.substring(pos + 1, name.length()) : name;
-            pos = pattern.indexOf('*');
-            String prefix = pattern.substring(0, pos);
-            String suffix = pattern.substring(pos + 1, pattern.length());
-            if (name.startsWith(prefix) && matchesPackage(packageName, prefix)) {
-                // package name has to be exact match
-                if (suffix.contains("*")) {
-                    return name.matches(convertToRegex(pattern));
-                } else {
-                    return basename.endsWith(suffix);
-                }
-            } else {
-                // we don't support wildcard be used in the package name
-                return false;
-            }
-        } else {
-            // exact match or inner class
-            return name.equals(pattern) || name.startsWith(pattern + "$");
-        }
-    }
-
-    boolean matchesNameWithSlash(String name, String pattern) {
-        if (pattern.endsWith("**")) {
-            String p = pattern.substring(0, pattern.length() - 2);
-            return name.startsWith(p);
-        } else if (pattern.contains("*")) {
-            int pos = pattern.indexOf('*');
-            String prefix = pattern.substring(0, pos);
-            String suffix = pattern.substring(pos + 1, pattern.length());
-            String tail = name.substring(pos, name.length());
-
-            if (!name.startsWith(prefix)) {
-                // prefix has to exact match
-                return false;
-            }
-
-            if (pattern.indexOf('*') == pattern.lastIndexOf('*')) {
-                // exact match prefix with no '/' in the tail string
-                String wildcard = tail.substring(0, tail.length() - suffix.length());
-                return tail.indexOf('/') < 0 && tail.endsWith(suffix);
-            }
-
-            if (suffix.contains("*")) {
-                return matchesNameWithSlash(tail, suffix);
-            } else {
-                // tail ends with the suffix while no '/' in the wildcard matched string
-                String any = tail.substring(0, tail.length() - suffix.length());
-                return tail.endsWith(suffix) && any.indexOf('/') < 0;
-            }
-        } else {
-            // exact match
-            return name.equals(pattern);
-        }
-    }
-
-    private String convertToRegex(String pattern) {
-        StringBuilder sb = new StringBuilder();
-        int i = 0;
-        int index = 0;
-        int plen = pattern.length();
-        while (i < plen) {
-            char p = pattern.charAt(i);
-            if (p == '*') {
-                sb.append("(").append(pattern.substring(index, i)).append(")");
-                if (i + 1 < plen && pattern.charAt(i + 1) == '*') {
-                    sb.append(".*");
-                    index = i + 2;
-                } else {
-                    sb.append("[^\\.]*");
-                    index = i + 1;
-                }
-            }
-            i++;
-        }
-        if (index < plen) {
-            sb.append("(").append(pattern.substring(index, plen)).append(")");
-        }
-        return sb.toString();
-    }
-
-    static class Filter {
-
-        final ModuleConfig config;
-        final Set<String> exclude = new TreeSet<String>();
-        final Set<String> allow = new TreeSet<String>();
-
-        Filter(ModuleConfig config) {
-            this.config = config;
-        }
-
-        Filter exclude(String pattern) {
-            exclude.add(pattern);
-            return this;
-        }
-
-        Filter allow(String pattern) {
-            allow.add(pattern);
-            return this;
-        }
-
-        String allowedBy(String name) {
-            String allowedBy = null;
-            for (String pattern : allow) {
-                if (config.matches(name, pattern)) {
-                    if (name.equals(pattern)) {
-                        return pattern;  // exact match
-                    }
-                    if (allowedBy == null) {
-                        allowedBy = pattern;
-                    } else {
-                        if (pattern.length() > allowedBy.length()) {
-                            allowedBy = pattern;
-                        }
-                    }
-                }
-            }
-            return allowedBy;
-        }
-
-        String excludedBy(String name) {
-            String allowedBy = allowedBy(name);
-            String excludedBy = null;
-
-            if (allowedBy != null && name.equals(allowedBy)) {
-                return null;  // exact match
-            }
-            for (String pattern : exclude) {
-                if (config.matches(name, pattern)) {
-                    // not matched by allowed rule or exact match
-                    if (allowedBy == null || name.equals(pattern)) {
-                        return pattern;
-                    }
-                    if (excludedBy == null) {
-                        excludedBy = pattern;
-                    } else {
-                        if (pattern.length() > excludedBy.length()) {
-                            excludedBy = pattern;
-                        }
-                    }
-                }
-            }
-            return excludedBy;
-        }
-
-        boolean isExcluded(String name) {
-            String allowedBy = allowedBy(name);
-            String excludedBy = excludedBy(name);
-
-            if (excludedBy == null) {
-                return false;
-            }
-            // not matched by allowed rule or exact match
-            if (allowedBy == null || name.equals(excludedBy)) {
-                return true;
-            }
-
-            if (allowedBy == null) {
-                return true;
-            }
-            if (allowedBy != null &&
-                    excludedBy.length() > allowedBy.length()) {
-                return true;
-            }
-            return false;
-        }
-    }
-
-    private static String trimComment(String line) {
-        StringBuilder sb = new StringBuilder();
-
-        int pos = 0;
-        while (pos >= 0 && pos < line.length()) {
-            int c1 = line.indexOf("//", pos);
-            if (c1 > 0 && !Character.isWhitespace(line.charAt(c1-1))) {
-                // not a comment
-                c1 = -1;
-            }
-
-            int c2 = line.indexOf("/*", pos);
-            if (c2 > 0 && !Character.isWhitespace(line.charAt(c2-1))) {
-                // not a comment
-                c2 = -1;
-            }
-
-            int c = line.length();
-            int n = line.length();
-            if (c1 >= 0 || c2 >= 0) {
-                if (c1 >= 0) {
-                    c = c1;
-                }
-                if (c2 >= 0 && c2 < c) {
-                    c = c2;
-                }
-                int c3 = line.indexOf("*/", c2 + 2);
-                if (c == c2 && c3 > c2) {
-                    n = c3 + 2;
-                }
-            }
-            if (c > 0) {
-                if (sb.length() > 0) {
-                    // add a whitespace if multiple comments on one line
-                    sb.append(" ");
-                }
-                sb.append(line.substring(pos, c));
-            }
-            pos = n;
-        }
-        return sb.toString();
-    }
-
-    private static boolean beginBlockComment(String line) {
-        int pos = 0;
-        while (pos >= 0 && pos < line.length()) {
-            int c = line.indexOf("/*", pos);
-            if (c < 0) {
-                return false;
-            }
-
-            if (c > 0 && !Character.isWhitespace(line.charAt(c-1))) {
-                return false;
-            }
-
-            int c1 = line.indexOf("//", pos);
-            if (c1 >= 0 && c1 < c) {
-                return false;
-            }
-
-            int c2 = line.indexOf("*/", c + 2);
-            if (c2 < 0) {
-                return true;
-            }
-            pos = c + 2;
-        }
-        return false;
-    }
-
-    static void setBaseModule(String name) {
-        baseModuleName = name;
-    }
-    // TODO: we shall remove "-" from the regex once we define
-    // the naming convention for the module names without dashes
-    static final Pattern classNamePattern = Pattern.compile("[\\w\\.\\*_$-/]+");
-
-    static List<ModuleConfig> readConfigurationFile(String file) throws IOException {
-        List<ModuleConfig> result = new ArrayList<ModuleConfig>();
-        // parse configuration file
-        FileInputStream in = new FileInputStream(file);
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line;
-
-            int lineNumber = 0;
-            boolean inRoots = false;
-            boolean inIncludes = false;
-            boolean inAllows = false;
-            boolean inExcludes = false;
-            boolean inBlockComment = false;
-            ModuleConfig config = null;
-
-            while ((line = reader.readLine()) != null) {
-                lineNumber++;
-
-                if (inBlockComment) {
-                    int c = line.indexOf("*/");
-                    if (c >= 0) {
-                        line = line.substring(c + 2, line.length());
-                        inBlockComment = false;
-                    } else {
-                        // skip lines until end of comment block
-                        continue;
-                    }
-                }
-
-                inBlockComment = beginBlockComment(line);
-
-                line = trimComment(line).trim();
-                // ignore empty lines
-                if (line.length() == 0) {
-                    continue;
-                }
-
-                String values;
-                if (inRoots || inIncludes || inExcludes || inAllows) {
-                    values = line;
-                } else {
-                    String[] s = line.split("\\s+");
-                    String keyword = s[0].trim();
-                    if (keyword.equals("module")) {
-                        if (s.length != 3 || !s[2].trim().equals("{")) {
-                            throw new RuntimeException(file + ", line " +
-                                    lineNumber + ", is malformed");
-                        }
-                        config = new ModuleConfig(s[1].trim());
-                        result.add(config);
-                        // switch to a new module; so reset the flags
-                        inRoots = false;
-                        inIncludes = false;
-                        inExcludes = false;
-                        inAllows = false;
-                        continue;
-                    } else if (keyword.equals("roots")) {
-                        inRoots = true;
-                    } else if (keyword.equals("include")) {
-                        inIncludes = true;
-                    } else if (keyword.equals("exclude")) {
-                        inExcludes = true;
-                    } else if (keyword.equals("allow")) {
-                        inAllows = true;
-                    } else if (keyword.equals("}")) {
-                        if (config == null || s.length != 1) {
-                            throw new RuntimeException(file + ", line " +
-                                    lineNumber + ", is malformed");
-                        } else {
-                            // end of a module
-                            config = null;
-                            continue;
-                        }
-                    } else {
-                        throw new RuntimeException(file + ", \"" + keyword + "\" on line " +
-                                lineNumber + ", is not recognized");
-                    }
-                    values = line.substring(keyword.length(), line.length()).trim();
-                }
-
-                if (config == null) {
-                    throw new RuntimeException(file + ", module not specified");
-                }
-
-                int len = values.length();
-                if (len == 0) {
-                    continue;
-                }
-                char lastchar = values.charAt(len - 1);
-                if (lastchar != ',' && lastchar != ';') {
-                    throw new RuntimeException(file + ", line " +
-                            lineNumber + ", is malformed:" +
-                            " ',' or ';' is missing.");
-                }
-
-                values = values.substring(0, len - 1);
-                // parse the values specified for a keyword specified
-                for (String s : values.split(",")) {
-                    s = s.trim();
-                    if (s.length() > 0) {
-                        if (!classNamePattern.matcher(s).matches()) {
-                            throw new RuntimeException(file + ", line " +
-                                    lineNumber + ", is malformed: \"" + s + "\"");
-                        }
-                        if (inRoots) {
-                            config.roots.add(s);
-                        } else if (inIncludes) {
-                            config.includes.add(s);
-                        } else if (inExcludes) {
-                            config.filter.exclude(s);
-                        } else if (inAllows) {
-                            config.filter.allow(s);
-                        }
-
-                    }
-                }
-                if (lastchar == ';') {
-                    inRoots = false;
-                    inIncludes = false;
-                    inExcludes = false;
-                    inAllows = false;
-                }
-            }
-
-            if (inBlockComment) {
-                throw new RuntimeException(file + ", line " +
-                        lineNumber + ", missing \"*/\" to end a block comment");
-            }
-            if (config != null) {
-                throw new RuntimeException(file + ", line " +
-                        lineNumber + ", missing \"}\" to end module definition" +
-                        " for \"" + config.module + "\"");
-            }
-
-        } finally {
-            in.close();
-        }
-
-        return result;
-    }
-
-    private String format(String keyword, Collection<String> values) {
-        if (values.size() == 0) {
-            return "";
-        }
-
-        StringBuilder sb = new StringBuilder();
-        String format = "%4s%-9s";
-        String spaces = String.format(format, "", "");
-        sb.append(String.format(format, "", keyword));
-        int count = 0;
-        for (String s : values) {
-            if (count > 0) {
-                sb.append(",\n").append(spaces);
-            } else if (count++ > 0) {
-                sb.append(", ");
-            }
-            sb.append(s);
-        }
-        if (count > 0) {
-            sb.append(";\n");
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("module " + module).append(" {\n");
-        sb.append(format("include", includes));
-        sb.append(format("root", roots));
-        sb.append(format("allow", filter.allow));
-        sb.append(format("exclude", filter.exclude));
-        sb.append("}\n");
-        return sb.toString();
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import com.sun.classanalyzer.Klass.Method;
-
-/**
- *
- * @author mchung
- */
-public class ResolutionInfo implements Comparable<ResolutionInfo> {
-
-    enum Type {
-
-        REFLECTION("reflection", true),
-        NATIVE("native", true),
-        INTERFACE("interface", false),
-        SUPER("super", false),
-        EXPLICIT("explicit", false),
-        VERIFICATION("verification", false),
-        METHODTRACE("method trace", true),
-        CONSTANT_POOL("constant pool", true),
-        CHECKED_EXCEPTION("throws", true),
-        METHOD("method", true),
-        FIELD("field", true),
-        EXTENDS("extends", true),
-        IMPLEMENTS("implements", true),
-        NOINFO("No info", false);
-
-        private final String name;
-        private final boolean hasInfo;
-
-        private Type(String name, boolean hasInfo) {
-            this.name = name;
-            this.hasInfo = hasInfo;
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public boolean hasInfo() {
-            return hasInfo;
-        }
-
-        public static Type getType(String s) {
-            if (s.isEmpty()) {
-                return NOINFO;
-            }
-            for (Type t : values()) {
-                if (s.equals(t.name)) {
-                    return t;
-                }
-            }
-            // Need to fix the VM output to add "native"
-            // throw new IllegalArgumentException("Invalid ResolutionInfo.type \"" + s + "\"");
-            System.out.println("WARNING: Invalid ResolutionInfo.type \"" + s + "\"");
-            return null;
-        }
-    }
-    final Klass fromClass;
-    final Method method;
-    final Klass toClass;
-    final int linenumber;
-    final Type type;
-    final String info;
-    private boolean isPublic = false;
-
-    private ResolutionInfo(Klass from, Klass to, int linenumber, Type type, String info) {
-        this.fromClass = from;
-        this.method = null;
-        this.toClass = to;
-        this.linenumber = linenumber;
-        this.type = type;
-        this.info = info;
-    }
-
-    private ResolutionInfo(Klass from, Method m, Klass to, int linenumber, Type type) {
-        this.fromClass = from;
-        this.method = m;
-        this.toClass = to;
-        this.linenumber = linenumber;
-        this.type = type;
-        this.info = m.toString();
-    }
-
-    public boolean isPublic() {
-        return isPublic;
-    }
-
-    public void setPublicAccess(boolean value) {
-        isPublic = value;
-    }
-    static ResolutionInfo resolved(Klass from, Klass to) {
-        return new ResolutionInfo(from, to, 0, Type.NOINFO, "");
-    }
-
-    static ResolutionInfo resolved(Klass from, Klass to, int linenumber) {
-        return new ResolutionInfo(from, to, linenumber, Type.NOINFO, "");
-    }
-
-    static ResolutionInfo resolved(Klass from, Klass to, int linenumber, String reason) {
-        String[] ss = reason.split("\\s+");
-        Type type;
-        String info;
-        if (linenumber == -1) {
-            type = Type.NATIVE;
-            info = ss[0];  // native method name
-        } else {
-            info = ss.length == 2 ? ss[1] : "";
-            type = Type.getType(ss[0]);
-            if (type == null) {
-                if (reason.isEmpty()) {
-                    throw new IllegalArgumentException("Invalid type: " + reason + " (" + ss[0] + ")" + ss.length);
-                }
-                // assume it's native
-                type = Type.NATIVE;
-                info = reason.isEmpty() ? ss[0] : reason;
-            }
-        }
-
-        return new ResolutionInfo(from, to, linenumber, type, info);
-    }
-
-    static ResolutionInfo resolved(Klass from, Klass to, Method callee) {
-        return new ResolutionInfo(from, callee, to, 0, Type.METHODTRACE);
-    }
-
-    static ResolutionInfo resolvedConstantPool(Klass from, Klass to, int index) {
-        return new ResolutionInfo(from, to, 0, Type.CONSTANT_POOL, "#" + index);
-    }
-
-    static ResolutionInfo resolvedField(Klass from, Klass to, String fieldname) {
-        return new ResolutionInfo(from, to, 0, Type.FIELD, fieldname);
-    }
-
-    static ResolutionInfo resolvedMethodSignature(Klass from, Klass to, Method m) {
-        return new ResolutionInfo(from, m, to, 0, Type.METHOD);
-    }
-
-    static ResolutionInfo resolvedCheckedException(Klass from, Klass to, Method m) {
-        return new ResolutionInfo(from, m, to, 0, Type.CHECKED_EXCEPTION);
-    }
-
-    static ResolutionInfo resolvedExtends(Klass from, Klass to) {
-        String info = from.getClassName() + " implements " + to.getClassName();
-        return new ResolutionInfo(from, to, 0, Type.EXTENDS, info);
-    }
-
-    static ResolutionInfo resolvedImplements(Klass from, Klass to) {
-        String info = from.getClassName() + " implements " + to.getClassName();
-        return new ResolutionInfo(from, to, 0, Type.IMPLEMENTS, info);
-    }
-
-    @Override
-    public int compareTo(ResolutionInfo ri) {
-        if (this.fromClass == ri.fromClass &&
-                this.toClass == ri.toClass &&
-                this.linenumber == ri.linenumber &&
-                this.type == ri.type &&
-                this.info.equals(ri.info)) {
-            return 0;
-        } else if (this.fromClass == ri.fromClass) {
-            if (this.linenumber > ri.linenumber) {
-                return 1;
-            } else if (this.linenumber < ri.linenumber) {
-                return -1;
-            } else if (this.type != ri.type) {
-                return this.type.getName().compareTo(ri.type.getName());
-            } else if (this.toClass != ri.toClass) {
-                return this.toClass.compareTo(ri.toClass);
-            } else {
-                return this.info.compareTo(ri.info);
-            }
-        } else {
-            return this.fromClass.compareTo(ri.fromClass);
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ResourceFile implements Comparable<ResourceFile> {
-
-    private final String pathname;
-    private Module module;
-
-    ResourceFile(String pathname) {
-        this.pathname = pathname.replace(File.separatorChar, '/');
-    }
-
-    Module getModule() {
-        return module;
-    }
-
-    void setModule(Module m) {
-        if (module != null) {
-            throw new RuntimeException("Module for " + this + " already set");
-        }
-        this.module = m;
-    }
-
-    String getName() {
-        return pathname;
-    }
-
-    String getPathname() {
-        return pathname;
-    }
-
-    @Override
-    public String toString() {
-        return pathname;
-    }
-
-    @Override
-    public int compareTo(ResourceFile o) {
-        return pathname.compareTo(o.pathname);
-    }
-    static Set<ResourceFile> resources = new TreeSet<ResourceFile>();
-
-    static boolean isResource(String pathname) {
-        String name = pathname.replace(File.separatorChar, '/');
-
-        if (name.endsWith("META-INF/MANIFEST.MF")) {
-            return false;
-        }
-        if (name.contains("META-INF/JCE_RSA.")) {
-            return false;
-        }
-
-        return true;
-    }
-
-    static void addResource(String name, InputStream in) {
-        ResourceFile res;
-        name = name.replace(File.separatorChar, '/');
-        if (name.startsWith("META-INF/services")) {
-            res = new ServiceProviderConfigFile(name, in);
-        } else {
-            res = new ResourceFile(name);
-        }
-        resources.add(res);
-    }
-
-    static Set<ResourceFile> getAllResources() {
-        return Collections.unmodifiableSet(resources);
-    }
-
-    static class ServiceProviderConfigFile extends ResourceFile {
-
-        private final List<String> providers = new ArrayList<String>();
-        private final String service;
-        ServiceProviderConfigFile(String pathname, InputStream in) {
-            super(pathname);
-            readServiceConfiguration(in, providers);
-            this.service = pathname.substring("META-INF/services".length() + 1, pathname.length());
-        }
-
-        @Override
-        String getName() {
-            if (providers.isEmpty()) {
-                return service;
-            } else {
-                // just use the first one for matching
-                return providers.get(0);
-            }
-        }
-
-        @SuppressWarnings("empty-statement")
-        void readServiceConfiguration(InputStream in, List<String> names) {
-            BufferedReader br = null;
-            try {
-                if (in != null) {
-                    // Properties doesn't perserve the order of the input file
-                    br = new BufferedReader(new InputStreamReader(in, "utf-8"));
-                    int lc = 1;
-                    while ((lc = parseLine(br, lc, names)) >= 0);
-                }
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            } finally {
-                if (br != null) {
-                    try {
-                        br.close();
-                    } catch (IOException ex) {
-                        throw new RuntimeException(ex);
-                    }
-                }
-            }
-        }
-
-        // Parse a single line from the given configuration file, adding the name
-        // on the line to the names list.
-        //
-        private int parseLine(BufferedReader r, int lc, List<String> names) throws IOException {
-            String ln = r.readLine();
-            if (ln == null) {
-                return -1;
-            }
-            int ci = ln.indexOf('#');
-            if (ci >= 0) {
-                ln = ln.substring(0, ci);
-            }
-            ln = ln.trim();
-            int n = ln.length();
-            if (n != 0) {
-                if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) {
-                    throw new RuntimeException("Illegal configuration-file syntax");
-                }
-                int cp = ln.codePointAt(0);
-                if (!Character.isJavaIdentifierStart(cp)) {
-                    throw new RuntimeException("Illegal provider-class name: " + ln);
-                }
-                for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
-                    cp = ln.codePointAt(i);
-                    if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) {
-                        throw new RuntimeException("Illegal provider-class name: " + ln);
-                    }
-                }
-                if (!names.contains(ln)) {
-                    names.add(ln);
-                }
-            }
-            return lc + 1;
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.classanalyzer;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-/**
- * A simple tool to print out the static dependencies for a given set of JAR,
- * class files, or combinations of. The tools supports an -ignore option to
- * ignore references to classes listed in the file (including .classlists
- * created by the ClassAnalyzer tool).
- */
-
-public class ShowDeps {
-
-    static void usage() {
-        System.out.println("java ShowDeps [-ignore <classlist>] file...");
-        System.out.println("   where <file> is a class or JAR file, or a directory");
-        System.out.println();
-        System.out.println("Example usages:");
-        System.out.println("  java ShowDeps Foo.jar");
-        System.out.println("  java ShowDeps -ignore base.classlist Foo.jar");
-        System.out.println("  java ShowDeps -ignore base.classlist -ignore " +
-            "jaxp-parsers.classlist <dir>");
-        System.exit(-1);
-    }
-
-    public static void main(String[] args) throws IOException {
-        // process -ignore options
-        int argi = 0;
-        Set<String> ignore = new HashSet<String>();
-        while (argi < args.length && args[argi].equals("-ignore")) {
-            argi++;
-            Scanner s = new Scanner(new File(args[argi++]));
-            try {
-                while (s.hasNextLine()) {
-                    String line = s.nextLine();
-                    if (!line.endsWith(".class"))
-                        continue;
-                    int len = line.length();
-                    // convert to class names
-                    String clazz = line.replace('\\', '.').replace('/', '.')
-                        .substring(0, len-6);
-                    ignore.add(clazz);
-                }
-            } finally {
-                s.close();
-            }
-        }
-
-        if (argi >= args.length)
-            usage();
-
-        // parse all classes
-        while (argi < args.length)
-            ClassPath.setClassPath(args[argi++]);
-        ClassPath.parseAllClassFiles();
-
-        // find the classes that don't exist
-        Set<Klass> unresolved = new TreeSet<Klass>();
-        for (Klass k : Klass.getAllClasses()) {
-            if (k.getFileSize() == 0)
-                unresolved.add(k);
-        }
-
-        // print references to classes that don't exist
-        for (Klass k: Klass.getAllClasses()) {
-            for (Klass other : k.getReferencedClasses()) {
-                if (unresolved.contains(other)) {
-                    String name = other.toString();
-                    if (!ignore.contains(name)) {
-                        System.out.format("%s -> %s\n", k, other);
-                    }
-                }
-            }
-        }
-    }
-}
--- a/jdk/make/sun/applet/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/applet/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = applet
 PACKAGE = sun.applet
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/awt/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/awt/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = awt
 PRODUCT = sun
@@ -368,7 +367,7 @@
 FONTCONFIGS_SRC	= $(CLOSED_SRC)/solaris/classes/sun/awt/fontconfigs
 _FONTCONFIGS	= \
 	fontconfig.properties				\
-	fontconfig.RedHat.properties			\
+	fontconfig.RedHat.5.5.properties		\
 	fontconfig.Turbo.properties			\
 	fontconfig.SuSE.10.properties                   \
 	fontconfig.SuSE.11.properties
@@ -405,7 +404,6 @@
     $(COMPILEFONTCONFIG_JARFILE)
 	$(prep-target)
 	$(BOOT_JAVA_CMD) -jar $(COMPILEFONTCONFIG_JARFILE) $(COMPILEFONTCONFIG_FLAGS) $< $@
-	$(install-module-file)
 	$(call chmod-file, 444)
 	@$(java-vm-cleanup)
 
--- a/jdk/make/sun/awt/mapfile-mawt-vers	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/awt/mapfile-mawt-vers	Fri Mar 18 11:00:10 2011 -0700
@@ -424,6 +424,7 @@
 		Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
 		Java_sun_java2d_xr_XRSurfaceData_initIDs;
 		Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
+		Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture;
 		Java_sun_java2d_xr_XRBackendNative_initIDs;
 		Java_sun_java2d_xr_XIDGenerator_bufferXIDs;
 		Java_sun_java2d_xr_XRBackendNative_freeGC;
--- a/jdk/make/sun/cmm/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/cmm/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE   = java2d
 PRODUCT  = sun
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/sun/cmm/kcms/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/cmm/kcms/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = java2d
 PACKAGE = sun.java2d.cmm.kcms
 LIBRARY = kcms
 PRODUCT = sun
--- a/jdk/make/sun/cmm/lcms/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/cmm/lcms/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = java2d
 PACKAGE = sun.java2d.cmm.lcms
 LIBRARY = lcms
 PRODUCT = sun
--- a/jdk/make/sun/dcpr/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/dcpr/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.dc
 LIBRARY = dcpr
 PRODUCT = sun
--- a/jdk/make/sun/font/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/font/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = font
 PACKAGE = sun.font
 LIBRARY = fontmanager
 PRODUCT = sun
@@ -136,7 +135,6 @@
 
 $(FREETYPE_LIB):
 	$(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
-	$(install-module-file)
 endif
 
 #ifeq ($(PLATFORM), solaris)
--- a/jdk/make/sun/font/t2k/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/font/t2k/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = font
 PACKAGE = sun.font
 LIBRARY = t2k
 PRODUCT = sun
--- a/jdk/make/sun/headless/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/headless/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -30,7 +30,6 @@
 MOTIF_VERSION_STRING=none
 LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/headless
 
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = mawt
 LIBRARY_OUTPUT = headless
--- a/jdk/make/sun/image/generic/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/image/generic/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = media
 PACKAGE = sun.awt.medialib
 LIBRARY = mlib_image
 PRODUCT = sun
--- a/jdk/make/sun/image/vis/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/image/vis/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -27,7 +27,6 @@
 # Makefile for building the VIS (solaris-only) version of medialib
 #
 BUILDDIR = ../../..
-MODULE  = media
 PACKAGE = sun.awt.medialib
 LIBRARY = mlib_image_v
 PRODUCT = sun
--- a/jdk/make/sun/jar/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/jar/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jar-tool
 PACKAGE = sun.tools
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/javazic/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/javazic/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -27,7 +27,6 @@
 
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = sun.javazic
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
@@ -70,7 +69,6 @@
 	$(RM) -r $(@D)
 	$(prep-target)
 	$(CP) -r $(WORKDIR)/* $(@D)
-	$(install-module-dir)
 
 clean clobber::
 	$(RM) -r $(TEMPDIR) $(INSTALLDIR)
--- a/jdk/make/sun/jawt/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/jawt/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = jawt
 PRODUCT = sun
--- a/jdk/make/sun/jconsole/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/jconsole/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jconsole
 PACKAGE = sun.tools.jconsole
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/jdbc/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/jdbc/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -33,7 +33,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdbc-odbc
 PACKAGE = sun.jdbc.odbc
 LIBRARY = JdbcOdbc
 PRODUCT = sun
--- a/jdk/make/sun/jdga/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/jdga/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.jdga
 LIBRARY = sunwjdga
 PRODUCT = sun
--- a/jdk/make/sun/jpeg/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/jpeg/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.awt
 LIBRARY = jpeg
 PRODUCT = sun
--- a/jdk/make/sun/launcher/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/launcher/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = sun.launcher
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/management/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/management/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE   = management
 
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/sun/native2ascii/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/native2ascii/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = tools
 PACKAGE = sun.tools.native2ascii
 PRODUCT = sun
 OTHER_JAVACFLAGS += -Xlint:serial -Werror
--- a/jdk/make/sun/net/others/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/net/others/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PACKAGE = sun.net
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/net/spi/nameservice/dns/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/net/spi/nameservice/dns/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -30,7 +30,6 @@
 BUILDDIR = ../../../../..
 
 # dns should probably be its own module
-MODULE  = net-dns
 PACKAGE = sun.net.spi.nameservice.dns
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/nio/cs/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/nio/cs/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -30,7 +30,6 @@
 BUILDDIR = ../../..
 
 # charsets should be separated from nio module 
-MODULE  = charsets
 PACKAGE = sun.nio
 PRODUCT = sun
 
--- a/jdk/make/sun/org/mozilla/javascript/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/org/mozilla/javascript/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = scripting-rhino
 PACKAGE = sun.org.mozilla.javascript.internal
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/pisces/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/pisces/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.pisces
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/cgi/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/rmi/cgi/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 # java-rmi.cgi is a JDK tool
-MODULE  = tools
 PACKAGE = sun.rmi
 PRODUCT = sun
 PROGRAM = java-rmi
--- a/jdk/make/sun/rmi/oldtools/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/rmi/oldtools/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = oldjavac
 PRODUCT	 = oldjavac
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/registry/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/rmi/registry/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmi
 PACKAGE = sun.rmi.registry
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/rmi/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/rmi/rmi/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmi
 PACKAGE = sun.rmi
 PRODUCT = sun
 LIBRARY = rmi
--- a/jdk/make/sun/rmi/rmic/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/rmi/rmic/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmic
 PACKAGE = sun.rmi.rmic
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/rmid/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/rmi/rmid/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmi-activation
 PACKAGE = sun.rmi.activation
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/security/ec/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/security/ec/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -89,7 +89,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-sunec
 PACKAGE = sun.security.ec
 PRODUCT = sun
 
@@ -309,7 +308,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunec.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/sun/security/jgss/wrapper/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/security/jgss/wrapper/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = security-kerberos
 PACKAGE = sun.security.jgss.wrapper
 PRODUCT = sun
 
--- a/jdk/make/sun/security/krb5/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/security/krb5/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-kerberos
 PACKAGE = sun.security.krb5
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/security/mscapi/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/security/mscapi/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -89,7 +89,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-sunmscapi
 PACKAGE = sun.security.mscapi
 LIBRARY = sunmscapi
 PRODUCT = sun
@@ -273,7 +272,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunmscapi.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/sun/security/pkcs11/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/security/pkcs11/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -89,7 +89,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-sunpkcs11
 PACKAGE = sun.security.pkcs11
 LIBRARY = j2pkcs11
 PRODUCT = sun
@@ -288,7 +287,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunpkcs11.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/sun/security/smartcardio/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/security/smartcardio/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-smartcardio
 PACKAGE = sun.security.smartcardio
 LIBRARY = j2pcsc
 PRODUCT = sun
--- a/jdk/make/sun/security/tools/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/security/tools/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-tools
 PACKAGE = sun.security.tools
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/serialver/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/serialver/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = serialver
 PACKAGE = sun.tools.serialver
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/splashscreen/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/splashscreen/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = splashscreen
 PRODUCT = sun
--- a/jdk/make/sun/text/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/text/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = localedata
 PACKAGE = sun.text
 PRODUCT = sun
 
--- a/jdk/make/sun/tools/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/tools/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = tools
 PACKAGE = sun.tools
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/tracing/dtrace/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/tracing/dtrace/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -27,7 +27,6 @@
 # Makefile for building dtrace extension
 #
 BUILDDIR = ../../..
-MODULE  = tracing
 PACKAGE = sun.tracing.dtrace
 LIBRARY = jsdt
 PRODUCT = sun
--- a/jdk/make/sun/xawt/Makefile	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/xawt/Makefile	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt.X11
 LIBRARY = mawt
 LIBRARY_OUTPUT = xawt
--- a/jdk/make/sun/xawt/mapfile-vers	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/sun/xawt/mapfile-vers	Fri Mar 18 11:00:10 2011 -0700
@@ -374,6 +374,7 @@
         Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
         Java_sun_java2d_xr_XRSurfaceData_initIDs;
         Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
+	Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture;
 	Java_sun_java2d_xr_XRBackendNative_initIDs;
 	Java_sun_java2d_xr_XRBackendNative_freeGC;
 	Java_sun_java2d_xr_XRBackendNative_createGC;
@@ -432,6 +433,7 @@
         Java_sun_awt_X11_GtkFileDialogPeer_run;
         Java_sun_awt_X11_GtkFileDialogPeer_quit;
         Java_sun_awt_X11_GtkFileDialogPeer_toFront;
+        Java_sun_awt_X11_GtkFileDialogPeer_setBounds;
 
 	Java_sun_print_CUPSPrinter_initIDs;
 	Java_sun_print_CUPSPrinter_getCupsServer;
--- a/jdk/make/tools/manifest.mf	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/make/tools/manifest.mf	Fri Mar 18 11:00:10 2011 -0700
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 Specification-Title: Java Platform API Specification
-Specification-Version: 1.6
+Specification-Version: 1.7
 Specification-Vendor: Oracle
 Implementation-Title: Java Runtime Environment
 Implementation-Version: @@RELEASE@@
--- a/jdk/src/share/classes/com/sun/jarsigner/ContentSignerParameters.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jarsigner/ContentSignerParameters.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 com.sun.jarsigner;
 
 import java.net.URI;
-import java.security.cert.X509CRL;
 import java.security.cert.X509Certificate;
-import java.util.Set;
 import java.util.zip.ZipFile;
 
 /**
@@ -83,13 +81,6 @@
     public X509Certificate[] getSignerCertificateChain();
 
     /**
-     * Retrieves the signer's X.509 CRLs.
-     *
-     * @return An unmodifiable set of X.509 CRLs (never <code>null</code>)
-     */
-    public Set<X509CRL> getCRLs();
-
-    /**
      * Retrieves the content that was signed.
      * The content is the JAR file's signature file.
      *
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1011,7 +1011,7 @@
         return -1;
     }
 
-    Comparator<Entry> entryOutputOrder = new Comparator<>() {
+    Comparator<Entry> entryOutputOrder = new Comparator<Entry>() {
         public int compare(Entry  e0, Entry e1) {
             int k0 = getOutputIndex(e0);
             int k1 = getOutputIndex(e1);
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -785,7 +785,7 @@
             defMap.entrySet().toArray(layoutsAndCounts);
             // Sort by count, most frequent first.
             // Predefs. participate in this sort, though it does not matter.
-            Arrays.sort(layoutsAndCounts, new Comparator<>() {
+            Arrays.sort(layoutsAndCounts, new Comparator<Object>() {
                 public int compare(Object o0, Object o1) {
                     Map.Entry e0 = (Map.Entry) o0;
                     Map.Entry e1 = (Map.Entry) o1;
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -380,13 +380,19 @@
     }
 
     LdapRequest writeRequest(BerEncoder ber, int msgId) throws IOException {
-        return writeRequest(ber, msgId, false /* pauseAfterReceipt */);
+        return writeRequest(ber, msgId, false /* pauseAfterReceipt */, -1);
     }
 
-    LdapRequest writeRequest(BerEncoder ber, int msgId, boolean pauseAfterReceipt)
-        throws IOException {
+    LdapRequest writeRequest(BerEncoder ber, int msgId,
+        boolean pauseAfterReceipt) throws IOException {
+        return writeRequest(ber, msgId, pauseAfterReceipt, -1);
+    }
 
-        LdapRequest req = new LdapRequest(msgId, pauseAfterReceipt);
+    LdapRequest writeRequest(BerEncoder ber, int msgId,
+        boolean pauseAfterReceipt, int replyQueueCapacity) throws IOException {
+
+        LdapRequest req =
+            new LdapRequest(msgId, pauseAfterReceipt, replyQueueCapacity);
         addRequest(req);
 
         if (traceFile != null) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -516,7 +516,8 @@
     LdapResult search(String dn, int scope, int deref, int sizeLimit,
                       int timeLimit, boolean attrsOnly, String attrs[],
                       String filter, int batchSize, Control[] reqCtls,
-                      Hashtable binaryAttrs, boolean waitFirstReply)
+                      Hashtable binaryAttrs, boolean waitFirstReply,
+                      int replyQueueCapacity)
         throws IOException, NamingException {
 
         ensureOpen();
@@ -543,7 +544,8 @@
                 if (isLdapv3) encodeControls(ber, reqCtls);
             ber.endSeq();
 
-         LdapRequest req = conn.writeRequest(ber, curMsgId);
+         LdapRequest req =
+                conn.writeRequest(ber, curMsgId, false, replyQueueCapacity);
 
          res.msgId = curMsgId;
          res.status = LdapClient.LDAP_SUCCESS; //optimistic
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +191,14 @@
     // Environment property for the domain name (derived from this context's DN)
     private static final String DOMAIN_NAME = "com.sun.jndi.ldap.domainname";
 
+    // Block until the first search reply is received
+    private static final String WAIT_FOR_REPLY =
+        "com.sun.jndi.ldap.search.waitForReply";
+
+    // Size of the queue of unprocessed search replies
+    private static final String REPLY_QUEUE_SIZE =
+        "com.sun.jndi.ldap.search.replyQueueSize";
+
     // ----------------- Fields that don't change -----------------------
     private static final NameParser parser = new LdapNameParser();
 
@@ -246,6 +254,8 @@
     private Hashtable binaryAttrs = null;    // attr values returned as byte[]
     private int connectTimeout = -1;         // no timeout value
     private int readTimeout = -1;            // no timeout value
+    private boolean waitForReply = true;     // wait for search response
+    private int replyQueueSize  = -1;        // unlimited queue size
     private boolean useSsl = false;          // true if SSL protocol is active
     private boolean useDefaultPortNumber = false; // no port number was supplied
 
@@ -1759,8 +1769,8 @@
                                          SearchControls cons,
                                          Continuation cont)
             throws NamingException {
-        return searchAux(name, filter, cloneSearchControls(cons), true, true,
-                         cont);
+        return searchAux(name, filter, cloneSearchControls(cons), true,
+                 waitForReply, cont);
     }
 
     protected NamingEnumeration c_search(Name name,
@@ -1928,7 +1938,7 @@
     }
 
     private LdapResult doSearch(Name name, String filter, SearchControls cons,
-        boolean relative, boolean waitFirstReply) throws NamingException {
+        boolean relative, boolean waitForReply) throws NamingException {
             ensureOpen();
             try {
                 int scope;
@@ -1984,7 +1994,8 @@
                         batchSize,
                         reqCtls,
                         binaryAttrs,
-                        waitFirstReply);
+                        waitForReply,
+                        replyQueueSize);
                 respCtls = answer.resControls; // retrieve response controls
                 return answer;
 
@@ -2170,6 +2181,10 @@
             connectTimeout = -1;
         } else if (propName.equals(READ_TIMEOUT)) {
             readTimeout = -1;
+        } else if (propName.equals(WAIT_FOR_REPLY)) {
+            waitForReply = true;
+        } else if (propName.equals(REPLY_QUEUE_SIZE)) {
+            replyQueueSize = -1;
 
 // The following properties affect the connection
 
@@ -2225,6 +2240,11 @@
                 setConnectTimeout((String)propVal);
             } else if (propName.equals(READ_TIMEOUT)) {
                 setReadTimeout((String)propVal);
+            } else if (propName.equals(WAIT_FOR_REPLY)) {
+                setWaitForReply((String)propVal);
+            } else if (propName.equals(REPLY_QUEUE_SIZE)) {
+                setReplyQueueSize((String)propVal);
+
 // The following properties affect the connection
 
             } else if (propName.equals(Context.SECURITY_PROTOCOL)) {
@@ -2312,6 +2332,13 @@
         // Set the read timeout
         setReadTimeout((String)envprops.get(READ_TIMEOUT));
 
+        // Set the flag that controls whether to block until the first reply
+        // is received
+        setWaitForReply((String)envprops.get(WAIT_FOR_REPLY));
+
+        // Set the size of the queue of unprocessed search replies
+        setReplyQueueSize((String)envprops.get(REPLY_QUEUE_SIZE));
+
         // When connection is created, it will use these and other
         // properties from the environment
     }
@@ -2442,6 +2469,34 @@
     }
 
     /**
+     * Sets the size of the queue of unprocessed search replies
+     */
+    private void setReplyQueueSize(String replyQueueSizeProp) {
+        if (replyQueueSizeProp != null) {
+           replyQueueSize = Integer.parseInt(replyQueueSizeProp);
+            // disallow an empty queue
+            if (replyQueueSize <= 0) {
+                replyQueueSize = -1;    // unlimited
+            }
+        } else {
+            replyQueueSize = -1;        // unlimited
+        }
+    }
+
+    /**
+     * Sets the flag that controls whether to block until the first search
+     * reply is received
+     */
+    private void setWaitForReply(String waitForReplyProp) {
+        if (waitForReplyProp != null &&
+            (waitForReplyProp.equalsIgnoreCase("false"))) {
+            waitForReply = false;
+        } else {
+            waitForReply = true;
+        }
+    }
+
+    /**
      * Sets the read timeout value
      */
     private void setReadTimeout(String readTimeoutProp) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
 package com.sun.jndi.ldap;
 
 import java.io.IOException;
-import java.util.Vector;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
 import javax.naming.CommunicationException;
 
 final class LdapRequest {
@@ -35,14 +36,26 @@
     int msgId;          // read-only
 
     private int gotten = 0;
-    private Vector replies = new Vector(3);
+    private BlockingQueue<BerDecoder> replies;
+    private int highWatermark = -1;
     private boolean cancelled = false;
     private boolean pauseAfterReceipt = false;
     private boolean completed = false;
 
     LdapRequest(int msgId, boolean pause) {
+        this(msgId, pause, -1);
+    }
+
+    LdapRequest(int msgId, boolean pause, int replyQueueCapacity) {
         this.msgId = msgId;
         this.pauseAfterReceipt = pause;
+        if (replyQueueCapacity == -1) {
+            this.replies = new LinkedBlockingQueue<BerDecoder>();
+        } else {
+            this.replies =
+                new LinkedBlockingQueue<BerDecoder>(replyQueueCapacity);
+            highWatermark = (replyQueueCapacity * 80) / 100; // 80% capacity
+        }
     }
 
     synchronized void cancel() {
@@ -57,7 +70,13 @@
         if (cancelled) {
             return false;
         }
-        replies.addElement(ber);
+
+        // Add a new reply to the queue of unprocessed replies.
+        try {
+            replies.put(ber);
+        } catch (InterruptedException e) {
+            // ignore
+        }
 
         // peek at the BER buffer to check if it is a SearchResultDone PDU
         try {
@@ -70,6 +89,14 @@
         ber.reset();
 
         notify(); // notify anyone waiting for reply
+        /*
+         * If a queue capacity has been set then trigger a pause when the
+         * queue has filled to 80% capacity. Later, when the queue has drained
+         * then the reader gets unpaused.
+         */
+        if (highWatermark != -1 && replies.size() >= highWatermark) {
+            return true; // trigger the pause
+        }
         return pauseAfterReceipt;
     }
 
@@ -79,14 +106,12 @@
                 " cancelled");
         }
 
-        if (gotten < replies.size()) {
-            BerDecoder answer = (BerDecoder)replies.elementAt(gotten);
-            replies.setElementAt(null, gotten); // remove reference
-            ++gotten; // skip to next
-            return answer;
-        } else {
-            return null;
-        }
+        /*
+         * Remove a reply if the queue is not empty.
+         * poll returns null if queue is empty.
+         */
+        BerDecoder reply = replies.poll();
+        return reply;
     }
 
     synchronized boolean hasSearchCompleted() {
--- a/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java	Fri Mar 18 11:00:10 2011 -0700
@@ -25,12 +25,10 @@
 
 package com.sun.media.sound;
 
-import java.util.Vector;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
-import java.io.DataInputStream;
 
 import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
@@ -398,7 +396,8 @@
         header = baos.toByteArray();
         headerStream = new ByteArrayInputStream( header );
 
-        aiffStream = new SequenceInputStream(headerStream,codedAudioStream);
+        aiffStream = new SequenceInputStream(headerStream,
+                            new NoCloseInputStream(codedAudioStream));
 
         return aiffStream;
 
--- a/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java	Fri Mar 18 11:00:10 2011 -0700
@@ -52,9 +52,6 @@
     private static final short seg_end [] = {0xFF, 0x1FF, 0x3FF,
                                              0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF};
 
-    private static final int tempBufferSize = 64;
-    private byte tempBuffer [] = null;
-
     /**
      * Initializes the decode tables
      */
@@ -199,12 +196,9 @@
         AudioFormat inputFormat = stream.getFormat();
 
         if( inputFormat.matches(outputFormat) ) {
-
             cs = stream;
         } else {
-
             cs = (AudioInputStream) (new AlawCodecStream(stream, outputFormat));
-            tempBuffer = new byte[tempBufferSize];
         }
 
         return cs;
@@ -264,6 +258,10 @@
 
     class AlawCodecStream extends AudioInputStream {
 
+        // tempBuffer required only for encoding (when encode is true)
+        private static final int tempBufferSize = 64;
+        private byte tempBuffer [] = null;
+
         /**
          * True to encode to a-law, false to decode to linear
          */
@@ -303,6 +301,7 @@
                 encodeFormat = outputFormat;
                 decodeFormat = inputFormat;
                 PCMIsBigEndian = inputFormat.isBigEndian();
+                tempBuffer = new byte[tempBufferSize];
             }
 
             if (PCMIsBigEndian) {
--- a/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java	Fri Mar 18 11:00:10 2011 -0700
@@ -25,12 +25,10 @@
 
 package com.sun.media.sound;
 
-import java.util.Vector;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
-import java.lang.IllegalArgumentException;
 
 import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
@@ -131,10 +129,10 @@
             // $$fb: 2001-07-13: done. Fixes Bug 4479981
             RandomAccessFile raf=new RandomAccessFile(out, "rw");
             if (raf.length()<=0x7FFFFFFFl) {
-                                // skip AU magic and data offset field
+                // skip AU magic and data offset field
                 raf.skipBytes(8);
                 raf.writeInt(bytesWritten-AuFileFormat.AU_HEADERSIZE);
-                                // that's all
+                // that's all
             }
             raf.close();
         }
@@ -303,7 +301,8 @@
         dos.close();
         header = baos.toByteArray();
         headerStream = new ByteArrayInputStream( header );
-        auStream = new SequenceInputStream(headerStream,codedAudioStream);
+        auStream = new SequenceInputStream(headerStream,
+                        new NoCloseInputStream(codedAudioStream));
 
         return auStream;
     }
--- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java	Fri Mar 18 11:00:10 2011 -0700
@@ -395,11 +395,7 @@
         protected volatile boolean noService = false; // do not run the nService method
 
         // Guards all native calls.
-        protected Object lockNative = new Object();
-        // Guards the lastOpened static variable in implOpen and implClose.
-        protected static Object lockLast = new Object();
-        // Keeps track of last opened line, see implOpen "trick".
-        protected static DirectDL lastOpened;
+        protected final Object lockNative = new Object();
 
         // CONSTRUCTOR
         protected DirectDL(DataLine.Info info,
@@ -501,48 +497,21 @@
             // align buffer to full frames
             bufferSize = ((int) bufferSize / format.getFrameSize()) * format.getFrameSize();
 
-            synchronized(lockLast) {
-                id = nOpen(mixerIndex, deviceID, isSource,
-                        encoding,
-                        hardwareFormat.getSampleRate(),
-                        hardwareFormat.getSampleSizeInBits(),
-                        hardwareFormat.getFrameSize(),
-                        hardwareFormat.getChannels(),
-                        hardwareFormat.getEncoding().equals(
-                            AudioFormat.Encoding.PCM_SIGNED),
-                        hardwareFormat.isBigEndian(),
-                        bufferSize);
+            id = nOpen(mixerIndex, deviceID, isSource,
+                    encoding,
+                    hardwareFormat.getSampleRate(),
+                    hardwareFormat.getSampleSizeInBits(),
+                    hardwareFormat.getFrameSize(),
+                    hardwareFormat.getChannels(),
+                    hardwareFormat.getEncoding().equals(
+                        AudioFormat.Encoding.PCM_SIGNED),
+                    hardwareFormat.isBigEndian(),
+                    bufferSize);
 
-                if (id == 0) {
-                    // Bah... Dirty trick. The most likely cause is an application
-                    // already having a line open for this particular hardware
-                    // format and forgetting about it. If so, silently close that
-                    // implementation and try again. Unfortuantely we can only
-                    // open one line per hardware format currently.
-                    if (lastOpened != null
-                            && hardwareFormat.matches(lastOpened.hardwareFormat)) {
-                        lastOpened.implClose();
-                        lastOpened = null;
-
-                        id = nOpen(mixerIndex, deviceID, isSource,
-                                encoding,
-                                hardwareFormat.getSampleRate(),
-                                hardwareFormat.getSampleSizeInBits(),
-                                hardwareFormat.getFrameSize(),
-                                hardwareFormat.getChannels(),
-                                hardwareFormat.getEncoding().equals(
-                                    AudioFormat.Encoding.PCM_SIGNED),
-                                hardwareFormat.isBigEndian(),
-                                bufferSize);
-                    }
-
-                    if (id == 0) {
-                        // TODO: nicer error messages...
-                        throw new LineUnavailableException(
-                            "line with format "+format+" not supported.");
-                    }
-                }
-                lastOpened = this;
+            if (id == 0) {
+                // TODO: nicer error messages...
+                throw new LineUnavailableException(
+                        "line with format "+format+" not supported.");
             }
 
             this.bufferSize = nGetBufferSize(id, isSource);
@@ -615,14 +584,13 @@
             }
             synchronized (lockNative) {
                 nStop(id, isSource);
-
+            }
+            // wake up any waiting threads
+            synchronized(lock) {
                 // need to set doIO to false before notifying the
                 // read/write thread, that's why isStartedRunning()
                 // cannot be used
                 doIO = false;
-            }
-            // wake up any waiting threads
-            synchronized(lock) {
                 lock.notifyAll();
             }
             setActive(false);
@@ -649,12 +617,8 @@
             doIO = false;
             long oldID = id;
             id = 0;
-            synchronized (lockLast) {
-                synchronized (lockNative) {
-                    nClose(oldID, isSource);
-                    if (lastOpened == this)
-                      lastOpened = null;
-                }
+            synchronized (lockNative) {
+                nClose(oldID, isSource);
             }
             bytePosition = 0;
             softwareConversionSize = 0;
@@ -667,10 +631,9 @@
             if (id == 0) {
                 return 0;
             }
-            int a = 0;
+            int a;
             synchronized (lockNative) {
-                if (doIO)
-                    a = nAvailable(id, isSource);
+                a = nAvailable(id, isSource);
             }
             return a;
         }
@@ -726,7 +689,7 @@
                     lock.notifyAll();
                 }
                 synchronized (lockNative) {
-                    if (id != 0 && doIO) {
+                    if (id != 0) {
                         // then flush native buffers
                         nFlush(id, isSource);
                     }
@@ -737,10 +700,9 @@
 
         // replacement for getFramePosition (see AbstractDataLine)
         public long getLongFramePosition() {
-            long pos = 0;
+            long pos;
             synchronized (lockNative) {
-                if (doIO)
-                    pos = nGetBytePosition(id, isSource, bytePosition);
+                pos = nGetBytePosition(id, isSource, bytePosition);
             }
             // hack because ALSA sometimes reports wrong framepos
             if (pos < 0) {
@@ -786,12 +748,11 @@
             }
             int written = 0;
             while (!flushing) {
-                int thisWritten = 0;
+                int thisWritten;
                 synchronized (lockNative) {
-                    if (doIO)
-                        thisWritten = nWrite(id, b, off, len,
-                                softwareConversionSize,
-                                leftGain, rightGain);
+                    thisWritten = nWrite(id, b, off, len,
+                            softwareConversionSize,
+                            leftGain, rightGain);
                     if (thisWritten < 0) {
                         // error in native layer
                         break;
@@ -1014,10 +975,9 @@
             }
             int read = 0;
             while (doIO && !flushing) {
-                int thisRead = 0;
+                int thisRead;
                 synchronized (lockNative) {
-                    if (doIO)
-                        thisRead = nRead(id, b, off, len, softwareConversionSize);
+                    thisRead = nRead(id, b, off, len, softwareConversionSize);
                     if (thisRead < 0) {
                         // error in native layer
                         break;
@@ -1252,8 +1212,7 @@
             // set new native position (if necessary)
             // this must come after the flush!
             synchronized (lockNative) {
-                if (doIO)
-                    nSetBytePosition(id, isSource, frames * frameSize);
+                nSetBytePosition(id, isSource, frames * frameSize);
             }
 
             if (Printer.debug) Printer.debug("  DirectClip.setFramePosition: "
--- a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java	Fri Mar 18 11:00:10 2011 -0700
@@ -775,15 +775,22 @@
         Receiver rec = null;
         // first try to connect to the default synthesizer
         // IMPORTANT: this code needs to be synch'ed with
-        //            MidiSystem.getReceiver(boolean), because the same
+        //            MidiSystem.getSequencer(boolean), because the same
         //            algorithm needs to be used!
         try {
             Synthesizer synth = MidiSystem.getSynthesizer();
-            synth.open();
             if (synth instanceof ReferenceCountingDevice) {
                 rec = ((ReferenceCountingDevice) synth).getReceiverReferenceCounting();
             } else {
-                rec = synth.getReceiver();
+                synth.open();
+                try {
+                    rec = synth.getReceiver();
+                } finally {
+                    // make sure that the synth is properly closed
+                    if (rec == null) {
+                        synth.close();
+                    }
+                }
             }
         } catch (Exception e) {
             // something went wrong with synth
--- a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java	Fri Mar 18 11:00:10 2011 -0700
@@ -127,7 +127,7 @@
                 resolution = timing;
             } else {
                 // SMPTE based timing.  first decipher the frame code.
-                int frameCode = (-1 * timing) >> 8;
+                int frameCode = -1 * (timing >> 8);
                 switch(frameCode) {
                 case 24:
                     divisionType = Sequence.SMPTE_24;
--- a/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java	Fri Mar 18 11:00:10 2011 -0700
@@ -30,14 +30,9 @@
 import java.io.OutputStream;
 import java.io.IOException;
 import java.io.DataInputStream;
-import java.io.RandomAccessFile;
-import java.net.URL;
 
-import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioSystem;
-import javax.sound.sampled.UnsupportedAudioFileException;
 import javax.sound.sampled.spi.AudioFileWriter;
 
 
@@ -177,4 +172,62 @@
         return i;
     }
 
+    /**
+     * InputStream wrapper class which prevent source stream from being closed.
+     * The class is usefull for use with SequenceInputStream to prevent
+     * closing of the source input streams.
+     */
+    protected class NoCloseInputStream extends InputStream {
+        private final InputStream in;
+
+        public NoCloseInputStream(InputStream in) {
+            this.in = in;
+        }
+
+        @Override
+        public int read() throws IOException {
+            return in.read();
+        }
+
+        @Override
+        public int read(byte b[]) throws IOException {
+            return in.read(b);
+        }
+
+        @Override
+        public int read(byte b[], int off, int len) throws IOException {
+            return in.read(b, off, len);
+        }
+
+        @Override
+        public long skip(long n) throws IOException {
+            return in.skip(n);
+        }
+
+        @Override
+        public int available() throws IOException {
+            return in.available();
+        }
+
+        @Override
+        public void close() throws IOException {
+            // don't propagate the call
+        }
+
+        @Override
+        public void mark(int readlimit) {
+            in.mark(readlimit);
+        }
+
+        @Override
+        public void reset() throws IOException {
+            in.reset();
+        }
+
+        @Override
+        public boolean markSupported() {
+            return in.markSupported();
+        }
+
+    }
 }
--- a/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java	Fri Mar 18 11:00:10 2011 -0700
@@ -25,12 +25,10 @@
 
 package com.sun.media.sound;
 
-import java.util.Vector;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
-import java.lang.IllegalArgumentException;
 
 import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
@@ -371,7 +369,8 @@
         dos.close();
         header = baos.toByteArray();
         headerStream = new ByteArrayInputStream( header );
-        waveStream = new SequenceInputStream(headerStream,codedAudioStream);
+        waveStream = new SequenceInputStream(headerStream,
+                            new NoCloseInputStream(codedAudioStream));
 
         return (InputStream)waveStream;
     }
--- a/jdk/src/share/classes/java/awt/Font.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/awt/Font.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1985,8 +1985,22 @@
      * @since 1.2
      */
     public int canDisplayUpTo(String str) {
-        return canDisplayUpTo(new StringCharacterIterator(str), 0,
-            str.length());
+        Font2D font2d = getFont2D();
+        int len = str.length();
+        for (int i = 0; i < len; i++) {
+            char c = str.charAt(i);
+            if (font2d.canDisplay(c)) {
+                continue;
+            }
+            if (!Character.isHighSurrogate(c)) {
+                return i;
+            }
+            if (!font2d.canDisplay(str.codePointAt(i))) {
+                return i;
+            }
+            i++;
+        }
+        return -1;
     }
 
     /**
@@ -2009,11 +2023,21 @@
      * @since 1.2
      */
     public int canDisplayUpTo(char[] text, int start, int limit) {
-        while (start < limit && canDisplay(text[start])) {
-            ++start;
+        Font2D font2d = getFont2D();
+        for (int i = start; i < limit; i++) {
+            char c = text[i];
+            if (font2d.canDisplay(c)) {
+                continue;
+            }
+            if (!Character.isHighSurrogate(c)) {
+                return i;
+            }
+            if (!font2d.canDisplay(Character.codePointAt(text, i, limit))) {
+                return i;
+            }
+            i++;
         }
-
-        return start == limit ? -1 : start;
+        return -1;
     }
 
     /**
@@ -2034,13 +2058,26 @@
      * @since 1.2
      */
     public int canDisplayUpTo(CharacterIterator iter, int start, int limit) {
-        for (char c = iter.setIndex(start);
-             iter.getIndex() < limit && canDisplay(c);
-             c = iter.next()) {
+        Font2D font2d = getFont2D();
+        char c = iter.setIndex(start);
+        for (int i = start; i < limit; i++, c = iter.next()) {
+            if (font2d.canDisplay(c)) {
+                continue;
+            }
+            if (!Character.isHighSurrogate(c)) {
+                return i;
+            }
+            char c2 = iter.next();
+            // c2 could be CharacterIterator.DONE which is not a low surrogate.
+            if (!Character.isLowSurrogate(c2)) {
+                return i;
+            }
+            if (!font2d.canDisplay(Character.toCodePoint(c, c2))) {
+                return i;
+            }
+            i++;
         }
-
-        int result = iter.getIndex();
-        return result == limit ? -1 : result;
+        return -1;
     }
 
     /**
--- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java	Fri Mar 18 11:00:10 2011 -0700
@@ -58,7 +58,6 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import sun.misc.BootClassLoaderHook;
 
 /**
  * A representation of color profile data for device independent and
@@ -865,8 +864,7 @@
         case ColorSpace.CS_PYCC:
             synchronized(ICC_Profile.class) {
                 if (PYCCprofile == null) {
-                    if (BootClassLoaderHook.getHook() != null ||
-                        standardProfileExists("PYCC.pf"))
+                    if (standardProfileExists("PYCC.pf"))
                     {
                         ProfileDeferralInfo pInfo =
                             new ProfileDeferralInfo("PYCC.pf",
--- a/jdk/src/share/classes/java/io/File.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/io/File.java	Fri Mar 18 11:00:10 2011 -0700
@@ -2055,7 +2055,7 @@
      *
      * @return  a {@code Path} constructed from this abstract path
      *
-     * @throws  InvalidPathException
+     * @throws  java.nio.file.InvalidPathException
      *          if a {@code Path} object cannot be constructed from the abstract
      *          path (see {@link java.nio.file.FileSystem#getPath FileSystem.getPath})
      *
--- a/jdk/src/share/classes/java/lang/ClassLoader.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/lang/ClassLoader.java	Fri Mar 18 11:00:10 2011 -0700
@@ -51,7 +51,6 @@
 import java.util.Hashtable;
 import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
-import sun.misc.BootClassLoaderHook;
 import sun.misc.ClassFileTransformer;
 import sun.misc.CompoundEnumeration;
 import sun.misc.Resource;
@@ -1300,7 +1299,6 @@
      * Find resources from the VM's built-in classloader.
      */
     private static URL getBootstrapResource(String name) {
-        BootClassLoaderHook.preLoadResource(name);
         URLClassPath ucp = getBootstrapClassPath();
         Resource res = ucp.getResource(name);
         return res != null ? res.getURL() : null;
@@ -1814,7 +1812,6 @@
     // Invoked in the java.lang.Runtime class to implement load and loadLibrary.
     static void loadLibrary(Class fromClass, String name,
                             boolean isAbsolute) {
-        BootClassLoaderHook.preLoadLibrary(name);
         ClassLoader loader =
             (fromClass == null) ? null : fromClass.getClassLoader();
         if (sys_paths == null) {
--- a/jdk/src/share/classes/java/lang/Package.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/lang/Package.java	Fri Mar 18 11:00:10 2011 -0700
@@ -576,12 +576,10 @@
      * Returns the Manifest for the specified JAR file name.
      */
     private static Manifest loadManifest(String fn) {
-        try {
-            FileInputStream fis = new FileInputStream(fn);
-            JarInputStream jis = new JarInputStream(fis, false);
-            Manifest man = jis.getManifest();
-            jis.close();
-            return man;
+        try (FileInputStream fis = new FileInputStream(fn);
+             JarInputStream jis = new JarInputStream(fis, false))
+        {
+            return jis.getManifest();
         } catch (IOException e) {
             return null;
         }
--- a/jdk/src/share/classes/java/net/HttpURLConnection.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/net/HttpURLConnection.java	Fri Mar 18 11:00:10 2011 -0700
@@ -400,7 +400,8 @@
      * @exception ProtocolException if the method cannot be reset or if
      *              the requested method isn't valid for HTTP.
      * @exception SecurityException if a security manager is set and the
-     *              "allowHttpTrace" NetPermission is not granted.
+     *              method is "TRACE", but the "allowHttpTrace"
+     *              NetPermission is not granted.
      * @see #getRequestMethod()
      */
     public void setRequestMethod(String method) throws ProtocolException {
--- a/jdk/src/share/classes/java/net/NetPermission.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/net/NetPermission.java	Fri Mar 18 11:00:10 2011 -0700
@@ -73,6 +73,13 @@
  *   </tr>
  *
  * <tr>
+ *  <td>getNetworkInformation</td>
+ *  <td>The ability to retrieve all information about local network interfaces.</td>
+ *  <td>Malicious code can read information about network hardware such as
+ *  MAC addresses, which could be used to construct local IPv6 addresses.</td>
+ * </tr>
+ *
+ * <tr>
  *   <td>getProxySelector</td>
  *   <td>The ability to get the proxy selector used to make decisions
  *   on which proxies to use when making network connections.</td>
--- a/jdk/src/share/classes/java/net/URI.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/net/URI.java	Fri Mar 18 11:00:10 2011 -0700
@@ -991,7 +991,7 @@
      *   authority and path are taken from the given URI. </p></li>
      *
      *   <li><p> Otherwise the new URI's authority component is copied from
-     *   this URI, and its path is computed as follows: </p></li>
+     *   this URI, and its path is computed as follows: </p>
      *
      *   <ol type=a>
      *
@@ -1005,7 +1005,7 @@
      *     path and then normalizing the result as if by invoking the {@link
      *     #normalize() normalize} method. </p></li>
      *
-     *   </ol>
+     *   </ol></li>
      *
      * </ol>
      *
@@ -1511,7 +1511,7 @@
      *   fragments. </p></li>
      *
      *   <li><p> Two hierarchical URIs with identical schemes are ordered
-     *   according to the ordering of their authority components: </p></li>
+     *   according to the ordering of their authority components: </p>
      *
      *   <ul type=disc>
      *
@@ -1526,7 +1526,7 @@
      *     the URIs are ordered according to the ordering of their authority
      *     components. </p></li>
      *
-     *   </ul>
+     *   </ul></li>
      *
      *   <li><p> Finally, two hierarchical URIs with identical schemes and
      *   authority components are ordered according to the ordering of their
--- a/jdk/src/share/classes/java/net/package.html	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/net/package.html	Fri Mar 18 11:00:10 2011 -0700
@@ -31,18 +31,18 @@
 
 <p> The java.net package can be roughly divided in two sections:</p>
 <ul>
-    <li> <p><i>A Low Level API</i>, which deals with the following abstractions:</p></li>
+    <li> <p><i>A Low Level API</i>, which deals with the following abstractions:</p>
     <ul>
       <li><p><i>Addresses</i>, which are networking identifiers, like IP addresses.</p></li>
       <li><p><i>Sockets</i>, which are basic bidirectional data communication mechanisms.</p></li>
       <li><p><i>Interfaces</i>, which describe network interfaces. </p></li>
-    </ul>
-    <li> <p><i>A High Level API</i>, which deals with the following abstractions:</p></li>
+    </ul></li>
+    <li> <p><i>A High Level API</i>, which deals with the following abstractions:</p>
     <ul>
       <li><p><i>URIs</i>, which represent Universal Resource Identifiers.</p></li>
       <li><p><i>URLs</i>, which represent Universal Resource Locators.</p></li>
       <li><p><i>Connections</i>, which represents connections to the resource pointed to by <i>URLs</i>.</p></li>
-      </ul>
+      </ul></li>
 </ul>
 <h2>Addresses</h2>
 <p>Addresses are used throughout the java.net APIs as either host identifiers, or socket endpoint identifiers.</p>
--- a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java	Fri Mar 18 11:00:10 2011 -0700
@@ -48,12 +48,12 @@
  *
  * <p> An asynchronous file channel does not have a <i>current position</i>
  * within the file. Instead, the file position is specified to each read and
- * write methd that initiate asynchronous operations. A {@link CompletionHandler}
+ * write method that initiates asynchronous operations. A {@link CompletionHandler}
  * is specified as a parameter and is invoked to consume the result of the I/O
  * operation. This class also defines read and write methods that initiate
  * asynchronous operations, returning a {@link Future} to represent the pending
  * result of the operation. The {@code Future} may be used to check if the
- * operation has completed, to wait for its completion.
+ * operation has completed, wait for its completion, and retrieve the result.
  *
  * <p> In addition to read and write operations, this class defines the
  * following operations: </p>
@@ -73,13 +73,13 @@
  * which tasks are submitted to handle I/O events and dispatch to completion
  * handlers that consume the results of I/O operations on the channel. The
  * completion handler for an I/O operation initiated on a channel is guaranteed
- * to be invoked by one threads in the thread pool (This ensures that the
+ * to be invoked by one of the threads in the thread pool (This ensures that the
  * completion handler is run by a thread with the expected <em>identity</em>).
  * Where an I/O operation completes immediately, and the initiating thread is
  * itself a thread in the thread pool, then the completion handler may be invoked
  * directly by the initiating thread. When an {@code AsynchronousFileChannel} is
  * created without specifying a thread pool then the channel is associated with
- * a system-dependent and default thread pool that may be shared with other
+ * a system-dependent default thread pool that may be shared with other
  * channels. The default thread pool is configured by the system properties
  * defined by the {@link AsynchronousChannelGroup} class.
  *
--- a/jdk/src/share/classes/java/nio/channels/SocketChannel.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/nio/channels/SocketChannel.java	Fri Mar 18 11:00:10 2011 -0700
@@ -182,10 +182,13 @@
         SocketChannel sc = open();
         try {
             sc.connect(remote);
-        } finally {
-            if (!sc.isConnected()) {
-                try { sc.close(); } catch (IOException x) { }
+        } catch (Throwable x) {
+            try {
+                sc.close();
+            } catch (Throwable suppressed) {
+                x.addSuppressed(suppressed);
             }
+            throw x;
         }
         assert sc.isConnected();
         return sc;
--- a/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java	Fri Mar 18 11:00:10 2011 -0700
@@ -135,11 +135,13 @@
                 view.setTimes(attrs.lastModifiedTime(),
                               attrs.lastAccessTime(),
                               attrs.creationTime());
-            } catch (IOException x) {
+            } catch (Throwable x) {
                 // rollback
                 try {
                     Files.delete(target);
-                } catch (IOException ignore) { }
+                } catch (Throwable suppressed) {
+                    x.addSuppressed(suppressed);
+                }
                 throw x;
             }
         }
--- a/jdk/src/share/classes/java/nio/file/Files.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/nio/file/Files.java	Fri Mar 18 11:00:10 2011 -0700
@@ -129,17 +129,18 @@
      * <pre>
      *     Path path = ...
      *
-     *     // replace an existing file or create the file if it doesn't initially exist
+     *     // truncate and overwrite an existing file, or create the file if
+     *     // it doesn't initially exist
      *     OutputStream out = Files.newOutputStream(path);
      *
      *     // append to an existing file, fail if the file does not exist
      *     out = Files.newOutputStream(path, APPEND);
      *
      *     // append to an existing file, create file if it doesn't initially exist
-     *     out = Files.newOutputStream(CREATE, APPEND);
+     *     out = Files.newOutputStream(path, CREATE, APPEND);
      *
      *     // always create new file, failing if it already exists
-     *     out = Files.newOutputStream(CREATE_NEW);
+     *     out = Files.newOutputStream(path, CREATE_NEW);
      * </pre>
      *
      * @param   path
@@ -793,7 +794,8 @@
                                       FileAttribute<?>... attrs)
         throws IOException
     {
-        return TempFileHelper.createTempFile(dir, prefix, suffix, attrs);
+        return TempFileHelper.createTempFile(Objects.requireNonNull(dir),
+                                             prefix, suffix, attrs);
     }
 
     /**
@@ -890,13 +892,14 @@
                                            FileAttribute<?>... attrs)
         throws IOException
     {
-        return TempFileHelper.createTempDirectory(dir, prefix, attrs);
+        return TempFileHelper.createTempDirectory(Objects.requireNonNull(dir),
+                                                  prefix, attrs);
     }
 
     /**
      * Creates a new directory in the default temporary-file directory, using
-     * the given prefix and suffix to generate its name. The resulting {@code
-     * Path} is associated with the default {@code FileSystem}.
+     * the given prefix to generate its name. The resulting {@code Path} is
+     * associated with the default {@code FileSystem}.
      *
      * <p> This method works in exactly the manner specified by {@link
      * #createTempDirectory(Path,String,FileAttribute[])} method for the case
@@ -2583,7 +2586,7 @@
      * walkFileTree(start, EnumSet.noneOf(FileVisitOption.class), Integer.MAX_VALUE, visitor)
      * </pre></blockquote>
      * In other words, it does not follow symbolic links, and visits all levels
-     * of the file level.
+     * of the file tree.
      *
      * @param   start
      *          the starting file
@@ -3005,7 +3008,7 @@
      * or after some bytes have been written to the file.
      *
      * <p> <b>Usage example</b>: By default the method creates a new file or
-     * overrides an existing file. Suppose you instead want to append bytes
+     * overwrites an existing file. Suppose you instead want to append bytes
      * to an existing file:
      * <pre>
      *     Path path = ...
--- a/jdk/src/share/classes/java/security/CodeSigner.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/security/CodeSigner.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
 package java.security;
 
 import java.io.*;
-import java.security.cert.CRL;
 import java.security.cert.CertPath;
-import sun.misc.JavaSecurityCodeSignerAccess;
-import sun.misc.SharedSecrets;
 
 /**
  * This class encapsulates information about a code signer.
@@ -167,44 +164,6 @@
         return sb.toString();
     }
 
-    // A private attribute attached to this CodeSigner object. Can be accessed
-    // through SharedSecrets.getJavaSecurityCodeSignerAccess().[g|s]etCRLs
-    //
-    // Currently called in SignatureFileVerifier.getSigners
-    private transient CRL[] crls;
-
-    /**
-     * Sets the CRLs attached
-     * @param crls, null to clear
-     */
-    void setCRLs(CRL[] crls) {
-        this.crls = crls;
-    }
-
-    /**
-     * Returns the CRLs attached
-     * @return the crls, initially null
-     */
-    CRL[] getCRLs() {
-        return crls;
-    }
-
-    // Set up JavaSecurityCodeSignerAccess in SharedSecrets
-    static {
-        SharedSecrets.setJavaSecurityCodeSignerAccess(
-                new JavaSecurityCodeSignerAccess() {
-            @Override
-            public void setCRLs(CodeSigner signer, CRL[] crls) {
-                signer.setCRLs(crls);
-            }
-
-            @Override
-            public CRL[] getCRLs(CodeSigner signer) {
-                return signer.getCRLs();
-            }
-        });
-    }
-
     // Explicitly reset hash code value to -1
     private void readObject(ObjectInputStream ois)
         throws IOException, ClassNotFoundException {
--- a/jdk/src/share/classes/java/text/SimpleDateFormat.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/text/SimpleDateFormat.java	Fri Mar 18 11:00:10 2011 -0700
@@ -504,8 +504,8 @@
     /**
      * Cache to hold the DateTimePatterns of a Locale.
      */
-    private static final ConcurrentMap<String, String[]> cachedLocaleData
-        = new ConcurrentHashMap<String, String[]>(3);
+    private static final ConcurrentMap<Locale, String[]> cachedLocaleData
+        = new ConcurrentHashMap<Locale, String[]>(3);
 
     /**
      * Cache NumberFormat instances with Locale key.
@@ -619,8 +619,7 @@
         initializeCalendar(loc);
 
         /* try the cache first */
-        String key = getKey();
-        String[] dateTimePatterns = cachedLocaleData.get(key);
+        String[] dateTimePatterns = cachedLocaleData.get(loc);
         if (dateTimePatterns == null) { /* cache miss */
             ResourceBundle r = LocaleData.getDateFormatData(loc);
             if (!isGregorianCalendar()) {
@@ -633,7 +632,7 @@
                 dateTimePatterns = r.getStringArray("DateTimePatterns");
             }
             /* update cache */
-            cachedLocaleData.putIfAbsent(key, dateTimePatterns);
+            cachedLocaleData.putIfAbsent(loc, dateTimePatterns);
         }
         formatData = DateFormatSymbols.getInstanceRef(loc);
         if ((timeStyle >= 0) && (dateStyle >= 0)) {
@@ -684,13 +683,6 @@
         }
     }
 
-    private String getKey() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getCalendarName()).append('.');
-        sb.append(locale.getLanguage()).append('_').append(locale.getCountry()).append('_').append(locale.getVariant());
-        return sb.toString();
-    }
-
     /**
      * Returns the compiled form of the given pattern. The syntax of
      * the compiled pattern is:
--- a/jdk/src/share/classes/java/util/Calendar.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/Calendar.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -554,7 +554,7 @@
 
     /**
      * Field number for <code>get</code> and <code>set</code> indicating the
-     * daylight savings offset in milliseconds.
+     * daylight saving offset in milliseconds.
      * <p>
      * This field reflects the correct daylight saving offset value of
      * the time zone of this <code>Calendar</code> if the
--- a/jdk/src/share/classes/java/util/Currency.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/Currency.java	Fri Mar 18 11:00:10 2011 -0700
@@ -233,7 +233,9 @@
                                              "currency.properties");
                     if (propFile.exists()) {
                         Properties props = new Properties();
-                        props.load(new FileReader(propFile));
+                        try (FileReader fr = new FileReader(propFile)) {
+                            props.load(fr);
+                        }
                         Set<String> keys = props.stringPropertyNames();
                         Pattern propertiesPattern =
                             Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*([0-3])");
--- a/jdk/src/share/classes/java/util/GregorianCalendar.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/GregorianCalendar.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
  * // create a Pacific Standard Time time zone
  * SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
  *
- * // set up rules for daylight savings time
+ * // set up rules for Daylight Saving Time
  * pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
  * pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
  *
--- a/jdk/src/share/classes/java/util/TimeZone.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/TimeZone.java	Fri Mar 18 11:00:10 2011 -0700
@@ -339,8 +339,9 @@
     /**
      * Returns a name in the specified {@code style} of this {@code TimeZone}
      * suitable for presentation to the user in the default locale. If the
-     * specified {@code daylight} is {@code true}, a daylight saving time name
-     * is returned. Otherwise, a standard time name is returned.
+     * specified {@code daylight} is {@code true}, a Daylight Saving Time name
+     * is returned (even if this {@code TimeZone} doesn't observe Daylight Saving
+     * Time). Otherwise, a Standard Time name is returned.
      *
      * <p>This method is equivalent to:
      * <pre><blockquote>
@@ -348,7 +349,8 @@
      *                Locale.getDefault({@link Locale.Category#DISPLAY}))
      * </blockquote></pre>
      *
-     * @param daylight if {@code true}, return the daylight saving time name.
+     * @param daylight {@code true} specifying a Daylight Saving Time name, or
+     *                 {@code false} specifying a Standard Time name
      * @param style either {@link #LONG} or {@link #SHORT}
      * @return the human-readable name of this time zone in the default locale.
      * @exception IllegalArgumentException if {@code style} is invalid.
@@ -356,6 +358,7 @@
      * @see #getDisplayName(boolean, int, Locale)
      * @see Locale#getDefault(Locale.Category)
      * @see Locale.Category
+     * @see java.text.DateFormatSymbols#getZoneStrings()
      */
     public final String getDisplayName(boolean daylight, int style) {
         return getDisplayName(daylight, style,
@@ -365,8 +368,9 @@
     /**
      * Returns a name in the specified {@code style} of this {@code TimeZone}
      * suitable for presentation to the user in the specified {@code
-     * locale}. If the specified {@code daylight} is {@code true}, a daylight
-     * saving time name is returned. Otherwise, a standard time name is
+     * locale}. If the specified {@code daylight} is {@code true}, a Daylight
+     * Saving Time name is returned (even if this {@code TimeZone} doesn't
+     * observe Daylight Saving Time). Otherwise, a Standard Time name is
      * returned.
      *
      * <p>When looking up a time zone name, the {@linkplain
@@ -379,13 +383,15 @@
      * found, the name is returned. Otherwise, a string in the
      * <a href="#NormalizedCustomID">normalized custom ID format</a> is returned.
      *
-     * @param daylight if {@code true}, return the daylight saving time name.
+     * @param daylight {@code true} specifying a Daylight Saving Time name, or
+     *                 {@code false} specifying a Standard Time name
      * @param style either {@link #LONG} or {@link #SHORT}
-     * @param locale the locale in which to supply the display name.
+     * @param locale   the locale in which to supply the display name.
      * @return the human-readable name of this time zone in the given locale.
      * @exception IllegalArgumentException if {@code style} is invalid.
      * @exception NullPointerException if {@code locale} is {@code null}.
      * @since 1.2
+     * @see java.text.DateFormatSymbols#getZoneStrings()
      */
     public String getDisplayName(boolean daylight, int style, Locale locale) {
         if (style != SHORT && style != LONG) {
@@ -526,10 +532,10 @@
 
     /**
      * Queries if the given {@code date} is in Daylight Saving Time in
-     * this {@code TimeZone}.
+     * this time zone.
      *
-     * @param date the given {@code Date}.
-     * @return {@code true} if the given {@code date} is in Daylight Saving Time,
+     * @param date the given Date.
+     * @return {@code true} if the given date is in Daylight Saving Time,
      *         {@code false}, otherwise.
      */
     abstract public boolean inDaylightTime(Date date);
@@ -566,7 +572,7 @@
      * @param rawOffset the given time zone GMT offset in milliseconds.
      * @return an array of IDs, where the time zone for that ID has
      * the specified GMT offset. For example, "America/Phoenix" and "America/Denver"
-     * both have GMT-07:00, but differ in daylight savings behavior.
+     * both have GMT-07:00, but differ in daylight saving behavior.
      * @see #getRawOffset()
      */
     public static synchronized String[] getAvailableIDs(int rawOffset) {
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java	Fri Mar 18 11:00:10 2011 -0700
@@ -272,13 +272,6 @@
 
     private static final Node<Object> PREV_TERMINATOR, NEXT_TERMINATOR;
 
-    static {
-        PREV_TERMINATOR = new Node<Object>(null);
-        PREV_TERMINATOR.next = PREV_TERMINATOR;
-        NEXT_TERMINATOR = new Node<Object>(null);
-        NEXT_TERMINATOR.prev = NEXT_TERMINATOR;
-    }
-
     @SuppressWarnings("unchecked")
     Node<E> prevTerminator() {
         return (Node<E>) PREV_TERMINATOR;
@@ -294,6 +287,9 @@
         volatile E item;
         volatile Node<E> next;
 
+        Node() {  // default constructor for NEXT_TERMINATOR, PREV_TERMINATOR
+        }
+
         /**
          * Constructs a new node.  Uses relaxed write because item can
          * only be seen after publication via casNext or casPrev.
@@ -324,14 +320,25 @@
 
         // Unsafe mechanics
 
-        private static final sun.misc.Unsafe UNSAFE =
-            sun.misc.Unsafe.getUnsafe();
-        private static final long prevOffset =
-            objectFieldOffset(UNSAFE, "prev", Node.class);
-        private static final long itemOffset =
-            objectFieldOffset(UNSAFE, "item", Node.class);
-        private static final long nextOffset =
-            objectFieldOffset(UNSAFE, "next", Node.class);
+        private static final sun.misc.Unsafe UNSAFE;
+        private static final long prevOffset;
+        private static final long itemOffset;
+        private static final long nextOffset;
+
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                Class k = Node.class;
+                prevOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("prev"));
+                itemOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("item"));
+                nextOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("next"));
+            } catch (Exception e) {
+                throw new Error(e);
+            }
+        }
     }
 
     /**
@@ -1422,14 +1429,6 @@
         initHeadTail(h, t);
     }
 
-    // Unsafe mechanics
-
-    private static final sun.misc.Unsafe UNSAFE =
-        sun.misc.Unsafe.getUnsafe();
-    private static final long headOffset =
-        objectFieldOffset(UNSAFE, "head", ConcurrentLinkedDeque.class);
-    private static final long tailOffset =
-        objectFieldOffset(UNSAFE, "tail", ConcurrentLinkedDeque.class);
 
     private boolean casHead(Node<E> cmp, Node<E> val) {
         return UNSAFE.compareAndSwapObject(this, headOffset, cmp, val);
@@ -1439,15 +1438,25 @@
         return UNSAFE.compareAndSwapObject(this, tailOffset, cmp, val);
     }
 
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class<?> klazz) {
+    // Unsafe mechanics
+
+    private static final sun.misc.Unsafe UNSAFE;
+    private static final long headOffset;
+    private static final long tailOffset;
+    static {
+        PREV_TERMINATOR = new Node<Object>();
+        PREV_TERMINATOR.next = PREV_TERMINATOR;
+        NEXT_TERMINATOR = new Node<Object>();
+        NEXT_TERMINATOR.prev = NEXT_TERMINATOR;
         try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = ConcurrentLinkedDeque.class;
+            headOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("head"));
+            tailOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("tail"));
+        } catch (Exception e) {
+            throw new Error(e);
         }
     }
 }
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java	Fri Mar 18 11:00:10 2011 -0700
@@ -194,12 +194,22 @@
 
         // Unsafe mechanics
 
-        private static final sun.misc.Unsafe UNSAFE =
-            sun.misc.Unsafe.getUnsafe();
-        private static final long nextOffset =
-            objectFieldOffset(UNSAFE, "next", Node.class);
-        private static final long itemOffset =
-            objectFieldOffset(UNSAFE, "item", Node.class);
+        private static final sun.misc.Unsafe UNSAFE;
+        private static final long itemOffset;
+        private static final long nextOffset;
+
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                Class k = Node.class;
+                itemOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("item"));
+                nextOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("next"));
+            } catch (Exception e) {
+                throw new Error(e);
+            }
+        }
     }
 
     /**
@@ -790,14 +800,6 @@
             throw new NullPointerException();
     }
 
-    // Unsafe mechanics
-
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long headOffset =
-        objectFieldOffset(UNSAFE, "head", ConcurrentLinkedQueue.class);
-    private static final long tailOffset =
-        objectFieldOffset(UNSAFE, "tail", ConcurrentLinkedQueue.class);
-
     private boolean casTail(Node<E> cmp, Node<E> val) {
         return UNSAFE.compareAndSwapObject(this, tailOffset, cmp, val);
     }
@@ -806,15 +808,21 @@
         return UNSAFE.compareAndSwapObject(this, headOffset, cmp, val);
     }
 
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class<?> klazz) {
+    // Unsafe mechanics
+
+    private static final sun.misc.Unsafe UNSAFE;
+    private static final long headOffset;
+    private static final long tailOffset;
+    static {
         try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = ConcurrentLinkedQueue.class;
+            headOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("head"));
+            tailOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("tail"));
+        } catch (Exception e) {
+            throw new Error(e);
         }
     }
 }
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Fri Mar 18 11:00:10 2011 -0700
@@ -507,13 +507,24 @@
             return new AbstractMap.SimpleImmutableEntry<K,V>(key, v);
         }
 
-        // Unsafe mechanics
-        private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-        private static final long valueOffset =
-            objectFieldOffset(UNSAFE, "value", Node.class);
-        private static final long nextOffset =
-            objectFieldOffset(UNSAFE, "next", Node.class);
+        // UNSAFE mechanics
+
+        private static final sun.misc.Unsafe UNSAFE;
+        private static final long valueOffset;
+        private static final long nextOffset;
 
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                Class k = Node.class;
+                valueOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("value"));
+                nextOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("next"));
+            } catch (Exception e) {
+                throw new Error(e);
+            }
+        }
     }
 
     /* ---------------- Indexing -------------- */
@@ -580,10 +591,18 @@
         }
 
         // Unsafe mechanics
-        private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-        private static final long rightOffset =
-            objectFieldOffset(UNSAFE, "right", Index.class);
-
+        private static final sun.misc.Unsafe UNSAFE;
+        private static final long rightOffset;
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                Class k = Index.class;
+                rightOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("right"));
+            } catch (Exception e) {
+                throw new Error(e);
+            }
+        }
     }
 
     /* ---------------- Head nodes -------------- */
@@ -3082,20 +3101,16 @@
     }
 
     // Unsafe mechanics
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long headOffset =
-        objectFieldOffset(UNSAFE, "head", ConcurrentSkipListMap.class);
-
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class<?> klazz) {
+    private static final sun.misc.Unsafe UNSAFE;
+    private static final long headOffset;
+    static {
         try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = ConcurrentSkipListMap.class;
+            headOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("head"));
+        } catch (Exception e) {
+            throw new Error(e);
         }
     }
-
 }
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java	Fri Mar 18 11:00:10 2011 -0700
@@ -470,16 +470,20 @@
     }
 
     // Support for resetting map in clone
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private void setMap(ConcurrentNavigableMap<E,Object> map) {
+        UNSAFE.putObjectVolatile(this, mapOffset, map);
+    }
+
+    private static final sun.misc.Unsafe UNSAFE;
     private static final long mapOffset;
     static {
         try {
-            mapOffset = unsafe.objectFieldOffset
-                (ConcurrentSkipListSet.class.getDeclaredField("m"));
-        } catch (Exception ex) { throw new Error(ex); }
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = ConcurrentSkipListSet.class;
+            mapOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("m"));
+        } catch (Exception e) {
+            throw new Error(e);
+        }
     }
-    private void setMap(ConcurrentNavigableMap<E,Object> map) {
-        unsafe.putObjectVolatile(this, mapOffset, map);
-    }
-
 }
--- a/jdk/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1318,16 +1318,19 @@
     }
 
     // Support for resetting lock while deserializing
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private void resetLock() {
+        UNSAFE.putObjectVolatile(this, lockOffset, new ReentrantLock());
+    }
+    private static final sun.misc.Unsafe UNSAFE;
     private static final long lockOffset;
     static {
         try {
-            lockOffset = unsafe.objectFieldOffset
-                (CopyOnWriteArrayList.class.getDeclaredField("lock"));
-            } catch (Exception ex) { throw new Error(ex); }
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = CopyOnWriteArrayList.class;
+            lockOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("lock"));
+        } catch (Exception e) {
+            throw new Error(e);
+        }
     }
-    private void resetLock() {
-        unsafe.putObjectVolatile(this, lockOffset, new ReentrantLock());
-    }
-
 }
--- a/jdk/src/share/classes/java/util/concurrent/LinkedTransferQueue.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/LinkedTransferQueue.java	Fri Mar 18 11:00:10 2011 -0700
@@ -525,16 +525,27 @@
             return false;
         }
 
+        private static final long serialVersionUID = -3375979862319811754L;
+
         // Unsafe mechanics
-        private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-        private static final long nextOffset =
-            objectFieldOffset(UNSAFE, "next", Node.class);
-        private static final long itemOffset =
-            objectFieldOffset(UNSAFE, "item", Node.class);
-        private static final long waiterOffset =
-            objectFieldOffset(UNSAFE, "waiter", Node.class);
-
-        private static final long serialVersionUID = -3375979862319811754L;
+        private static final sun.misc.Unsafe UNSAFE;
+        private static final long itemOffset;
+        private static final long nextOffset;
+        private static final long waiterOffset;
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                Class k = Node.class;
+                itemOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("item"));
+                nextOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("next"));
+                waiterOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("waiter"));
+            } catch (Exception e) {
+                throw new Error(e);
+            }
+        }
     }
 
     /** head of the queue; null until first enqueue */
@@ -1312,23 +1323,22 @@
 
     // Unsafe mechanics
 
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long headOffset =
-        objectFieldOffset(UNSAFE, "head", LinkedTransferQueue.class);
-    private static final long tailOffset =
-        objectFieldOffset(UNSAFE, "tail", LinkedTransferQueue.class);
-    private static final long sweepVotesOffset =
-        objectFieldOffset(UNSAFE, "sweepVotes", LinkedTransferQueue.class);
-
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class<?> klazz) {
+    private static final sun.misc.Unsafe UNSAFE;
+    private static final long headOffset;
+    private static final long tailOffset;
+    private static final long sweepVotesOffset;
+    static {
         try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = LinkedTransferQueue.class;
+            headOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("head"));
+            tailOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("tail"));
+            sweepVotesOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("sweepVotes"));
+        } catch (Exception e) {
+            throw new Error(e);
         }
     }
 }
--- a/jdk/src/share/classes/java/util/concurrent/Phaser.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/Phaser.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1137,18 +1137,16 @@
 
     // Unsafe mechanics
 
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long stateOffset =
-        objectFieldOffset("state", Phaser.class);
-
-    private static long objectFieldOffset(String field, Class<?> klazz) {
+    private static final sun.misc.Unsafe UNSAFE;
+    private static final long stateOffset;
+    static {
         try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = Phaser.class;
+            stateOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("state"));
+        } catch (Exception e) {
+            throw new Error(e);
         }
     }
 }
--- a/jdk/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Fri Mar 18 11:00:10 2011 -0700
@@ -963,21 +963,16 @@
     }
 
     // Unsafe mechanics
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long allocationSpinLockOffset =
-        objectFieldOffset(UNSAFE, "allocationSpinLock",
-                          PriorityBlockingQueue.class);
-
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class<?> klazz) {
+    private static final sun.misc.Unsafe UNSAFE;
+    private static final long allocationSpinLockOffset;
+    static {
         try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
+            UNSAFE = sun.misc.Unsafe.getUnsafe();
+            Class k = PriorityBlockingQueue.class;
+            allocationSpinLockOffset = UNSAFE.objectFieldOffset
+                (k.getDeclaredField("allocationSpinLock"));
+        } catch (Exception e) {
+            throw new Error(e);
         }
     }
-
 }
--- a/jdk/src/share/classes/java/util/concurrent/SynchronousQueue.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/SynchronousQueue.java	Fri Mar 18 11:00:10 2011 -0700
@@ -279,12 +279,22 @@
             }
 
             // Unsafe mechanics
-            private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-            private static final long nextOffset =
-                objectFieldOffset(UNSAFE, "next", SNode.class);
-            private static final long matchOffset =
-                objectFieldOffset(UNSAFE, "match", SNode.class);
+            private static final sun.misc.Unsafe UNSAFE;
+            private static final long matchOffset;
+            private static final long nextOffset;
 
+            static {
+                try {
+                    UNSAFE = sun.misc.Unsafe.getUnsafe();
+                    Class k = SNode.class;
+                    matchOffset = UNSAFE.objectFieldOffset
+                        (k.getDeclaredField("match"));
+                    nextOffset = UNSAFE.objectFieldOffset
+                        (k.getDeclaredField("next"));
+                } catch (Exception e) {
+                    throw new Error(e);
+                }
+            }
         }
 
         /** The head (top) of the stack */
@@ -498,10 +508,18 @@
         }
 
         // Unsafe mechanics
-        private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-        private static final long headOffset =
-            objectFieldOffset(UNSAFE, "head", TransferStack.class);
-
+        private static final sun.misc.Unsafe UNSAFE;
+        private static final long headOffset;
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                Class k = TransferStack.class;
+                headOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("head"));
+            } catch (Exception e) {
+                throw new Error(e);
+            }
+        }
     }
 
     /** Dual Queue */
@@ -558,11 +576,22 @@
             }
 
             // Unsafe mechanics
-            private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-            private static final long nextOffset =
-                objectFieldOffset(UNSAFE, "next", QNode.class);
-            private static final long itemOffset =
-                objectFieldOffset(UNSAFE, "item", QNode.class);
+            private static final sun.misc.Unsafe UNSAFE;
+            private static final long itemOffset;
+            private static final long nextOffset;
+
+            static {
+                try {
+                    UNSAFE = sun.misc.Unsafe.getUnsafe();
+                    Class k = QNode.class;
+                    itemOffset = UNSAFE.objectFieldOffset
+                        (k.getDeclaredField("item"));
+                    nextOffset = UNSAFE.objectFieldOffset
+                        (k.getDeclaredField("next"));
+                } catch (Exception e) {
+                    throw new Error(e);
+                }
+            }
         }
 
         /** Head of queue */
@@ -791,15 +820,24 @@
             }
         }
 
-        // unsafe mechanics
-        private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-        private static final long headOffset =
-            objectFieldOffset(UNSAFE, "head", TransferQueue.class);
-        private static final long tailOffset =
-            objectFieldOffset(UNSAFE, "tail", TransferQueue.class);
-        private static final long cleanMeOffset =
-            objectFieldOffset(UNSAFE, "cleanMe", TransferQueue.class);
-
+        private static final sun.misc.Unsafe UNSAFE;
+        private static final long headOffset;
+        private static final long tailOffset;
+        private static final long cleanMeOffset;
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                Class k = TransferQueue.class;
+                headOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("head"));
+                tailOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("tail"));
+                cleanMeOffset = UNSAFE.objectFieldOffset
+                    (k.getDeclaredField("cleanMe"));
+            } catch (Exception e) {
+                throw new Error(e);
+            }
+        }
     }
 
     /**
--- a/jdk/src/share/classes/java/util/jar/JarFile.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/jar/JarFile.java	Fri Mar 18 11:00:10 2011 -0700
@@ -376,9 +376,9 @@
      */
     private byte[] getBytes(ZipEntry ze) throws IOException {
         byte[] b = new byte[(int)ze.getSize()];
-        DataInputStream is = new DataInputStream(super.getInputStream(ze));
-        is.readFully(b, 0, b.length);
-        is.close();
+        try (DataInputStream is = new DataInputStream(super.getInputStream(ze))) {
+            is.readFully(b, 0, b.length);
+        }
         return b;
     }
 
@@ -480,10 +480,10 @@
             JarEntry manEntry = getManEntry();
             if (manEntry != null) {
                 byte[] b = new byte[(int)manEntry.getSize()];
-                DataInputStream dis = new DataInputStream(
-                                                          super.getInputStream(manEntry));
-                dis.readFully(b, 0, b.length);
-                dis.close();
+                try (DataInputStream dis = new DataInputStream(
+                         super.getInputStream(manEntry))) {
+                    dis.readFully(b, 0, b.length);
+                }
 
                 int last = b.length - src.length;
                 int i = 0;
--- a/jdk/src/share/classes/java/util/zip/ZipEntry.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/java/util/zip/ZipEntry.java	Fri Mar 18 11:00:10 2011 -0700
@@ -26,7 +26,6 @@
 package java.util.zip;
 
 import java.util.Date;
-import sun.misc.BootClassLoaderHook;
 
 /**
  * This class is used to represent a ZIP file entry.
--- a/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,6 @@
  * <p> Every implementation of the Java platform is required to support the
  * following standard <code>SecretKeyFactory</code> algorithms:
  * <ul>
- * <li><tt>AES</tt></li>
  * <li><tt>DES</tt></li>
  * <li><tt>DESede</tt></li>
  * </ul>
--- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Fri Mar 18 11:00:10 2011 -0700
@@ -441,13 +441,6 @@
                 Synthesizer synth = getSynthesizer();
                 if (synth instanceof ReferenceCountingDevice) {
                     rec = ((ReferenceCountingDevice) synth).getReceiverReferenceCounting();
-                    // only use MixerSynth if it could successfully load a soundbank
-                    if (synth.getClass().toString().contains("com.sun.media.sound.MixerSynth")
-                        && (synth.getDefaultSoundbank() == null)) {
-                        // don't use this receiver if no soundbank available
-                        rec = null;
-                        synth.close();
-                    }
                 } else {
                     synth.open();
                     try {
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Fri Mar 18 11:00:10 2011 -0700
@@ -174,6 +174,8 @@
         if(!wasIcon(f)) {
             Rectangle r = getBoundsForIconOf(f);
             desktopIcon.setBounds(r.x, r.y, r.width, r.height);
+            // we must validate the hierarchy to not break the hw/lw mixing
+            desktopIcon.revalidate();
             setWasIcon(f, Boolean.TRUE);
         }
 
@@ -453,11 +455,9 @@
 
     /** This moves the <code>JComponent</code> and repaints the damaged areas. */
     public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
-        boolean didResize = (f.getWidth() != newWidth || f.getHeight() != newHeight);
         f.setBounds(newX, newY, newWidth, newHeight);
-        if(didResize) {
-            f.validate();
-        }
+        // we must validate the hierarchy to not break the hw/lw mixing
+        f.revalidate();
     }
 
     /** Convenience method to remove the desktopIcon of <b>f</b> is necessary. */
--- a/jdk/src/share/classes/javax/swing/JComponent.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/JComponent.java	Fri Mar 18 11:00:10 2011 -0700
@@ -5158,31 +5158,30 @@
                 }
             }
         }
-
         try {
-            g = safelyGetGraphics(paintingComponent, c);
-            try {
-                if (hasBuffer) {
-                    RepaintManager rm = RepaintManager.currentManager(
-                                               bufferedComponent);
-                    rm.beginPaint();
-                    try {
-                        rm.paint(paintingComponent, bufferedComponent, g,
-                                 paintImmediatelyClip.x,
-                                 paintImmediatelyClip.y,
-                                 paintImmediatelyClip.width,
-                                 paintImmediatelyClip.height);
-                    } finally {
-                        rm.endPaint();
+            if ((g = safelyGetGraphics(paintingComponent, c)) != null) {
+                try {
+                    if (hasBuffer) {
+                        RepaintManager rm = RepaintManager.currentManager(
+                                bufferedComponent);
+                        rm.beginPaint();
+                        try {
+                            rm.paint(paintingComponent, bufferedComponent, g,
+                                    paintImmediatelyClip.x,
+                                    paintImmediatelyClip.y,
+                                    paintImmediatelyClip.width,
+                                    paintImmediatelyClip.height);
+                        } finally {
+                            rm.endPaint();
+                        }
+                    } else {
+                        g.setClip(paintImmediatelyClip.x, paintImmediatelyClip.y,
+                                paintImmediatelyClip.width, paintImmediatelyClip.height);
+                        paintingComponent.paint(g);
                     }
+                } finally {
+                    g.dispose();
                 }
-                else {
-                    g.setClip(paintImmediatelyClip.x,paintImmediatelyClip.y,
-                       paintImmediatelyClip.width,paintImmediatelyClip.height);
-                    paintingComponent.paint(g);
-                }
-            } finally {
-                g.dispose();
             }
         }
         finally {
--- a/jdk/src/share/classes/javax/swing/JViewport.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/JViewport.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1111,6 +1111,8 @@
                 view.setLocation(newX, newY);
                 repaintAll = false;
             }
+            // we must validate the hierarchy to not break the hw/lw mixing
+            revalidate();
             fireStateChanged();
         }
     }
--- a/jdk/src/share/classes/javax/swing/text/Utilities.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/Utilities.java	Fri Mar 18 11:00:10 2011 -0700
@@ -390,11 +390,15 @@
             }
             if ((x >= currX) && (x < nextX)) {
                 // found the hit position... return the appropriate side
-                if ((round == false) || ((x - currX) < (nextX - x))) {
-                    return i - txtOffset;
-                } else {
-                    return i + 1 - txtOffset;
+                int offset = ((round == false) || ((x - currX) < (nextX - x))) ?
+                        (i - txtOffset) : (i + 1 - txtOffset);
+                // the length of the string measured as a whole may differ from
+                // the sum of individual character lengths, for example if
+                // fractional metrics are enabled; and we must guard from this.
+                while (metrics.charsWidth(txt, txtOffset, offset + 1) > (x - x0)) {
+                    offset--;
                 }
+                return (offset < 0 ? 0 : offset);
             }
             currX = nextX;
         }
@@ -404,24 +408,6 @@
     }
 
     /**
-     * Adjust text offset so that the length of a resulting string as a whole
-     * fits into the specified width.
-     */
-    static int adjustOffsetForFractionalMetrics(
-            Segment s, FontMetrics fm, int offset, int width) {
-        // Sometimes the offset returned by getTabbedTextOffset is beyond the
-        // available area, when fractional metrics are enabled. We should
-        // guard against this.
-        if (offset < s.count) {
-            while (offset > 0 &&
-                    fm.charsWidth(s.array, s.offset, offset + 1) > width) {
-                offset--;
-            }
-        }
-        return offset;
-    }
-
-    /**
      * Determine where to break the given text to fit
      * within the given span. This tries to find a word boundary.
      * @param s  the source of the text
@@ -443,7 +429,6 @@
         int txtCount = s.count;
         int index = Utilities.getTabbedTextOffset(s, metrics, x0, x,
                                                   e, startOffset, false);
-        index = adjustOffsetForFractionalMetrics(s, metrics, index, x - x0);
 
         if (index >= txtCount - 1) {
             return txtCount;
--- a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Fri Mar 18 11:00:10 2011 -0700
@@ -239,11 +239,9 @@
                                                 tabBase, tabBase + currentWidth,
                                                 this, p0);
         } else {
-            int offset = Utilities.getTabbedTextOffset(segment, metrics,
-                    tabBase, tabBase + currentWidth, this, p0, false);
-            offset = Utilities.adjustOffsetForFractionalMetrics(
-                    segment, metrics, offset, currentWidth);
-            p = p0 + offset;
+            p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
+                                                   tabBase, tabBase + currentWidth,
+                                                   this, p0, false);
         }
         SegmentCache.releaseSharedSegment(segment);
         return p;
--- a/jdk/src/share/classes/javax/swing/text/html/CSSBorder.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/CSSBorder.java	Fri Mar 18 11:00:10 2011 -0700
@@ -203,10 +203,11 @@
 
     public void paintBorder(Component c, Graphics g,
                                         int x, int y, int width, int height) {
-        assert (g instanceof Graphics2D) : "need Graphics2D instanse";
-        Graphics2D g2 = (Graphics2D) g;
-        Color savedColor = g2.getColor();
-        Shape savedClip = g2.getClip();
+        if (!(g instanceof Graphics2D)) {
+            return;
+        }
+
+        Graphics2D g2 = (Graphics2D) g.create();
 
         int[] widths = getWidths();
 
@@ -238,16 +239,16 @@
                 BorderPainter painter = getBorderPainter(i);
 
                 double angle = i * Math.PI / 2;
+                g2.setClip(g.getClip()); // Restore initial clip
                 g2.translate(intCorners[i][0], intCorners[i][1]);
                 g2.rotate(angle);
-                g2.setClip(shape);
-                painter.paint(shape, g, color, i);
+                g2.clip(shape);
+                painter.paint(shape, g2, color, i);
                 g2.rotate(-angle);
                 g2.translate(-intCorners[i][0], -intCorners[i][1]);
             }
         }
-        g2.setColor(savedColor);
-        g2.setClip(savedClip);
+        g2.dispose();
     }
 
 
--- a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,6 @@
             {"appletclassloader.fileexception", "{0} exception when loading: {1}"},
             {"appletclassloader.filedeath", "{0} killed when loading: {1}"},
             {"appletclassloader.fileerror", "{0} error when loading: {1}"},
-            {"appletclassloader.findclass.verbose.findclass", "{0} find class {1}"},
             {"appletclassloader.findclass.verbose.openstream", "Opening stream to: {0} to get {1}"},
             {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource for name: {0}"},
             {"appletclassloader.getresource.verbose.found", "Found resource: {0} as a system resource"},
--- a/jdk/src/share/classes/sun/font/StrikeCache.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/font/StrikeCache.java	Fri Mar 18 11:00:10 2011 -0700
@@ -319,8 +319,7 @@
                 ArrayList<Long> gids = null;
 
                 for (int i = 0; i < glyphPtrs.length; i++) {
-                    if (glyphPtrs[i] != 0 && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
-                            && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+                    if (glyphPtrs[i] != 0 && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0) {
 
                         if (gids == null) {
                             gids = new ArrayList<Long>();
@@ -330,6 +329,8 @@
                 }
 
                 if (gids != null) {
+                    // Any reference by the disposers to the native glyph ptrs
+                    // must be done before this returns.
                     notifyDisposeListeners(gids);
                 }
             }
@@ -345,8 +346,7 @@
 
                 for (int i=0; i < glyphPtrs.length; i++) {
                     if (glyphPtrs[i] != 0
-                            && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
-                            && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+                            && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0) {
 
                         if (gids == null) {
                             gids = new ArrayList<Long>();
@@ -356,6 +356,8 @@
                 }
 
                 if (gids != null) {
+                    // Any reference by the disposers to the native glyph ptrs
+                    // must be done before this returns.
                     notifyDisposeListeners(gids);
                 }
         }
--- a/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Fri Mar 18 11:00:10 2011 -0700
@@ -109,7 +109,7 @@
         Region clip = sg.getCompClip();
         int abox[] = new int[4];
         AATileGenerator aatg =
-            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0,
+            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, lw1, lw2,
                                             clip, abox);
         if (aatg == null) {
             // Nothing to render
--- a/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.misc;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URLStreamHandlerFactory;
-import sun.misc.URLClassPath;
-
-/**
- * BootClassLoaderHook defines an interface for a hook to inject
- * into the bootstrap class loader.
- *
- * With jkernel now removed, no hook is set
- */
-public abstract class BootClassLoaderHook {
-    private static BootClassLoaderHook bootLoaderHook = null;
-    public static synchronized BootClassLoaderHook getHook() {
-        return bootLoaderHook;
-    }
-
-    public static synchronized void setHook(BootClassLoaderHook hook) {
-        if (!VM.isBooted()) {
-            throw new InternalError("hook can only be set after VM is booted");
-        }
-        if (bootLoaderHook != null) {
-            throw new InternalError("hook should not be reinitialized");
-        }
-        bootLoaderHook = hook;
-    }
-
-    protected BootClassLoaderHook() {
-    }
-
-    /**
-     * A method to be invoked before a class loader loads
-     * a bootstrap class.
-     *
-     * @param classname the binary name of the class
-     */
-    public static void preLoadClass(String classname) {
-        BootClassLoaderHook hook = getHook();
-        if (hook != null) {
-            hook.loadBootstrapClass(classname);
-        }
-    }
-
-    /**
-     * A method to be invoked before a class loader loads
-     * a resource.
-     *
-     * @param resourcename the resource name
-     */
-    public static void preLoadResource(String resourcename) {
-        BootClassLoaderHook hook = getHook();
-        if (hook != null) {
-            hook.getBootstrapResource(resourcename);
-        }
-    }
-
-    /**
-     * A method to be invoked before a library is loaded.
-     *
-     * @param libname the name of the library
-     */
-    public static void preLoadLibrary(String libname) {
-        BootClassLoaderHook hook = getHook();
-        if (hook != null) {
-            hook.loadLibrary(libname);
-        }
-    }
-
-    /**
-     * Returns a pathname of a JAR or class that the hook loads
-     * per this loadClass request; or null.
-     *
-     * @param classname the binary name of the class
-     */
-    public abstract String loadBootstrapClass(String className);
-
-    /**
-     * Returns a pathname of a resource file that the hook loads
-     * per this getResource request; or null.
-     *
-     * @param resourceName the resource name
-     */
-    public abstract String getBootstrapResource(String resourceName);
-
-    /**
-     * Returns true if the hook successfully performs an operation per
-     * this loadLibrary request; or false if it fails.
-     *
-     * @param libname the name of the library
-     */
-    public abstract boolean loadLibrary(String libname);
-
-    /**
-     * Returns a bootstrap class path constructed by the hook.
-     *
-     * @param bcp VM's bootstrap class path
-     * @param factory Launcher's URL stream handler
-     */
-    public abstract URLClassPath getBootstrapClassPath(URLClassPath bcp,
-            URLStreamHandlerFactory factory);
-
-    /**
-     * Returns true if the current thread is in the process of doing
-     * a prefetching operation.
-     */
-    public abstract boolean isCurrentThreadPrefetching();
-
-    /**
-     * Returns true if the hook successfully prefetches the specified file.
-     *
-     * @param name a platform independent pathname
-     */
-    public abstract boolean prefetchFile(String name);
-}
--- a/jdk/src/share/classes/sun/misc/JavaSecurityCodeSignerAccess.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.misc;
-
-import java.security.CodeSigner;
-import java.security.cert.CRL;
-
-public interface JavaSecurityCodeSignerAccess {
-    void setCRLs(CodeSigner signer, CRL[] crls);
-    CRL[] getCRLs(CodeSigner signer);
-}
--- a/jdk/src/share/classes/sun/misc/Launcher.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/misc/Launcher.java	Fri Mar 18 11:00:10 2011 -0700
@@ -38,7 +38,6 @@
 import java.util.Set;
 import java.util.Vector;
 import java.security.AccessController;
-import java.security.AllPermission;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
 import java.security.AccessControlContext;
@@ -117,18 +116,6 @@
         return loader;
     }
 
-    public static void addURLToAppClassLoader(URL u) {
-        AccessController.checkPermission(new AllPermission());
-        ClassLoader loader = Launcher.getLauncher().getClassLoader();
-        ((Launcher.AppClassLoader) loader).addAppURL(u);
-    }
-
-    public static void addURLToExtClassLoader(URL u) {
-        AccessController.checkPermission(new AllPermission());
-        ClassLoader loader = Launcher.getLauncher().getClassLoader();
-        ((Launcher.ExtClassLoader) loader.getParent()).addExtURL(u);
-    }
-
     /*
      * The class loader used for loading installed extensions.
      */
@@ -247,11 +234,6 @@
             return null;
         }
 
-        protected Class findClass(String name) throws ClassNotFoundException {
-            BootClassLoaderHook.preLoadClass(name);
-            return super.findClass(name);
-        }
-
         private static AccessControlContext getContext(File[] dirs)
             throws IOException
         {
@@ -316,7 +298,6 @@
         public Class loadClass(String name, boolean resolve)
             throws ClassNotFoundException
         {
-            BootClassLoaderHook.preLoadClass(name);
             int i = name.lastIndexOf('.');
             if (i != -1) {
                 SecurityManager sm = System.getSecurityManager();
@@ -373,10 +354,6 @@
 
             return acc;
         }
-
-        void addAppURL(URL url) {
-            super.addURL(url);
-        }
     }
 
     private static class BootClassPathHolder {
@@ -413,11 +390,7 @@
     }
 
     public static URLClassPath getBootstrapClassPath() {
-        URLClassPath bcp = BootClassPathHolder.bcp;
-        // if DownloadManager is installed, return the bootstrap class path
-        // maintained by the Java kernel
-        BootClassLoaderHook hook = BootClassLoaderHook.getHook();
-        return hook == null ? bcp : hook.getBootstrapClassPath(bcp, factory);
+        return BootClassPathHolder.bcp;
     }
 
     private static URL[] pathToURLs(File[] path) {
--- a/jdk/src/share/classes/sun/misc/SharedSecrets.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/misc/SharedSecrets.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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.util.jar.JarFile;
 import java.io.Console;
 import java.io.FileDescriptor;
-import java.security.CodeSigner;
 import java.security.ProtectionDomain;
 
 /** A repository of "shared secrets", which are a mechanism for
@@ -49,7 +48,6 @@
     private static JavaNioAccess javaNioAccess;
     private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
     private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
-    private static JavaSecurityCodeSignerAccess javaSecurityCodeSignerAccess;
 
     public static JavaUtilJarAccess javaUtilJarAccess() {
         if (javaUtilJarAccess == null) {
@@ -127,16 +125,4 @@
                 unsafe.ensureClassInitialized(ProtectionDomain.class);
             return javaSecurityProtectionDomainAccess;
     }
-
-    public static void setJavaSecurityCodeSignerAccess
-            (JavaSecurityCodeSignerAccess jscsa) {
-        javaSecurityCodeSignerAccess = jscsa;
-    }
-
-    public static JavaSecurityCodeSignerAccess
-            getJavaSecurityCodeSignerAccess() {
-        if (javaSecurityCodeSignerAccess == null)
-            unsafe.ensureClassInitialized(CodeSigner.class);
-        return javaSecurityCodeSignerAccess;
-    }
 }
--- a/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java	Fri Mar 18 11:00:10 2011 -0700
@@ -69,32 +69,33 @@
      */
     private int readChunkHeader () throws IOException {
         boolean gotCR = false;
-        char c;
+        int c;
         char[] len_arr = new char [16];
         int len_size = 0;
         boolean end_of_len = false;
 
-        while ((c=(char)in.read())!= -1) {
+        while ((c=in.read())!= -1) {
+            char ch = (char) c;
             if (len_size == len_arr.length -1) {
                 throw new IOException ("invalid chunk header");
             }
             if (gotCR) {
-                if (c == LF) {
+                if (ch == LF) {
                     int l = numeric (len_arr, len_size);
                     return l;
                 } else {
                     gotCR = false;
                 }
                 if (!end_of_len) {
-                    len_arr[len_size++] = c;
+                    len_arr[len_size++] = ch;
                 }
             } else {
-                if (c == CR) {
+                if (ch == CR) {
                     gotCR = true;
-                } else if (c == ';') {
+                } else if (ch == ';') {
                     end_of_len = true;
                 } else if (!end_of_len) {
-                    len_arr[len_size++] = c;
+                    len_arr[len_size++] = ch;
                 }
             }
         }
--- a/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java	Fri Mar 18 11:00:10 2011 -0700
@@ -475,8 +475,8 @@
                 assert !target.isOpen();
                 try {
                     close();
-                } catch (IOException ignore) {
-                    // nothing we can do
+                } catch (Throwable suppressed) {
+                    e.addSuppressed(suppressed);
                 }
                 throw e;
             } catch (IOException ioe) {
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,14 +42,12 @@
  * Cipher implementation class. This class currently supports
  * DES, DESede, AES, ARCFOUR, and Blowfish.
  *
- * This class is designed to support ECB and CBC with NoPadding and
- * PKCS5Padding for both. It will use its own padding impl if the
- * native mechanism does not support padding.
+ * This class is designed to support ECB, CBC, CTR with NoPadding
+ * and ECB, CBC with PKCS5Padding. It will use its own padding impl
+ * if the native mechanism does not support padding.
  *
- * Note that PKCS#11 current only supports ECB and CBC. There are no
- * provisions for other modes such as CFB, OFB, PCBC, or CTR mode.
- * However, CTR could be implemented relatively easily (and efficiently)
- * on top of ECB mode in this class, if need be.
+ * Note that PKCS#11 currently only supports ECB, CBC, and CTR.
+ * There are no provisions for other modes such as CFB, OFB, and PCBC.
  *
  * @author  Andreas Sterbenz
  * @since   1.5
@@ -60,6 +58,8 @@
     private final static int MODE_ECB = 3;
     // mode constant for CBC mode
     private final static int MODE_CBC = 4;
+    // mode constant for CTR mode
+    private final static int MODE_CTR = 5;
 
     // padding constant for NoPadding
     private final static int PAD_NONE = 5;
@@ -157,7 +157,7 @@
     private byte[] padBuffer;
     private int padBufferLen;
 
-    // original IV, if in MODE_CBC
+    // original IV, if in MODE_CBC or MODE_CTR
     private byte[] iv;
 
     // number of bytes buffered internally by the native mechanism and padBuffer
@@ -213,6 +213,8 @@
                         ("CBC mode not supported with stream ciphers");
             }
             result = MODE_CBC;
+        } else if (mode.equals("CTR")) {
+            result = MODE_CTR;
         } else {
             throw new NoSuchAlgorithmException("Unsupported mode " + mode);
         }
@@ -228,6 +230,10 @@
         if (padding.equals("NOPADDING")) {
             paddingType = PAD_NONE;
         } else if (padding.equals("PKCS5PADDING")) {
+            if (this.blockMode == MODE_CTR) {
+                throw new NoSuchPaddingException
+                    ("PKCS#5 padding not supported with CTR mode");
+            }
             paddingType = PAD_PKCS5;
             if (mechanism != CKM_DES_CBC_PAD && mechanism != CKM_DES3_CBC_PAD &&
                     mechanism != CKM_AES_CBC_PAD) {
@@ -348,11 +354,14 @@
                             ("IV not used in ECB mode");
                 }
             }
-        } else { // MODE_CBC
+        } else { // MODE_CBC or MODE_CTR
             if (iv == null) {
                 if (encrypt == false) {
-                    throw new InvalidAlgorithmParameterException
-                            ("IV must be specified for decryption in CBC mode");
+                    String exMsg =
+                        (blockMode == MODE_CBC ?
+                         "IV must be specified for decryption in CBC mode" :
+                         "IV must be specified for decryption in CTR mode");
+                    throw new InvalidAlgorithmParameterException(exMsg);
                 }
                 // generate random IV
                 if (random == null) {
@@ -410,13 +419,15 @@
         if (session == null) {
             session = token.getOpSession();
         }
+        CK_MECHANISM mechParams = (blockMode == MODE_CTR?
+            new CK_MECHANISM(mechanism, new CK_AES_CTR_PARAMS(iv)) :
+            new CK_MECHANISM(mechanism, iv));
+
         try {
             if (encrypt) {
-                token.p11.C_EncryptInit(session.id(),
-                        new CK_MECHANISM(mechanism, iv), p11Key.keyID);
+                token.p11.C_EncryptInit(session.id(), mechParams, p11Key.keyID);
             } else {
-                token.p11.C_DecryptInit(session.id(),
-                        new CK_MECHANISM(mechanism, iv), p11Key.keyID);
+                token.p11.C_DecryptInit(session.id(), mechParams, p11Key.keyID);
             }
         } catch (PKCS11Exception ex) {
             // release session when initialization failed
--- a/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,11 @@
     // mode constant for public key decryption (verifying)
     private final static int MODE_VERIFY  = 4;
 
+    // padding type constant for NoPadding
+    private final static int PAD_NONE = 1;
+    // padding type constant for PKCS1Padding
+    private final static int PAD_PKCS1 = 2;
+
     // token instance
     private final Token token;
 
@@ -77,6 +82,9 @@
     // mode, one of MODE_* above
     private int mode;
 
+    // padding, one of PAD_* above
+    private int padType;
+
     private byte[] buffer;
     private int bufOfs;
 
@@ -113,8 +121,10 @@
     protected void engineSetPadding(String padding)
             throws NoSuchPaddingException {
         String lowerPadding = padding.toLowerCase(Locale.ENGLISH);
-        if (lowerPadding.equals("pkcs1Padding")) {
-            // empty
+        if (lowerPadding.equals("pkcs1padding")) {
+            padType = PAD_PKCS1;
+        } else if (lowerPadding.equals("nopadding")) {
+            padType = PAD_NONE;
         } else {
             throw new NoSuchPaddingException("Unsupported padding " + padding);
         }
@@ -209,7 +219,8 @@
         int n = (p11Key.keyLength() + 7) >> 3;
         outputSize = n;
         buffer = new byte[n];
-        maxInputSize = encrypt ? (n - PKCS1_MIN_PADDING_LENGTH) : n;
+        maxInputSize = ((padType == PAD_PKCS1 && encrypt) ?
+                            (n - PKCS1_MIN_PADDING_LENGTH) : n);
         try {
             initialize();
         } catch (PKCS11Exception e) {
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +621,16 @@
                 m(CKM_AES_CBC_PAD, CKM_AES_CBC));
         d(CIP, "AES/ECB",                       P11Cipher,      s("AES"),
                 m(CKM_AES_ECB));
+        d(CIP, "AES/CTR/NoPadding",             P11Cipher,
+                m(CKM_AES_CTR));
         d(CIP, "Blowfish/CBC",                  P11Cipher,
                 m(CKM_BLOWFISH_CBC));
 
         // XXX RSA_X_509, RSA_OAEP not yet supported
-        d(CIP, "RSA/ECB/PKCS1Padding",          P11RSACipher,
+        d(CIP, "RSA/ECB/PKCS1Padding",          P11RSACipher,   s("RSA"),
                 m(CKM_RSA_PKCS));
+        d(CIP, "RSA/ECB/NoPadding",             P11RSACipher,
+                m(CKM_RSA_X_509));
 
         d(SIG, "RawDSA",        P11Signature,           s("NONEwithDSA"),
                 m(CKM_DSA));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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.pkcs11.wrapper;
+
+/**
+ * This class represents the necessary parameters required by
+ * the CKM_AES_CTR mechanism as defined in CK_AES_CTR_PARAMS structure.<p>
+ * <B>PKCS#11 structure:</B>
+ * <PRE>
+ * typedef struct CK_AES_CTR_PARAMS {
+ *   CK_ULONG ulCounterBits;
+ *   CK_BYTE cb[16];
+ * } CK_AES_CTR_PARAMS;
+ * </PRE>
+ *
+ * @author Yu-Ching Valerie Peng
+ * @since   1.7
+ */
+public class CK_AES_CTR_PARAMS {
+
+    private final long ulCounterBits;
+    private final byte cb[];
+
+    public CK_AES_CTR_PARAMS(byte[] cb) {
+        ulCounterBits = 128;
+        this.cb = cb.clone();
+    }
+
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+
+        buffer.append(Constants.INDENT);
+        buffer.append("ulCounterBits: ");
+        buffer.append(ulCounterBits);
+        buffer.append(Constants.NEWLINE);
+
+        buffer.append(Constants.INDENT);
+        buffer.append("cb: ");
+        buffer.append(Functions.toHexString(cb));
+
+        return buffer.toString();
+    }
+}
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -48,6 +48,7 @@
 package sun.security.pkcs11.wrapper;
 
 import java.math.BigInteger;
+import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
 
 /**
  * class CK_MECHANISM specifies a particular mechanism and any parameters it
@@ -127,6 +128,10 @@
         init(mechanism, params);
     }
 
+    public CK_MECHANISM(long mechanism, CK_AES_CTR_PARAMS params) {
+        init(mechanism, params);
+    }
+
     private void init(long mechanism, Object pParameter) {
         this.mechanism = mechanism;
         this.pParameter = pParameter;
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -47,8 +47,6 @@
 
 package sun.security.pkcs11.wrapper;
 
-
-
 /**
  * This interface holds constants of the PKCS#11 v2.11 standard.
  * This is mainly the content of the 'pkcs11t.h' header file.
@@ -306,6 +304,10 @@
 
     public static final long  CKK_VENDOR_DEFINED  = 0x80000000L;
 
+    // new for v2.20 amendment 3
+    //public static final long  CKK_CAMELLIA          = 0x00000025L;
+    //public static final long  CKK_ARIA              = 0x00000026L;
+
     // pseudo key type ANY (for template manager)
     public static final long  PCKK_ANY            = 0x7FFFFF22L;
 
@@ -690,6 +692,34 @@
 
     public static final long  CKM_VENDOR_DEFINED             = 0x80000000L;
 
+    // new for v2.20 amendment 3
+    public static final long  CKM_SHA224                     = 0x00000255L;
+    public static final long  CKM_SHA224_HMAC                = 0x00000256L;
+    public static final long  CKM_SHA224_HMAC_GENERAL        = 0x00000257L;
+    public static final long  CKM_SHA224_KEY_DERIVATION      = 0x00000396L;
+    public static final long  CKM_SHA224_RSA_PKCS            = 0x00000046L;
+    public static final long  CKM_SHA224_RSA_PKCS_PSS        = 0x00000047L;
+    public static final long  CKM_AES_CTR                    = 0x00001086L;
+    /*
+    public static final long  CKM_CAMELLIA_KEY_GEN           = 0x00000550L;
+    public static final long  CKM_CAMELLIA_ECB               = 0x00000551L;
+    public static final long  CKM_CAMELLIA_CBC               = 0x00000552L;
+    public static final long  CKM_CAMELLIA_MAC               = 0x00000553L;
+    public static final long  CKM_CAMELLIA_MAC_GENERAL       = 0x00000554L;
+    public static final long  CKM_CAMELLIA_CBC_PAD           = 0x00000555L;
+    public static final long  CKM_CAMELLIA_ECB_ENCRYPT_DATA  = 0x00000556L;
+    public static final long  CKM_CAMELLIA_CBC_ENCRYPT_DATA  = 0x00000557L;
+    public static final long  CKM_CAMELLIA_CTR               = 0x00000558L;
+    public static final long  CKM_ARIA_KEY_GEN               = 0x00000560L;
+    public static final long  CKM_ARIA_ECB                   = 0x00000561L;
+    public static final long  CKM_ARIA_CBC                   = 0x00000562L;
+    public static final long  CKM_ARIA_MAC                   = 0x00000563L;
+    public static final long  CKM_ARIA_MAC_GENERAL           = 0x00000564L;
+    public static final long  CKM_ARIA_CBC_PAD               = 0x00000565L;
+    public static final long  CKM_ARIA_ECB_ENCRYPT_DATA      = 0x00000566L;
+    public static final long  CKM_ARIA_CBC_ENCRYPT_DATA      = 0x00000567L;
+    */
+
     // NSS private
     public static final long  CKM_NSS_TLS_PRF_GENERAL        = 0x80000373L;
 
@@ -881,7 +911,8 @@
 
     /* The following MGFs are defined */
     public static final long  CKG_MGF1_SHA1       =  0x00000001L;
-
+    // new for v2.20 amendment 3
+    public static final long  CKG_MGF1_SHA224     = 0x00000005L;
 
     /* The following encoding parameter sources are defined */
     public static final long  CKZ_DATA_SPECIFIED   = 0x00000001L;
--- a/jdk/src/share/classes/sun/security/tools/JarSigner.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 package sun.security.tools;
 
 import java.io.*;
-import java.security.cert.X509CRL;
 import java.util.*;
 import java.util.zip.*;
 import java.util.jar.*;
@@ -36,7 +35,6 @@
 import java.text.Collator;
 import java.text.MessageFormat;
 import java.security.cert.Certificate;
-import java.security.cert.CRL;
 import java.security.cert.X509Certificate;
 import java.security.cert.CertificateException;
 import java.security.*;
@@ -58,7 +56,6 @@
 import sun.security.x509.*;
 import sun.security.util.*;
 import sun.misc.BASE64Encoder;
-import sun.misc.SharedSecrets;
 
 
 /**
@@ -117,13 +114,11 @@
     static final int SIGNED_BY_ALIAS = 0x08;    // signer is in alias list
 
     X509Certificate[] certChain;    // signer's cert chain (when composing)
-    Set<X509CRL> crls;                 // signer provided CRLs
     PrivateKey privateKey;          // private key
     KeyStore store;                 // the keystore specified by -keystore
                                     // or the default keystore, never null
 
     String keystore; // key store file
-    List<String> crlfiles = new ArrayList<>();  // CRL files to add
     boolean nullStream = false; // null keystore input stream (NONE)
     boolean token = false; // token-based keystore
     String jarfile;  // jar files to sign or verify
@@ -151,7 +146,6 @@
     boolean signManifest = true; // "sign" the whole manifest
     boolean externalSF = true; // leave the .SF out of the PKCS7 block
     boolean strict = false;  // treat warnings as error
-    boolean autoCRL = false;    // Automatcially add CRL defined in cert
 
     // read zip entry raw bytes
     private ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
@@ -232,29 +226,6 @@
             } else {
                 loadKeyStore(keystore, true);
                 getAliasInfo(alias);
-                crls = new HashSet<X509CRL>();
-                if (crlfiles.size() > 0 || autoCRL) {
-                    CertificateFactory fac =
-                            CertificateFactory.getInstance("X509");
-                    List<CRL> list = new ArrayList<>();
-                    for (String file: crlfiles) {
-                        Collection<? extends CRL> tmp = KeyTool.loadCRLs(file);
-                        for (CRL crl: tmp) {
-                            if (crl instanceof X509CRL) {
-                                crls.add((X509CRL)crl);
-                            }
-                        }
-                    }
-                    if (autoCRL) {
-                        List<CRL> crlsFromCert =
-                                KeyTool.readCRLsFromCert(certChain[0]);
-                        for (CRL crl: crlsFromCert) {
-                            if (crl instanceof X509CRL) {
-                                crls.add((X509CRL)crl);
-                            }
-                        }
-                    }
-                }
 
                 // load the alternative signing mechanism
                 if (altSignerClass != null) {
@@ -396,13 +367,6 @@
             } else if (collator.compare(flags, "-digestalg") ==0) {
                 if (++n == args.length) usageNoArg();
                 digestalg = args[n];
-            } else if (collator.compare(flags, "-crl") ==0) {
-                if ("auto".equals(modifier)) {
-                    autoCRL = true;
-                } else {
-                    if (++n == args.length) usageNoArg();
-                    crlfiles.add(args[n]);
-                }
             } else if (collator.compare(flags, "-certs") ==0) {
                 showcerts = true;
             } else if (collator.compare(flags, "-strict") ==0) {
@@ -549,9 +513,6 @@
                 (".sigalg.algorithm.name.of.signature.algorithm"));
         System.out.println();
         System.out.println(rb.getString
-                (".crl.auto.file.include.CRL.in.signed.jar"));
-        System.out.println();
-        System.out.println(rb.getString
                 (".verify.verify.a.signed.JAR.file"));
         System.out.println();
         System.out.println(rb.getString
@@ -691,20 +652,6 @@
                             if (showcerts) {
                                 sb.append(si);
                                 sb.append('\n');
-                                CRL[] crls = SharedSecrets
-                                        .getJavaSecurityCodeSignerAccess()
-                                        .getCRLs(signer);
-                                if (crls != null) {
-                                    for (CRL crl: crls) {
-                                        if (crl instanceof X509CRLImpl) {
-                                            sb.append(tab).append("[");
-                                            sb.append(String.format(
-                                                    rb.getString("with.a.CRL.including.d.entries"),
-                                                    ((X509CRLImpl)crl).getRevokedCertificates().size()))
-                                                .append("]\n");
-                                        }
-                                    }
-                                }
                             }
                         }
                     } else if (showcerts && !verbose.equals("all")) {
@@ -1284,7 +1231,7 @@
 
             try {
                 block =
-                    sf.generateBlock(privateKey, sigalg, certChain, crls,
+                    sf.generateBlock(privateKey, sigalg, certChain,
                         externalSF, tsaUrl, tsaCert, signingMechanism, args,
                         zipFile);
             } catch (SocketTimeoutException e) {
@@ -2249,7 +2196,6 @@
     public Block generateBlock(PrivateKey privateKey,
                                String sigalg,
                                X509Certificate[] certChain,
-                               Set<X509CRL> crls,
                                boolean externalSF, String tsaUrl,
                                X509Certificate tsaCert,
                                ContentSigner signingMechanism,
@@ -2257,7 +2203,7 @@
         throws NoSuchAlgorithmException, InvalidKeyException, IOException,
             SignatureException, CertificateException
     {
-        return new Block(this, privateKey, sigalg, certChain, crls, externalSF,
+        return new Block(this, privateKey, sigalg, certChain, externalSF,
                 tsaUrl, tsaCert, signingMechanism, args, zipFile);
     }
 
@@ -2271,8 +2217,7 @@
          * Construct a new signature block.
          */
         Block(SignatureFile sfg, PrivateKey privateKey, String sigalg,
-            X509Certificate[] certChain, Set<X509CRL> crls,
-            boolean externalSF, String tsaUrl,
+            X509Certificate[] certChain, boolean externalSF, String tsaUrl,
             X509Certificate tsaCert, ContentSigner signingMechanism,
             String[] args, ZipFile zipFile)
             throws NoSuchAlgorithmException, InvalidKeyException, IOException,
@@ -2359,7 +2304,7 @@
             // Assemble parameters for the signing mechanism
             ContentSignerParameters params =
                 new JarSignerParameters(args, tsaUri, tsaCert, signature,
-                    signatureAlgorithm, certChain, crls, content, zipFile);
+                    signatureAlgorithm, certChain, content, zipFile);
 
             // Generate the signature block
             block = signingMechanism.generateSignedData(
@@ -2400,7 +2345,6 @@
     private byte[] signature;
     private String signatureAlgorithm;
     private X509Certificate[] signerCertificateChain;
-    private Set<X509CRL> crls;
     private byte[] content;
     private ZipFile source;
 
@@ -2409,8 +2353,7 @@
      */
     JarSignerParameters(String[] args, URI tsa, X509Certificate tsaCertificate,
         byte[] signature, String signatureAlgorithm,
-        X509Certificate[] signerCertificateChain, Set<X509CRL> crls,
-        byte[] content,
+        X509Certificate[] signerCertificateChain, byte[] content,
         ZipFile source) {
 
         if (signature == null || signatureAlgorithm == null ||
@@ -2423,7 +2366,6 @@
         this.signature = signature;
         this.signatureAlgorithm = signatureAlgorithm;
         this.signerCertificateChain = signerCertificateChain;
-        this.crls = crls;
         this.content = content;
         this.source = source;
     }
@@ -2499,13 +2441,4 @@
     public ZipFile getSource() {
         return source;
     }
-
-    @Override
-    public Set<X509CRL> getCRLs() {
-        if (crls == null) {
-            return Collections.emptySet();
-        } else {
-            return Collections.unmodifiableSet(crls);
-        }
-    }
 }
--- a/jdk/src/share/classes/sun/security/tools/JarSignerResources.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/JarSignerResources.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +74,6 @@
                 "[-digestalg <algorithm>]    name of digest algorithm"},
         {".sigalg.algorithm.name.of.signature.algorithm",
                 "[-sigalg <algorithm>]       name of signature algorithm"},
-        {".crl.auto.file.include.CRL.in.signed.jar",
-                "[-crl[:auto| <file>]        include CRL in signed jar"},
         {".verify.verify.a.signed.JAR.file",
                 "[-verify]                   verify a signed JAR file"},
         {".verbose.suboptions.verbose.output.when.signing.verifying.",
@@ -193,7 +191,6 @@
         {"using.an.alternative.signing.mechanism",
                 "using an alternative signing mechanism"},
         {"entry.was.signed.on", "entry was signed on {0}"},
-        {"with.a.CRL.including.d.entries", "with a CRL including %d entries"},
         {"Warning.", "Warning: "},
         {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
                 "This jar contains unsigned entries which have not been integrity-checked. "},
--- a/jdk/src/share/classes/sun/security/tools/KeyTool.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 sun.security.tools;
 
-import sun.misc.SharedSecrets;
 import java.io.*;
 import java.security.CodeSigner;
 import java.security.KeyStore;
@@ -2311,16 +2310,6 @@
                                     out.println();
                                 }
                             }
-                            CRL[] crls = SharedSecrets
-                                    .getJavaSecurityCodeSignerAccess()
-                                    .getCRLs(signer);
-                            if (crls != null) {
-                                out.println(rb.getString("CRLs."));
-                                out.println();
-                                for (CRL crl: crls) {
-                                    printCRL(crl, out);
-                                }
-                            }
                         }
                     }
                 }
--- a/jdk/src/share/classes/sun/security/tools/TimestampedSigner.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/TimestampedSigner.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 java.util.List;
 
 import com.sun.jarsigner.*;
-import java.security.cert.X509CRL;
 import java.util.Arrays;
 import sun.security.pkcs.*;
 import sun.security.timestamp.*;
@@ -238,9 +237,8 @@
         AlgorithmId[] algorithms = {digestAlgorithmId};
 
         // Create the PKCS #7 signed data message
-        PKCS7 p7 =
-            new PKCS7(algorithms, contentInfo, signerCertificateChain,
-                    parameters.getCRLs().toArray(new X509CRL[parameters.getCRLs().size()]), signerInfos);
+        PKCS7 p7 = new PKCS7(algorithms, contentInfo, signerCertificateChain,
+                null, signerInfos);
         ByteArrayOutputStream p7out = new ByteArrayOutputStream();
         p7.encodeSignedData(p7out);
 
--- a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java	Fri Mar 18 11:00:10 2011 -0700
@@ -37,7 +37,6 @@
 import sun.security.pkcs.*;
 import sun.security.timestamp.TimestampToken;
 import sun.misc.BASE64Decoder;
-import sun.misc.SharedSecrets;
 
 import sun.security.jca.Providers;
 
@@ -486,12 +485,7 @@
                 signers = new ArrayList<CodeSigner>();
             }
             // Append the new code signer
-            CodeSigner signer = new CodeSigner(certChain, getTimestamp(info));
-            if (block.getCRLs() != null) {
-                SharedSecrets.getJavaSecurityCodeSignerAccess().setCRLs(
-                        signer, block.getCRLs());
-            }
-            signers.add(signer);
+            signers.add(new CodeSigner(certChain, getTimestamp(info)));
 
             if (debug != null) {
                 debug.println("Signature Block Certificate: " +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/text/resources/CollationData_sr_Latn.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ */
+
+/*
+ * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
+ *
+ * The original version of this source code and documentation
+ * is copyrighted and owned by Taligent, Inc., a wholly-owned
+ * subsidiary of IBM. These materials are provided under terms
+ * of a License Agreement between Taligent and Sun. This technology
+ * is protected by multiple US and International patents.
+ *
+ * This notice and attribution to Taligent may not be removed.
+ * Taligent is a registered trademark of Taligent, Inc.
+ *
+ */
+
+package sun.text.resources;
+
+import java.util.ListResourceBundle;
+
+public class CollationData_sr_Latn extends ListResourceBundle {
+
+    protected final Object[][] getContents() {
+        return new Object[][] {
+            { "Rule",
+                /* for sr-Latin, default sorting except for the following: */
+
+                /* add dz "ligature" between d and d<stroke>. */
+                /* add d<stroke> between d and e. */
+                /* add lj "ligature" between l and l<stroke>. */
+                /* add l<stroke> between l and m. */
+                /* add nj "ligature" between n and o. */
+                /* add z<abovedot> after z.       */
+                "& \u200f = \u030c "
+                + "& \u0306 = \u030d "
+                + "& C < c\u030c , C\u030c "  // C < c-caron
+                + "< c\u0301 , C\u0301 "      // c-acute
+                + "& D < \u01f3 , \u01f2 , \u01f1 "  // dz
+                + "< dz , dZ , Dz , DZ "      // dz ligature
+                + "< \u01c6 , \u01c5 , \u01c4 "  // dz-caron
+                + "< \u0111 , \u0110 "           // d-stroke
+                + "& L < lj , lJ , Lj , LJ " // l < lj ligature
+                + "& N < nj , nJ , Nj , NJ " // n < nj ligature
+                + "& S < s\u030c , S\u030c "  // s < s-caron
+                + "& Z < z\u030c , Z\u030c "  // z < z-caron
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/text/resources/FormatData_sr_Latn.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * COPYRIGHT AND PERMISSION NOTICE
+ *
+ * Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+ * Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of the Unicode data files and any associated documentation (the
+ * "Data Files") or Unicode software and any associated documentation
+ * (the "Software") to deal in the Data Files or Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, and/or sell copies of the Data
+ * Files or Software, and to permit persons to whom the Data Files or
+ * Software are furnished to do so, provided that (a) the above copyright
+ * notice(s) and this permission notice appear with all copies of the
+ * Data Files or Software, (b) both the above copyright notice(s) and
+ * this permission notice appear in associated documentation, and (c)
+ * there is clear notice in each modified Data File or in the Software as
+ * well as in the documentation associated with the Data File(s) or
+ * Software that the data or software has been modified.
+ *
+ * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+ * ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in these Data Files or Software without prior
+ * written authorization of the copyright holder.
+ */
+
+// Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+package sun.text.resources;
+
+import java.util.ListResourceBundle;
+
+public class FormatData_sr_Latn extends ListResourceBundle {
+    protected final Object[][] getContents() {
+        return new Object[][] {
+            { "MonthNames",
+                new String[] {
+                    "januar",
+                    "februar",
+                    "mart",
+                    "april",
+                    "maj",
+                    "jun",
+                    "jul",
+                    "avgust",
+                    "septembar",
+                    "oktobar",
+                    "novembar",
+                    "decembar",
+                    "",
+                }
+            },
+            { "MonthAbbreviations",
+                new String[] {
+                    "jan",
+                    "feb",
+                    "mar",
+                    "apr",
+                    "maj",
+                    "jun",
+                    "jul",
+                    "avg",
+                    "sep",
+                    "okt",
+                    "nov",
+                    "dec",
+                    "",
+                }
+            },
+            { "DayNames",
+                new String[] {
+                    "nedelja",
+                    "ponedeljak",
+                    "utorak",
+                    "sreda",
+                    "\u010detvrtak",
+                    "petak",
+                    "subota",
+                }
+            },
+            { "DayAbbreviations",
+                new String[] {
+                    "ned",
+                    "pon",
+                    "uto",
+                    "sre",
+                    "\u010det",
+                    "pet",
+                    "sub",
+                }
+            },
+            { "Eras",
+                new String[] {
+                    "p. n. e.",
+                    "n. e",
+                }
+            },
+            { "NumberPatterns",
+                new String[] {
+                    "#,##0.###",
+                    "\u00a4\u00a0#,##0.00",
+                    "#,##0%",
+                }
+            },
+            { "NumberElements",
+                new String[] {
+                    ".",
+                    ",",
+                    ";",
+                    "%",
+                    "0",
+                    "#",
+                    "-",
+                    "E",
+                    "\u2030",
+                    "\u221e",
+                    "NaN",
+                }
+            },
+            { "DateTimePatterns",
+                new String[] {
+                    "HH.mm.ss zzzz",
+                    "HH.mm.ss z",
+                    "HH.mm.ss",
+                    "HH.mm",
+                    "EEEE, dd. MMMM y.",
+                    "dd. MMMM y.",
+                    "dd.MM.y.",
+                    "d.M.yy.",
+                    "{1} {0}",
+                }
+            },
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/text/resources/FormatData_sr_Latn_BA.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * COPYRIGHT AND PERMISSION NOTICE
+ *
+ * Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+ * Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of the Unicode data files and any associated documentation (the
+ * "Data Files") or Unicode software and any associated documentation
+ * (the "Software") to deal in the Data Files or Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, and/or sell copies of the Data
+ * Files or Software, and to permit persons to whom the Data Files or
+ * Software are furnished to do so, provided that (a) the above copyright
+ * notice(s) and this permission notice appear with all copies of the
+ * Data Files or Software, (b) both the above copyright notice(s) and
+ * this permission notice appear in associated documentation, and (c)
+ * there is clear notice in each modified Data File or in the Software as
+ * well as in the documentation associated with the Data File(s) or
+ * Software that the data or software has been modified.
+ *
+ * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+ * ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in these Data Files or Software without prior
+ * written authorization of the copyright holder.
+ */
+
+// Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+package sun.text.resources;
+
+import sun.util.EmptyListResourceBundle;
+
+public class FormatData_sr_Latn_BA extends EmptyListResourceBundle {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/text/resources/FormatData_sr_Latn_ME.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * COPYRIGHT AND PERMISSION NOTICE
+ *
+ * Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+ * Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of the Unicode data files and any associated documentation (the
+ * "Data Files") or Unicode software and any associated documentation
+ * (the "Software") to deal in the Data Files or Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, and/or sell copies of the Data
+ * Files or Software, and to permit persons to whom the Data Files or
+ * Software are furnished to do so, provided that (a) the above copyright
+ * notice(s) and this permission notice appear with all copies of the
+ * Data Files or Software, (b) both the above copyright notice(s) and
+ * this permission notice appear in associated documentation, and (c)
+ * there is clear notice in each modified Data File or in the Software as
+ * well as in the documentation associated with the Data File(s) or
+ * Software that the data or software has been modified.
+ *
+ * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+ * ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in these Data Files or Software without prior
+ * written authorization of the copyright holder.
+ */
+
+// Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+package sun.text.resources;
+
+import java.util.ListResourceBundle;
+
+public class FormatData_sr_Latn_ME extends ListResourceBundle {
+    protected final Object[][] getContents() {
+        return new Object[][] {
+            { "DateTimePatterns",
+                new String[] {
+                    "HH.mm.ss zzzz",
+                    "HH.mm.ss z",
+                    "HH.mm.ss",
+                    "HH.mm",
+                    "EEEE, dd. MMMM y.",
+                    "d.MM.yyyy.",
+                    "dd.MM.y.",
+                    "d.M.yy.",
+                    "{1} {0}",
+                }
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/text/resources/FormatData_sr_Latn_RS.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * COPYRIGHT AND PERMISSION NOTICE
+ *
+ * Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+ * Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of the Unicode data files and any associated documentation (the
+ * "Data Files") or Unicode software and any associated documentation
+ * (the "Software") to deal in the Data Files or Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, and/or sell copies of the Data
+ * Files or Software, and to permit persons to whom the Data Files or
+ * Software are furnished to do so, provided that (a) the above copyright
+ * notice(s) and this permission notice appear with all copies of the
+ * Data Files or Software, (b) both the above copyright notice(s) and
+ * this permission notice appear in associated documentation, and (c)
+ * there is clear notice in each modified Data File or in the Software as
+ * well as in the documentation associated with the Data File(s) or
+ * Software that the data or software has been modified.
+ *
+ * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+ * ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in these Data Files or Software without prior
+ * written authorization of the copyright holder.
+ */
+
+// Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+package sun.text.resources;
+
+import sun.util.EmptyListResourceBundle;
+
+public class FormatData_sr_Latn_RS extends EmptyListResourceBundle {
+}
--- a/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java	Fri Mar 18 11:00:10 2011 -0700
@@ -44,7 +44,7 @@
  * or if the keys ends with ".mnemonic", an element
  * representing a mnemomic keycode <code>int</code> or <code>char</code>.
  */
-public class JConsoleResources_ja extends ListResourceBundle {
+public class JConsoleResources_ja extends JConsoleResources {
 
     /**
      * Returns the contents of this <code>ResourceBundle</code>.
--- a/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_zh_CN.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_zh_CN.java	Fri Mar 18 11:00:10 2011 -0700
@@ -44,7 +44,7 @@
  * or if the keys ends with ".mnemonic", an element
  * representing a mnemomic keycode <code>int</code> or <code>char</code>.
  */
-public class JConsoleResources_zh_CN extends ListResourceBundle {
+public class JConsoleResources_zh_CN extends JConsoleResources {
 
     /**
      * Returns the contents of this <code>ResourceBundle</code>.
--- a/jdk/src/share/classes/sun/tools/native2ascii/Main.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/tools/native2ascii/Main.java	Fri Mar 18 11:00:10 2011 -0700
@@ -94,7 +94,7 @@
      * Run the converter
      */
     public synchronized boolean convert(String argv[]){
-        Vector v = new Vector(2);
+        List<String> v = new ArrayList<>(2);
         File outputFile = null;
         boolean createOutputFile = false;
 
@@ -115,7 +115,7 @@
                     usage();
                     return false;
                 }
-                v.addElement(argv[i]);
+                v.add(argv[i]);
             }
         }
         if (encodingString == null)
@@ -126,11 +126,11 @@
             initializeConverter();
 
             if (v.size() == 1)
-                inputFileName = (String)v.elementAt(0);
+                inputFileName = v.get(0);
 
             if (v.size() == 2) {
-                inputFileName = (String)v.elementAt(0);
-                outputFileName = (String)v.elementAt(1);
+                inputFileName = v.get(0);
+                outputFileName = v.get(1);
                 createOutputFile = true;
             }
 
@@ -363,9 +363,7 @@
 
     private String formatMsg(String key, String arg) {
         String msg = getMsg(key);
-        String[] args = new String[1];
-        args[0] = arg;
-        return MessageFormat.format(msg, (Object)args);
+        return MessageFormat.format(msg, arg);
     }
 
 
--- a/jdk/src/share/classes/sun/util/calendar/LocalGregorianCalendar.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/util/calendar/LocalGregorianCalendar.java	Fri Mar 18 11:00:10 2011 -0700
@@ -127,7 +127,9 @@
             calendarProps = (Properties) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws IOException {
                     Properties props = new Properties();
-                    props.load(new FileInputStream(fname));
+                    try (FileInputStream fis = new FileInputStream(fname)) {
+                        props.load(fis);
+                    }
                     return props;
                 }
             });
--- a/jdk/src/share/classes/sun/util/calendar/ZoneInfo.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/util/calendar/ZoneInfo.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -266,7 +266,7 @@
         int index = getTransitionIndex(date, type);
 
         // prior to the transition table, returns the raw offset.
-        // should support LMT.
+        // FIXME: should support LMT.
         if (index < 0) {
             int offset = getLastRawOffset();
             if (offsets != null) {
@@ -297,7 +297,13 @@
             if (type != UTC_TIME) {
                 msec -= rawOffset;
             }
-            int dstoffset = tz.inDaylightTime(new Date(msec)) ? tz.getDSTSavings() : 0;
+            int dstoffset = tz.getOffset(msec) - rawOffset;
+
+            // Check if it's in a standard-to-daylight transition.
+            if (dstoffset > 0 && tz.getOffset(msec - dstoffset) == rawoffset) {
+                dstoffset = 0;
+            }
+
             if (offsets != null) {
                 offsets[0] = rawoffset;
                 offsets[1] = dstoffset;
@@ -452,6 +458,36 @@
         return (simpleTimeZoneParams != null);
     }
 
+    @Override
+    public boolean observesDaylightTime() {
+        if (simpleTimeZoneParams != null) {
+            return true;
+        }
+        if (transitions == null) {
+            return false;
+        }
+
+        // Look up the transition table to see if it's in DST right
+        // now or if there's any standard-to-daylight transition at
+        // any future.
+        long utc = System.currentTimeMillis() - rawOffsetDiff;
+        int index = getTransitionIndex(utc, UTC_TIME);
+
+        // before transitions in the transition table
+        if (index < 0) {
+            return false;
+        }
+
+        // the time is in the table range.
+        for (int i = index; i < transitions.length; i++) {
+            if ((transitions[i] & DST_MASK) != 0) {
+                return true;
+            }
+        }
+        // No further DST is observed.
+        return false;
+    }
+
     /**
      * Queries if the specified date is in Daylight Saving Time.
      */
--- a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java	Fri Mar 18 11:00:10 2011 -0700
@@ -535,7 +535,14 @@
         }
 
         void doLog(int level, String msg, Object... params) {
-            LoggingSupport.log(javaLogger, levelObjects.get(level), msg, params);
+            // only pass String objects to the j.u.l.Logger which may
+            // be created by untrusted code
+            int len = (params != null) ? params.length : 0;
+            Object[] sparams = new String[len];
+            for (int i = 0; i < len; i++) {
+                sparams [i] = String.valueOf(params[i]);
+            }
+            LoggingSupport.log(javaLogger, levelObjects.get(level), msg, sparams);
         }
 
         boolean isEnabled() {
--- a/jdk/src/share/classes/sun/util/logging/resources/logging.properties	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/util/logging/resources/logging.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -25,13 +25,22 @@
 
 # Localizations for Level names.  For the US locale
 # these are the same as the non-localized level name.
+
+# The following ALL CAPS words should be translated.
 ALL=ALL
+# The following ALL CAPS words should be translated.
 SEVERE=SEVERE
+# The following ALL CAPS words should be translated.
 WARNING=WARNING
+# The following ALL CAPS words should be translated.
 INFO=INFO
+# The following ALL CAPS words should be translated.
 CONFIG= CONFIG
+# The following ALL CAPS words should be translated.
 FINE=FINE
+# The following ALL CAPS words should be translated.
 FINER=FINER
+# The following ALL CAPS words should be translated.
 FINEST=FINEST
+# The following ALL CAPS words should be translated.
 OFF=OFF
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CalendarData_sr_Latn_BA.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of the Unicode data files and any associated documentation (the
+# "Data Files") or Unicode software and any associated documentation
+# (the "Software") to deal in the Data Files or Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, and/or sell copies of the Data
+# Files or Software, and to permit persons to whom the Data Files or
+# Software are furnished to do so, provided that (a) the above copyright
+# notice(s) and this permission notice appear with all copies of the
+# Data Files or Software, (b) both the above copyright notice(s) and
+# this permission notice appear in associated documentation, and (c)
+# there is clear notice in each modified Data File or in the Software as
+# well as in the documentation associated with the Data File(s) or
+# Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+# SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in these Data Files or Software without prior
+# written authorization of the copyright holder.
+
+#
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+#
+minimalDaysInFirstWeek=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CalendarData_sr_Latn_ME.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of the Unicode data files and any associated documentation (the
+# "Data Files") or Unicode software and any associated documentation
+# (the "Software") to deal in the Data Files or Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, and/or sell copies of the Data
+# Files or Software, and to permit persons to whom the Data Files or
+# Software are furnished to do so, provided that (a) the above copyright
+# notice(s) and this permission notice appear with all copies of the
+# Data Files or Software, (b) both the above copyright notice(s) and
+# this permission notice appear in associated documentation, and (c)
+# there is clear notice in each modified Data File or in the Software as
+# well as in the documentation associated with the Data File(s) or
+# Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+# SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in these Data Files or Software without prior
+# written authorization of the copyright holder.
+
+#
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+#
+minimalDaysInFirstWeek=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CalendarData_sr_Latn_RS.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of the Unicode data files and any associated documentation (the
+# "Data Files") or Unicode software and any associated documentation
+# (the "Software") to deal in the Data Files or Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, and/or sell copies of the Data
+# Files or Software, and to permit persons to whom the Data Files or
+# Software are furnished to do so, provided that (a) the above copyright
+# notice(s) and this permission notice appear with all copies of the
+# Data Files or Software, (b) both the above copyright notice(s) and
+# this permission notice appear in associated documentation, and (c)
+# there is clear notice in each modified Data File or in the Software as
+# well as in the documentation associated with the Data File(s) or
+# Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+# SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in these Data Files or Software without prior
+# written authorization of the copyright holder.
+
+#
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+#
+minimalDaysInFirstWeek=4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_pt.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,250 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of the Unicode data files and any associated documentation (the "Data
+# Files") or Unicode software and any associated documentation (the
+# "Software") to deal in the Data Files or Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Data Files or Software, and
+# to permit persons to whom the Data Files or Software are furnished to do
+# so, provided that (a) the above copyright notice(s) and this permission
+# notice appear with all copies of the Data Files or Software, (b) both the
+# above copyright notice(s) and this permission notice appear in associated
+# documentation, and (c) there is clear notice in each modified Data File or
+# in the Software as well as in the documentation associated with the Data
+# File(s) or Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+# THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
+# INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
+# CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder shall not
+# be used in advertising or otherwise to promote the sale, use or other
+# dealings in these Data Files or Software without prior written
+# authorization of the copyright holder.
+#
+ 
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+
+adp=Peseta de Andorra
+aed=Dir\u00e9m dos Emirados \u00c1rabes Unidos
+afa=Afegane (1927-2002)
+afn=Afegane
+all=Lek Alban\u00eas
+amd=Dram arm\u00eanio
+ang=Guilder das Antilhas Holandesas
+aoa=Cuanza angolano
+ars=Peso argentino
+ats=Xelim austr\u00edaco
+aud=D\u00f3lar australiano
+awg=Guilder de Aruba
+azm=Manat azerbaijano
+azn=Manat do Azerbaij\u00e3o
+bam=Marco b\u00f3snio-herzegovino convers\u00edvel
+bbd=D\u00f3lar de Barbados
+bdt=Taka de Bangladesh
+bef=Franco belga
+bgl=Lev forte b\u00falgaro
+bgn=Lev novo b\u00falgaro
+bhd=Dinar bareinita
+bif=Franco do Burundi
+bmd=D\u00f3lar das Bermudas
+bnd=D\u00f3lar do Brunei
+bov=Mvdol boliviano
+brl=Real brasileiro
+bsd=D\u00f3lar das Bahamas
+btn=Ngultrum do But\u00e3o
+bwp=Pula botsuanesa
+byb=Rublo novo bielo-russo (1994-1999)
+byr=Rublo bielo-russo
+bzd=D\u00f3lar do Belize
+cad=D\u00f3lar canadense
+cdf=Franco congol\u00eas
+chf=Franco su\u00ed\u00e7o
+clf=Unidades de Fomento chilenas
+clp=Peso chileno
+cny=Yuan Renminbi chin\u00eas
+cop=Peso colombiano
+crc=Colon da Costa Rica
+csd=Dinar s\u00e9rvio antigo
+cup=Peso cubano
+cve=Escudo cabo-verdiano
+cyp=Libra cipriota
+czk=Coroa checa
+dem=Marco alem\u00e3o
+djf=Franco do Djibuti
+dkk=Coroa dinamarquesa
+dop=Peso dominicano
+dzd=Dinar argelino
+eek=Coroa estoniana
+egp=Libra eg\u00edpcia
+ern=Nakfa da Eritreia
+esp=Peseta espanhola
+etb=Birr et\u00edope
+fim=Marca finlandesa
+fjd=D\u00f3lar de Fiji
+fkp=Libra das Malvinas
+frf=Franco franc\u00eas
+gbp=Libra esterlina brit\u00e2nica
+gel=Lari georgiano
+ghc=Cedi de Gana (1979-2007)
+ghs=Cedi gan\u00eas
+gip=Libra de Gibraltar
+gmd=Dalasi de G\u00e2mbia
+gnf=Franco de Guin\u00e9
+grd=Dracma grego
+gtq=Quet\u00e7al da Guatemala
+gwp=Peso da Guin\u00e9-Bissau
+gyd=D\u00f3lar da Guiana
+hkd=D\u00f3lar de Hong Kong
+hnl=Lempira de Honduras
+hrk=Kuna croata
+htg=Gurde do Haiti
+huf=Forinte h\u00fangaro
+idr=Rupia indon\u00e9sia
+iep=Libra irlandesa
+ils=Sheqel Novo israelita
+inr=R\u00fapia indiana
+iqd=Dinar iraquiano
+irr=Rial iraniano
+isk=Coroa islandesa
+itl=Lira italiana
+jmd=D\u00f3lar jamaicano
+jod=Dinar jordaniano
+jpy=Iene japon\u00eas
+kes=Xelim queniano
+kgs=Som quirguiz
+khr=Riel cambojano
+kmf=Franco de Comores
+kpw=Won norte-coreano
+krw=Won sul-coreano
+kwd=Dinar coveitiano
+kyd=D\u00f3lar das Ilhas Caiman
+kzt=Tenge do Cazaquist\u00e3o
+lak=Kip de Laos
+lbp=Libra libanesa
+lkr=Rupia do Sri Lanka
+lrd=D\u00f3lar liberiano
+lsl=Loti do Lesoto
+ltl=Lita lituano
+luf=Franco luxemburgu\u00eas
+lvl=Lats let\u00e3o
+lyd=Dinar l\u00edbio
+mad=Dir\u00e9m marroquino
+mdl=Leu mold\u00e1vio
+mga=Ariary de Madagascar
+mgf=Franco de Madagascar
+mkd=Dinar maced\u00f4nio
+mmk=Kyat de Mianmar
+mnt=Tugrik mongol
+mop=Pataca macaense
+mro=Ouguiya da Maurit\u00e2nia
+mtl=Lira maltesa
+mur=Rupia de Maur\u00edcio
+mvr=Rupias das Ilhas Maldivas
+mwk=Cuacha do Mal\u00e1ui
+mxn=Peso mexicano
+mxv=Unidade Mexicana de Investimento (UDI)
+myr=Ringgit malaio
+mzm=Metical antigo de Mo\u00e7ambique
+mzn=Metical do Mo\u00e7ambique
+nad=D\u00f3lar da Nam\u00edbia
+ngn=Naira nigeriana
+nio=C\u00f3rdoba Ouro nicaraguense
+nlg=Florim holand\u00eas
+nok=Coroa norueguesa
+npr=Rupia nepalesa
+nzd=D\u00f3lar da Nova Zel\u00e2ndia
+omr=Rial de Om\u00e3
+pab=Balboa panamenho
+pen=Sol Novo peruano
+pgk=Kina da Papua-Nova Guin\u00e9
+php=Peso filipino
+pkr=Rupia paquistanesa
+pln=Zloti polon\u00eas
+pte=Escudo portugu\u00eas
+pyg=Guarani paraguaio
+qar=Rial catariano
+rol=Leu romeno antigo
+ron=Leu romeno
+rsd=Dinar s\u00e9rvio
+rub=Rublo russo
+rur=Rublo russo (1991-1998)
+rwf=Franco ruand\u00eas
+sar=Rial saudita
+sbd=D\u00f3lar das Ilhas Salom\u00e3o
+scr=Rupia das Seychelles
+sdd=Dinar sudan\u00eas
+sdg=Libra sudanesa
+sek=Coroa sueca
+sgd=D\u00f3lar de Cingapura
+shp=Libra de Santa Helena
+sit=Tolar Bons esloveno
+skk=Coroa eslovaca
+sll=Leone de Serra Leoa
+sos=Xelim somali
+srd=D\u00f3lar do Suriname
+srg=Florim do Suriname
+std=Dobra de S\u00e3o Tom\u00e9 e Pr\u00edncipe
+svc=Colom salvadorenho
+syp=Libra s\u00edria
+szl=Lilangeni da Suazil\u00e2ndia
+thb=Baht tailand\u00eas
+tjs=Somoni tadjique
+tmm=Manat do Turcomenist\u00e3o
+tnd=Dinar tunisiano
+top=Pa\u02bbanga de Tonga
+tpe=Escudo timorense
+trl=Lira turca antiga
+try=Lira turca
+ttd=D\u00f3lar de Trinidad e Tobago
+twd=D\u00f3lar Novo de Taiwan
+tzs=Xelim da Tanz\u00e2nia
+uah=Hryvnia ucraniano
+ugx=Xelim ugandense
+usd=D\u00f3lar norte-americano
+usn=D\u00f3lar norte-americano (Dia seguinte)
+uss=D\u00f3lar norte-americano (Mesmo dia)
+uyu=Peso uruguaio
+uzs=Sum do Usbequist\u00e3o
+veb=Bol\u00edvar venezuelano
+vef=Bol\u00edvar v enezuelano forte
+vnd=Dong vietnamita
+vuv=Vatu de Vanuatu
+wst=Tala samoano
+xaf=Franco CFA BEAC
+xag=Prata
+xau=Ouro
+xba=Unidade Composta Europeia
+xbb=Unidade Monet\u00e1ria Europeia
+xbc=Unidade de Conta Europeia (XBC)
+xbd=Unidade de Conta Europeia (XBD)
+xcd=D\u00f3lar do Caribe Oriental
+xdr=Direitos Especiais de Giro
+xfo=Franco-ouro franc\u00eas
+xfu=Franco UIC franc\u00eas
+xof=Franco CFA BCEAO
+xpd=Pal\u00e1dio
+xpf=Franco CFP
+xpt=Platina
+xts=C\u00f3digo de Moeda de Teste
+xxx=Moeda Desconhecida ou Inv\u00e1lida
+yer=Rial iemenita
+yum=Dinar noviy iugoslavo
+zar=Rand sul-africano
+zmk=Cuacha zambiano
+zwd=D\u00f3lar do Zimb\u00e1bue
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_sr_Latn_BA.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of the Unicode data files and any associated documentation (the
+# "Data Files") or Unicode software and any associated documentation
+# (the "Software") to deal in the Data Files or Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, and/or sell copies of the Data
+# Files or Software, and to permit persons to whom the Data Files or
+# Software are furnished to do so, provided that (a) the above copyright
+# notice(s) and this permission notice appear with all copies of the
+# Data Files or Software, (b) both the above copyright notice(s) and
+# this permission notice appear in associated documentation, and (c)
+# there is clear notice in each modified Data File or in the Software as
+# well as in the documentation associated with the Data File(s) or
+# Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+# SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in these Data Files or Software without prior
+# written authorization of the copyright holder.
+
+#
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+#
+BAM=KM
+bam=bosansko-hercegova\u010dkih konvertibilnih maraka
+EUR=\u20ac
+eur=evra
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_sr_Latn_ME.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of the Unicode data files and any associated documentation (the
+# "Data Files") or Unicode software and any associated documentation
+# (the "Software") to deal in the Data Files or Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, and/or sell copies of the Data
+# Files or Software, and to permit persons to whom the Data Files or
+# Software are furnished to do so, provided that (a) the above copyright
+# notice(s) and this permission notice appear with all copies of the
+# Data Files or Software, (b) both the above copyright notice(s) and
+# this permission notice appear in associated documentation, and (c)
+# there is clear notice in each modified Data File or in the Software as
+# well as in the documentation associated with the Data File(s) or
+# Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+# SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in these Data Files or Software without prior
+# written authorization of the copyright holder.
+
+#
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+#
+EUR=\u20ac
+eur=evra
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_sr_Latn_RS.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of the Unicode data files and any associated documentation (the
+# "Data Files") or Unicode software and any associated documentation
+# (the "Software") to deal in the Data Files or Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, and/or sell copies of the Data
+# Files or Software, and to permit persons to whom the Data Files or
+# Software are furnished to do so, provided that (a) the above copyright
+# notice(s) and this permission notice appear with all copies of the
+# Data Files or Software, (b) both the above copyright notice(s) and
+# this permission notice appear in associated documentation, and (c)
+# there is clear notice in each modified Data File or in the Software as
+# well as in the documentation associated with the Data File(s) or
+# Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+# SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in these Data Files or Software without prior
+# written authorization of the copyright holder.
+
+#
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+#
+RSD=din.
+rsd=srpski dinari
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_sr_RS.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,43 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of the Unicode data files and any associated documentation (the "Data
+# Files") or Unicode software and any associated documentation (the
+# "Software") to deal in the Data Files or Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Data Files or Software, and
+# to permit persons to whom the Data Files or Software are furnished to do
+# so, provided that (a) the above copyright notice(s) and this permission
+# notice appear with all copies of the Data Files or Software, (b) both the
+# above copyright notice(s) and this permission notice appear in associated
+# documentation, and (c) there is clear notice in each modified Data File or
+# in the Software as well as in the documentation associated with the Data
+# File(s) or Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+# THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
+# INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
+# CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder shall not
+# be used in advertising or otherwise to promote the sale, use or other
+# dealings in these Data Files or Software without prior written
+# authorization of the copyright holder.
+#
+ 
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+
+RSD=\u0434\u0438\u043d.
--- a/jdk/src/share/classes/sun/util/resources/LocaleData.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/classes/sun/util/resources/LocaleData.java	Fri Mar 18 11:00:10 2011 -0700
@@ -171,16 +171,21 @@
             /* Get the locale string list from LocaleDataMetaInfo class. */
             String localeString = LocaleDataMetaInfo.getSupportedLocaleString(baseName);
 
-            if (localeString.length() == 0) {
+      if (localeString.length() == 0) {
                 return candidates;
             }
 
             for (Iterator<Locale> l = candidates.iterator(); l.hasNext(); ) {
-                String lstr = l.next().toString();
-                /* truncate extra segment introduced by Java 7 for script and extesions */
-                int idx = lstr.indexOf("_#");
-                if (idx >= 0) {
-                    lstr = lstr.substring(0, idx);
+                Locale loc = l.next();
+                String lstr = null;
+                if (loc.getScript().length() > 0) {
+                    lstr = loc.toLanguageTag().replace('-', '_');
+                } else {
+                    lstr = loc.toString();
+                    int idx = lstr.indexOf("_#");
+                    if (idx >= 0) {
+                        lstr = lstr.substring(0, idx);
+                    }
                 }
                 /* Every locale string in the locale string list returned from
                    the above getSupportedLocaleString is enclosed
@@ -265,28 +270,15 @@
 
         Locale[] locales = new Locale[localeStringTokenizer.countTokens()];
         for (int i = 0; i < locales.length; i++) {
-            String currentToken = localeStringTokenizer.nextToken();
-            int p2 = 0;
-            int p1 = currentToken.indexOf('_');
-            String language = "";
-            String country = "";
-            String variant = "";
-
-            if (p1 == -1) {
-                language = currentToken;
-            } else {
-                language = currentToken.substring(0, p1);
-                p2 = currentToken.indexOf('_', p1 + 1);
-                if (p2 == -1) {
-                    country = currentToken.substring(p1 + 1);
-                } else {
-                    country = currentToken.substring(p1 + 1, p2);
-                    if (p2 < currentToken.length()) {
-                        variant = currentToken.substring(p2 + 1);
-                    }
-                }
+            String currentToken = localeStringTokenizer.nextToken().replace('_','-');
+            if (currentToken.equals("ja-JP-JP")) {
+                currentToken = "ja-JP-u-ca-japanese-x-lvariant-JP";
+            } else if (currentToken.equals("th-TH-TH")) {
+                currentToken = "th-TH-u-nu-thai-x-lvariant-TH";
+            } else if (currentToken.equals("no-NO-NY")) {
+                currentToken = "no-NO-x-lvariant-NY";
             }
-            locales[i] = new Locale(language, country, variant);
+            locales[i] = Locale.forLanguageTag(currentToken);
         }
         return locales;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/util/resources/LocaleNames_sr_Latn.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,471 @@
+#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# COPYRIGHT AND PERMISSION NOTICE
+#
+# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved.
+# Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of the Unicode data files and any associated documentation (the
+# "Data Files") or Unicode software and any associated documentation
+# (the "Software") to deal in the Data Files or Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, and/or sell copies of the Data
+# Files or Software, and to permit persons to whom the Data Files or
+# Software are furnished to do so, provided that (a) the above copyright
+# notice(s) and this permission notice appear with all copies of the
+# Data Files or Software, (b) both the above copyright notice(s) and
+# this permission notice appear in associated documentation, and (c)
+# there is clear notice in each modified Data File or in the Software as
+# well as in the documentation associated with the Data File(s) or
+# Software that the data or software has been modified.
+#
+# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR
+# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
+# SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in these Data Files or Software without prior
+# written authorization of the copyright holder.
+
+#
+# Generated automatically from the Common Locale Data Repository. DO NOT EDIT!
+#
+aa=Afarski
+ab=Abkazijski
+ae=Avestanski
+af=Afrikanerski
+am=Amharski
+an=Aragone\u017eanski
+ar=Arapski
+as=Asemijski
+av=Avarski
+ay=Ajmara
+az=Azerbejd\u017eanski
+ba=Ba\u0161kir
+be=Beloruski
+bg=Bugarski
+bh=Biharski
+bn=Bengalski
+bo=Tibetanski
+br=Bretonski
+bs=Bosanski
+ca=Katalonski
+ce=\u010ce\u010denski
+ch=\u010camoro
+co=Korzikanski
+cr=Kri
+cs=\u010ce\u0161ki
+cu=Staroslovenski
+cv=\u010cuva\u0161ki
+cy=Vel\u0161ki
+da=Danski
+de=Nema\u010dki
+dv=Divehijski
+dz=D\u017eonga
+ee=Eve
+el=Gr\u010dki
+en=Engleski
+eo=Esperanto
+es=\u0160panski
+et=Estonski
+eu=Baskijski
+fa=Persijski
+fi=Finski
+fj=Fid\u017eijski
+fo=Farski
+fr=Francuski
+fy=Frizijski
+ga=Irski
+gd=\u0160kotski Galski
+gl=Galski
+gn=Gvarani
+gu=Gud\u017earati
+gv=Manks
+he=Hebrejski
+hi=Hindi
+hr=Hrvatski
+ht=Hai\u0107anski
+hu=Ma\u0111arski
+hy=Jermenski
+ia=Interlingva
+id=Indonezijski
+ie=Interlingve
+ii=Si\u010duan ji
+ik=Inupiak
+in=Indonezijski
+is=Islandski
+it=Italijanski
+iw=Hebrejski
+ja=Japanski
+ji=Jidi\u0161
+jv=Javanski
+ka=Gruzijski
+ki=Kikuju
+kj=Kuanjama
+kk=Koza\u010dki
+kl=Kalalisutski
+km=Kmerski
+kn=Kanada
+ko=Korejski
+ks=Ka\u0161miri
+ku=Kurdski
+kw=Korni\u0161ki
+ky=Kirgiski
+la=Latinski
+lb=Luksembur\u0161ki
+li=Limburgi\u0161
+lo=Lao\u0161ki
+lt=Litvanski
+lu=Luba-katanga
+lv=Letonski
+mg=Malagazijski
+mh=Mar\u0161alski
+mi=Maorski
+mk=Makedonski
+ml=Malajalam
+mn=Mongolski
+mo=Moldavski
+mr=Marati
+ms=Malajski
+mt=Melte\u0161ki
+my=Burmanski
+nb=Norve\u0161ki bokm\u00e5l
+nd=Severni ndebele
+ne=Nepalski
+nl=Holandski
+nn=Norve\u0161ki njorsk
+no=Norve\u0161ki
+nr=Ju\u017eni ndebele
+nv=Navaho
+ny=Njanja
+oc=Provansalski
+oj=Ojibva
+or=Orijski
+os=Osetski
+pa=Pand\u017eabski
+pl=Poljski
+ps=Pa\u0161tunski
+pt=Portugalski
+qu=Kven\u010da
+rm=Reto-Romanski
+ro=Rumunski
+ru=Ruski
+rw=Kinjarvanda
+sa=Sanskrit
+sc=Sardinijski
+sd=Sindi
+se=Severni sami
+si=Singaleski
+sk=Slova\u010dki
+sl=Slovena\u010dki
+sm=Samoanski
+sn=\u0160ona
+so=Somalski
+sq=Albanski
+sr=Srpski
+ss=Svati
+st=Sesoto
+su=Sudanski
+sv=\u0160vedski
+sw=Svahili
+ta=Tamilski
+tg=Ta\u0111ik
+th=Tajlandski
+ti=Tigrinja
+tk=Turkmenski
+tl=Tagalski
+tn=Tsvana
+tr=Turski
+tt=Tatarski
+tw=Tvi
+ty=Tahi\u0107anski
+ug=Ujgurski
+uk=Ukrajinski
+uz=Uzbe\u010dki
+vi=Vijetnamski
+wa=Valun
+wo=Volof
+xh=Khosa
+yi=Jidi\u0161
+yo=Jorubanski
+za=Zuang
+zh=Kineski
+AD=Andora
+AE=Ujedinjeni Arapski Emirati
+AF=Avganistan
+AG=Antigva i Barbuda
+AI=Angvila
+AL=Albanija
+AM=Armenija
+AN=Holandski Antili
+AO=Angola
+AQ=Antarktika
+AR=Argentina
+AS=Ameri\u010dka Samoa
+AT=Austrija
+AU=Australija
+AW=Aruba
+AX=Alandska ostrva
+AZ=Azerbejd\u017ean
+BA=Bosna i Hercegovina
+BB=Barbados
+BD=Banglade\u0161
+BE=Belgija
+BF=Burkina Faso
+BG=Bugarska
+BH=Bahrein
+BI=Burundi
+BJ=Benin
+BL=Sv. Bartolomej
+BM=Bermuda
+BN=Brunej
+BO=Bolivija
+BR=Brazil
+BS=Bahami
+BT=Butan
+BV=Buve Ostrva
+BW=Bocvana
+BY=Belorusija
+BZ=Belise
+CA=Kanada
+CC=Kokos (Keling) Ostrva
+CD=Demokratska Republika Kongo
+CF=Centralno Afri\u010dka Republika
+CG=Kongo
+CH=\u0160vajcarska
+CI=Obala Slonova\u010de
+CK=Kukova Ostrva
+CL=\u010cile
+CM=Kamerun
+CN=Kina
+CO=Kolumbija
+CR=Kostarika
+CU=Kuba
+CV=Kape Verde
+CX=Bo\u017ei\u0107na Ostrva
+CY=Kipar
+CZ=\u010ce\u0161ka
+DE=Nema\u010dka
+DJ=D\u017eibuti
+DK=Danska
+DM=Dominika
+DO=Dominikanska Republika
+DZ=Al\u017eir
+EC=Ekvador
+EE=Estonija
+EG=Egipat
+EH=Zapadna Sahara
+ER=Eritreja
+ES=\u0160panija
+ET=Etiopija
+FI=Finska
+FJ=Fid\u017ei
+FK=Folklandska Ostrva
+FM=Mikronezija
+FO=Farska Ostrva
+FR=Francuska
+GA=Gabon
+GB=Velika Britanija
+GD=Grenada
+GE=Gruzija
+GF=Francuska Gvajana
+GG=Gurnsi
+GH=Gana
+GI=Gibraltar
+GL=Grenland
+GM=Gambija
+GN=Gvineja
+GP=Gvadelupe
+GQ=Ekvatorijalna Gvineja
+GR=Gr\u010dka
+GS=Ju\u017ena D\u017eord\u017eija i Ju\u017ena Sendvi\u010d Ostrva
+GT=Gvatemala
+GU=Guam
+GW=Gvineja-Bisao
+GY=Gvajana
+HK=Hong Kong (S. A. R. Kina)
+HM=Herd i Mekdonald Ostrva
+HN=Honduras
+HR=Hrvatska
+HT=Haiti
+HU=Ma\u0111arska
+ID=Indonezija
+IE=Irska
+IL=Izrael
+IM=Ostrvo Man
+IN=Indija
+IO=Britansko Indijska Okeanska Teritorija
+IQ=Irak
+IR=Iran
+IS=Island
+IT=Italija
+JE=D\u017eersi
+JM=Jamajka
+JO=Jordan
+JP=Japan
+KE=Kenija
+KG=Kirgizstan
+KH=Kambod\u017ea
+KI=Kiribati
+KM=Komorska Ostrva
+KN=Sent Kits i Nevis
+KP=Severna Koreja
+KR=Ju\u017ena Koreja
+KW=Kuvajt
+KY=Kajmanska Ostrva
+KZ=Kazahstan
+LA=Laos
+LB=Liban
+LC=Sent Lucija
+LI=Lihten\u0161tajn
+LK=\u0160ri Lanka
+LR=Liberija
+LS=Lesoto
+LT=Litvanija
+LU=Luksemburg
+LV=Letonija
+LY=Libija
+MA=Maroko
+MC=Monako
+MD=Moldavija
+ME=Crna Gora
+MF=Sv. Martin
+MG=Madagaskar
+MH=Mar\u0161alska Ostrva
+MK=Makedonija
+ML=Mali
+MM=Mijanmar
+MN=Mongolija
+MO=Makao (S. A. R. Kina)
+MP=Severna Marijanska Ostrva
+MQ=Martinik
+MR=Mauritanija
+MS=Monserat
+MT=Malta
+MU=Mauricius
+MV=Maldivi
+MW=Malavi
+MX=Meksiko
+MY=Malezija
+MZ=Mozambik
+NA=Namibija
+NC=Nova Kaledonija
+NE=Niger
+NF=Norfolk Ostrvo
+NG=Nigerija
+NI=Nikaragva
+NL=Holandija
+NO=Norve\u0161ka
+NP=Nepal
+NR=Nauru
+NU=Niue
+NZ=Novi Zeland
+OM=Oman
+PA=Panama
+PE=Peru
+PF=Francuska Polinezija
+PG=Papua Nova Gvineja
+PH=Filipini
+PK=Pakistan
+PL=Poljska
+PM=Sen Pjer i Mikelon
+PN=Pitcairn
+PR=Porto Riko
+PS=Palestinska Teritorija
+PT=Portugal
+PW=Palau
+PY=Paragvaj
+QA=Katar
+RE=Rejunion
+RO=Rumunija
+RS=Srbija
+RU=Rusija
+RW=Ruanda
+SA=Saudijska Arabija
+SB=Solomonska Ostrva
+SC=Sej\u0161eli
+SD=Sudan
+SE=\u0160vedska
+SG=Singapur
+SH=Sveta Jelena
+SI=Slovenija
+SJ=Svalbard i Janmajen Ostrva
+SK=Slova\u010dka
+SL=Sijera Leone
+SM=San Marino
+SN=Senegal
+SO=Somalija
+SR=Surinam
+ST=Sao Tome i Principe
+SV=Salvador
+SY=Sirija
+SZ=Svazilend
+TC=Turks i Kajkos Ostrva
+TD=\u010cad
+TF=Francuske Ju\u017ene Teritorije
+TG=Togo
+TH=Tajland
+TJ=Tad\u017eikistan
+TK=Tokelau
+TL=Isto\u010dni Timor
+TM=Turkmenistan
+TN=Tunis
+TO=Tonga
+TR=Turska
+TT=Trinidad i Tobago
+TV=Tuvalu
+TW=Tajvan
+TZ=Tanzanija
+UA=Ukrajina
+UG=Uganda
+UM=Manja Udaljena Ostrva SAD
+US=Sjedinjene Ameri\u010dke Dr\u017eave
+UY=Urugvaj
+UZ=Uzbekistan
+VA=Vatikan
+VC=Sent Vinsent i Grenadini
+VE=Venecuela
+VG=Britanska Devi\u010danska Ostrva
+VI=S.A.D. Devi\u010danska Ostrva
+VN=Vijetnam
+VU=Vanuatu
+WF=Valis i Futuna Ostrva
+WS=Samoa
+YE=Jemen
+YT=Majote
+ZA=Ju\u017enoafri\u010dka Republika
+ZM=Zambija
+ZW=Zimbabve
--- a/jdk/src/share/demo/jfc/Notepad/resources/Notepad.properties	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/demo/jfc/Notepad/resources/Notepad.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -3,12 +3,15 @@
 
 Title=Notepad
 ElementTreeFrameTitle=Elements
+# The following string should NOT be translated: ViewportBackingStore
 ViewportBackingStore=false
 
 # menubar definition
 #
 # Each of the strings that follow form a key to be 
 # used to the actual menu definition.
+
+# The following string should NOT be translated: menubar
 menubar=file edit debug
 
 # file Menu definition
@@ -20,6 +23,8 @@
 # new  ->  Notepad.newAction
 # save ->  Notepad.saveAction
 # exit ->  Notepad.exitAction
+
+# The following string should NOT be translated: file
 file=new open save - exit
 fileLabel=File
 openLabel=Open
@@ -36,28 +41,38 @@
 # cut   -> JTextComponent.cutAction
 # copy  -> JTextComponent.copyAction
 # paste -> JTextComponent.pasteAction
+
+# The following string should NOT be translated: edit
 edit=cut copy paste - undo redo
 editLabel=Edit
 cutLabel=Cut
+# The following string should NOT be translated: cutAction
 cutAction=cut-to-clipboard
 cutImage=resources/cut.gif
 copyLabel=Copy
+# The following string should NOT be translated: copyAction
 copyAction=copy-to-clipboard
 copyImage=resources/copy.gif
 pasteLabel=Paste
+# The following string should NOT be translated: pasteAction
 pasteAction=paste-from-clipboard
 pasteImage=resources/paste.gif
 undoLabel=Undo
+# The following string should NOT be translated: undoAction
 undoAction=Undo
 redoLabel=Redo
+# The following string should NOT be translated: redoAction
 redoAction=Redo
 
 #
 # debug Menu definition
 #
+
+# The following string should NOT be translated: debug
 debug=dump showElementTree
 debugLabel=Debug
 dumpLabel=Dump model to System.err
+# The following string should NOT be translated: dumpAction
 dumpAction=dump-model
 showElementTreeLabel=Show Elements
 
@@ -67,6 +82,8 @@
 # used as the basis of the tool definition.  Actions
 # are of course sharable, and in this case are shared
 # with the menu items.
+
+# The following string should NOT be translated: toolbar
 toolbar=new open save - cut copy paste
 newTooltip=Create a new file
 openTooltip=Open a file
--- a/jdk/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -9,7 +9,7 @@
 #
 # Each of the strings that follow form a key to be 
 # used to the actual menu definition.
-menubar=\u30D5\u30A1\u30A4\u30EB \u7DE8\u96C6 \u30C7\u30D0\u30C3\u30B0
+menubar=file edit debug
 
 # file Menu definition
 #
@@ -20,7 +20,7 @@
 # new  ->  Notepad.newAction
 # save ->  Notepad.saveAction
 # exit ->  Notepad.exitAction
-file=\u65B0\u898F \u958B\u304F \u4FDD\u5B58 - \u7D42\u4E86
+file=new open save - exit
 fileLabel=\u30D5\u30A1\u30A4\u30EB
 openLabel=\u958B\u304F
 openImage=resources/open.gif
@@ -36,7 +36,7 @@
 # cut   -> JTextComponent.cutAction
 # copy  -> JTextComponent.copyAction
 # paste -> JTextComponent.pasteAction
-edit=\u5207\u53D6\u308A \u30B3\u30D4\u30FC \u8CBC\u4ED8\u3051 - \u5143\u306B\u623B\u3059 \u518D\u5B9F\u884C
+edit=cut copy paste - undo redo
 editLabel=\u7DE8\u96C6
 cutLabel=\u5207\u53D6\u308A
 cutAction=cut-to-clipboard
@@ -48,14 +48,14 @@
 pasteAction=paste-from-clipboard
 pasteImage=resources/paste.gif
 undoLabel=\u5143\u306B\u623B\u3059
-undoAction=\u5143\u306B\u623B\u3059
+undoAction=Undo
 redoLabel=\u518D\u5B9F\u884C
-redoAction=\u518D\u5B9F\u884C
+redoAction=Redo
 
 #
 # debug Menu definition
 #
-debug=showElementTree\u306E\u30C0\u30F3\u30D7
+debug=dump showElementTree
 debugLabel=\u30C7\u30D0\u30C3\u30B0
 dumpLabel=\u30E2\u30C7\u30EB\u3092System.err\u306B\u30C0\u30F3\u30D7
 dumpAction=dump-model
@@ -67,7 +67,7 @@
 # used as the basis of the tool definition.  Actions
 # are of course sharable, and in this case are shared
 # with the menu items.
-toolbar=\u65B0\u898F \u958B\u304F \u4FDD\u5B58 - \u5207\u53D6\u308A \u30B3\u30D4\u30FC \u8CBC\u4ED8\u3051
+toolbar=new open save - cut copy paste
 newTooltip=\u30D5\u30A1\u30A4\u30EB\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B
 openTooltip=\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F
 saveTooltip=\u30D5\u30A1\u30A4\u30EB\u306B\u4FDD\u5B58
--- a/jdk/src/share/demo/jfc/Notepad/resources/Notepad_zh_CN.properties	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/demo/jfc/Notepad/resources/Notepad_zh_CN.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -48,9 +48,9 @@
 pasteAction=paste-from-clipboard
 pasteImage=resources/paste.gif
 undoLabel=\u64A4\u6D88
-undoAction=\u64A4\u6D88
+undoAction=Undo
 redoLabel=\u91CD\u505A
-redoAction=\u91CD\u505A
+redoAction=Redo
 
 #
 # debug Menu definition
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -76,7 +76,7 @@
         } catch (IOException e) {
             throw new IllegalStateException(e);
         }
-        return new Iterator<>() {
+        return new Iterator<Path>() {
             private Path next;
             @Override
             public boolean hasNext() {
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Fri Mar 18 11:00:10 2011 -0700
@@ -112,11 +112,8 @@
         }
         // sm and existence check
         zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ);
-        try {
-            zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.WRITE);
-        } catch (AccessDeniedException x) {
+        if (!Files.isWritable(zfpath))
             this.readOnly = true;
-        }
         this.zc = ZipCoder.get(nameEncoding);
         this.defaultdir = new ZipPath(this, getBytes(defaultDir));
         this.ch = Files.newByteChannel(zfpath, READ);
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -590,7 +590,7 @@
 
     @Override
     public Iterator<Path> iterator() {
-        return new Iterator<>() {
+        return new Iterator<Path>() {
             private int i = 0;
 
             @Override
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -695,6 +695,46 @@
 }
 
 /*
+ * converts the Java CK_AES_CTR_PARAMS object to a CK_AES_CTR_PARAMS structure
+ *
+ * @param env - used to call JNI funktions to get the Java classes and objects
+ * @param jParam - the Java CK_AES_CTR_PARAMS object to convert
+ * @param ckpParam - pointer to the new CK_AES_CTR_PARAMS structure
+ */
+void jAesCtrParamsToCKAesCtrParam(JNIEnv *env, jobject jParam,
+                                  CK_AES_CTR_PARAMS_PTR ckpParam) {
+    jclass jAesCtrParamsClass;
+    jfieldID fieldID;
+    jlong jCounterBits;
+    jobject jCb;
+    CK_BYTE_PTR ckBytes;
+    CK_ULONG ckTemp;
+
+    /* get ulCounterBits */
+    jAesCtrParamsClass = (*env)->FindClass(env, CLASS_AES_CTR_PARAMS);
+    if (jAesCtrParamsClass == NULL) { return; }
+    fieldID = (*env)->GetFieldID(env, jAesCtrParamsClass, "ulCounterBits", "J");
+    if (fieldID == NULL) { return; }
+    jCounterBits = (*env)->GetLongField(env, jParam, fieldID);
+
+    /* get cb */
+    fieldID = (*env)->GetFieldID(env, jAesCtrParamsClass, "cb", "[B");
+    if (fieldID == NULL) { return; }
+    jCb = (*env)->GetObjectField(env, jParam, fieldID);
+
+    /* populate java values */
+    ckpParam->ulCounterBits = jLongToCKULong(jCounterBits);
+    jByteArrayToCKByteArray(env, jCb, &ckBytes, &ckTemp);
+    if ((*env)->ExceptionCheck(env)) { return; }
+    if (ckTemp != 16) {
+        TRACE1("ERROR: WRONG CTR IV LENGTH %d", ckTemp);
+    } else {
+        memcpy(ckpParam->cb, ckBytes, ckTemp);
+        free(ckBytes);
+    }
+}
+
+/*
  * converts a Java CK_MECHANISM object into a CK_MECHANISM structure
  *
  * @param env - used to call JNI funktions to get the values out of the Java object
@@ -937,12 +977,10 @@
 {
     /* get all Java mechanism parameter classes */
     jclass jVersionClass, jSsl3MasterKeyDeriveParamsClass, jSsl3KeyMatParamsClass;
-    jclass jTlsPrfParamsClass, jRsaPkcsOaepParamsClass, jPbeParamsClass;
-    jclass jPkcs5Pbkd2ParamsClass, jRsaPkcsPssParamsClass;
+    jclass jTlsPrfParamsClass, jAesCtrParamsClass, jRsaPkcsOaepParamsClass;
+    jclass jPbeParamsClass, jPkcs5Pbkd2ParamsClass, jRsaPkcsPssParamsClass;
     jclass jEcdh1DeriveParamsClass, jEcdh2DeriveParamsClass;
     jclass jX942Dh1DeriveParamsClass, jX942Dh2DeriveParamsClass;
-
-    /* get all Java mechanism parameter classes */
     TRACE0("\nDEBUG: jMechanismParameterToCKMechanismParameter");
 
     /* most common cases, i.e. NULL/byte[]/long, are already handled by
@@ -1046,6 +1084,33 @@
         return;
     }
 
+    jAesCtrParamsClass = (*env)->FindClass(env, CLASS_AES_CTR_PARAMS);
+    if (jAesCtrParamsClass == NULL) { return; }
+    if ((*env)->IsInstanceOf(env, jParam, jAesCtrParamsClass)) {
+        /*
+         * CK_AES_CTR_PARAMS
+         */
+        CK_AES_CTR_PARAMS_PTR ckpParam;
+
+        ckpParam = (CK_AES_CTR_PARAMS_PTR) malloc(sizeof(CK_AES_CTR_PARAMS));
+        if (ckpParam == NULL) {
+            JNU_ThrowOutOfMemoryError(env, 0);
+            return;
+        }
+
+        /* convert jParameter to CKParameter */
+        jAesCtrParamsToCKAesCtrParam(env, jParam, ckpParam);
+        if ((*env)->ExceptionCheck(env)) {
+            free(ckpParam);
+            return;
+        }
+
+        /* get length and pointer of parameter */
+        *ckpLength = sizeof(CK_AES_CTR_PARAMS);
+        *ckpParamPtr = ckpParam;
+        return;
+    }
+
     jRsaPkcsOaepParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_OAEP_PARAMS);
     if (jRsaPkcsOaepParamsClass == NULL) { return; }
     if ((*env)->IsInstanceOf(env, jParam, jRsaPkcsOaepParamsClass)) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs-11v2-20a3.h	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,124 @@
+/* pkcs-11v2-20a3.h include file for the PKCS #11 Version 2.20 Amendment 3
+   document. */
+
+/* $Revision: 1.4 $ */
+
+/* License to copy and use this software is granted provided that it is
+ * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
+ * (Cryptoki) Version 2.20 Amendment 3" in all material mentioning or
+ * referencing this software.
+
+ * RSA Security Inc. makes no representations concerning either the
+ * merchantability of this software or the suitability of this software for
+ * any particular purpose. It is provided "as is" without express or implied
+ * warranty of any kind.
+ */
+
+/* This file is preferably included after inclusion of pkcs11.h */
+
+#ifndef _PKCS_11V2_20A3_H_
+#define _PKCS_11V2_20A3_H_ 1
+
+/* Are the definitions of this file already included in pkcs11t.h ? */
+#ifndef CKK_CAMELLIA
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Key types */
+
+/* Camellia is new for PKCS #11 v2.20 amendment 3 */
+#define CKK_CAMELLIA                   0x00000025
+/* ARIA is new for PKCS #11 v2.20 amendment 3 */
+#define CKK_ARIA                       0x00000026
+
+
+/* Mask-generating functions */
+
+/* SHA-224 is new for PKCS #11 v2.20 amendment 3 */
+#define CKG_MGF1_SHA224                0x00000005
+
+
+/* Mechanism Identifiers */
+
+/* SHA-224 is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_SHA224                     0x00000255
+#define CKM_SHA224_HMAC                0x00000256
+#define CKM_SHA224_HMAC_GENERAL        0x00000257
+
+/* SHA-224 key derivation is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_SHA224_KEY_DERIVATION      0x00000396
+
+/* SHA-224 RSA mechanisms are new for PKCS #11 v2.20 amendment 3 */
+#define CKM_SHA224_RSA_PKCS            0x00000046
+#define CKM_SHA224_RSA_PKCS_PSS        0x00000047
+
+/* AES counter mode is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_AES_CTR                    0x00001086
+
+/* Camellia is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_CAMELLIA_KEY_GEN           0x00000550
+#define CKM_CAMELLIA_ECB               0x00000551
+#define CKM_CAMELLIA_CBC               0x00000552
+#define CKM_CAMELLIA_MAC               0x00000553
+#define CKM_CAMELLIA_MAC_GENERAL       0x00000554
+#define CKM_CAMELLIA_CBC_PAD           0x00000555
+#define CKM_CAMELLIA_ECB_ENCRYPT_DATA  0x00000556
+#define CKM_CAMELLIA_CBC_ENCRYPT_DATA  0x00000557
+#define CKM_CAMELLIA_CTR               0x00000558
+
+/* ARIA is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_ARIA_KEY_GEN               0x00000560
+#define CKM_ARIA_ECB                   0x00000561
+#define CKM_ARIA_CBC                   0x00000562
+#define CKM_ARIA_MAC                   0x00000563
+#define CKM_ARIA_MAC_GENERAL           0x00000564
+#define CKM_ARIA_CBC_PAD               0x00000565
+#define CKM_ARIA_ECB_ENCRYPT_DATA      0x00000566
+#define CKM_ARIA_CBC_ENCRYPT_DATA      0x00000567
+
+
+/* Mechanism parameters */
+
+/* CK_AES_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_AES_CTR_PARAMS {
+    CK_ULONG ulCounterBits;
+    CK_BYTE cb[16];
+} CK_AES_CTR_PARAMS;
+
+typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR;
+
+/* CK_CAMELLIA_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_CAMELLIA_CTR_PARAMS {
+    CK_ULONG ulCounterBits;
+    CK_BYTE cb[16];
+} CK_CAMELLIA_CTR_PARAMS;
+
+typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR;
+
+/* CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS {
+    CK_BYTE      iv[16];
+    CK_BYTE_PTR  pData;
+    CK_ULONG     length;
+} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS;
+
+typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR;
+
+/* CK_ARIA_CBC_ENCRYPT_DATA_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS {
+    CK_BYTE      iv[16];
+    CK_BYTE_PTR  pData;
+    CK_ULONG     length;
+} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS;
+
+typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -153,6 +153,7 @@
 #include "p11_md.h"
 
 #include "pkcs11.h"
+#include "pkcs-11v2-20a3.h"
 #include <jni.h>
 #include <jni_util.h>
 
@@ -272,6 +273,7 @@
 #define CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_SSL3_MASTER_KEY_DERIVE_PARAMS"
 #define CLASS_SSL3_KEY_MAT_PARAMS "sun/security/pkcs11/wrapper/CK_SSL3_KEY_MAT_PARAMS"
 #define CLASS_TLS_PRF_PARAMS "sun/security/pkcs11/wrapper/CK_TLS_PRF_PARAMS"
+#define CLASS_AES_CTR_PARAMS "sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS"
 
 /* function to convert a PKCS#11 return value other than CK_OK into a Java Exception
  * or to throw a PKCS11RuntimeException
--- a/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java	Fri Mar 18 11:00:10 2011 -0700
@@ -571,9 +571,9 @@
                     long newLastSyncTime = 0;
                     try {
                         newLastSyncTime = prefsFile.lastModified();
-                        FileInputStream fis = new FileInputStream(prefsFile);
-                        XmlSupport.importMap(fis, m);
-                        fis.close();
+                        try (FileInputStream fis = new FileInputStream(prefsFile)) {
+                            XmlSupport.importMap(fis, m);
+                        }
                     } catch(Exception e) {
                         if (e instanceof InvalidPreferencesFormatException) {
                             getLogger().warning("Invalid preferences format in "
@@ -618,9 +618,9 @@
                         if (!dir.exists() && !dir.mkdirs())
                             throw new BackingStoreException(dir +
                                                              " create failed.");
-                        FileOutputStream fos = new FileOutputStream(tmpFile);
-                        XmlSupport.exportMap(fos, prefsCache);
-                        fos.close();
+                        try (FileOutputStream fos = new FileOutputStream(tmpFile)) {
+                            XmlSupport.exportMap(fos, prefsCache);
+                        }
                         if (!tmpFile.renameTo(prefsFile))
                             throw new BackingStoreException("Can't rename " +
                             tmpFile + " to " + prefsFile);
--- a/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Fri Mar 18 11:00:10 2011 -0700
@@ -56,12 +56,14 @@
     }
 
     private native void run(String title, int mode, String dir, String file,
-            FilenameFilter filter, boolean isMultipleMode);
+                            FilenameFilter filter, boolean isMultipleMode, int x, int y);
     private native void quit();
 
     @Override
     public native void toFront();
 
+    @Override
+    public native void setBounds(int x, int y, int width, int height, int op);
 
     /**
      * Called exclusively by the native C code.
@@ -106,9 +108,8 @@
                 Thread t = new Thread() {
                     public void run() {
                         GtkFileDialogPeer.this.run(fd.getTitle(), fd.getMode(),
-                                fd.getDirectory(), fd.getFile(), fd
-                                        .getFilenameFilter(), fd
-                                        .isMultipleMode());
+                                   fd.getDirectory(), fd.getFile(), fd.getFilenameFilter(), fd.isMultipleMode(),
+                                   fd.getX(), fd.getY());
                         fd.setVisible(false);
                     }
                 };
--- a/jdk/src/solaris/classes/sun/font/XRGlyphCache.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/classes/sun/font/XRGlyphCache.java	Fri Mar 18 11:00:10 2011 -0700
@@ -70,9 +70,14 @@
         try {
             SunToolkit.awtLock();
 
-            ArrayList<Integer> glyphIDList = new ArrayList<Integer>(glyphPtrList.size());
+            GrowableIntArray glyphIDList = new GrowableIntArray(1, glyphPtrList.size());
             for (long glyphPtr : glyphPtrList) {
-                glyphIDList.add(XRGlyphCacheEntry.getGlyphID(glyphPtr));
+                int glyphID = XRGlyphCacheEntry.getGlyphID(glyphPtr);
+
+                //Check if glyph hasn't been freed already
+                if (glyphID != 0) {
+                   glyphIDList.addInt(glyphID);
+                }
             }
             freeGlyphs(glyphIDList);
         } finally {
@@ -83,7 +88,6 @@
     protected int getFreeGlyphID() {
         if (freeGlyphIDs.size() > 0) {
             int newID = freeGlyphIDs.remove(freeGlyphIDs.size() - 1);
-            ;
             return newID;
         }
         return nextID++;
@@ -246,7 +250,7 @@
             glyph.setPinned();
         }
 
-        ArrayList<Integer> deleteGlyphList = new ArrayList<Integer>();
+        GrowableIntArray deleteGlyphList = new GrowableIntArray(1, 10);
         int pixelsToRelease = cachedPixels - MAX_CACHED_PIXELS;
 
         for (int i = cacheList.size() - 1; i >= 0 && pixelsToRelease > 0; i--) {
@@ -254,7 +258,7 @@
 
             if (!entry.isPinned()) {
                 pixelsToRelease -= entry.getPixelCnt();
-                deleteGlyphList.add(new Integer(entry.getGlyphID()));
+                deleteGlyphList.addInt(entry.getGlyphID());
             }
         }
 
@@ -265,26 +269,23 @@
         freeGlyphs(deleteGlyphList);
     }
 
-    private void freeGlyphs(List<Integer> glyphIdList) {
-
-        freeGlyphIDs.addAll(glyphIdList);
+    private void freeGlyphs(GrowableIntArray glyphIdList) {
+        GrowableIntArray removedLCDGlyphs = new GrowableIntArray(1, 10);
+        GrowableIntArray removedGrayscaleGlyphs = new GrowableIntArray(1, 10);
 
-        GrowableIntArray removedLCDGlyphs = new GrowableIntArray(1, 1);
-        GrowableIntArray removedGrayscaleGlyphs = new GrowableIntArray(1, 1);
+        for (int i=0; i < glyphIdList.getSize(); i++) {
+            int glyphId = glyphIdList.getInt(i);
+            freeGlyphIDs.add(glyphId);
 
-        for (Integer glyphId : glyphIdList) {
-            tmp.setValue(glyphId.intValue());
+            tmp.setValue(glyphId);
             XRGlyphCacheEntry entry = cacheMap.get(tmp);
             cachedPixels -= entry.getPixelCnt();
-
-            int removedGlyphID = entry.getGlyphID();
-            tmp.setValue(removedGlyphID);
             cacheMap.remove(tmp);
 
             if (entry.getGlyphSet() == grayGlyphSet) {
-                removedGrayscaleGlyphs.addInt(removedGlyphID);
+                removedGrayscaleGlyphs.addInt(glyphId);
             } else {
-                removedLCDGlyphs.addInt(removedGlyphID);
+                removedLCDGlyphs.addInt(glyphId);
             }
 
             entry.setGlyphID(0);
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Fri Mar 18 11:00:10 2011 -0700
@@ -55,6 +55,8 @@
 
     native void initXRPicture(long xsdo, int pictForm);
 
+    native void freeXSDOPicture(long xsdo);
+
     public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap";
     public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap";
     public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap";
@@ -531,6 +533,17 @@
         public Object getDestination() {
             return peer.getTarget();
         }
+
+       public void invalidate() {
+           try {
+               SunToolkit.awtLock();
+               freeXSDOPicture(getNativeOps());
+           }finally {
+               SunToolkit.awtUnlock();
+           }
+
+           super.invalidate();
+       }
     }
 
     public static class XRInternalSurfaceData extends XRSurfaceData {
--- a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java	Fri Mar 18 11:00:10 2011 -0700
@@ -236,7 +236,9 @@
         } catch (SecurityException x) {
             try {
                 ch.close();
-            } catch (IOException ignore) { }
+            } catch (Throwable suppressed) {
+                x.addSuppressed(suppressed);
+            }
             throw x;
         }
         return ch;
--- a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Fri Mar 18 11:00:10 2011 -0700
@@ -137,7 +137,7 @@
         return port;
     }
 
-    // register for events if there are outstanding I/O operations
+    // register events for outstanding I/O operations, caller already owns updateLock
     private void updateEvents() {
         assert Thread.holdsLock(updateLock);
         int events = 0;
@@ -149,6 +149,13 @@
             port.startPoll(fdVal, events);
     }
 
+    // register events for outstanding I/O operations
+    private void lockAndUpdateEvents() {
+        synchronized (updateLock) {
+            updateEvents();
+        }
+    }
+
     // invoke to finish read and/or write operations
     private void finish(boolean mayInvokeDirect,
                         boolean readable,
@@ -255,10 +262,11 @@
             // close channel if connection cannot be established
             try {
                 close();
-            } catch (IOException ignore) { }
+            } catch (Throwable suppressed) {
+                e.addSuppressed(suppressed);
+            }
         }
 
-
         // invoke handler and set result
         CompletionHandler<Void,Object> handler = connectHandler;
         Object att = connectAttachment;
@@ -345,7 +353,9 @@
         if (e != null) {
             try {
                 close();
-            } catch (IOException ignore) { }
+            } catch (Throwable suppressed) {
+                e.addSuppressed(suppressed);
+            }
         }
         if (handler == null) {
             return CompletedFuture.withResult(null, e);
@@ -399,9 +409,8 @@
             exc = x;
         } finally {
             // restart poll in case of concurrent write
-            synchronized (updateLock) {
-                updateEvents();
-            }
+            if (!(exc instanceof AsynchronousCloseException))
+                lockAndUpdateEvents();
             end();
         }
 
@@ -595,9 +604,8 @@
             exc = x;
         } finally {
             // restart poll in case of concurrent write
-            synchronized (updateLock) {
-                updateEvents();
-            }
+            if (!(exc instanceof AsynchronousCloseException))
+                lockAndUpdateEvents();
             end();
         }
 
--- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,22 +77,24 @@
          */
 #endif /* __linux__ */
         struct hostent res, res2, *hp;
-        char buf[HENT_BUF_SIZE];
-        char buf2[HENT_BUF_SIZE];
+        // these buffers must be pointer-aligned so they are declared
+        // with pointer type
+        char *buf[HENT_BUF_SIZE/(sizeof (char *))];
+        char *buf2[HENT_BUF_SIZE/(sizeof (char *))];
         int h_error=0;
 
 #ifdef __GLIBC__
-        gethostbyname_r(hostname, &res, buf, sizeof(buf), &hp, &h_error);
+        gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &hp, &h_error);
 #else
-        hp = gethostbyname_r(hostname, &res, buf, sizeof(buf), &h_error);
+        hp = gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &h_error);
 #endif
         if (hp) {
 #ifdef __GLIBC__
             gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET,
-                            &res2, buf2, sizeof(buf2), &hp, &h_error);
+                            &res2, (char*)buf2, sizeof(buf2), &hp, &h_error);
 #else
             hp = gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET,
-                                 &res2, buf2, sizeof(buf2), &h_error);
+                                 &res2, (char*)buf2, sizeof(buf2), &h_error);
 #endif
             if (hp) {
                 /*
@@ -136,7 +138,9 @@
     const char *hostname;
     jobjectArray ret = 0;
     struct hostent res, *hp = 0;
-    char buf[HENT_BUF_SIZE];
+    // this buffer must be pointer-aligned so is declared
+    // with pointer type
+    char *buf[HENT_BUF_SIZE/(sizeof (char *))];
 
     /* temporary buffer, on the off chance we need to expand */
     char *tmp = NULL;
@@ -176,9 +180,9 @@
 
     /* Try once, with our static buffer. */
 #ifdef __GLIBC__
-    gethostbyname_r(hostname, &res, buf, sizeof(buf), &hp, &h_error);
+    gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &hp, &h_error);
 #else
-    hp = gethostbyname_r(hostname, &res, buf, sizeof(buf), &h_error);
+    hp = gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &h_error);
 #endif
 
     /* With the re-entrant system calls, it's possible that the buffer
@@ -251,7 +255,9 @@
     jstring ret = NULL;
     jint addr;
     struct hostent hent, *hp = 0;
-    char buf[HENT_BUF_SIZE];
+    // this buffer must be pointer-aligned so is declared
+    // with pointer type
+    char *buf[HENT_BUF_SIZE/(sizeof (char *))];
     int h_error = 0;
     char *tmp = NULL;
 
@@ -273,10 +279,10 @@
     addr = htonl(addr);
 #ifdef __GLIBC__
     gethostbyaddr_r((char *)&addr, sizeof(addr), AF_INET, &hent,
-                    buf, sizeof(buf), &hp, &h_error);
+                    (char*)buf, sizeof(buf), &hp, &h_error);
 #else
     hp = gethostbyaddr_r((char *)&addr, sizeof(addr), AF_INET, &hent,
-                         buf, sizeof(buf), &h_error);
+                         (char*)buf, sizeof(buf), &h_error);
 #endif
     /* With the re-entrant system calls, it's possible that the buffer
      * we pass to it is not large enough to hold an exceptionally
--- a/jdk/src/solaris/native/java/net/NetworkInterface.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/java/net/NetworkInterface.c	Fri Mar 18 11:00:10 2011 -0700
@@ -45,7 +45,6 @@
 #ifdef __linux__
 #include <sys/ioctl.h>
 #include <bits/ioctls.h>
-#include <linux/sockios.h>
 #include <sys/utsname.h>
 #include <stdio.h>
 #endif
@@ -1100,7 +1099,7 @@
 #ifdef AF_INET6
 static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) {
     FILE *f;
-    char addr6[40], devname[20];
+    char addr6[40], devname[21];
     char addr6p[8][5];
     int plen, scope, dad_status, if_idx;
     uint8_t ipv6addr[16];
--- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Fri Mar 18 11:00:10 2011 -0700
@@ -34,8 +34,8 @@
 #include <fcntl.h>
 #endif
 #ifdef __linux__
-#include <linux/unistd.h>
-#include <linux/sysctl.h>
+#include <unistd.h>
+#include <sys/sysctl.h>
 #include <sys/utsname.h>
 #include <netinet/ip.h>
 
--- a/jdk/src/solaris/native/java/net/PlainSocketImpl.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/java/net/PlainSocketImpl.c	Fri Mar 18 11:00:10 2011 -0700
@@ -42,8 +42,8 @@
 #include <fcntl.h>
 #endif
 #ifdef __linux__
-#include <linux/unistd.h>
-#include <linux/sysctl.h>
+#include <unistd.h>
+#include <sys/sysctl.h>
 #endif
 
 #include "jvm.h"
--- a/jdk/src/solaris/native/java/net/linux_close.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/java/net/linux_close.c	Fri Mar 18 11:00:10 2011 -0700
@@ -112,7 +112,7 @@
  */
 static inline fdEntry_t *getFdEntry(int fd)
 {
-    if (fd < 0 || fd > fdCount) {
+    if (fd < 0 || fd >= fdCount) {
         return NULL;
     }
     return &fdTable[fd];
--- a/jdk/src/solaris/native/java/net/net_util_md.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/java/net/net_util_md.c	Fri Mar 18 11:00:10 2011 -0700
@@ -608,7 +608,7 @@
     {
         /* now find the scope_id for "lo" */
 
-        char devname[20];
+        char devname[21];
         char addr6p[8][5];
         int plen, scope, dad_status, if_idx;
 
@@ -651,7 +651,7 @@
 static void initLocalIfs () {
     FILE *f;
     unsigned char staddr [16];
-    char ifname [32];
+    char ifname [33];
     struct localinterface *lif=0;
     int index, x1, x2, x3;
     unsigned int u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,ua,ub,uc,ud,ue,uf;
@@ -660,7 +660,7 @@
         return ;
     }
     while (fscanf (f, "%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x "
-                "%d %x %x %x %s",&u0,&u1,&u2,&u3,&u4,&u5,&u6,&u7,
+                "%d %x %x %x %32s",&u0,&u1,&u2,&u3,&u4,&u5,&u6,&u7,
                 &u8,&u9,&ua,&ub,&uc,&ud,&ue,&uf,
                 &index, &x1, &x2, &x3, ifname) == 21) {
         staddr[0] = (unsigned char)u0;
@@ -1102,7 +1102,7 @@
      * index.
      */
     if (match) {
-        char devname[20];
+        char devname[21];
         char addr6p[8][5];
         int plen, scope, dad_status, if_idx;
 
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Fri Mar 18 11:00:10 2011 -0700
@@ -608,7 +608,10 @@
         fp_gtk_viewport_new = dl_symbol("gtk_viewport_new");
         fp_gtk_window_new = dl_symbol("gtk_window_new");
         fp_gtk_window_present = dl_symbol("gtk_window_present");
-        fp_gtk_dialog_new = dl_symbol("gtk_dialog_new");
+        fp_gtk_window_move = dl_symbol("gtk_window_move");
+        fp_gtk_window_resize = dl_symbol("gtk_window_resize");
+
+          fp_gtk_dialog_new = dl_symbol("gtk_dialog_new");
         fp_gtk_frame_new = dl_symbol("gtk_frame_new");
 
         fp_gtk_adjustment_new = dl_symbol("gtk_adjustment_new");
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.h	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.h	Fri Mar 18 11:00:10 2011 -0700
@@ -750,7 +750,8 @@
 GdkPixbuf *(*fp_gdk_pixbuf_new_from_file)(const char *filename, GError **error);
 void (*fp_gtk_widget_destroy)(GtkWidget *widget);
 void (*fp_gtk_window_present)(GtkWindow *window);
-
+void (*fp_gtk_window_move)(GtkWindow *window, gint x, gint y);
+void (*fp_gtk_window_resize)(GtkWindow *window, gint width, gint height);
 
 /**
  * Function Pointers for GtkFileChooser
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Fri Mar 18 11:00:10 2011 -0700
@@ -102,6 +102,33 @@
     fp_gdk_threads_leave();
 }
 
+/*
+ * Class:     sun_awt_X11_GtkFileDialogPeer
+ * Method:    setBounds
+ * Signature: (IIIII)V
+ */
+JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_setBounds
+(JNIEnv * env, jobject jpeer, jint x, jint y, jint width, jint height, jint op)
+{
+    GtkWindow* dialog;
+
+    fp_gdk_threads_enter();
+
+    dialog = (GtkWindow*)jlong_to_ptr(
+        (*env)->GetLongField(env, jpeer, widgetFieldID));
+
+    if (dialog != NULL) {
+        if (x >= 0 && y >= 0) {
+            fp_gtk_window_move(dialog, (gint)x, (gint)y);
+        }
+        if (width > 0 && height > 0) {
+            fp_gtk_window_resize(dialog, (gint)width, (gint)height);
+        }
+    }
+
+    fp_gdk_threads_leave();
+}
+
 /**
  * Convert a GSList to an array of filenames (without the parent folder)
  */
@@ -175,12 +202,12 @@
 /*
  * Class:     sun_awt_X11_GtkFileDialogPeer
  * Method:    run
- * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;Z;)V
+ * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;ZII)V
  */
 JNIEXPORT void JNICALL
 Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer,
         jstring jtitle, jint mode, jstring jdir, jstring jfile,
-        jobject jfilter, jboolean multiple)
+        jobject jfilter, jboolean multiple, int x, int y)
 {
     GtkWidget *dialog = NULL;
     GtkFileFilter *filter;
@@ -244,6 +271,14 @@
                 dialog), TRUE);
     }
 
+    /* Set the initial location */
+    if (x >= 0 && y >= 0) {
+        fp_gtk_window_move((GtkWindow*)dialog, (gint)x, (gint)y);
+
+        // NOTE: it doesn't set the initial size for the file chooser
+        // as it seems like the file chooser overrides the size internally
+    }
+
     fp_g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(
             handle_response), jpeer);
 
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h	Fri Mar 18 11:00:10 2011 -0700
@@ -20,10 +20,10 @@
 /*
  * Class:     sun_awt_X11_GtkFileDialogPeer
  * Method:    run
- * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;Z;)V
+ * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;ZII)V
  */
 JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_run
-(JNIEnv *, jobject, jstring, jint, jstring, jstring, jobject, jboolean);
+(JNIEnv *, jobject, jstring, jint, jstring, jstring, jobject, jboolean, jint, jint);
 
 /*
  * Class:     sun_awt_X11_GtkFileDialogPeer
@@ -41,6 +41,14 @@
 JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_toFront
 (JNIEnv *, jobject);
 
+/*
+ * Class:     sun_awt_X11_GtkFileDialogPeer
+ * Method:    setBounds
+ * Signature: (IIIII)V
+ */
+JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_setBounds
+(JNIEnv * env, jobject jpeer, jint x, jint y, jint width, jint height, jint op);
+
 #ifdef __cplusplus
 }
 #endif
--- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Fri Mar 18 11:00:10 2011 -0700
@@ -375,6 +375,12 @@
     AWT_LOCK();
 
     xsdo->invalid = JNI_TRUE;
+
+    if (xsdo->xrPic != None) {
+        XRenderFreePicture(awt_display, xsdo->xrPic);
+        xsdo->xrPic = None;
+     }
+
     if (xsdo->isPixmap == JNI_TRUE && xsdo->drawable != 0) {
 #ifdef MITSHM
         if (xsdo->shmPMData.shmSegInfo != NULL) {
--- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Fri Mar 18 11:00:10 2011 -0700
@@ -304,23 +304,27 @@
     color.blue = blue;
 
     if (rectCnt <= 256) {
-      xRects = &sRects[0];
+        xRects = &sRects[0];
     } else {
-      xRects = (XRectangle *) malloc(sizeof(XRectangle) * rectCnt);
-      if (xRects == NULL) {
-        return;
-      }
+        xRects = (XRectangle *) malloc(sizeof(XRectangle) * rectCnt);
+        if (xRects == NULL) {
+            return;
+        }
     }
 
-    if ((rects = (jint *) (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
-      return;
+    if ((rects = (jint *)
+         (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
+        if (xRects != &sRects[0]) {
+            free(xRects);
+        }
+        return;
     }
 
     for (i=0; i < rectCnt; i++) {
-      xRects[i].x = rects[i*4 + 0];
-      xRects[i].y = rects[i*4 + 1];
-      xRects[i].width = rects[i*4 + 2];
-      xRects[i].height = rects[i*4 + 3];
+        xRects[i].x = rects[i*4 + 0];
+        xRects[i].y = rects[i*4 + 1];
+        xRects[i].width = rects[i*4 + 2];
+        xRects[i].height = rects[i*4 + 3];
     }
 
     XRenderFillRectangles(awt_display, op,
@@ -328,7 +332,7 @@
 
     (*env)->ReleasePrimitiveArrayCritical(env, rectArray, rects, JNI_ABORT);
     if (xRects != &sRects[0]) {
-      free(xRects);
+        free(xRects);
     }
 }
 
@@ -610,17 +614,30 @@
     Glyph *gid = (Glyph *) malloc(sizeof(Glyph) * glyphCnt);
 
     if (xginfo == NULL || gid == NULL) {
-      return;
+        if (xginfo != NULL) {
+            free(xginfo);
+        }
+        if (gid != NULL) {
+            free(gid);
+        }
+        return;
     }
 
-    if ((glyphInfoPtrs = (jlong *) (*env)->GetPrimitiveArrayCritical(env, glyphInfoPtrsArray, NULL)) == NULL) {
+    if ((glyphInfoPtrs = (jlong *)(*env)->
+        GetPrimitiveArrayCritical(env, glyphInfoPtrsArray, NULL)) == NULL)
+    {
+        free(xginfo);
+        free(gid);
         return;
     }
 
     if ((pixelData = (unsigned char *)
-        (*env)->GetPrimitiveArrayCritical(env, pixelDataArray, NULL)) == NULL) {
+        (*env)->GetPrimitiveArrayCritical(env, pixelDataArray, NULL)) == NULL)
+    {
         (*env)->ReleasePrimitiveArrayCritical(env,
-                                  glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
+                                glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
+        free(xginfo);
+        free(gid);
         return;
     }
 
@@ -637,7 +654,7 @@
     }
 
     XRenderAddGlyphs(awt_display, glyphSet, &gid[0], &xginfo[0], glyphCnt,
-                     pixelData, pixelDataLength);
+                     (const char*)pixelData, pixelDataLength);
 
     (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
     (*env)->ReleasePrimitiveArrayCritical(env, pixelDataArray, pixelData, JNI_ABORT);
@@ -684,22 +701,44 @@
       xelts = &selts[0];
     }else {
       xelts = (XGlyphElt32 *) malloc(sizeof(XGlyphElt32) * eltCnt);
+      if (xelts == NULL) {
+          return;
+      }
     }
 
     if (glyphCnt <= 256) {
       xids = &sids[0];
-    }else {
+    } else {
       xids = (Glyph *) malloc(sizeof(Glyph) * glyphCnt);
+      if (xids == NULL) {
+          if (xelts != &selts[0]) {
+            free(xelts);
+          }
+          return;
+      }
     }
 
-    if ((ids = (jint *) (*env)->GetPrimitiveArrayCritical(env, glyphIDArray, NULL)) == NULL) {
-      return;
+    if ((ids = (jint *)
+         (*env)->GetPrimitiveArrayCritical(env, glyphIDArray, NULL)) == NULL) {
+        if (xelts != &selts[0]) {
+            free(xelts);
+        }
+        if (xids != &sids[0]) {
+            free(xids);
+        }
+        return;
     }
     if ((elts = (jint *)
           (*env)->GetPrimitiveArrayCritical(env, eltArray, NULL)) == NULL) {
         (*env)->ReleasePrimitiveArrayCritical(env,
                                               glyphIDArray, ids, JNI_ABORT);
-      return;
+        if (xelts != &selts[0]) {
+            free(xelts);
+        }
+        if (xids != &sids[0]) {
+            free(xids);
+        }
+        return;
     }
 
     for (i=0; i < glyphCnt; i++) {
@@ -724,11 +763,11 @@
     (*env)->ReleasePrimitiveArrayCritical(env, eltArray, elts, JNI_ABORT);
 
     if (xelts != &selts[0]) {
-      free(xelts);
+        free(xelts);
     }
 
     if (xids != &sids[0]) {
-      free(xids);
+        free(xids);
     }
 }
 
@@ -762,8 +801,12 @@
       }
     }
 
-    if ((rects = (jint *) (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
-      return;
+    if ((rects = (jint*)
+         (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
+        if (xRects != &sRects[0]) {
+            free(xRects);
+        }
+        return;
     }
 
     for (i=0; i < rectCnt; i++) {
--- a/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	Fri Mar 18 11:00:10 2011 -0700
@@ -114,3 +114,26 @@
     XShared_initSurface(env, xsdo, depth, width, height, drawable);
 #endif /* !HEADLESS */
 }
+
+
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture(JNIEnv *env, jobject xsd,
+                                                  jlong pXSData)
+{
+#ifndef HEADLESS
+    X11SDOps *xsdo;
+
+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_freeXSDOPicture");
+
+    xsdo = X11SurfaceData_GetOps(env, xsd);
+    if (xsdo == NULL) {
+        return;
+    }
+
+    if(xsdo->xrPic != None) {
+       XRenderFreePicture(awt_display, xsdo->xrPic);
+       xsdo->xrPic = None;
+    }
+#endif /* !HEADLESS */
+}
--- a/jdk/src/windows/classes/sun/nio/ch/PendingIoCache.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/classes/sun/nio/ch/PendingIoCache.java	Fri Mar 18 11:00:10 2011 -0700
@@ -110,8 +110,7 @@
             if (closed)
                 return;
 
-            // handle the case that where there are I/O operations that have
-            // not completed.
+            // handle case where I/O operations that have not completed.
             if (!pendingIoMap.isEmpty())
                 clearPendingIoMap();
 
@@ -132,7 +131,9 @@
         closePending = true;
         try {
             this.wait(50);
-        } catch (InterruptedException x) { }
+        } catch (InterruptedException x) {
+            Thread.currentThread().interrupt();
+        }
         closePending = false;
         if (pendingIoMap.isEmpty())
             return;
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Fri Mar 18 11:00:10 2011 -0700
@@ -439,6 +439,7 @@
                 address = ((DirectBuffer)buf).address();
             }
 
+            boolean pending = false;
             try {
                 begin();
 
@@ -449,6 +450,7 @@
                 n = readFile(handle, address, rem, position, overlapped);
                 if (n == IOStatus.UNAVAILABLE) {
                     // I/O is pending
+                    pending = true;
                     return;
                 } else if (n == IOStatus.EOF) {
                     result.setResult(n);
@@ -460,14 +462,15 @@
                 // failed to initiate read
                 result.setFailure(toIOException(x));
             } finally {
+                if (!pending) {
+                    // release resources
+                    if (overlapped != 0L)
+                        ioCache.remove(overlapped);
+                    releaseBufferIfSubstituted();
+                }
                 end();
             }
 
-            // release resources
-            if (overlapped != 0L)
-                ioCache.remove(overlapped);
-            releaseBufferIfSubstituted();
-
             // invoke completion handler
             Invoker.invoke(result);
         }
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java	Fri Mar 18 11:00:10 2011 -0700
@@ -239,14 +239,14 @@
                     result.setResult(null);
                 }
             } catch (Throwable x) {
+                if (overlapped != 0L)
+                    ioCache.remove(overlapped);
                 exc = x;
             } finally {
                 end();
             }
 
             if (exc != null) {
-                if (overlapped != 0L)
-                    ioCache.remove(overlapped);
                 closeChannel();
                 result.setFailure(toIOException(exc));
             }
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java	Fri Mar 18 11:00:10 2011 -0700
@@ -201,13 +201,12 @@
         if (!(ob instanceof WindowsFileStore))
             return false;
         WindowsFileStore other = (WindowsFileStore)ob;
-        return this.volInfo.volumeSerialNumber() == other.volInfo.volumeSerialNumber();
+        return root.equals(other.root);
     }
 
     @Override
     public int hashCode() {
-        // reveals VSN without permission check - okay?
-        return volInfo.volumeSerialNumber();
+        return root.hashCode();
     }
 
     @Override
--- a/jdk/src/windows/native/sun/windows/awt_Frame.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Frame.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -109,7 +109,6 @@
     m_isMenuDropped = FALSE;
     m_isInputMethodWindow = FALSE;
     m_isUndecorated = FALSE;
-    m_proxyFocusOwner = NULL;
     m_lastProxiedFocusOwner = NULL;
     m_actualFocusedWindow = NULL;
     m_iconic = FALSE;
@@ -127,7 +126,6 @@
 
 void AwtFrame::Dispose()
 {
-    DestroyProxyFocusOwner();
     AwtWindow::Dispose();
 }
 
@@ -308,22 +306,9 @@
     return frame;
 }
 
-LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message,
-                                           WPARAM wParam, LPARAM lParam)
+LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, MsgRouting &mr)
 {
-    TRY;
-
-    DASSERT(::IsWindow(hwnd));
-
-    AwtFrame *parent = (AwtFrame *)
-        AwtComponent::GetComponentImpl(::GetParent(hwnd));
-
-    if (!parent || parent->GetProxyFocusOwner() != hwnd ||
-        message == AwtComponent::WmAwtIsComponent ||
-        message == WM_GETOBJECT)
-    {
-        return ComCtl32Util::GetInstance().DefWindowProc(NULL, hwnd, message, wParam, lParam);
-    }
+    LRESULT retValue = 0L;
 
     AwtComponent *focusOwner = NULL;
     // IME and input language related messages need to be sent to a window
@@ -346,19 +331,23 @@
         // TODO: when a Choice's list is dropped down and we're scrolling in
         // the list WM_MOUSEWHEEL messages come to the poxy, not to the list. Why?
         case WM_MOUSEWHEEL:
-            focusOwner = AwtComponent::GetComponent(parent->GetLastProxiedFocusOwner());
-            if  (focusOwner != NULL) {
-                return focusOwner->WindowProc(message, wParam, lParam);
+            focusOwner = AwtComponent::GetComponent(GetLastProxiedFocusOwner());
+            if  (focusOwner != NULL &&
+                 focusOwner != this) // avoid recursive calls
+            {
+                 retValue = focusOwner->WindowProc(message, wParam, lParam);
+                 mr = mrConsume;
             }
             break;
         case WM_SETFOCUS:
-            if (!sm_suppressFocusAndActivation && parent->IsEmbeddedFrame()) {
-                parent->AwtSetActiveWindow();
+            if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
+                AwtSetActiveWindow();
             }
-            return 0;
+            mr = mrConsume;
+            break;
         case WM_KILLFOCUS:
-            if (!sm_suppressFocusAndActivation && parent->IsEmbeddedFrame()) {
-                AwtWindow::SynthesizeWmActivate(FALSE, parent->GetHWnd(), NULL);
+            if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
+                AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL);
 
             } else if (sm_restoreFocusAndActivation) {
                 if (AwtComponent::GetFocusedWindow() != NULL) {
@@ -369,64 +358,28 @@
                     }
                 }
             }
-            return 0;
+            mr = mrConsume;
+            break;
         case 0x0127: // WM_CHANGEUISTATE
         case 0x0128: // WM_UPDATEUISTATE
-            return 0;
+            mr = mrConsume;
+            break;
     }
-    return parent->WindowProc(message, wParam, lParam);
-
-    CATCH_BAD_ALLOC_RET(0);
-}
 
-void AwtFrame::CreateProxyFocusOwner()
-{
-    if (AwtToolkit::IsMainThread()) {
-        AwtFrame::_CreateProxyFocusOwner((void *)this);
-    } else {
-        AwtToolkit::GetInstance().InvokeFunction(AwtFrame::_CreateProxyFocusOwner, (void *)this);
-    }
+    return retValue;
 }
 
-void AwtFrame::_CreateProxyFocusOwner(void *param)
-{
-    DASSERT(AwtToolkit::IsMainThread());
-
-    AwtFrame *f = (AwtFrame *)param;
-    DASSERT(f->m_proxyFocusOwner == NULL);
-
-    f->m_proxyFocusOwner = ::CreateWindow(TEXT("STATIC"),
-                                          TEXT("ProxyFocusOwner"),
-                                          WS_CHILD,
-                                          0, 0, 0, 0, f->GetHWnd(), NULL,
-                                          AwtToolkit::GetInstance().
-                                          GetModuleHandle(),
-                                          NULL);
-
-    f->m_proxyDefWindowProc = ComCtl32Util::GetInstance().SubclassHWND(f->m_proxyFocusOwner, ProxyWindowProc);
-}
-
-void AwtFrame::DestroyProxyFocusOwner()
+LRESULT AwtFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
 {
-    // proxy focus owner must be destroyed on toolkit thread only
-    if (AwtToolkit::IsMainThread()) {
-        AwtFrame::_DestroyProxyFocusOwner((void *)this);
-    } else {
-        AwtToolkit::GetInstance().InvokeFunction(AwtFrame::_DestroyProxyFocusOwner, (void *)this);
-    }
-}
+    MsgRouting mr = mrDoDefault;
+    LRESULT retValue = 0L;
+
+    retValue = ProxyWindowProc(message, wParam, lParam, mr);
 
-void AwtFrame::_DestroyProxyFocusOwner(void *param)
-{
-    DASSERT(AwtToolkit::IsMainThread());
-
-    AwtFrame *f = (AwtFrame *)param;
-    if (f->m_proxyFocusOwner != NULL) {
-        HWND toDestroy = f->m_proxyFocusOwner;
-        f->m_proxyFocusOwner = NULL;
-        ComCtl32Util::GetInstance().UnsubclassHWND(toDestroy, ProxyWindowProc, f->m_proxyDefWindowProc);
-        ::DestroyWindow(toDestroy);
+    if (mr != mrConsume) {
+        retValue = AwtWindow::WindowProc(message, wParam, lParam);
     }
+    return retValue;
 }
 
 MsgRouting AwtFrame::WmShowWindow(BOOL show, UINT status)
--- a/jdk/src/windows/native/sun/windows/awt_Frame.h	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Frame.h	Fri Mar 18 11:00:10 2011 -0700
@@ -96,6 +96,8 @@
     AwtMenuBar* GetMenuBar();
     void SetMenuBar(AwtMenuBar*);
 
+    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
+
     MsgRouting WmGetMinMaxInfo(LPMINMAXINFO lpmmi);
     MsgRouting WmSize(UINT type, int w, int h);
     MsgRouting WmActivate(UINT nState, BOOL fMinimized, HWND opposite);
@@ -117,10 +119,7 @@
     INLINE BOOL IsUndecorated() { return m_isUndecorated; }
 
     INLINE HWND GetProxyFocusOwner() {
-        if (m_proxyFocusOwner == NULL) {
-            CreateProxyFocusOwner();
-        }
-        return m_proxyFocusOwner;
+        return GetHWnd();
     }
 
     void SetMaximizedBounds(int x, int y, int w, int h);
@@ -159,15 +158,7 @@
     BOOL m_isUndecorated;
 
 private:
-    static LRESULT CALLBACK ProxyWindowProc(HWND hwnd, UINT message,
-                                            WPARAM wParam, LPARAM lParam);
-    void CreateProxyFocusOwner();
-    void DestroyProxyFocusOwner();
-
-    /* creates proxy focus owner, called on Toolkit thread */
-    static void _CreateProxyFocusOwner(void *param);
-    /* destroys proxy focus owner, called on Toolkit thread */
-    static void _DestroyProxyFocusOwner(void *param);
+    LRESULT ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, MsgRouting &mr);
 
     /* The frame's embedding parent (if any) */
     HWND m_parentWnd;
@@ -188,10 +179,6 @@
     /* The frame is an InputMethodWindow */
     BOOL m_isInputMethodWindow;
 
-    /* Receives all keyboard input when an AwtWindow which is not an AwtFrame
-       or an AwtDialog (or one of its children) has the logical input focus. */
-    HWND m_proxyFocusOwner;
-
     /* Retains the last/current sm_focusOwner proxied. Actually, it should be
      * a component of an owned window last/currently active. */
     HWND m_lastProxiedFocusOwner;
--- a/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -200,10 +200,9 @@
             m_nid.cbSize = (BYTE *)(&m_nid.guidItem) - (BYTE *)(&m_nid.cbSize);
             break;
         case 6: // WIN_XP
-            // Uncomment these two lines when moving to VS2008
-//            m_nid.cbSize = (BYTE *)(&m_nid.hBalloonIcon) - (BYTE *)(&m_nid.cbSize);
-//            break;
-        default: // WIN_VISTA?
+            m_nid.cbSize = (BYTE *)(&m_nid.hBalloonIcon) - (BYTE *)(&m_nid.cbSize);
+            break;
+        default: // WIN_VISTA
             m_nid.cbSize = sizeof(m_nid);
             break;
     }
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp	Fri Mar 18 11:00:10 2011 -0700
@@ -221,6 +221,8 @@
 
     m_windowType = NORMAL;
     m_alwaysOnTop = false;
+
+    fullScreenExclusiveModeState = FALSE;
 }
 
 AwtWindow::~AwtWindow()
--- a/jdk/test/ProblemList.txt	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/ProblemList.txt	Fri Mar 18 11:00:10 2011 -0700
@@ -380,30 +380,9 @@
 
 # jdk_nio
 
-# 6944810
-java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java       windows-all
-
 # 6963118
 java/nio/channels/Selector/Wakeup.java                          windows-all
 
-# The asynchronous I/O implementation on Windows requires Windows XP or newer.
-# We can remove the following once all Windows 2000 machines have been
-# decommissioned.
-java/nio/channels/AsynchronousChannelGroup/Basic.java           windows-5.0
-java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java      windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Identity.java        windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Restart.java         windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Unbounded.java       windows-5.0
-java/nio/channels/AsynchronousDatagramChannel/Basic.java        windows-5.0
-java/nio/channels/AsynchronousFileChannel/Lock.java             windows-5.0
-java/nio/channels/AsynchronousServerSocketChannel/Basic.java    windows-5.0
-java/nio/channels/AsynchronousServerSocketChannel/WithSecurityManager.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/Basic.java          windows-5.0
-java/nio/channels/AsynchronousSocketChannel/DieBeforeComplete.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/Leaky.java          windows-5.0
-java/nio/channels/AsynchronousSocketChannel/StressLoopback.java windows-5.0
-java/nio/channels/Channels/Basic2.java                          windows-5.0
-
 # 6959891
 com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
 
@@ -625,9 +604,6 @@
 # Timeout on solaris-sparcv9 or exception thrown
 com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java	 	solaris-all
 
-# File 6535697.test input stream left open? windows samevm
-java/security/cert/CertificateFactory/openssl/OpenSSLCert.java	generic-all
-
 # Leaving file open: SerialVersion.current, windows samevm
 java/security/BasicPermission/SerialVersion.java		generic-all
 
@@ -717,6 +693,7 @@
 # Filed 6933803
 java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java	generic-all
 
+# Filed 7022325
 # Fails with assertion error on windows
 #   11 separate stacktraces created... file reuse problem?
 java/util/zip/ZipFile/ReadLongZipFileName.java			generic-all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6748156
+ * @summary add an new JNDI property to control the boolean flag WaitForReply
+ */
+
+import java.net.Socket;
+import java.net.ServerSocket;
+import java.io.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+
+public class NoWaitForReplyTest {
+
+    public static void main(String[] args) throws Exception {
+
+        boolean passed = false;
+
+        // start the LDAP server
+        DummyServer ldapServer = new DummyServer();
+        ldapServer.start();
+
+        // Set up the environment for creating the initial context
+        Hashtable env = new Hashtable(11);
+        env.put(Context.PROVIDER_URL, "ldap://localhost:" +
+            ldapServer.getPortNumber());
+        env.put(Context.INITIAL_CONTEXT_FACTORY,
+            "com.sun.jndi.ldap.LdapCtxFactory");
+
+        // Wait up to 10 seconds for a response from the LDAP server
+        env.put("com.sun.jndi.ldap.read.timeout", "10000");
+
+        // Don't wait until the first search reply is received
+        env.put("com.sun.jndi.ldap.search.waitForReply", "false");
+
+        // Send the LDAP search request without first authenticating (no bind)
+        env.put("java.naming.ldap.version", "3");
+
+
+        try {
+
+            // Create initial context
+            System.out.println("Client: connecting to the server");
+            DirContext ctx = new InitialDirContext(env);
+
+            SearchControls scl = new SearchControls();
+            scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+            System.out.println("Client: performing search");
+            NamingEnumeration answer =
+            ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+
+            // Server will never reply: either we waited in the call above until
+            // the timeout (fail) or we did not wait and reached here (pass).
+            passed = true;
+            System.out.println("Client: did not wait until first reply");
+
+            // Close the context when we're done
+            ctx.close();
+
+        } catch (NamingException e) {
+            // timeout (ignore)
+        }
+        ldapServer.interrupt();
+
+        if (!passed) {
+            throw new Exception(
+                "Test FAILED: should not have waited until first search reply");
+        }
+        System.out.println("Test PASSED");
+    }
+
+    static class DummyServer extends Thread {
+
+        private final ServerSocket serverSocket;
+
+        DummyServer() throws IOException {
+            this.serverSocket = new ServerSocket(0);
+            System.out.println("Server: listening on port " + serverSocket.getLocalPort());
+        }
+
+        public int getPortNumber() {
+            return serverSocket.getLocalPort();
+        }
+
+        public void run() {
+            try (Socket socket = serverSocket.accept()) {
+                System.out.println("Server: accepted a connection");
+                InputStream in = socket.getInputStream();
+
+                while (!isInterrupted()) {
+                   in.skip(in.available());
+                }
+
+            } catch (Exception e) {
+                // ignore
+
+            } finally {
+                System.out.println("Server: shutting down");
+                try {
+                    serverSocket.close();
+                } catch (IOException e) {
+                    // ignore
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/FontClass/SurrogateTest/SupplementaryCanDisplayUpToTest.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6623219
+ * @summary Test canDisplayUpTo with supplementary characters.
+ */
+
+import java.awt.*;
+import java.text.*;
+
+public class SupplementaryCanDisplayUpToTest {
+    // Lists consisting of a font name, test text, and its expected
+    // return value. Test text uses private area code point U+F0000
+    // (\udb80\udc00).
+    private static String[][] DATA = {
+        // Windows
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80\udc00", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80Z", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udc00", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47", "-1" },
+
+        // Linux
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80\udc00", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80Z", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udc00", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b", "-1" },
+
+        // Solaris
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80\udc00", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80Z", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udc00", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b", "-1" },
+    };
+    private static int errorcount = 0;
+
+    public static void main(String[] args) {
+        for (String[] data : DATA) {
+            String fontname = data[0];
+            Font font = new Font(fontname, Font.PLAIN, 16);
+            if (font.getFamily().equals(Font.DIALOG)) {
+                // Skip any unavailable fonts.
+                continue;
+            }
+
+            System.out.printf("Testing with font '%s'... ", fontname);
+            int errors = 0;
+            String text = data[1];
+            int expected = Integer.parseInt(data[2]);
+
+            int result = font.canDisplayUpTo(text);
+            if (result != expected) {
+                System.err.println("canDisplayUpTo(String) returns " + result);
+                errors++;
+            }
+
+            result = font.canDisplayUpTo(text.toCharArray(), 0, text.length());
+            if (result != expected) {
+                System.err.println("canDisplayUpTo(char[], int, int) returns " + result);
+                errors++;
+            }
+
+            CharacterIterator iter = new StringCharacterIterator(text);
+            result = font.canDisplayUpTo(iter, iter.getBeginIndex(), iter.getEndIndex());
+            if (result != expected) {
+                System.err.println("canDisplayUpTo(CharacterIterator, int, int) returns " + result);
+                errors++;
+            }
+
+            if (errors == 0) {
+                System.out.println("passed");
+            } else {
+                System.out.println("failed");
+                errorcount += errors;
+            }
+        }
+        if (errorcount > 0) {
+            throw new RuntimeException("SupplementaryCanDisplayUpToTest: failed");
+        }
+    }
+}
--- a/jdk/test/java/io/File/SetLastModified.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/io/File/SetLastModified.java	Fri Mar 18 11:00:10 2011 -0700
@@ -105,9 +105,9 @@
             System.getProperty("os.name").startsWith("Windows") ? 0L : 3L*G;
         long pos = 0L;
         while (pos <= MAX_POSITION) {
-            FileChannel fc = new FileOutputStream(f).getChannel();
-            fc.position(pos).write(ByteBuffer.wrap("x".getBytes()));
-            fc.close();
+            try (FileChannel fc = new FileOutputStream(f).getChannel()) {
+                fc.position(pos).write(ByteBuffer.wrap("x".getBytes()));
+            }
             ot = f.lastModified();
             System.out.format("check with file size: %d\n", f.length());
             if (!f.setLastModified(nt))
--- a/jdk/test/java/io/FileOutputStream/AtomicAppend.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/io/FileOutputStream/AtomicAppend.java	Fri Mar 18 11:00:10 2011 -0700
@@ -47,12 +47,12 @@
             for (int i = 0; i < nThreads; i++)
                 es.execute(new Runnable() { public void run() {
                     try {
-                        FileOutputStream s = new FileOutputStream(file, true);
-                        for (int j = 0; j < 1000; j++) {
-                            s.write((int) 'x');
-                            s.flush();
+                        try (FileOutputStream s = new FileOutputStream(file, true)) {
+                            for (int j = 0; j < 1000; j++) {
+                                s.write((int) 'x');
+                                s.flush();
+                            }
                         }
-                        s.close();
                     } catch (Throwable t) { unexpected(t); }}});
             es.shutdown();
             es.awaitTermination(10L, TimeUnit.MINUTES);
--- a/jdk/test/java/io/OutputStreamWriter/Encode.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/io/OutputStreamWriter/Encode.java	Fri Mar 18 11:00:10 2011 -0700
@@ -35,8 +35,9 @@
         new Encode();
     }
 
+    final ServerSocket ss = new ServerSocket(0);
+
     Encode() throws Exception {
-        ss = new ServerSocket(0);
         (new Thread(this)).start();
         String toEncode = "\uD800\uDC00 \uD801\uDC01 ";
         String enc1 = URLEncoder.encode(toEncode, "UTF-8");
@@ -47,27 +48,31 @@
             "/missing.nothtml";
         HttpURLConnection uc =  (HttpURLConnection)new URL(url).openConnection();
         uc.connect();
-        String enc2 = URLEncoder.encode(toEncode, "UTF-8");
-        if (!enc1.equals(enc2))
-            throw new RuntimeException("test failed");
-        uc.disconnect();
+        try {
+            String enc2 = URLEncoder.encode(toEncode, "UTF-8");
+            if (!enc1.equals(enc2)) {
+                System.out.println("test failed");
+                throw new RuntimeException("test failed");
+            }
+        } finally {
+            uc.disconnect();
+        }
     }
 
-    ServerSocket ss;
-
     public void run() {
-        try {
-            Socket s = ss.accept();
-            BufferedReader in = new BufferedReader(
-                new InputStreamReader(s.getInputStream()));
+        try (ServerSocket serv = ss;
+             Socket s = serv.accept();
+             BufferedReader in =
+                 new BufferedReader(new InputStreamReader(s.getInputStream())))
+        {
             String req = in.readLine();
-            PrintStream out = new PrintStream(new BufferedOutputStream(
-                s.getOutputStream()));
-            out.print("HTTP/1.1 403 Forbidden\r\n");
-            out.print("\r\n");
-            out.flush();
-            s.close();
-            ss.close();
+            try (OutputStream os = s.getOutputStream();
+                 BufferedOutputStream bos = new BufferedOutputStream(os);
+                 PrintStream out = new PrintStream(bos))
+            {
+                out.print("HTTP/1.1 403 Forbidden\r\n");
+                out.print("\r\n");
+            }
         } catch (Exception e) {
             e.printStackTrace();
         }
--- a/jdk/test/java/io/PrintStream/EncodingConstructor.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/io/PrintStream/EncodingConstructor.java	Fri Mar 18 11:00:10 2011 -0700
@@ -34,11 +34,11 @@
 
     public static void main(String args[]) throws Exception {
         ByteArrayOutputStream bo = new ByteArrayOutputStream();
-        PrintStream ps = new PrintStream(bo, false, "UTF-8");
         String s = "xyzzy";
         int n = s.length();
-        ps.print(s);
-        ps.close();
+        try (PrintStream ps = new PrintStream(bo, false, "UTF-8")) {
+            ps.print(s);
+        }
         byte[] ba = bo.toByteArray();
         if (ba.length != n)
             throw new Exception("Length mismatch: " + n + " " + ba.length);
--- a/jdk/test/java/io/PrintStream/FailingConstructors.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/io/PrintStream/FailingConstructors.java	Fri Mar 18 11:00:10 2011 -0700
@@ -35,6 +35,8 @@
 import java.io.IOException;
 import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
+import java.nio.file.Files;
+import java.nio.file.Path;
 
 public class FailingConstructors {
     static final String fileName = "FailingConstructorsTest";
@@ -45,14 +47,13 @@
         test(false, new File(fileName));
 
         /* create the file and write its contents */
-        File file = File.createTempFile(fileName, null);
-        file.deleteOnExit();
-        FileOutputStream fos = new FileOutputStream(file);
-        fos.write(FILE_CONTENTS.getBytes());
-        fos.close();
-
-        test(true, file);
-        file.delete();
+        Path path = Files.createTempFile(fileName, null);
+        try {
+            Files.write(path, FILE_CONTENTS.getBytes());
+            test(true, path.toFile());
+        } finally {
+            Files.delete(path);
+        }
     }
 
     private static void test(boolean exists, File file) throws Throwable {
--- a/jdk/test/java/io/Serializable/evolution/RenamePackage/install/SerialDriver.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/install/SerialDriver.java	Fri Mar 18 11:00:10 2011 -0700
@@ -27,7 +27,7 @@
  * @build install/SerialDriver.java test/SerialDriver.java extension/ExtendedObjectInputStream.java
  * @summary Enable resolveClass() to accommodate package renaming.
  * This fix enables one to implement a resolveClass method that maps a
- * Serialiazable class within a serialization stream to the same class
+ * Serializable class within a serialization stream to the same class
  * in a different package within the JVM runtime. See run shell script
  * for instructions on how to run this test.
  */
@@ -86,16 +86,15 @@
         File f = new File("stream.ser");
         if (serialize) {
             // Serialize the subclass
-            try {
-                FileOutputStream fo = new FileOutputStream(f);
-                ObjectOutputStream so = new ObjectOutputStream(fo);
+            try (FileOutputStream fo = new FileOutputStream(f);
+                 ObjectOutputStream so = new ObjectOutputStream(fo))
+            {
                 so.writeObject(obj);
                 /* Skip arrays since they do not work with rename yet.
                    The serialVersionUID changes due to the name change
                    and there is no way to set the serialVersionUID for an
                    array. */
                 so.writeObject(array);
-                so.flush();
             } catch (Exception e) {
                 System.out.println(e);
                 throw e;
@@ -103,16 +102,14 @@
         }
         if (deserialize) {
             // Deserialize the subclass
-            try {
-                FileInputStream fi = new FileInputStream(f);
-                ExtendedObjectInputStream si =
-                    new ExtendedObjectInputStream(fi);
+            try (FileInputStream fi = new FileInputStream(f);
+                 ExtendedObjectInputStream si = new ExtendedObjectInputStream(fi))
+            {
                 si.addRenamedClassName("test.SerialDriver", "install.SerialDriver");
                 si.addRenamedClassName("[Ltest.SerialDriver;",
                                        "[Linstall.SerialDriver");
                 obj = (SerialDriver) si.readObject();
                 array = (SerialDriver[]) si.readObject();
-                si.close();
             } catch (Exception e) {
                 System.out.println(e);
                 throw e;
--- a/jdk/test/java/io/Serializable/evolution/RenamePackage/test/SerialDriver.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/test/SerialDriver.java	Fri Mar 18 11:00:10 2011 -0700
@@ -27,7 +27,7 @@
  * @build install/SerialDriver.java test/SerialDriver.java extension/ExtendedObjectInputStream.java
  * @summary Enable resolveClass() to accommodate package renaming.
  * This fix enables one to implement a resolveClass method that maps a
- * Serialiazable class within a serialization stream to the same class
+ * Serializable class within a serialization stream to the same class
  * in a different package within the JVM runtime. See run shell script
  * for instructions on how to run this test.
  */
@@ -83,14 +83,13 @@
         File f = new File("stream.ser");
         if (serialize) {
             // Serialize the subclass
-            try {
-                FileOutputStream fo = new FileOutputStream(f);
-                ObjectOutputStream so = new ObjectOutputStream(fo);
+            try (FileOutputStream fo = new FileOutputStream(f);
+                 ObjectOutputStream so = new ObjectOutputStream(fo))
+            {
                 so.writeObject(obj);
                 /* Comment out since renaming arrays does not work
                    since it changes the serialVersionUID. */
                 so.writeObject(array);
-                so.flush();
             } catch (Exception e) {
                 System.out.println(e);
                 throw e;
@@ -98,16 +97,15 @@
         }
         if (deserialize) {
             // Deserialize the subclass
-            try {
-                FileInputStream fi = new FileInputStream(f);
-                ExtendedObjectInputStream si = new ExtendedObjectInputStream(fi);
+            try (FileInputStream fi = new FileInputStream(f);
+                 ExtendedObjectInputStream si = new ExtendedObjectInputStream(fi))
+            {
                 si.addRenamedClassName("install.SerialDriver",
                                        "test.SerialDriver");
                 si.addRenamedClassName("[Linstall.SerialDriver;",
                                        "[Ltest.SerialDriver");
                 obj = (SerialDriver) si.readObject();
                 array = (SerialDriver[]) si.readObject();
-                si.close();
             } catch (Exception e) {
                 System.out.println(e);
                 throw e;
--- a/jdk/test/java/lang/Character/CheckScript.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/lang/Character/CheckScript.java	Fri Mar 18 11:00:10 2011 -0700
@@ -12,40 +12,43 @@
 
 public class CheckScript {
 
-    public static void main(String[] args) throws Exception {
-
-        BufferedReader sbfr = null;
+    static BufferedReader open(String[] args) throws FileNotFoundException {
         if (args.length == 0) {
-            sbfr = new BufferedReader(new FileReader(new File(System.getProperty("test.src", "."), "Scripts.txt")));
+            return new BufferedReader(new FileReader(new File(System.getProperty("test.src", "."), "Scripts.txt")));
         } else if (args.length == 1) {
-            sbfr = new BufferedReader(new FileReader(args[0]));
+            return new BufferedReader(new FileReader(args[0]));
         } else {
             System.out.println("java CharacterScript Scripts.txt");
             throw new RuntimeException("Datafile name should be specified.");
         }
+    }
+
+    public static void main(String[] args) throws Exception {
+
         Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s+;\\s+(\\w+)\\s+#.*").matcher("");
         String line = null;
         HashMap<String,ArrayList<Integer>> scripts = new HashMap<>();
-        while ((line = sbfr.readLine()) != null) {
-            if (line.length() <= 1 || line.charAt(0) == '#') {
-                continue;
-            }
-            m.reset(line);
-            if (m.matches()) {
-                int start = Integer.parseInt(m.group(1), 16);
-                int end = (m.group(2)==null)?start
-                                            :Integer.parseInt(m.group(2), 16);
-                String name = m.group(3).toLowerCase(Locale.ENGLISH);
-                ArrayList<Integer> ranges = scripts.get(name);
-                if (ranges == null) {
-                    ranges = new ArrayList<Integer>();
-                    scripts.put(name, ranges);
+        try (BufferedReader sbfr = open(args)) {
+            while ((line = sbfr.readLine()) != null) {
+                if (line.length() <= 1 || line.charAt(0) == '#') {
+                    continue;
                 }
-                ranges.add(start);
-                ranges.add(end);
+                m.reset(line);
+                if (m.matches()) {
+                    int start = Integer.parseInt(m.group(1), 16);
+                    int end = (m.group(2)==null)?start
+                                                :Integer.parseInt(m.group(2), 16);
+                    String name = m.group(3).toLowerCase(Locale.ENGLISH);
+                    ArrayList<Integer> ranges = scripts.get(name);
+                    if (ranges == null) {
+                        ranges = new ArrayList<Integer>();
+                        scripts.put(name, ranges);
+                    }
+                    ranges.add(start);
+                    ranges.add(end);
+                }
             }
         }
-        sbfr.close();
         // check all defined ranges
         Integer[] ZEROSIZEARRAY = new Integer[0];
         for (String name : scripts.keySet()) {
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java	Fri Mar 18 11:00:10 2011 -0700
@@ -26,7 +26,7 @@
  * @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689
  *      5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313
  *      6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
- *      4947220
+ *      4947220 7018606
  * @summary Basic tests for Process and Environment Variable code
  * @run main/othervm/timeout=300 Basic
  * @author Martin Buchholz
@@ -47,6 +47,9 @@
 
 public class Basic {
 
+    /* used for Windows only */
+    static final String systemRoot = System.getenv("SystemRoot");
+
     private static String commandOutput(Reader r) throws Throwable {
         StringBuilder sb = new StringBuilder();
         int c;
@@ -1073,7 +1076,11 @@
         try {
             ProcessBuilder pb = new ProcessBuilder();
             pb.environment().clear();
-            equal(getenvInChild(pb), "");
+            String expected = Windows.is() ? "SystemRoot="+systemRoot+",": "";
+            if (Windows.is()) {
+                pb.environment().put("SystemRoot", systemRoot);
+            }
+            equal(getenvInChild(pb), expected);
         } catch (Throwable t) { unexpected(t); }
 
         //----------------------------------------------------------------
@@ -1561,13 +1568,21 @@
             List<String> childArgs = new ArrayList<String>(javaChildArgs);
             childArgs.add("System.getenv()");
             String[] cmdp = childArgs.toArray(new String[childArgs.size()]);
-            String[] envp = {"=ExitValue=3", "=C:=\\"};
+            String[] envp;
+            String[] envpWin = {"=ExitValue=3", "=C:=\\", "SystemRoot="+systemRoot};
+            String[] envpOth = {"=ExitValue=3", "=C:=\\"};
+            if (Windows.is()) {
+                envp = envpWin;
+            } else {
+                envp = envpOth;
+            }
             Process p = Runtime.getRuntime().exec(cmdp, envp);
-            String expected = Windows.is() ? "=C:=\\,=ExitValue=3," : "=C:=\\,";
+            String expected = Windows.is() ? "=C:=\\,SystemRoot="+systemRoot+",=ExitValue=3," : "=C:=\\,";
             equal(commandOutput(p), expected);
             if (Windows.is()) {
                 ProcessBuilder pb = new ProcessBuilder(childArgs);
                 pb.environment().clear();
+                pb.environment().put("SystemRoot", systemRoot);
                 pb.environment().put("=ExitValue", "3");
                 pb.environment().put("=C:", "\\");
                 equal(commandOutput(pb), expected);
@@ -1591,10 +1606,18 @@
             List<String> childArgs = new ArrayList<String>(javaChildArgs);
             childArgs.add("System.getenv()");
             String[] cmdp = childArgs.toArray(new String[childArgs.size()]);
-            String[] envp = {"LC_ALL=C\u0000\u0000", // Yuck!
+            String[] envpWin = {"SystemRoot="+systemRoot, "LC_ALL=C\u0000\u0000", // Yuck!
+                             "FO\u0000=B\u0000R"};
+            String[] envpOth = {"LC_ALL=C\u0000\u0000", // Yuck!
                              "FO\u0000=B\u0000R"};
+            String[] envp;
+            if (Windows.is()) {
+                envp = envpWin;
+            } else {
+                envp = envpOth;
+            }
             Process p = Runtime.getRuntime().exec(cmdp, envp);
-            check(commandOutput(p).equals("LC_ALL=C,"),
+            check(commandOutput(p).equals(Windows.is() ? "SystemRoot="+systemRoot+",LC_ALL=C," : "LC_ALL=C,"),
                   "Incorrect handling of envstrings containing NULs");
         } catch (Throwable t) { unexpected(t); }
 
@@ -2144,6 +2167,7 @@
     static 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 {
         try {realMain(args);} catch (Throwable t) {unexpected(t);}
         System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
--- a/jdk/test/java/lang/Runtime/shutdown/ShutdownHooks.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/lang/Runtime/shutdown/ShutdownHooks.java	Fri Mar 18 11:00:10 2011 -0700
@@ -43,9 +43,9 @@
         file = new File(dir, args[1]);
         // write to file
         System.out.println("writing to "+ file);
-        PrintWriter pw = new PrintWriter(file);
-        pw.println("Shutdown begins");
-        pw.close();
+        try (PrintWriter pw = new PrintWriter(file)) {
+            pw.println("Shutdown begins");
+        }
     }
 
     public static class Cleaner extends Thread {
@@ -56,10 +56,8 @@
             // register the DeleteOnExitHook while the application
             // shutdown hook is running
             file.deleteOnExit();
-            try {
-                PrintWriter pw = new PrintWriter(file);
+            try (PrintWriter pw = new PrintWriter(file)) {
                 pw.println("file is being deleted");
-                pw.close();
             } catch (FileNotFoundException e) {
                 throw new RuntimeException(e);
             }
--- a/jdk/test/java/lang/Thread/StartOOMTest.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/lang/Thread/StartOOMTest.java	Fri Mar 18 11:00:10 2011 -0700
@@ -22,11 +22,14 @@
  */
 
 /*
- * @test
- * @bug 6379235
- * @ignore until 6721694 is fixed
- * @run main/othervm -server -Xmx32m -Xms32m -Xss256m StartOOMTest
- * @summary ThreadGroup accounting mistake possible with failure of Thread.start()
+ * This test is relatively useful for verifying 6379235, but
+ * is too resource intensive, especially on 64 bit systems,
+ * to be run automatically, see 6721694.
+ *
+ * When run it should be typically be run with the server vm
+ * and a relatively small java heap, and a large stack size
+ * ( to provoke the OOM quicker ).
+ *    java -server -Xmx32m -Xms32m -Xss256m StartOOMTest
  */
 
 import java.util.*;
--- a/jdk/test/java/lang/instrument/BootClassPath/Setup.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/lang/instrument/BootClassPath/Setup.java	Fri Mar 18 11:00:10 2011 -0700
@@ -62,31 +62,33 @@
          * Create manifest file with Boot-Class-Path encoding the
          * sub-directory name.
          */
-        FileOutputStream out = new FileOutputStream(manifestFile);
-        out.write("Manifest-Version: 1.0\n".getBytes("UTF-8"));
+        try (FileOutputStream out = new FileOutputStream(manifestFile)) {
+            out.write("Manifest-Version: 1.0\n".getBytes("UTF-8"));
 
-        byte[] premainBytes = ("Premain-Class: " + premainClass + "\n").getBytes("UTF-8");
-        out.write(premainBytes);
+            byte[] premainBytes =
+                ("Premain-Class: " + premainClass + "\n").getBytes("UTF-8");
+            out.write(premainBytes);
 
-        out.write( "Boot-Class-Path: ".getBytes("UTF-8") );
+            out.write( "Boot-Class-Path: ".getBytes("UTF-8") );
 
-        byte[] value = bootClassPath.getBytes("UTF-8");
-        for (int i=0; i<value.length; i++) {
-            int v = (int)value[i];
-            if (v < 0) v += 256;
-            byte[] escaped =  ("%" + Integer.toHexString(v)).getBytes("UTF-8");
-            out.write(escaped);
+            byte[] value = bootClassPath.getBytes("UTF-8");
+            for (int i=0; i<value.length; i++) {
+                int v = (int)value[i];
+                if (v < 0) v += 256;
+                byte[] escaped =
+                    ("%" + Integer.toHexString(v)).getBytes("UTF-8");
+                out.write(escaped);
+            }
+            out.write( "\n\n".getBytes("UTF-8") );
         }
-        out.write( "\n\n".getBytes("UTF-8") );
-        out.close();
 
         /*
          * Write the name of the boot dir to "boot.dir"
          */
         f = new File(workDir + fileSeparator + "boot.dir");
-        out = new FileOutputStream(f);
-        out.write(bootDir.getBytes(defaultEncoding));
-        out.close();
+        try (FileOutputStream out = new FileOutputStream(f)) {
+            out.write(bootDir.getBytes(defaultEncoding));
+        }
     }
 
     /* ported from test/sun/tools/launcher/UnicodeTest.java */
--- a/jdk/test/java/lang/instrument/ilib/Inject.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/lang/instrument/ilib/Inject.java	Fri Mar 18 11:00:10 2011 -0700
@@ -118,23 +118,24 @@
         }
 
         void dump(File outDir, String filename) throws IOException {
-            FileOutputStream fileOut = new FileOutputStream(new File(outDir, filename));
-            DataOutputStream dataOut = new DataOutputStream(fileOut);
-
-            String currentClassName = null;
+            try (FileOutputStream fileOut =
+                     new FileOutputStream(new File(outDir, filename));
+                 DataOutputStream dataOut = new DataOutputStream(fileOut))
+            {
+                String currentClassName = null;
 
-            dataOut.writeInt(infoList.size());
-            for (Iterator<Info> it = infoList.iterator(); it.hasNext(); ) {
-                Info info = it.next();
-                if (!info.className.equals(currentClassName)) {
-                    dataOut.writeInt(123456); // class name marker
-                    currentClassName = info.className;
-                    dataOut.writeUTF(currentClassName);
+                dataOut.writeInt(infoList.size());
+                for (Iterator<Info> it = infoList.iterator(); it.hasNext(); ) {
+                    Info info = it.next();
+                    if (!info.className.equals(currentClassName)) {
+                        dataOut.writeInt(123456); // class name marker
+                        currentClassName = info.className;
+                        dataOut.writeUTF(currentClassName);
+                    }
+                    dataOut.writeInt(info.location);
+                    dataOut.writeUTF(info.methodName);
                 }
-                dataOut.writeInt(info.location);
-                dataOut.writeUTF(info.methodName);
             }
-            dataOut.close();
         }
 
         public byte[] bytecodes(String className, String methodName, int location) {
--- a/jdk/test/java/math/BigInteger/BigIntegerTest.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java	Fri Mar 18 11:00:10 2011 -0700
@@ -645,26 +645,17 @@
             BigInteger b2 = null;
 
             File f = new File("serialtest");
-            FileOutputStream fos = new FileOutputStream(f);
-            try {
-                ObjectOutputStream oos = new ObjectOutputStream(fos);
-                try {
+
+            try (FileOutputStream fos = new FileOutputStream(f)) {
+                try (ObjectOutputStream oos = new ObjectOutputStream(fos)) {
                     oos.writeObject(b1);
                     oos.flush();
-                } finally {
-                    oos.close();
                 }
 
-                FileInputStream fis = new FileInputStream(f);
-                try {
-                    ObjectInputStream ois = new ObjectInputStream(fis);
-                    try {
-                        b2 = (BigInteger)ois.readObject();
-                    } finally {
-                        ois.close();
-                    }
-                } finally {
-                    fis.close();
+                try (FileInputStream fis = new FileInputStream(f);
+                     ObjectInputStream ois = new ObjectInputStream(fis))
+                {
+                    b2 = (BigInteger)ois.readObject();
                 }
 
                 if (!b1.equals(b2) ||
@@ -673,8 +664,6 @@
                     System.err.println("Serialized failed for hex " +
                                        b1.toString(16));
                 }
-            } finally {
-                fos.close();
             }
             f.delete();
         }
@@ -683,29 +672,17 @@
             BigInteger b1 = fetchNumber(rnd.nextInt(100));
             BigInteger b2 = null;
             File f = new File("serialtest");
-            FileOutputStream fos = new FileOutputStream(f);
-            try {
-                ObjectOutputStream oos = new ObjectOutputStream(fos);
-                try {
+            try (FileOutputStream fos = new FileOutputStream(f)) {
+                try (ObjectOutputStream oos = new ObjectOutputStream(fos)) {
                     oos.writeObject(b1);
                     oos.flush();
-                } finally {
-                    oos.close();
                 }
 
-                FileInputStream fis = new FileInputStream(f);
-                try {
-                    ObjectInputStream ois = new ObjectInputStream(fis);
-                    try {
-                        b2 = (BigInteger)ois.readObject();
-                    } finally {
-                        ois.close();
-                    }
-                } finally {
-                    fis.close();
+                try (FileInputStream fis = new FileInputStream(f);
+                     ObjectInputStream ois = new ObjectInputStream(fis))
+                {
+                    b2 = (BigInteger)ois.readObject();
                 }
-            } finally {
-                fos.close();
             }
 
             if (!b1.equals(b2) ||
--- a/jdk/test/java/net/URLConnection/RedirectLimit.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/net/URLConnection/RedirectLimit.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,105 +36,81 @@
 import java.net.*;
 
 class RedirLimitServer extends Thread {
+    static final int TIMEOUT = 10 * 1000;
+    static final int NUM_REDIRECTS = 9;
 
-    ServerSocket s;
-    Socket   s1;
-    InputStream  is;
-    OutputStream os;
-    int port;
-    int nredirects = 9;
-
-    String reply1 = "HTTP/1.1 307 Temporary Redirect\r\n" +
+    static final String reply1 = "HTTP/1.1 307 Temporary Redirect\r\n" +
         "Date: Mon, 15 Jan 2001 12:18:21 GMT\r\n" +
         "Server: Apache/1.3.14 (Unix)\r\n" +
         "Location: http://localhost:";
-    String reply2 = ".html\r\n" +
+    static final String reply2 = ".html\r\n" +
         "Connection: close\r\n" +
         "Content-Type: text/html; charset=iso-8859-1\r\n\r\n" +
         "<html>Hello</html>";
-
-    RedirLimitServer (ServerSocket y) {
-        s = y;
-        port = s.getLocalPort();
-    }
-
-    String reply3 = "HTTP/1.1 200 Ok\r\n" +
+    static final String reply3 = "HTTP/1.1 200 Ok\r\n" +
         "Date: Mon, 15 Jan 2001 12:18:21 GMT\r\n" +
         "Server: Apache/1.3.14 (Unix)\r\n" +
         "Connection: close\r\n" +
         "Content-Type: text/html; charset=iso-8859-1\r\n\r\n" +
         "World";
 
-    public void run () {
+    final ServerSocket ss;
+    final int port;
+
+    RedirLimitServer(ServerSocket ss) {
+        this.ss = ss;
+        port = ss.getLocalPort();
+    }
+
+    public void run() {
         try {
-            s.setSoTimeout (2000);
-            for (int i=0; i<nredirects; i++) {
-                s1 = s.accept ();
-                s1.setSoTimeout (2000);
-                is = s1.getInputStream ();
-                os = s1.getOutputStream ();
-                is.read ();
-                String reply = reply1 + port + "/redirect" + i + reply2;
-                os.write (reply.getBytes());
-                os.close();
+            ss.setSoTimeout(TIMEOUT);
+            for (int i=0; i<NUM_REDIRECTS; i++) {
+                try (Socket s = ss.accept()) {
+                    s.setSoTimeout(TIMEOUT);
+                    InputStream is = s.getInputStream();
+                    OutputStream os = s.getOutputStream();
+                    is.read();
+                    String reply = reply1 + port + "/redirect" + i + reply2;
+                    os.write(reply.getBytes());
+                }
             }
-            s1 = s.accept ();
-            is = s1.getInputStream ();
-            os = s1.getOutputStream ();
-            is.read ();
-            os.write (reply3.getBytes());
-            os.close();
-        }
-        catch (Exception e) {
-            /* Just need thread to terminate */
+            try (Socket s = ss.accept()) {
+                InputStream is = s.getInputStream();
+                OutputStream os = s.getOutputStream();
+                is.read();
+                os.write(reply3.getBytes());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
         } finally {
-            try { s.close(); } catch (IOException unused) {}
+            try { ss.close(); } catch (IOException unused) {}
         }
     }
 };
 
-
 public class RedirectLimit {
-
-    public static final int DELAY = 10;
-
     public static void main(String[] args) throws Exception {
-        int nLoops = 1;
-        int nSize = 10;
-        int port, n =0;
-        byte b[] = new byte[nSize];
-        RedirLimitServer server;
-        ServerSocket sock;
+        ServerSocket ss = new ServerSocket (0);
+        int port = ss.getLocalPort();
+        RedirLimitServer server = new RedirLimitServer(ss);
+        server.start();
 
+        InputStream in = null;
         try {
-            sock = new ServerSocket (0);
-            port = sock.getLocalPort ();
-        }
-        catch (Exception e) {
-            System.out.println ("Exception: " + e);
-            return;
-        }
-
-        server = new RedirLimitServer(sock);
-        server.start ();
-
-        try  {
-
-            String s = "http://localhost:" + port;
-            URL url = new URL(s);
+            URL url = new URL("http://localhost:" + port);
             URLConnection conURL =  url.openConnection();
 
             conURL.setDoInput(true);
             conURL.setAllowUserInteraction(false);
             conURL.setUseCaches(false);
 
-            InputStream in = conURL.getInputStream();
+            in = conURL.getInputStream();
             if ((in.read() != (int)'W') || (in.read()!=(int)'o')) {
-                throw new RuntimeException ("Unexpected string read");
+                throw new RuntimeException("Unexpected string read");
             }
-        }
-        catch(IOException e) {
-            throw new RuntimeException ("Exception caught " + e);
+        } finally {
+            if ( in != null ) { in.close(); }
         }
     }
 }
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java	Fri Mar 18 11:00:10 2011 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4607272 6842687 6878369
+ * @bug 4607272 6842687 6878369 6944810 7023403
  * @summary Unit test for AsynchronousSocketChannel
  * @run main/timeout=600 Basic
  */
--- a/jdk/test/java/nio/file/DirectoryStream/Basic.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/nio/file/DirectoryStream/Basic.java	Fri Mar 18 11:00:10 2011 -0700
@@ -69,7 +69,7 @@
             throw new RuntimeException("entry not found");
 
         // check filtering: f* should match foo
-        DirectoryStream.Filter<Path> filter = new DirectoryStream.Filter<>() {
+        DirectoryStream.Filter<Path> filter = new DirectoryStream.Filter<Path>() {
             private PathMatcher matcher =
                 dir.getFileSystem().getPathMatcher("glob:f*");
             public boolean accept(Path file) {
--- a/jdk/test/java/nio/file/FileStore/Basic.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/nio/file/FileStore/Basic.java	Fri Mar 18 11:00:10 2011 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6873621 6979526 7006126
+ * @bug 4313887 6873621 6979526 7006126 7020517
  * @summary Unit test for java.nio.file.FileStore
  * @library ..
  */
--- a/jdk/test/java/nio/file/Files/TemporaryFiles.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/nio/file/Files/TemporaryFiles.java	Fri Mar 18 11:00:10 2011 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6838333 7006126
+ * @bug 4313887 6838333 7006126 7023034
  * @summary Unit test for Files.createTempXXX
  * @library ..
  */
@@ -167,5 +167,31 @@
         testInvalidFileTemp("../blah", null);
         testInvalidFileTemp("dir/blah", null);
         testInvalidFileTemp("blah", ".dat/foo");
+
+        // nulls
+        try {
+            Files.createTempFile("blah", ".tmp", (FileAttribute<?>[])null);
+            throw new RuntimeException("NullPointerException expected");
+        } catch (NullPointerException ignore) { }
+        try {
+            Files.createTempFile("blah", ".tmp", new FileAttribute<?>[] { null });
+            throw new RuntimeException("NullPointerException expected");
+        } catch (NullPointerException ignore) { }
+        try {
+            Files.createTempDirectory("blah", (FileAttribute<?>[])null);
+            throw new RuntimeException("NullPointerException expected");
+        } catch (NullPointerException ignore) { }
+        try {
+            Files.createTempDirectory("blah", new FileAttribute<?>[] { null });
+            throw new RuntimeException("NullPointerException expected");
+        } catch (NullPointerException ignore) { }
+        try {
+            Files.createTempFile((Path)null, "blah", ".tmp");
+            throw new RuntimeException("NullPointerException expected");
+        } catch (NullPointerException ignore) { }
+        try {
+            Files.createTempDirectory((Path)null, "blah");
+            throw new RuntimeException("NullPointerException expected");
+        } catch (NullPointerException ignore) { }
     }
 }
--- a/jdk/test/java/security/cert/CertificateFactory/openssl/OpenSSLCert.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/security/cert/CertificateFactory/openssl/OpenSSLCert.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
  */
 
 import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Arrays;
 import java.security.cert.CertificateFactory;
 
@@ -46,24 +48,20 @@
     }
 
     static void test(String... files) throws Exception {
-        FileOutputStream fout = new FileOutputStream(OUTFILE);
-        for (String file: files) {
-            FileInputStream fin = new FileInputStream(
-                new File(System.getProperty("test.src", "."), file));
-            byte[] buffer = new byte[4096];
-            while (true) {
-                int len = fin.read(buffer);
-                if (len < 0) break;
-                fout.write(buffer, 0, len);
+        try (FileOutputStream fout = new FileOutputStream(OUTFILE)) {
+            String here = System.getProperty("test.src", "");
+            for (String file: files) {
+                Files.copy(Paths.get(here, file), fout);
             }
-            fin.close();
         }
-        fout.close();
-        System.out.println("Testing " + Arrays.toString(files) + "...");
-        if (CertificateFactory.getInstance("X509")
-                .generateCertificates(new FileInputStream(OUTFILE))
-                .size() != files.length) {
-            throw new Exception("Not same number");
+        try (FileInputStream fin = new FileInputStream(OUTFILE)) {
+            System.out.println("Testing " + Arrays.toString(files) + "...");
+            if (CertificateFactory.getInstance("X509")
+                    .generateCertificates(fin)
+                    .size() != files.length) {
+                throw new Exception("Not same number");
+            }
         }
+        Files.delete(Paths.get(OUTFILE));
     }
 }
--- a/jdk/test/java/util/Collection/MOAT.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/Collection/MOAT.java	Fri Mar 18 11:00:10 2011 -0700
@@ -28,6 +28,8 @@
  *          6431845 4802633 6570566 6570575 6570631 6570924 6691185 6691215
  * @summary Run many tests on many Collection and Map implementations
  * @author  Martin Buchholz
+ * @run main MOAT
+ * @run main/othervm -XX:+AggressiveOpts MOAT
  */
 
 /* Mother Of All (Collection) Tests
--- a/jdk/test/java/util/Currency/ValidateISO4217.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/Currency/ValidateISO4217.java	Fri Mar 18 11:00:10 2011 -0700
@@ -111,57 +111,58 @@
 
     static void test1() throws Exception {
 
-        FileReader fr = new FileReader(new File(System.getProperty("test.src", "."), datafile));
-        BufferedReader in = new BufferedReader(fr);
-        String line;
-        SimpleDateFormat format = null;
+        try (FileReader fr = new FileReader(new File(System.getProperty("test.src", "."), datafile));
+             BufferedReader in = new BufferedReader(fr))
+        {
+            String line;
+            SimpleDateFormat format = null;
 
-        while ((line = in.readLine()) != null) {
-            if (line.length() == 0 || line.charAt(0) == '#') {
-                continue;
-            }
+            while ((line = in.readLine()) != null) {
+                if (line.length() == 0 || line.charAt(0) == '#') {
+                    continue;
+                }
 
-            StringTokenizer tokens = new StringTokenizer(line, "\t");
-            String country = tokens.nextToken();
-            if (country.length() != 2) {
-                continue;
-            }
+                StringTokenizer tokens = new StringTokenizer(line, "\t");
+                String country = tokens.nextToken();
+                if (country.length() != 2) {
+                    continue;
+                }
 
-            String currency;
-            String numeric;
-            String minorUnit;
-            int tokensCount = tokens.countTokens();
-            if (tokensCount < 3) {
-                currency = "";
-                numeric = "0";
-                minorUnit = "0";
-            } else {
-                currency = tokens.nextToken();
-                numeric = tokens.nextToken();
-                minorUnit = tokens.nextToken();
-                testCurrencies.add(Currency.getInstance(currency));
+                String currency;
+                String numeric;
+                String minorUnit;
+                int tokensCount = tokens.countTokens();
+                if (tokensCount < 3) {
+                    currency = "";
+                    numeric = "0";
+                    minorUnit = "0";
+                } else {
+                    currency = tokens.nextToken();
+                    numeric = tokens.nextToken();
+                    minorUnit = tokens.nextToken();
+                    testCurrencies.add(Currency.getInstance(currency));
 
-                // check for the cutover
-                if (tokensCount > 3) {
-                    if (format == null) {
-                        format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US);
-                        format.setTimeZone(TimeZone.getTimeZone("GMT"));
-                        format.setLenient(false);
-                    }
-                    if (format.parse(tokens.nextToken()).getTime() <
-                        System.currentTimeMillis()) {
-                        currency = tokens.nextToken();
-                        numeric = tokens.nextToken();
-                        minorUnit = tokens.nextToken();
-                        testCurrencies.add(Currency.getInstance(currency));
+                    // check for the cutover
+                    if (tokensCount > 3) {
+                        if (format == null) {
+                            format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US);
+                            format.setTimeZone(TimeZone.getTimeZone("GMT"));
+                            format.setLenient(false);
+                        }
+                        if (format.parse(tokens.nextToken()).getTime() <
+                            System.currentTimeMillis()) {
+                            currency = tokens.nextToken();
+                            numeric = tokens.nextToken();
+                            minorUnit = tokens.nextToken();
+                            testCurrencies.add(Currency.getInstance(currency));
+                        }
                     }
                 }
+                int index = toIndex(country);
+                testCountryCurrency(country, currency, Integer.parseInt(numeric),
+                    Integer.parseInt(minorUnit), index);
             }
-            int index = toIndex(country);
-            testCountryCurrency(country, currency, Integer.parseInt(numeric),
-                Integer.parseInt(minorUnit), index);
         }
-        in.close();
 
         for (int i = 0; i < additionalCodes.length; i++) {
             int index = toIndex(additionalCodes[i][0]);
--- a/jdk/test/java/util/Formatter/FailingConstructors.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/Formatter/FailingConstructors.java	Fri Mar 18 11:00:10 2011 -0700
@@ -34,6 +34,7 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.nio.file.Files;
 import java.util.Formatter;
 
 public class FailingConstructors {
@@ -47,9 +48,7 @@
         /* create the file and write its contents */
         File file = File.createTempFile(fileName, null);
         file.deleteOnExit();
-        FileOutputStream fos = new FileOutputStream(file);
-        fos.write(FILE_CONTENTS.getBytes());
-        fos.close();
+        Files.write(file.toPath(), FILE_CONTENTS.getBytes());
 
         test(true, file);
         file.delete();
--- a/jdk/test/java/util/Locale/LocaleEnhanceTest.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/Locale/LocaleEnhanceTest.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1204,14 +1204,12 @@
                 locale = new Locale(lang, country, variant);
             }
 
-            // desrialize
-            try {
-                FileInputStream fis = new FileInputStream(testfile);
-                ObjectInputStream ois = new ObjectInputStream(fis);
-
+            // deserialize
+            try (FileInputStream fis = new FileInputStream(testfile);
+                 ObjectInputStream ois = new ObjectInputStream(fis))
+            {
                 Object o = ois.readObject();
                 assertEquals("Deserialize Java 6 Locale " + locale, o, locale);
-                ois.close();
             } catch (Exception e) {
                 errln("Exception while reading " + testfile.getAbsolutePath() + " - " + e.getMessage());
             }
--- a/jdk/test/java/util/PriorityQueue/NoNulls.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/PriorityQueue/NoNulls.java	Fri Mar 18 11:00:10 2011 -0700
@@ -53,7 +53,7 @@
 public class NoNulls {
     void test(String[] args) throws Throwable {
         final Comparator<String> nullTolerantComparator
-            = new Comparator<>() {
+            = new Comparator<String>() {
             public int compare(String x, String y) {
                 return (x == null ? -1 :
                         y == null ? 1 :
@@ -65,7 +65,7 @@
         nullSortedSet.add(null);
 
         final PriorityQueue<String> nullPriorityQueue
-            = new PriorityQueue<>() {
+            = new PriorityQueue<String>() {
             public Object[] toArray() { return new Object[] { null };}};
 
         final Collection<String> nullCollection = new ArrayList<>();
--- a/jdk/test/java/util/ResourceBundle/Bug6204853.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/ResourceBundle/Bug6204853.java	Fri Mar 18 11:00:10 2011 -0700
@@ -39,24 +39,19 @@
 public final class Bug6204853 {
 
     public Bug6204853() {
-        try {
-            String srcDir = System.getProperty("test.src", ".");
-            FileInputStream  fis8859_1 =
-                new FileInputStream(new File(srcDir, "Bug6204853.properties"));
-            FileInputStream fisUtf8 =
-                new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
-            InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8");
-
+        String srcDir = System.getProperty("test.src", ".");
+        try (FileInputStream fis8859_1 =
+                 new FileInputStream(new File(srcDir, "Bug6204853.properties"));
+             FileInputStream fisUtf8 =
+                 new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
+             InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
+        {
             PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
             PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
 
             String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
             String[] array = createKeyValueArray(bundle);
 
-            isrUtf8.close();
-            fisUtf8.close();
-            fis8859_1.close();
-
             if (!Arrays.equals(arrayUtf8, array)) {
                 throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
             }
--- a/jdk/test/java/util/Scanner/FailingConstructors.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/Scanner/FailingConstructors.java	Fri Mar 18 11:00:10 2011 -0700
@@ -33,6 +33,7 @@
 import java.io.FileOutputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.util.Scanner;
 
 public class FailingConstructors {
@@ -46,9 +47,7 @@
         /* create the file and write its contents */
         File file = File.createTempFile(fileName, null);
         file.deleteOnExit();
-        FileOutputStream fos = new FileOutputStream(file);
-        fos.write(FILE_CONTENTS.getBytes());
-        fos.close();
+        Files.write(file.toPath(), FILE_CONTENTS.getBytes());
 
         test(true, file);
         file.delete();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/TimeZone/Bug6772689.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6772689
+ * @summary Test for standard-to-daylight transitions at midnight:
+ * date stays on the given day.
+ */
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+import static java.util.GregorianCalendar.*;
+
+public class Bug6772689 {
+    private static final int BEGIN_YEAR = 2035;
+    private static final int END_YEAR = BEGIN_YEAR + 28;
+
+    public static void main(String[] args) {
+        TimeZone defaultTimeZone = TimeZone.getDefault();
+        int errors = 0;
+
+        Calendar cal = new GregorianCalendar(BEGIN_YEAR, MARCH, 1);
+        String[] tzids = TimeZone.getAvailableIDs();
+        try {
+            for (String id : tzids) {
+                TimeZone tz = TimeZone.getTimeZone(id);
+                if (!tz.useDaylightTime()) {
+                    continue;
+                }
+                TimeZone.setDefault(tz);
+
+              dateloop:
+                // Use future dates because sun.util.calendar.ZoneInfo
+                // delegates offset transition calculations to a SimpleTimeZone
+                // (after 2038 as of JDK7).
+                for (int year = BEGIN_YEAR; year < END_YEAR; year++) {
+                    for (int month = MARCH; month <= NOVEMBER; month++) {
+                        cal.set(year, month, 1, 15, 0, 0);
+                        int maxDom = cal.getActualMaximum(DAY_OF_MONTH);
+                        for (int dom = 1; dom <= maxDom; dom++) {
+                            Date date = new Date(year - 1900, month, dom);
+                            if (date.getYear()+1900 != year
+                                || date.getMonth() != month
+                                || date.getDate() != dom) {
+                                System.err.printf("%s: got %04d-%02d-%02d, expected %04d-%02d-%02d%n",
+                                                  id,
+                                                  date.getYear() + 1900,
+                                                  date.getMonth() + 1,
+                                                  date.getDate(),
+                                                  year,
+                                                  month + 1,
+                                                  dom);
+                                errors++;
+                                break dateloop;
+                            }
+                        }
+                    }
+                }
+            }
+        } finally {
+            // Restore the default TimeZone.
+            TimeZone.setDefault(defaultTimeZone);
+        }
+        if (errors > 0) {
+            throw new RuntimeException("Transition test failed");
+        }
+    }
+}
--- a/jdk/test/java/util/jar/JarEntry/GetMethodsReturnClones.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/jar/JarEntry/GetMethodsReturnClones.java	Fri Mar 18 11:00:10 2011 -0700
@@ -40,22 +40,21 @@
         System.getProperty("file.separator");
 
     public static void main(String[] args) throws Exception {
-        JarFile jf = new JarFile(BASE + "test.jar", true);
-
-        byte[] buffer = new byte[8192];
-        Enumeration<JarEntry> e = jf.entries();
-        List<JarEntry> entries = new ArrayList<JarEntry>();
-        while (e.hasMoreElements()) {
-            JarEntry je = e.nextElement();
-            entries.add(je);
-            InputStream is = jf.getInputStream(je);
-            while (is.read(buffer, 0, buffer.length) != -1) {
-                // we just read. this will throw a SecurityException
-                // if  a signature/digest check fails.
+        List<JarEntry> entries = new ArrayList<>();
+        try (JarFile jf = new JarFile(BASE + "test.jar", true)) {
+            byte[] buffer = new byte[8192];
+            Enumeration<JarEntry> e = jf.entries();
+            while (e.hasMoreElements()) {
+                JarEntry je = e.nextElement();
+                entries.add(je);
+                try (InputStream is = jf.getInputStream(je)) {
+                    while (is.read(buffer, 0, buffer.length) != -1) {
+                        // we just read. this will throw a SecurityException
+                        // if  a signature/digest check fails.
+                    }
+                }
             }
-            is.close();
         }
-        jf.close();
 
         for (JarEntry je : entries) {
             Certificate[] certs = je.getCertificates();
--- a/jdk/test/java/util/jar/JarFile/ScanSignedJar.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/jar/JarFile/ScanSignedJar.java	Fri Mar 18 11:00:10 2011 -0700
@@ -37,25 +37,25 @@
 public class ScanSignedJar {
 
     public static void main(String[] args) throws Exception {
-        JarFile file = new JarFile(new File(System.getProperty("test.src","."),
-            "bogus-signerinfo-attr.jar"));
-        byte[] buffer = new byte[8192];
         boolean isSigned = false;
+        try (JarFile file = new JarFile(new File(System.getProperty("test.src","."),
+                 "bogus-signerinfo-attr.jar"))) {
+            byte[] buffer = new byte[8192];
 
-        for (Enumeration entries = file.entries(); entries.hasMoreElements();) {
-            JarEntry entry = (JarEntry) entries.nextElement();
-            InputStream jis = file.getInputStream(entry);
-            while (jis.read(buffer, 0, buffer.length) != -1) {
-                // read the jar entry
+            for (Enumeration entries = file.entries(); entries.hasMoreElements();) {
+                JarEntry entry = (JarEntry) entries.nextElement();
+                try (InputStream jis = file.getInputStream(entry)) {
+                    while (jis.read(buffer, 0, buffer.length) != -1) {
+                        // read the jar entry
+                    }
+                }
+                if (entry.getCertificates() != null) {
+                    isSigned = true;
+                }
+                System.out.println((isSigned ? "[signed] " : "\t ") +
+                    entry.getName());
             }
-            jis.close();
-            if (entry.getCertificates() != null) {
-                isSigned = true;
-            }
-            System.out.println((isSigned ? "[signed] " : "\t ") +
-                entry.getName());
         }
-        file.close();
 
         if (isSigned) {
             System.out.println("\nJAR file has signed entries");
--- a/jdk/test/java/util/zip/Available.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/Available.java	Fri Mar 18 11:00:10 2011 -0700
@@ -44,14 +44,17 @@
         File f = new File(System.getProperty("test.src", "."), "input.jar");
 
         // test ZipInputStream
-        ZipInputStream z = new ZipInputStream(new FileInputStream(f));
-        z.getNextEntry();
-        tryAvail(z);
+        try (FileInputStream fis = new FileInputStream(f);
+             ZipInputStream z = new ZipInputStream(fis))
+        {
+            z.getNextEntry();
+            tryAvail(z);
+        }
 
         // test InflaterInputStream
-        ZipFile zfile = new ZipFile(f);
-        tryAvail(zfile.getInputStream(zfile.getEntry("Available.java")));
-        z.close();
+        try (ZipFile zfile = new ZipFile(f)) {
+            tryAvail(zfile.getInputStream(zfile.getEntry("Available.java")));
+        }
     }
 
     static void tryAvail(InputStream in) throws Exception {
@@ -67,20 +70,21 @@
     // To reproduce 4401122
     private static void test2() throws Exception {
         File f = new File(System.getProperty("test.src", "."), "input.jar");
-        ZipFile zf = new ZipFile(f);
-        InputStream in = zf.getInputStream(zf.getEntry("Available.java"));
+        try (ZipFile zf = new ZipFile(f)) {
+            InputStream in = zf.getInputStream(zf.getEntry("Available.java"));
 
-        int initialAvailable = in.available();
-        in.read();
-        if (in.available() != initialAvailable - 1)
-            throw new RuntimeException("Available not decremented.");
-        for(int j=0; j<initialAvailable-1; j++)
+            int initialAvailable = in.available();
             in.read();
-        if (in.available() != 0)
-            throw new RuntimeException();
-        in.close();
-        if (in.available() != 0)
-            throw new RuntimeException();
+            if (in.available() != initialAvailable - 1)
+                throw new RuntimeException("Available not decremented.");
+            for(int j=0; j<initialAvailable-1; j++)
+                in.read();
+            if (in.available() != 0)
+                throw new RuntimeException();
+            in.close();
+            if (in.available() != 0)
+                throw new RuntimeException();
+        }
     }
 
 }
--- a/jdk/test/java/util/zip/FileBuilder.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/FileBuilder.java	Fri Mar 18 11:00:10 2011 -0700
@@ -53,25 +53,24 @@
                filetype.equals("SlightlyCompressible")))
             usageError();
 
-        RandomAccessFile raf = new RandomAccessFile(filename, "rw");
+        try (RandomAccessFile raf = new RandomAccessFile(filename, "rw")) {
+            if (filetype.equals("SlightlyCompressible")) {
+                byte[] randomBytes = new byte[16384];
+                byte[] nullBytes   = new byte[randomBytes.length/10];
+                Random rand = new Random();
+                for (int i = 0; raf.length() < filesize; ++i) {
+                    rand.nextBytes(randomBytes);
+                    raf.write(nullBytes);
+                    raf.write(randomBytes);
+                }
+            }
 
-        if (filetype.equals("SlightlyCompressible")) {
-            byte[] randomBytes = new byte[16384];
-            byte[] nullBytes   = new byte[randomBytes.length/10];
-            Random rand = new Random();
-            for (int i = 0; raf.length() < filesize; ++i) {
-                rand.nextBytes(randomBytes);
-                raf.write(nullBytes);
-                raf.write(randomBytes);
-            }
+            // Make sure file is exactly the requested size, and that
+            // a unique identifying trailer is written.
+            byte[] filenameBytes = filename.getBytes("UTF8");
+            raf.seek(filesize-filenameBytes.length);
+            raf.write(filenameBytes);
+            raf.setLength(filesize);
         }
-
-        // Make sure file is exactly the requested size, and that
-        // a unique identifying trailer is written.
-        byte[] filenameBytes = filename.getBytes("UTF8");
-        raf.seek(filesize-filenameBytes.length);
-        raf.write(filenameBytes);
-        raf.setLength(filesize);
-        raf.close();
     }
 }
--- a/jdk/test/java/util/zip/GZIP/Accordion.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/GZIP/Accordion.java	Fri Mar 18 11:00:10 2011 -0700
@@ -64,16 +64,13 @@
         System.out.println("count="+count);
 
         Thread compressor = new Thread() { public void run() {
-            try {
-                final GZIPOutputStream s = new GZIPOutputStream(out);
+            try (GZIPOutputStream s = new GZIPOutputStream(out)) {
                 for (long i = 0; i < count; i++)
                     s.write(data, 0, data.length);
-                s.close();
             } catch (Throwable t) { trouble = t; }}};
 
         Thread uncompressor = new Thread() { public void run() {
-            try {
-                final GZIPInputStream s = new GZIPInputStream(in);
+            try (GZIPInputStream s = new GZIPInputStream(in)) {
                 final byte[] maybeBytes = new byte[data.length];
                 for (long i = 0; i < count; i++) {
                     readFully(s, maybeBytes);
@@ -82,7 +79,6 @@
                 }
                 if (s.read(maybeBytes, 0, 1) > 0)
                     throw new Exception("Unexpected NON-EOF");
-                s.close();
             } catch (Throwable t) { trouble = t; }}};
 
         compressor.start(); uncompressor.start();
--- a/jdk/test/java/util/zip/GZIP/GZIPInputStreamRead.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/GZIP/GZIPInputStreamRead.java	Fri Mar 18 11:00:10 2011 -0700
@@ -44,9 +44,9 @@
                 rnd.nextBytes(src);
                 srcBAOS.write(src);
 
-                GZIPOutputStream gzos = new GZIPOutputStream(dstBAOS);
-                gzos.write(src);
-                gzos.close();
+                try (GZIPOutputStream gzos = new GZIPOutputStream(dstBAOS)) {
+                    gzos.write(src);
+                }
             }
             byte[] srcBytes = srcBAOS.toByteArray();
             byte[] dstBytes = dstBAOS.toByteArray();
@@ -75,26 +75,26 @@
                              int readBufSize, int gzisBufSize)
         throws Throwable
     {
-        GZIPInputStream gzis = new GZIPInputStream(
-                                   new ByteArrayInputStream(dst),
-                                   gzisBufSize);
-        byte[] result = new byte[src.length + 10];
-        byte[] buf = new byte[readBufSize];
-        int n = 0;
-        int off = 0;
+        try (ByteArrayInputStream bais = new ByteArrayInputStream(dst);
+             GZIPInputStream gzis = new GZIPInputStream(bais, gzisBufSize))
+        {
+            byte[] result = new byte[src.length + 10];
+            byte[] buf = new byte[readBufSize];
+            int n = 0;
+            int off = 0;
 
-        while ((n = gzis.read(buf, 0, buf.length)) != -1) {
-            System.arraycopy(buf, 0, result, off, n);
-            off += n;
-            // no range check, if overflow, let it fail
+            while ((n = gzis.read(buf, 0, buf.length)) != -1) {
+                System.arraycopy(buf, 0, result, off, n);
+                off += n;
+                // no range check, if overflow, let it fail
+            }
+            if (off != src.length || gzis.available() != 0 ||
+                !Arrays.equals(src, Arrays.copyOf(result, off))) {
+                throw new RuntimeException(
+                    "GZIPInputStream reading failed! " +
+                    ", src.len=" + src.length +
+                    ", read=" + off);
+            }
         }
-        if (off != src.length || gzis.available() != 0 ||
-            !Arrays.equals(src, Arrays.copyOf(result, off))) {
-            throw new RuntimeException(
-                "GZIPInputStream reading failed! " +
-                ", src.len=" + src.length +
-                ", read=" + off);
-        }
-        gzis.close();
     }
 }
--- a/jdk/test/java/util/zip/InflateIn_DeflateOut.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/InflateIn_DeflateOut.java	Fri Mar 18 11:00:10 2011 -0700
@@ -134,14 +134,14 @@
 
         PairedOutputStream pos = new PairedOutputStream(pis);
         pis.setPairedOutputStream(pos);
-        DeflaterOutputStream dos = new DeflaterOutputStream(pos, true);
 
         byte[] data = new byte[random.nextInt(1024 * 1024)];
         byte[] buf = new byte[data.length];
         random.nextBytes(data);
 
-        dos.write(data);
-        dos.close();
+        try (DeflaterOutputStream dos = new DeflaterOutputStream(pos, true)) {
+            dos.write(data);
+        }
         check(readFully(iis, buf, buf.length));
         check(Arrays.equals(data, buf));
     }
--- a/jdk/test/java/util/zip/InfoZip.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/InfoZip.java	Fri Mar 18 11:00:10 2011 -0700
@@ -85,41 +85,37 @@
         //----------------------------------------------------------------
         File f = new File("InfoZip.zip");
 
-        OutputStream os = new FileOutputStream(f);
-        os.write(new byte[]
-            {'P', 'K', 3, 4, 10, 0, 0, 0, 0, 0, -68, 8, 'k',
-             '2', 'V', -7, 'm', 9, 20, 0, 0, 0, 20, 0, 0, 0,
-             8, 0, 21, 0, 's', 'o', 'm', 'e', 'F', 'i', 'l', 'e', 'U',
-             'T', 9, 0, 3, 't', '_', '1', 'B', 't', '_', '1', 'B', 'U',
-             'x', 4, 0, -14, 'v', 26, 4, 'M', 'e', 's', 's', 'a', 'g',
-             'e', ' ', 'i', 'n', ' ', 'a', ' ', 'B', 'o', 't', 't', 'l', 'e',
-             10, 'P', 'K', 1, 2, 23, 3, 10, 0, 0, 0, 0, 0,
-             -68, 8, 'k', '2', 'V', -7, 'm', 9, 20, 0, 0, 0, 20,
-             0, 0, 0, 8, 0, 13, 0, 0, 0, 0, 0, 1, 0,
-             0, 0, -92, -127, 0, 0, 0, 0, 's', 'o', 'm', 'e', 'F',
-             'i', 'l', 'e', 'U', 'T', 5, 0, 3, 't', '_', '1', 'B', 'U',
-             'x', 0, 0, 'P', 'K', 5, 6, 0, 0, 0, 0, 1, 0,
-             1, 0, 'C', 0, 0, 0, 'O', 0, 0, 0, 0, 0, });
-        os.close();
+        try (OutputStream os = new FileOutputStream(f)) {
+            os.write(new byte[]
+                {'P', 'K', 3, 4, 10, 0, 0, 0, 0, 0, -68, 8, 'k',
+                 '2', 'V', -7, 'm', 9, 20, 0, 0, 0, 20, 0, 0, 0,
+                 8, 0, 21, 0, 's', 'o', 'm', 'e', 'F', 'i', 'l', 'e', 'U',
+                 'T', 9, 0, 3, 't', '_', '1', 'B', 't', '_', '1', 'B', 'U',
+                 'x', 4, 0, -14, 'v', 26, 4, 'M', 'e', 's', 's', 'a', 'g',
+                 'e', ' ', 'i', 'n', ' ', 'a', ' ', 'B', 'o', 't', 't', 'l', 'e',
+                 10, 'P', 'K', 1, 2, 23, 3, 10, 0, 0, 0, 0, 0,
+                 -68, 8, 'k', '2', 'V', -7, 'm', 9, 20, 0, 0, 0, 20,
+                 0, 0, 0, 8, 0, 13, 0, 0, 0, 0, 0, 1, 0,
+                 0, 0, -92, -127, 0, 0, 0, 0, 's', 'o', 'm', 'e', 'F',
+                 'i', 'l', 'e', 'U', 'T', 5, 0, 3, 't', '_', '1', 'B', 'U',
+                 'x', 0, 0, 'P', 'K', 5, 6, 0, 0, 0, 0, 1, 0,
+                 1, 0, 'C', 0, 0, 0, 'O', 0, 0, 0, 0, 0, });
+        }
 
-        ZipFile zf = new ZipFile(f);
         ZipEntry ze = null;
-        try {
+        try (ZipFile zf = new ZipFile(f)) {
             Enumeration<? extends ZipEntry> entries = zf.entries();
             ze = entries.nextElement();
             check(! entries.hasMoreElements());
             checkZipEntry(ze, contents(zf, ze));
-        } finally {
-            zf.close();
         }
 
-        ZipInputStream is = new ZipInputStream(new FileInputStream(f));
-        try {
+        try (FileInputStream fis = new FileInputStream(f);
+             ZipInputStream is = new ZipInputStream(fis))
+        {
             ze = is.getNextEntry();
             checkZipEntry(ze, contents(is));
             check(is.getNextEntry() == null);
-        } finally {
-            is.close();
         }
         f.delete();
         System.out.printf("passed = %d, failed = %d%n", passed, failed);
--- a/jdk/test/java/util/zip/LargeZip.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/LargeZip.java	Fri Mar 18 11:00:10 2011 -0700
@@ -98,19 +98,21 @@
         }
         data = baos.toByteArray();
 
-        ZipOutputStream zos = new ZipOutputStream(
-            new BufferedOutputStream(new FileOutputStream(largeFile)));
-        long length = 0;
-        while (length < fileSize) {
-            ZipEntry ze = new ZipEntry("entry-" + length);
-            lastEntryName = ze.getName();
-            zos.putNextEntry(ze);
-            zos.write(data, 0, data.length);
-            zos.closeEntry();
-            length = largeFile.length();
+        try (FileOutputStream fos = new FileOutputStream(largeFile);
+             BufferedOutputStream bos = new BufferedOutputStream(fos);
+             ZipOutputStream zos = new ZipOutputStream(bos))
+        {
+            long length = 0;
+            while (length < fileSize) {
+                ZipEntry ze = new ZipEntry("entry-" + length);
+                lastEntryName = ze.getName();
+                zos.putNextEntry(ze);
+                zos.write(data, 0, data.length);
+                zos.closeEntry();
+                length = largeFile.length();
+            }
+            System.out.println("Last entry written is " + lastEntryName);
         }
-        System.out.println("Last entry written is " + lastEntryName);
-        zos.close();
     }
 
     static void readLargeZip1() throws Throwable {
@@ -143,33 +145,35 @@
 
 
     static void readLargeZip2() throws Throwable {
-        ZipInputStream zis = new ZipInputStream(
-            new BufferedInputStream(new FileInputStream(largeFile)));
-        ZipEntry entry = null;
-        String entryName = null;
-        int count = 0;
-        while ((entry = zis.getNextEntry()) != null) {
-            entryName = entry.getName();
-            if (entryName.equals(lastEntryName)) {
-                break;
+        try (FileInputStream fis = new FileInputStream(largeFile);
+             BufferedInputStream bis = new BufferedInputStream(fis);
+             ZipInputStream zis = new ZipInputStream(bis))
+        {
+            ZipEntry entry = null;
+            String entryName = null;
+            int count = 0;
+            while ((entry = zis.getNextEntry()) != null) {
+                entryName = entry.getName();
+                if (entryName.equals(lastEntryName)) {
+                    break;
+                }
+                count++;
             }
-            count++;
+            System.out.println("Number of entries read: " + count);
+            System.out.println("Last entry read is " + entryName);
+            check(!entry.isDirectory());
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+            byte buf[] = new byte[4096];
+            int len;
+            while ((len = zis.read(buf)) >= 0) {
+                baos.write(buf, 0, len);
+            }
+            baos.close();
+            check(Arrays.equals(data, baos.toByteArray()));
+            check(zis.getNextEntry() == null);
         }
-        System.out.println("Number of entries read: " + count);
-        System.out.println("Last entry read is " + entryName);
-        check(!entry.isDirectory());
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
-        byte buf[] = new byte[4096];
-        int len;
-        while ((len = zis.read(buf)) >= 0) {
-            baos.write(buf, 0, len);
-        }
-        baos.close();
-        check(Arrays.equals(data, baos.toByteArray()));
-        check(zis.getNextEntry() == null);
-        zis.close();
     }
 
 
--- a/jdk/test/java/util/zip/TestEmptyZip.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/TestEmptyZip.java	Fri Mar 18 11:00:10 2011 -0700
@@ -78,67 +78,49 @@
                 pass();
             }
         }
-        ZipInputStream zis = null;
-        try {
-            zis = new ZipInputStream(new FileInputStream(f));
+        try (FileInputStream fis = new FileInputStream(f);
+             ZipInputStream zis = new ZipInputStream(fis))
+        {
             ZipEntry ze = zis.getNextEntry();
             check(ze == null);
         } catch (IOException ex) {
             unexpected(ex);
-        } finally {
-            if (zis != null) zis.close();
         }
     }
 
     static void write(File f) throws Exception {
-        ZipOutputStream zos = null;
-        try {
-            zos = new ZipOutputStream(new FileOutputStream(f));
+        try (FileOutputStream fis = new FileOutputStream(f);
+             ZipOutputStream zos = new ZipOutputStream(fis))
+        {
             zos.finish();
-            zos.close();
             pass();
         } catch (Exception ex) {
             unexpected(ex);
-        } finally {
-            if (zos != null) {
-                zos.close();
-            }
         }
     }
 
     static void readFile(File f) throws Exception {
-        ZipFile zf = null;
-        try {
-            zf = new ZipFile(f);
+        try (ZipFile zf = new ZipFile(f)) {
 
             Enumeration e = zf.entries();
             while (e.hasMoreElements()) {
                 ZipEntry entry = (ZipEntry) e.nextElement();
                 fail();
             }
-            zf.close();
             pass();
         } catch (Exception ex) {
             unexpected(ex);
-        } finally {
-            if (zf != null) {
-                zf.close();
-            }
         }
     }
 
     static void readStream(File f) throws Exception {
-        ZipInputStream zis = null;
-        try {
-            zis = new ZipInputStream(new FileInputStream(f));
+        try (FileInputStream fis = new FileInputStream(f);
+             ZipInputStream zis = new ZipInputStream(fis))
+        {
             ZipEntry ze = zis.getNextEntry();
             check(ze == null);
             byte[] buf = new byte[1024];
             check(zis.read(buf, 0, 1024) == -1);
-        } finally {
-            if (zis != null) {
-                zis.close();
-            }
         }
     }
 
--- a/jdk/test/java/util/zip/ZipCoding.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipCoding.java	Fri Mar 18 11:00:10 2011 -0700
@@ -57,59 +57,58 @@
                                    String name, String comment, byte[] bb)
         throws Exception
     {
-        ZipInputStream zis = new ZipInputStream(is, cs);
-        ZipEntry e = zis.getNextEntry();
-        if (e == null || ! name.equals(e.getName()))
-            throw new RuntimeException("ZipIS name doesn't match!");
-        byte[] bBuf = new byte[bb.length << 1];
-        int n = zis.read(bBuf, 0, bBuf.length);
-        if (n != bb.length ||
-            !Arrays.equals(bb, Arrays.copyOf(bBuf, n))) {
-            throw new RuntimeException("ZipIS content doesn't match!");
+        try (ZipInputStream zis = new ZipInputStream(is, cs)) {
+            ZipEntry e = zis.getNextEntry();
+            if (e == null || ! name.equals(e.getName()))
+                throw new RuntimeException("ZipIS name doesn't match!");
+            byte[] bBuf = new byte[bb.length << 1];
+            int n = zis.read(bBuf, 0, bBuf.length);
+            if (n != bb.length ||
+                !Arrays.equals(bb, Arrays.copyOf(bBuf, n))) {
+                throw new RuntimeException("ZipIS content doesn't match!");
+            }
         }
-        zis.close();
     }
 
     static void testZipFile(File f, Charset cs,
                             String name, String comment, byte[] bb)
         throws Exception
     {
-        ZipFile zf = new ZipFile(f, cs);
-        Enumeration<? extends ZipEntry> zes = zf.entries();
-        ZipEntry e = (ZipEntry)zes.nextElement();
-        if (! name.equals(e.getName()) ||
-            ! comment.equals(e.getComment()))
-            throw new RuntimeException("ZipFile: name/comment doesn't match!");
-        InputStream is = zf.getInputStream(e);
-        if (is == null)
-            throw new RuntimeException("ZipFile: getIS failed!");
-        byte[] bBuf = new byte[bb.length << 1];
-        int n = 0;
-        int nn =0;
-        while ((nn = is.read(bBuf, n, bBuf.length-n)) != -1) {
-            n += nn;
+        try (ZipFile zf = new ZipFile(f, cs)) {
+            Enumeration<? extends ZipEntry> zes = zf.entries();
+            ZipEntry e = (ZipEntry)zes.nextElement();
+            if (! name.equals(e.getName()) ||
+                ! comment.equals(e.getComment()))
+                throw new RuntimeException("ZipFile: name/comment doesn't match!");
+            InputStream is = zf.getInputStream(e);
+            if (is == null)
+                throw new RuntimeException("ZipFile: getIS failed!");
+            byte[] bBuf = new byte[bb.length << 1];
+            int n = 0;
+            int nn =0;
+            while ((nn = is.read(bBuf, n, bBuf.length-n)) != -1) {
+                n += nn;
+            }
+            if (n != bb.length ||
+                !Arrays.equals(bb, Arrays.copyOf(bBuf, n))) {
+                throw new RuntimeException("ZipFile content doesn't match!");
+            }
         }
-        if (n != bb.length ||
-            !Arrays.equals(bb, Arrays.copyOf(bBuf, n))) {
-            throw new RuntimeException("ZipFile content doesn't match!");
-        }
-        zf.close();
     }
 
     static void test(String csn, String name, String comment)
         throws Exception
     {
-        byte[] bb = "This is the conent of the zipfile".getBytes("ISO-8859-1");
+        byte[] bb = "This is the content of the zipfile".getBytes("ISO-8859-1");
         Charset cs = Charset.forName(csn);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        ZipOutputStream zos = new ZipOutputStream(baos, cs);
-
-        ZipEntry e = new ZipEntry(name);
-        e.setComment(comment);
-        zos.putNextEntry(e);
-        zos.write(bb, 0, bb.length);
-        zos.closeEntry();
-        zos.close();
+        try (ZipOutputStream zos = new ZipOutputStream(baos, cs)) {
+            ZipEntry e = new ZipEntry(name);
+            e.setComment(comment);
+            zos.putNextEntry(e);
+            zos.write(bb, 0, bb.length);
+            zos.closeEntry();
+        }
         ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
         testZipInputStream(bis, cs, name, comment, bb);
 
@@ -121,9 +120,9 @@
 
         File f = new File(new File(System.getProperty("test.dir", ".")),
                           "zfcoding.zip");
-        FileOutputStream fos = new FileOutputStream(f);
-        baos.writeTo(fos);
-        fos.close();
+        try (FileOutputStream fos = new FileOutputStream(f)) {
+            baos.writeTo(fos);
+        }
         testZipFile(f, cs, name, comment, bb);
         if ("utf-8".equals(csn)) {
             testZipFile(f, Charset.forName("MS932"), name, comment, bb);
--- a/jdk/test/java/util/zip/ZipFile/Assortment.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/Assortment.java	Fri Mar 18 11:00:10 2011 -0700
@@ -201,13 +201,12 @@
         //----------------------------------------------------------------
         // Write zip file using ZipOutputStream
         //----------------------------------------------------------------
-        ZipOutputStream zos = new ZipOutputStream(
-            new FileOutputStream(zipName));
-
-        for (Entry e : entries)
-            e.write(zos);
-
-        zos.close();
+        try (FileOutputStream fos = new FileOutputStream(zipName);
+             ZipOutputStream zos = new ZipOutputStream(fos))
+        {
+            for (Entry e : entries)
+                e.write(zos);
+        }
 
         //----------------------------------------------------------------
         // Verify zip file contents using JarFile class
--- a/jdk/test/java/util/zip/ZipFile/Comment.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/Comment.java	Fri Mar 18 11:00:10 2011 -0700
@@ -57,16 +57,15 @@
     private static void writeZipFile(String name, String comment)
         throws IOException
     {
-        ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(name));
-        try {
+        try (FileOutputStream fos = new FileOutputStream(name);
+             ZipOutputStream zos = new ZipOutputStream(fos))
+        {
             zos.setComment(comment);
             ZipEntry ze = new ZipEntry(entryName);
             ze.setMethod(ZipEntry.DEFLATED);
             zos.putNextEntry(ze);
             new DataOutputStream(zos).writeUTF(entryContents);
             zos.closeEntry();
-        } finally {
-            zos.close();
         }
     }
 
@@ -74,30 +73,30 @@
         throws Exception
     {
         // Check that Zip entry was correctly written.
-        ZipFile zipFile = new ZipFile(name);
-        ZipEntry zipEntry = zipFile.getEntry(entryName);
-        InputStream is = zipFile.getInputStream(zipEntry);
-        String result = new DataInputStream(is).readUTF();
-        if (!result.equals(entryContents))
-            throw new Exception("Entry contents corrupted");
+        try (ZipFile zipFile = new ZipFile(name)) {
+            ZipEntry zipEntry = zipFile.getEntry(entryName);
+            InputStream is = zipFile.getInputStream(zipEntry);
+            String result = new DataInputStream(is).readUTF();
+            if (!result.equals(entryContents))
+                throw new Exception("Entry contents corrupted");
+        }
 
-        // Check that comment length was correctly written.
-        RandomAccessFile file = new RandomAccessFile(name, "r");
-        file.seek(file.length() - comment.length()
-                  - ZipFile.ENDHDR + ZipFile.ENDCOM);
-        int b1 = file.readUnsignedByte();
-        int b2 = file.readUnsignedByte();
-        if (b1 + (b2 << 8) != comment.length())
-            throw new Exception("Zip file comment length corrupted");
+        try (RandomAccessFile file = new RandomAccessFile(name, "r")) {
+            // Check that comment length was correctly written.
+            file.seek(file.length() - comment.length()
+                      - ZipFile.ENDHDR + ZipFile.ENDCOM);
+            int b1 = file.readUnsignedByte();
+            int b2 = file.readUnsignedByte();
+            if (b1 + (b2 << 8) != comment.length())
+                throw new Exception("Zip file comment length corrupted");
 
-        // Check that comment was correctly written.
-        file.seek(file.length() - comment.length());
-        byte [] bytes = new byte [comment.length()];
-        file.readFully(bytes);
-        zipFile.close();
-        file.close();
-        if (! comment.equals(new String(bytes, "UTF8")))
-            throw new Exception("Zip file comment corrupted");
+            // Check that comment was correctly written.
+            file.seek(file.length() - comment.length());
+            byte [] bytes = new byte [comment.length()];
+            file.readFully(bytes);
+            if (! comment.equals(new String(bytes, "UTF8")))
+                throw new Exception("Zip file comment corrupted");
+        }
     }
 
     private static String buildComment(int length) {
--- a/jdk/test/java/util/zip/ZipFile/CopyJar.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/CopyJar.java	Fri Mar 18 11:00:10 2011 -0700
@@ -31,18 +31,18 @@
 
 public class CopyJar {
     public static void main(String args[]) throws Exception {
-        ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
-                                          "input.jar"));
-        ZipEntry ze = zf.getEntry("ReleaseInflater.java");
-        ZipOutputStream zos = new ZipOutputStream(new ByteArrayOutputStream());
-        InputStream in = zf.getInputStream(ze);
-        byte[] b = new byte[128];
-        int n;
-        zos.putNextEntry(ze);
-        while((n = in.read(b)) != -1) {
-            zos.write(b, 0, n);
+        try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
+                                               "input.jar"))) {
+            ZipEntry ze = zf.getEntry("ReleaseInflater.java");
+            ZipOutputStream zos = new ZipOutputStream(new ByteArrayOutputStream());
+            InputStream in = zf.getInputStream(ze);
+            byte[] b = new byte[128];
+            int n;
+            zos.putNextEntry(ze);
+            while((n = in.read(b)) != -1) {
+                zos.write(b, 0, n);
+            }
+            zos.close();
         }
-        zos.close();
-        zf.close();
     }
 }
--- a/jdk/test/java/util/zip/ZipFile/CorruptedZipFiles.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/CorruptedZipFiles.java	Fri Mar 18 11:00:10 2011 -0700
@@ -47,21 +47,19 @@
     }
 
     public static void main(String[] args) throws Exception {
-        ZipOutputStream zos = new ZipOutputStream(new FileOutputStream("x.zip"));
-        try {
+        try (FileOutputStream fos = new FileOutputStream("x.zip");
+             ZipOutputStream zos = new ZipOutputStream(fos))
+        {
             ZipEntry e = new ZipEntry("x");
             zos.putNextEntry(e);
             zos.write((int)'x');
-        } finally {
-            zos.close();
         }
 
         int len = (int)(new File("x.zip").length());
         byte[] good = new byte[len];
-        FileInputStream fis = new FileInputStream("x.zip");
-        fis.read(good);
-        fis.close();
-        fis = null;
+        try (FileInputStream fis = new FileInputStream("x.zip")) {
+            fis.read(good);
+        }
         new File("x.zip").delete();
 
         int endpos = len - ENDHDR;
@@ -150,17 +148,14 @@
                                       boolean getInputStream) {
         String zipName = "bad" + (uniquifier++) + ".zip";
         try {
-            FileOutputStream fos = new FileOutputStream(zipName);
-            fos.write(data);
-            fos.close();
-            ZipFile zf = new ZipFile(zipName);
-            try {
+            try (FileOutputStream fos = new FileOutputStream(zipName)) {
+                fos.write(data);
+            }
+            try (ZipFile zf = new ZipFile(zipName)) {
                 if (getInputStream) {
                     InputStream is = zf.getInputStream(new ZipEntry("x"));
                     is.read();
                 }
-            } finally {
-                zf.close();
             }
             fail("Failed to throw expected ZipException");
         } catch (ZipException e) {
@@ -170,8 +165,7 @@
                 unexpected(e);
         } catch (Throwable t) {
             unexpected(t);
-        }
-        finally {
+        } finally {
             new File(zipName).delete();
         }
     }
--- a/jdk/test/java/util/zip/ZipFile/DeleteTempJar.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/DeleteTempJar.java	Fri Mar 18 11:00:10 2011 -0700
@@ -53,34 +53,34 @@
     {
         final File zf = File.createTempFile("deletetemp", ".jar");
         zf.deleteOnExit();
-        JarOutputStream jos = new JarOutputStream(
-                new FileOutputStream(zf));
-        JarEntry je = new JarEntry("entry");
-        jos.putNextEntry(je);
-        jos.write("hello, world".getBytes("ASCII"));
-        jos.close();
+        try (FileOutputStream fos = new FileOutputStream(zf);
+             JarOutputStream jos = new JarOutputStream(fos))
+        {
+            JarEntry je = new JarEntry("entry");
+            jos.putNextEntry(je);
+            jos.write("hello, world".getBytes("ASCII"));
+        }
 
         HttpServer server = HttpServer.create(
                 new InetSocketAddress((InetAddress) null, 0), 0);
         HttpContext context = server.createContext("/",
             new HttpHandler() {
                 public void handle(HttpExchange e) {
-                try {
-                    FileInputStream fis = new FileInputStream(zf);
-                    e.sendResponseHeaders(200, zf.length());
-                    OutputStream os = e.getResponseBody();
-                    byte[] buf = new byte[1024];
-                    int count = 0;
-                    while ((count = fis.read(buf)) != -1) {
-                        os.write(buf, 0, count);
+                    try (FileInputStream fis = new FileInputStream(zf)) {
+                        e.sendResponseHeaders(200, zf.length());
+                        OutputStream os = e.getResponseBody();
+                        byte[] buf = new byte[1024];
+                        int count = 0;
+                        while ((count = fis.read(buf)) != -1) {
+                            os.write(buf, 0, count);
+                        }
+                    } catch (Exception ex) {
+                        unexpected(ex);
+                    } finally {
+                        e.close();
                     }
-                    fis.close();
-                    e.close();
-                } catch (Exception ex) {
-                    unexpected(ex);
                 }
-            }
-        });
+            });
         server.start();
 
         URL url = new URL("jar:http://localhost:"
--- a/jdk/test/java/util/zip/ZipFile/EnumAfterClose.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/EnumAfterClose.java	Fri Mar 18 11:00:10 2011 -0700
@@ -33,10 +33,12 @@
 
 public class EnumAfterClose {
     public static void main(String args[]) throws Exception {
-        ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
-                                          "input.zip"));
-        Enumeration e = zf.entries();
-        zf.close();
+        Enumeration e;
+        try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
+                                               "input.zip"))) {
+            e = zf.entries();
+        }
+        // ensure that the ZipFile is closed before checking the Enumeration
         try {
             if (e.hasMoreElements()) {
                 ZipEntry ze = (ZipEntry)e.nextElement();
--- a/jdk/test/java/util/zip/ZipFile/GetDirEntry.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/GetDirEntry.java	Fri Mar 18 11:00:10 2011 -0700
@@ -32,12 +32,12 @@
 
 public class GetDirEntry {
     public static void main(String args[]) throws Exception {
-        ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
-                                          "input.jar"));
-        ZipEntry ze = zf.getEntry("META-INF");
-        if (ze == null) {
-            throw new Exception("failed to find a directory entry");
+        try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
+                                               "input.jar"))) {
+            ZipEntry ze = zf.getEntry("META-INF");
+            if (ze == null) {
+                throw new Exception("failed to find a directory entry");
+            }
         }
-        zf.close();
     }
 }
--- a/jdk/test/java/util/zip/ZipFile/LargeZipFile.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/LargeZipFile.java	Fri Mar 18 11:00:10 2011 -0700
@@ -93,51 +93,50 @@
             baos.write(bb.array(), 0, DATA_SIZE);
         }
         data = baos.toByteArray();
-
-        ZipOutputStream zos = new ZipOutputStream(
-            new BufferedOutputStream(new FileOutputStream(largeFile)));
-        long length = 0;
-        while (length < fileSize) {
-            ZipEntry ze = new ZipEntry("entry-" + length);
-            lastEntryName = ze.getName();
-            zos.putNextEntry(ze);
-            zos.write(data, 0, data.length);
-            zos.closeEntry();
-            length = largeFile.length();
+        try (FileOutputStream fos = new FileOutputStream(largeFile);
+             BufferedOutputStream bos = new BufferedOutputStream(fos);
+             ZipOutputStream zos = new ZipOutputStream(bos))
+        {
+            long length = 0;
+            while (length < fileSize) {
+                ZipEntry ze = new ZipEntry("entry-" + length);
+                lastEntryName = ze.getName();
+                zos.putNextEntry(ze);
+                zos.write(data, 0, data.length);
+                zos.closeEntry();
+                length = largeFile.length();
+            }
+            System.out.println("Last entry written is " + lastEntryName);
         }
-        System.out.println("Last entry written is " + lastEntryName);
-        zos.close();
     }
 
     static void readLargeZip() throws Throwable {
-        ZipFile zipFile = new ZipFile(largeFile);
-        ZipEntry entry = null;
-        String entryName = null;
-        int count = 0;
-        Enumeration<? extends ZipEntry> entries = zipFile.entries();
-        while (entries.hasMoreElements()) {
-            entry = entries.nextElement();
-            entryName = entry.getName();
-            count++;
+        try (ZipFile zipFile = new ZipFile(largeFile)) {
+            ZipEntry entry = null;
+            String entryName = null;
+            int count = 0;
+            Enumeration<? extends ZipEntry> entries = zipFile.entries();
+            while (entries.hasMoreElements()) {
+                entry = entries.nextElement();
+                entryName = entry.getName();
+                count++;
+            }
+            System.out.println("Number of entries read: " + count);
+            System.out.println("Last entry read is " + entryName);
+            check(!entry.isDirectory());
+            if (check(entryName.equals(lastEntryName))) {
+                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                InputStream is = zipFile.getInputStream(entry);
+                byte buf[] = new byte[4096];
+                int len;
+                while ((len = is.read(buf)) >= 0) {
+                    baos.write(buf, 0, len);
+                }
+                baos.close();
+                is.close();
+                check(Arrays.equals(data, baos.toByteArray()));
+            }
         }
-        System.out.println("Number of entries read: " + count);
-        System.out.println("Last entry read is " + entryName);
-        check(!entry.isDirectory());
-        if (check(entryName.equals(lastEntryName))) {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            InputStream is = zipFile.getInputStream(entry);
-            byte buf[] = new byte[4096];
-            int len;
-            while ((len = is.read(buf)) >= 0) {
-                baos.write(buf, 0, len);
-            }
-            baos.close();
-            is.close();
-            check(Arrays.equals(data, baos.toByteArray()));
-        }
-        try {
-          zipFile.close();
-        } catch (IOException ioe) {/* what can you do */ }
     }
 
     //--------------------- Infrastructure ---------------------------
--- a/jdk/test/java/util/zip/ZipFile/ManyEntries.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/ManyEntries.java	Fri Mar 18 11:00:10 2011 -0700
@@ -55,10 +55,10 @@
         File zipFile = new File(++uniquifier + ".zip");
         try {
             zipFile.delete();
-            ZipOutputStream zos = new ZipOutputStream(
-                new BufferedOutputStream(
-                    new FileOutputStream(zipFile)));
-            try {
+            try (FileOutputStream fos = new FileOutputStream(zipFile);
+                 BufferedOutputStream bos = new BufferedOutputStream(fos);
+                 ZipOutputStream zos = new ZipOutputStream(bos))
+            {
                 for (int i = 0; i < N; i++) {
                     ZipEntry e = new ZipEntry("DIR/"+i);
                     e.setMethod(method);
@@ -75,13 +75,9 @@
                     zos.putNextEntry(e);
                     zos.write(i);
                 }
-            } finally {
-                zos.close();
-                zos = null;
             }
 
-            ZipFile zip = zip = new ZipFile(zipFile);
-            try {
+            try (ZipFile zip = new ZipFile(zipFile)) {
                 if (! (zip.size() == N))
                     throw new Exception("Bad ZipFile size: " + zip.size());
                 Enumeration entries = zip.entries();
@@ -104,11 +100,8 @@
                 }
                 if (entries.hasMoreElements())
                     throw new Exception("too many elements");
-            } finally {
-                zip.close();
             }
-        }
-        finally {
+        } finally {
             zipFile.delete();
         }
     }
--- a/jdk/test/java/util/zip/ZipFile/ManyZipFiles.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/ManyZipFiles.java	Fri Mar 18 11:00:10 2011 -0700
@@ -51,14 +51,14 @@
 
         // Create some zip data
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        ZipOutputStream zos = new ZipOutputStream(baos);
-        ZipEntry ze = new ZipEntry("test");
-        zos.putNextEntry(ze);
-        byte[] hello = "hello, world".getBytes("ASCII");
-        zos.write(hello, 0, hello.length);
-        zos.closeEntry();
-        zos.finish();
-        zos.close();
+        try (ZipOutputStream zos = new ZipOutputStream(baos)) {
+            ZipEntry ze = new ZipEntry("test");
+            zos.putNextEntry(ze);
+            byte[] hello = "hello, world".getBytes("ASCII");
+            zos.write(hello, 0, hello.length);
+            zos.closeEntry();
+            zos.finish();
+        }
         byte[] data = baos.toByteArray();
 
         ZipFile zips[] = new ZipFile[numFiles];
@@ -90,9 +90,9 @@
             for (int i = 0; i < numFiles; i++) {
                 File f = File.createTempFile("test", ".zip", tmpdir);
                 f.deleteOnExit();
-                FileOutputStream fos = new FileOutputStream(f);
-                fos.write(data, 0, data.length);
-                fos.close();
+                try (FileOutputStream fos = new FileOutputStream(f)) {
+                    fos.write(data, 0, data.length);
+                }
                 try {
                     zips[i] = new ZipFile(f);
                 } catch (Throwable t) {
@@ -102,11 +102,12 @@
                 }
             }
         } finally {
-            // This finally block is due to bug 4171239.  On windows, if the
+            // This finally block is due to bug 4171239.  On Windows, if the
             // file is still open at the end of the VM, deleteOnExit won't
             // take place.  "new ZipFile(...)" opens the zip file, so we have
-            // to explicity close those opened above.  This finally block can
-            // be removed when 4171239 is fixed.
+            // to explicitly close those opened above.  This finally block can
+            // be removed when 4171239 is fixed. See also 6357433, against which
+            // 4171239 was closed as a duplicate.
             for (int i = 0; i < numFiles; i++) {
                 if (zips[i] != null) {
                     try {
--- a/jdk/test/java/util/zip/ZipFile/ReadAfterClose.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/ReadAfterClose.java	Fri Mar 18 11:00:10 2011 -0700
@@ -34,10 +34,13 @@
 
 public class ReadAfterClose {
     public static void main(String[] argv) throws Exception {
-        ZipFile zf = new ZipFile(new File(System.getProperty("test.src","."),"crash.jar"));
-        ZipEntry zent = zf.getEntry("Test.java");
-        InputStream in = zf.getInputStream(zent);
-        zf.close();
+        InputStream in;
+        try (ZipFile zf = new ZipFile(
+                 new File(System.getProperty("test.src","."),"crash.jar"))) {
+            ZipEntry zent = zf.getEntry("Test.java");
+            in = zf.getInputStream(zent);
+        }
+        // ensure zf is closed at this point
         try {
             in.read();
         } catch (IOException e) {
--- a/jdk/test/java/util/zip/ZipFile/ReadZip.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/ReadZip.java	Fri Mar 18 11:00:10 2011 -0700
@@ -27,6 +27,10 @@
  */
 
 import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.nio.file.StandardOpenOption;
 import java.util.zip.*;
 
 public class ReadZip {
@@ -38,71 +42,62 @@
     }
 
     public static void main(String args[]) throws Exception {
-        ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
-                                          "input.zip"));
-
-        // Make sure we throw NPE on null objects
-        try { unreached (zf.getEntry(null)); }
-        catch (NullPointerException e) {}
+        try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
+                                               "input.zip"))) {
+            // Make sure we throw NPE on null objects
+            try { unreached (zf.getEntry(null)); }
+            catch (NullPointerException e) {}
 
-        try { unreached (zf.getInputStream(null)); }
-        catch (NullPointerException e) {}
+            try { unreached (zf.getInputStream(null)); }
+            catch (NullPointerException e) {}
 
-        ZipEntry ze = zf.getEntry("ReadZip.java");
-        if (ze == null) {
-            throw new Exception("cannot read from zip file");
+            ZipEntry ze = zf.getEntry("ReadZip.java");
+            if (ze == null) {
+                throw new Exception("cannot read from zip file");
+            }
         }
-        zf.close();
 
         // Make sure we can read the zip file that has some garbage
         // bytes padded at the end.
-        FileInputStream fis = new FileInputStream(
-                                   new File(System.getProperty("test.src", "."),
-                                            "input.zip"));
-        File newZip = new File(System.getProperty("test.dir", "."),
-                               "input2.zip");
-        FileOutputStream fos = new FileOutputStream(newZip);
+        File newZip = new File(System.getProperty("test.dir", "."), "input2.zip");
+        Files.copy(Paths.get(System.getProperty("test.src", ""), "input.zip"),
+                   newZip.toPath(), StandardCopyOption.REPLACE_EXISTING);
 
-        byte[] buf = new byte[1024];
-        int n = 0;
-        while ((n = fis.read(buf)) != -1) {
-            fos.write(buf, 0, n);
+        // pad some bytes
+        try (OutputStream os = Files.newOutputStream(newZip.toPath(),
+                                                     StandardOpenOption.APPEND)) {
+            os.write(1); os.write(3); os.write(5); os.write(7);
         }
-        fis.close();
-        // pad some bytes
-        fos.write(1); fos.write(3); fos.write(5); fos.write(7);
-        fos.close();
-        try {
-            zf = new ZipFile(newZip);
-            ze = zf.getEntry("ReadZip.java");
+
+        try (ZipFile zf = new ZipFile(newZip)) {
+            ZipEntry ze = zf.getEntry("ReadZip.java");
             if (ze == null) {
                 throw new Exception("cannot read from zip file");
             }
         } finally {
-            zf.close();
             newZip.delete();
         }
 
         // Read zip file comment
         try {
+            try (FileOutputStream fos = new FileOutputStream(newZip);
+                 ZipOutputStream zos = new ZipOutputStream(fos))
+            {
+                ZipEntry ze = new ZipEntry("ZipEntry");
+                zos.putNextEntry(ze);
+                zos.write(1); zos.write(2); zos.write(3); zos.write(4);
+                zos.closeEntry();
+                zos.setComment("This is the comment for testing");
+            }
 
-            ZipOutputStream zos = new ZipOutputStream(
-                                      new FileOutputStream(newZip));
-            ze = new ZipEntry("ZipEntry");
-            zos.putNextEntry(ze);
-            zos.write(1); zos.write(2); zos.write(3); zos.write(4);
-            zos.closeEntry();
-            zos.setComment("This is the comment for testing");
-            zos.close();
-
-            zf = new ZipFile(newZip);
-            ze = zf.getEntry("ZipEntry");
-            if (ze == null)
-                throw new Exception("cannot read entry from zip file");
-            if (!"This is the comment for testing".equals(zf.getComment()))
-                throw new Exception("cannot read comment from zip file");
+            try (ZipFile zf = new ZipFile(newZip)) {
+                ZipEntry ze = zf.getEntry("ZipEntry");
+                if (ze == null)
+                    throw new Exception("cannot read entry from zip file");
+                if (!"This is the comment for testing".equals(zf.getComment()))
+                    throw new Exception("cannot read comment from zip file");
+            }
         } finally {
-            zf.close();
             newZip.delete();
         }
 
--- a/jdk/test/java/util/zip/ZipFile/ShortRead.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/ZipFile/ShortRead.java	Fri Mar 18 11:00:10 2011 -0700
@@ -38,27 +38,29 @@
         try {
             final String entryName = "abc";
             final String data = "Data disponible";
-            final ZipOutputStream zos =
-                new ZipOutputStream(new FileOutputStream(zFile));
-            zos.putNextEntry(new ZipEntry(entryName));
-            zos.write(data.getBytes("ASCII"));
-            zos.closeEntry();
-            zos.close();
+            try (FileOutputStream fos = new FileOutputStream(zFile);
+                 ZipOutputStream zos = new ZipOutputStream(fos))
+            {
+                zos.putNextEntry(new ZipEntry(entryName));
+                zos.write(data.getBytes("ASCII"));
+                zos.closeEntry();
+            }
 
-            final ZipFile zipFile = new ZipFile(zFile);
-            final ZipEntry zentry = zipFile.getEntry(entryName);
-            final InputStream inputStream = zipFile.getInputStream(zentry);
-            System.out.printf("size=%d csize=%d available=%d%n",
-                              zentry.getSize(),
-                              zentry.getCompressedSize(),
-                              inputStream.available());
-            byte[] buf = new byte[data.length()];
-            final int count = inputStream.read(buf);
-            if (! new String(buf, "ASCII").equals(data) ||
-                count != data.length())
-                throw new Exception("short read?");
-            zipFile.close();
+            try (ZipFile zipFile = new ZipFile(zFile)) {
+                final ZipEntry zentry = zipFile.getEntry(entryName);
+                final InputStream inputStream = zipFile.getInputStream(zentry);
+                System.out.printf("size=%d csize=%d available=%d%n",
+                                  zentry.getSize(),
+                                  zentry.getCompressedSize(),
+                                  inputStream.available());
+                byte[] buf = new byte[data.length()];
+                final int count = inputStream.read(buf);
+                if (! new String(buf, "ASCII").equals(data) ||
+                    count != data.length())
+                    throw new Exception("short read?");
+            }
+        } finally {
+            zFile.delete();
         }
-        finally { zFile.delete(); }
     }
 }
--- a/jdk/test/java/util/zip/zip.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/java/util/zip/zip.java	Fri Mar 18 11:00:10 2011 -0700
@@ -322,57 +322,57 @@
 
     void create(OutputStream out) throws IOException
     {
-        ZipOutputStream zos = new ZipOutputStream(out, cs);
-        if (flag0) {
-            zos.setMethod(ZipOutputStream.STORED);
+        try (ZipOutputStream zos = new ZipOutputStream(out, cs)) {
+            if (flag0) {
+                zos.setMethod(ZipOutputStream.STORED);
+            }
+            for (File file: entries) {
+                addFile(zos, file);
+            }
         }
-        for (File file: entries) {
-            addFile(zos, file);
-        }
-        zos.close();
     }
 
     boolean update(InputStream in, OutputStream out) throws IOException
     {
-        ZipInputStream zis = new ZipInputStream(in, cs);
-        ZipOutputStream zos = new ZipOutputStream(out, cs);
-        ZipEntry e = null;
-        byte[] buf = new byte[1024];
-        int n = 0;
-        boolean updateOk = true;
+        try (ZipInputStream zis = new ZipInputStream(in, cs);
+             ZipOutputStream zos = new ZipOutputStream(out, cs))
+        {
+            ZipEntry e = null;
+            byte[] buf = new byte[1024];
+            int n = 0;
+            boolean updateOk = true;
 
-        // put the old entries first, replace if necessary
-        while ((e = zis.getNextEntry()) != null) {
-            String name = e.getName();
-            if (!entryMap.containsKey(name)) { // copy the old stuff
-                // do our own compression
-                ZipEntry e2 = new ZipEntry(name);
-                e2.setMethod(e.getMethod());
-                e2.setTime(e.getTime());
-                e2.setComment(e.getComment());
-                e2.setExtra(e.getExtra());
-                if (e.getMethod() == ZipEntry.STORED) {
-                    e2.setSize(e.getSize());
-                    e2.setCrc(e.getCrc());
+            // put the old entries first, replace if necessary
+            while ((e = zis.getNextEntry()) != null) {
+                String name = e.getName();
+                if (!entryMap.containsKey(name)) { // copy the old stuff
+                    // do our own compression
+                    ZipEntry e2 = new ZipEntry(name);
+                    e2.setMethod(e.getMethod());
+                    e2.setTime(e.getTime());
+                    e2.setComment(e.getComment());
+                    e2.setExtra(e.getExtra());
+                    if (e.getMethod() == ZipEntry.STORED) {
+                        e2.setSize(e.getSize());
+                        e2.setCrc(e.getCrc());
+                    }
+                    zos.putNextEntry(e2);
+                    while ((n = zis.read(buf, 0, buf.length)) != -1) {
+                        zos.write(buf, 0, n);
+                    }
+                } else { // replace with the new files
+                    File f = entryMap.get(name);
+                    addFile(zos, f);
+                    entryMap.remove(name);
+                    entries.remove(f);
                 }
-                zos.putNextEntry(e2);
-                while ((n = zis.read(buf, 0, buf.length)) != -1) {
-                    zos.write(buf, 0, n);
-                }
-            } else { // replace with the new files
-                File f = entryMap.get(name);
+            }
+
+            // add the remaining new files
+            for (File f: entries) {
                 addFile(zos, f);
-                entryMap.remove(name);
-                entries.remove(f);
             }
         }
-
-        // add the remaining new files
-        for (File f: entries) {
-            addFile(zos, f);
-        }
-        zis.close();
-        zos.close();
         return updateOk;
     }
 
@@ -517,25 +517,25 @@
     }
 
     void extract(String fname, String files[]) throws IOException {
-        ZipFile zf = new ZipFile(fname, cs);
-        Set<ZipEntry> dirs = newDirSet();
-        Enumeration<? extends ZipEntry> zes = zf.entries();
-        while (zes.hasMoreElements()) {
-            ZipEntry e = zes.nextElement();
-            InputStream is;
-            if (files == null) {
-                dirs.add(extractFile(zf.getInputStream(e), e));
-            } else {
-                String name = e.getName();
-                for (String file : files) {
-                    if (name.startsWith(file)) {
-                        dirs.add(extractFile(zf.getInputStream(e), e));
-                        break;
+        try (ZipFile zf = new ZipFile(fname, cs)) {
+            Set<ZipEntry> dirs = newDirSet();
+            Enumeration<? extends ZipEntry> zes = zf.entries();
+            while (zes.hasMoreElements()) {
+                ZipEntry e = zes.nextElement();
+                InputStream is;
+                if (files == null) {
+                    dirs.add(extractFile(zf.getInputStream(e), e));
+                } else {
+                    String name = e.getName();
+                    for (String file : files) {
+                        if (name.startsWith(file)) {
+                            dirs.add(extractFile(zf.getInputStream(e), e));
+                            break;
+                        }
                     }
                 }
             }
         }
-        zf.close();
         updateLastModifiedTime(dirs);
     }
 
@@ -607,12 +607,12 @@
     }
 
     void list(String fname, String files[]) throws IOException {
-        ZipFile zf = new ZipFile(fname, cs);
-        Enumeration<? extends ZipEntry> zes = zf.entries();
-        while (zes.hasMoreElements()) {
-            printEntry(zes.nextElement(), files);
+        try (ZipFile zf = new ZipFile(fname, cs)) {
+            Enumeration<? extends ZipEntry> zes = zf.entries();
+            while (zes.hasMoreElements()) {
+                printEntry(zes.nextElement(), files);
+            }
         }
-        zf.close();
     }
 
     void printEntry(ZipEntry e, String[] files) throws IOException {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/midi/File/SMPTESequence.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,75 @@
+/**
+ * @test
+ * @bug 6835393
+ * @summary Tests that MidiFileReader correctly reads sequences with different division types
+ * @author Alex Menkov
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.Sequence;
+
+public class SMPTESequence {
+
+    static int failed = 0;
+
+    public static void main(String[] args) {
+        test(Sequence.PPQ);
+        test(Sequence.SMPTE_24);
+        test(Sequence.SMPTE_25);
+        test(Sequence.SMPTE_30);
+        test(Sequence.SMPTE_30DROP);
+
+        if (failed > 0) {
+            throw new RuntimeException("" + failed + " tests failed");
+        }
+    }
+
+    static boolean test(float divisionType) {
+        boolean result = false;
+        try {
+            log("Testing divisionType == " + divisionType);
+            Sequence sequence = new Sequence(divisionType, 16, 1);
+            float div1 = sequence.getDivisionType();
+
+            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+            MidiSystem.write(sequence, 1, outStream);
+
+            InputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
+
+            sequence = MidiSystem.getSequence(inStream);
+            float div2 = sequence.getDivisionType();
+
+            log("After write/read got divisionType == " + div2);
+            if (Math.abs(div2 - div1) < 0.001f) {
+                result = true;
+            }
+        } catch (InvalidMidiDataException ex) {
+            log(ex);
+        } catch (IOException ex) {
+            log(ex);
+        } catch (IllegalArgumentException ex) {
+            log(ex);
+        }
+        if (result) {
+            log("OK");
+        } else {
+            log("FAIL");
+            failed++;
+        }
+        return result;
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+    static void log(Exception ex) {
+        log("got exception (" + ex.getClass().getSimpleName() + "): " + ex.getMessage());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/midi/Sequencer/SequencerImplicitSynthOpen.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,110 @@
+/**
+ * @test
+ * @bug 6660470
+ * @summary Tests that sequencer correctly opens/closes (implicitly) devices
+ * @author Alex Menkov
+ */
+
+import java.util.List;
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiDeviceReceiver;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Receiver;
+import javax.sound.midi.Sequencer;
+import javax.sound.midi.Transmitter;
+
+public class SequencerImplicitSynthOpen {
+
+    static int TEST_COUNT   = 5;
+
+    public static void main(String[] args) {
+        try {
+            log("getting sequencer...");
+            Sequencer sequencer = MidiSystem.getSequencer();
+            log("  - got " + getDeviceStr(sequencer));
+
+            // obtain connected device (usually synthesizer)
+            MidiDevice synth = getConnectedDevice(sequencer);
+            if (synth == null) {
+                log("could not get connected device, returning");
+                return;
+            }
+
+            log("connected device: " + getDeviceStr(synth));
+
+            int success = 0;
+            for (int i=0; i<TEST_COUNT; i++) {
+                if (test(sequencer)) {
+                    success++;
+                }
+            }
+
+            if (success != TEST_COUNT) {
+                throw new RuntimeException("test FAILS");
+            }
+        } catch (MidiUnavailableException ex) {
+            // this is not a failure
+            log("Could not get Sequencer");
+        }
+        log("test PASSED.");
+    }
+
+    static boolean test(Sequencer sequencer) throws MidiUnavailableException {
+        log("");
+        log("opening sequencer...");
+        sequencer.open();   // opens connected synthesizer implicitly
+        MidiDevice synth = getConnectedDevice(sequencer);
+        log("  connected device: " + getDeviceStr(synth));
+
+        log("closing sequencer...");
+        sequencer.close();  // closes the synth implicitly
+        log("  synth is " + getDeviceStr(synth));
+        MidiDevice synth2 = getConnectedDevice(sequencer);
+        log("  currently connected device: " + getDeviceStr(synth2));
+
+        if (synth != null && synth.isOpen()) {
+            log("FAIL.");
+            return false;
+        }
+        log("OK.");
+        return true;
+    }
+
+    static MidiDevice getConnectedDevice(Sequencer sequencer) {
+        List<Transmitter> trans = sequencer.getTransmitters();
+        log("  sequencer has " + trans.size() + " opened transmitters:");
+        for (Transmitter tr: trans) {
+            Receiver r = tr.getReceiver();
+            log("    " + getClassStr(tr) + " connected to " + getClassStr(r));
+            if (r instanceof MidiDeviceReceiver) {
+                MidiDeviceReceiver recv = (MidiDeviceReceiver)r;
+                MidiDevice dev = recv.getMidiDevice();
+                log("      - receiver of " + getClassStr(dev));
+                return dev;
+            } else {
+                log("      - does NOT implement MidiDeviceReceiver");
+            }
+        }
+        return null;
+    }
+
+    static String getClassStr(Object o) {
+        if (o == null) {
+            return "<null>";
+        }
+        return o.getClass().getName();
+    }
+
+    static String getDeviceStr(MidiDevice dev) {
+        if (dev == null) {
+            return "NULL";
+        }
+        return getClassStr(dev) + ", " + (dev.isOpen() ? "OPENED" : "CLOSED");
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/Clip/ClipSetPos.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6801206
+ * @summary Tests that Clip sets frame position
+ * @author Alex Menkov
+ */
+
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.Clip;
+import javax.sound.sampled.LineUnavailableException;
+
+public class ClipSetPos {
+
+    final static AudioFormat audioFormat = new AudioFormat(44100f, 16, 2, true, true);
+    final static int frameLength = 44100 * 2; // 2 seconds
+    final static byte[] dataBuffer
+            = new byte[frameLength * (audioFormat.getSampleSizeInBits()/8)
+                       * audioFormat.getChannels()];
+    final static int MAX_FRAME_DELTA = 20;
+
+    public static void main(String[] args) {
+        boolean testPassed = true;
+        Clip clip = null;
+        try {
+            clip = AudioSystem.getClip();
+            clip.open(audioFormat, dataBuffer, 0, dataBuffer.length);
+        } catch (LineUnavailableException ex) {
+            log(ex);
+            log("Cannot test (this is not failure)");
+            return;
+        }
+
+        log("clip: " + clip.getClass().getName());
+
+        int len = clip.getFrameLength();
+        for (int pos=0; pos < len; pos += (len /100)) {
+            clip.setFramePosition(pos);
+            int curPos = clip.getFramePosition();
+            if (Math.abs(pos - curPos) > MAX_FRAME_DELTA) {
+                log("Tried to set pos to " + pos + ", but got back " + curPos);
+                testPassed = false;
+            } else {
+                log("Sucessfully set pos to " + pos);
+            }
+        }
+        clip.close();
+
+        if (testPassed) {
+            log("Test PASSED.");
+        } else {
+            log("Test FAILED.");
+            throw new RuntimeException("Test FAILED (see log)");
+        }
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+    static void log(Exception ex) {
+        ex.printStackTrace(System.out);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/FileWriter/AlawEncoderSync.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,113 @@
+/**
+ * @test
+ * @bug 6938426
+ * @summary Tests that Alaw encoder works properly in multithreaded environment
+ * @author Alex Menkov
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.Arrays;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+
+public class AlawEncoderSync {
+
+    static final int THREAD_COUNT   = 20;
+
+    static final AudioFormat pcmFormat = new AudioFormat(8000f, 16, 2, true, false);
+    static final int STREAM_LENGTH = 10;    // in seconds
+    static byte[] pcmBuffer;
+    static final AudioFormat alawFormat
+            = new AudioFormat(AudioFormat.Encoding.ALAW, 8000f, 8, 2, 2, 8000f, false);
+
+    static final ConversionThread[] threads = new ConversionThread[THREAD_COUNT];
+
+    public static void main(String[] args) {
+        preparePCMBuffer();
+        log("pcmStream size: " + pcmBuffer.length);
+
+        for (int i=0; i<THREAD_COUNT; i++) {
+            threads[i] = new ConversionThread(i);
+            threads[i].start();
+        }
+
+        for (int i=1; i<THREAD_COUNT; i++) {
+            try {
+                threads[i].join();
+            } catch (InterruptedException ex) {
+                log("Main thread was interrupted, exiting.");
+                return;
+            }
+        }
+
+        int failed = 0;
+        log("comparing result arrays...");
+        for (int i=1; i<THREAD_COUNT; i++) {
+            if (!Arrays.equals(threads[0].resultArray, threads[i].resultArray)) {
+                failed++;
+                log("NOT equals: 0 and " + i);
+            }
+        }
+        if (failed > 0) {
+            throw new RuntimeException("test FAILED");
+        }
+        log("test PASSED.");
+    }
+
+
+    static void preparePCMBuffer() {
+        pcmBuffer = new byte[STREAM_LENGTH * (int)pcmFormat.getSampleRate()
+                * (pcmFormat.getSampleSizeInBits() / 8) * pcmFormat.getChannels()];
+        for (int i=0; i<pcmBuffer.length; i++) {
+            pcmBuffer[i] = (byte)(Math.random() * 256.0 - 128.0);
+        }
+    }
+
+    static AudioInputStream createPCMStream() {
+        InputStream byteStream = new ByteArrayInputStream(pcmBuffer);
+        return new AudioInputStream(byteStream, pcmFormat, AudioSystem.NOT_SPECIFIED);
+    }
+
+    static class ConversionThread extends Thread {
+        public final int num;
+        public byte[] resultArray = null;
+        public ConversionThread(int num) {
+            this.num = num;
+        }
+        @Override
+        public void run() {
+            log("ConversionThread[" + num + "] started.");
+            try {
+                InputStream inStream = new ByteArrayInputStream(pcmBuffer);
+
+                AudioInputStream pcmStream = new AudioInputStream(
+                        inStream, pcmFormat, AudioSystem.NOT_SPECIFIED);
+                AudioInputStream alawStream = AudioSystem.getAudioInputStream(alawFormat, pcmStream);
+
+                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+                int read = 0;
+                byte[] data = new byte[4096];
+                while((read = alawStream.read(data)) != -1) {
+                    outStream.write(data, 0, read);
+               }
+               alawStream.close();
+               resultArray = outStream.toByteArray();
+            } catch (Exception ex) {
+                log("ConversionThread[" + num + "] exception:");
+                log(ex);
+            }
+            log("ConversionThread[" + num + "] completed.");
+        }
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+    static void log(Exception ex) {
+        ex.printStackTrace(System.out);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/FileWriter/WriterCloseInput.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,127 @@
+/**
+ * @test
+ * @bug 7013521
+ * @summary AIFF/AU/WAVE writers close input audio stream
+ * @author Alex Menkov
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+
+
+public class WriterCloseInput {
+
+    final static AudioFormat audioFormat = new AudioFormat(44100f, 16, 2, true, true);
+    //final static AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.ULAW, 44100f, 8, 2, 2, 44100f, true);
+    final static int frameLength = 44100 * 2; // 2 seconds
+    final static byte[] dataBuffer
+            = new byte[frameLength * (audioFormat.getSampleSizeInBits()/8)
+                       * audioFormat.getChannels()];
+
+    static int testTotal = 0;
+    static int testFailed = 0;
+
+    public static void main(String[] args) throws Exception {
+        test(AudioFileFormat.Type.AIFF);
+        test(AudioFileFormat.Type.AU);
+        test(AudioFileFormat.Type.WAVE);
+
+        if (testFailed == 0) {
+            out("All tests passed.");
+        } else {
+            out("" + testFailed + " of " + testTotal + " tests FAILED.");
+            System.out.flush();
+            throw new RuntimeException("Test FAILED.");
+        }
+    }
+
+    static void test(AudioFileFormat.Type fileType) {
+        test(fileType, frameLength);
+        test(fileType, AudioSystem.NOT_SPECIFIED);
+    }
+
+    static void test(AudioFileFormat.Type fileType, int length) {
+        test(fileType, length, false);
+        test(fileType, length, true);
+    }
+
+    static void test(AudioFileFormat.Type fileType, int length, boolean isFile) {
+        testTotal++;
+        out("Testing fileType: " + fileType
+                + ", frameLength: " + (length >= 0 ? length : "unspecified")
+                + ", output: " + (isFile ? "File" : "OutputStream"));
+        AudioInputStream inStream = new ThrowAfterCloseStream(
+                new ByteArrayInputStream(dataBuffer), audioFormat, length);
+
+        AudioSystem.isFileTypeSupported(fileType, inStream);
+
+        try {
+            if (isFile) {
+                File f = File.createTempFile("WriterCloseInput" + testTotal, "tmp");
+                AudioSystem.write(inStream, fileType, f);
+                f.delete();
+            } else {
+                OutputStream outStream = new NullOutputStream();
+                AudioSystem.write(inStream, fileType, outStream);
+            }
+        } catch (Exception ex) {
+            // this is not failure
+            out("SKIPPED (AudioSystem.write exception): " + ex.getMessage());
+            //out(ex);
+            inStream = null;
+        }
+
+        if (inStream != null) {
+            try {
+                // test if the stream is closed
+                inStream.available();
+                out("PASSED");
+            } catch (IOException ex) {
+                testFailed++;
+                out("FAILED: " + ex.getMessage());
+                //out(ex);
+            }
+        }
+        out("");
+    }
+
+    static class ThrowAfterCloseStream extends AudioInputStream {
+        private boolean closed = false;
+        public ThrowAfterCloseStream(InputStream in, AudioFormat format, long length) {
+            super(in, format, length);
+        }
+        @Override
+        public void close() {
+            closed = true;
+        }
+        @Override
+        public int available() throws IOException {
+            if (closed) {
+                throw new IOException("The stream has been closed");
+            }
+            return 1;
+        }
+    }
+
+    static class NullOutputStream extends OutputStream {
+        @Override
+        public void write(int b) throws IOException {
+            // nop
+        }
+    }
+
+    static void out(String s) {
+        System.out.println(s);
+    }
+
+    static void out(Exception ex) {
+        ex.printStackTrace(System.out);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/regtesthelpers/Util.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 java.awt.*;
+import java.awt.image.BufferedImage;
+
+/**
+ * <p>This class contains utilities useful for regression testing.
+ * <p>When using jtreg you would include this class via something like:
+ * <pre>
+ *
+ * @library ../../regtesthelpers
+ * @build Util
+ * </pre>
+ */
+
+public class Util {
+    /**
+     * Convert a rectangle from coordinate system of Component c to
+     * screen coordinate system.
+     *
+     * @param r a non-null Rectangle
+     * @param c a Component whose coordinate system is used for conversion
+     */
+    public static void convertRectToScreen(Rectangle r, Component c) {
+        Point p = new Point(r.x, r.y);
+        SwingUtilities.convertPointToScreen(p, c);
+        r.x = p.x;
+        r.y = p.y;
+    }
+
+    /**
+     * Compares two bufferedImages pixel-by-pixel.
+     * return true if all pixels in the two areas are identical
+     */
+    public static boolean compareBufferedImages(BufferedImage bufferedImage0, BufferedImage bufferedImage1) {
+        int width = bufferedImage0.getWidth();
+        int height = bufferedImage0.getHeight();
+
+        if (width != bufferedImage1.getWidth() || height != bufferedImage1.getHeight()) {
+            return false;
+        }
+
+        for (int y = 0; y < height; y++) {
+            for (int x = 0; x < width; x++) {
+                if (bufferedImage0.getRGB(x, y) != bufferedImage1.getRGB(x, y)) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6796710
+ * @summary Html content in JEditorPane is overlapping on swing components while resizing the application.
+ * @library ../../../regtesthelpers
+ * @build Util
+ * @author Pavel Porvatov
+   @run main bug6796710
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+public class bug6796710 {
+    // The page is inlined because we want to be sure that the JEditorPane filled synchronously
+    public static final String TEXT = "<html>" +
+            "<body>" +
+            "<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">" +
+            "    <tbody>" +
+            "        <tr>" +
+            "            <td>Col1</td>" +
+            "            <td>Col2</td>" +
+            "            <td>Col3</td>" +
+            "        </tr>" +
+            "        <tr>" +
+            "            <td>1. It's a regression from CR 4419748. The problem is in the CSSBorder#paintBorder, which ignores clip area while painting.</td>" +
+            "            <td>2. It's a regression from CR 4419748. The problem is in the CSSBorder#paintBorder, which ignores clip area while painting.</td>" +
+            "            <td>3. It's a regression from CR 4419748. The problem is in the CSSBorder#paintBorder, which ignores clip area while painting.</td>" +
+            "        </tr>" +
+            "    </tbody>" +
+            "</table>" +
+            "</body>" +
+            "</html>";
+
+    private static Robot robot;
+
+    private static JFrame frame;
+
+    private static JPanel pnBottom;
+
+    public static void main(String[] args) throws Exception {
+        robot = new Robot();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+
+                pnBottom = new JPanel();
+                pnBottom.add(new JLabel("Some label"));
+                pnBottom.add(new JButton("A button"));
+
+                JEditorPane editorPane = new JEditorPane();
+
+                editorPane.setContentType("text/html");
+                editorPane.setText(TEXT);
+                editorPane.setEditable(false);
+
+                JPanel pnContent = new JPanel(new BorderLayout());
+
+                pnContent.add(new JScrollPane(editorPane), BorderLayout.CENTER);
+                pnContent.add(pnBottom, BorderLayout.SOUTH);
+
+                frame.setContentPane(pnContent);
+                frame.setSize(400, 600);
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.setVisible(true);
+            }
+        });
+
+        robot.waitForIdle();
+
+        BufferedImage bufferedImage = getPnBottomImage();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.setSize(400, 150);
+            }
+        });
+
+        robot.waitForIdle();
+
+        if (!Util.compareBufferedImages(bufferedImage, getPnBottomImage())) {
+            throw new RuntimeException("The test failed");
+        }
+
+        System.out.println("The test bug6796710 passed.");
+    }
+
+    private static BufferedImage getPnBottomImage() {
+        Rectangle rect = pnBottom.getBounds();
+
+        Util.convertRectToScreen(rect, pnBottom.getParent());
+
+        return robot.createScreenCapture(rect);
+    }
+}
--- a/jdk/test/sun/misc/BootClassLoaderHook/TestHook.java	Wed Mar 16 17:21:52 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.util.TreeSet;
-import java.util.Set;
-import java.net.URLStreamHandlerFactory;
-import sun.misc.BootClassLoaderHook;
-import sun.misc.URLClassPath;
-
-
-/* @test
- * @bug     6888802
- * @summary Sanity test of BootClassLoaderHook interface
- *
- * @build TestHook
- * @run main TestHook
- */
-
-public class TestHook extends BootClassLoaderHook {
-
-    private static final TestHook hook = new TestHook();
-    private static Set<String> names = new TreeSet<String>();
-    private static final String LOGRECORD_CLASS =
-        "java.util.logging.LogRecord";
-    private static final String NONEXIST_RESOURCE =
-        "non.exist.resource";
-    private static final String LIBHELLO = "hello";
-
-    public static void main(String[] args) throws Exception {
-        BootClassLoaderHook.setHook(hook);
-        if (BootClassLoaderHook.getHook() == null) {
-           throw new RuntimeException("Null boot classloader hook ");
-        }
-
-        testHook();
-
-        if (!names.contains(LOGRECORD_CLASS)) {
-           throw new RuntimeException("loadBootstrapClass for " + LOGRECORD_CLASS + " not called");
-        }
-
-        if (!names.contains(NONEXIST_RESOURCE)) {
-           throw new RuntimeException("getBootstrapResource for " + NONEXIST_RESOURCE + " not called");
-        }
-        if (!names.contains(LIBHELLO)) {
-           throw new RuntimeException("loadLibrary for " + LIBHELLO + " not called");
-        }
-
-        Set<String> copy = new TreeSet<String>();
-        copy.addAll(names);
-        for (String s : copy) {
-            System.out.println("  Loaded " + s);
-        }
-    }
-
-    private static void testHook() throws Exception {
-        Class.forName(LOGRECORD_CLASS);
-        ClassLoader.getSystemResource(NONEXIST_RESOURCE);
-        try {
-          System.loadLibrary(LIBHELLO);
-        } catch (UnsatisfiedLinkError e) {
-        }
-    }
-
-    public String loadBootstrapClass(String className) {
-        names.add(className);
-        return null;
-    }
-
-    public String getBootstrapResource(String resourceName) {
-        names.add(resourceName);
-        return null;
-    }
-
-    public boolean loadLibrary(String libname) {
-        names.add(libname);
-        return false;
-    }
-
-    public URLClassPath getBootstrapClassPath(URLClassPath bcp,
-            URLStreamHandlerFactory factory) {
-        return bcp;
-    }
-
-    public boolean isCurrentThreadPrefetching() {
-        return false;
-    }
-
-    public boolean prefetchFile(String name) {
-        return false;
-    }
-}
--- a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 4898468
+ * @bug 4898468 6994008
  * @summary basic test for RSA cipher
  * @author Andreas Sterbenz
  * @library ..
@@ -38,9 +38,12 @@
 
 public class TestRSACipher extends PKCS11Test {
 
+    private static final String[] RSA_ALGOS =
+        { "RSA/ECB/PKCS1Padding", "RSA" };
+
     public void main(Provider p) throws Exception {
         try {
-            Cipher.getInstance("RSA/ECB/PKCS1Padding", p);
+            Cipher.getInstance(RSA_ALGOS[0], p);
         } catch (GeneralSecurityException e) {
             System.out.println("Not supported by provider, skipping");
             return;
@@ -55,57 +58,58 @@
         b = new byte[16];
         random.nextBytes(b);
 
-        Cipher c1 = Cipher.getInstance("RSA/ECB/PKCS1Padding", p);
-        Cipher c2 = Cipher.getInstance("RSA/ECB/PKCS1Padding", "SunJCE");
+        for (String rsaAlgo: RSA_ALGOS) {
+            Cipher c1 = Cipher.getInstance(rsaAlgo, p);
+            Cipher c2 = Cipher.getInstance(rsaAlgo, "SunJCE");
 
-        c1.init(Cipher.ENCRYPT_MODE, publicKey);
-        e = c1.doFinal(b);
-        c1.init(Cipher.DECRYPT_MODE, privateKey);
-        d = c1.doFinal(e);
-        match(b, d);
-        c2.init(Cipher.DECRYPT_MODE, privateKey);
-        d = c2.doFinal(e);
-        match(b, d);
+            c1.init(Cipher.ENCRYPT_MODE, publicKey);
+            e = c1.doFinal(b);
+            c1.init(Cipher.DECRYPT_MODE, privateKey);
+            d = c1.doFinal(e);
+            match(b, d);
+            c2.init(Cipher.DECRYPT_MODE, privateKey);
+            d = c2.doFinal(e);
+            match(b, d);
 
-        // invalid data
-        c1.init(Cipher.DECRYPT_MODE, publicKey);
-        try {
-            d = c1.doFinal(e);
-            throw new Exception("completed call");
-        } catch (BadPaddingException ee) {
-            ee.printStackTrace();
-        }
+            // invalid data
+            c1.init(Cipher.DECRYPT_MODE, publicKey);
+            try {
+                d = c1.doFinal(e);
+                throw new Exception("completed call");
+            } catch (BadPaddingException ee) {
+                ee.printStackTrace();
+            }
 
-        c1.init(Cipher.ENCRYPT_MODE, privateKey);
-        e = c1.doFinal(b);
-        c1.init(Cipher.DECRYPT_MODE, publicKey);
-        d = c1.doFinal(e);
-        match(b, d);
-        c2.init(Cipher.DECRYPT_MODE, publicKey);
-        d = c2.doFinal(e);
-        match(b, d);
+            c1.init(Cipher.ENCRYPT_MODE, privateKey);
+            e = c1.doFinal(b);
+            c1.init(Cipher.DECRYPT_MODE, publicKey);
+            d = c1.doFinal(e);
+            match(b, d);
+            c2.init(Cipher.DECRYPT_MODE, publicKey);
+            d = c2.doFinal(e);
+            match(b, d);
 
-        // reinit tests
-        c1.init(Cipher.ENCRYPT_MODE, privateKey);
-        c1.init(Cipher.ENCRYPT_MODE, privateKey);
-        e = c1.doFinal(b);
-        e = c1.doFinal(b);
-        c1.update(b);
-        c1.update(b);
-        c1.init(Cipher.ENCRYPT_MODE, privateKey);
-        e = c1.doFinal();
-        e = c1.doFinal();
-        c1.update(b);
-        e = c1.doFinal();
+            // reinit tests
+            c1.init(Cipher.ENCRYPT_MODE, privateKey);
+            c1.init(Cipher.ENCRYPT_MODE, privateKey);
+            e = c1.doFinal(b);
+            e = c1.doFinal(b);
+            c1.update(b);
+            c1.update(b);
+            c1.init(Cipher.ENCRYPT_MODE, privateKey);
+            e = c1.doFinal();
+            e = c1.doFinal();
+            c1.update(b);
+            e = c1.doFinal();
 
-        c1.update(new byte[256]);
-        try {
-            e = c1.doFinal();
-            throw new Exception("completed call");
-        } catch (IllegalBlockSizeException ee) {
-            System.out.println(ee);
+            c1.update(new byte[256]);
+            try {
+                e = c1.doFinal();
+                throw new Exception("completed call");
+            } catch (IllegalBlockSizeException ee) {
+                System.out.println(ee);
+            }
         }
-
     }
 
     private static void match(byte[] b1, byte[] b2) throws Exception {
--- a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 6572331
+ * @bug 6572331 6994008
  * @summary basic test for RSA cipher key wrapping functionality
  * @author Valerie Peng
  * @library ..
@@ -38,47 +38,48 @@
 
 public class TestRSACipherWrap extends PKCS11Test {
 
-    private static final String RSA_ALGO = "RSA/ECB/PKCS1Padding";
+    private static final String[] RSA_ALGOS =
+        { "RSA/ECB/PKCS1Padding", "RSA" };
 
     public void main(Provider p) throws Exception {
         try {
-            Cipher.getInstance(RSA_ALGO, p);
+            Cipher.getInstance(RSA_ALGOS[0], p);
         } catch (GeneralSecurityException e) {
-            System.out.println("Not supported by provider, skipping");
+            System.out.println(RSA_ALGOS[0] + " unsupported, skipping");
             return;
         }
         KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
         kpg.initialize(1024);
         KeyPair kp = kpg.generateKeyPair();
-        PublicKey publicKey = kp.getPublic();
-        PrivateKey privateKey = kp.getPrivate();
 
-        Cipher cipherPKCS11 = Cipher.getInstance(RSA_ALGO, p);
-        Cipher cipherJce = Cipher.getInstance(RSA_ALGO, "SunJCE");
+        for (String rsaAlgo: RSA_ALGOS) {
+            Cipher cipherPKCS11 = Cipher.getInstance(rsaAlgo, p);
+            Cipher cipherJce = Cipher.getInstance(rsaAlgo, "SunJCE");
 
-        String algos[] = {"AES", "RC2", "Blowfish"};
-        int keySizes[] = {128, 256};
+            String algos[] = {"AES", "RC2", "Blowfish"};
+            int keySizes[] = {128, 256};
 
-        for (int j = 0; j < algos.length; j++) {
-            String algorithm = algos[j];
-            KeyGenerator keygen =
+            for (int j = 0; j < algos.length; j++) {
+                String algorithm = algos[j];
+                KeyGenerator keygen =
                     KeyGenerator.getInstance(algorithm);
 
-            for (int i = 0; i < keySizes.length; i++) {
-                SecretKey secretKey = null;
-                System.out.print("Generate " + keySizes[i] + "-bit " +
+                for (int i = 0; i < keySizes.length; i++) {
+                    SecretKey secretKey = null;
+                    System.out.print("Generate " + keySizes[i] + "-bit " +
                         algorithm + " key using ");
-                try {
-                    keygen.init(keySizes[i]);
-                    secretKey = keygen.generateKey();
-                    System.out.println(keygen.getProvider().getName());
-                } catch (InvalidParameterException ipe) {
-                    secretKey = new SecretKeySpec(new byte[32], algorithm);
-                    System.out.println("SecretKeySpec class");
+                    try {
+                        keygen.init(keySizes[i]);
+                        secretKey = keygen.generateKey();
+                        System.out.println(keygen.getProvider().getName());
+                    } catch (InvalidParameterException ipe) {
+                        secretKey = new SecretKeySpec(new byte[32], algorithm);
+                        System.out.println("SecretKeySpec class");
+                    }
+                    test(kp, secretKey, cipherPKCS11, cipherJce);
+                    test(kp, secretKey, cipherPKCS11, cipherPKCS11);
+                    test(kp, secretKey, cipherJce, cipherPKCS11);
                 }
-                test(kp, secretKey, cipherPKCS11, cipherJce);
-                test(kp, secretKey, cipherPKCS11, cipherPKCS11);
-                test(kp, secretKey, cipherJce, cipherPKCS11);
             }
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java	Fri Mar 18 11:00:10 2011 -0700
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6994008
+ * @summary basic test for RSA/ECB/NoPadding cipher
+ * @author Valerie Peng
+ * @library ..
+ */
+
+import javax.crypto.*;
+import java.io.*;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.*;
+import java.util.*;
+
+public class TestRawRSACipher extends PKCS11Test {
+
+    public void main(Provider p) throws Exception {
+        try {
+            Cipher.getInstance("RSA/ECB/NoPadding", p);
+        } catch (GeneralSecurityException e) {
+            System.out.println("Not supported by provider, skipping");
+            return;
+        }
+
+        final int KEY_LEN = 1024;
+        KeyPairGenerator kpGen = KeyPairGenerator.getInstance("RSA", p);
+        kpGen.initialize(KEY_LEN);
+        KeyPair kp = kpGen.generateKeyPair();
+        Random random = new Random();
+        byte[] plainText, cipherText, recoveredText;
+        plainText = new byte[KEY_LEN/8];
+        random.nextBytes(plainText);
+        plainText[0] = 0; // to ensure that it's less than modulus
+
+        Cipher c1 = Cipher.getInstance("RSA/ECB/NoPadding", p);
+        Cipher c2 = Cipher.getInstance("RSA/ECB/NoPadding", "SunJCE");
+
+        c1.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+        c2.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+
+        cipherText = c1.doFinal(plainText);
+        recoveredText = c2.doFinal(cipherText);
+        if (!Arrays.equals(plainText, recoveredText)) {
+            throw new RuntimeException("E/D Test against SunJCE Failed!");
+        }
+
+        c2.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+        c1.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+        cipherText = c2.doFinal(plainText);
+        recoveredText = c1.doFinal(cipherText);
+        if (!Arrays.equals(plainText, recoveredText)) {
+            throw new RuntimeException("D/E Test against SunJCE Failed!");
+        }
+
+        System.out.println("Test Passed");
+    }
+
+    public static void main(String[] args) throws Exception {
+        main(new TestRawRSACipher());
+    }
+}
--- a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 %I% %E%
- * @bug 4898461
+ * @bug 4898461 6604496
  * @summary basic test for symmetric ciphers with padding
  * @author Valerie Peng
  * @library ..
@@ -70,9 +70,13 @@
         new CI("DES/ECB/PKCS5Padding", "DES", 6400),
         new CI("DESede/ECB/PKCS5Padding", "DESede", 400),
         new CI("AES/ECB/PKCS5Padding", "AES", 64),
+
         new CI("DES", "DES", 6400),
         new CI("DESede", "DESede", 408),
-        new CI("AES", "AES", 128)
+        new CI("AES", "AES", 128),
+
+        new CI("AES/CTR/NoPadding", "AES", 3200)
+
     };
     private static StringBuffer debugBuf = new StringBuffer();
 
--- a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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 4898484
+ * @bug 4898484 6604496
  * @summary basic test for symmetric ciphers with no padding
  * @author Valerie Peng
  * @library ..
@@ -59,7 +59,8 @@
         new CI("DES/CBC/NoPadding", "DES", 400),
         new CI("DESede/CBC/NoPadding", "DESede", 160),
         new CI("AES/CBC/NoPadding", "AES", 4800),
-        new CI("Blowfish/CBC/NoPadding", "Blowfish", 24)
+        new CI("Blowfish/CBC/NoPadding", "Blowfish", 24),
+        new CI("AES/CTR/NoPadding", "AES", 1600)
     };
 
     private static StringBuffer debugBuf;
--- a/jdk/test/sun/security/tools/jarsigner/crl.sh	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/security/tools/jarsigner/crl.sh	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
 # 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,9 +32,6 @@
 fi
 
 # set platform-dependent variables
-# PF: platform name, say, solaris-sparc
-
-PF=""
 
 OS=`uname -s`
 case "$OS" in
@@ -47,54 +44,28 @@
 esac
 
 KS=crl.jks
-JFILE=crl.jar
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
-rm $KS $JFILE 2> /dev/null
+rm $KS 2> /dev/null
 
-# Generates some crl files, each containing two entries
+# Test keytool -gencrl
 
 $KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300
-$KT -alias a -gencrl -id 1:1 -id 2:2 -file crl1
-$KT -alias a -gencrl -id 3:3 -id 4:4 -file crl2
-$KT -alias b -dname CN=b -keyalg rsa -genkey -validity 300
-$KT -alias b -gencrl -id 5:1 -id 6:2 -file crl3
+$KT -alias a -gencrl -id 1:1 -id 2:2 -file crl1 || exit 1
+$KT -alias a -gencrl -id 3:3 -id 4:4 -file crl2 || exit 2
+$KT -alias a -gencrl -id 5:1 -id 6:2 -file crl3 || exit 4
 
-cat > ToURI.java <<EOF
-class ToURI {
-    public static void main(String[] args) throws Exception {
-        System.out.println(new java.io.File("crl1").toURI());
-    }
-}
-EOF
-$TESTJAVA${FS}bin${FS}javac ToURI.java
-$TESTJAVA${FS}bin${FS}java ToURI > uri
-$KT -alias c -dname CN=c -keyalg rsa -genkey -validity 300 \
-    -ext crl=uri:`cat uri`
-
-echo A > A
+# Test keytool -printcrl
 
-# Test -crl:auto, cRLDistributionPoints is a local file
+$KT -printcrl -file crl1 || exit 5
+$KT -printcrl -file crl2 || exit 6
+$KT -printcrl -file crl3 || exit 7
 
-$JAR cvf $JFILE A
-$JARSIGNER -keystore $KS -storepass changeit $JFILE c \
-        -crl:auto || exit 1
-$JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 6
-$KT -printcert -jarfile $JFILE | grep CRLs || exit 7
-
-# Test -crl <file>
 
-$JAR cvf $JFILE A
-$JARSIGNER -keystore $KS -storepass changeit $JFILE a \
-        -crl crl1 -crl crl2 || exit 2
-$JARSIGNER -keystore $KS -storepass changeit $JFILE b \
-        -crl crl3 -crl crl2 || exit 3
-$JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 3
-$KT -printcert -jarfile $JFILE | grep CRLs || exit 4
-CRLCOUNT=`$KT -printcert -jarfile $JFILE | grep SerialNumber | wc -l`
-if [ $CRLCOUNT != 8 ]; then exit 5; fi
+# Test keytool -ext crl
+
+$KT -alias b -dname CN=c -keyalg rsa -genkey -validity 300 \
+    -ext crl=uri:http://www.example.com/crl || exit 10
 
 exit 0
--- a/jdk/test/sun/security/tools/keytool/NewSize7.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/security/tools/keytool/NewSize7.java	Fri Mar 18 11:00:10 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.security.KeyStore;
 import java.security.cert.X509Certificate;
 import java.security.interfaces.RSAPublicKey;
@@ -42,8 +44,10 @@
                 " -alias a -dname cn=c -storepass changeit" +
                 " -keypass changeit -keyalg rsa").split(" "));
         KeyStore ks = KeyStore.getInstance("JKS");
-        ks.load(new FileInputStream(FILE), null);
-        new File(FILE).delete();
+        try (FileInputStream fin = new FileInputStream(FILE)) {
+            ks.load(fin, null);
+        }
+        Files.delete(Paths.get(FILE));
         RSAPublicKey r = (RSAPublicKey)ks.getCertificate("a").getPublicKey();
         if (r.getModulus().bitLength() != 2048) {
             throw new Exception("Bad keysize");
--- a/jdk/test/sun/text/resources/LocaleData	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/text/resources/LocaleData	Fri Mar 18 11:00:10 2011 -0700
@@ -6101,3 +6101,258 @@
 
 # bug 6919624
 CalendarData/hu/minimalDaysInFirstWeek=4
+
+# bug 6998391
+CalendarData/sr-Latn/firstDayOfWeek=2
+CalendarData/sr-Latn-BA/firstDayOfWeek=2
+CalendarData/sr-Latn-ME/firstDayOfWeek=2
+CalendarData/sr-Latn-RS/firstDayOfWeek=2
+#
+CalendarData/sr-Latn/minimalDaysInFirstWeek=1
+CalendarData/sr-Latn-BA/minimalDaysInFirstWeek=4
+CalendarData/sr-Latn-ME/minimalDaysInFirstWeek=4
+CalendarData/sr-Latn-RS/minimalDaysInFirstWeek=4
+#
+LocaleNames/sr-Latn/SR=Surinam
+LocaleNames/sr-Latn-BA/SR=Surinam
+LocaleNames/sr-Latn-ME/SR=Surinam
+LocaleNames/sr-Latn-RS/SR=Surinam
+#
+FormatData/sr-Latn/MonthNames/2=mart
+FormatData/sr-Latn-BA/MonthNames/4=maj
+FormatData/sr-Latn-ME/MonthNames/7=avgust
+FormatData/sr-Latn-RS/MonthNames/8=septembar
+#
+FormatData/sr-Latn/DayNames/1=ponedeljak
+FormatData/sr-Latn-BA/DayNames/2=utorak
+FormatData/sr-Latn-ME/DayNames/3=sreda
+FormatData/sr-Latn-RS/DayNames/4=\u010detvrtak
+#
+FormatData/sr-Latn/DayAbbreviations/1=pon
+FormatData/sr-Latn-BA/DayAbbreviations/2=uto
+FormatData/sr-Latn-ME/DayAbbreviations/3=sre
+FormatData/sr-Latn-RS/DayAbbreviations/4=\u010det
+#
+CurrencyNames/sr-Latn/EUR=EUR
+CurrencyNames/sr-Latn-BA/EUR=\u20ac
+CurrencyNames/sr-Latn-BA/BAM=KM
+CurrencyNames/sr-Latn-ME/EUR=\u20ac
+CurrencyNames/sr-Latn-RS/EUR=EUR
+#
+FormatData/sr-Latn/DateTimePatterns/1=HH.mm.ss z
+FormatData/sr-Latn-BA/DateTimePatterns/2=HH.mm.ss
+FormatData/sr-Latn-ME/DateTimePatterns/5=d.MM.yyyy.
+FormatData/sr-Latn-RS/DateTimePatterns/5=dd. MMMM y.
+
+# bug 7019267
+CurrencyNames/pt/adp=Peseta de Andorra
+CurrencyNames/pt/aed=Dir\u00e9m dos Emirados \u00c1rabes Unidos
+CurrencyNames/pt/afa=Afegane (1927-2002)
+CurrencyNames/pt/afn=Afegane
+CurrencyNames/pt/all=Lek Alban\u00eas
+CurrencyNames/pt/amd=Dram arm\u00eanio
+CurrencyNames/pt/ang=Guilder das Antilhas Holandesas
+CurrencyNames/pt/aoa=Cuanza angolano
+CurrencyNames/pt/ars=Peso argentino
+CurrencyNames/pt/ats=Xelim austr\u00edaco
+CurrencyNames/pt/aud=D\u00f3lar australiano
+CurrencyNames/pt/awg=Guilder de Aruba
+CurrencyNames/pt/azm=Manat azerbaijano
+CurrencyNames/pt/azn=Manat do Azerbaij\u00e3o
+CurrencyNames/pt/bam=Marco b\u00f3snio-herzegovino convers\u00edvel
+CurrencyNames/pt/bbd=D\u00f3lar de Barbados
+CurrencyNames/pt/bdt=Taka de Bangladesh
+CurrencyNames/pt/bef=Franco belga
+CurrencyNames/pt/bgl=Lev forte b\u00falgaro
+CurrencyNames/pt/bgn=Lev novo b\u00falgaro
+CurrencyNames/pt/bhd=Dinar bareinita
+CurrencyNames/pt/bif=Franco do Burundi
+CurrencyNames/pt/bmd=D\u00f3lar das Bermudas
+CurrencyNames/pt/bnd=D\u00f3lar do Brunei
+CurrencyNames/pt/bov=Mvdol boliviano
+CurrencyNames/pt/brl=Real brasileiro
+CurrencyNames/pt/bsd=D\u00f3lar das Bahamas
+CurrencyNames/pt/btn=Ngultrum do But\u00e3o
+CurrencyNames/pt/bwp=Pula botsuanesa
+CurrencyNames/pt/byb=Rublo novo bielo-russo (1994-1999)
+CurrencyNames/pt/byr=Rublo bielo-russo
+CurrencyNames/pt/bzd=D\u00f3lar do Belize
+CurrencyNames/pt/cad=D\u00f3lar canadense
+CurrencyNames/pt/cdf=Franco congol\u00eas
+CurrencyNames/pt/chf=Franco su\u00ed\u00e7o
+CurrencyNames/pt/clf=Unidades de Fomento chilenas
+CurrencyNames/pt/clp=Peso chileno
+CurrencyNames/pt/cny=Yuan Renminbi chin\u00eas
+CurrencyNames/pt/cop=Peso colombiano
+CurrencyNames/pt/crc=Colon da Costa Rica
+CurrencyNames/pt/csd=Dinar s\u00e9rvio antigo
+CurrencyNames/pt/cup=Peso cubano
+CurrencyNames/pt/cve=Escudo cabo-verdiano
+CurrencyNames/pt/cyp=Libra cipriota
+CurrencyNames/pt/czk=Coroa checa
+CurrencyNames/pt/dem=Marco alem\u00e3o
+CurrencyNames/pt/djf=Franco do Djibuti
+CurrencyNames/pt/dkk=Coroa dinamarquesa
+CurrencyNames/pt/dop=Peso dominicano
+CurrencyNames/pt/dzd=Dinar argelino
+CurrencyNames/pt/eek=Coroa estoniana
+CurrencyNames/pt/egp=Libra eg\u00edpcia
+CurrencyNames/pt/ern=Nakfa da Eritreia
+CurrencyNames/pt/esp=Peseta espanhola
+CurrencyNames/pt/etb=Birr et\u00edope
+CurrencyNames/pt/fim=Marca finlandesa
+CurrencyNames/pt/fjd=D\u00f3lar de Fiji
+CurrencyNames/pt/fkp=Libra das Malvinas
+CurrencyNames/pt/frf=Franco franc\u00eas
+CurrencyNames/pt/gbp=Libra esterlina brit\u00e2nica
+CurrencyNames/pt/gel=Lari georgiano
+CurrencyNames/pt/ghc=Cedi de Gana (1979-2007)
+CurrencyNames/pt/ghs=Cedi gan\u00eas
+CurrencyNames/pt/gip=Libra de Gibraltar
+CurrencyNames/pt/gmd=Dalasi de G\u00e2mbia
+CurrencyNames/pt/gnf=Franco de Guin\u00e9
+CurrencyNames/pt/grd=Dracma grego
+CurrencyNames/pt/gtq=Quet\u00e7al da Guatemala
+CurrencyNames/pt/gwp=Peso da Guin\u00e9-Bissau
+CurrencyNames/pt/gyd=D\u00f3lar da Guiana
+CurrencyNames/pt/hkd=D\u00f3lar de Hong Kong
+CurrencyNames/pt/hnl=Lempira de Honduras
+CurrencyNames/pt/hrk=Kuna croata
+CurrencyNames/pt/htg=Gurde do Haiti
+CurrencyNames/pt/huf=Forinte h\u00fangaro
+CurrencyNames/pt/idr=Rupia indon\u00e9sia
+CurrencyNames/pt/iep=Libra irlandesa
+CurrencyNames/pt/ils=Sheqel Novo israelita
+CurrencyNames/pt/inr=R\u00fapia indiana
+CurrencyNames/pt/iqd=Dinar iraquiano
+CurrencyNames/pt/irr=Rial iraniano
+CurrencyNames/pt/isk=Coroa islandesa
+CurrencyNames/pt/itl=Lira italiana
+CurrencyNames/pt/jmd=D\u00f3lar jamaicano
+CurrencyNames/pt/jod=Dinar jordaniano
+CurrencyNames/pt/jpy=Iene japon\u00eas
+CurrencyNames/pt/kes=Xelim queniano
+CurrencyNames/pt/kgs=Som quirguiz
+CurrencyNames/pt/khr=Riel cambojano
+CurrencyNames/pt/kmf=Franco de Comores
+CurrencyNames/pt/kpw=Won norte-coreano
+CurrencyNames/pt/krw=Won sul-coreano
+CurrencyNames/pt/kwd=Dinar coveitiano
+CurrencyNames/pt/kyd=D\u00f3lar das Ilhas Caiman
+CurrencyNames/pt/kzt=Tenge do Cazaquist\u00e3o
+CurrencyNames/pt/lak=Kip de Laos
+CurrencyNames/pt/lbp=Libra libanesa
+CurrencyNames/pt/lkr=Rupia do Sri Lanka
+CurrencyNames/pt/lrd=D\u00f3lar liberiano
+CurrencyNames/pt/lsl=Loti do Lesoto
+CurrencyNames/pt/ltl=Lita lituano
+CurrencyNames/pt/luf=Franco luxemburgu\u00eas
+CurrencyNames/pt/lvl=Lats let\u00e3o
+CurrencyNames/pt/lyd=Dinar l\u00edbio
+CurrencyNames/pt/mad=Dir\u00e9m marroquino
+CurrencyNames/pt/mdl=Leu mold\u00e1vio
+CurrencyNames/pt/mga=Ariary de Madagascar
+CurrencyNames/pt/mgf=Franco de Madagascar
+CurrencyNames/pt/mkd=Dinar maced\u00f4nio
+CurrencyNames/pt/mmk=Kyat de Mianmar
+CurrencyNames/pt/mnt=Tugrik mongol
+CurrencyNames/pt/mop=Pataca macaense
+CurrencyNames/pt/mro=Ouguiya da Maurit\u00e2nia
+CurrencyNames/pt/mtl=Lira maltesa
+CurrencyNames/pt/mur=Rupia de Maur\u00edcio
+CurrencyNames/pt/mvr=Rupias das Ilhas Maldivas
+CurrencyNames/pt/mwk=Cuacha do Mal\u00e1ui
+CurrencyNames/pt/mxn=Peso mexicano
+CurrencyNames/pt/mxv=Unidade Mexicana de Investimento (UDI)
+CurrencyNames/pt/myr=Ringgit malaio
+CurrencyNames/pt/mzm=Metical antigo de Mo\u00e7ambique
+CurrencyNames/pt/mzn=Metical do Mo\u00e7ambique
+CurrencyNames/pt/nad=D\u00f3lar da Nam\u00edbia
+CurrencyNames/pt/ngn=Naira nigeriana
+CurrencyNames/pt/nio=C\u00f3rdoba Ouro nicaraguense
+CurrencyNames/pt/nlg=Florim holand\u00eas
+CurrencyNames/pt/nok=Coroa norueguesa
+CurrencyNames/pt/npr=Rupia nepalesa
+CurrencyNames/pt/nzd=D\u00f3lar da Nova Zel\u00e2ndia
+CurrencyNames/pt/omr=Rial de Om\u00e3
+CurrencyNames/pt/pab=Balboa panamenho
+CurrencyNames/pt/pen=Sol Novo peruano
+CurrencyNames/pt/pgk=Kina da Papua-Nova Guin\u00e9
+CurrencyNames/pt/php=Peso filipino
+CurrencyNames/pt/pkr=Rupia paquistanesa
+CurrencyNames/pt/pln=Zloti polon\u00eas
+CurrencyNames/pt/pte=Escudo portugu\u00eas
+CurrencyNames/pt/pyg=Guarani paraguaio
+CurrencyNames/pt/qar=Rial catariano
+CurrencyNames/pt/rol=Leu romeno antigo
+CurrencyNames/pt/ron=Leu romeno
+CurrencyNames/pt/rsd=Dinar s\u00e9rvio
+CurrencyNames/pt/rub=Rublo russo
+CurrencyNames/pt/rur=Rublo russo (1991-1998)
+CurrencyNames/pt/rwf=Franco ruand\u00eas
+CurrencyNames/pt/sar=Rial saudita
+CurrencyNames/pt/sbd=D\u00f3lar das Ilhas Salom\u00e3o
+CurrencyNames/pt/scr=Rupia das Seychelles
+CurrencyNames/pt/sdd=Dinar sudan\u00eas
+CurrencyNames/pt/sdg=Libra sudanesa
+CurrencyNames/pt/sek=Coroa sueca
+CurrencyNames/pt/sgd=D\u00f3lar de Cingapura
+CurrencyNames/pt/shp=Libra de Santa Helena
+CurrencyNames/pt/sit=Tolar Bons esloveno
+CurrencyNames/pt/skk=Coroa eslovaca
+CurrencyNames/pt/sll=Leone de Serra Leoa
+CurrencyNames/pt/sos=Xelim somali
+CurrencyNames/pt/srd=D\u00f3lar do Suriname
+CurrencyNames/pt/srg=Florim do Suriname
+CurrencyNames/pt/std=Dobra de S\u00e3o Tom\u00e9 e Pr\u00edncipe
+CurrencyNames/pt/svc=Colom salvadorenho
+CurrencyNames/pt/syp=Libra s\u00edria
+CurrencyNames/pt/szl=Lilangeni da Suazil\u00e2ndia
+CurrencyNames/pt/thb=Baht tailand\u00eas
+CurrencyNames/pt/tjs=Somoni tadjique
+CurrencyNames/pt/tmm=Manat do Turcomenist\u00e3o
+CurrencyNames/pt/tnd=Dinar tunisiano
+CurrencyNames/pt/top=Pa\u02bbanga de Tonga
+CurrencyNames/pt/tpe=Escudo timorense
+CurrencyNames/pt/trl=Lira turca antiga
+CurrencyNames/pt/try=Lira turca
+CurrencyNames/pt/ttd=D\u00f3lar de Trinidad e Tobago
+CurrencyNames/pt/twd=D\u00f3lar Novo de Taiwan
+CurrencyNames/pt/tzs=Xelim da Tanz\u00e2nia
+CurrencyNames/pt/uah=Hryvnia ucraniano
+CurrencyNames/pt/ugx=Xelim ugandense
+CurrencyNames/pt/usd=D\u00f3lar norte-americano
+CurrencyNames/pt/usn=D\u00f3lar norte-americano (Dia seguinte)
+CurrencyNames/pt/uss=D\u00f3lar norte-americano (Mesmo dia)
+CurrencyNames/pt/uyu=Peso uruguaio
+CurrencyNames/pt/uzs=Sum do Usbequist\u00e3o
+CurrencyNames/pt/veb=Bol\u00edvar venezuelano
+CurrencyNames/pt/vef=Bol\u00edvar v enezuelano forte
+CurrencyNames/pt/vnd=Dong vietnamita
+CurrencyNames/pt/vuv=Vatu de Vanuatu
+CurrencyNames/pt/wst=Tala samoano
+CurrencyNames/pt/xaf=Franco CFA BEAC
+CurrencyNames/pt/xag=Prata
+CurrencyNames/pt/xau=Ouro
+CurrencyNames/pt/xba=Unidade Composta Europeia
+CurrencyNames/pt/xbb=Unidade Monet\u00e1ria Europeia
+CurrencyNames/pt/xbc=Unidade de Conta Europeia (XBC)
+CurrencyNames/pt/xbd=Unidade de Conta Europeia (XBD)
+CurrencyNames/pt/xcd=D\u00f3lar do Caribe Oriental
+CurrencyNames/pt/xdr=Direitos Especiais de Giro
+CurrencyNames/pt/xfo=Franco-ouro franc\u00eas
+CurrencyNames/pt/xfu=Franco UIC franc\u00eas
+CurrencyNames/pt/xof=Franco CFA BCEAO
+CurrencyNames/pt/xpd=Pal\u00e1dio
+CurrencyNames/pt/xpf=Franco CFP
+CurrencyNames/pt/xpt=Platina
+CurrencyNames/pt/xts=C\u00f3digo de Moeda de Teste
+CurrencyNames/pt/xxx=Moeda Desconhecida ou Inv\u00e1lida
+CurrencyNames/pt/yer=Rial iemenita
+CurrencyNames/pt/yum=Dinar noviy iugoslavo
+CurrencyNames/pt/zar=Rand sul-africano
+CurrencyNames/pt/zmk=Cuacha zambiano
+CurrencyNames/pt/zwd=D\u00f3lar do Zimb\u00e1bue
+
+# bug 7020960
+CurrencyNames/sr_RS/RSD=\u0434\u0438\u043d.
--- a/jdk/test/sun/text/resources/LocaleDataTest.java	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/text/resources/LocaleDataTest.java	Fri Mar 18 11:00:10 2011 -0700
@@ -33,7 +33,7 @@
  *      6379214 6485516 6486607 4225362 4494727 6533691 6531591 6531593 6570259
  *      6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611
  *      6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
- *      6919624
+ *      6919624 6998391 7019267 7020960
  * @summary Verify locale data
  *
  */
@@ -91,6 +91,10 @@
  *        LocaleNames/fr_FR/US=\u00c9tats-Unis
  *        LocaleNames/fr_FR/FR=France</pre>
  *
+ *    You can use language tag with '-' in locale field like this:<pre>
+ *        LocaleNames/sr-Latn/SR=Surinam
+ *        FormatData/sr-Latn-BA/DayNames/2=utorak</pre>
+ *
  *    The command-line syntax of this test is
  *        <tt>java LocaleDataTest [-w] [{ -s | <filename> }]</tt>
  *
@@ -242,7 +246,9 @@
         if (index == -1 || index + 1 == key.length())
             throw new Exception("Malformed input file: \"" + key + "\" is missing locale name");
         localeName = key.substring(oldIndex, index);
-        if (localeName.length() > 0) {
+        boolean use_tag = localeName.indexOf("-") != -1;
+
+        if (use_tag == false && localeName.length() > 0) {
             language = localeName.substring(0, 2);
             if (localeName.length() > 3) {
                 country = localeName.substring(3, 5);
@@ -283,8 +289,14 @@
             } else {
                 fullName = "sun.text.resources." + rbName;
             }
+            Locale locale;
+            if (use_tag) {
+                locale = Locale.forLanguageTag(localeName);
+            } else {
+                locale = new Locale(language, country, variant);
+            }
             ResourceBundle bundle = ResourceBundle.getBundle(fullName,
-                           new Locale(language, country, variant),
+                           locale,
                            ResourceBundle.Control.getNoFallbackControl(Control.FORMAT_DEFAULT));
             resource = bundle.getObject(resTag);
         }
--- a/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh	Wed Mar 16 17:21:52 2011 -0700
+++ b/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh	Fri Mar 18 11:00:10 2011 -0700
@@ -24,7 +24,7 @@
 #
 
 # @test
-# @bug 4630463 4630971 4636448 4701617 4721296 4710890 6247817
+# @bug 4630463 4630971 4636448 4701617 4721296 4710890 6247817 7021987
 # @summary Tests miscellaneous native2ascii bugfixes and regressions
 
 
@@ -100,6 +100,15 @@
 $N2A -reverse -encoding MS932 $TESTSRC/A2N_4701617 x.out
 check 4701617 $TESTSRC/A2N_4701617.expected x.out
 
+# Check that the inputfile appears in the error message when not found
+
+badin="DoesNotExist"
+$N2A $badin x.out | grep "$badin" > /dev/null
+if [ $? != 0 ]; then
+    echo "\"$badin\" expected to appear in error message"
+    exit 1
+fi
+
 # for win32 only ensure when output file pre-exists that
 # native2ascii tool will simply overwrite with the expected
 # output file (fixed bugID 4710890)
--- a/langtools/.hgtags	Wed Mar 16 17:21:52 2011 -0700
+++ b/langtools/.hgtags	Fri Mar 18 11:00:10 2011 -0700
@@ -107,3 +107,5 @@
 7a98db8cbfce77a619057aa4fdde69d2a06d4101 jdk7-b130
 67221b8643b478c4fceacc89240db876455aae76 jdk7-b131
 e3d011d59a33acef79eff7523bef069557e91002 jdk7-b132
+e77e98f936e83d94c9b56cc7af218dc822a06122 jdk7-b133
+3d7acdbb72cab55deedfd35f60d4732abc9d6ac4 jdk7-b134
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Wed Mar 16 17:21:52 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Fri Mar 18 11:00:10 2011 -0700
@@ -11,15 +11,25 @@
 doclet.Interface_Hierarchy=Interface Hierarchy
 doclet.Enum_Hierarchy=Enum Hierarchy
 doclet.Annotation_Type_Hierarchy=Annotation Type Hierarchy
+# The following ALL CAPS words should be translated. It is used as "Previous" link on javadoc.
 doclet.Prev=PREV
+# The following ALL CAPS words should be translated. It is used as "Next" link on javadoc.
 doclet.Next=NEXT
+# The following ALL CAPS words should be translated. It is used as "Previous Class" link on javadoc.
 doclet.Prev_Class=PREV CLASS
+# The following ALL CAPS words should be translated. It is used as "Next Class" link on javadoc.
 doclet.Next_Class=NEXT CLASS
+# The following ALL CAPS words should be translated. It is used as "Previous Package" link on javadoc.
 doclet.Prev_Package=PREV PACKAGE
+# The following ALL CAPS words should be translated. It is used as "Next Package" link on javadoc.
 doclet.Next_Package=NEXT PACKAGE
+# The following ALL CAPS words should be translated. It is used as "Previous Letter" link on javadoc alphabetical index.
 doclet.Prev_Letter=PREV LETTER
+# The following ALL CAPS words should be translated. It is used as "Next Letter" link on javadoc alphabetical index.
 doclet.Next_Letter=NEXT LETTER
+# The following ALL CAPS words should be translated. It is used as "Show List" link on javadoc.
 doclet.Show_Lists=SHOW LISTS
+# The following ALL CAPS words should be translated. It is used as "Hide List" link on javadoc.
 doclet.Hide_Lists=HIDE LISTS
 doclet.Href_Class_Title=class in {0}
 doclet.Href_Interface_Title=interface in {0}
@@ -27,16 +37,27 @@
 doclet.Href_Enum_Title=enum in {0}
 doclet.Href_Type_Param_Title=type parameter in {0}
 doclet.Href_Class_Or_Interface_Title=class or interface in {0}
+# The following ALL CAPS words should be translated. It's used as SUMMARY: NESTED | FIELD | CONSTR | METHOD, meaning Nested Class Summary, Field Summary, Constructor Summary, or Method Summary.
 doclet.Summary=SUMMARY:
+# The following ALL CAPS words should be translated. It is used as DETAIL: FIELD | CONSTR | METHOD, meaning Field Detail, Constructor Detail, or Method Detail.
 doclet.Detail=DETAIL:
+# The following ALL CAPS words should be translated. It is used as "Nested" (Nested Class Summary) link on javadoc.
 doclet.navNested=NESTED
+# The following ALL CAPS words should be translated. It is used as "Optional" (Optional Element Summary) link on javadoc.
 doclet.navAnnotationTypeOptionalMember=OPTIONAL
+# The following ALL CAPS words should be translated. It is used as "Required" (Required Element Summary) link on javadoc.
 doclet.navAnnotationTypeRequiredMember=REQUIRED
+# The following ALL CAPS words should be translated. It is used as "Element" (Required Element Summary) link on javadoc.
 doclet.navAnnotationTypeMember=ELEMENT
+# The following ALL CAPS words should be translated. It is used as "Field" (Field Detail) link on javadoc.
 doclet.navField=FIELD
+# The following ALL CAPS words should be translated. It is used as "Enum Constants" link on javadoc.
 doclet.navEnum=ENUM CONSTANTS
+# The following ALL CAPS words should be translated. It is used as "Constructor" (Constructor Detail) link on javadoc.
 doclet.navConstructor=CONSTR
+# The following ALL CAPS words should be translated. It is used as "Method" (Method Detail) link on javadoc.
 doclet.navMethod=METHOD
+# The following resource does not seem to be used anymore.
 doclet.navFactoryMethod=FACTORY
 doclet.Index=Index
 doclet.Window_Single_Index=Index
@@ -45,8 +66,11 @@
 doclet.Skip_navigation_links=Skip navigation links
 doclet.New_Page=NewPage
 doclet.None=None
+# The following resource does not seem to be used anymore
 doclet.CLASSES=CLASSES
+# The following resource does not seem to be used anymore
 doclet.MEMBERS=MEMBERS
+# The following resource does not seem to be used anymore
 doclet.NONE=NONE
 doclet.Factory_Method_Detail=Static Factory Method Detail
 doclet.navDeprecated=Deprecated
@@ -112,7 +136,9 @@
 doclet.Option=Option
 doclet.Or=Or
 doclet.Frames=Frames
+# The following ALL CAPS words should be translated. It is used as "FRAMES" javadoc navigation link to indicate displaying the page with HTML frames.
 doclet.FRAMES=FRAMES
+# The following ALL CAPS words should be translated. It is used as "NO FRAMES" javadoc navigation link to indicate displaying the page without HTML frames.
 doclet.NO_FRAMES=NO FRAMES
 doclet.Package_Hierarchies=Package Hierarchies:
 doclet.Hierarchy_For_Package=Hierarchy For Package {0}