--- a/.hgtags-top-repo Thu Jun 01 08:59:24 2017 +0200
+++ b/.hgtags-top-repo Wed Jul 05 23:32:39 2017 +0200
@@ -420,6 +420,7 @@
03fe61bb7670644cf6e46b5cfafb6b27c0e0157e jdk-10+6
b25838a28195f4b6dab34668411eedd2d366a16c jdk-9+169
4d163ec59d989a9261ed7f848bc6303f90869af5 jdk-9+170
-
aa3c97810d7c484c93a2fd75d3c76ff574deb6d8 jdk-10+7
df33ef1dc163f994177fd97d4d0e73a1e3cb5d85 jdk-10+8
+b94be69cbb1d2943b886bf2d458745756df146e4 jdk-10+9
+4c12464a907db4656c1033f56fa49cba643ac629 jdk-9+171
--- a/common/autoconf/spec.gmk.in Thu Jun 01 08:59:24 2017 +0200
+++ b/common/autoconf/spec.gmk.in Wed Jul 05 23:32:39 2017 +0200
@@ -651,7 +651,7 @@
MV:=@MV@
NAWK:=@NAWK@
NICE:=@NICE@
-PANDOC:=@PANDOC@
+PANDOC:=@FIXPATH@ @PANDOC@
PATCH:=@PATCH@
PRINTF:=@PRINTF@
RM:=@RM@
--- a/common/doc/building.html Thu Jun 01 08:59:24 2017 +0200
+++ b/common/doc/building.html Wed Jul 05 23:32:39 2017 +0200
@@ -1,21 +1,23 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta name="generator" content="pandoc" />
+ <meta charset="utf-8">
+ <meta name="generator" content="pandoc">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>OpenJDK Build README</title>
<style type="text/css">code{white-space: pre;}</style>
- <link rel="stylesheet" href=" ../../jdk/make/data/docs-resources/specs/resources/jdk-default.css" type="text/css" />
+ <link rel="stylesheet" href="../../jdk/make/data/docs-resources/specs/resources/jdk-default.css">
+ <!--[if lt IE 9]>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
+ <![endif]-->
</head>
<body>
-<div id="header">
+<header>
<h1 class="title">OpenJDK Build README</h1>
-</div>
-<div class="figure">
-<img src="http://openjdk.java.net/images/openjdk.png" alt="OpenJDK" />
-<p class="caption">OpenJDK</p>
-</div>
+</header>
+<figure>
+<img src="http://openjdk.java.net/images/openjdk.png" alt="OpenJDK" /><figcaption>OpenJDK</figcaption>
+</figure>
<hr />
<h2 id="introduction">Introduction</h2>
<p>This README file contains build instructions for the <a href="http://openjdk.java.net">OpenJDK</a>. Building the source code for the OpenJDK requires a certain degree of technical expertise.</p>
@@ -149,50 +151,50 @@
<table>
<thead>
<tr class="header">
-<th align="left">Package</th>
-<th align="left">Version</th>
+<th style="text-align: left;">Package</th>
+<th style="text-align: left;">Version</th>
</tr>
</thead>
<tbody>
<tr class="odd">
-<td align="left">developer/solarisstudio-124/backend</td>
-<td align="left">12.4-1.0.6.0</td>
+<td style="text-align: left;">developer/solarisstudio-124/backend</td>
+<td style="text-align: left;">12.4-1.0.6.0</td>
</tr>
<tr class="even">
-<td align="left">developer/solarisstudio-124/c++</td>
-<td align="left">12.4-1.0.10.0</td>
+<td style="text-align: left;">developer/solarisstudio-124/c++</td>
+<td style="text-align: left;">12.4-1.0.10.0</td>
</tr>
<tr class="odd">
-<td align="left">developer/solarisstudio-124/cc</td>
-<td align="left">12.4-1.0.4.0</td>
+<td style="text-align: left;">developer/solarisstudio-124/cc</td>
+<td style="text-align: left;">12.4-1.0.4.0</td>
</tr>
<tr class="even">
-<td align="left">developer/solarisstudio-124/library/c++-libs</td>
-<td align="left">12.4-1.0.10.0</td>
+<td style="text-align: left;">developer/solarisstudio-124/library/c++-libs</td>
+<td style="text-align: left;">12.4-1.0.10.0</td>
</tr>
<tr class="odd">
-<td align="left">developer/solarisstudio-124/library/math-libs</td>
-<td align="left">12.4-1.0.0.1</td>
+<td style="text-align: left;">developer/solarisstudio-124/library/math-libs</td>
+<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="even">
-<td align="left">developer/solarisstudio-124/library/studio-gccrt</td>
-<td align="left">12.4-1.0.0.1</td>
+<td style="text-align: left;">developer/solarisstudio-124/library/studio-gccrt</td>
+<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="odd">
-<td align="left">developer/solarisstudio-124/studio-common</td>
-<td align="left">12.4-1.0.0.1</td>
+<td style="text-align: left;">developer/solarisstudio-124/studio-common</td>
+<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="even">
-<td align="left">developer/solarisstudio-124/studio-ja</td>
-<td align="left">12.4-1.0.0.1</td>
+<td style="text-align: left;">developer/solarisstudio-124/studio-ja</td>
+<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="odd">
-<td align="left">developer/solarisstudio-124/studio-legal</td>
-<td align="left">12.4-1.0.0.1</td>
+<td style="text-align: left;">developer/solarisstudio-124/studio-legal</td>
+<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="even">
-<td align="left">developer/solarisstudio-124/studio-zhCN</td>
-<td align="left">12.4-1.0.0.1</td>
+<td style="text-align: left;">developer/solarisstudio-124/studio-zhCN</td>
+<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
</tbody>
</table>
@@ -211,66 +213,66 @@
<table>
<thead>
<tr class="header">
-<th align="left">Binary Name</th>
-<th align="left">Category</th>
-<th align="left">Package</th>
-<th align="left">Description</th>
+<th style="text-align: left;">Binary Name</th>
+<th style="text-align: left;">Category</th>
+<th style="text-align: left;">Package</th>
+<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
-<td align="left">ar.exe</td>
-<td align="left">Devel</td>
-<td align="left">binutils</td>
-<td align="left">The GNU assembler, linker and binary utilities</td>
+<td style="text-align: left;">ar.exe</td>
+<td style="text-align: left;">Devel</td>
+<td style="text-align: left;">binutils</td>
+<td style="text-align: left;">The GNU assembler, linker and binary utilities</td>
</tr>
<tr class="even">
-<td align="left">make.exe</td>
-<td align="left">Devel</td>
-<td align="left">make</td>
-<td align="left">The GNU version of the 'make' utility built for CYGWIN</td>
+<td style="text-align: left;">make.exe</td>
+<td style="text-align: left;">Devel</td>
+<td style="text-align: left;">make</td>
+<td style="text-align: left;">The GNU version of the 'make' utility built for CYGWIN</td>
</tr>
<tr class="odd">
-<td align="left">m4.exe</td>
-<td align="left">Interpreters</td>
-<td align="left">m4</td>
-<td align="left">GNU implementation of the traditional Unix macro processor</td>
+<td style="text-align: left;">m4.exe</td>
+<td style="text-align: left;">Interpreters</td>
+<td style="text-align: left;">m4</td>
+<td style="text-align: left;">GNU implementation of the traditional Unix macro processor</td>
</tr>
<tr class="even">
-<td align="left">cpio.exe</td>
-<td align="left">Utils</td>
-<td align="left">cpio</td>
-<td align="left">A program to manage archives of files</td>
+<td style="text-align: left;">cpio.exe</td>
+<td style="text-align: left;">Utils</td>
+<td style="text-align: left;">cpio</td>
+<td style="text-align: left;">A program to manage archives of files</td>
</tr>
<tr class="odd">
-<td align="left">gawk.exe</td>
-<td align="left">Utils</td>
-<td align="left">awk</td>
-<td align="left">Pattern-directed scanning and processing language</td>
+<td style="text-align: left;">gawk.exe</td>
+<td style="text-align: left;">Utils</td>
+<td style="text-align: left;">awk</td>
+<td style="text-align: left;">Pattern-directed scanning and processing language</td>
</tr>
<tr class="even">
-<td align="left">file.exe</td>
-<td align="left">Utils</td>
-<td align="left">file</td>
-<td align="left">Determines file type using 'magic' numbers</td>
+<td style="text-align: left;">file.exe</td>
+<td style="text-align: left;">Utils</td>
+<td style="text-align: left;">file</td>
+<td style="text-align: left;">Determines file type using 'magic' numbers</td>
</tr>
<tr class="odd">
-<td align="left">zip.exe</td>
-<td align="left">Archive</td>
-<td align="left">zip</td>
-<td align="left">Package and compress (archive) files</td>
+<td style="text-align: left;">zip.exe</td>
+<td style="text-align: left;">Archive</td>
+<td style="text-align: left;">zip</td>
+<td style="text-align: left;">Package and compress (archive) files</td>
</tr>
<tr class="even">
-<td align="left">unzip.exe</td>
-<td align="left">Archive</td>
-<td align="left">unzip</td>
-<td align="left">Extract compressed files in a ZIP archive</td>
+<td style="text-align: left;">unzip.exe</td>
+<td style="text-align: left;">Archive</td>
+<td style="text-align: left;">unzip</td>
+<td style="text-align: left;">Extract compressed files in a ZIP archive</td>
</tr>
<tr class="odd">
-<td align="left">free.exe</td>
-<td align="left">System</td>
-<td align="left">procps</td>
-<td align="left">Display amount of free and used memory in the system</td>
+<td style="text-align: left;">free.exe</td>
+<td style="text-align: left;">System</td>
+<td style="text-align: left;">procps</td>
+<td style="text-align: left;">Display amount of free and used memory in the system</td>
</tr>
</tbody>
</table>
@@ -561,14 +563,14 @@
This is probably an issue with SELinux (See <a href="http://en.wikipedia.org/wiki/SELinux">SELinux on Wikipedia</a>). Parts of the VM is built without the <code>-fPIC</code> for performance reasons.</p></li>
</ul>
<p>To completely disable SELinux:</p>
-<ol style="list-style-type: decimal">
+<ol type="1">
<li><code>$ su root</code></li>
<li><code># system-config-securitylevel</code></li>
<li><code>In the window that appears, select the SELinux tab</code></li>
<li><code>Disable SELinux</code></li>
</ol>
<p>Alternatively, instead of completely disabling it you could disable just this one check.</p>
-<ol style="list-style-type: decimal">
+<ol type="1">
<li>Select System->Administration->SELinux Management</li>
<li>In the SELinux Management Tool which appears, select "Boolean" from the menu on the left</li>
<li>Expand the "Memory Protection" group</li>
@@ -616,62 +618,62 @@
<table>
<thead>
<tr class="header">
-<th align="left">Base OS and Architecture</th>
-<th align="left">OS</th>
-<th align="left">C/C++ Compiler</th>
-<th align="left">Processors</th>
-<th align="left">RAM Minimum</th>
-<th align="left">DISK Needs</th>
+<th style="text-align: left;">Base OS and Architecture</th>
+<th style="text-align: left;">OS</th>
+<th style="text-align: left;">C/C++ Compiler</th>
+<th style="text-align: left;">Processors</th>
+<th style="text-align: left;">RAM Minimum</th>
+<th style="text-align: left;">DISK Needs</th>
</tr>
</thead>
<tbody>
<tr class="odd">
-<td align="left">Linux X86 (32-bit) and X64 (64-bit)</td>
-<td align="left">Oracle Enterprise Linux 6.4</td>
-<td align="left">gcc 4.9.2</td>
-<td align="left">2 or more</td>
-<td align="left">1 GB</td>
-<td align="left">6 GB</td>
+<td style="text-align: left;">Linux X86 (32-bit) and X64 (64-bit)</td>
+<td style="text-align: left;">Oracle Enterprise Linux 6.4</td>
+<td style="text-align: left;">gcc 4.9.2</td>
+<td style="text-align: left;">2 or more</td>
+<td style="text-align: left;">1 GB</td>
+<td style="text-align: left;">6 GB</td>
</tr>
<tr class="even">
-<td align="left">Solaris SPARCV9 (64-bit)</td>
-<td align="left">Solaris 11 Update 1</td>
-<td align="left">Studio 12 Update 4 + patches</td>
-<td align="left">4 or more</td>
-<td align="left">4 GB</td>
-<td align="left">8 GB</td>
+<td style="text-align: left;">Solaris SPARCV9 (64-bit)</td>
+<td style="text-align: left;">Solaris 11 Update 1</td>
+<td style="text-align: left;">Studio 12 Update 4 + patches</td>
+<td style="text-align: left;">4 or more</td>
+<td style="text-align: left;">4 GB</td>
+<td style="text-align: left;">8 GB</td>
</tr>
<tr class="odd">
-<td align="left">Solaris X64 (64-bit)</td>
-<td align="left">Solaris 11 Update 1</td>
-<td align="left">Studio 12 Update 4 + patches</td>
-<td align="left">4 or more</td>
-<td align="left">4 GB</td>
-<td align="left">8 GB</td>
+<td style="text-align: left;">Solaris X64 (64-bit)</td>
+<td style="text-align: left;">Solaris 11 Update 1</td>
+<td style="text-align: left;">Studio 12 Update 4 + patches</td>
+<td style="text-align: left;">4 or more</td>
+<td style="text-align: left;">4 GB</td>
+<td style="text-align: left;">8 GB</td>
</tr>
<tr class="even">
-<td align="left">Windows X86 (32-bit)</td>
-<td align="left">Windows Server 2012 R2 x64</td>
-<td align="left">Microsoft Visual Studio C++ 2013 Professional Edition</td>
-<td align="left">2 or more</td>
-<td align="left">2 GB</td>
-<td align="left">6 GB</td>
+<td style="text-align: left;">Windows X86 (32-bit)</td>
+<td style="text-align: left;">Windows Server 2012 R2 x64</td>
+<td style="text-align: left;">Microsoft Visual Studio C++ 2013 Professional Edition</td>
+<td style="text-align: left;">2 or more</td>
+<td style="text-align: left;">2 GB</td>
+<td style="text-align: left;">6 GB</td>
</tr>
<tr class="odd">
-<td align="left">Windows X64 (64-bit)</td>
-<td align="left">Windows Server 2012 R2 x64</td>
-<td align="left">Microsoft Visual Studio C++ 2013 Professional Edition</td>
-<td align="left">2 or more</td>
-<td align="left">2 GB</td>
-<td align="left">6 GB</td>
+<td style="text-align: left;">Windows X64 (64-bit)</td>
+<td style="text-align: left;">Windows Server 2012 R2 x64</td>
+<td style="text-align: left;">Microsoft Visual Studio C++ 2013 Professional Edition</td>
+<td style="text-align: left;">2 or more</td>
+<td style="text-align: left;">2 GB</td>
+<td style="text-align: left;">6 GB</td>
</tr>
<tr class="even">
-<td align="left">Mac OS X X64 (64-bit)</td>
-<td align="left">Mac OS X 10.9 "Mavericks"</td>
-<td align="left">Xcode 6.3 or newer</td>
-<td align="left">2 or more</td>
-<td align="left">4 GB</td>
-<td align="left">6 GB</td>
+<td style="text-align: left;">Mac OS X X64 (64-bit)</td>
+<td style="text-align: left;">Mac OS X 10.9 "Mavericks"</td>
+<td style="text-align: left;">Xcode 6.3 or newer</td>
+<td style="text-align: left;">2 or more</td>
+<td style="text-align: left;">4 GB</td>
+<td style="text-align: left;">6 GB</td>
</tr>
</tbody>
</table>
--- a/common/doc/testing.html Thu Jun 01 08:59:24 2017 +0200
+++ b/common/doc/testing.html Wed Jul 05 23:32:39 2017 +0200
@@ -1,19 +1,22 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta name="generator" content="pandoc" />
+ <meta charset="utf-8">
+ <meta name="generator" content="pandoc">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Testing OpenJDK</title>
<style type="text/css">code{white-space: pre;}</style>
- <link rel="stylesheet" href=" ../../jdk/make/data/docs-resources/specs/resources/jdk-default.css" type="text/css" />
+ <link rel="stylesheet" href="../../jdk/make/data/docs-resources/specs/resources/jdk-default.css">
+ <!--[if lt IE 9]>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
+ <![endif]-->
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
</head>
<body>
-<div id="header">
+<header>
<h1 class="title">Testing OpenJDK</h1>
-</div>
-<div id="TOC">
+</header>
+<nav id="TOC">
<ul>
<li><a href="#using-the-run-test-framework">Using the run-test framework</a></li>
<li><a href="#test-selection">Test selection</a><ul>
@@ -26,16 +29,18 @@
<li><a href="#gtest-keywords">Gtest keywords</a></li>
</ul></li>
</ul>
-</div>
+</nav>
<h2 id="using-the-run-test-framework">Using the run-test framework</h2>
<p>This new way of running tests is developer-centric. It assumes that you have built a jdk locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.</p>
+<p>The main target "run-test" uses the jdk-image as the tested product. There is also an alternate target "exploded-run-test" that uses the exploded image instead. Not all tests will run successfully on the exploded image, but using this target can greatly improve rebuild times for certain workflows.</p>
<p>Some example command-lines:</p>
<pre><code>$ make run-test-tier1
$ make run-test-jdk_lang JTREG="JOBS=8"
$ make run-test TEST=jdk_lang
$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
$ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"
-$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"</code></pre>
+$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
+$ make exploded-run-test TEST=hotspot_tier1</code></pre>
<h2 id="test-selection">Test selection</h2>
<p>All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.</p>
<p>For some common top-level tests, direct make targets have been generated. This includes all JTreg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make run-test-tier1</code> is equivalent to <code>make run-test TEST="tier1"</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>run-test TEST="x"</code> solution needs to be used.</p>
--- a/common/doc/testing.md Thu Jun 01 08:59:24 2017 +0200
+++ b/common/doc/testing.md Wed Jul 05 23:32:39 2017 +0200
@@ -7,6 +7,11 @@
and more complex ad-hoc combination of tests is possible. The user interface is
forgiving, and clearly report errors it cannot resolve.
+The main target "run-test" uses the jdk-image as the tested product. There is
+also an alternate target "exploded-run-test" that uses the exploded image
+instead. Not all tests will run successfully on the exploded image, but using
+this target can greatly improve rebuild times for certain workflows.
+
Some example command-lines:
$ make run-test-tier1
@@ -15,6 +20,7 @@
$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
$ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"
$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
+ $ make exploded-run-test TEST=hotspot_tier1
## Test selection
--- a/hotspot/.hgtags Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/.hgtags Wed Jul 05 23:32:39 2017 +0200
@@ -582,3 +582,5 @@
38a240fd58a287acb1963920b92ed4d9c2fd39e3 jdk-9+170
9d4746eca95aec3e5a344bf2520745dcc1d17eed jdk-10+7
f5ded0cf954c770deeecb80f2ba1ba6a05cd979b jdk-10+8
+233647e3d3800e76d7612014b745b37a88098f63 jdk-10+9
+d53171650a2cc6c6f699c966c533b914ca9c0602 jdk-9+171
--- a/hotspot/.mx.jvmci/mx_jvmci.py Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/.mx.jvmci/mx_jvmci.py Wed Jul 05 23:32:39 2017 +0200
@@ -303,9 +303,9 @@
out.close('link')
out.open('link')
- out.element('name', data='generated')
+ out.element('name', data='gensrc')
out.element('type', data='2')
- generated = join(_get_hotspot_build_dir(jvmVariant, debugLevel), 'generated')
+ generated = join(_get_hotspot_build_dir(jvmVariant, debugLevel), 'gensrc')
out.element('locationURI', data=mx.get_eclipse_project_rel_locationURI(generated, eclProjectDir))
out.close('link')
@@ -620,18 +620,12 @@
def _get_hotspot_build_dir(jvmVariant=None, debugLevel=None):
"""
Gets the directory in which a particular HotSpot configuration is built
- (e.g., <JDK_REPO_ROOT>/build/macosx-x86_64-normal-server-release/hotspot/bsd_amd64_compiler2)
+ (e.g., <JDK_REPO_ROOT>/build/macosx-x86_64-normal-server-release/hotspot/variant-<variant>)
"""
if jvmVariant is None:
jvmVariant = _vm.jvmVariant
- os = mx.get_os()
- if os == 'darwin':
- os = 'bsd'
- arch = mx.get_arch()
- buildname = {'client': 'compiler1', 'server': 'compiler2'}.get(jvmVariant, jvmVariant)
-
- name = '{}_{}_{}'.format(os, arch, buildname)
+ name = 'variant-{}'.format(jvmVariant)
return join(_get_jdk_build_dir(debugLevel=debugLevel), 'hotspot', name)
class JVMCI9JDKConfig(mx.JDKConfig):
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Wed Jul 05 23:32:39 2017 +0200
@@ -4134,28 +4134,33 @@
if ((dst_enc < 16) && (nds_enc < 16)) {
vandps(dst, nds, negate_field, vector_len);
} else if ((src_enc < 16) && (dst_enc < 16)) {
- movss(src, nds);
+ evmovdqul(src, nds, Assembler::AVX_512bit);
vandps(dst, src, negate_field, vector_len);
} else if (src_enc < 16) {
- movss(src, nds);
+ evmovdqul(src, nds, Assembler::AVX_512bit);
vandps(src, src, negate_field, vector_len);
- movss(dst, src);
+ evmovdqul(dst, src, Assembler::AVX_512bit);
} else if (dst_enc < 16) {
- movdqu(src, xmm0);
- movss(xmm0, nds);
+ evmovdqul(src, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandps(dst, xmm0, negate_field, vector_len);
- movdqu(xmm0, src);
- } else if (nds_enc < 16) {
- movdqu(src, xmm0);
- vandps(xmm0, nds, negate_field, vector_len);
- movss(dst, xmm0);
- movdqu(xmm0, src);
- } else {
- movdqu(src, xmm0);
- movss(xmm0, nds);
- vandps(xmm0, xmm0, negate_field, vector_len);
- movss(dst, xmm0);
- movdqu(xmm0, src);
+ evmovdqul(xmm0, src, Assembler::AVX_512bit);
+ } else {
+ if (src_enc != dst_enc) {
+ evmovdqul(src, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, nds, Assembler::AVX_512bit);
+ vandps(xmm0, xmm0, negate_field, vector_len);
+ evmovdqul(dst, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, src, Assembler::AVX_512bit);
+ } else {
+ subptr(rsp, 64);
+ evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, nds, Assembler::AVX_512bit);
+ vandps(xmm0, xmm0, negate_field, vector_len);
+ evmovdqul(dst, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
+ addptr(rsp, 64);
+ }
}
}
@@ -4166,28 +4171,33 @@
if ((dst_enc < 16) && (nds_enc < 16)) {
vandpd(dst, nds, negate_field, vector_len);
} else if ((src_enc < 16) && (dst_enc < 16)) {
- movsd(src, nds);
+ evmovdqul(src, nds, Assembler::AVX_512bit);
vandpd(dst, src, negate_field, vector_len);
} else if (src_enc < 16) {
- movsd(src, nds);
+ evmovdqul(src, nds, Assembler::AVX_512bit);
vandpd(src, src, negate_field, vector_len);
- movsd(dst, src);
+ evmovdqul(dst, src, Assembler::AVX_512bit);
} else if (dst_enc < 16) {
- movdqu(src, xmm0);
- movsd(xmm0, nds);
+ evmovdqul(src, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandpd(dst, xmm0, negate_field, vector_len);
- movdqu(xmm0, src);
- } else if (nds_enc < 16) {
- movdqu(src, xmm0);
- vandpd(xmm0, nds, negate_field, vector_len);
- movsd(dst, xmm0);
- movdqu(xmm0, src);
- } else {
- movdqu(src, xmm0);
- movsd(xmm0, nds);
- vandpd(xmm0, xmm0, negate_field, vector_len);
- movsd(dst, xmm0);
- movdqu(xmm0, src);
+ evmovdqul(xmm0, src, Assembler::AVX_512bit);
+ } else {
+ if (src_enc != dst_enc) {
+ evmovdqul(src, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, nds, Assembler::AVX_512bit);
+ vandpd(xmm0, xmm0, negate_field, vector_len);
+ evmovdqul(dst, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, src, Assembler::AVX_512bit);
+ } else {
+ subptr(rsp, 64);
+ evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, nds, Assembler::AVX_512bit);
+ vandpd(xmm0, xmm0, negate_field, vector_len);
+ evmovdqul(dst, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
+ addptr(rsp, 64);
+ }
}
}
@@ -4934,6 +4944,24 @@
}
}
+void MacroAssembler::pshufd(XMMRegister dst, Address src, int mode) {
+ if (VM_Version::supports_avx512vl()) {
+ Assembler::pshufd(dst, src, mode);
+ } else {
+ int dst_enc = dst->encoding();
+ if (dst_enc < 16) {
+ Assembler::pshufd(dst, src, mode);
+ } else {
+ subptr(rsp, 64);
+ evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+ Assembler::pshufd(xmm0, src, mode);
+ evmovdqul(dst, xmm0, Assembler::AVX_512bit);
+ evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
+ addptr(rsp, 64);
+ }
+ }
+}
+
// This instruction exists within macros, ergo we cannot control its input
// when emitted through those patterns.
void MacroAssembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) {
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp Wed Jul 05 23:32:39 2017 +0200
@@ -1232,6 +1232,9 @@
void punpcklbw(XMMRegister dst, XMMRegister src);
void punpcklbw(XMMRegister dst, Address src) { Assembler::punpcklbw(dst, src); }
+ void pshufd(XMMRegister dst, Address src, int mode);
+ void pshufd(XMMRegister dst, XMMRegister src, int mode) { Assembler::pshufd(dst, src, mode); }
+
void pshuflw(XMMRegister dst, XMMRegister src, int mode);
void pshuflw(XMMRegister dst, Address src, int mode) { Assembler::pshuflw(dst, src, mode); }
--- a/hotspot/src/jdk.hotspot.agent/share/classes/module-info.java Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/module-info.java Wed Jul 05 23:32:39 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Defines the implementation of the HotSpot Serviceability Agent.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.hotspot.agent {
requires java.datatransfer;
requires java.desktop;
--- a/hotspot/src/share/vm/oops/constMethod.cpp Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/src/share/vm/oops/constMethod.cpp Wed Jul 05 23:32:39 2017 +0200
@@ -407,8 +407,12 @@
ResourceMark rm;
assert(is_constMethod(), "must be constMethod");
st->print_cr("%s", internal_name());
- st->print(" - method: " INTPTR_FORMAT " ", p2i((address)method()));
- method()->print_value_on(st); st->cr();
+ Method* m = method();
+ st->print(" - method: " INTPTR_FORMAT " ", p2i((address)m));
+ if (m != NULL) {
+ m->print_value_on(st);
+ }
+ st->cr();
if (has_stackmap_table()) {
st->print(" - stackmap data: ");
stackmap_data()->print_value_on(st);
@@ -421,7 +425,12 @@
void ConstMethod::print_value_on(outputStream* st) const {
assert(is_constMethod(), "must be constMethod");
st->print(" const part of method " );
- method()->print_value_on(st);
+ Method* m = method();
+ if (m != NULL) {
+ m->print_value_on(st);
+ } else {
+ st->print("NULL");
+ }
}
#if INCLUDE_SERVICES
@@ -461,7 +470,7 @@
// Verification can occur during oop construction before the method or
// other fields have been initialized.
- guarantee(method()->is_method(), "should be method");
+ guarantee(method() != NULL && method()->is_method(), "should be method");
address m_end = (address)((intptr_t) this + size());
address compressed_table_start = code_end();
--- a/hotspot/src/share/vm/opto/matcher.cpp Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/src/share/vm/opto/matcher.cpp Wed Jul 05 23:32:39 2017 +0200
@@ -1000,7 +1000,7 @@
if (C->failing()) return NULL;
if (m == NULL) { Matcher::soft_match_failure(); return NULL; }
} else { // Nothing the matcher cares about
- if( n->is_Proj() && n->in(0)->is_Multi()) { // Projections?
+ if (n->is_Proj() && n->in(0) != NULL && n->in(0)->is_Multi()) { // Projections?
// Convert to machine-dependent projection
m = n->in(0)->as_Multi()->match( n->as_Proj(), this );
#ifdef ASSERT
@@ -1645,6 +1645,7 @@
// Build the object to represent this state & prepare for recursive calls
MachNode *mach = s->MachNodeGenerator(rule);
+ guarantee(mach != NULL, "Missing MachNode");
mach->_opnds[0] = s->MachOperGenerator(_reduceOp[rule]);
assert( mach->_opnds[0] != NULL, "Missing result operand" );
Node *leaf = s->_leaf;
--- a/hotspot/src/share/vm/opto/memnode.cpp Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/src/share/vm/opto/memnode.cpp Wed Jul 05 23:32:39 2017 +0200
@@ -1123,6 +1123,9 @@
// Use _idx of address base (could be Phi node) for boxed values.
intptr_t ignore = 0;
Node* base = AddPNode::Ideal_base_and_offset(in(Address), phase, ignore);
+ if (base == NULL) {
+ return this;
+ }
this_iid = base->_idx;
}
const Type* this_type = bottom_type();
@@ -3947,9 +3950,10 @@
// if it is the last unused 4 bytes of an instance, forget about it
intptr_t size_limit = phase->find_intptr_t_con(size_in_bytes, max_jint);
if (zeroes_done + BytesPerLong >= size_limit) {
- assert(allocation() != NULL, "");
- if (allocation()->Opcode() == Op_Allocate) {
- Node* klass_node = allocation()->in(AllocateNode::KlassNode);
+ AllocateNode* alloc = allocation();
+ assert(alloc != NULL, "must be present");
+ if (alloc != NULL && alloc->Opcode() == Op_Allocate) {
+ Node* klass_node = alloc->in(AllocateNode::KlassNode);
ciKlass* k = phase->type(klass_node)->is_klassptr()->klass();
if (zeroes_done == k->layout_helper())
zeroes_done = size_limit;
--- a/hotspot/test/ProblemList.txt Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/test/ProblemList.txt Wed Jul 05 23:32:39 2017 +0200
@@ -64,14 +64,14 @@
runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
# This test is disabled since it will stress NMT and timeout during normal testing
runtime/NMT/MallocStressTest.java 8166548 generic-all
-runtime/SharedArchiveFile/BootAppendTests.java 8150683 generic-all
+runtime/SharedArchiveFile/BootAppendTests.java 8179103 generic-all
runtime/SharedArchiveFile/DefaultUseWithClient.java 8154204 generic-all
#############################################################################
# :hotspot_serviceability
-serviceability/jdwp/AllModulesCommandTest.java 8168478 generic-all
+serviceability/jdwp/AllModulesCommandTest.java 8170541 generic-all
serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all
serviceability/jvmti/ModuleAwareAgents/ClassFileLoadHook/MAAClassFileLoadHook.java 8173936 generic-all
--- a/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java Wed Jul 05 23:32:39 2017 +0200
@@ -23,7 +23,7 @@
package compiler.codecache.stress;
-import jdk.test.lib.wrappers.TimeLimitedRunner;
+import jdk.test.lib.TimeLimitedRunner;
import jdk.test.lib.Utils;
public class CodeCacheStressRunner {
--- a/hotspot/test/compiler/codecache/stress/Helper.java Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/test/compiler/codecache/stress/Helper.java Wed Jul 05 23:32:39 2017 +0200
@@ -25,7 +25,7 @@
import jdk.test.lib.Asserts;
import jdk.test.lib.ByteCodeLoader;
-import jdk.test.lib.wrappers.InfiniteLoop;
+import jdk.test.lib.InfiniteLoop;
import jdk.test.lib.Utils;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java Wed Jul 05 23:32:39 2017 +0200
@@ -29,7 +29,7 @@
import compiler.compilercontrol.share.pool.PoolHelper;
import compiler.compilercontrol.share.scenario.Executor;
import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.wrappers.TimeLimitedRunner;
+import jdk.test.lib.TimeLimitedRunner;
import jdk.test.lib.Utils;
import java.util.ArrayList;
--- a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java Wed Jul 05 23:32:39 2017 +0200
@@ -44,7 +44,7 @@
package compiler.whitebox;
import jdk.test.lib.Asserts;
-import jdk.test.lib.wrappers.InfiniteLoop;
+import jdk.test.lib.InfiniteLoop;
import sun.hotspot.WhiteBox;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/serviceability/jdwp/AllModulesCommandTest.java Thu Jun 01 08:59:24 2017 +0200
+++ b/hotspot/test/serviceability/jdwp/AllModulesCommandTest.java Wed Jul 05 23:32:39 2017 +0200
@@ -32,7 +32,6 @@
* @test
* @summary Tests the modules-related JDWP commands
* @library /test/lib
- * @ignore 8170541
* @modules jdk.jdwp.agent
* @modules java.base/jdk.internal.misc
* @compile AllModulesCommandTestDebuggee.java
--- a/make/CompileJavaModules.gmk Thu Jun 01 08:59:24 2017 +0200
+++ b/make/CompileJavaModules.gmk Wed Jul 05 23:32:39 2017 +0200
@@ -42,7 +42,8 @@
################################################################################
-java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline
+java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline \
+ --doclint-format html4
java.base_COPY := .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
java.base_CLEAN := intrinsic.properties
@@ -95,7 +96,8 @@
################################################################################
java.desktop_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference \
- '-Xdoclint/package:java.*,javax.*' -Xlint:exports
+ '-Xdoclint/package:java.*,javax.*' -Xlint:exports \
+ --doclint-format html4
java.desktop_COPY := .gif .png .wav .txt .xml .css .pf
java.desktop_CLEAN := iio-plugin.properties cursors.properties
--- a/make/Docs.gmk Thu Jun 01 08:59:24 2017 +0200
+++ b/make/Docs.gmk Wed Jul 05 23:32:39 2017 +0200
@@ -55,7 +55,6 @@
LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java9speclicense.html
REDISTRIBUTION_URL := http://www.oracle.com/technetwork/java/redist-137594.html
-
# In order to get a specific ordering it's necessary to specify the total
# ordering of tags as the tags are otherwise ordered in order of definition.
JAVADOC_TAGS := \
@@ -163,7 +162,7 @@
################################################################################
-JDK_DOCS_INDEX_HTML_TITLE := Java™ Platform, Standard Edition Development Kit \
+JDK_INDEX_TITLE := Java™ Platform, Standard Edition Development Kit \
(JDK™) $(VERSION_SPECIFICATION) Specification<br>$(DRAFT_MARKER_TITLE)
################################################################################
@@ -211,10 +210,10 @@
SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
define SetupApiDocsGenerationBody
- # Figure out all modules, both specified and transitive, that will be processed
- # by javadoc.
- $1_TRANSITIVE_MODULES := $$(call FindTransitiveDepsForModules, $$($1_MODULES))
- $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_TRANSITIVE_MODULES))
+ # Figure out all modules, both specified and transitive indirect exports, that
+ # will be processed by javadoc.
+ $1_INDIRECT_EXPORTS := $$(call FindTransitiveIndirectDepsForModules, $$($1_MODULES))
+ $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_INDIRECT_EXPORTS))
ifeq ($$(ENABLE_FULL_DOCS), true)
# Tell the ModuleGraph taglet to generate html links to soon-to-be-created
@@ -334,7 +333,8 @@
################################################################################
# Setup generation of the Java SE API documentation (javadoc + modulegraph)
-# The Java SE module scope is just java.se.ee and it's transitive modules.
+# The Java SE module scope is just java.se.ee and it's transitive indirect
+# exports.
JAVASE_JAVADOC_MODULES := java.se.ee
JAVASE_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
@@ -356,15 +356,27 @@
################################################################################
-JDK_DOCS_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
+JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
+JDK_INDEX_TOOLS_DIR := $(TOOLS_CLASSES_DIR)/build/tools/docs
-$(JDK_DOCS_INDEX_HTML): $(BUILD_JIGSAW_TOOLS)
+$(JDK_INDEX_HTML): $(BUILD_JIGSAW_TOOLS) \
+ $(JDK_INDEX_TOOLS_DIR)/docs-bundle-page.html \
+ $(JDK_INDEX_TOOLS_DIR)/docs-module-groups.properties
$(call LogInfo, Generating docs bundle index page)
$(MKDIR) -p $(@D)
- $(TOOL_GEN_DOCS_BUNDLE_PAGE) --title '$(JDK_DOCS_INDEX_HTML_TITLE)' \
+ $(TOOL_GEN_DOCS_BUNDLE_PAGE) --title '$(JDK_INDEX_TITLE)' \
--output $@
-JDK_DOCS_INDEX_HTML_TARGETS := $(JDK_DOCS_INDEX_HTML)
+JDK_INDEX_TARGETS := $(JDK_INDEX_HTML)
+
+# Copy the global resources
+GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/
+$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
+ SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
+ FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
+ DEST := $(DOCS_OUTPUTDIR), \
+))
+JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
################################################################################
# Copy JDK specs files
@@ -389,20 +401,11 @@
) \
)
-# Copy the global resources
-GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/specs
-$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
- SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
- FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
- DEST := $(DOCS_OUTPUTDIR)/specs/, \
-))
-JDK_SPECS_TARGETS += $(COPY_GLOBAL_RESOURCES)
-
ifeq ($(ENABLE_FULL_DOCS), true)
# For all markdown files in $module/share/specs directories, convert them to
# html.
- GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/specs/resources/jdk-default.css
+ GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
$(foreach m, $(ALL_MODULES), \
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
@@ -464,7 +467,7 @@
docs-jdk-specs: $(JDK_SPECS_TARGETS)
-docs-jdk-index: $(JDK_DOCS_INDEX_HTML_TARGETS)
+docs-jdk-index: $(JDK_INDEX_TARGETS)
docs-zip: $(ZIP_TARGETS)
--- a/make/Help.gmk Thu Jun 01 08:59:24 2017 +0200
+++ b/make/Help.gmk Wed Jul 05 23:32:39 2017 +0200
@@ -56,6 +56,8 @@
$(info $(_) make test # Run tests, default is all tests (see TEST below))
$(info $(_) make run-test-<test> # Run test, e.g. run-test-tier1)
$(info $(_) make run-test TEST=<t> # Run test(s) given by TEST specification)
+ $(info $(_) make exploded-run-test TEST=<t> # Run test(s) on the exploded image instead of)
+ $(info $(_) # the full jdk image)
$(info )
$(info Targets for cleaning)
$(info $(_) make clean # Remove all files generated by make, but not those)
--- a/make/Main.gmk Thu Jun 01 08:59:24 2017 +0200
+++ b/make/Main.gmk Wed Jul 05 23:32:39 2017 +0200
@@ -450,13 +450,18 @@
run-test-$1:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1")
+ exploded-run-test-$1:
+ +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \
+ TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
+
endef
# ALL_NAMED_TESTS is defined in FindTests.gmk
$(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t)))
ALL_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS))
+ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-run-test-, $(ALL_NAMED_TESTS))
-ALL_TARGETS += $(ALL_TEST_TARGETS)
+ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS)
################################################################################
# Build tests
@@ -485,6 +490,10 @@
run-test:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)")
+exploded-run-test:
+ +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \
+ TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
+
ifeq ($(BUILD_GTEST), true)
test-image-hotspot-gtest:
+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
@@ -514,7 +523,7 @@
test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
- run-test
+ run-test exploded-run-test
################################################################################
# Run tests
@@ -798,7 +807,8 @@
docs-javase-api-modulegraph: exploded-image buildtools-modules
# The gensrc steps for hotspot and jdk.jdi create html spec files.
- docs-jdk-specs: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
+ docs-jdk-specs: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc \
+ docs-jdk-index
docs-jdk-index: exploded-image buildtools-modules
@@ -807,9 +817,11 @@
test: jdk-image test-image
run-test: jdk-image test-image
+ exploded-run-test: exploded-image test-image
# Declare dependency for all generated test targets
$(foreach t, $(ALL_TEST_TARGETS), $(eval $t: jdk-image test-image))
+ $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image))
create-buildjdk-copy: jdk.jlink-java java.base-gendata \
$(addsuffix -java, $(INTERIM_IMAGE_MODULES))
--- a/make/common/Modules.gmk Thu Jun 01 08:59:24 2017 +0200
+++ b/make/common/Modules.gmk Wed Jul 05 23:32:39 2017 +0200
@@ -151,6 +151,7 @@
jdk.crypto.ec \
jdk.dynalink \
jdk.editpad \
+ jdk.hotspot.agent \
jdk.httpserver \
jdk.incubator.httpclient \
jdk.jartool \
@@ -298,7 +299,8 @@
$(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
################################################################################
-# Extract module dependencies from module-info.java files.
+# Extract module dependencies from module-info.java files, both normal
+# dependencies ("requires"), and indirect exports ("requires transitive").
MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
@@ -320,17 +322,31 @@
gsub(/^ +\*.*/, ""); \
gsub(/ /, ""); \
printf(" %s", $$0) } \
+ END { printf("\n") }' $m && \
+ $(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) :=" && \
+ $(NAWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
+ BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
+ /^ *requires *transitive/ { \
+ sub(/;/, ""); \
+ sub(/requires/, ""); \
+ sub(/transitive/, ""); \
+ sub(/\/\/.*/, ""); \
+ sub(/\/\*.*\*\//, ""); \
+ gsub(/^ +\*.*/, ""); \
+ gsub(/ /, ""); \
+ printf(" %s", $$0) } \
END { printf("\n") }' $m \
) >> $@ $(NEWLINE))
-include $(MODULE_DEPS_MAKEFILE)
-# Param 1: Module to find deps for
+# Find dependencies ("requires") for a given module.
+# Param 1: Module to find dependencies for.
FindDepsForModule = \
$(DEPS_$(strip $1))
-# Finds transitive dependencies in 3 levels.
-# Param 1: Module to find transitive deps for
+# Find dependencies ("requires") transitively in 3 levels for a given module.
+# Param 1: Module to find dependencies for.
FindTransitiveDepsForModule = \
$(sort $(call FindDepsForModule, $1) \
$(foreach m, $(call FindDepsForModule, $1), \
@@ -338,11 +354,30 @@
$(foreach n, $(call FindDepsForModule, $m), \
$(call FindDepsForModule, $n))))
-# Finds transitive dependencies in 3 levels for a set of modules.
-# Param 1: List of modules to find transitive deps for
+# Find dependencies ("requires") transitively in 3 levels for a set of modules.
+# Param 1: List of modules to find dependencies for.
FindTransitiveDepsForModules = \
$(sort $(foreach m, $1, $(call FindTransitiveDepsForModule, $m)))
+# Find indirect exported modules ("requires transitive") for a given module .
+# Param 1: Module to find indirect exported modules for.
+FindIndirectExportsForModule = \
+ $(TRANSITIVE_MODULES_$(strip $1))
+
+# Finds indirect exported modules transitively in 3 levels for a given module.
+# Param 1: Module to find indirect exported modules for.
+FindTransitiveIndirectDepsForModule = \
+ $(sort $(call FindIndirectExportsForModule, $1) \
+ $(foreach m, $(call FindIndirectExportsForModule, $1), \
+ $(call FindIndirectExportsForModule, $m) \
+ $(foreach n, $(call FindIndirectExportsForModule, $m), \
+ $(call FindIndirectExportsForModule, $n))))
+
+# Finds indirect exported modules transitively in 3 levels for a set of modules.
+# Param 1: List of modules to find indirect exported modules for.
+FindTransitiveIndirectDepsForModules = \
+ $(sort $(foreach m, $1, $(call FindTransitiveIndirectDepsForModule, $m)))
+
# Upgradeable modules are those that are either defined as upgradeable or that
# require an upradeable module.
FindAllUpgradeableModules = \
--- a/make/common/ProcessMarkdown.gmk Thu Jun 01 08:59:24 2017 +0200
+++ b/make/common/ProcessMarkdown.gmk Wed Jul 05 23:32:39 2017 +0200
@@ -36,7 +36,7 @@
ifneq ($$(findstring http:/, $$($1_CSS)), )
$1_$2_CSS_OPTION := --css '$$($1_CSS)'
else
- $1_$2_CSS := $$(call RelativePath, $$($1_CSS), $$($1_$2_TARGET_DIR))
+ $1_$2_CSS := $$(strip $$(call RelativePath, $$($1_CSS), $$($1_$2_TARGET_DIR)))
$1_$2_CSS_OPTION := --css '$$($1_$2_CSS)'
endif
endif
@@ -51,7 +51,7 @@
$$(call LogInfo, Converting $2 to html)
$$(call MakeDir, $$($1_$2_TARGET_DIR) $$(SUPPORT_OUTPUTDIR)/markdown)
$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \
- $$(PANDOC) $$($1_OPTIONS) -f markdown -t html --standalone \
+ $$(PANDOC) $$($1_OPTIONS) -f markdown -t html5 --standalone \
$$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$<' -o '$$@')
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
--- a/make/common/SetupJavaCompilers.gmk Thu Jun 01 08:59:24 2017 +0200
+++ b/make/common/SetupJavaCompilers.gmk Wed Jul 05 23:32:39 2017 +0200
@@ -69,7 +69,7 @@
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
JVM := $(JAVA_JAVAC), \
JAVAC := $(NEW_JAVAC), \
- FLAGS := -source 10 -target 10 \
+ FLAGS := -source 10 -target 10 --doclint-format html5 \
-encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/InfiniteLoop.java Wed Jul 05 23:32:39 2017 +0200
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib;
+
+import java.util.Objects;
+
+/**
+ * Class which runs another Runnable in infinite loop with certain pauses
+ * between cycles.
+ */
+public class InfiniteLoop implements Runnable {
+ private final Runnable target;
+ private final long mills;
+
+
+ /**
+ * @param target a target to run in a loop
+ * @param mills the length of pause time in milliseconds
+ * @throws NullPointerException if target is null
+ * @throws IllegalArgumentException if the value of millis is negative
+ */
+ public InfiniteLoop(Runnable target, long mills) {
+ Objects.requireNonNull(target);
+ if (mills < 0) {
+ throw new IllegalArgumentException("mills < 0");
+ }
+ this.target = target;
+ this.mills = mills;
+ }
+
+ @Override
+ public void run() {
+ try {
+ while (true) {
+ target.run();
+ if (mills > 0) {
+ Thread.sleep(mills);
+ }
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new Error(e);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/RandomFactory.java Wed Jul 05 23:32:39 2017 +0200
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib;
+
+import java.util.Random;
+import java.util.SplittableRandom;
+
+/**
+ * Factory class which generates and prints to STDOUT a long-valued seed
+ * for use in initializing a PRNG. An instance of {@code Random} or
+ * {@code SplittableRandom} may likewise be obtained.
+ */
+public class RandomFactory {
+ /**
+ * Attempt to obtain the seed from the value of the "seed" property.
+ * @return The seed or {@code null} if the "seed" property was not set or
+ * could not be parsed.
+ */
+ private static Long getSystemSeed() {
+ Long seed = null;
+ try {
+ // note that Long.valueOf(null) also throws a
+ // NumberFormatException so if the property is undefined this
+ // will still work correctly
+ seed = Long.valueOf(System.getProperty("seed"));
+ } catch (NumberFormatException e) {
+ // do nothing: seed is still null
+ }
+
+ return seed;
+ }
+
+ /**
+ * Obtain a seed from an independent PRNG.
+ *
+ * @return A random seed.
+ */
+ private static long getRandomSeed() {
+ return new Random().nextLong();
+ }
+
+ /**
+ * Obtain and print to STDOUT a seed appropriate for initializing a PRNG.
+ * If the system property "seed" is set and has value which may be correctly
+ * parsed it is used, otherwise a seed is generated using an independent
+ * PRNG.
+ *
+ * @return The seed.
+ */
+ public static long getSeed() {
+ Long seed = getSystemSeed();
+ if (seed == null) {
+ seed = getRandomSeed();
+ }
+ System.out.println("Seed from RandomFactory = "+seed+"L");
+ return seed;
+ }
+
+ /**
+ * Obtain and print to STDOUT a seed and use it to initialize a new
+ * {@code Random} instance which is returned. If the system
+ * property "seed" is set and has value which may be correctly parsed it
+ * is used, otherwise a seed is generated using an independent PRNG.
+ *
+ * @return The {@code Random} instance.
+ */
+ public static Random getRandom() {
+ return new Random(getSeed());
+ }
+
+ /**
+ * Obtain and print to STDOUT a seed and use it to initialize a new
+ * {@code SplittableRandom} instance which is returned. If the system
+ * property "seed" is set and has value which may be correctly parsed it
+ * is used, otherwise a seed is generated using an independent PRNG.
+ *
+ * @return The {@code SplittableRandom} instance.
+ */
+ public static SplittableRandom getSplittableRandom() {
+ return new SplittableRandom(getSeed());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/TimeLimitedRunner.java Wed Jul 05 23:32:39 2017 +0200
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib;
+
+import java.util.Objects;
+import java.util.concurrent.Callable;
+
+/**
+ * Auxiliary class to run target w/ given timeout.
+ */
+public class TimeLimitedRunner implements Callable<Void> {
+ private final long stoptime;
+ private final long timeout;
+ private final double factor;
+ private final Callable<Boolean> target;
+
+ /**
+ * @param timeout a timeout. zero means no time limitation
+ * @param factor a multiplier used to estimate next iteration time
+ * @param target a target to run
+ * @throws NullPointerException if target is null
+ * @throws IllegalArgumentException if timeout is negative or
+ factor isn't positive
+ */
+ public TimeLimitedRunner(long timeout, double factor,
+ Callable<Boolean> target) {
+ Objects.requireNonNull(target, "target must not be null");
+ if (timeout < 0) {
+ throw new IllegalArgumentException("timeout[" + timeout + "] < 0");
+ }
+ if (factor <= 0d) {
+ throw new IllegalArgumentException("factor[" + factor + "] <= 0");
+ }
+ this.stoptime = System.currentTimeMillis() + timeout;
+ this.timeout = timeout;
+ this.factor = factor;
+ this.target = target;
+ }
+
+ /**
+ * Runs @{linkplan target} while it returns true and timeout isn't exceeded
+ */
+ @Override
+ public Void call() throws Exception {
+ long maxDuration = 0L;
+ long iterStart = System.currentTimeMillis();
+ if (timeout != 0 && iterStart > stoptime) {
+ return null;
+ }
+ while (target.call()) {
+ if (timeout != 0) {
+ long iterDuration = System.currentTimeMillis() - iterStart;
+ maxDuration = Math.max(maxDuration, iterDuration);
+ iterStart = System.currentTimeMillis();
+ if (iterStart + (maxDuration * factor) > stoptime) {
+ System.out.println("Not enough time to continue execution. "
+ + "Interrupted.");
+ break;
+ }
+ }
+ }
+ return null;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/util/FileUtils.java Wed Jul 05 23:32:39 2017 +0200
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib.util;
+
+import jdk.test.lib.Platform;
+
+import java.io.IOException;
+import java.nio.file.DirectoryNotEmptyException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * Common library for various test file utility functions.
+ */
+public final class FileUtils {
+ private static final boolean IS_WINDOWS = Platform.isWindows();
+ private static final int RETRY_DELETE_MILLIS = IS_WINDOWS ? 500 : 0;
+ private static final int MAX_RETRY_DELETE_TIMES = IS_WINDOWS ? 15 : 0;
+
+ /**
+ * Deletes a file, retrying if necessary.
+ *
+ * @param path the file to delete
+ *
+ * @throws NoSuchFileException
+ * if the file does not exist (optional specific exception)
+ * @throws DirectoryNotEmptyException
+ * if the file is a directory and could not otherwise be deleted
+ * because the directory is not empty (optional specific exception)
+ * @throws IOException
+ * if an I/O error occurs
+ */
+ public static void deleteFileWithRetry(Path path) throws IOException {
+ try {
+ deleteFileWithRetry0(path);
+ } catch (InterruptedException x) {
+ throw new IOException("Interrupted while deleting.", x);
+ }
+ }
+
+ /**
+ * Deletes a file, retrying if necessary.
+ * No exception thrown if file doesn't exist.
+ *
+ * @param path the file to delete
+ *
+ * @throws NoSuchFileException
+ * if the file does not exist (optional specific exception)
+ * @throws DirectoryNotEmptyException
+ * if the file is a directory and could not otherwise be deleted
+ * because the directory is not empty (optional specific exception)
+ * @throws IOException
+ * if an I/O error occurs
+ */
+ public static void deleteFileIfExistsWithRetry(Path path) throws IOException {
+ try {
+ if (Files.exists(path)) {
+ deleteFileWithRetry0(path);
+ }
+ } catch (InterruptedException x) {
+ throw new IOException("Interrupted while deleting.", x);
+ }
+ }
+
+ private static void deleteFileWithRetry0(Path path)
+ throws IOException, InterruptedException {
+ int times = 0;
+ IOException ioe = null;
+ while (true) {
+ try {
+ Files.delete(path);
+ while (Files.exists(path)) {
+ times++;
+ if (times > MAX_RETRY_DELETE_TIMES) {
+ throw new IOException("File still exists after " + times + " waits.");
+ }
+ Thread.sleep(RETRY_DELETE_MILLIS);
+ }
+ break;
+ } catch (NoSuchFileException | DirectoryNotEmptyException x) {
+ throw x;
+ } catch (IOException x) {
+ // Backoff/retry in case another process is accessing the file
+ times++;
+ if (ioe == null) {
+ ioe = x;
+ } else {
+ ioe.addSuppressed(x);
+ }
+
+ if (times > MAX_RETRY_DELETE_TIMES) {
+ throw ioe;
+ }
+ Thread.sleep(RETRY_DELETE_MILLIS);
+ }
+ }
+ }
+
+ /**
+ * Deletes a directory and its subdirectories, retrying if necessary.
+ *
+ * @param dir the directory to delete
+ *
+ * @throws IOException
+ * If an I/O error occurs. Any such exceptions are caught
+ * internally. If only one is caught, then it is re-thrown.
+ * If more than one exception is caught, then the second and
+ * following exceptions are added as suppressed exceptions of the
+ * first one caught, which is then re-thrown.
+ */
+ public static void deleteFileTreeWithRetry(Path dir) throws IOException {
+ IOException ioe = null;
+ final List<IOException> excs = deleteFileTreeUnchecked(dir);
+ if (!excs.isEmpty()) {
+ ioe = excs.remove(0);
+ for (IOException x : excs) {
+ ioe.addSuppressed(x);
+ }
+ }
+ if (ioe != null) {
+ throw ioe;
+ }
+ }
+
+ public static List<IOException> deleteFileTreeUnchecked(Path dir) {
+ final List<IOException> excs = new ArrayList<>();
+ try {
+ java.nio.file.Files.walkFileTree(dir, new SimpleFileVisitor<>() {
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
+ try {
+ deleteFileWithRetry0(file);
+ } catch (IOException x) {
+ excs.add(x);
+ } catch (InterruptedException x) {
+ excs.add(new IOException("Interrupted while deleting.", x));
+ return FileVisitResult.TERMINATE;
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
+ try {
+ deleteFileWithRetry0(dir);
+ } catch (IOException x) {
+ excs.add(x);
+ } catch (InterruptedException x) {
+ excs.add(new IOException("Interrupted while deleting.", x));
+ return FileVisitResult.TERMINATE;
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ @Override
+ public FileVisitResult visitFileFailed(Path file, IOException exc) {
+ excs.add(exc);
+ return FileVisitResult.CONTINUE;
+ }
+ });
+ } catch (IOException x) {
+ excs.add(x);
+ }
+ return excs;
+ }
+
+ /**
+ * Checks whether all file systems are accessible. This is performed
+ * by checking free disk space on all mounted file systems via a
+ * separate, spawned process. File systems are considered to be
+ * accessible if this process completes successfully before a given
+ * fixed duration has elapsed.
+ *
+ * @implNote On Unix this executes the {@code df} command in a separate
+ * process and on Windows always returns {@code true}.
+ */
+ public static boolean areFileSystemsAccessible() throws IOException {
+ boolean areFileSystemsAccessible = true;
+ if (!IS_WINDOWS) {
+ // try to check whether 'df' hangs
+ System.out.println("\n--- df output ---");
+ System.out.flush();
+ Process proc = new ProcessBuilder("df").inheritIO().start();
+ try {
+ proc.waitFor(90, TimeUnit.SECONDS);
+ } catch (InterruptedException ignored) {
+ }
+ try {
+ int exitValue = proc.exitValue();
+ if (exitValue != 0) {
+ System.err.printf("df process exited with %d != 0%n",
+ exitValue);
+ areFileSystemsAccessible = false;
+ }
+ } catch (IllegalThreadStateException ignored) {
+ System.err.println("df command apparently hung");
+ areFileSystemsAccessible = false;
+ }
+ }
+ return areFileSystemsAccessible;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/util/JarUtils.java Wed Jul 05 23:32:39 2017 +0200
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib.util;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+
+/**
+ * Common library for various test jar file utility functions.
+ */
+public final class JarUtils {
+
+ /**
+ * Create jar file with specified files. If a specified file does not exist,
+ * a new jar entry will be created with the file name itself as the content.
+ */
+ public static void createJar(String dest, String... files)
+ throws IOException {
+ try (JarOutputStream jos = new JarOutputStream(
+ new FileOutputStream(dest), new Manifest())) {
+ for (String file : files) {
+ System.out.println(String.format("Adding %s to %s",
+ file, dest));
+
+ // add an archive entry, and write a file
+ jos.putNextEntry(new JarEntry(file));
+ try (FileInputStream fis = new FileInputStream(file)) {
+ fis.transferTo(jos);
+ } catch (FileNotFoundException e) {
+ jos.write(file.getBytes());
+ }
+ }
+ }
+ System.out.println();
+ }
+
+ /**
+ * Add or remove specified files to existing jar file. If a specified file
+ * to be updated or added does not exist, the jar entry will be created
+ * with the file name itself as the content.
+ *
+ * @param src the original jar file name
+ * @param dest the new jar file name
+ * @param files the files to update. The list is broken into 2 groups
+ * by a "-" string. The files before in the 1st group will
+ * be either updated or added. The files in the 2nd group
+ * will be removed. If no "-" exists, all files belong to
+ * the 1st group.
+ */
+ public static void updateJar(String src, String dest, String... files)
+ throws IOException {
+ try (JarOutputStream jos = new JarOutputStream(
+ new FileOutputStream(dest))) {
+
+ // copy each old entry into destination unless the entry name
+ // is in the updated list
+ List<String> updatedFiles = new ArrayList<>();
+ try (JarFile srcJarFile = new JarFile(src)) {
+ Enumeration<JarEntry> entries = srcJarFile.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry entry = entries.nextElement();
+ String name = entry.getName();
+ boolean found = false;
+ boolean update = true;
+ for (String file : files) {
+ if (file.equals("-")) {
+ update = false;
+ } else if (name.equals(file)) {
+ updatedFiles.add(file);
+ found = true;
+ break;
+ }
+ }
+
+ if (found) {
+ if (update) {
+ System.out.println(String.format("Updating %s with %s",
+ dest, name));
+ jos.putNextEntry(new JarEntry(name));
+ try (FileInputStream fis = new FileInputStream(name)) {
+ fis.transferTo(jos);
+ } catch (FileNotFoundException e) {
+ jos.write(name.getBytes());
+ }
+ } else {
+ System.out.println(String.format("Removing %s from %s",
+ name, dest));
+ }
+ } else {
+ System.out.println(String.format("Copying %s to %s",
+ name, dest));
+ jos.putNextEntry(entry);
+ srcJarFile.getInputStream(entry).transferTo(jos);
+ }
+ }
+ }
+
+ // append new files
+ for (String file : files) {
+ if (file.equals("-")) {
+ break;
+ }
+ if (!updatedFiles.contains(file)) {
+ System.out.println(String.format("Adding %s with %s",
+ dest, file));
+ jos.putNextEntry(new JarEntry(file));
+ try (FileInputStream fis = new FileInputStream(file)) {
+ fis.transferTo(jos);
+ } catch (FileNotFoundException e) {
+ jos.write(file.getBytes());
+ }
+ }
+ }
+ }
+ System.out.println();
+ }
+
+}
--- a/test/lib/jdk/test/lib/wrappers/InfiniteLoop.java Thu Jun 01 08:59:24 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.lib.wrappers;
-
-import java.util.Objects;
-
-/**
- * Class which runs another Runnable in infinite loop with certain pauses
- * between cycles.
- */
-public class InfiniteLoop implements Runnable {
- private final Runnable target;
- private final long mills;
-
-
- /**
- * @param target a target to run in a loop
- * @param mills the length of pause time in milliseconds
- * @throws NullPointerException if target is null
- * @throws IllegalArgumentException if the value of millis is negative
- */
- public InfiniteLoop(Runnable target, long mills) {
- Objects.requireNonNull(target);
- if (mills < 0) {
- throw new IllegalArgumentException("mills < 0");
- }
- this.target = target;
- this.mills = mills;
- }
-
- @Override
- public void run() {
- try {
- while (true) {
- target.run();
- if (mills > 0) {
- Thread.sleep(mills);
- }
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw new Error(e);
- }
- }
-}
--- a/test/lib/jdk/test/lib/wrappers/TimeLimitedRunner.java Thu Jun 01 08:59:24 2017 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test.lib.wrappers;
-
-import java.util.Objects;
-import java.util.concurrent.Callable;
-
-/**
- * Auxiliary class to run target w/ given timeout.
- */
-public class TimeLimitedRunner implements Callable<Void> {
- private final long stoptime;
- private final long timeout;
- private final double factor;
- private final Callable<Boolean> target;
-
- /**
- * @param timeout a timeout. zero means no time limitation
- * @param factor a multiplier used to estimate next iteration time
- * @param target a target to run
- * @throws NullPointerException if target is null
- * @throws IllegalArgumentException if timeout is negative or
- factor isn't positive
- */
- public TimeLimitedRunner(long timeout, double factor,
- Callable<Boolean> target) {
- Objects.requireNonNull(target, "target must not be null");
- if (timeout < 0) {
- throw new IllegalArgumentException("timeout[" + timeout + "] < 0");
- }
- if (factor <= 0d) {
- throw new IllegalArgumentException("factor[" + factor + "] <= 0");
- }
- this.stoptime = System.currentTimeMillis() + timeout;
- this.timeout = timeout;
- this.factor = factor;
- this.target = target;
- }
-
- /**
- * Runs @{linkplan target} while it returns true and timeout isn't exceeded
- */
- @Override
- public Void call() throws Exception {
- long maxDuration = 0L;
- long iterStart = System.currentTimeMillis();
- if (timeout != 0 && iterStart > stoptime) {
- return null;
- }
- while (target.call()) {
- if (timeout != 0) {
- long iterDuration = System.currentTimeMillis() - iterStart;
- maxDuration = Math.max(maxDuration, iterDuration);
- iterStart = System.currentTimeMillis();
- if (iterStart + (maxDuration * factor) > stoptime) {
- System.out.println("Not enough time to continue execution. "
- + "Interrupted.");
- break;
- }
- }
- }
- return null;
- }
-
-}