mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-12 12:29:41 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85c79a084b | ||
|
|
32b6f56a09 | ||
|
|
254bdae9a4 | ||
|
|
754f92e386 | ||
|
|
ee529c38cc | ||
|
|
b1cf0b26ed | ||
|
|
69b44cdd35 | ||
|
|
8b074ca357 | ||
|
|
54e6516236 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +0,0 @@
|
||||
* -text
|
||||
1517
.github/workflows/submit.yml
vendored
1517
.github/workflows/submit.yml
vendored
File diff suppressed because it is too large
Load Diff
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,7 @@ JTreport
|
||||
.idea/modules.xml
|
||||
.idea/shelf/
|
||||
JetBrainsRuntime.iml
|
||||
build/
|
||||
# Project exclude paths
|
||||
/jb/project/java-gradle/.gradle/
|
||||
/build/
|
||||
@@ -23,4 +24,3 @@ test/nashorn/lib
|
||||
NashornProfile.txt
|
||||
**/JTreport/**
|
||||
**/JTwork/**
|
||||
/jb/project/java-gradle/.idea/workspace.xml
|
||||
|
||||
28
.hgtags
28
.hgtags
@@ -613,31 +613,3 @@ e872676174c7f171a9864becba83cb783cfec9d0 jdk-11.0.9+9
|
||||
4fd46d208f0a4b55924af8e0c2fb6bcf46e18ec6 jdk-11.0.9.1+0
|
||||
27723943c0dd65a191cbefe031cec001521e4b13 jdk-11.0.9.1+1
|
||||
31affc22b3b5f5d43783ffadf57f22848bad9db8 jdk-11.0.9.1-ga
|
||||
f3168de4eb0dd74bf8e81537f62742bde5e412c3 jdk-11.0.10+1
|
||||
a35aa07b57bab3690224e3af939ee085d50eb476 jdk-11.0.10+2
|
||||
bca12c00a776f8cee7a0eeaf788499b9eab9cf9d jdk-11.0.10+3
|
||||
9504fa6f98f5aad0aa1ac36d5bff3260a32020c8 jdk-11.0.10+4
|
||||
5f5c3544ccb4d0bbc638e665524b292860dd9515 jdk-11.0.10+5
|
||||
4b9bc2a1dde0631958393125997855382325964d jdk-11.0.10+6
|
||||
c45f74d45787a857d35b5a66c9b0304c91a9c5d0 jdk-11.0.10+7
|
||||
43428f69099f6f87f6e1922deacbf13e1adb751f jdk-11.0.10+8
|
||||
8b3498547395ee80a6e731078056b2aeb3e3c5e8 jdk-11.0.10+9
|
||||
8b3498547395ee80a6e731078056b2aeb3e3c5e8 jdk-11.0.10-ga
|
||||
4ed322bf6b0098353ceaecf35662fadf457cd81d jdk-11.0.11+1
|
||||
b68647c6ecc1e73111d8047448d75966f255460f jdk-11.0.11+2
|
||||
14cc036b17a5f4be5b0643e6b24ed32563684ab9 jdk-11.0.11+3
|
||||
c4405735470a92e2c45490b89a8099252f3481d2 jdk-11.0.11+4
|
||||
38430a8a4488582612c6a87ab58d109cc5217e8b jdk-11.0.11+5
|
||||
e41ae00add1d76a8f25adb558933382947ea840d jdk-11.0.11+6
|
||||
14f9928caac31368d27f13e4e21ca25c1e0be950 jdk-11.0.11+7
|
||||
9f0347b029d3a0349f23befcfb68ee02d85d9034 jdk-11.0.11+8
|
||||
15862747ee15445292b4b9949b4f0f4badba4812 jdk-11.0.11+9
|
||||
15862747ee15445292b4b9949b4f0f4badba4812 jdk-11.0.11-ga
|
||||
5720ffa08f8514b9f0ea8b3a49e05a872c9c0efe jdk-11.0.12+1
|
||||
70a4031a8bef3e693f34864fdd482429c73dc76a jdk-11.0.12+2
|
||||
873a691b1ae4fa8b55ca5d08fa21aca3a4904fb8 jdk-11.0.12+3
|
||||
40d1e784e1937aaea696a9654cc2d944d3d78996 jdk-11.0.12+4
|
||||
6aa6f6860508fca3a97aea1de7a36574498d22bf jdk-11.0.12+5
|
||||
91e81ac088545abdc3eaaa707853d31a6cf99af3 jdk-11.0.12+6
|
||||
f412f2537f1502a9697a9684c77bea8d848db1ab jdk-11.0.12+7
|
||||
f412f2537f1502a9697a9684c77bea8d848db1ab jdk-11.0.12-ga
|
||||
|
||||
6
.idea/copyright/JetBrains.xml
generated
6
.idea/copyright/JetBrains.xml
generated
@@ -1,7 +1,9 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="allowReplaceRegexp" value="JetBrains" />
|
||||
<option name="notice" value="Copyright 2000-&#36;today.year JetBrains s.r.o. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions." />
|
||||
<option name="notice" value="Copyright 2000-&#36;today.year JetBrains s.r.o. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="allowReplaceKeyword" value="JetBrains" />
|
||||
<option name="myName" value="JetBrains" />
|
||||
<option name="myLocal" value="true" />
|
||||
</copyright>
|
||||
</component>
|
||||
33
.jcheck/conf
33
.jcheck/conf
@@ -1,31 +1,2 @@
|
||||
[general]
|
||||
project=jdk-updates
|
||||
jbs=JDK
|
||||
version=11.0.15
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
|
||||
|
||||
[repository]
|
||||
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)
|
||||
branches=
|
||||
|
||||
[census]
|
||||
version=0
|
||||
domain=openjdk.org
|
||||
|
||||
[checks "whitespace"]
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java
|
||||
|
||||
[checks "merge"]
|
||||
message=Merge
|
||||
|
||||
[checks "reviewers"]
|
||||
reviewers=1
|
||||
ignore=duke
|
||||
|
||||
[checks "committer"]
|
||||
role=committer
|
||||
|
||||
[checks "issues"]
|
||||
pattern=^([124-8][0-9]{6}): (\S.*)$
|
||||
project=jdk10
|
||||
bugids=dup
|
||||
|
||||
95
README.md
95
README.md
@@ -1,7 +1,94 @@
|
||||
[](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
|
||||
|
||||
# Welcome to JetBrains Runtime!
|
||||
<a name="jetbrains-runtime"></a>
|
||||
# Downloads
|
||||
|
||||
Do not use this branch. It is [outdated](https://youtrack.jetbrains.com/issue/JBR-4375/New-branch-naming-policy-in-JBR-repo).
|
||||
Please use [jbr11](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr11) instead.
|
||||
|Windows-x64 |macOS |Linux-x64 |
|
||||
|-------------|-------------|-------------|
|
||||
|[  ](https://bintray.com/jetbrains/intellij-jdk/openjdk11-windows-x64/_latestVersion)|[  ](https://bintray.com/jetbrains/intellij-jdk/openjdk11-osx-x64/_latestVersion)|[  ](https://bintray.com/jetbrains/intellij-jdk/openjdk11-linux-x64/_latestVersion)|
|
||||
|
||||
|
||||
# How JetBrains Runtime is organised
|
||||
## Workspaces
|
||||
|
||||
[github.com/JetBrains/JetBrainsRuntime](https://github.com/JetBrains/JetBrainsRuntime)
|
||||
|
||||
## Getting sources
|
||||
__OSX, Linux:__
|
||||
```
|
||||
git config --global core.autocrlf input
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
```
|
||||
|
||||
__Windows:__
|
||||
```
|
||||
git config --global core.autocrlf false
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
```
|
||||
|
||||
# Configure Local Build Environment
|
||||
[OpenJDK build docs](http://hg.openjdk.java.net/jdk/jdk11/raw-file/tip/doc/building.html)
|
||||
Tip for all platforms: run ./configure and check output.
|
||||
Usually, it has meaningful advice how to solve your problem.
|
||||
|
||||
## Linux (docker)
|
||||
```
|
||||
$ cd jb/project/docker
|
||||
$ docker build .
|
||||
...
|
||||
Successfully built 942ea9900054
|
||||
|
||||
$ docker run -v `pwd`../../../../:/JetBrainsRuntime -it 942ea9900054
|
||||
|
||||
# cd /JetBrainsRuntime
|
||||
# sh ./configure
|
||||
# make images CONF=linux-x86_64-normal-server-release
|
||||
|
||||
```
|
||||
|
||||
## Linux (Ubuntu 18.10 desktop)
|
||||
```
|
||||
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev
|
||||
|
||||
$ cd JetBrainsRuntime
|
||||
$ sh ./configure --disable-warnings-as-errors
|
||||
$ make images
|
||||
```
|
||||
|
||||
## Windows
|
||||
Install:
|
||||
|
||||
* [Cygwin x64](http://www.cygwin.com/)
|
||||
Required packages: autoconf, binutils, cpio, diffutils, file, gawk, gcc-core, make, m4, unzip, zip.
|
||||
**Install them while installing cygwin**.
|
||||
* Visual Studio compiler toolset [Download](https://visualstudio.microsoft.com/downloads/)
|
||||
Visual Studio 2015 has support by default.
|
||||
**Install with desktop development kit, it includes Windows SDK and compilers**.
|
||||
* [Java 11](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
|
||||
If you have problems while configuring [read java tips on cygwin](http://horstmann.com/articles/cygwin-tips.html)
|
||||
|
||||
From command line
|
||||
```
|
||||
"c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
"c:\Program_Files\cygwin64\bin\mintty.exe" /bin/bash -l
|
||||
```
|
||||
First command will set env vars, the second will run cygwin shell with proper environment.
|
||||
In cygwin shell
|
||||
```
|
||||
cd JetBrainsRuntime
|
||||
bash configure --enable-option-checking=fatal --with-toolchain-version=2015 --with-boot-jdk="/cygdrive/c/Program Files/Java/jdk-11.0.5" --disable-warnings-as-errors
|
||||
make images
|
||||
```
|
||||
|
||||
## OSX
|
||||
|
||||
install Xcode console tools, autoconf (via homebrew)
|
||||
|
||||
run
|
||||
|
||||
```
|
||||
sh ./configure --prefix=$(pwd)/build --disable-warnings-as-errors
|
||||
make images
|
||||
```
|
||||
|
||||
## Contribution
|
||||
We will be happy to receive your pull requests. Before you submit one, please sign our Contributor License Agreement (CLA) https://www.jetbrains.com/agreements/cla/
|
||||
|
||||
@@ -68,12 +68,10 @@
|
||||
</ul></li>
|
||||
<li><a href="#running-tests">Running Tests</a></li>
|
||||
<li><a href="#cross-compiling">Cross-compiling</a><ul>
|
||||
<li><a href="#cross-compiling-the-easy-way-with-openjdk-devkits">Cross compiling the easy way with OpenJDK devkits</a></li>
|
||||
<li><a href="#boot-jdk-and-build-jdk">Boot JDK and Build JDK</a></li>
|
||||
<li><a href="#specifying-the-target-platform">Specifying the Target Platform</a></li>
|
||||
<li><a href="#toolchain-considerations">Toolchain Considerations</a></li>
|
||||
<li><a href="#native-libraries">Native Libraries</a></li>
|
||||
<li><a href="#creating-and-using-sysroots-with-qemu-deboostrap">Creating And Using Sysroots With qemu-deboostrap</a></li>
|
||||
<li><a href="#building-for-armaarch64">Building for ARM/aarch64</a></li>
|
||||
<li><a href="#verifying-the-build">Verifying the Build</a></li>
|
||||
</ul></li>
|
||||
@@ -93,10 +91,12 @@
|
||||
<li><a href="#getting-help">Getting Help</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#hints-and-suggestions-for-advanced-users">Hints and Suggestions for Advanced Users</a><ul>
|
||||
<li><a href="#setting-up-a-forest-for-pushing-changes-defpath">Setting Up a Forest for Pushing Changes (defpath)</a></li>
|
||||
<li><a href="#bash-completion">Bash Completion</a></li>
|
||||
<li><a href="#using-multiple-configurations">Using Multiple Configurations</a></li>
|
||||
<li><a href="#handling-reconfigurations">Handling Reconfigurations</a></li>
|
||||
<li><a href="#using-fine-grained-make-targets">Using Fine-Grained Make Targets</a></li>
|
||||
<li><a href="#learn-about-mercurial">Learn About Mercurial</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#understanding-the-build-system">Understanding the Build System</a><ul>
|
||||
<li><a href="#configurations">Configurations</a></li>
|
||||
@@ -110,10 +110,10 @@
|
||||
</ul>
|
||||
</nav>
|
||||
<h2 id="tldr-instructions-for-the-impatient">TL;DR (Instructions for the Impatient)</h2>
|
||||
<p>If you are eager to try out building the JDK, these simple steps works most of the time. They assume that you have installed Git (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build.</p>
|
||||
<p>If you are eager to try out building the JDK, these simple steps works most of the time. They assume that you have installed Mercurial (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build.</p>
|
||||
<ol type="1">
|
||||
<li><p><a href="#getting-the-source-code">Get the complete source code</a>:<br />
|
||||
<code>git clone https://git.openjdk.java.net/jdk/</code></p></li>
|
||||
<code>hg clone http://hg.openjdk.java.net/jdk/jdk</code></p></li>
|
||||
<li><p><a href="#running-configure">Run configure</a>:<br />
|
||||
<code>bash configure</code></p>
|
||||
<p>If <code>configure</code> fails due to missing dependencies (to either the <a href="#native-compiler-toolchain-requirements">toolchain</a>, <a href="#build-tools-requirements">build tools</a>, <a href="#external-library-requirements">external libraries</a> or the <a href="#boot-jdk-requirements">boot JDK</a>), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running <code>bash configure</code> again.</p></li>
|
||||
@@ -129,8 +129,8 @@
|
||||
<p>The JDK is a complex software project. Building it requires a certain amount of technical expertise, a fair number of dependencies on external software, and reasonably powerful hardware.</p>
|
||||
<p>If you just want to use the JDK and not build it yourself, this document is not for you. See for instance <a href="http://openjdk.java.net/install">OpenJDK installation</a> for some methods of installing a prebuilt JDK.</p>
|
||||
<h2 id="getting-the-source-code">Getting the Source Code</h2>
|
||||
<p>Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the <a href="https://git.openjdk.java.net/">OpenJDK Git site</a> you can see a list of all available repositories. If you want to build an older version, e.g. JDK 8, it is recommended that you get the <code>jdk8u</code> forest, which contains incremental updates, instead of the <code>jdk8</code> forest, which was frozen at JDK 8 GA.</p>
|
||||
<p>If you are new to Git, a good place to start is the book <a href="https://git-scm.com/book/en/v2">Pro Git</a>. The rest of this document assumes a working knowledge of Git.</p>
|
||||
<p>Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the <a href="http://hg.openjdk.java.net/">OpenJDK Mercurial server</a> you can see a list of all available forests. If you want to build an older version, e.g. JDK 8, it is recommended that you get the <code>jdk8u</code> forest, which contains incremental updates, instead of the <code>jdk8</code> forest, which was frozen at JDK 8 GA.</p>
|
||||
<p>If you are new to Mercurial, a good place to start is the <a href="http://www.mercurial-scm.org/guide">Mercurial Beginner's Guide</a>. The rest of this document assumes a working knowledge of Mercurial.</p>
|
||||
<h3 id="special-considerations">Special Considerations</h3>
|
||||
<p>For a smooth building experience, it is recommended that you follow these rules on where and how to check out the source code.</p>
|
||||
<ul>
|
||||
@@ -141,11 +141,7 @@
|
||||
<ul>
|
||||
<li><p>Create the directory that is going to contain the top directory of the JDK clone by using the <code>mkdir</code> command in the Cygwin bash shell. That is, do <em>not</em> create it using Windows Explorer. This will ensure that it will have proper Cygwin attributes, and that it's children will inherit those attributes.</p></li>
|
||||
<li><p>Do not put the JDK clone in a path under your Cygwin home directory. This is especially important if your user name contains spaces and/or mixed upper and lower case letters.</p></li>
|
||||
<li><p>You need to install a git client. You have two choices, Cygwin git or Git for Windows. Unfortunately there are pros and cons with each choice.</p>
|
||||
<ul>
|
||||
<li><p>The Cygwin <code>git</code> client has no line ending issues and understands Cygwin paths (which are used throughout the JDK build system). However, it does not currently work well with the Skara CLI tooling. Please see the <a href="https://wiki.openjdk.java.net/display/SKARA/Skara#Skara-Git">Skara wiki on Git clients</a> for up-to-date information about the Skara git client support.</p></li>
|
||||
<li><p>The <a href="https://gitforwindows.org">Git for Windows</a> client has issues with line endings, and do not understand Cygwin paths. It does work well with the Skara CLI tooling, however. To alleviate the line ending problems, make sure you set <code>core.autocrlf</code> to <code>false</code> (this is asked during installation).</p></li>
|
||||
</ul></li>
|
||||
<li><p>Clone the JDK repository using the Cygwin command line <code>hg</code> client as instructed in this document. That is, do <em>not</em> use another Mercurial client such as TortoiseHg.</p></li>
|
||||
</ul>
|
||||
<p>Failure to follow this procedure might result in hard-to-debug build problems.</p></li>
|
||||
</ul>
|
||||
@@ -195,7 +191,7 @@
|
||||
<p>Windows XP is not a supported platform, but all newer Windows should be able to build the JDK.</p>
|
||||
<p>On Windows, it is important that you pay attention to the instructions in the <a href="#special-considerations">Special Considerations</a>.</p>
|
||||
<p>Windows is the only non-POSIX OS supported by the JDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. Currently, the only supported such layer is Cygwin. (Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require effort to implement.)</p>
|
||||
<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/git/jdk/Makefile</code> rather than <code>C:\git\jdk\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p>
|
||||
<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p>
|
||||
<h4 id="cygwin">Cygwin</h4>
|
||||
<p>A functioning <a href="http://www.cygwin.com/">Cygwin</a> environment is thus required for building the JDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.</p>
|
||||
<p><strong>Note:</strong> Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the JDK build process, and that can cause unexpected build problems.</p>
|
||||
@@ -357,7 +353,7 @@ cc: Sun C 5.13 SunOS_i386 2014/10/20
|
||||
$ CC -V
|
||||
CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
<h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
|
||||
<p>The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by <code>configure</code>. The maximum accepted version of Visual Studio is 2019. Versions older than 2017 are unlikely to continue working for long.</p>
|
||||
<p>The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by <code>configure</code>. The maximum accepted version of Visual Studio is 2017. Versions older than 2017 are unlikely to continue working for long.</p>
|
||||
<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2015</code>.</p>
|
||||
<p>If you get <code>LINK: fatal error LNK1123: failure during conversion to COFF: file invalid</code> when building using Visual Studio 2010, you have encountered <a href="http://support.microsoft.com/kb/2757355">KB2757355</a>, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See <a href="https://stackoverflow.com/questions/10888391">this stackoverflow discussion</a> for other suggestions.</p>
|
||||
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
|
||||
@@ -569,47 +565,6 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
<p>This requires a more complex setup and build procedure. This section assumes you are familiar with cross-compiling in general, and will only deal with the particularities of cross-compiling the JDK. If you are new to cross-compiling, please see the <a href="https://en.wikipedia.org/wiki/Cross_compiler#External_links">external links at Wikipedia</a> for a good start on reading materials.</p>
|
||||
<p>Cross-compiling the JDK requires you to be able to build both for the build platform and for the target platform. The reason for the former is that we need to build and execute tools during the build process, both native tools and Java tools.</p>
|
||||
<p>If all you want to do is to compile a 32-bit version, for the same OS, on a 64-bit machine, consider using <code>--with-target-bits=32</code> instead of doing a full-blown cross-compilation. (While this surely is possible, it's a lot more work and will take much longer to build.)</p>
|
||||
<h3 id="cross-compiling-the-easy-way-with-openjdk-devkits">Cross compiling the easy way with OpenJDK devkits</h3>
|
||||
<p>The OpenJDK build system provides out-of-the box support for creating and using so called devkits. A <code>devkit</code> is basically a collection of a cross-compiling toolchain and a sysroot environment which can easily be used together with the <code>--with-devkit</code> configure option to cross compile the OpenJDK. On Linux/x86_64, the following command:</p>
|
||||
<pre><code>bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64-linux-gnu && make</code></pre>
|
||||
<p>will configure and build OpenJDK for Linux/ppc64 assuming that <code><devkit-path></code> points to a Linux/x86_64 to Linux/ppc64 devkit.</p>
|
||||
<p>Devkits can be created from the <code>make/devkit</code> directory by executing:</p>
|
||||
<pre><code>make [ TARGETS="<TARGET_TRIPLET>+" ] [ BASE_OS=<OS> ] [ BASE_OS_VERSION=<VER> ]</code></pre>
|
||||
<p>where <code>TARGETS</code> contains one or more <code>TARGET_TRIPLET</code>s of the form described in <a href="https://sourceware.org/autobook/autobook/autobook_17.html">section 3.4 of the GNU Autobook</a>. If no targets are given, a native toolchain for the current platform will be created. Currently, at least the following targets are known to work:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Supported devkit targets</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>x86_64-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>aarch64-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>arm-linux-gnueabihf</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>ppc64-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>ppc64le-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>s390x-linux-gnu</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><code>BASE_OS</code> must be one of "OEL6" for Oracle Enterprise Linux 6 or "Fedora" (if not specified "OEL6" will be the default). If the base OS is "Fedora" the corresponding Fedora release can be specified with the help of the <code>BASE_OS_VERSION</code> option (with "27" as default version). If the build is successful, the new devkits can be found in the <code>build/devkit/result</code> subdirectory:</p>
|
||||
<pre><code>cd make/devkit
|
||||
make TARGETS="ppc64le-linux-gnu aarch64-linux-gnu" BASE_OS=Fedora BASE_OS_VERSION=21
|
||||
ls -1 ../../build/devkit/result/
|
||||
x86_64-linux-gnu-to-aarch64-linux-gnu
|
||||
x86_64-linux-gnu-to-ppc64le-linux-gnu</code></pre>
|
||||
<p>Notice that devkits are not only useful for targeting different build platforms. Because they contain the full build dependencies for a system (i.e. compiler and root file system), they can easily be used to build well-known, reliable and reproducible build environments. You can for example create and use a devkit with GCC 7.3 and a Fedora 12 sysroot environment (with glibc 2.11) on Ubuntu 14.04 (which doesn't have GCC 7.3 by default) to produce OpenJDK binaries which will run on all Linux systems with runtime libraries newer than the ones from Fedora 12 (e.g. Ubuntu 16.04, SLES 11 or RHEL 6).</p>
|
||||
<h3 id="boot-jdk-and-build-jdk">Boot JDK and Build JDK</h3>
|
||||
<p>When cross-compiling, make sure you use a boot JDK that runs on the <em>build</em> system, and not on the <em>target</em> system.</p>
|
||||
<p>To be able to build, we need a "Build JDK", which is a JDK built from the current sources (that is, the same as the end result of the entire build process), but able to run on the <em>build</em> system, and not the <em>target</em> system. (In contrast, the Boot JDK should be from an older release, e.g. JDK 8 when building JDK 9.)</p>
|
||||
@@ -679,85 +634,6 @@ cp: cannot stat `arm-linux-gnueabihf/libSM.so': No such file or directory
|
||||
cp: cannot stat `arm-linux-gnueabihf/libXt.so': No such file or directory</code></pre></li>
|
||||
<li><p>If the X11 libraries are not properly detected by <code>configure</code>, you can point them out by <code>--with-x</code>.</p></li>
|
||||
</ul>
|
||||
<h3 id="creating-and-using-sysroots-with-qemu-deboostrap">Creating And Using Sysroots With qemu-deboostrap</h3>
|
||||
<p>Fortunately, you can create sysroots for foreign architectures with tools provided by your OS. On Debian/Ubuntu systems, one could use <code>qemu-deboostrap</code> to create the <em>target</em> system chroot, which would have the native libraries and headers specific to that <em>target</em> system. After that, we can use the cross-compiler on the <em>build</em> system, pointing into chroot to get the build dependencies right. This allows building for foreign architectures with native compilation speed.</p>
|
||||
<p>For example, cross-compiling to AArch64 from x86_64 could be done like this:</p>
|
||||
<ul>
|
||||
<li><p>Install cross-compiler on the <em>build</em> system:</p>
|
||||
<pre><code>apt install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu</code></pre></li>
|
||||
<li><p>Create chroot on the <em>build</em> system, configuring it for <em>target</em> system:</p>
|
||||
<pre><code>sudo qemu-debootstrap \
|
||||
--arch=arm64 \
|
||||
--verbose \
|
||||
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev \
|
||||
--resolve-deps \
|
||||
buster \
|
||||
~/sysroot-arm64 \
|
||||
http://httpredir.debian.org/debian/</code></pre></li>
|
||||
<li><p>Make sure the symlinks inside the newly created chroot point to proper locations:</p>
|
||||
<pre><code>sudo chroot ~/sysroot-arm64 symlinks -cr .</code></pre></li>
|
||||
<li><p>Configure and build with newly created chroot as sysroot/toolchain-path:</p>
|
||||
<pre><code>CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ sh ./configure \
|
||||
--openjdk-target=aarch64-linux-gnu \
|
||||
--with-sysroot=~/sysroot-arm64 \
|
||||
--with-toolchain-path=~/sysroot-arm64 \
|
||||
--with-freetype-lib=~/sysroot-arm64/usr/lib/aarch64-linux-gnu/ \
|
||||
--with-freetype-include=~/sysroot-arm64/usr/include/freetype2/ \
|
||||
--x-libraries=~/sysroot-arm64/usr/lib/aarch64-linux-gnu/
|
||||
make images
|
||||
ls build/linux-aarch64-normal-server-release/</code></pre></li>
|
||||
</ul>
|
||||
<p>The build does not create new files in that chroot, so it can be reused for multiple builds without additional cleanup.</p>
|
||||
<p>Architectures that are known to successfully cross-compile like this are:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th style="text-align: left;">Target</th>
|
||||
<th style="text-align: left;"><code>CC</code></th>
|
||||
<th style="text-align: left;"><code>CXX</code></th>
|
||||
<th><code>--arch=...</code></th>
|
||||
<th><code>--openjdk-target=...</code></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">x86</td>
|
||||
<td style="text-align: left;">default</td>
|
||||
<td style="text-align: left;">default</td>
|
||||
<td>i386</td>
|
||||
<td>i386-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">armhf</td>
|
||||
<td style="text-align: left;">gcc-arm-linux-gnueabihf</td>
|
||||
<td style="text-align: left;">g++-arm-linux-gnueabihf</td>
|
||||
<td>armhf</td>
|
||||
<td>arm-linux-gnueabihf</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">aarch64</td>
|
||||
<td style="text-align: left;">gcc-aarch64-linux-gnu</td>
|
||||
<td style="text-align: left;">g++-aarch64-linux-gnu</td>
|
||||
<td>arm64</td>
|
||||
<td>aarch64-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">ppc64el</td>
|
||||
<td style="text-align: left;">gcc-powerpc64le-linux-gnu</td>
|
||||
<td style="text-align: left;">g++-powerpc64le-linux-gnu</td>
|
||||
<td>ppc64el</td>
|
||||
<td>powerpc64le-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">s390x</td>
|
||||
<td style="text-align: left;">gcc-s390x-linux-gnu</td>
|
||||
<td style="text-align: left;">g++-s390x-linux-gnu</td>
|
||||
<td>s390x</td>
|
||||
<td>s390x-linux-gnu</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Additional architectures might be supported by Debian/Ubuntu Ports.</p>
|
||||
<h3 id="building-for-armaarch64">Building for ARM/aarch64</h3>
|
||||
<p>A common cross-compilation target is the ARM CPU. When building for ARM, it is useful to set the ABI profile. A number of pre-defined ABI profiles are available using <code>--with-abi-profile</code>: arm-vfp-sflt, arm-vfp-hflt, arm-sflt, armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer properly supported by the JDK.</p>
|
||||
<p>The JDK contains two different ports for the aarch64 platform, one is the original aarch64 port from the <a href="http://openjdk.java.net/projects/aarch64-port">AArch64 Port Project</a> and one is a 64-bit version of the Oracle contributed ARM port. When targeting aarch64, by the default the original aarch64 port is used. To select the Oracle ARM 64 port, use <code>--with-cpu-port=arm64</code>. Also set the corresponding value (<code>aarch64</code> or <code>arm64</code>) to --with-abi-profile, to ensure a consistent build.</p>
|
||||
@@ -804,14 +680,14 @@ ls build/linux-aarch64-normal-server-release/</code></pre></li>
|
||||
|
||||
=== Output from failing command(s) repeated here ===
|
||||
* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o:
|
||||
/localhome/git/jdk-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
|
||||
/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
|
||||
... (rest of output omitted)
|
||||
|
||||
* All command lines available in /localhome/git/jdk-sandbox/build/linux-x64/make-support/failure-logs.
|
||||
* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs.
|
||||
=== End of repeated output ===
|
||||
|
||||
=== Make failed targets repeated here ===
|
||||
lib/CompileJvm.gmk:207: recipe for target '/localhome/git/jdk-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
|
||||
lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
|
||||
make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed
|
||||
=== End of repeated output ===
|
||||
|
||||
@@ -834,11 +710,11 @@ Hint: If caused by a warning, try configure --disable-warnings-as-errors.</code>
|
||||
<p>Verify that the summary at the end looks correct. Are you indeed using the Boot JDK and native toolchain that you expect?</p>
|
||||
<p>By default, the JDK has a strict approach where warnings from the compiler is considered errors which fail the build. For very new or very old compiler versions, this can trigger new classes of warnings, which thus fails the build. Run <code>configure</code> with <code>--disable-warnings-as-errors</code> to turn of this behavior. (The warnings will still show, but not make the build fail.)</p>
|
||||
<h4 id="problems-with-incremental-rebuilds">Problems with Incremental Rebuilds</h4>
|
||||
<p>Incremental rebuilds mean that when you modify part of the product, only the affected parts get rebuilt. While this works great in most cases, and significantly speed up the development process, from time to time complex interdependencies will result in an incorrect build result. This is the most common cause for unexpected build problems.</p>
|
||||
<p>Incremental rebuilds mean that when you modify part of the product, only the affected parts get rebuilt. While this works great in most cases, and significantly speed up the development process, from time to time complex interdependencies will result in an incorrect build result. This is the most common cause for unexpected build problems, together with inconsistencies between the different Mercurial repositories in the forest.</p>
|
||||
<p>Here are a suggested list of things to try if you are having unexpected build problems. Each step requires more time than the one before, so try them in order. Most issues will be solved at step 1 or 2.</p>
|
||||
<ol type="1">
|
||||
<li><p>Make sure your repository is up-to-date</p>
|
||||
<p>Run <code>git pull origin master</code> to make sure you have the latest changes.</p></li>
|
||||
<li><p>Make sure your forest is up-to-date</p>
|
||||
<p>Run <code>bash get_source.sh</code> to make sure you have the latest version of all repositories.</p></li>
|
||||
<li><p>Clean build results</p>
|
||||
<p>The simplest way to fix incremental rebuild issues is to run <code>make clean</code>. This will remove all build results, but not the configuration or any build system support artifacts. In most cases, this will solve build errors resulting from incremental build mismatches.</p></li>
|
||||
<li><p>Completely clean the build directory.</p>
|
||||
@@ -847,8 +723,8 @@ Hint: If caused by a warning, try configure --disable-warnings-as-errors.</code>
|
||||
make dist-clean
|
||||
bash configure $(cat current-configuration)
|
||||
make</code></pre></li>
|
||||
<li><p>Re-clone the Git repository</p>
|
||||
<p>Sometimes the Git repository gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the "sledgehammer approach": delete the entire repository, and re-clone it. If you have local changes, save them first to a different location using <code>git format-patch</code>.</p></li>
|
||||
<li><p>Re-clone the Mercurial forest</p>
|
||||
<p>Sometimes the Mercurial repositories themselves gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the "sledgehammer approach": delete the entire forest, and re-clone it. If you have local changes, save them first to a different location using <code>hg export</code>.</p></li>
|
||||
</ol>
|
||||
<h3 id="specific-build-issues">Specific Build Issues</h3>
|
||||
<h4 id="clock-skew">Clock Skew</h4>
|
||||
@@ -870,6 +746,20 @@ spawn failed</code></pre>
|
||||
<p>If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to <a href="mailto:build-dev@openjdk.java.net">build-dev@openjdk.java.net</a>. Please include the relevant parts of the configure and/or build log.</p>
|
||||
<p>If you need general help or advice about developing for the JDK, you can also contact the Adoption Group. See the section on <a href="#contributing-to-openjdk">Contributing to OpenJDK</a> for more information.</p>
|
||||
<h2 id="hints-and-suggestions-for-advanced-users">Hints and Suggestions for Advanced Users</h2>
|
||||
<h3 id="setting-up-a-forest-for-pushing-changes-defpath">Setting Up a Forest for Pushing Changes (defpath)</h3>
|
||||
<p>To help you prepare a proper push path for a Mercurial repository, there exists a useful tool known as <a href="http://openjdk.java.net/projects/code-tools/defpath">defpath</a>. It will help you setup a proper push path for pushing changes to the JDK.</p>
|
||||
<p>Install the extension by cloning <code>http://hg.openjdk.java.net/code-tools/defpath</code> and updating your <code>.hgrc</code> file. Here's one way to do this:</p>
|
||||
<pre><code>cd ~
|
||||
mkdir hg-ext
|
||||
cd hg-ext
|
||||
hg clone http://hg.openjdk.java.net/code-tools/defpath
|
||||
cat << EOT >> ~/.hgrc
|
||||
[extensions]
|
||||
defpath=~/hg-ext/defpath/defpath.py
|
||||
EOT</code></pre>
|
||||
<p>You can now setup a proper push path using:</p>
|
||||
<pre><code>hg defpath -d -u <your OpenJDK username></code></pre>
|
||||
<p>If you also have the <code>trees</code> extension installed in Mercurial, you will automatically get a <code>tdefpath</code> command, which is even more useful. By running <code>hg tdefpath -du <username></code> in the top repository of your forest, all repos will get setup automatically. This is the recommended usage.</p>
|
||||
<h3 id="bash-completion">Bash Completion</h3>
|
||||
<p>The <code>configure</code> and <code>make</code> commands tries to play nice with bash command-line completion (using <code><tab></code> or <code><tab><tab></code>). To use this functionality, make sure you enable completion in your <code>~/.bashrc</code> (see instructions for bash in your operating system).</p>
|
||||
<p>Make completion will work out of the box, and will complete valid make targets. For instance, typing <code>make jdk-i<tab></code> will complete to <code>make jdk-image</code>.</p>
|
||||
@@ -923,6 +813,14 @@ sudo mv /tmp/configure /usr/local/bin</code></pre>
|
||||
<h4 id="rebuilding-part-of-java.base-jdk_filter">Rebuilding Part of java.base (JDK_FILTER)</h4>
|
||||
<p>If you are modifying files in <code>java.base</code>, which is the by far largest module in the JDK, then you need to rebuild all those files whenever a single file has changed. (This inefficiency will hopefully be addressed in JDK 10.)</p>
|
||||
<p>As a hack, you can use the make control variable <code>JDK_FILTER</code> to specify a pattern that will be used to limit the set of files being recompiled. For instance, <code>make java.base JDK_FILTER=javax/crypto</code> (or, to combine methods, <code>make java.base-java-only JDK_FILTER=javax/crypto</code>) will limit the compilation to files in the <code>javax.crypto</code> package.</p>
|
||||
<h3 id="learn-about-mercurial">Learn About Mercurial</h3>
|
||||
<p>To become an efficient JDK developer, it is recommended that you invest in learning Mercurial properly. Here are some links that can get you started:</p>
|
||||
<ul>
|
||||
<li><a href="http://www.mercurial-scm.org/wiki/GitConcepts">Mercurial for git users</a></li>
|
||||
<li><a href="http://www.mercurial-scm.org/wiki/Tutorial">The official Mercurial tutorial</a></li>
|
||||
<li><a href="http://hginit.com/">hg init</a></li>
|
||||
<li><a href="http://hgbook.red-bean.com/read/">Mercurial: The Definitive Guide</a></li>
|
||||
</ul>
|
||||
<h2 id="understanding-the-build-system">Understanding the Build System</h2>
|
||||
<p>This section will give you a more technical description on the details of the build system.</p>
|
||||
<h3 id="configurations">Configurations</h3>
|
||||
|
||||
223
doc/building.md
223
doc/building.md
@@ -3,11 +3,11 @@
|
||||
## TL;DR (Instructions for the Impatient)
|
||||
|
||||
If you are eager to try out building the JDK, these simple steps works most of
|
||||
the time. They assume that you have installed Git (and Cygwin if running
|
||||
the time. They assume that you have installed Mercurial (and Cygwin if running
|
||||
on Windows) and cloned the top-level JDK repository that you want to build.
|
||||
|
||||
1. [Get the complete source code](#getting-the-source-code): \
|
||||
`git clone https://git.openjdk.java.net/jdk/`
|
||||
`hg clone http://hg.openjdk.java.net/jdk/jdk`
|
||||
|
||||
2. [Run configure](#running-configure): \
|
||||
`bash configure`
|
||||
@@ -47,14 +47,14 @@ JDK.
|
||||
|
||||
Make sure you are getting the correct version. As of JDK 10, the source is no
|
||||
longer split into separate repositories so you only need to clone one single
|
||||
repository. At the [OpenJDK Git site](https://git.openjdk.java.net/) you
|
||||
can see a list of all available repositories. If you want to build an older version,
|
||||
repository. At the [OpenJDK Mercurial server](http://hg.openjdk.java.net/) you
|
||||
can see a list of all available forests. If you want to build an older version,
|
||||
e.g. JDK 8, it is recommended that you get the `jdk8u` forest, which contains
|
||||
incremental updates, instead of the `jdk8` forest, which was frozen at JDK 8 GA.
|
||||
|
||||
If you are new to Git, a good place to start is the book [Pro
|
||||
Git](https://git-scm.com/book/en/v2). The rest of this document
|
||||
assumes a working knowledge of Git.
|
||||
If you are new to Mercurial, a good place to start is the [Mercurial Beginner's
|
||||
Guide](http://www.mercurial-scm.org/guide). The rest of this document assumes a
|
||||
working knowledge of Mercurial.
|
||||
|
||||
### Special Considerations
|
||||
|
||||
@@ -89,21 +89,9 @@ on where and how to check out the source code.
|
||||
directory. This is especially important if your user name contains
|
||||
spaces and/or mixed upper and lower case letters.
|
||||
|
||||
* You need to install a git client. You have two choices, Cygwin git or
|
||||
Git for Windows. Unfortunately there are pros and cons with each choice.
|
||||
|
||||
* The Cygwin `git` client has no line ending issues and understands
|
||||
Cygwin paths (which are used throughout the JDK build system).
|
||||
However, it does not currently work well with the Skara CLI tooling.
|
||||
Please see the [Skara wiki on Git clients](
|
||||
https://wiki.openjdk.java.net/display/SKARA/Skara#Skara-Git) for
|
||||
up-to-date information about the Skara git client support.
|
||||
|
||||
* The [Git for Windows](https://gitforwindows.org) client has issues
|
||||
with line endings, and do not understand Cygwin paths. It does work
|
||||
well with the Skara CLI tooling, however. To alleviate the line ending
|
||||
problems, make sure you set `core.autocrlf` to `false` (this is asked
|
||||
during installation).
|
||||
* Clone the JDK repository using the Cygwin command line `hg` client
|
||||
as instructed in this document. That is, do *not* use another Mercurial
|
||||
client such as TortoiseHg.
|
||||
|
||||
Failure to follow this procedure might result in hard-to-debug build
|
||||
problems.
|
||||
@@ -183,7 +171,7 @@ supported due to a too old bash; msys2 and the new Windows Subsystem for Linux
|
||||
require effort to implement.)
|
||||
|
||||
Internally in the build system, all paths are represented as Unix-style paths,
|
||||
e.g. `/cygdrive/c/git/jdk/Makefile` rather than `C:\git\jdk\Makefile`. This
|
||||
e.g. `/cygdrive/c/hg/jdk9/Makefile` rather than `C:\hg\jdk9\Makefile`. This
|
||||
rule also applies to input to the build system, e.g. in arguments to
|
||||
`configure`. So, use `--with-msvcr-dll=/cygdrive/c/msvcr100.dll` rather than
|
||||
`--with-msvcr-dll=c:\msvcr100.dll`. For details on this conversion, see the section
|
||||
@@ -383,7 +371,7 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30
|
||||
|
||||
The minimum accepted version of Visual Studio is 2010. Older versions will not
|
||||
be accepted by `configure`. The maximum accepted version of Visual Studio is
|
||||
2019. Versions older than 2017 are unlikely to continue working for long.
|
||||
2017. Versions older than 2017 are unlikely to continue working for long.
|
||||
|
||||
If you have multiple versions of Visual Studio installed, `configure` will by
|
||||
default pick the latest. You can request a specific version to be used by
|
||||
@@ -887,64 +875,6 @@ If all you want to do is to compile a 32-bit version, for the same OS, on a
|
||||
full-blown cross-compilation. (While this surely is possible, it's a lot more
|
||||
work and will take much longer to build.)
|
||||
|
||||
### Cross compiling the easy way with OpenJDK devkits
|
||||
|
||||
The OpenJDK build system provides out-of-the box support for creating and using
|
||||
so called devkits. A `devkit` is basically a collection of a cross-compiling
|
||||
toolchain and a sysroot environment which can easily be used together with the
|
||||
`--with-devkit` configure option to cross compile the OpenJDK. On Linux/x86_64,
|
||||
the following command:
|
||||
```
|
||||
bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64-linux-gnu && make
|
||||
```
|
||||
|
||||
will configure and build OpenJDK for Linux/ppc64 assuming that `<devkit-path>`
|
||||
points to a Linux/x86_64 to Linux/ppc64 devkit.
|
||||
|
||||
Devkits can be created from the `make/devkit` directory by executing:
|
||||
```
|
||||
make [ TARGETS="<TARGET_TRIPLET>+" ] [ BASE_OS=<OS> ] [ BASE_OS_VERSION=<VER> ]
|
||||
```
|
||||
|
||||
where `TARGETS` contains one or more `TARGET_TRIPLET`s of the form
|
||||
described in [section 3.4 of the GNU Autobook](
|
||||
https://sourceware.org/autobook/autobook/autobook_17.html). If no
|
||||
targets are given, a native toolchain for the current platform will be
|
||||
created. Currently, at least the following targets are known to work:
|
||||
|
||||
Supported devkit targets
|
||||
------------------------
|
||||
x86_64-linux-gnu
|
||||
aarch64-linux-gnu
|
||||
arm-linux-gnueabihf
|
||||
ppc64-linux-gnu
|
||||
ppc64le-linux-gnu
|
||||
s390x-linux-gnu
|
||||
|
||||
`BASE_OS` must be one of "OEL6" for Oracle Enterprise Linux 6 or
|
||||
"Fedora" (if not specified "OEL6" will be the default). If the base OS
|
||||
is "Fedora" the corresponding Fedora release can be specified with the
|
||||
help of the `BASE_OS_VERSION` option (with "27" as default version).
|
||||
If the build is successful, the new devkits can be found in the
|
||||
`build/devkit/result` subdirectory:
|
||||
```
|
||||
cd make/devkit
|
||||
make TARGETS="ppc64le-linux-gnu aarch64-linux-gnu" BASE_OS=Fedora BASE_OS_VERSION=21
|
||||
ls -1 ../../build/devkit/result/
|
||||
x86_64-linux-gnu-to-aarch64-linux-gnu
|
||||
x86_64-linux-gnu-to-ppc64le-linux-gnu
|
||||
```
|
||||
|
||||
Notice that devkits are not only useful for targeting different build
|
||||
platforms. Because they contain the full build dependencies for a
|
||||
system (i.e. compiler and root file system), they can easily be used
|
||||
to build well-known, reliable and reproducible build environments. You
|
||||
can for example create and use a devkit with GCC 7.3 and a Fedora 12
|
||||
sysroot environment (with glibc 2.11) on Ubuntu 14.04 (which doesn't
|
||||
have GCC 7.3 by default) to produce OpenJDK binaries which will run on
|
||||
all Linux systems with runtime libraries newer than the ones from
|
||||
Fedora 12 (e.g. Ubuntu 16.04, SLES 11 or RHEL 6).
|
||||
|
||||
### Boot JDK and Build JDK
|
||||
|
||||
When cross-compiling, make sure you use a boot JDK that runs on the *build*
|
||||
@@ -1088,67 +1018,6 @@ Note that X11 is needed even if you only want to build a headless JDK.
|
||||
* If the X11 libraries are not properly detected by `configure`, you can
|
||||
point them out by `--with-x`.
|
||||
|
||||
### Creating And Using Sysroots With qemu-deboostrap
|
||||
|
||||
Fortunately, you can create sysroots for foreign architectures with tools
|
||||
provided by your OS. On Debian/Ubuntu systems, one could use `qemu-deboostrap` to
|
||||
create the *target* system chroot, which would have the native libraries and headers
|
||||
specific to that *target* system. After that, we can use the cross-compiler on the *build*
|
||||
system, pointing into chroot to get the build dependencies right. This allows building
|
||||
for foreign architectures with native compilation speed.
|
||||
|
||||
For example, cross-compiling to AArch64 from x86_64 could be done like this:
|
||||
|
||||
* Install cross-compiler on the *build* system:
|
||||
```
|
||||
apt install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
||||
```
|
||||
|
||||
* Create chroot on the *build* system, configuring it for *target* system:
|
||||
```
|
||||
sudo qemu-debootstrap \
|
||||
--arch=arm64 \
|
||||
--verbose \
|
||||
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev \
|
||||
--resolve-deps \
|
||||
buster \
|
||||
~/sysroot-arm64 \
|
||||
http://httpredir.debian.org/debian/
|
||||
```
|
||||
|
||||
* Make sure the symlinks inside the newly created chroot point to proper locations:
|
||||
```
|
||||
sudo chroot ~/sysroot-arm64 symlinks -cr .
|
||||
```
|
||||
|
||||
* Configure and build with newly created chroot as sysroot/toolchain-path:
|
||||
```
|
||||
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ sh ./configure \
|
||||
--openjdk-target=aarch64-linux-gnu \
|
||||
--with-sysroot=~/sysroot-arm64 \
|
||||
--with-toolchain-path=~/sysroot-arm64 \
|
||||
--with-freetype-lib=~/sysroot-arm64/usr/lib/aarch64-linux-gnu/ \
|
||||
--with-freetype-include=~/sysroot-arm64/usr/include/freetype2/ \
|
||||
--x-libraries=~/sysroot-arm64/usr/lib/aarch64-linux-gnu/
|
||||
make images
|
||||
ls build/linux-aarch64-normal-server-release/
|
||||
```
|
||||
|
||||
The build does not create new files in that chroot, so it can be reused for multiple builds
|
||||
without additional cleanup.
|
||||
|
||||
Architectures that are known to successfully cross-compile like this are:
|
||||
|
||||
Target `CC` `CXX` `--arch=...` `--openjdk-target=...`
|
||||
------------ ------------------------- --------------------------- ------------ ----------------------
|
||||
x86 default default i386 i386-linux-gnu
|
||||
armhf gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf armhf arm-linux-gnueabihf
|
||||
aarch64 gcc-aarch64-linux-gnu g++-aarch64-linux-gnu arm64 aarch64-linux-gnu
|
||||
ppc64el gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu ppc64el powerpc64le-linux-gnu
|
||||
s390x gcc-s390x-linux-gnu g++-s390x-linux-gnu s390x s390x-linux-gnu
|
||||
|
||||
Additional architectures might be supported by Debian/Ubuntu Ports.
|
||||
|
||||
### Building for ARM/aarch64
|
||||
|
||||
A common cross-compilation target is the ARM CPU. When building for ARM, it is
|
||||
@@ -1289,14 +1158,14 @@ ERROR: Build failed for target 'hotspot' in configuration 'linux-x64' (exit code
|
||||
|
||||
=== Output from failing command(s) repeated here ===
|
||||
* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o:
|
||||
/localhome/git/jdk-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
|
||||
/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
|
||||
... (rest of output omitted)
|
||||
|
||||
* All command lines available in /localhome/git/jdk-sandbox/build/linux-x64/make-support/failure-logs.
|
||||
* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs.
|
||||
=== End of repeated output ===
|
||||
|
||||
=== Make failed targets repeated here ===
|
||||
lib/CompileJvm.gmk:207: recipe for target '/localhome/git/jdk-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
|
||||
lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
|
||||
make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed
|
||||
=== End of repeated output ===
|
||||
|
||||
@@ -1386,15 +1255,17 @@ Incremental rebuilds mean that when you modify part of the product, only the
|
||||
affected parts get rebuilt. While this works great in most cases, and
|
||||
significantly speed up the development process, from time to time complex
|
||||
interdependencies will result in an incorrect build result. This is the most
|
||||
common cause for unexpected build problems.
|
||||
common cause for unexpected build problems, together with inconsistencies
|
||||
between the different Mercurial repositories in the forest.
|
||||
|
||||
Here are a suggested list of things to try if you are having unexpected build
|
||||
problems. Each step requires more time than the one before, so try them in
|
||||
order. Most issues will be solved at step 1 or 2.
|
||||
|
||||
1. Make sure your repository is up-to-date
|
||||
1. Make sure your forest is up-to-date
|
||||
|
||||
Run `git pull origin master` to make sure you have the latest changes.
|
||||
Run `bash get_source.sh` to make sure you have the latest version of all
|
||||
repositories.
|
||||
|
||||
2. Clean build results
|
||||
|
||||
@@ -1419,13 +1290,13 @@ order. Most issues will be solved at step 1 or 2.
|
||||
make
|
||||
```
|
||||
|
||||
4. Re-clone the Git repository
|
||||
4. Re-clone the Mercurial forest
|
||||
|
||||
Sometimes the Git repository gets in a state that causes the product
|
||||
to be un-buildable. In such a case, the simplest solution is often the
|
||||
"sledgehammer approach": delete the entire repository, and re-clone it.
|
||||
If you have local changes, save them first to a different location using
|
||||
`git format-patch`.
|
||||
Sometimes the Mercurial repositories themselves gets in a state that causes
|
||||
the product to be un-buildable. In such a case, the simplest solution is
|
||||
often the "sledgehammer approach": delete the entire forest, and re-clone
|
||||
it. If you have local changes, save them first to a different location
|
||||
using `hg export`.
|
||||
|
||||
### Specific Build Issues
|
||||
|
||||
@@ -1476,6 +1347,38 @@ contact the Adoption Group. See the section on [Contributing to OpenJDK](
|
||||
|
||||
## Hints and Suggestions for Advanced Users
|
||||
|
||||
### Setting Up a Forest for Pushing Changes (defpath)
|
||||
|
||||
To help you prepare a proper push path for a Mercurial repository, there exists
|
||||
a useful tool known as [defpath](
|
||||
http://openjdk.java.net/projects/code-tools/defpath). It will help you setup a
|
||||
proper push path for pushing changes to the JDK.
|
||||
|
||||
Install the extension by cloning
|
||||
`http://hg.openjdk.java.net/code-tools/defpath` and updating your `.hgrc` file.
|
||||
Here's one way to do this:
|
||||
|
||||
```
|
||||
cd ~
|
||||
mkdir hg-ext
|
||||
cd hg-ext
|
||||
hg clone http://hg.openjdk.java.net/code-tools/defpath
|
||||
cat << EOT >> ~/.hgrc
|
||||
[extensions]
|
||||
defpath=~/hg-ext/defpath/defpath.py
|
||||
EOT
|
||||
```
|
||||
|
||||
You can now setup a proper push path using:
|
||||
```
|
||||
hg defpath -d -u <your OpenJDK username>
|
||||
```
|
||||
|
||||
If you also have the `trees` extension installed in Mercurial, you will
|
||||
automatically get a `tdefpath` command, which is even more useful. By running
|
||||
`hg tdefpath -du <username>` in the top repository of your forest, all repos
|
||||
will get setup automatically. This is the recommended usage.
|
||||
|
||||
### Bash Completion
|
||||
|
||||
The `configure` and `make` commands tries to play nice with bash command-line
|
||||
@@ -1618,6 +1521,16 @@ instance, `make java.base JDK_FILTER=javax/crypto` (or, to combine methods,
|
||||
`make java.base-java-only JDK_FILTER=javax/crypto`) will limit the compilation
|
||||
to files in the `javax.crypto` package.
|
||||
|
||||
### Learn About Mercurial
|
||||
|
||||
To become an efficient JDK developer, it is recommended that you invest in
|
||||
learning Mercurial properly. Here are some links that can get you started:
|
||||
|
||||
* [Mercurial for git users](http://www.mercurial-scm.org/wiki/GitConcepts)
|
||||
* [The official Mercurial tutorial](http://www.mercurial-scm.org/wiki/Tutorial)
|
||||
* [hg init](http://hginit.com/)
|
||||
* [Mercurial: The Definitive Guide](http://hgbook.red-bean.com/read/)
|
||||
|
||||
## Understanding the Build System
|
||||
|
||||
This section will give you a more technical description on the details of the
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
<li><a href="#configuration">Configuration</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#test-selection">Test selection</a><ul>
|
||||
<li><a href="#common-test-groups">Common Test Groups</a></li>
|
||||
<li><a href="#jtreg">JTReg</a></li>
|
||||
<li><a href="#gtest">Gtest</a></li>
|
||||
</ul></li>
|
||||
@@ -60,19 +59,6 @@ $ make exploded-run-test TEST=tier2</code></pre>
|
||||
<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>
|
||||
<p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
|
||||
<h3 id="common-test-groups">Common Test Groups</h3>
|
||||
<p>Ideally, all tests are run for every change but this may not be practical due to the limited testing resources, the scope of the change, etc.</p>
|
||||
<p>The source tree currently defines a few common test groups in the relevant <code>TEST.groups</code> files. There are test groups that cover a specific component, for example <code>hotspot_gc</code>. It is a good idea to look into <code>TEST.groups</code> files to get a sense what tests are relevant to a particular JDK component.</p>
|
||||
<p>Component-specific tests may miss some unintended consequences of a change, so other tests should also be run. Again, it might be impractical to run all tests, and therefore <em>tiered</em> test groups exist. Tiered test groups are not component-specific, but rather cover the significant parts of the entire JDK.</p>
|
||||
<p>Multiple tiers allow balancing test coverage and testing costs. Lower test tiers are supposed to contain the simpler, quicker and more stable tests. Higher tiers are supposed to contain progressively more thorough, slower, and sometimes less stable tests, or the tests that require special configuration.</p>
|
||||
<p>Contributors are expected to run the tests for the areas that are changed, and the first N tiers they can afford to run, but at least tier1.</p>
|
||||
<p>A brief description of the tiered test groups:</p>
|
||||
<ul>
|
||||
<li><p><code>tier1</code>: This is the lowest test tier. Multiple developers run these tests every day. Because of the widespread use, the tests in <code>tier1</code> are carefully selected and optimized to run fast, and to run in the most stable manner. The test failures in <code>tier1</code> are usually followed up on quickly, either with fixes, or adding relevant tests to problem list. GitHub Actions workflows, if enabled, run <code>tier1</code> tests.</p></li>
|
||||
<li><p><code>tier2</code>: This test group covers even more ground. These contain, among other things, tests that either run for too long to be at <code>tier1</code>, or may require special configuration, or tests that are less stable, or cover the broader range of non-core JVM and JDK features/components (for example, XML).</p></li>
|
||||
<li><p><code>tier3</code>: This test group includes more stressful tests, the tests for corner cases not covered by previous tiers, plus the tests that require GUIs. As such, this suite should either be run with low concurrency (<code>TEST_JOBS=1</code>), or without headful tests (<code>JTREG_KEYWORDS=\!headful</code>), or both.</p></li>
|
||||
<li><p><code>tier4</code>: This test group includes every other test not covered by previous tiers. It includes, for example, <code>vmTestbase</code> suites for Hotspot, which run for many hours even on large machines. It also runs GUI tests, so the same <code>TEST_JOBS</code> and <code>JTREG_KEYWORDS</code> caveats apply.</p></li>
|
||||
</ul>
|
||||
<h3 id="jtreg">JTReg</h3>
|
||||
<p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
|
||||
<p>JTReg test groups can be specified either without a test root, e.g. <code>:tier1</code> (or <code>tier1</code>, the initial colon is optional), or with, e.g. <code>hotspot:tier1</code>, <code>test/jdk:jdk_util</code> or <code>$(TOPDIR)/test/hotspot/jtreg:hotspot_all</code>. The test root can be specified either as an absolute path, or a path relative to the JDK top directory, or the <code>test</code> directory. For simplicity, the hotspot JTReg test root, which really is <code>hotspot/jtreg</code> can be abbreviated as just <code>hotspot</code>.</p>
|
||||
@@ -156,8 +142,6 @@ TEST FAILURE</code></pre>
|
||||
<p>Additional VM options to JTReg (<code>-vmoption</code>).</p>
|
||||
<h4 id="aot_modules-1">AOT_MODULES</h4>
|
||||
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
<h4 id="retry_count">RETRY_COUNT</h4>
|
||||
<p>Retry failed tests up to a set number of times. Defaults to 0.</p>
|
||||
<h3 id="gtest-keywords">Gtest keywords</h3>
|
||||
<h4 id="repeat">REPEAT</h4>
|
||||
<p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
|
||||
|
||||
@@ -52,52 +52,6 @@ jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1`. You can
|
||||
always submit a list of fully qualified test descriptors in the `TEST` variable
|
||||
if you want to shortcut the parser.
|
||||
|
||||
### Common Test Groups
|
||||
|
||||
Ideally, all tests are run for every change but this may not be practical due to the limited
|
||||
testing resources, the scope of the change, etc.
|
||||
|
||||
The source tree currently defines a few common test groups in the relevant `TEST.groups`
|
||||
files. There are test groups that cover a specific component, for example `hotspot_gc`.
|
||||
It is a good idea to look into `TEST.groups` files to get a sense what tests are relevant
|
||||
to a particular JDK component.
|
||||
|
||||
Component-specific tests may miss some unintended consequences of a change, so other
|
||||
tests should also be run. Again, it might be impractical to run all tests, and therefore
|
||||
_tiered_ test groups exist. Tiered test groups are not component-specific, but rather cover
|
||||
the significant parts of the entire JDK.
|
||||
|
||||
Multiple tiers allow balancing test coverage and testing costs. Lower test tiers are supposed to
|
||||
contain the simpler, quicker and more stable tests. Higher tiers are supposed to contain
|
||||
progressively more thorough, slower, and sometimes less stable tests, or the tests that require
|
||||
special configuration.
|
||||
|
||||
Contributors are expected to run the tests for the areas that are changed, and the first N tiers
|
||||
they can afford to run, but at least tier1.
|
||||
|
||||
A brief description of the tiered test groups:
|
||||
|
||||
- `tier1`: This is the lowest test tier. Multiple developers run these tests every day.
|
||||
Because of the widespread use, the tests in `tier1` are carefully selected and optimized to run
|
||||
fast, and to run in the most stable manner. The test failures in `tier1` are usually followed up
|
||||
on quickly, either with fixes, or adding relevant tests to problem list. GitHub Actions workflows,
|
||||
if enabled, run `tier1` tests.
|
||||
|
||||
- `tier2`: This test group covers even more ground. These contain, among other things,
|
||||
tests that either run for too long to be at `tier1`, or may require special configuration,
|
||||
or tests that are less stable, or cover the broader range of non-core JVM and JDK features/components
|
||||
(for example, XML).
|
||||
|
||||
- `tier3`: This test group includes more stressful tests, the tests for corner cases
|
||||
not covered by previous tiers, plus the tests that require GUIs. As such, this suite
|
||||
should either be run with low concurrency (`TEST_JOBS=1`), or without headful tests
|
||||
(`JTREG_KEYWORDS=\!headful`), or both.
|
||||
|
||||
- `tier4`: This test group includes every other test not covered by previous tiers. It includes,
|
||||
for example, `vmTestbase` suites for Hotspot, which run for many hours even on large
|
||||
machines. It also runs GUI tests, so the same `TEST_JOBS` and `JTREG_KEYWORDS` caveats
|
||||
apply.
|
||||
|
||||
### JTReg
|
||||
|
||||
JTReg tests can be selected either by picking a JTReg test group, or a selection
|
||||
@@ -315,10 +269,6 @@ Generate AOT modules before testing for the specified module, or set of
|
||||
modules. If multiple modules are specified, they should be separated by space
|
||||
(or, to help avoid quoting issues, the special value `%20`).
|
||||
|
||||
#### RETRY_COUNT
|
||||
|
||||
Retry failed tests up to a set number of times. Defaults to 0.
|
||||
|
||||
### Gtest keywords
|
||||
|
||||
#### REPEAT
|
||||
|
||||
@@ -4,9 +4,9 @@ RUN yum -y install centos-release-scl
|
||||
RUN yum -y install devtoolset-8
|
||||
RUN yum -y install zip bzip2 unzip tar wget make autoconf automake libtool alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel freetype-devel file which libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel git
|
||||
# Install Java 11
|
||||
RUN wget https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz \
|
||||
RUN wget https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrsdk-11_0_3-linux-x64-b360.2.tar.gz \
|
||||
-O - | tar xz -C /
|
||||
ENV JAVA_HOME /zulu11.45.27-ca-jdk11.0.10-linux_x64
|
||||
ENV JAVA_HOME /jbrsdk
|
||||
ENV PATH $JAVA_HOME/bin:/opt/rh/devtoolset-8/root/usr/bin:$PATH
|
||||
RUN git config --global user.email "teamcity@buildserver.intellij.net"
|
||||
RUN git config --global user.name "builduser"
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_aarch64.sh script.
|
||||
|
||||
# Pull a concrete version of Linux that does NOT recieve updates after it's
|
||||
# been created. This is so that the image is as stable as possible to make
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
FROM arm64v8/centos:7
|
||||
|
||||
# Install the necessary build tools
|
||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
export DEBCONF_NONINTERACTIVE_SEEN=true && \
|
||||
yum -y update && \
|
||||
yum -y groupinstall \
|
||||
"Development Tools" && \
|
||||
yum -y install centos-release-scl && \
|
||||
yum -y install devtoolset-8 && \
|
||||
yum -y install \
|
||||
centos-release-scl-rh \
|
||||
devtoolset-8 \
|
||||
which \
|
||||
autoconf \
|
||||
git \
|
||||
file \
|
||||
make \
|
||||
libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel \
|
||||
cups-devel \
|
||||
fontconfig-devel \
|
||||
alsa-lib-devel \
|
||||
unzip \
|
||||
zip \
|
||||
&& \
|
||||
yum -y clean all && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ENV PATH /opt/rh/devtoolset-8/root/usr/bin:$PATH
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser"
|
||||
@@ -1,6 +1,7 @@
|
||||
FROM i386/ubuntu:xenial
|
||||
|
||||
RUN linux32 apt-get update && apt-get install -y --no-install-recommends apt-utils
|
||||
COPY jbrsdk-11.0.5-b1 /jbrsdk-11.0.5-b1
|
||||
RUN linux32 apt-get -y install file build-essential zip unzip curl libx11-dev libxext-dev \
|
||||
libxrender-dev libxrandr-dev libxtst-dev libxt-dev libcups2-dev libasound2-data \
|
||||
libpng12-0 libasound2 libfreetype6 libfontconfig1-dev libasound2-dev autoconf rsync
|
||||
libpng12-0 libasound2 libfreetype6 libfontconfig1-dev libasound2-dev autoconf
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# This script creates a Docker image suitable for building AArch64 variant
|
||||
# of the JetBrains Runtime version 17.
|
||||
|
||||
#BOOT_JDK_REMOTE_FILE=zulu17.30.15-ca-jdk17.0.1-linux_aarch64.tar.gz
|
||||
#BOOT_JDK_SHA=4d9c9116eb0cdd2d7fb220d6d27059f4bf1b7e95cc93d5512bd8ce3791af86c7
|
||||
#BOOT_JDK_LOCAL_FILE=boot_jdk.tar.gz
|
||||
|
||||
#if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
|
||||
# Obtain "boot JDK" from outside of the container.
|
||||
# wget -nc https://cdn.azul.com/zulu/bin/${BOOT_JDK_REMOTE_FILE} -O $BOOT_JDK_LOCAL_FILE
|
||||
#else
|
||||
# echo "boot JDK \"$BOOT_JDK_LOCAL_FILE\" present, skipping download"
|
||||
#fi
|
||||
|
||||
# Verify that what we've downloaded can be trusted.
|
||||
#shasum -a 256 -c - <<EOF
|
||||
#$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
|
||||
#EOF
|
||||
|
||||
docker build -t jetbrains/runtime:jbr11dev8env_aarch64 -f Dockerfile.aarch64 .
|
||||
|
||||
# NB: the resulting container can (and should) be used without the network
|
||||
# connection (--network none) during build in order to reduce the chance
|
||||
# of build contamination.
|
||||
@@ -5,21 +5,10 @@ VENDOR_VERSION_STRING="JBR-${JBSDK_VERSION_WITH_DOTS}.${JDK_BUILD_NUMBER}-${buil
|
||||
do_reset_changes=0
|
||||
do_reset_dcevm=0
|
||||
HEAD_REVISION=0
|
||||
WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS="--with-native-debug-symbols=zipped"
|
||||
|
||||
function zip_native_debug_symbols() {
|
||||
image_bundle_path=$(echo $1 | cut -d"/" -f-4)
|
||||
jbr_diz_name=$2
|
||||
|
||||
(cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} ../../../../dizfiles \; )
|
||||
|
||||
(cd dizfiles && find . -print0 | COPYFILE_DISABLE=1 \
|
||||
tar --no-recursion --null -T - -czf ../"$jbr_diz_name".tar.gz) || do_exit $?
|
||||
}
|
||||
|
||||
function do_exit() {
|
||||
exit_code=$1
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD modules.list src/java.desktop/share/classes/module-info.java
|
||||
if [ $do_reset_dcevm -eq 1 ]; then
|
||||
[ ! -z $HEAD_REVISION ] && git reset --hard $HEAD_REVISION
|
||||
fi
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $1 - Boot JDK
|
||||
# $2 - JBR part of API version
|
||||
|
||||
cd "`dirname "$0"`/../../../../.."
|
||||
PWD="`pwd`"
|
||||
CONF="$PWD/build/jbr-api.conf"
|
||||
./configure --with-debug-level=release --with-boot-jdk=$1 || exit $?
|
||||
make jbr-api CONF=release MAKEOVERRIDES= "JBR_API_CONF_FILE=$CONF" JBR_API_JBR_VERSION=$2 || exit $?
|
||||
. $CONF || exit $?
|
||||
echo "##teamcity[buildNumber '$VERSION']"
|
||||
cp "$JAR" ./jbr-api-${VERSION}.jar || exit $?
|
||||
cp "$SOURCES_JAR" ./jbr-api-${VERSION}-sources.jar || exit $?
|
||||
echo "##teamcity[publishArtifacts '$PWD/jbr-api-${VERSION}.jar']"
|
||||
echo "##teamcity[publishArtifacts '$PWD/jbr-api-${VERSION}-sources.jar']"
|
||||
@@ -1,177 +1,86 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# jcef - the release bundles with jcef
|
||||
# dcevm - the release bundles with dcevm patches
|
||||
# nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
|
||||
# jfx - the bundle 1) jbr with javafx only will be created
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-aarch64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-aarch64-b${build_number}.tar.gz
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
# Environment variables:
|
||||
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
|
||||
# By default imported modules should be located in ./jcef_linux_aarch64/modular-sdk
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_linux_aarch64
|
||||
|
||||
while getopts ":i?" o; do
|
||||
case "${o}" in
|
||||
i)
|
||||
i="incremental build"
|
||||
INC_BUILD=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
JCEF_PATH=${JCEF_PATH:=./jcef_linux_aarch64}
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${JCEF_PATH}/modular-sdk}"
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function do_configure {
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
--enable-cds=yes || do_exit $?
|
||||
}
|
||||
--with-import-modules=./modular-sdk \
|
||||
--with-boot-jdk=amazon-corretto-11.0.5.10.1-linux-aarch64 \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=linux-aarch64-normal-server-release || exit $?
|
||||
make images CONF=linux-aarch64-normal-server-release test-image || exit $?
|
||||
|
||||
function create_jbr {
|
||||
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
|
||||
case "${bundle_type}" in
|
||||
"jcef" | "dcevm" | "nomod" | "fd")
|
||||
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
cat jb/project/tools/common/modules.list > modules_tmp.list
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
|
||||
JBR=${JBR_BASE_NAME}-linux-aarch64-b${build_number}
|
||||
|
||||
echo Running jlink....
|
||||
$JSDK/bin/jlink \
|
||||
--module-path $JSDK/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output $BASE_DIR/$JBR_BUNDLE || do_exit $?
|
||||
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
|
||||
cp -R $BASE_DIR/$JBR_BUNDLE $BASE_DIR/jbr
|
||||
rsync -av ${JCEF_PATH}/ $BASE_DIR/$JBR_BUNDLE/lib --exclude="modular-sdk" || do_exit $?
|
||||
fi
|
||||
grep -v "^JAVA_VERSION" $JSDK/release | grep -v "^MODULES" >> $BASE_DIR/$JBR_BUNDLE/release
|
||||
|
||||
echo Creating ${JBR}.tar.gz ...
|
||||
rm -rf ${BASE_DIR}/jbr
|
||||
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
|
||||
tar -pcf ${JBR}.tar -C ${BASE_DIR} jbr || do_exit $?
|
||||
gzip -f ${JBR}.tar || do_exit $?
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk_${bundle_type}-${JBSDK_VERSION}
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=linux-aarch64-normal-server-release
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-aarch64-b${build_number}
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
do_reset_dcevm=1
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"nomod")
|
||||
WITH_IMPORT_MODULES=""
|
||||
;;
|
||||
"fd")
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=linux-aarch64-normal-server-fastdebug
|
||||
JBSDK=jbrsdk-${JBSDK_VERSION}-linux-aarch64-fastdebug-b${build_number}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
make images CONF=$RELEASE_NAME || do_exit $?
|
||||
|
||||
JSDK=build/${RELEASE_NAME}/images/jdk
|
||||
BASE_DIR=build/linux-aarch64-normal-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
BASE_DIR=build/${RELEASE_NAME}/images
|
||||
if [ "${bundle_type}" == "dcevm" ] || [ "${bundle_type}" == "jcef" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk_${bundle_type}
|
||||
else
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
fi
|
||||
|
||||
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE}
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || do_exit $?
|
||||
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
|
||||
rsync -av ${JCEF_PATH}/ $BASE_DIR/$JBRSDK_BUNDLE/lib --exclude="modular-sdk" || do_exit $?
|
||||
fi
|
||||
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
|
||||
tar -pcf ${JBSDK}.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
|
||||
-C ${BASE_DIR} ${JBRSDK_BUNDLE} || do_exit $?
|
||||
gzip -f ${JBSDK}.tar || do_exit $?
|
||||
tar -pcf $JBSDK.tar \
|
||||
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
|
||||
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
zip_native_debug_symbols ${BASE_DIR}/jdk "${JBSDK}_diz"
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
create_jbr || do_exit $?
|
||||
JBR=$JBR_BASE_NAME-linux-aarch64-b$build_number
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.aarch64
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.aarch64 | sed s/" "//g | sed s/,$//g) \
|
||||
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
|
||||
|
||||
if [ "$bundle_type" == "dcevm" ]; then
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
echo Modifying release info ...
|
||||
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
|
||||
|
||||
JBRSDK_TEST=jbrsdk-${JBSDK_VERSION}-linux-test-aarch64-b$build_number
|
||||
echo Creating $JBR.tar.gz ...
|
||||
tar -pcf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
|
||||
gzip $JBR.tar || exit $?
|
||||
|
||||
echo Creating $JBSDK_TEST.tar.gz ...
|
||||
tar -pcf ${JBRSDK_TEST}.tar -C ${BASE_DIR} --exclude='test/jdk/demos' test || do_exit $?
|
||||
gzip -f ${JBRSDK_TEST}.tar || do_exit $?
|
||||
fi
|
||||
|
||||
do_exit 0
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-aarch64-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' test || exit $?
|
||||
gzip $JBRSDK_TEST.tar || exit $?
|
||||
@@ -6,6 +6,8 @@
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# jcef - the release bundles with jcef
|
||||
# jfx - the release bundles with javafx
|
||||
# jcef_jfx - the release bundles with jcef and javafx
|
||||
# dcevm - the release bundles with dcevm patches
|
||||
# nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
@@ -20,59 +22,36 @@
|
||||
#
|
||||
# Environment variables:
|
||||
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
|
||||
# By default imported modules should be located in ./jcef_linux_x64/modular-sdk
|
||||
# By default imported modules should be located in ./modular-sdk
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_linux_x64
|
||||
|
||||
while getopts ":i?" o; do
|
||||
case "${o}" in
|
||||
i)
|
||||
i="incremental build"
|
||||
INC_BUILD=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=./modular-sdk}"
|
||||
JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${JCEF_PATH}/modular-sdk}"
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function do_configure {
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
--enable-cds=yes || do_exit $?
|
||||
}
|
||||
|
||||
function create_jbr {
|
||||
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
|
||||
case "${bundle_type}" in
|
||||
"jcef" | "dcevm" | "nomod" | "fd")
|
||||
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
|
||||
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
|
||||
;;
|
||||
"jfx_jcef")
|
||||
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
cat jb/project/tools/common/modules.list > modules_tmp.list
|
||||
cat modules.list > modules_tmp.list
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
|
||||
JBR=${JBR_BASE_NAME}-linux-x64-b${build_number}
|
||||
@@ -96,15 +75,24 @@ function create_jbr {
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk_${bundle_type}-${JBSDK_VERSION}
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=linux-x86_64-normal-server-release
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-x64-b${build_number}
|
||||
case "$bundle_type" in
|
||||
"jfx")
|
||||
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"jfx_jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
@@ -120,18 +108,25 @@ case "$bundle_type" in
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=linux-x86_64-normal-server-fastdebug
|
||||
JBSDK=jbrsdk-${JBSDK_VERSION}-linux-x64-fastdebug-b${build_number}
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-x64-fastdebug-b${build_number}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
make images CONF=$RELEASE_NAME || do_exit $?
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
--enable-cds=yes || do_exit $?
|
||||
|
||||
make clean images CONF=$RELEASE_NAME || do_exit $?
|
||||
|
||||
JSDK=build/${RELEASE_NAME}/images/jdk
|
||||
|
||||
@@ -139,11 +134,7 @@ echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
BASE_DIR=build/${RELEASE_NAME}/images
|
||||
if [ "${bundle_type}" == "dcevm" ] || [ "${bundle_type}" == "jcef" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk_${bundle_type}
|
||||
else
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
fi
|
||||
|
||||
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE}
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || do_exit $?
|
||||
@@ -151,7 +142,7 @@ cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || do_exit $?
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
|
||||
rsync -av ${JCEF_PATH}/ $BASE_DIR/$JBRSDK_BUNDLE/lib --exclude="modular-sdk" || do_exit $?
|
||||
fi
|
||||
|
||||
if [ "${bundle_type}" == "jcef" ] || [ "${bundle_type}" == "fd" ]; then
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
@@ -159,15 +150,14 @@ mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
tar -pcf ${JBSDK}.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
|
||||
-C ${BASE_DIR} ${JBRSDK_BUNDLE} || do_exit $?
|
||||
gzip -f ${JBSDK}.tar || do_exit $?
|
||||
|
||||
zip_native_debug_symbols ${BASE_DIR}/jdk "${JBSDK}_diz"
|
||||
fi
|
||||
|
||||
create_jbr || do_exit $?
|
||||
|
||||
if [ "$bundle_type" == "dcevm" ]; then
|
||||
if [ "$bundle_type" == "jcef" ]; then
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
|
||||
JBRSDK_TEST=jbrsdk-${JBSDK_VERSION}-linux-test-x64-b$build_number
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x64-b$build_number
|
||||
|
||||
echo Creating $JBSDK_TEST.tar.gz ...
|
||||
tar -pcf ${JBRSDK_TEST}.tar -C ${BASE_DIR} --exclude='test/jdk/demos' test || do_exit $?
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
|
||||
# jfx - the bundle 1) jbr with javafx only will be created
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
@@ -19,7 +20,6 @@
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
BOOT_JDK=${BOOT_JDK:=$(/jbrsdk-11.0.5-b1)}
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
@@ -32,12 +32,10 @@ linux32 bash configure \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=$JDK_BUILD_NUMBER \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
--with-boot-jdk=/jbrsdk-11.0.5-b1 \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=linux-x86-normal-server-release || exit $?
|
||||
make images CONF=linux-x86-normal-server-release test-image || exit $?
|
||||
@@ -60,14 +58,12 @@ mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man -C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
zip_native_debug_symbols ${BASE_DIR}/jdk "${JBSDK}_diz"
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-x86-b$build_number
|
||||
grep -v javafx jb/project/tools/common/modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# jcef - the release bundles with jcef
|
||||
# jfx - the release bundles with javafx
|
||||
# jcef_jfx - the release bundles with jcef and javafx
|
||||
# dcevm - the release bundles with dcevm patches
|
||||
# nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
@@ -20,20 +22,10 @@
|
||||
#
|
||||
# Environment variables:
|
||||
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
|
||||
# By default imported modules should be located in ./jcef_mac/modular-sdk
|
||||
# By default imported modules should be located in ./modular-sdk
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_mac
|
||||
|
||||
while getopts ":i?" o; do
|
||||
case "${o}" in
|
||||
i)
|
||||
i="incremental build"
|
||||
INC_BUILD=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
@@ -41,64 +33,35 @@ bundle_type=$4
|
||||
architecture=$5 # aarch64 or x64
|
||||
enable_aot=$6 # temporary param for building test jre with aot under aarch64
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=./modular-sdk}"
|
||||
JCEF_PATH=${JCEF_PATH:=./jcef_mac}
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${JCEF_PATH}/modular-sdk}"
|
||||
architecture=${architecture:=x64}
|
||||
BOOT_JDK=${BOOT_JDK:=$(/usr/libexec/java_home -v 11)}
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function do_configure {
|
||||
if [[ "${architecture}" == *aarch64* ]]; then
|
||||
# NOTE: aot, cds aren't supported yet
|
||||
WITH_JVM_FEATURES="--with-jvm-features=-aot"
|
||||
if [[ "${enable_aot}" == *enable_aot* ]]; then
|
||||
echo "Enable unstable jvm feature: AOT"
|
||||
WITH_JVM_FEATURES=""
|
||||
fi
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--disable-hotspot-gtest --disable-javac-server --disable-full-docs --disable-manpages \
|
||||
--enable-cds=no \
|
||||
$WITH_JVM_FEATURES \
|
||||
--with-extra-cflags="-F$(pwd)/Frameworks" \
|
||||
--with-extra-cxxflags="-F$(pwd)/Frameworks" \
|
||||
--with-extra-ldflags="-F$(pwd)/Frameworks" || do_exit $?
|
||||
else
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--enable-cds=yes || do_exit $?
|
||||
fi
|
||||
function copyJNF {
|
||||
__contents_dir=$1
|
||||
# we can't notarize this library as usual framework (with headers and tbd-file)
|
||||
# but single library notarizes correctly
|
||||
mkdir -p ${__contents_dir}/Frameworks/JavaNativeFoundation.framework/Resources
|
||||
cp -p Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation \
|
||||
${__contents_dir}/Frameworks/JavaNativeFoundation.framework || do_exit $?
|
||||
cp -p Frameworks/JavaNativeFoundation.framework/Resources/Info.plist \
|
||||
${__contents_dir}/Frameworks/JavaNativeFoundation.framework/Resources || do_exit $?
|
||||
# unsign JavaNativeFoundation binary (otherwise notarization will fail)
|
||||
codesign --remove-signature ${__contents_dir}/Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation || do_exit $?
|
||||
}
|
||||
|
||||
function create_jbr {
|
||||
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
|
||||
case "${bundle_type}" in
|
||||
"jcef" | "dcevm" | "nomod" | "fd")
|
||||
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
|
||||
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
|
||||
;;
|
||||
"jfx_jcef")
|
||||
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
@@ -106,11 +69,11 @@ function create_jbr {
|
||||
if [[ "${architecture}" == *aarch64* ]] && [[ "${enable_aot}" != *enable_aot* ]]; then
|
||||
# aot isn't supported yet, so remove dependent modules
|
||||
echo "Exclude jdk.internal.vm.compiler and jdk.aot (because aot not supported yet)"
|
||||
cat jb/project/tools/common/modules.list | \
|
||||
cat modules.list | \
|
||||
grep -v "jdk.internal.vm.compiler\|jdk.aot" \
|
||||
> modules_tmp.list
|
||||
else
|
||||
cat jb/project/tools/common/modules.list > modules_tmp.list
|
||||
cat modules.list > modules_tmp.list
|
||||
fi
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
|
||||
@@ -132,6 +95,17 @@ function create_jbr {
|
||||
cp ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Info.plist ${JRE_CONTENTS}
|
||||
|
||||
rm -rf ${JRE_CONTENTS}/Frameworks || do_exit $?
|
||||
if [[ "${architecture}" == *aarch64* ]]; then
|
||||
# we can't notarize this library as usual framework (with headers and tbd-file)
|
||||
# but single library notarizes correctly
|
||||
mkdir -p ${JRE_CONTENTS}/Frameworks/JavaNativeFoundation.framework/Resources
|
||||
cp -p Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation \
|
||||
${JRE_CONTENTS}/Frameworks/JavaNativeFoundation.framework || do_exit $?
|
||||
cp -p Frameworks/JavaNativeFoundation.framework/Resources/Info.plist \
|
||||
${JRE_CONTENTS}/Frameworks/JavaNativeFoundation.framework/Resources || do_exit $?
|
||||
# unsign JavaNativeFoundation binary (otherwise notarization will fail)
|
||||
codesign --remove-signature ${JRE_CONTENTS}/Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation || do_exit $?
|
||||
fi
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
|
||||
cp -a ${JCEF_PATH}/Frameworks ${JRE_CONTENTS} || do_exit $?
|
||||
fi
|
||||
@@ -144,7 +118,7 @@ function create_jbr {
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk_${bundle_type}-${JBSDK_VERSION}
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
CONF_ARCHITECTURE=x86_64
|
||||
if [[ "${architecture}" == *aarch64* ]]; then
|
||||
@@ -152,12 +126,21 @@ if [[ "${architecture}" == *aarch64* ]]; then
|
||||
fi
|
||||
CONF_NAME=macosx-${CONF_ARCHITECTURE}-normal-server-release
|
||||
|
||||
JBSDK="${JBRSDK_BASE_NAME}-osx-${architecture}-b${build_number}"
|
||||
JBSDK=${JBRSDK_BASE_NAME}-osx-${architecture}-b${build_number}
|
||||
case "$bundle_type" in
|
||||
"jfx")
|
||||
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"jfx_jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
@@ -173,27 +156,57 @@ case "$bundle_type" in
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
CONF_NAME=macosx-${CONF_ARCHITECTURE}-normal-server-fastdebug
|
||||
JBSDK=jbrsdk-${JBSDK_VERSION}-osx-${architecture}-fastdebug-b${build_number}
|
||||
JBSDK=${JBRSDK_BASE_NAME}-osx-${architecture}-fastdebug-b${build_number}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
if [[ "${architecture}" == *aarch64* ]]; then
|
||||
# NOTE: aot, cds aren't supported yet
|
||||
WITH_JVM_FEATURES="--with-jvm-features=-aot"
|
||||
if [[ "${enable_aot}" == *enable_aot* ]]; then
|
||||
echo "Enable unstable jvm feature: AOT"
|
||||
WITH_JVM_FEATURES=""
|
||||
fi
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
|
||||
--disable-hotspot-gtest --disable-javac-server --disable-full-docs --disable-manpages \
|
||||
--enable-cds=no \
|
||||
$WITH_JVM_FEATURES \
|
||||
--with-extra-cflags="-F$(pwd)/Frameworks" \
|
||||
--with-extra-cxxflags="-F$(pwd)/Frameworks" \
|
||||
--with-extra-ldflags="-F$(pwd)/Frameworks" || do_exit $?
|
||||
else
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
|
||||
--enable-cds=yes || do_exit $?
|
||||
fi
|
||||
|
||||
make clean CONF=$CONF_NAME || do_exit $?
|
||||
make images CONF=$CONF_NAME || do_exit $?
|
||||
|
||||
JSDK=build/${CONF_NAME}/images/jdk-bundle
|
||||
|
||||
BASE_DIR=jre
|
||||
if [ "${bundle_type}" == "dcevm" ] || [ "${bundle_type}" == "jcef" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk_${bundle_type}
|
||||
else
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
fi
|
||||
|
||||
rm -rf $BASE_DIR
|
||||
mkdir $BASE_DIR || do_exit $?
|
||||
@@ -201,24 +214,26 @@ cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || do_exit
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
|
||||
cp -a ${JCEF_PATH}/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
|
||||
fi
|
||||
|
||||
if [ "${bundle_type}" == "jcef" ] || [ "${bundle_type}" == "fd" ]; then
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
if [[ "${architecture}" == *aarch64* ]]; then
|
||||
copyJNF $BASE_DIR/$JBRSDK_BUNDLE/Contents
|
||||
fi
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release
|
||||
[ -f "${JBSDK}.tar.gz" ] && rm "${JBSDK}.tar.gz"
|
||||
COPYFILE_DISABLE=1 tar -pczf ${JBSDK}.tar.gz -C ${BASE_DIR} \
|
||||
--exclude='.DS_Store' --exclude='*~' \
|
||||
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
|
||||
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \
|
||||
${JBRSDK_BUNDLE} || do_exit $?
|
||||
|
||||
zip_native_debug_symbols ${JSDK} "${JBSDK}_diz"
|
||||
fi
|
||||
|
||||
create_jbr || do_exit $?
|
||||
|
||||
if [ "$bundle_type" == "dcevm" ]; then
|
||||
if [ "$bundle_type" == "jcef" ]; then
|
||||
make test-image CONF=$CONF_NAME || do_exit $?
|
||||
|
||||
JBRSDK_TEST=jbrsdk-${JBSDK_VERSION}-osx-test-${architecture}-b$build_number
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-osx-test-${architecture}-b$build_number
|
||||
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
[ -f "${JBRSDK_TEST}.tar.gz" ] && rm "${JBRSDK_TEST}.tar.gz"
|
||||
|
||||
@@ -58,7 +58,7 @@ file="$APP_NAME.zip"
|
||||
|
||||
log "Zipping $file..."
|
||||
rm -rf "$file"
|
||||
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY" "$file"
|
||||
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY/Contents" "$file"
|
||||
|
||||
log "Notarizing $file..."
|
||||
rm -rf "altool.init.out" "altool.check.out"
|
||||
|
||||
@@ -26,7 +26,8 @@ log "Signing libraries and executables..."
|
||||
# -perm +111 searches for executables
|
||||
for f in \
|
||||
"Contents/Home/bin" \
|
||||
"Contents/Home/lib"; do
|
||||
"Contents/Home/lib" \
|
||||
"Contents/Frameworks"; do
|
||||
if [ -d "$APP_DIRECTORY/$f" ]; then
|
||||
find "$APP_DIRECTORY/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
|
||||
@@ -36,20 +37,6 @@ for f in \
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -d "$APP_DIRECTORY/Contents/Frameworks" ]; then
|
||||
log "Signing frameworks..."
|
||||
for f in $APP_DIRECTORY/Contents/Frameworks/*; do
|
||||
find "$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" \) \
|
||||
-exec codesign --timestamp --force \
|
||||
-v -s "$JB_CERT" \
|
||||
--entitlements entitlements.xml {} \;
|
||||
codesign --timestamp --force \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--entitlements entitlements.xml "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
log "Signing libraries in jars in $PWD"
|
||||
|
||||
# todo: add set -euo pipefail; into the inner sh -c
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
@@ -32,10 +32,8 @@ mkdir "$BACKUP_JMODS"
|
||||
|
||||
log "Unzipping $INPUT_FILE to $EXPLODED ..."
|
||||
tar -xzvf "$INPUT_FILE" --directory $EXPLODED
|
||||
BUILD_NAME="$(ls "$EXPLODED")"
|
||||
sed -i '' s/BNDL/APPL/ $EXPLODED/$BUILD_NAME/Contents/Info.plist
|
||||
rm -f $EXPLODED/$BUILD_NAME/Contents/CodeResources
|
||||
rm "$INPUT_FILE"
|
||||
BUILD_NAME="$(ls "$EXPLODED")"
|
||||
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/jmods; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/Home/jmods $BACKUP_JMODS
|
||||
fi
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
diff --git jb/project/tools/common/modules.list jb/project/tools/common/modules.list
|
||||
index 33375b527c4..76539cbc0e0 100644
|
||||
--- jb/project/tools/common/modules.list
|
||||
+++ jb/project/tools/common/modules.list
|
||||
@@ -55,4 +55,7 @@ jdk.unsupported,
|
||||
diff --git modules.list modules.list
|
||||
index e23d793..368d022 100644
|
||||
--- modules.list
|
||||
+++ modules.list
|
||||
@@ -54,4 +54,7 @@ jdk.security.jgss,
|
||||
jdk.unsupported,
|
||||
jdk.xml.dom,
|
||||
jdk.zipfs,
|
||||
jdk.hotspot.agent,
|
||||
-jdk.jcmd
|
||||
+jdk.jcmd,
|
||||
-jdk.hotspot.agent
|
||||
+jdk.hotspot.agent,
|
||||
+jcef,
|
||||
+gluegen.rt,
|
||||
+jogl.all
|
||||
diff --git src/java.desktop/share/classes/module-info.java src/java.desktop/share/classes/module-info.java
|
||||
index b663b382f52..3e9acdc0c27 100644
|
||||
index b663b38..3e9acdc 100644
|
||||
--- src/java.desktop/share/classes/module-info.java
|
||||
+++ src/java.desktop/share/classes/module-info.java
|
||||
@@ -109,7 +109,11 @@ module java.desktop {
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
diff --git jb/project/tools/common/modules.list jb/project/tools/common/modules.list
|
||||
index 33375b527c4..76539cbc0e0 100644
|
||||
--- jb/project/tools/common/modules.list
|
||||
+++ jb/project/tools/common/modules.list
|
||||
@@ -55,4 +55,5 @@ jdk.unsupported,
|
||||
jdk.xml.dom,
|
||||
jdk.zipfs,
|
||||
jdk.hotspot.agent,
|
||||
-jdk.jcmd
|
||||
+jdk.jcmd,
|
||||
+jcef
|
||||
diff --git src/java.desktop/share/classes/module-info.java src/java.desktop/share/classes/module-info.java
|
||||
index b663b382f52..3e9acdc0c27 100644
|
||||
--- src/java.desktop/share/classes/module-info.java
|
||||
+++ src/java.desktop/share/classes/module-info.java
|
||||
@@ -109,7 +109,10 @@ module java.desktop {
|
||||
// see make/GensrcModuleInfo.gmk
|
||||
exports sun.awt to
|
||||
jdk.accessibility,
|
||||
- jdk.unsupported.desktop;
|
||||
+ jdk.unsupported.desktop,
|
||||
+ jcef;
|
||||
+
|
||||
+ exports java.awt.peer to jcef;
|
||||
|
||||
exports java.awt.dnd.peer to jdk.unsupported.desktop;
|
||||
exports sun.awt.dnd to jdk.unsupported.desktop;
|
||||
18
jb/project/tools/patches/add_jfx_module.patch
Normal file
18
jb/project/tools/patches/add_jfx_module.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
diff --git modules.list modules.list
|
||||
index e23d793ca61..14b9a6c8e50 100644
|
||||
--- modules.list
|
||||
+++ modules.list
|
||||
@@ -20,6 +20,13 @@ java.sql.rowset,
|
||||
java.transaction.xa,
|
||||
java.xml,
|
||||
java.xml.crypto,
|
||||
+javafx.base,
|
||||
+javafx.controls,
|
||||
+javafx.fxml,
|
||||
+javafx.graphics,
|
||||
+javafx.media,
|
||||
+javafx.swing,
|
||||
+javafx.web,
|
||||
jdk.accessibility,
|
||||
jdk.aot,
|
||||
jdk.attach,
|
||||
@@ -1,7 +1,7 @@
|
||||
From 6ba107bfbd2c71b211a2e4eb54741576ca9e4370 Mon Sep 17 00:00:00 2001
|
||||
From b36887fca0b0b251c914567d0ee2871c6d786c09 Mon Sep 17 00:00:00 2001
|
||||
From: skybber <lada.dvorak7@gmail.com>
|
||||
Date: Wed, 14 Nov 2018 21:09:39 +0100
|
||||
Subject: [PATCH 01/44] Apply basic dcevm11 patch
|
||||
Subject: [PATCH 01/17] Apply basic dcevm11 patch
|
||||
|
||||
---
|
||||
src/hotspot/share/ci/ciObjectFactory.cpp | 25 +
|
||||
@@ -72,10 +72,10 @@ Subject: [PATCH 01/44] Apply basic dcevm11 patch
|
||||
create mode 100644 src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
|
||||
diff --git a/src/hotspot/share/ci/ciObjectFactory.cpp b/src/hotspot/share/ci/ciObjectFactory.cpp
|
||||
index 3ed142d348e..b2ab15c4b65 100644
|
||||
index a5dd94f4bb8..66bbe835e7b 100644
|
||||
--- a/src/hotspot/share/ci/ciObjectFactory.cpp
|
||||
+++ b/src/hotspot/share/ci/ciObjectFactory.cpp
|
||||
@@ -726,3 +726,28 @@ void ciObjectFactory::print() {
|
||||
@@ -708,3 +708,28 @@ void ciObjectFactory::print() {
|
||||
_unloaded_instances->length(),
|
||||
_unloaded_klasses->length());
|
||||
}
|
||||
@@ -105,7 +105,7 @@ index 3ed142d348e..b2ab15c4b65 100644
|
||||
+}
|
||||
+
|
||||
diff --git a/src/hotspot/share/ci/ciObjectFactory.hpp b/src/hotspot/share/ci/ciObjectFactory.hpp
|
||||
index 1e8033f03a7..5d573350aa2 100644
|
||||
index 1063c9853e1..3e9d48c4cdc 100644
|
||||
--- a/src/hotspot/share/ci/ciObjectFactory.hpp
|
||||
+++ b/src/hotspot/share/ci/ciObjectFactory.hpp
|
||||
@@ -88,6 +88,7 @@ private:
|
||||
@@ -116,7 +116,7 @@ index 1e8033f03a7..5d573350aa2 100644
|
||||
public:
|
||||
static bool is_initialized() { return _initialized; }
|
||||
|
||||
@@ -144,6 +145,8 @@ public:
|
||||
@@ -143,6 +144,8 @@ public:
|
||||
|
||||
void print_contents();
|
||||
void print();
|
||||
@@ -126,7 +126,7 @@ index 1e8033f03a7..5d573350aa2 100644
|
||||
|
||||
#endif // SHARE_VM_CI_CIOBJECTFACTORY_HPP
|
||||
diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp
|
||||
index c4607a5a54b..143a4165608 100644
|
||||
index 6d65cca2101..e2b8c5793d0 100644
|
||||
--- a/src/hotspot/share/classfile/classFileParser.cpp
|
||||
+++ b/src/hotspot/share/classfile/classFileParser.cpp
|
||||
@@ -954,6 +954,8 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
|
||||
@@ -138,7 +138,7 @@ index c4607a5a54b..143a4165608 100644
|
||||
if (!interf->is_interface()) {
|
||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(),
|
||||
err_msg("class %s can not implement %s, because it is not an interface (%s)",
|
||||
@@ -3834,7 +3836,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
|
||||
@@ -3826,7 +3828,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
|
||||
// However, make sure it is not an array type.
|
||||
bool is_array = false;
|
||||
if (cp->tag_at(super_class_index).is_klass()) {
|
||||
@@ -147,7 +147,7 @@ index c4607a5a54b..143a4165608 100644
|
||||
if (need_verify)
|
||||
is_array = super_klass->is_array_klass();
|
||||
} else if (need_verify) {
|
||||
@@ -4502,7 +4504,10 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
|
||||
@@ -4494,7 +4496,10 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
|
||||
if (!_has_empty_finalizer) {
|
||||
if (_has_finalizer ||
|
||||
(super != NULL && super->has_finalizer())) {
|
||||
@@ -159,7 +159,7 @@ index c4607a5a54b..143a4165608 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5880,6 +5885,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
|
||||
@@ -5872,6 +5877,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
|
||||
const InstanceKlass* host_klass,
|
||||
GrowableArray<Handle>* cp_patches,
|
||||
Publicity pub_level,
|
||||
@@ -167,7 +167,7 @@ index c4607a5a54b..143a4165608 100644
|
||||
TRAPS) :
|
||||
_stream(stream),
|
||||
_requested_name(name),
|
||||
@@ -5938,7 +5944,8 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
|
||||
@@ -5930,7 +5936,8 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
|
||||
_has_finalizer(false),
|
||||
_has_empty_finalizer(false),
|
||||
_has_vanilla_constructor(false),
|
||||
@@ -177,7 +177,7 @@ index c4607a5a54b..143a4165608 100644
|
||||
|
||||
_class_name = name != NULL ? name : vmSymbols::unknown_class_name();
|
||||
|
||||
@@ -6339,14 +6346,15 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
|
||||
@@ -6331,14 +6338,15 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
|
||||
CHECK);
|
||||
}
|
||||
Handle loader(THREAD, _loader_data->class_loader());
|
||||
@@ -236,10 +236,10 @@ index 3bdfd34e39f..d792ab4bb3f 100644
|
||||
ReferenceType reference_type() const { return _rt; }
|
||||
AccessFlags access_flags() const { return _access_flags; }
|
||||
diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp
|
||||
index ee43e47ec89..64b8e03cdbd 100644
|
||||
index f0cf1fb7cb1..5713bb9e98c 100644
|
||||
--- a/src/hotspot/share/classfile/classLoader.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoader.cpp
|
||||
@@ -1508,6 +1508,7 @@ InstanceKlass* ClassLoader::load_class(Symbol* name, bool search_append_only, TR
|
||||
@@ -1501,6 +1501,7 @@ InstanceKlass* ClassLoader::load_class(Symbol* name, bool search_append_only, TR
|
||||
protection_domain,
|
||||
NULL, // host_klass
|
||||
NULL, // cp_patches
|
||||
@@ -248,10 +248,10 @@ index ee43e47ec89..64b8e03cdbd 100644
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
if (DumpSharedSpaces) {
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index 37bd9d8eed5..bcbd2548ffc 100644
|
||||
index c58026ae192..25103fff2c0 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -1245,6 +1245,12 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*)) {
|
||||
@@ -1242,6 +1242,12 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*)) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ index 37bd9d8eed5..bcbd2548ffc 100644
|
||||
// Only walks the classes defined in this class loader.
|
||||
void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*, TRAPS), TRAPS) {
|
||||
Thread* thread = Thread::current();
|
||||
@@ -1254,6 +1260,12 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*, TRAPS),
|
||||
@@ -1251,6 +1257,12 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*, TRAPS),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ index 37bd9d8eed5..bcbd2548ffc 100644
|
||||
// Walks all entries in the dictionary including entries initiated by this class loader.
|
||||
void ClassLoaderDataGraph::dictionary_all_entries_do(void f(InstanceKlass*, ClassLoaderData*)) {
|
||||
Thread* thread = Thread::current();
|
||||
@@ -1375,11 +1387,15 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
@@ -1372,11 +1384,15 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
// Mark metadata seen on the stack only so we can delete unneeded entries.
|
||||
// Only walk all metadata, including the expensive code cache walk, for Full GC
|
||||
// and only if class redefinition and if there's previous versions of
|
||||
@@ -294,7 +294,7 @@ index 37bd9d8eed5..bcbd2548ffc 100644
|
||||
|
||||
// Save previous _unloading pointer for CMS which may add to unloading list before
|
||||
// purging and we don't want to rewalk the previously unloaded class loader data.
|
||||
@@ -1389,10 +1405,12 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
@@ -1386,10 +1402,12 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
while (data != NULL) {
|
||||
if (data->is_alive()) {
|
||||
// clean metaspace
|
||||
@@ -308,7 +308,7 @@ index 37bd9d8eed5..bcbd2548ffc 100644
|
||||
data = data->next();
|
||||
loaders_processed++;
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.hpp b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
index aa6b25c0bd1..b5a7cf21c85 100644
|
||||
index 152cc26efdb..7e357929971 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
@@ -125,6 +125,11 @@ class ClassLoaderDataGraph : public AllStatic {
|
||||
@@ -336,7 +336,7 @@ index f5157e07c76..e9e52f00e8a 100644
|
||||
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
|
||||
index 1ed49636e5b..4b27e572593 100644
|
||||
index 3ac1ca69ae5..118730f1b83 100644
|
||||
--- a/src/hotspot/share/classfile/dictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/dictionary.cpp
|
||||
@@ -245,6 +245,19 @@ void Dictionary::classes_do(void f(InstanceKlass*)) {
|
||||
@@ -449,10 +449,10 @@ index d26f1f11fb4..fd4b134d7a7 100644
|
||||
|
||||
// An entry in the class loader data dictionaries, this describes a class as
|
||||
diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp
|
||||
index 17ae8be1d02..a659cd23fc8 100644
|
||||
index 6d320fb0d30..1004f41b277 100644
|
||||
--- a/src/hotspot/share/classfile/javaClasses.cpp
|
||||
+++ b/src/hotspot/share/classfile/javaClasses.cpp
|
||||
@@ -2428,6 +2428,8 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHand
|
||||
@@ -2444,6 +2444,8 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHand
|
||||
skip_throwableInit_check = true;
|
||||
}
|
||||
}
|
||||
@@ -461,7 +461,7 @@ index 17ae8be1d02..a659cd23fc8 100644
|
||||
if (method->is_hidden()) {
|
||||
if (skip_hidden) continue;
|
||||
}
|
||||
@@ -3610,6 +3612,62 @@ void java_lang_invoke_DirectMethodHandle::serialize_offsets(SerializeClosure* f)
|
||||
@@ -3626,6 +3628,62 @@ void java_lang_invoke_DirectMethodHandle::serialize_offsets(SerializeClosure* f)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -524,7 +524,7 @@ index 17ae8be1d02..a659cd23fc8 100644
|
||||
// Support for java_lang_invoke_MethodHandle
|
||||
|
||||
int java_lang_invoke_MethodHandle::_type_offset;
|
||||
@@ -3796,6 +3854,11 @@ void java_lang_invoke_ResolvedMethodName::set_vmtarget(oop resolved_method, Meth
|
||||
@@ -3812,6 +3870,11 @@ void java_lang_invoke_ResolvedMethodName::set_vmtarget(oop resolved_method, Meth
|
||||
resolved_method->address_field_put(_vmtarget_offset, (address)m);
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ index 17ae8be1d02..a659cd23fc8 100644
|
||||
// lookup ResolvedMethod oop in the table, or create a new one and intern it
|
||||
oop resolved_method = ResolvedMethodTable::find_method(m());
|
||||
diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp
|
||||
index 97df4a0bdea..2e121e19f19 100644
|
||||
index bd9cdca3fe3..da004d1b307 100644
|
||||
--- a/src/hotspot/share/classfile/javaClasses.hpp
|
||||
+++ b/src/hotspot/share/classfile/javaClasses.hpp
|
||||
@@ -67,6 +67,8 @@
|
||||
@@ -561,7 +561,7 @@ index 97df4a0bdea..2e121e19f19 100644
|
||||
static void allocate_fixup_lists();
|
||||
static void compute_offsets();
|
||||
|
||||
@@ -1048,6 +1050,55 @@ class java_lang_invoke_DirectMethodHandle: AllStatic {
|
||||
@@ -1055,6 +1057,55 @@ class java_lang_invoke_DirectMethodHandle: AllStatic {
|
||||
static int member_offset_in_bytes() { return _member_offset; }
|
||||
};
|
||||
|
||||
@@ -617,7 +617,7 @@ index 97df4a0bdea..2e121e19f19 100644
|
||||
// Interface to java.lang.invoke.LambdaForm objects
|
||||
// (These are a private interface for managing adapter code generation.)
|
||||
|
||||
@@ -1099,6 +1150,7 @@ class java_lang_invoke_ResolvedMethodName : AllStatic {
|
||||
@@ -1106,6 +1157,7 @@ class java_lang_invoke_ResolvedMethodName : AllStatic {
|
||||
|
||||
static Method* vmtarget(oop resolved_method);
|
||||
static void set_vmtarget(oop resolved_method, Method* method);
|
||||
@@ -685,10 +685,10 @@ index c08f8b9a119..b7b96c5cfdc 100644
|
||||
public:
|
||||
static InstanceKlass* check_shared_class_file_load_hook(
|
||||
diff --git a/src/hotspot/share/classfile/loaderConstraints.cpp b/src/hotspot/share/classfile/loaderConstraints.cpp
|
||||
index 7cccf23efb7..a26b9d1cb55 100644
|
||||
index 9cd141bbfa2..e4a23e8a27c 100644
|
||||
--- a/src/hotspot/share/classfile/loaderConstraints.cpp
|
||||
+++ b/src/hotspot/share/classfile/loaderConstraints.cpp
|
||||
@@ -90,6 +90,19 @@ LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
|
||||
@@ -87,6 +87,19 @@ LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
|
||||
return pp;
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ index 7cccf23efb7..a26b9d1cb55 100644
|
||||
|
||||
void LoaderConstraintTable::purge_loader_constraints() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
||||
@@ -445,7 +458,7 @@ void LoaderConstraintTable::verify(PlaceholderTable* placeholders) {
|
||||
@@ -442,7 +455,7 @@ void LoaderConstraintTable::verify(PlaceholderTable* placeholders) {
|
||||
if (k != NULL) {
|
||||
// We found the class in the dictionary, so we should
|
||||
// make sure that the Klass* matches what we already have.
|
||||
@@ -732,10 +732,10 @@ index 8a7a1248e62..611e18aaf85 100644
|
||||
bool add_entry(Symbol* name, InstanceKlass* klass1, Handle loader1,
|
||||
InstanceKlass* klass2, Handle loader2);
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index 0360de28dea..f9e2f5ebdc3 100644
|
||||
index 5c8ff453823..669de5e56a5 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -200,6 +200,7 @@ Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader
|
||||
@@ -201,6 +201,7 @@ Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader
|
||||
// can return a null klass
|
||||
klass = handle_resolution_exception(class_name, throw_error, klass, THREAD);
|
||||
}
|
||||
@@ -743,7 +743,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
return klass;
|
||||
}
|
||||
|
||||
@@ -874,6 +875,7 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
|
||||
@@ -875,6 +876,7 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
|
||||
ClassLoaderData* loader_data = k->class_loader_data();
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
Klass* kk = find_class(name, loader_data);
|
||||
@@ -751,7 +751,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
assert(kk == k, "should be present in dictionary");
|
||||
}
|
||||
#endif
|
||||
@@ -996,6 +998,7 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
@@ -997,6 +999,7 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
protection_domain,
|
||||
host_klass,
|
||||
cp_patches,
|
||||
@@ -759,7 +759,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
CHECK_NULL);
|
||||
|
||||
if (host_klass != NULL && k != NULL) {
|
||||
@@ -1045,10 +1048,13 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1050,10 +1053,13 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
Handle class_loader,
|
||||
Handle protection_domain,
|
||||
ClassFileStream* st,
|
||||
@@ -773,7 +773,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
// Classloaders that support parallelism, e.g. bootstrap classloader,
|
||||
// do not acquire lock here
|
||||
bool DoObjectLock = true;
|
||||
@@ -1072,6 +1078,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1077,6 +1083,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
InstanceKlass* k = NULL;
|
||||
|
||||
#if INCLUDE_CDS
|
||||
@@ -781,7 +781,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
if (!DumpSharedSpaces) {
|
||||
k = SystemDictionaryShared::lookup_from_stream(class_name,
|
||||
class_loader,
|
||||
@@ -1091,9 +1098,15 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1096,9 +1103,15 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
protection_domain,
|
||||
NULL, // host_klass
|
||||
NULL, // cp_patches
|
||||
@@ -797,7 +797,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
assert(k != NULL, "no klass created");
|
||||
Symbol* h_name = k->name();
|
||||
assert(class_name == NULL || class_name == h_name, "name mismatch");
|
||||
@@ -1101,7 +1114,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1106,7 +1119,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
// Add class just loaded
|
||||
// If a class loader supports parallel classloading handle parallel define requests
|
||||
// find_or_define_instance_class may return a different InstanceKlass
|
||||
@@ -806,7 +806,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
InstanceKlass* defined_k = find_or_define_instance_class(h_name, class_loader, k, THREAD);
|
||||
if (!HAS_PENDING_EXCEPTION && defined_k != k) {
|
||||
// If a parallel capable class loader already defined this class, register 'k' for cleanup.
|
||||
@@ -1110,7 +1123,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1115,7 +1128,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
k = defined_k;
|
||||
}
|
||||
} else {
|
||||
@@ -815,7 +815,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
}
|
||||
|
||||
// If defining the class throws an exception register 'k' for cleanup.
|
||||
@@ -1125,7 +1138,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1130,7 +1143,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
|
||||
Klass* check = find_class(h_name, k->class_loader_data());
|
||||
@@ -824,7 +824,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
} );
|
||||
|
||||
return k;
|
||||
@@ -1550,11 +1563,12 @@ static void post_class_define_event(InstanceKlass* k, const ClassLoaderData* def
|
||||
@@ -1553,11 +1566,12 @@ static void post_class_define_event(InstanceKlass* k, const ClassLoaderData* def
|
||||
}
|
||||
}
|
||||
|
||||
@@ -838,7 +838,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
|
||||
// for bootstrap and other parallel classloaders don't acquire lock,
|
||||
// use placeholder token
|
||||
@@ -1579,7 +1593,11 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, TRAPS) {
|
||||
@@ -1582,7 +1596,11 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, TRAPS) {
|
||||
Symbol* name_h = k->name();
|
||||
Dictionary* dictionary = loader_data->dictionary();
|
||||
unsigned int d_hash = dictionary->compute_hash(name_h);
|
||||
@@ -851,7 +851,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
|
||||
// Register class just loaded with class loader (placed in Vector)
|
||||
// Note we do this before updating the dictionary, as this can
|
||||
@@ -1613,7 +1631,7 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, TRAPS) {
|
||||
@@ -1616,7 +1634,7 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, TRAPS) {
|
||||
k->eager_initialize(THREAD);
|
||||
|
||||
// notify jvmti
|
||||
@@ -860,7 +860,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
assert(THREAD->is_Java_thread(), "thread->is_Java_thread()");
|
||||
JvmtiExport::post_class_load((JavaThread *) THREAD, k);
|
||||
|
||||
@@ -1691,7 +1709,7 @@ InstanceKlass* SystemDictionary::find_or_define_instance_class(Symbol* class_nam
|
||||
@@ -1694,7 +1712,7 @@ InstanceKlass* SystemDictionary::find_or_define_instance_class(Symbol* class_nam
|
||||
}
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
|
||||
Handle linkage_exception = Handle(); // null handle
|
||||
|
||||
@@ -1814,6 +1832,18 @@ void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) {
|
||||
@@ -1817,6 +1835,18 @@ void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) {
|
||||
CodeCache::flush_dependents_on(k);
|
||||
}
|
||||
|
||||
@@ -888,7 +888,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
// ----------------------------------------------------------------------------
|
||||
// GC support
|
||||
|
||||
@@ -2109,7 +2139,7 @@ void SystemDictionary::check_constraints(unsigned int d_hash,
|
||||
@@ -2113,7 +2143,7 @@ void SystemDictionary::check_constraints(unsigned int d_hash,
|
||||
// also hold array classes.
|
||||
|
||||
assert(check->is_instance_klass(), "noninstance in systemdictionary");
|
||||
@@ -898,7 +898,7 @@ index 0360de28dea..f9e2f5ebdc3 100644
|
||||
ss.print("loader %s", loader_data->loader_name_and_id());
|
||||
ss.print(" attempted duplicate %s definition for %s. (%s)",
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
index 77adcd4719d..8b5ba8546dd 100644
|
||||
index 649b321a6a4..06f6c869d63 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
@@ -161,6 +161,8 @@ class OopStorage;
|
||||
@@ -910,7 +910,7 @@ index 77adcd4719d..8b5ba8546dd 100644
|
||||
do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre ) \
|
||||
do_klass(VarHandle_klass, java_lang_invoke_VarHandle, Pre ) \
|
||||
do_klass(MemberName_klass, java_lang_invoke_MemberName, Pre ) \
|
||||
@@ -321,6 +323,7 @@ public:
|
||||
@@ -318,6 +320,7 @@ public:
|
||||
Handle class_loader,
|
||||
Handle protection_domain,
|
||||
ClassFileStream* st,
|
||||
@@ -918,7 +918,7 @@ index 77adcd4719d..8b5ba8546dd 100644
|
||||
TRAPS);
|
||||
|
||||
// Lookup an already loaded class. If not found NULL is returned.
|
||||
@@ -458,6 +461,10 @@ public:
|
||||
@@ -462,6 +465,10 @@ public:
|
||||
static bool is_well_known_klass(Symbol* class_name);
|
||||
#endif
|
||||
|
||||
@@ -929,7 +929,7 @@ index 77adcd4719d..8b5ba8546dd 100644
|
||||
protected:
|
||||
// Returns the class loader data to be used when looking up/updating the
|
||||
// system dictionary.
|
||||
@@ -646,7 +653,7 @@ protected:
|
||||
@@ -655,7 +662,7 @@ protected:
|
||||
// after waiting, but before reentering SystemDictionary_lock
|
||||
// to preserve lock order semantics.
|
||||
static void double_lock_wait(Handle lockObject, TRAPS);
|
||||
@@ -952,10 +952,10 @@ index ad638e26579..32de261588a 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp
|
||||
index 89f3b236ccb..c52e2531486 100644
|
||||
index ea4f74fc783..472216b6a40 100644
|
||||
--- a/src/hotspot/share/classfile/verifier.cpp
|
||||
+++ b/src/hotspot/share/classfile/verifier.cpp
|
||||
@@ -244,7 +244,7 @@ bool Verifier::is_eligible_for_verification(InstanceKlass* klass, bool should_ve
|
||||
@@ -237,7 +237,7 @@ bool Verifier::is_eligible_for_verification(InstanceKlass* klass, bool should_ve
|
||||
Symbol* name = klass->name();
|
||||
Klass* refl_magic_klass = SystemDictionary::reflect_MagicAccessorImpl_klass();
|
||||
|
||||
@@ -977,10 +977,10 @@ index 05239c57866..c1357bde0ed 100644
|
||||
methodHandle _method; // current method being verified
|
||||
VerificationType _this_type; // the verification type of the current class
|
||||
diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
index cef3f530cbc..17f7e720c95 100644
|
||||
index 44cf2583eb9..41e9a84cd69 100644
|
||||
--- a/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
+++ b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
@@ -287,6 +287,8 @@
|
||||
@@ -286,6 +286,8 @@
|
||||
template(java_lang_invoke_CallSite, "java/lang/invoke/CallSite") \
|
||||
template(java_lang_invoke_ConstantCallSite, "java/lang/invoke/ConstantCallSite") \
|
||||
template(java_lang_invoke_DirectMethodHandle, "java/lang/invoke/DirectMethodHandle") \
|
||||
@@ -989,7 +989,7 @@ index cef3f530cbc..17f7e720c95 100644
|
||||
template(java_lang_invoke_MutableCallSite, "java/lang/invoke/MutableCallSite") \
|
||||
template(java_lang_invoke_VolatileCallSite, "java/lang/invoke/VolatileCallSite") \
|
||||
template(java_lang_invoke_MethodHandle, "java/lang/invoke/MethodHandle") \
|
||||
@@ -447,6 +449,12 @@
|
||||
@@ -446,6 +448,12 @@
|
||||
template(module_entry_name, "module_entry") \
|
||||
template(resolved_references_name, "<resolved_references>") \
|
||||
template(init_lock_name, "<init_lock>") \
|
||||
@@ -1684,10 +1684,10 @@ index 81998728f66..b9ccdee8cca 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
index 6cf7aec68f8..61a406377ee 100644
|
||||
index b532101c9b5..8afe8985026 100644
|
||||
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
@@ -1471,6 +1471,7 @@ static InstanceKlass* create_new_instance_klass(InstanceKlass* ik, ClassFileStre
|
||||
@@ -1467,6 +1467,7 @@ static InstanceKlass* create_new_instance_klass(InstanceKlass* ik, ClassFileStre
|
||||
NULL, // host klass
|
||||
NULL, // cp_patches
|
||||
ClassFileParser::INTERNAL, // internal visibility
|
||||
@@ -1696,7 +1696,7 @@ index 6cf7aec68f8..61a406377ee 100644
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
log_pending_exception(PENDING_EXCEPTION);
|
||||
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
|
||||
index eab9576bcc6..c3b1d766db8 100644
|
||||
index 4a1bd297b72..7ecb950b231 100644
|
||||
--- a/src/hotspot/share/memory/universe.cpp
|
||||
+++ b/src/hotspot/share/memory/universe.cpp
|
||||
@@ -153,6 +153,7 @@ int Universe::_base_vtable_size = 0;
|
||||
@@ -1919,7 +1919,7 @@ index 2a93500b794..2a9eb978b43 100644
|
||||
|
||||
// RedefineClasses support
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index dfa4b2314b4..0bd3cf3deb7 100644
|
||||
index c6752eb373f..e9c1d4e5226 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -832,7 +832,8 @@ bool InstanceKlass::link_class_impl(bool throw_verifyerror, TRAPS) {
|
||||
@@ -2013,7 +2013,7 @@ index dfa4b2314b4..0bd3cf3deb7 100644
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
@@ -3567,7 +3617,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||
@@ -3552,7 +3602,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||
}
|
||||
|
||||
guarantee(sib->is_klass(), "should be klass");
|
||||
@@ -2109,7 +2109,7 @@ index 01c5ed5bd46..f38874340be 100644
|
||||
return class_loader_data()->holder_phantom();
|
||||
}
|
||||
diff --git a/src/hotspot/share/oops/klass.hpp b/src/hotspot/share/oops/klass.hpp
|
||||
index 1d1c524fe88..478fd26beff 100644
|
||||
index b77a19deb38..5573b10f021 100644
|
||||
--- a/src/hotspot/share/oops/klass.hpp
|
||||
+++ b/src/hotspot/share/oops/klass.hpp
|
||||
@@ -165,6 +165,18 @@ class Klass : public Metadata {
|
||||
@@ -2186,10 +2186,10 @@ index 1d1c524fe88..478fd26beff 100644
|
||||
// Compiler support
|
||||
static ByteSize super_offset() { return in_ByteSize(offset_of(Klass, _super)); }
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index 9d2cc5cc444..0a12f01536a 100644
|
||||
index 916772c0b10..ed6f769bf1b 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -1447,6 +1447,8 @@ methodHandle Method::clone_with_new_data(const methodHandle& m, u_char* new_code
|
||||
@@ -1402,6 +1402,8 @@ methodHandle Method::clone_with_new_data(const methodHandle& m, u_char* new_code
|
||||
|
||||
// Reset correct method/const method, method size, and parameter info
|
||||
newm->set_constMethod(newcm);
|
||||
@@ -2198,7 +2198,7 @@ index 9d2cc5cc444..0a12f01536a 100644
|
||||
newm->constMethod()->set_code_size(new_code_length);
|
||||
newm->constMethod()->set_constMethod_size(new_const_method_size);
|
||||
assert(newm->code_size() == new_code_length, "check");
|
||||
@@ -2140,6 +2142,10 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
||||
@@ -2096,6 +2098,10 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
||||
|
||||
// Add a method id to the jmethod_ids
|
||||
jmethodID Method::make_jmethod_id(ClassLoaderData* loader_data, Method* m) {
|
||||
@@ -2210,7 +2210,7 @@ index 9d2cc5cc444..0a12f01536a 100644
|
||||
|
||||
if (!SafepointSynchronize::is_at_safepoint()) {
|
||||
diff --git a/src/hotspot/share/oops/method.hpp b/src/hotspot/share/oops/method.hpp
|
||||
index da8468dead4..4ac3e6e80de 100644
|
||||
index 18c706187df..4533476ff8f 100644
|
||||
--- a/src/hotspot/share/oops/method.hpp
|
||||
+++ b/src/hotspot/share/oops/method.hpp
|
||||
@@ -78,6 +78,9 @@ class Method : public Metadata {
|
||||
@@ -2248,10 +2248,10 @@ index da8468dead4..4ac3e6e80de 100644
|
||||
Symbol* signature() const { return constants()->symbol_at(signature_index()); }
|
||||
int signature_index() const { return constMethod()->signature_index(); }
|
||||
diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp
|
||||
index 4ece84a0359..36b412ec078 100644
|
||||
index f9a69ef0c8b..231ada3f0ab 100644
|
||||
--- a/src/hotspot/share/prims/jni.cpp
|
||||
+++ b/src/hotspot/share/prims/jni.cpp
|
||||
@@ -354,6 +354,7 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR
|
||||
@@ -353,6 +353,7 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR
|
||||
class_loader,
|
||||
Handle(),
|
||||
&st,
|
||||
@@ -2260,10 +2260,10 @@ index 4ece84a0359..36b412ec078 100644
|
||||
|
||||
if (log_is_enabled(Debug, class, resolve) && k != NULL) {
|
||||
diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp
|
||||
index 352f1c3011e..cc0ab12f40f 100644
|
||||
index 24c66ab3918..82b359ee9a3 100644
|
||||
--- a/src/hotspot/share/prims/jvm.cpp
|
||||
+++ b/src/hotspot/share/prims/jvm.cpp
|
||||
@@ -936,6 +936,7 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name,
|
||||
@@ -935,6 +935,7 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name,
|
||||
class_loader,
|
||||
protection_domain,
|
||||
&st,
|
||||
@@ -2273,7 +2273,7 @@ index 352f1c3011e..cc0ab12f40f 100644
|
||||
if (log_is_enabled(Debug, class, resolve) && k != NULL) {
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
new file mode 100644
|
||||
index 00000000000..83c0952de37
|
||||
index 00000000000..80c31135487
|
||||
--- /dev/null
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -0,0 +1,2255 @@
|
||||
@@ -4534,7 +4534,7 @@ index 00000000000..83c0952de37
|
||||
+}
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
new file mode 100644
|
||||
index 00000000000..b712d69a193
|
||||
index 00000000000..3f95cf42645
|
||||
--- /dev/null
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -0,0 +1,202 @@
|
||||
@@ -4741,7 +4741,7 @@ index 00000000000..b712d69a193
|
||||
+};
|
||||
+#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSES2_HPP
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
index f54c9b713be..54617f05b5a 100644
|
||||
index 1dd911fd8d8..bc6ebb2d4af 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
@@ -50,6 +50,7 @@
|
||||
@@ -4752,7 +4752,7 @@ index f54c9b713be..54617f05b5a 100644
|
||||
#include "prims/jvmtiTagMap.hpp"
|
||||
#include "prims/jvmtiThreadState.inline.hpp"
|
||||
#include "prims/jvmtiUtil.hpp"
|
||||
@@ -382,8 +383,13 @@ JvmtiEnv::GetClassLoaderClasses(jobject initiating_loader, jint* class_count_ptr
|
||||
@@ -381,8 +382,13 @@ JvmtiEnv::GetClassLoaderClasses(jobject initiating_loader, jint* class_count_ptr
|
||||
// is_modifiable_class_ptr - pre-checked for NULL
|
||||
jvmtiError
|
||||
JvmtiEnv::IsModifiableClass(oop k_mirror, jboolean* is_modifiable_class_ptr) {
|
||||
@@ -4768,7 +4768,7 @@ index f54c9b713be..54617f05b5a 100644
|
||||
return JVMTI_ERROR_NONE;
|
||||
} /* end IsModifiableClass */
|
||||
|
||||
@@ -413,7 +419,8 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
@@ -412,7 +418,8 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
return JVMTI_ERROR_INVALID_CLASS;
|
||||
}
|
||||
|
||||
@@ -4778,7 +4778,7 @@ index f54c9b713be..54617f05b5a 100644
|
||||
return JVMTI_ERROR_UNMODIFIABLE_CLASS;
|
||||
}
|
||||
|
||||
@@ -445,6 +452,12 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
@@ -444,6 +451,12 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
}
|
||||
class_definitions[index].klass = jcls;
|
||||
}
|
||||
@@ -4791,7 +4791,7 @@ index f54c9b713be..54617f05b5a 100644
|
||||
VM_RedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_retransform);
|
||||
VMThread::execute(&op);
|
||||
return (op.check_error());
|
||||
@@ -455,7 +468,12 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
@@ -454,7 +467,12 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
// class_definitions - pre-checked for NULL
|
||||
jvmtiError
|
||||
JvmtiEnv::RedefineClasses(jint class_count, const jvmtiClassDefinition* class_definitions) {
|
||||
@@ -4806,10 +4806,10 @@ index f54c9b713be..54617f05b5a 100644
|
||||
VMThread::execute(&op);
|
||||
return (op.check_error());
|
||||
diff --git a/src/hotspot/share/prims/jvmtiExport.cpp b/src/hotspot/share/prims/jvmtiExport.cpp
|
||||
index 555e0140e4f..1ffc2f9ea20 100644
|
||||
index 375aa5f54f8..08f910bd2ac 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiExport.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiExport.cpp
|
||||
@@ -2803,7 +2803,7 @@ JvmtiDynamicCodeEventCollector::JvmtiDynamicCodeEventCollector() : _code_blobs(N
|
||||
@@ -2813,7 +2813,7 @@ JvmtiDynamicCodeEventCollector::JvmtiDynamicCodeEventCollector() : _code_blobs(N
|
||||
// iterate over any code blob descriptors collected and post a
|
||||
// DYNAMIC_CODE_GENERATED event to the profiler.
|
||||
JvmtiDynamicCodeEventCollector::~JvmtiDynamicCodeEventCollector() {
|
||||
@@ -4819,10 +4819,10 @@ index 555e0140e4f..1ffc2f9ea20 100644
|
||||
if (_code_blobs != NULL) {
|
||||
for (int i=0; i<_code_blobs->length(); i++) {
|
||||
diff --git a/src/hotspot/share/prims/jvmtiExport.hpp b/src/hotspot/share/prims/jvmtiExport.hpp
|
||||
index d0433dfc145..da6131eb2e6 100644
|
||||
index 557d10543c6..ef8c266bc6e 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiExport.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiExport.hpp
|
||||
@@ -176,6 +176,7 @@ class JvmtiExport : public AllStatic {
|
||||
@@ -178,6 +178,7 @@ class JvmtiExport : public AllStatic {
|
||||
// systems as needed to relax invariant checks.
|
||||
static bool _has_redefined_a_class;
|
||||
friend class VM_RedefineClasses;
|
||||
@@ -4850,10 +4850,10 @@ index 61a616271f6..60604c645ff 100644
|
||||
|
||||
int extract(jclass* result_list) {
|
||||
diff --git a/src/hotspot/share/prims/jvmtiImpl.cpp b/src/hotspot/share/prims/jvmtiImpl.cpp
|
||||
index a0a6a6cbd18..39953a71244 100644
|
||||
index 001c592807a..2a92ece916e 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiImpl.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiImpl.cpp
|
||||
@@ -295,6 +295,11 @@ void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
|
||||
@@ -293,6 +293,11 @@ void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
|
||||
Symbol* m_name = _method->name();
|
||||
Symbol* m_signature = _method->signature();
|
||||
|
||||
@@ -4866,10 +4866,10 @@ index a0a6a6cbd18..39953a71244 100644
|
||||
for (InstanceKlass* pv_node = ik->previous_versions();
|
||||
pv_node != NULL;
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index f68990f3af9..87be28e9eee 100644
|
||||
index c071e0641d4..a9057893368 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -204,6 +204,8 @@ void ResolvedMethodTable::print() {
|
||||
@@ -201,6 +201,8 @@ void ResolvedMethodTable::print() {
|
||||
void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
|
||||
// For each entry in RMT, change to new method
|
||||
@@ -4878,7 +4878,7 @@ index f68990f3af9..87be28e9eee 100644
|
||||
for (int i = 0; i < _the_table->table_size(); ++i) {
|
||||
for (ResolvedMethodEntry* entry = _the_table->bucket(i);
|
||||
entry != NULL;
|
||||
@@ -218,18 +220,30 @@ void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
@@ -215,18 +217,30 @@ void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
|
||||
if (old_method->is_old()) {
|
||||
|
||||
@@ -4918,7 +4918,7 @@ index f68990f3af9..87be28e9eee 100644
|
||||
|
||||
ResourceMark rm;
|
||||
if (!(*trace_name_printed)) {
|
||||
@@ -238,9 +252,14 @@ void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
@@ -235,9 +249,14 @@ void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
}
|
||||
log_debug(redefine, class, update, constantpool)
|
||||
("ResolvedMethod method update: %s(%s)",
|
||||
@@ -4935,7 +4935,7 @@ index f68990f3af9..87be28e9eee 100644
|
||||
}
|
||||
#endif // INCLUDE_JVMTI
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index cc9366dcc53..4e2a3ff1083 100644
|
||||
index 3e7d48ad5a3..a11dfe48dd6 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -2033,6 +2033,36 @@ unsigned int addopens_count = 0;
|
||||
@@ -4985,7 +4985,7 @@ index cc9366dcc53..4e2a3ff1083 100644
|
||||
#if INCLUDE_NMT
|
||||
if (MemTracker::tracking_level() == NMT_off) {
|
||||
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
|
||||
index 73444c43fe5..5cb7f5c4bd8 100644
|
||||
index bd439aab073..cc7f71a4404 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.hpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.hpp
|
||||
@@ -506,6 +506,7 @@ class Arguments : AllStatic {
|
||||
@@ -4997,10 +4997,10 @@ index 73444c43fe5..5cb7f5c4bd8 100644
|
||||
static size_t max_heap_for_compressed_oops();
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
|
||||
index 3d2e4e6900b..35b8205f7c7 100644
|
||||
index 3cd51a1ac95..7b061359c1d 100644
|
||||
--- a/src/hotspot/share/runtime/globals.hpp
|
||||
+++ b/src/hotspot/share/runtime/globals.hpp
|
||||
@@ -2683,7 +2683,11 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
@@ -2674,7 +2674,11 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
"Start flight recording with options")) \
|
||||
\
|
||||
experimental(bool, UseFastUnorderedTimeStamps, false, \
|
||||
@@ -5014,7 +5014,7 @@ index 3d2e4e6900b..35b8205f7c7 100644
|
||||
#define VM_FLAGS(develop, \
|
||||
develop_pd, \
|
||||
diff --git a/src/hotspot/share/runtime/interfaceSupport.inline.hpp b/src/hotspot/share/runtime/interfaceSupport.inline.hpp
|
||||
index f39687a25bc..7b1aa3cc58e 100644
|
||||
index 0267345b535..bcdd8e5d3e6 100644
|
||||
--- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp
|
||||
+++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp
|
||||
@@ -276,8 +276,8 @@ class ThreadToNativeFromVM : public ThreadStateTransition {
|
||||
@@ -5029,7 +5029,7 @@ index f39687a25bc..7b1aa3cc58e 100644
|
||||
trans_and_fence(_thread_in_vm, _thread_in_native);
|
||||
// Check for pending. async. exceptions or suspends.
|
||||
diff --git a/src/hotspot/share/runtime/javaCalls.cpp b/src/hotspot/share/runtime/javaCalls.cpp
|
||||
index dd55cff0ea3..36e8b2b9c05 100644
|
||||
index 32040586b36..0eb2fc1ec6b 100644
|
||||
--- a/src/hotspot/share/runtime/javaCalls.cpp
|
||||
+++ b/src/hotspot/share/runtime/javaCalls.cpp
|
||||
@@ -57,7 +57,8 @@ JavaCallWrapper::JavaCallWrapper(const methodHandle& callee_method, Handle recei
|
||||
@@ -5043,7 +5043,7 @@ index dd55cff0ea3..36e8b2b9c05 100644
|
||||
_result = result;
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
index 42f1fa9626f..16e91c85fd1 100644
|
||||
index b56b44eab69..2e1514cf750 100644
|
||||
--- a/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
+++ b/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
@@ -5,7 +5,7 @@
|
||||
@@ -5064,7 +5064,7 @@ index 42f1fa9626f..16e91c85fd1 100644
|
||||
Monitor* GCTaskManager_lock = NULL;
|
||||
|
||||
Mutex* Management_lock = NULL;
|
||||
@@ -291,6 +293,7 @@ void mutex_init() {
|
||||
@@ -285,6 +287,7 @@ void mutex_init() {
|
||||
def(JNIGlobalActive_lock , PaddedMutex , nonleaf-1, true, Monitor::_safepoint_check_never);
|
||||
def(JNIWeakAlloc_lock , PaddedMutex , nonleaf, true, Monitor::_safepoint_check_never);
|
||||
def(JNIWeakActive_lock , PaddedMutex , nonleaf-1, true, Monitor::_safepoint_check_never);
|
||||
@@ -5073,10 +5073,10 @@ index 42f1fa9626f..16e91c85fd1 100644
|
||||
def(AdapterHandlerLibrary_lock , PaddedMutex , nonleaf, true, Monitor::_safepoint_check_always);
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp
|
||||
index 0d263ca55ba..b41abcb82ae 100644
|
||||
index 12366c7ead1..70aeb1bd0c1 100644
|
||||
--- a/src/hotspot/share/runtime/mutexLocker.hpp
|
||||
+++ b/src/hotspot/share/runtime/mutexLocker.hpp
|
||||
@@ -124,6 +124,8 @@ extern Mutex* PerfDataManager_lock; // a long on access to PerfData
|
||||
@@ -123,6 +123,8 @@ extern Mutex* PerfDataManager_lock; // a long on access to PerfData
|
||||
extern Mutex* ParkerFreeList_lock;
|
||||
extern Mutex* OopMapCacheAlloc_lock; // protects allocation of oop_map caches
|
||||
|
||||
@@ -5086,7 +5086,7 @@ index 0d263ca55ba..b41abcb82ae 100644
|
||||
extern Mutex* OldSets_lock; // protects the old region sets
|
||||
extern Monitor* RootRegionScan_lock; // used to notify that the CM threads have finished scanning the IM snapshot regions
|
||||
diff --git a/src/hotspot/share/runtime/reflection.cpp b/src/hotspot/share/runtime/reflection.cpp
|
||||
index b8f736a7dbc..ac233f3b373 100644
|
||||
index a49b5108821..ed789b0bc2b 100644
|
||||
--- a/src/hotspot/share/runtime/reflection.cpp
|
||||
+++ b/src/hotspot/share/runtime/reflection.cpp
|
||||
@@ -658,6 +658,12 @@ bool Reflection::verify_member_access(const Klass* current_class,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 8fde348c4072670576f9e480058c8ed77ead7d47 Mon Sep 17 00:00:00 2001
|
||||
From 8ab0856ab3446eb08ad773b0225232a899527298 Mon Sep 17 00:00:00 2001
|
||||
From: skybber <lada.dvorak7@gmail.com>
|
||||
Date: Wed, 14 Nov 2018 21:18:22 +0100
|
||||
Subject: [PATCH 02/44] dcevm11 fixes
|
||||
Subject: [PATCH 02/17] dcevm11 fixes
|
||||
|
||||
1. We need to set classRedefinitionCount on new class, not old class.
|
||||
|
||||
@@ -82,7 +82,7 @@ dmh
|
||||
19 files changed, 324 insertions(+), 415 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp
|
||||
index 143a4165608..444471d1d8c 100644
|
||||
index e2b8c5793d0..5e1c740a3d2 100644
|
||||
--- a/src/hotspot/share/classfile/classFileParser.cpp
|
||||
+++ b/src/hotspot/share/classfile/classFileParser.cpp
|
||||
@@ -954,6 +954,7 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
|
||||
@@ -93,7 +93,7 @@ index 143a4165608..444471d1d8c 100644
|
||||
interf = (Klass *) maybe_newest(interf);
|
||||
|
||||
if (!interf->is_interface()) {
|
||||
@@ -3836,6 +3837,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
|
||||
@@ -3828,6 +3829,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
|
||||
// However, make sure it is not an array type.
|
||||
bool is_array = false;
|
||||
if (cp->tag_at(super_class_index).is_klass()) {
|
||||
@@ -101,7 +101,7 @@ index 143a4165608..444471d1d8c 100644
|
||||
super_klass = InstanceKlass::cast(maybe_newest(cp->resolved_klass_at(super_class_index)));
|
||||
if (need_verify)
|
||||
is_array = super_klass->is_array_klass();
|
||||
@@ -4504,7 +4506,7 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
|
||||
@@ -4496,7 +4498,7 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
|
||||
if (!_has_empty_finalizer) {
|
||||
if (_has_finalizer ||
|
||||
(super != NULL && super->has_finalizer())) {
|
||||
@@ -124,10 +124,10 @@ index d792ab4bb3f..de48092bde8 100644
|
||||
|
||||
public:
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index bcbd2548ffc..3f75bffce8a 100644
|
||||
index 25103fff2c0..ab2615da0ed 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -1245,6 +1245,7 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*)) {
|
||||
@@ -1242,6 +1242,7 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*)) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ index bcbd2548ffc..3f75bffce8a 100644
|
||||
void ClassLoaderDataGraph::dictionary_classes_do(KlassClosure* klass_closure) {
|
||||
FOR_ALL_DICTIONARY(cld) {
|
||||
cld->dictionary()->classes_do(klass_closure);
|
||||
@@ -1260,6 +1261,7 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*, TRAPS),
|
||||
@@ -1257,6 +1258,7 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*, TRAPS),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ index bcbd2548ffc..3f75bffce8a 100644
|
||||
void ClassLoaderDataGraph::rollback_redefinition() {
|
||||
FOR_ALL_DICTIONARY(cld) {
|
||||
cld->dictionary()->rollback_redefinition();
|
||||
@@ -1390,12 +1392,13 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
@@ -1387,12 +1389,13 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
// Klassesoto delete.
|
||||
|
||||
// FIXME: dcevm - block asserts in MetadataOnStackMark
|
||||
@@ -163,7 +163,7 @@ index bcbd2548ffc..3f75bffce8a 100644
|
||||
|
||||
// Save previous _unloading pointer for CMS which may add to unloading list before
|
||||
// purging and we don't want to rewalk the previously unloaded class loader data.
|
||||
@@ -1405,12 +1408,12 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
@@ -1402,12 +1405,12 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
while (data != NULL) {
|
||||
if (data->is_alive()) {
|
||||
// clean metaspace
|
||||
@@ -182,7 +182,7 @@ index bcbd2548ffc..3f75bffce8a 100644
|
||||
data = data->next();
|
||||
loaders_processed++;
|
||||
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
|
||||
index 4b27e572593..86dc1f26933 100644
|
||||
index 118730f1b83..dda5188c370 100644
|
||||
--- a/src/hotspot/share/classfile/dictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/dictionary.cpp
|
||||
@@ -245,6 +245,8 @@ void Dictionary::classes_do(void f(InstanceKlass*)) {
|
||||
@@ -223,7 +223,7 @@ index fd4b134d7a7..5eaa741d500 100644
|
||||
return (k != NULL && k->is_redefining()) ? ((InstanceKlass* )k->old_version()) : k;
|
||||
}
|
||||
diff --git a/src/hotspot/share/classfile/loaderConstraints.cpp b/src/hotspot/share/classfile/loaderConstraints.cpp
|
||||
index a26b9d1cb55..3d5a59a04ff 100644
|
||||
index e4a23e8a27c..bca73b5e0dc 100644
|
||||
--- a/src/hotspot/share/classfile/loaderConstraints.cpp
|
||||
+++ b/src/hotspot/share/classfile/loaderConstraints.cpp
|
||||
@@ -4,7 +4,7 @@
|
||||
@@ -235,7 +235,7 @@ index a26b9d1cb55..3d5a59a04ff 100644
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
@@ -90,6 +90,7 @@ LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
|
||||
@@ -87,6 +87,7 @@ LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
|
||||
return pp;
|
||||
}
|
||||
|
||||
@@ -244,10 +244,10 @@ index a26b9d1cb55..3d5a59a04ff 100644
|
||||
for (int index = 0; index < table_size(); index++) {
|
||||
LoaderConstraintEntry** p = bucket_addr(index);
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index f9e2f5ebdc3..0059af83584 100644
|
||||
index 669de5e56a5..e464b94b420 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -875,7 +875,8 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
|
||||
@@ -876,7 +876,8 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
|
||||
ClassLoaderData* loader_data = k->class_loader_data();
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
Klass* kk = find_class(name, loader_data);
|
||||
@@ -257,7 +257,7 @@ index f9e2f5ebdc3..0059af83584 100644
|
||||
assert(kk == k, "should be present in dictionary");
|
||||
}
|
||||
#endif
|
||||
@@ -1078,7 +1079,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1083,7 +1084,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
InstanceKlass* k = NULL;
|
||||
|
||||
#if INCLUDE_CDS
|
||||
@@ -266,7 +266,7 @@ index f9e2f5ebdc3..0059af83584 100644
|
||||
if (!DumpSharedSpaces) {
|
||||
k = SystemDictionaryShared::lookup_from_stream(class_name,
|
||||
class_loader,
|
||||
@@ -1832,7 +1833,7 @@ void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) {
|
||||
@@ -1835,7 +1836,7 @@ void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) {
|
||||
CodeCache::flush_dependents_on(k);
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ index f9e2f5ebdc3..0059af83584 100644
|
||||
void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
|
||||
assert(k != NULL, "just checking");
|
||||
|
||||
@@ -1840,6 +1841,7 @@ void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
|
||||
@@ -1843,6 +1844,7 @@ void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
|
||||
k->remove_from_sibling_list();
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ index b9ccdee8cca..0c24146ff00 100644
|
||||
selected_method = methodHandle(THREAD, recv_klass->method_at_vtable(vtable_index));
|
||||
}
|
||||
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
|
||||
index c3b1d766db8..9a633280118 100644
|
||||
index 7ecb950b231..d0a6d665aa0 100644
|
||||
--- a/src/hotspot/share/memory/universe.cpp
|
||||
+++ b/src/hotspot/share/memory/universe.cpp
|
||||
@@ -176,7 +176,7 @@ void Universe::basic_type_classes_do(void f(Klass*)) {
|
||||
@@ -376,7 +376,7 @@ index 47040d51f0c..4318df227d1 100644
|
||||
}
|
||||
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index 0bd3cf3deb7..e3724984aa5 100644
|
||||
index e9c1d4e5226..312d9af2527 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -178,6 +178,7 @@ bool InstanceKlass::has_nest_member(InstanceKlass* k, TRAPS) const {
|
||||
@@ -442,7 +442,7 @@ index 0bd3cf3deb7..e3724984aa5 100644
|
||||
// if (this->old_version() != NULL) {
|
||||
// InstanceKlass::cast(this->old_version())->remove_dependent_nmethod(nm, true);
|
||||
// return;
|
||||
@@ -3617,6 +3628,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||
@@ -3602,6 +3613,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||
}
|
||||
|
||||
guarantee(sib->is_klass(), "should be klass");
|
||||
@@ -463,7 +463,7 @@ index 2cc98b636f1..e8107a39813 100644
|
||||
// link this class into the implementors list of every interface it implements
|
||||
void process_interfaces(Thread *thread);
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 83c0952de37..92ce6c27b8a 100644
|
||||
index 80c31135487..43d761cdbb2 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -1,4 +1,4 @@
|
||||
@@ -1394,7 +1394,7 @@ index 83c0952de37..92ce6c27b8a 100644
|
||||
ResourceMark mark(THREAD);
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index b712d69a193..60b62c3170a 100644
|
||||
index 3f95cf42645..a48e07e3a6a 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -16,6 +16,8 @@
|
||||
@@ -1511,10 +1511,10 @@ index b712d69a193..60b62c3170a 100644
|
||||
};
|
||||
#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSES2_HPP
|
||||
diff --git a/src/hotspot/share/prims/jvmtiImpl.cpp b/src/hotspot/share/prims/jvmtiImpl.cpp
|
||||
index 39953a71244..b59d3046b88 100644
|
||||
index 2a92ece916e..d2044541d38 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiImpl.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiImpl.cpp
|
||||
@@ -296,8 +296,10 @@ void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
|
||||
@@ -294,8 +294,10 @@ void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
|
||||
Symbol* m_signature = _method->signature();
|
||||
|
||||
// (DCEVM) Go through old versions of method
|
||||
@@ -1528,10 +1528,10 @@ index 39953a71244..b59d3046b88 100644
|
||||
|
||||
// search previous versions if they exist
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index 87be28e9eee..8098b80baa6 100644
|
||||
index a9057893368..af2ec48c2e1 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -200,8 +200,52 @@ void ResolvedMethodTable::print() {
|
||||
@@ -197,8 +197,52 @@ void ResolvedMethodTable::print() {
|
||||
#endif // PRODUCT
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 049d83cfb1db63a0c20cd53696686a7ae11be824 Mon Sep 17 00:00:00 2001
|
||||
From dcf2c02f9ce950170b0e448b8ef3aceb19732a86 Mon Sep 17 00:00:00 2001
|
||||
From: skybber <lada.dvorak7@gmail.com>
|
||||
Date: Wed, 12 Dec 2018 19:38:28 +0100
|
||||
Subject: [PATCH 03/44] Support for Concurrent Mark Sweep (CMS) collector
|
||||
Subject: [PATCH 03/17] Support for Concurrent Mark Sweep (CMS) collector
|
||||
|
||||
---
|
||||
.../share/gc/cms/compactibleFreeListSpace.cpp | 139 ++++++++++++------
|
||||
@@ -422,7 +422,7 @@ index 6b109fcd2e5..8c255d6d428 100644
|
||||
Klass* new_version = oop(cur_obj)->klass()->new_version();
|
||||
if (new_version->update_information() == NULL) {
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 92ce6c27b8a..41e82ae7a69 100644
|
||||
index 43d761cdbb2..14af1aad21b 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -54,6 +54,7 @@
|
||||
@@ -462,7 +462,7 @@ index 92ce6c27b8a..41e82ae7a69 100644
|
||||
} else {
|
||||
obj->set_klass(obj->klass()->new_version());
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index 4e2a3ff1083..e3cb44d8690 100644
|
||||
index a11dfe48dd6..013ba213c00 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -2045,14 +2045,14 @@ bool Arguments::check_gc_consistency() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 199dbcfcc71ea6992970c9cf9cfeee6f13d2a600 Mon Sep 17 00:00:00 2001
|
||||
From 663ccc831cc21ffddc5bc035de2c72666df00a4e Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@mailprofiler.com>
|
||||
Date: Wed, 11 Mar 2020 14:19:34 +0100
|
||||
Subject: [PATCH 04/44] Fix class cast exception on redefinition of class A,
|
||||
Subject: [PATCH 04/17] Fix class cast exception on redefinition of class A,
|
||||
that is superclass of B that has anonymous class C
|
||||
|
||||
---
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH 04/44] Fix class cast exception on redefinition of class A,
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index e3724984aa5..b10e566b7c3 100644
|
||||
index 312d9af2527..4312c2c4ca9 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -788,7 +788,10 @@ bool InstanceKlass::link_class_impl(bool throw_verifyerror, TRAPS) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 238ef84478962cdba49b479803163b6e71f46914 Mon Sep 17 00:00:00 2001
|
||||
From 25cb9b5fa97749d3bc13dc6c848c7eb9cc1b66bb Mon Sep 17 00:00:00 2001
|
||||
From: skybber <lada.dvorak7@gmail.com>
|
||||
Date: Wed, 14 Nov 2018 21:20:08 +0100
|
||||
Subject: [PATCH 05/44] HotswapAgent integration
|
||||
Subject: [PATCH 05/17] HotswapAgent integration
|
||||
|
||||
It include:
|
||||
|
||||
@@ -37,7 +37,7 @@ old DCEVM
|
||||
make/launcher/Launcher-jdk.jartool.gmk | 2 +
|
||||
make/launcher/Launcher-jdk.javadoc.gmk | 3 +-
|
||||
make/launcher/Launcher-jdk.jcmd.gmk | 13 +++-
|
||||
make/launcher/Launcher-jdk.jconsole.gmk | 5 +-
|
||||
make/launcher/Launcher-jdk.jconsole.gmk | 3 +-
|
||||
make/launcher/Launcher-jdk.jdeps.gmk | 3 +
|
||||
make/launcher/Launcher-jdk.jdi.gmk | 1 +
|
||||
make/launcher/Launcher-jdk.jlink.gmk | 5 +-
|
||||
@@ -55,7 +55,7 @@ old DCEVM
|
||||
.../classes/com/sun/beans/package-info.java | 26 +++++++
|
||||
.../com/sun/beans/util/package-info.java | 26 +++++++
|
||||
.../share/classes/module-info.java | 3 +
|
||||
28 files changed, 210 insertions(+), 12 deletions(-)
|
||||
28 files changed, 209 insertions(+), 11 deletions(-)
|
||||
create mode 100644 src/java.desktop/share/classes/com/sun/beans/introspect/package-info.java
|
||||
create mode 100644 src/java.desktop/share/classes/com/sun/beans/package-info.java
|
||||
create mode 100644 src/java.desktop/share/classes/com/sun/beans/util/package-info.java
|
||||
@@ -259,16 +259,14 @@ index 7117fa78059..761a52d8466 100644
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
diff --git a/make/launcher/Launcher-jdk.jconsole.gmk b/make/launcher/Launcher-jdk.jconsole.gmk
|
||||
index 575b9e0595b..2ec087d710f 100644
|
||||
index 575b9e0595b..9b38683a489 100644
|
||||
--- a/make/launcher/Launcher-jdk.jconsole.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jconsole.gmk
|
||||
@@ -28,8 +28,9 @@ include LauncherCommon.gmk
|
||||
$(eval $(call SetupBuildLauncher, jconsole, \
|
||||
@@ -29,7 +29,8 @@ $(eval $(call SetupBuildLauncher, jconsole, \
|
||||
MAIN_CLASS := sun.tools.jconsole.JConsole, \
|
||||
JAVA_ARGS := --add-opens java.base/java.io=jdk.jconsole \
|
||||
- -Djconsole.showOutputViewer \
|
||||
-Djconsole.showOutputViewer \
|
||||
- -Djdk.attach.allowAttachSelf=true, \
|
||||
+ -Djconsole.showOutputViewer \
|
||||
+ -Djdk.attach.allowAttachSelf=true \
|
||||
+ -XX:+DisableHotswapAgent, \
|
||||
CFLAGS_windows := -DJAVAW, \
|
||||
@@ -394,10 +392,10 @@ index 82311e69fd6..bd39f8595b2 100644
|
||||
CFLAGS := -DENABLE_ARG_FILES, \
|
||||
))
|
||||
diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
index 17f7e720c95..0d0badeabd0 100644
|
||||
index 41e9a84cd69..1f67eb202b5 100644
|
||||
--- a/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
+++ b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
@@ -343,6 +343,7 @@
|
||||
@@ -342,6 +342,7 @@
|
||||
/* common method and field names */ \
|
||||
template(object_initializer_name, "<init>") \
|
||||
template(class_initializer_name, "<clinit>") \
|
||||
@@ -419,10 +417,10 @@ index 0c24146ff00..9dc184d02f5 100644
|
||||
!fd.is_static() &&
|
||||
!m->is_object_initializer());
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index e3cb44d8690..36276741b5c 100644
|
||||
index 013ba213c00..2b5ba619f43 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -3967,6 +3967,8 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
|
||||
@@ -3962,6 +3962,8 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
|
||||
// Set object alignment values.
|
||||
set_object_alignment();
|
||||
|
||||
@@ -431,7 +429,7 @@ index e3cb44d8690..36276741b5c 100644
|
||||
#if !INCLUDE_CDS
|
||||
if (DumpSharedSpaces || RequireSharedSpaces) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
@@ -4300,3 +4302,68 @@ bool Arguments::copy_expand_pid(const char* src, size_t srclen,
|
||||
@@ -4295,3 +4297,68 @@ bool Arguments::copy_expand_pid(const char* src, size_t srclen,
|
||||
*b = '\0';
|
||||
return (p == src_end); // return false if not all of the source was copied
|
||||
}
|
||||
@@ -501,7 +499,7 @@ index e3cb44d8690..36276741b5c 100644
|
||||
+
|
||||
+}
|
||||
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
|
||||
index 5cb7f5c4bd8..d7fd03d079e 100644
|
||||
index cc7f71a4404..b2bab2e1f44 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.hpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.hpp
|
||||
@@ -507,6 +507,9 @@ class Arguments : AllStatic {
|
||||
@@ -515,7 +513,7 @@ index 5cb7f5c4bd8..d7fd03d079e 100644
|
||||
static size_t max_heap_for_compressed_oops();
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
|
||||
index 35b8205f7c7..4d6fe0034a3 100644
|
||||
index 7b061359c1d..fc0405b5df2 100644
|
||||
--- a/src/hotspot/share/runtime/globals.hpp
|
||||
+++ b/src/hotspot/share/runtime/globals.hpp
|
||||
@@ -32,6 +32,12 @@
|
||||
@@ -531,7 +529,7 @@ index 35b8205f7c7..4d6fe0034a3 100644
|
||||
// The larger HeapWordSize for 64bit requires larger heaps
|
||||
// for the same application running in 64bit. See bug 4967770.
|
||||
// The minimum alignment to a heap word size is done. Other
|
||||
@@ -2687,8 +2693,10 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
@@ -2678,8 +2684,10 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
\
|
||||
product(bool, AllowEnhancedClassRedefinition, true, \
|
||||
"Allow enhanced class redefinition beyond swapping method " \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 2b6afed7b4bd890326b2cc7a3eaf3020e3f0fe44 Mon Sep 17 00:00:00 2001
|
||||
From 28d352b4b7cda96a37f95d75cf576570271157e3 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sun, 4 Oct 2020 21:12:12 +0200
|
||||
Subject: [PATCH 06/44] Support for Lambda class redefinition
|
||||
Subject: [PATCH 06/17] Support for Lambda class redefinition
|
||||
|
||||
---
|
||||
.../share/classfile/classLoaderData.cpp | 9 +++
|
||||
@@ -15,7 +15,7 @@ Subject: [PATCH 06/44] Support for Lambda class redefinition
|
||||
8 files changed, 85 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index 3f75bffce8a..a901b4309b9 100644
|
||||
index ab2615da0ed..1bc67adf5a7 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -663,6 +663,15 @@ Dictionary* ClassLoaderData::create_dictionary() {
|
||||
@@ -35,7 +35,7 @@ index 3f75bffce8a..a901b4309b9 100644
|
||||
oop ClassLoaderData::holder_phantom() const {
|
||||
// A klass that was previously considered dead can be looked up in the
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.hpp b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
index b5a7cf21c85..c4f617ab800 100644
|
||||
index 7e357929971..00a84610b43 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
@@ -292,6 +292,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
|
||||
@@ -47,10 +47,10 @@ index b5a7cf21c85..c4f617ab800 100644
|
||||
|
||||
void unload();
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index 0059af83584..89375cd59fa 100644
|
||||
index e464b94b420..791b49c68ad 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -970,12 +970,16 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
@@ -971,12 +971,16 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
Handle protection_domain,
|
||||
ClassFileStream* st,
|
||||
const InstanceKlass* host_klass,
|
||||
@@ -67,7 +67,7 @@ index 0059af83584..89375cd59fa 100644
|
||||
if (host_klass != NULL) {
|
||||
// Create a new CLD for anonymous class, that uses the same class loader
|
||||
// as the host_klass
|
||||
@@ -999,8 +1003,12 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
@@ -1000,8 +1004,12 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
protection_domain,
|
||||
host_klass,
|
||||
cp_patches,
|
||||
@@ -81,7 +81,7 @@ index 0059af83584..89375cd59fa 100644
|
||||
|
||||
if (host_klass != NULL && k != NULL) {
|
||||
// Anonymous classes must update ClassLoaderData holder (was host_klass loader)
|
||||
@@ -1841,7 +1849,7 @@ void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
|
||||
@@ -1844,7 +1852,7 @@ void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
|
||||
k->remove_from_sibling_list();
|
||||
}
|
||||
|
||||
@@ -91,10 +91,10 @@ index 0059af83584..89375cd59fa 100644
|
||||
constraints()->update_after_redefinition();
|
||||
}
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
index 8b5ba8546dd..0002abe6122 100644
|
||||
index 06f6c869d63..1dbbffa197f 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
@@ -307,6 +307,7 @@ public:
|
||||
@@ -304,6 +304,7 @@ public:
|
||||
protection_domain,
|
||||
st,
|
||||
NULL, // host klass
|
||||
@@ -102,7 +102,7 @@ index 8b5ba8546dd..0002abe6122 100644
|
||||
NULL, // cp_patches
|
||||
THREAD);
|
||||
}
|
||||
@@ -315,6 +316,7 @@ public:
|
||||
@@ -312,6 +313,7 @@ public:
|
||||
Handle protection_domain,
|
||||
ClassFileStream* st,
|
||||
const InstanceKlass* host_klass,
|
||||
@@ -111,7 +111,7 @@ index 8b5ba8546dd..0002abe6122 100644
|
||||
TRAPS);
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 41e82ae7a69..b94caa39562 100644
|
||||
index 14af1aad21b..0b239b2ff6d 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -488,6 +488,8 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
@@ -208,7 +208,7 @@ index 41e82ae7a69..b94caa39562 100644
|
||||
|
||||
// Sort the affected klasses such that a supertype is always on a smaller array index than its subtype.
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 60b62c3170a..d8a11b51fe9 100644
|
||||
index a48e07e3a6a..3551b06ecde 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -116,6 +116,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
@@ -220,10 +220,10 @@ index 60b62c3170a..d8a11b51fe9 100644
|
||||
// Figure out which new methods match old methods in name and signature,
|
||||
// which methods have been added, and which are no longer present
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index 8098b80baa6..5a5d5e98623 100644
|
||||
index af2ec48c2e1..7741328979f 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -203,7 +203,7 @@ void ResolvedMethodTable::print() {
|
||||
@@ -200,7 +200,7 @@ void ResolvedMethodTable::print() {
|
||||
|
||||
void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
|
||||
@@ -232,7 +232,7 @@ index 8098b80baa6..5a5d5e98623 100644
|
||||
for (int i = 0; i < _the_table->table_size(); ++i) {
|
||||
for (ResolvedMethodEntry* entry = _the_table->bucket(i);
|
||||
entry != NULL;
|
||||
@@ -274,6 +274,8 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
@@ -271,6 +271,8 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
|
||||
Method* newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
|
||||
@@ -242,10 +242,10 @@ index 8098b80baa6..5a5d5e98623 100644
|
||||
assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
assert(old_method != newer_method, "sanity check");
|
||||
diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp
|
||||
index 5f9f93c6b4c..c35ef044e65 100644
|
||||
index 2f14e01ce0d..d0e0367d8eb 100644
|
||||
--- a/src/hotspot/share/prims/unsafe.cpp
|
||||
+++ b/src/hotspot/share/prims/unsafe.cpp
|
||||
@@ -820,6 +820,7 @@ Unsafe_DefineAnonymousClass_impl(JNIEnv *env,
|
||||
@@ -818,6 +818,7 @@ Unsafe_DefineAnonymousClass_impl(JNIEnv *env,
|
||||
host_domain,
|
||||
&st,
|
||||
InstanceKlass::cast(host_klass),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From d78e34a89b273508d3502d7456bf40b568edb3fd Mon Sep 17 00:00:00 2001
|
||||
From 3b6c7d2f807857712df6fd51a36a5a906b705f57 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sat, 23 May 2020 10:02:15 +0200
|
||||
Subject: [PATCH 07/44] Fix "no original bytecode found" error if method with
|
||||
Subject: [PATCH 07/17] Fix "no original bytecode found" error if method with
|
||||
bkp is missing
|
||||
|
||||
Sometimes IDE can deploy class with erroneous method, such method has
|
||||
@@ -28,10 +28,10 @@ index e377e36b88c..262ecc021b2 100644
|
||||
|
||||
int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) {
|
||||
diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp
|
||||
index aeafba285f0..026fe9234fb 100644
|
||||
index f367e658879..71bbd15a4f5 100644
|
||||
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp
|
||||
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp
|
||||
@@ -819,7 +819,7 @@ IRT_END
|
||||
@@ -834,7 +834,7 @@ IRT_END
|
||||
// Invokes
|
||||
|
||||
IRT_ENTRY(Bytecodes::Code, InterpreterRuntime::get_original_bytecode_at(JavaThread* thread, Method* method, address bcp))
|
||||
@@ -41,10 +41,10 @@ index aeafba285f0..026fe9234fb 100644
|
||||
|
||||
IRT_ENTRY(void, InterpreterRuntime::set_original_bytecode_at(JavaThread* thread, Method* method, address bcp, Bytecodes::Code new_code))
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index 0a12f01536a..037ceef2c44 100644
|
||||
index ed6f769bf1b..031f255e632 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -1789,14 +1789,14 @@ bool CompressedLineNumberReadStream::read_pair() {
|
||||
@@ -1744,14 +1744,14 @@ bool CompressedLineNumberReadStream::read_pair() {
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
|
||||
@@ -61,7 +61,7 @@ index 0a12f01536a..037ceef2c44 100644
|
||||
ResourceMark rm;
|
||||
fatal("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci);
|
||||
}
|
||||
@@ -1942,7 +1942,7 @@ BreakpointInfo::BreakpointInfo(Method* m, int bci) {
|
||||
@@ -1897,7 +1897,7 @@ BreakpointInfo::BreakpointInfo(Method* m, int bci) {
|
||||
_signature_index = m->signature_index();
|
||||
_orig_bytecode = (Bytecodes::Code) *m->bcp_from(_bci);
|
||||
if (_orig_bytecode == Bytecodes::_breakpoint)
|
||||
@@ -70,7 +70,7 @@ index 0a12f01536a..037ceef2c44 100644
|
||||
_next = NULL;
|
||||
}
|
||||
|
||||
@@ -1951,7 +1951,7 @@ void BreakpointInfo::set(Method* method) {
|
||||
@@ -1906,7 +1906,7 @@ void BreakpointInfo::set(Method* method) {
|
||||
{
|
||||
Bytecodes::Code code = (Bytecodes::Code) *method->bcp_from(_bci);
|
||||
if (code == Bytecodes::_breakpoint)
|
||||
@@ -80,7 +80,7 @@ index 0a12f01536a..037ceef2c44 100644
|
||||
}
|
||||
#endif
|
||||
diff --git a/src/hotspot/share/oops/method.hpp b/src/hotspot/share/oops/method.hpp
|
||||
index 4ac3e6e80de..9ff4f0e8036 100644
|
||||
index 4533476ff8f..193e1845b23 100644
|
||||
--- a/src/hotspot/share/oops/method.hpp
|
||||
+++ b/src/hotspot/share/oops/method.hpp
|
||||
@@ -230,7 +230,7 @@ class Method : public Metadata {
|
||||
@@ -102,7 +102,7 @@ index 4ac3e6e80de..9ff4f0e8036 100644
|
||||
void set_breakpoint(int bci);
|
||||
void clear_breakpoint(int bci);
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index b94caa39562..1fbba406087 100644
|
||||
index 0b239b2ff6d..aba99bb60fa 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -1356,14 +1356,16 @@ void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7035df8436fdda697753f1af48c26701328f684a Mon Sep 17 00:00:00 2001
|
||||
From 102b7a0ba69c1411ec926985c79a36a2fc1978dd Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sun, 24 May 2020 12:07:42 +0200
|
||||
Subject: [PATCH 08/44] Replace deleted method with
|
||||
Subject: [PATCH 08/17] Replace deleted method with
|
||||
Universe::throw_no_such_method_error
|
||||
|
||||
---
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 08/44] Replace deleted method with
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index 5a5d5e98623..c7996df51bc 100644
|
||||
index 7741328979f..06581643c3b 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -264,25 +264,25 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
@@ -261,25 +261,25 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
|
||||
if (old_method->is_old()) {
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 7c0fb4d6401dd7f87e6985c514484ee9846bf447 Mon Sep 17 00:00:00 2001
|
||||
From a89a7aad1d44b540e4704332939d639e66392bd5 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Fri, 12 Jun 2020 17:43:52 +0200
|
||||
Subject: [PATCH 09/44] Support for G1 gc
|
||||
Subject: [PATCH 09/17] Support for G1 gc
|
||||
|
||||
---
|
||||
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 20 +++
|
||||
src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 2 +
|
||||
src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 3 +
|
||||
src/hotspot/share/gc/g1/g1FullCollector.cpp | 16 +-
|
||||
.../share/gc/g1/g1FullGCCompactTask.cpp | 92 +++++++++-
|
||||
.../share/gc/g1/g1FullGCCompactTask.hpp | 19 +++
|
||||
@@ -26,15 +26,15 @@ Subject: [PATCH 09/44] Support for G1 gc
|
||||
.../prims/jvmtiEnhancedRedefineClasses.hpp | 6 +-
|
||||
src/hotspot/share/runtime/arguments.cpp | 4 +-
|
||||
src/hotspot/share/utilities/growableArray.hpp | 4 +
|
||||
22 files changed, 627 insertions(+), 141 deletions(-)
|
||||
22 files changed, 628 insertions(+), 141 deletions(-)
|
||||
create mode 100644 src/hotspot/share/gc/shared/dcevmSharedGC.cpp
|
||||
create mode 100644 src/hotspot/share/gc/shared/dcevmSharedGC.hpp
|
||||
|
||||
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
index 3b0e6eb6587..d33a5ff3a54 100644
|
||||
index dea8d9fdb0e..33664a30519 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
@@ -2115,6 +2115,21 @@ public:
|
||||
@@ -2108,6 +2108,21 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ index 3b0e6eb6587..d33a5ff3a54 100644
|
||||
void G1CollectedHeap::object_iterate(ObjectClosure* cl) {
|
||||
IterateObjectClosureRegionClosure blk(cl);
|
||||
heap_region_iterate(&blk);
|
||||
@@ -2152,6 +2167,11 @@ void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
|
||||
@@ -2117,6 +2132,11 @@ void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
|
||||
_hrm.iterate(cl);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ index 3b0e6eb6587..d33a5ff3a54 100644
|
||||
HeapRegionClaimer *hrclaimer,
|
||||
uint worker_id) const {
|
||||
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
|
||||
index 1f2029ab1f0..39b05017b92 100644
|
||||
index 8a171dc6b52..05a068bb2e0 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
|
||||
@@ -144,6 +144,7 @@ class G1CollectedHeap : public CollectedHeap {
|
||||
@@ -80,14 +80,15 @@ index 1f2029ab1f0..39b05017b92 100644
|
||||
|
||||
// Other related classes.
|
||||
friend class HeapRegionClaimer;
|
||||
@@ -1117,6 +1118,7 @@ public:
|
||||
@@ -1116,6 +1117,8 @@ public:
|
||||
|
||||
// Iteration functions.
|
||||
|
||||
void object_iterate_parallel(ObjectClosure* cl, uint worker_id, HeapRegionClaimer* claimer);
|
||||
+ void object_par_iterate(ObjectClosure* cl);
|
||||
|
||||
+
|
||||
// Iterate over all objects, calling "cl.do_object" on each.
|
||||
virtual void object_iterate(ObjectClosure* cl);
|
||||
|
||||
diff --git a/src/hotspot/share/gc/g1/g1FullCollector.cpp b/src/hotspot/share/gc/g1/g1FullCollector.cpp
|
||||
index 4362ee87e30..7b9496976b8 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp
|
||||
@@ -1023,7 +1024,7 @@ index 8c255d6d428..71ed3cfcda8 100644
|
||||
oop(compaction_top)->init_mark_raw();
|
||||
assert(oop(compaction_top)->klass() != NULL, "should have a class");
|
||||
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
|
||||
index 9a633280118..2e4f597cf1f 100644
|
||||
index d0a6d665aa0..3dc4cc1323c 100644
|
||||
--- a/src/hotspot/share/memory/universe.cpp
|
||||
+++ b/src/hotspot/share/memory/universe.cpp
|
||||
@@ -210,6 +210,11 @@ void Universe::root_oops_do(OopClosure *oopClosure) {
|
||||
@@ -1039,7 +1040,7 @@ index 9a633280118..2e4f597cf1f 100644
|
||||
SystemDictionary::oops_do(oopClosure);
|
||||
}
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 1fbba406087..e67fc2dd58f 100644
|
||||
index aba99bb60fa..8b6fad2128e 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -36,7 +36,6 @@
|
||||
@@ -1243,7 +1244,7 @@ index 1fbba406087..e67fc2dd58f 100644
|
||||
ResourceMark mark(THREAD);
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index d8a11b51fe9..9755944d70b 100644
|
||||
index 3551b06ecde..62a0fbf54d4 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -86,9 +86,10 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
@@ -1268,7 +1269,7 @@ index d8a11b51fe9..9755944d70b 100644
|
||||
static void fix_invoke_method(Method* method);
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index 36276741b5c..0db55d00bd3 100644
|
||||
index 2b5ba619f43..5053ad7ee61 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -2045,9 +2045,9 @@ bool Arguments::check_gc_consistency() {
|
||||
@@ -1284,10 +1285,10 @@ index 36276741b5c..0db55d00bd3 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/hotspot/share/utilities/growableArray.hpp b/src/hotspot/share/utilities/growableArray.hpp
|
||||
index ea746e065fa..d13e64f3806 100644
|
||||
index f37d94a0529..738d475aea6 100644
|
||||
--- a/src/hotspot/share/utilities/growableArray.hpp
|
||||
+++ b/src/hotspot/share/utilities/growableArray.hpp
|
||||
@@ -523,6 +523,10 @@ template<class E> class GrowableArrayIterator : public StackObj {
|
||||
@@ -532,6 +532,10 @@ template<class E> class GrowableArrayIterator : public StackObj {
|
||||
assert(_array == rhs._array, "iterator belongs to different array");
|
||||
return _position != rhs._position;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 840e28ad947e63d97d40a5e05fdacc0bfd371962 Mon Sep 17 00:00:00 2001
|
||||
From 2c6512bb54400e3836a3c348c10c78557c1abbf5 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sat, 13 Jun 2020 18:50:59 +0200
|
||||
Subject: [PATCH 10/44] Change log level in advanced redefinition
|
||||
Subject: [PATCH 10/17] Change log level in advanced redefinition
|
||||
|
||||
- Change log level for "Comparing different class ver.." to debug
|
||||
- Fix adjust_method_entries_dcevm logging levels and severity
|
||||
@@ -11,7 +11,7 @@ Subject: [PATCH 10/44] Change log level in advanced redefinition
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index e67fc2dd58f..5be9bb74305 100644
|
||||
index 8b6fad2128e..a8adfa5af47 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -915,7 +915,7 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
|
||||
@@ -24,10 +24,10 @@ index e67fc2dd58f..5be9bb74305 100644
|
||||
assert(new_class->old_version() != NULL, "must have old version");
|
||||
InstanceKlass* the_class = InstanceKlass::cast(new_class->old_version());
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index c7996df51bc..082d3d26c34 100644
|
||||
index 06581643c3b..10806bee29b 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -273,7 +273,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
@@ -270,7 +270,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
} else {
|
||||
newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
|
||||
@@ -36,7 +36,7 @@ index c7996df51bc..082d3d26c34 100644
|
||||
|
||||
assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
|
||||
assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
@@ -293,7 +293,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
@@ -290,7 +290,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
|
||||
ResourceMark rm;
|
||||
if (!(*trace_name_printed)) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 68c65981000d71555a529443831a18c9738c9566 Mon Sep 17 00:00:00 2001
|
||||
From 9c8d44a088bfd73f9be3678110a67a5ed8954c8a Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Tue, 6 Oct 2020 22:15:31 +0200
|
||||
Subject: [PATCH 11/44] AllowEnhancedClassRedefinition is false (disabled) by
|
||||
Subject: [PATCH 11/17] AllowEnhancedClassRedefinition is false (disabled) by
|
||||
default
|
||||
|
||||
---
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 11/44] AllowEnhancedClassRedefinition is false (disabled) by
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
|
||||
index 4d6fe0034a3..1984b8c28f9 100644
|
||||
index fc0405b5df2..607a39449dc 100644
|
||||
--- a/src/hotspot/share/runtime/globals.hpp
|
||||
+++ b/src/hotspot/share/runtime/globals.hpp
|
||||
@@ -2691,7 +2691,7 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
@@ -2682,7 +2682,7 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
experimental(bool, UseFastUnorderedTimeStamps, false, \
|
||||
"Use platform unstable time where supported for timestamps only") \
|
||||
\
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From b7e705f79f0a6fcc486511a5b8d7007dde4feec0 Mon Sep 17 00:00:00 2001
|
||||
From 69bc6c03ad25d485182d1b17f265a59ff98e3352 Mon Sep 17 00:00:00 2001
|
||||
From: Artem Khvastunov <artem.khvastunov@jetbrains.com>
|
||||
Date: Tue, 14 Apr 2020 19:11:35 +0200
|
||||
Subject: [PATCH 12/44] add jvmtiEnhancedRedefineClasses.* to CMakeLists.txt
|
||||
Subject: [PATCH 12/17] add jvmtiEnhancedRedefineClasses.* to CMakeLists.txt
|
||||
|
||||
---
|
||||
jb/project/hotspot-cmake/CMakeLists.txt | 2 ++
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From 7f887b3b4819fbbe79a8caaae0e4f175c1368f77 Mon Sep 17 00:00:00 2001
|
||||
From 5e66d1cd39dcae56adfa3a4785e8da47218d7b72 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Mon, 19 Oct 2020 20:00:04 +0200
|
||||
Subject: [PATCH 13/44] Set HOTSPOT_VM_DISTRO=Dynamic Code Evolution
|
||||
Subject: [PATCH 13/17] Set HOTSPOT_VM_DISTRO=Dynamic Code Evolution
|
||||
|
||||
---
|
||||
make/autoconf/version-numbers | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers
|
||||
index f8945e435aa..30f6b825493 100644
|
||||
index bb9d863c992..e462ab57217 100644
|
||||
--- a/make/autoconf/version-numbers
|
||||
+++ b/make/autoconf/version-numbers
|
||||
@@ -44,7 +44,7 @@ PRODUCT_NAME=OpenJDK
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 01acfab08f6fb1c1a0db80915cacf8987021272c Mon Sep 17 00:00:00 2001
|
||||
From 5b1408b47bd86a5bd2a4aa1f39705687efc73223 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sun, 11 Oct 2020 10:43:28 +0200
|
||||
Subject: [PATCH 14/44] Fix G1 nmethod registration
|
||||
Subject: [PATCH 14/17] Fix G1 nmethod registration
|
||||
|
||||
---
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 19 ++++++++++++++++---
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH 14/44] Fix G1 nmethod registration
|
||||
2 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 5be9bb74305..f4bde7504c8 100644
|
||||
index a8adfa5af47..4ee12b7021f 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -217,7 +217,14 @@ void VM_EnhancedRedefineClasses::mark_as_scavengable(nmethod* nm) {
|
||||
@@ -53,7 +53,7 @@ index 5be9bb74305..f4bde7504c8 100644
|
||||
log_trace(redefine, class, obsolete, metadata)("After updating instances");
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 9755944d70b..4c0412d343d 100644
|
||||
index 62a0fbf54d4..d00109a0b92 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -116,7 +116,8 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From ca37cdca38fa1dd08844767510fce418a8c49b9e Mon Sep 17 00:00:00 2001
|
||||
From c5bae0e9c9c0b0a6e05a966648fb2ddaf9a16564 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Thu, 22 Oct 2020 20:15:20 +0200
|
||||
Subject: [PATCH 15/44] Initialize method's _new_version/_old_version to NULL
|
||||
Subject: [PATCH 15/17] Initialize method's _new_version/_old_version to NULL
|
||||
|
||||
---
|
||||
src/hotspot/share/oops/method.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index 037ceef2c44..6b8e2198e55 100644
|
||||
index 031f255e632..a9556ecf0c4 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -83,7 +83,8 @@ Method* Method::allocate(ClassLoaderData* loader_data,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 400fa82043b7b9589e1f77c43f6696b133fc1188 Mon Sep 17 00:00:00 2001
|
||||
From 5504812403a0673c428fc5589cd94f2c3fea7616 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Fri, 23 Oct 2020 10:20:26 +0200
|
||||
Subject: [PATCH 16/44] Clear dcevm code separation
|
||||
Subject: [PATCH 16/17] Clear dcevm code separation
|
||||
|
||||
---
|
||||
src/hotspot/share/classfile/systemDictionary.cpp | 4 ++--
|
||||
@@ -15,10 +15,10 @@ Subject: [PATCH 16/44] Clear dcevm code separation
|
||||
8 files changed, 27 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index 89375cd59fa..a61c342f5bd 100644
|
||||
index 791b49c68ad..011a14eab32 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -1147,7 +1147,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
@@ -1152,7 +1152,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
|
||||
Klass* check = find_class(h_name, k->class_loader_data());
|
||||
@@ -27,7 +27,7 @@ index 89375cd59fa..a61c342f5bd 100644
|
||||
} );
|
||||
|
||||
return k;
|
||||
@@ -2149,7 +2149,7 @@ void SystemDictionary::check_constraints(unsigned int d_hash,
|
||||
@@ -2153,7 +2153,7 @@ void SystemDictionary::check_constraints(unsigned int d_hash,
|
||||
// also hold array classes.
|
||||
|
||||
assert(check->is_instance_klass(), "noninstance in systemdictionary");
|
||||
@@ -93,10 +93,10 @@ index 9dc184d02f5..bff1c3627b0 100644
|
||||
is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string(),
|
||||
current_klass->external_name());
|
||||
diff --git a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
index 61a406377ee..da9df7a21a2 100644
|
||||
index 8afe8985026..4e7b39406fa 100644
|
||||
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
@@ -1471,7 +1471,7 @@ static InstanceKlass* create_new_instance_klass(InstanceKlass* ik, ClassFileStre
|
||||
@@ -1467,7 +1467,7 @@ static InstanceKlass* create_new_instance_klass(InstanceKlass* ik, ClassFileStre
|
||||
NULL, // host klass
|
||||
NULL, // cp_patches
|
||||
ClassFileParser::INTERNAL, // internal visibility
|
||||
@@ -106,7 +106,7 @@ index 61a406377ee..da9df7a21a2 100644
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
log_pending_exception(PENDING_EXCEPTION);
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index b10e566b7c3..7557a84fbf3 100644
|
||||
index 4312c2c4ca9..7335f0cffc9 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -178,7 +178,9 @@ bool InstanceKlass::has_nest_member(InstanceKlass* k, TRAPS) const {
|
||||
@@ -138,7 +138,7 @@ index b10e566b7c3..7557a84fbf3 100644
|
||||
wait = true;
|
||||
ol.waitUninterruptibly(CHECK);
|
||||
}
|
||||
@@ -3632,7 +3634,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||
@@ -3617,7 +3619,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||
|
||||
guarantee(sib->is_klass(), "should be klass");
|
||||
// TODO: (DCEVM) explain
|
||||
@@ -148,10 +148,10 @@ index b10e566b7c3..7557a84fbf3 100644
|
||||
|
||||
// Verify implementor fields requires the Compile_lock, but this is sometimes
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index 6b8e2198e55..2af3e71635e 100644
|
||||
index a9556ecf0c4..6c7edaca67e 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -2144,7 +2144,7 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
||||
@@ -2100,7 +2100,7 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
||||
// Add a method id to the jmethod_ids
|
||||
jmethodID Method::make_jmethod_id(ClassLoaderData* loader_data, Method* m) {
|
||||
// FIXME: (DCEVM) ???
|
||||
@@ -174,7 +174,7 @@ index 60604c645ff..325bffb7ad0 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/hotspot/share/runtime/reflection.cpp b/src/hotspot/share/runtime/reflection.cpp
|
||||
index ac233f3b373..ae0cb65969a 100644
|
||||
index ed789b0bc2b..06f60855655 100644
|
||||
--- a/src/hotspot/share/runtime/reflection.cpp
|
||||
+++ b/src/hotspot/share/runtime/reflection.cpp
|
||||
@@ -660,7 +660,7 @@ bool Reflection::verify_member_access(const Klass* current_class,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 22608d7381bc606fa488389c3d4e56987abd166b Mon Sep 17 00:00:00 2001
|
||||
From a9bc3c0b7acfe8432f4f50362df3d8f95d7b5d9d Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Fri, 23 Oct 2020 11:07:40 +0200
|
||||
Subject: [PATCH 17/44] Fix metadataOnStack bug
|
||||
Subject: [PATCH 17/17] Fix metadataOnStack bug
|
||||
|
||||
---
|
||||
.../share/classfile/classLoaderData.cpp | 7 +-
|
||||
@@ -11,10 +11,10 @@ Subject: [PATCH 17/44] Fix metadataOnStack bug
|
||||
4 files changed, 41 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index a901b4309b9..7b88f6b44d9 100644
|
||||
index 1bc67adf5a7..bba5ce0511f 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -1401,13 +1401,10 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
@@ -1398,13 +1398,10 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
// Klassesoto delete.
|
||||
|
||||
// FIXME: dcevm - block asserts in MetadataOnStackMark
|
||||
@@ -143,7 +143,7 @@ index 8da4ac6f92b..6d327ab98f2 100644
|
||||
|
||||
static void record(Metadata* m);
|
||||
diff --git a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
|
||||
index aee84b1d7c5..3dd86d63a1f 100644
|
||||
index 1b2070d686f..1178c863c30 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
|
||||
@@ -199,7 +199,7 @@ void VM_RedefineClasses::doit() {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From dbce1c2db6bcb28327fd715d389c824805174690 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Wed, 11 Nov 2020 18:45:15 +0100
|
||||
Subject: [PATCH 18/18] Fix LoadedClassesClosure - fixes problems with remote
|
||||
debugging
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
index 325bffb7ad0..30752e37f1c 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
// the new version (SystemDictionary stores only new versions). But the LoadedClassesClosure's functionality was
|
||||
// changed in java8 where jvmtiLoadedClasses collects all classes from all classloaders, therefore we
|
||||
// must use new versions only.
|
||||
- if (AllowEnhancedClassRedefinition && k->new_version()==NULL) {
|
||||
+ if (!AllowEnhancedClassRedefinition || k->new_version()==NULL) {
|
||||
_classStack.push((jclass) _env->jni_reference(Handle(_cur_thread, k->java_mirror())));
|
||||
}
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 371093160151f400b149a5e5e4cd1acc89b1ab52 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sun, 1 Nov 2020 21:19:00 +0100
|
||||
Subject: [PATCH 18/44] Ignore MetadataOnStackMark if redefining_gc_run
|
||||
|
||||
---
|
||||
src/hotspot/share/classfile/classLoaderData.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index 7b88f6b44d9..2f6329f3e4d 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -1404,7 +1404,7 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
|
||||
bool walk_all_metadata = clean_previous_versions &&
|
||||
JvmtiExport::has_redefined_a_class() &&
|
||||
InstanceKlass::has_previous_versions_and_reset();
|
||||
- MetadataOnStackMark md_on_stack(walk_all_metadata, AllowEnhancedClassRedefinition);
|
||||
+ MetadataOnStackMark md_on_stack(walk_all_metadata, Universe::is_redefining_gc_run());
|
||||
|
||||
// Save previous _unloading pointer for CMS which may add to unloading list before
|
||||
// purging and we don't want to rewalk the previously unloaded class loader data.
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
From 3151c71be433365e2d8ce5fb6e061b12fbca009a Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Wed, 11 Nov 2020 18:45:15 +0100
|
||||
Subject: [PATCH 19/44] Fix LoadedClassesClosure - fixes problems with remote
|
||||
debugging
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
index 325bffb7ad0..30752e37f1c 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
// the new version (SystemDictionary stores only new versions). But the LoadedClassesClosure's functionality was
|
||||
// changed in java8 where jvmtiLoadedClasses collects all classes from all classloaders, therefore we
|
||||
// must use new versions only.
|
||||
- if (AllowEnhancedClassRedefinition && k->new_version()==NULL) {
|
||||
+ if (!AllowEnhancedClassRedefinition || k->new_version()==NULL) {
|
||||
_classStack.push((jclass) _env->jni_reference(Handle(_cur_thread, k->java_mirror())));
|
||||
}
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From 9a869a57205c3e0f75ea0c23f6c5dc4334e6ddd8 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Fri, 5 Feb 2021 23:30:49 +0100
|
||||
Subject: [PATCH 20/44] Disable AllowEnhancedClassRedefinition in flight
|
||||
recorder
|
||||
|
||||
---
|
||||
src/hotspot/share/runtime/arguments.cpp | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index 0db55d00bd3..65839b842e2 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -3967,6 +3967,13 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
|
||||
// Set object alignment values.
|
||||
set_object_alignment();
|
||||
|
||||
+ if (FlightRecorder) {
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ warning("EnhancedClassRedefinition was disabled, it is not allowed in FlightRecorder.");
|
||||
+ AllowEnhancedClassRedefinition = false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
setup_hotswap_agent();
|
||||
|
||||
#if !INCLUDE_CDS
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
From a6b2a48880db25c3c8ce5bc3bae9040eda6f18f2 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Fri, 12 Feb 2021 12:33:11 +0100
|
||||
Subject: [PATCH 21/44] JBR-3106 Check InstanceKlass::has_nestmate_access_to
|
||||
with active classes
|
||||
|
||||
Dcevm can leave old host in nested class if nested class is not
|
||||
redefined together with host class
|
||||
---
|
||||
src/hotspot/share/oops/instanceKlass.cpp | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index 7557a84fbf3..ed26b33466a 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -327,11 +327,21 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // (DCEVM) cur_host can be old, decide accessibility based on active version
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ cur_host = InstanceKlass::cast(cur_host->active_version());
|
||||
+ }
|
||||
+
|
||||
Klass* k_nest_host = k->nest_host(icce, CHECK_false);
|
||||
if (k_nest_host == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // (DCEVM) k_nest_host can be old, decide accessibility based on active version
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ k_nest_host = InstanceKlass::cast(k_nest_host->active_version());
|
||||
+ }
|
||||
+
|
||||
bool access = (cur_host == k_nest_host);
|
||||
|
||||
if (log_is_enabled(Trace, class, nestmates)) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From 01b00e2df98dbcfc2e37c42017a545de5f29e852 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sun, 7 Feb 2021 12:08:58 +0100
|
||||
Subject: [PATCH 22/44] JBR-3110 Fix assert in MetadataOnStackMark
|
||||
|
||||
Fixed fastdebug tests crashes in redefine gc run
|
||||
---
|
||||
src/hotspot/share/classfile/metadataOnStackMark.cpp | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/metadataOnStackMark.cpp b/src/hotspot/share/classfile/metadataOnStackMark.cpp
|
||||
index 9d7bdbde74b..66049f11629 100644
|
||||
--- a/src/hotspot/share/classfile/metadataOnStackMark.cpp
|
||||
+++ b/src/hotspot/share/classfile/metadataOnStackMark.cpp
|
||||
@@ -49,10 +49,11 @@ NOT_PRODUCT(bool MetadataOnStackMark::_is_active = false;)
|
||||
MetadataOnStackMark::MetadataOnStackMark(bool redefinition_walk, bool ignore) : _ignore(ignore) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "sanity check");
|
||||
assert(_used_buffers == NULL, "sanity check");
|
||||
- assert(!_is_active, "MetadataOnStackMarks do not nest");
|
||||
- NOT_PRODUCT(_is_active = true;)
|
||||
|
||||
if (!ignore) {
|
||||
+ assert(!_is_active, "MetadataOnStackMarks do not nest");
|
||||
+ NOT_PRODUCT(_is_active = true;)
|
||||
+
|
||||
Threads::metadata_handles_do(Metadata::mark_on_stack);
|
||||
|
||||
if (redefinition_walk) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
From 214a02487be521857a088595f8568df7846acd62 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Fri, 12 Feb 2021 11:27:39 +0100
|
||||
Subject: [PATCH 23/44] Code cleanup
|
||||
|
||||
- Rename confusing method name old_if_redefined to old_if_redefining
|
||||
- Remove unused is_redefining_gc_run
|
||||
---
|
||||
src/hotspot/share/classfile/dictionary.cpp | 6 +++---
|
||||
src/hotspot/share/classfile/dictionary.hpp | 2 +-
|
||||
src/hotspot/share/memory/universe.hpp | 5 -----
|
||||
3 files changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
|
||||
index 86dc1f26933..d347f572350 100644
|
||||
--- a/src/hotspot/share/classfile/dictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/dictionary.cpp
|
||||
@@ -381,7 +381,7 @@ InstanceKlass* Dictionary::find(unsigned int hash, Symbol* name,
|
||||
int index = hash_to_index(hash);
|
||||
DictionaryEntry* entry = get_entry(index, hash, name);
|
||||
if (entry != NULL && entry->is_valid_protection_domain(protection_domain)) {
|
||||
- return old_if_redefined(entry->instance_klass());
|
||||
+ return old_if_redefining(entry->instance_klass());
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
@@ -394,7 +394,7 @@ InstanceKlass* Dictionary::find_class(int index, unsigned int hash,
|
||||
assert (index == index_for(name), "incorrect index?");
|
||||
|
||||
DictionaryEntry* entry = get_entry(index, hash, name);
|
||||
- return old_if_redefined((entry != NULL) ? entry->instance_klass() : NULL);
|
||||
+ return old_if_redefining((entry != NULL) ? entry->instance_klass() : NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ InstanceKlass* Dictionary::find_shared_class(int index, unsigned int hash,
|
||||
assert (index == index_for(name), "incorrect index?");
|
||||
|
||||
DictionaryEntry* entry = get_entry(index, hash, name);
|
||||
- return old_if_redefined((entry != NULL) ? entry->instance_klass() : NULL);
|
||||
+ return old_if_redefining((entry != NULL) ? entry->instance_klass() : NULL);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/dictionary.hpp b/src/hotspot/share/classfile/dictionary.hpp
|
||||
index 5eaa741d500..f6e08e7bfd5 100644
|
||||
--- a/src/hotspot/share/classfile/dictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/dictionary.hpp
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
void rollback_redefinition();
|
||||
|
||||
// (DCEVM) return old class if redefining in AllowEnhancedClassRedefinition, otherwise return "k"
|
||||
- static InstanceKlass* old_if_redefined(InstanceKlass* k) {
|
||||
+ static InstanceKlass* old_if_redefining(InstanceKlass* k) {
|
||||
return (k != NULL && k->is_redefining()) ? ((InstanceKlass* )k->old_version()) : k;
|
||||
}
|
||||
};
|
||||
diff --git a/src/hotspot/share/memory/universe.hpp b/src/hotspot/share/memory/universe.hpp
|
||||
index b32db16b9cf..742dada0e8f 100644
|
||||
--- a/src/hotspot/share/memory/universe.hpp
|
||||
+++ b/src/hotspot/share/memory/universe.hpp
|
||||
@@ -52,13 +52,8 @@ class LatestMethodCache : public CHeapObj<mtClass> {
|
||||
Klass* _klass;
|
||||
int _method_idnum;
|
||||
|
||||
- static bool _is_redefining_gc_run;
|
||||
-
|
||||
public:
|
||||
|
||||
- static bool is_redefining_gc_run() { return _is_redefining_gc_run; }
|
||||
- static void set_redefining_gc_run(bool b) { _is_redefining_gc_run = b; }
|
||||
-
|
||||
LatestMethodCache() { _klass = NULL; _method_idnum = -1; }
|
||||
~LatestMethodCache() { _klass = NULL; _method_idnum = -1; }
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
From 88d359a84fb3a7dd7556c91ed0e17dca5b8d7d25 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sat, 13 Feb 2021 20:47:52 +0100
|
||||
Subject: [PATCH 24/44] JBR-3111 Update class in all dictionaries where it was
|
||||
already defined
|
||||
|
||||
This patch keeps compatibility with std redefinition, that does not
|
||||
create a new Klass, but modifies it, then it is modified in all
|
||||
dictionaries containing this class.
|
||||
---
|
||||
src/hotspot/share/classfile/classLoaderData.cpp | 9 +++++++++
|
||||
src/hotspot/share/classfile/classLoaderData.hpp | 3 +++
|
||||
src/hotspot/share/classfile/dictionary.cpp | 2 +-
|
||||
src/hotspot/share/classfile/dictionary.hpp | 2 +-
|
||||
src/hotspot/share/classfile/systemDictionary.cpp | 4 +++-
|
||||
5 files changed, 17 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index 2f6329f3e4d..68df33b6c40 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -1277,6 +1277,15 @@ void ClassLoaderDataGraph::rollback_redefinition() {
|
||||
}
|
||||
}
|
||||
|
||||
+// (DCEVM) - iterate over all classes in all dictionaries
|
||||
+bool ClassLoaderDataGraph::dictionary_classes_do_update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass) {
|
||||
+ bool ok = false;
|
||||
+ FOR_ALL_DICTIONARY(cld) {
|
||||
+ ok = cld->dictionary()->update_klass(name, k, old_klass) || ok;
|
||||
+ }
|
||||
+ return ok;
|
||||
+}
|
||||
+
|
||||
// Walks all entries in the dictionary including entries initiated by this class loader.
|
||||
void ClassLoaderDataGraph::dictionary_all_entries_do(void f(InstanceKlass*, ClassLoaderData*)) {
|
||||
Thread* thread = Thread::current();
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.hpp b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
index c4f617ab800..92f57dac23e 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
@@ -130,6 +130,9 @@ class ClassLoaderDataGraph : public AllStatic {
|
||||
// Enhanced class redefinition
|
||||
static void rollback_redefinition();
|
||||
|
||||
+ // Enhanced class redefinition
|
||||
+ static bool dictionary_classes_do_update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass);
|
||||
+
|
||||
// Iterate all classes and their class loaders, including initiating class loaders.
|
||||
static void dictionary_all_entries_do(void f(InstanceKlass*, ClassLoaderData*));
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
|
||||
index d347f572350..fd9ef491ba1 100644
|
||||
--- a/src/hotspot/share/classfile/dictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/dictionary.cpp
|
||||
@@ -345,7 +345,7 @@ DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
|
||||
}
|
||||
|
||||
// (DCEVM) replace old_class by new class in dictionary
|
||||
-bool Dictionary::update_klass(unsigned int hash, Symbol* name, ClassLoaderData* loader_data, InstanceKlass* k, InstanceKlass* old_klass) {
|
||||
+bool Dictionary::update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass) {
|
||||
// There are several entries for the same class in the dictionary: One extra entry for each parent classloader of the classloader of the class.
|
||||
bool found = false;
|
||||
for (int index = 0; index < table_size(); index++) {
|
||||
diff --git a/src/hotspot/share/classfile/dictionary.hpp b/src/hotspot/share/classfile/dictionary.hpp
|
||||
index f6e08e7bfd5..2932cc9c320 100644
|
||||
--- a/src/hotspot/share/classfile/dictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/dictionary.hpp
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
void free_entry(DictionaryEntry* entry);
|
||||
|
||||
// Enhanced class redefinition
|
||||
- bool update_klass(unsigned int hash, Symbol* name, ClassLoaderData* loader_data, InstanceKlass* k, InstanceKlass* old_klass);
|
||||
+ bool update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass);
|
||||
|
||||
void rollback_redefinition();
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index a61c342f5bd..cf0a05176c8 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -1603,7 +1603,9 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, InstanceKlass* ol
|
||||
Dictionary* dictionary = loader_data->dictionary();
|
||||
unsigned int d_hash = dictionary->compute_hash(name_h);
|
||||
if (is_redefining) {
|
||||
- bool ok = dictionary->update_klass(d_hash, name_h, loader_data, k, old_klass);
|
||||
+ // Update all dictionaries containing old_class to new_class
|
||||
+ // outcome must be same as result of standard redefinition, that does not create a new Klass
|
||||
+ bool ok = ClassLoaderDataGraph::dictionary_classes_do_update_klass(name_h, k, old_klass);
|
||||
assert (ok, "must have found old class and updated!");
|
||||
}
|
||||
check_constraints(d_hash, k, class_loader_h, !is_redefining, CHECK);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,527 +0,0 @@
|
||||
From cfdbad725c55a4ce45d407393a4591d8b8f333c9 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Thu, 18 Jun 2020 18:40:11 +0200
|
||||
Subject: [PATCH 25/44] JBR-3140 - support for modularized HotswapAgent
|
||||
|
||||
Add -XX:HotswapAgent=[disabled,fatjar.core]
|
||||
---
|
||||
make/launcher/Launcher-java.base.gmk | 1 -
|
||||
make/launcher/Launcher-java.rmi.gmk | 2 -
|
||||
make/launcher/Launcher-java.scripting.gmk | 3 +-
|
||||
make/launcher/Launcher-java.security.jgss.gmk | 3 --
|
||||
make/launcher/Launcher-jdk.aot.gmk | 2 -
|
||||
make/launcher/Launcher-jdk.compiler.gmk | 5 +-
|
||||
make/launcher/Launcher-jdk.hotspot.agent.gmk | 1 -
|
||||
make/launcher/Launcher-jdk.jartool.gmk | 2 -
|
||||
make/launcher/Launcher-jdk.javadoc.gmk | 3 +-
|
||||
make/launcher/Launcher-jdk.jcmd.gmk | 13 +----
|
||||
make/launcher/Launcher-jdk.jdeps.gmk | 3 --
|
||||
make/launcher/Launcher-jdk.jdi.gmk | 1 -
|
||||
make/launcher/Launcher-jdk.jlink.gmk | 5 +-
|
||||
make/launcher/Launcher-jdk.jshell.gmk | 1 -
|
||||
make/launcher/Launcher-jdk.jstatd.gmk | 1 -
|
||||
make/launcher/Launcher-jdk.pack.gmk | 1 -
|
||||
make/launcher/Launcher-jdk.rmic.gmk | 1 -
|
||||
.../Launcher-jdk.scripting.nashorn.shell.gmk | 3 +-
|
||||
src/hotspot/share/runtime/arguments.cpp | 48 +++++++++++--------
|
||||
.../runtime/flags/jvmFlagConstraintList.cpp | 23 +++++++++
|
||||
.../runtime/flags/jvmFlagConstraintList.hpp | 1 +
|
||||
.../flags/jvmFlagConstraintsRuntime.cpp | 10 ++++
|
||||
.../flags/jvmFlagConstraintsRuntime.hpp | 1 +
|
||||
src/hotspot/share/runtime/globals.hpp | 12 ++++-
|
||||
24 files changed, 81 insertions(+), 65 deletions(-)
|
||||
|
||||
diff --git a/make/launcher/Launcher-java.base.gmk b/make/launcher/Launcher-java.base.gmk
|
||||
index 38ba29530d8..f6d4aa28fe6 100644
|
||||
--- a/make/launcher/Launcher-java.base.gmk
|
||||
+++ b/make/launcher/Launcher-java.base.gmk
|
||||
@@ -52,7 +52,6 @@ endif
|
||||
|
||||
$(eval $(call SetupBuildLauncher, keytool, \
|
||||
MAIN_CLASS := sun.security.tools.keytool.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
diff --git a/make/launcher/Launcher-java.rmi.gmk b/make/launcher/Launcher-java.rmi.gmk
|
||||
index 07046232275..a69a90bcc81 100644
|
||||
--- a/make/launcher/Launcher-java.rmi.gmk
|
||||
+++ b/make/launcher/Launcher-java.rmi.gmk
|
||||
@@ -27,10 +27,8 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, rmid, \
|
||||
MAIN_CLASS := sun.rmi.server.Activation, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, rmiregistry, \
|
||||
MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-java.scripting.gmk b/make/launcher/Launcher-java.scripting.gmk
|
||||
index cf100e20789..057d2bf3aca 100644
|
||||
--- a/make/launcher/Launcher-java.scripting.gmk
|
||||
+++ b/make/launcher/Launcher-java.scripting.gmk
|
||||
@@ -27,6 +27,5 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jrunscript, \
|
||||
MAIN_CLASS := com.sun.tools.script.shell.Main, \
|
||||
- JAVA_ARGS := --add-modules ALL-DEFAULT \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
+ JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-java.security.jgss.gmk b/make/launcher/Launcher-java.security.jgss.gmk
|
||||
index 2b856bfccb4..7411e1a21c4 100644
|
||||
--- a/make/launcher/Launcher-java.security.jgss.gmk
|
||||
+++ b/make/launcher/Launcher-java.security.jgss.gmk
|
||||
@@ -28,16 +28,13 @@ include LauncherCommon.gmk
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$(eval $(call SetupBuildLauncher, kinit, \
|
||||
MAIN_CLASS := sun.security.krb5.internal.tools.Kinit, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, klist, \
|
||||
MAIN_CLASS := sun.security.krb5.internal.tools.Klist, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, ktab, \
|
||||
MAIN_CLASS := sun.security.krb5.internal.tools.Ktab, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
endif
|
||||
diff --git a/make/launcher/Launcher-jdk.aot.gmk b/make/launcher/Launcher-jdk.aot.gmk
|
||||
index 2c52c31a555..10717a5e1c5 100644
|
||||
--- a/make/launcher/Launcher-jdk.aot.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.aot.gmk
|
||||
@@ -31,7 +31,6 @@ include LauncherCommon.gmk
|
||||
$(eval $(call SetupBuildLauncher, jaotc, \
|
||||
MAIN_CLASS := jdk.tools.jaotc.Main, \
|
||||
EXTRA_JAVA_ARGS := -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI \
|
||||
- -XX:+DisableHotswapAgent \
|
||||
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
@@ -41,7 +40,6 @@ $(eval $(call SetupBuildLauncher, jaotc, \
|
||||
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
, \
|
||||
JAVA_ARGS := --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
- -XX:+DisableHotswapAgent \
|
||||
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
|
||||
diff --git a/make/launcher/Launcher-jdk.compiler.gmk b/make/launcher/Launcher-jdk.compiler.gmk
|
||||
index 744969546de..f71c37adf74 100644
|
||||
--- a/make/launcher/Launcher-jdk.compiler.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.compiler.gmk
|
||||
@@ -27,14 +27,12 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, javac, \
|
||||
MAIN_CLASS := com.sun.tools.javac.Main, \
|
||||
- JAVA_ARGS := --add-modules ALL-DEFAULT \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
+ JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, serialver, \
|
||||
MAIN_CLASS := sun.tools.serialver.SerialVer, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
@@ -43,7 +41,6 @@ ifeq ($(ENABLE_SJAVAC), yes)
|
||||
# into any real images
|
||||
$(eval $(call SetupBuildLauncher, sjavac, \
|
||||
MAIN_CLASS := com.sun.tools.sjavac.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.hotspot.agent.gmk b/make/launcher/Launcher-jdk.hotspot.agent.gmk
|
||||
index 9f12b05b172..76da3600368 100644
|
||||
--- a/make/launcher/Launcher-jdk.hotspot.agent.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.hotspot.agent.gmk
|
||||
@@ -27,6 +27,5 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jhsdb, \
|
||||
MAIN_CLASS := sun.jvm.hotspot.SALauncher, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
MACOSX_PRIVILEGED := true, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.jartool.gmk b/make/launcher/Launcher-jdk.jartool.gmk
|
||||
index 647d82b65b1..f74e82bfdae 100644
|
||||
--- a/make/launcher/Launcher-jdk.jartool.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jartool.gmk
|
||||
@@ -27,10 +27,8 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jar, \
|
||||
MAIN_CLASS := sun.tools.jar.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jarsigner, \
|
||||
MAIN_CLASS := sun.security.tools.jarsigner.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.javadoc.gmk b/make/launcher/Launcher-jdk.javadoc.gmk
|
||||
index c3d2093be04..889028a2b17 100644
|
||||
--- a/make/launcher/Launcher-jdk.javadoc.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.javadoc.gmk
|
||||
@@ -27,7 +27,6 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, javadoc, \
|
||||
MAIN_CLASS := jdk.javadoc.internal.tool.Main, \
|
||||
- JAVA_ARGS := --add-modules ALL-DEFAULT \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
+ JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.jcmd.gmk b/make/launcher/Launcher-jdk.jcmd.gmk
|
||||
index 761a52d8466..7117fa78059 100644
|
||||
--- a/make/launcher/Launcher-jdk.jcmd.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jcmd.gmk
|
||||
@@ -30,7 +30,6 @@ $(eval $(call SetupBuildLauncher, jinfo, \
|
||||
JAVA_ARGS := \
|
||||
-Dsun.jvm.hotspot.debugger.useProcDebugger \
|
||||
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
MACOSX_PRIVILEGED := true, \
|
||||
))
|
||||
|
||||
@@ -38,36 +37,28 @@ $(eval $(call SetupBuildLauncher, jmap, \
|
||||
MAIN_CLASS := sun.tools.jmap.JMap, \
|
||||
JAVA_ARGS := \
|
||||
-Dsun.jvm.hotspot.debugger.useProcDebugger \
|
||||
- -Dsun.jvm.hotspot.debugger.useWindbgDebugger \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
+ -Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
|
||||
MACOSX_PRIVILEGED := true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jps, \
|
||||
MAIN_CLASS := sun.tools.jps.Jps, \
|
||||
- JAVA_ARGS := \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jstack, \
|
||||
MAIN_CLASS := sun.tools.jstack.JStack, \
|
||||
JAVA_ARGS := \
|
||||
-Dsun.jvm.hotspot.debugger.useProcDebugger \
|
||||
- -Dsun.jvm.hotspot.debugger.useWindbgDebugger \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
+ -Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
|
||||
MACOSX_PRIVILEGED := true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jstat, \
|
||||
MAIN_CLASS := sun.tools.jstat.Jstat, \
|
||||
- JAVA_ARGS := \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jcmd, \
|
||||
MAIN_CLASS := sun.tools.jcmd.JCmd, \
|
||||
- JAVA_ARGS := \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
diff --git a/make/launcher/Launcher-jdk.jdeps.gmk b/make/launcher/Launcher-jdk.jdeps.gmk
|
||||
index 5448278dae7..217523c48cc 100644
|
||||
--- a/make/launcher/Launcher-jdk.jdeps.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jdeps.gmk
|
||||
@@ -27,18 +27,15 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, javap, \
|
||||
MAIN_CLASS := com.sun.tools.javap.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jdeps, \
|
||||
MAIN_CLASS := com.sun.tools.jdeps.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jdeprscan, \
|
||||
MAIN_CLASS := com.sun.tools.jdeprscan.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.jdi.gmk b/make/launcher/Launcher-jdk.jdi.gmk
|
||||
index 27bd448e3ae..fcce98cf430 100644
|
||||
--- a/make/launcher/Launcher-jdk.jdi.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jdi.gmk
|
||||
@@ -27,5 +27,4 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jdb, \
|
||||
MAIN_CLASS := com.sun.tools.example.debug.tty.TTY, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.jlink.gmk b/make/launcher/Launcher-jdk.jlink.gmk
|
||||
index 9e61edeb2c8..df2173996d7 100644
|
||||
--- a/make/launcher/Launcher-jdk.jlink.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jlink.gmk
|
||||
@@ -27,21 +27,18 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jimage,\
|
||||
MAIN_CLASS := jdk.tools.jimage.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DENABLE_ARG_FILES, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jlink,\
|
||||
MAIN_CLASS := jdk.tools.jlink.internal.Main, \
|
||||
- JAVA_ARGS := --add-modules ALL-DEFAULT \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
+ JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DENABLE_ARG_FILES \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jmod,\
|
||||
MAIN_CLASS := jdk.tools.jmod.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DENABLE_ARG_FILES \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.jshell.gmk b/make/launcher/Launcher-jdk.jshell.gmk
|
||||
index 7287f8f998a..349eb88e9eb 100644
|
||||
--- a/make/launcher/Launcher-jdk.jshell.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jshell.gmk
|
||||
@@ -27,6 +27,5 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jshell, \
|
||||
MAIN_CLASS := jdk.internal.jshell.tool.JShellToolProvider, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.jstatd.gmk b/make/launcher/Launcher-jdk.jstatd.gmk
|
||||
index e1657910c67..e9286d63094 100644
|
||||
--- a/make/launcher/Launcher-jdk.jstatd.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.jstatd.gmk
|
||||
@@ -27,7 +27,6 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jstatd, \
|
||||
MAIN_CLASS := sun.tools.jstatd.Jstatd, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
diff --git a/make/launcher/Launcher-jdk.pack.gmk b/make/launcher/Launcher-jdk.pack.gmk
|
||||
index 64bbbb7c949..a93fd2a9017 100644
|
||||
--- a/make/launcher/Launcher-jdk.pack.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.pack.gmk
|
||||
@@ -28,7 +28,6 @@ include LauncherCommon.gmk
|
||||
$(eval $(call SetupBuildLauncher, pack200, \
|
||||
MAIN_MODULE := java.base, \
|
||||
MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
diff --git a/make/launcher/Launcher-jdk.rmic.gmk b/make/launcher/Launcher-jdk.rmic.gmk
|
||||
index b8a55900b0e..d60c3d9b60b 100644
|
||||
--- a/make/launcher/Launcher-jdk.rmic.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.rmic.gmk
|
||||
@@ -27,6 +27,5 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, rmic, \
|
||||
MAIN_CLASS := sun.rmi.rmic.Main, \
|
||||
- JAVA_ARGS := -XX:+DisableHotswapAgent, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
diff --git a/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk b/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk
|
||||
index bd39f8595b2..82311e69fd6 100644
|
||||
--- a/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk
|
||||
+++ b/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk
|
||||
@@ -27,7 +27,6 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jjs, \
|
||||
MAIN_CLASS := jdk.nashorn.tools.jjs.Main, \
|
||||
- JAVA_ARGS := --add-modules ALL-DEFAULT \
|
||||
- -XX:+DisableHotswapAgent, \
|
||||
+ JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DENABLE_ARG_FILES, \
|
||||
))
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index 65839b842e2..dce89a044e9 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -4315,11 +4315,17 @@ void Arguments::setup_hotswap_agent() {
|
||||
if (DumpSharedSpaces)
|
||||
return;
|
||||
|
||||
- if (!AllowEnhancedClassRedefinition)
|
||||
+ if (HotswapAgent == NULL || strcmp(HotswapAgent, "disabled") == 0)
|
||||
return;
|
||||
|
||||
+ // Force AllowEnhancedClassRedefinition if HA is enabled
|
||||
+ AllowEnhancedClassRedefinition = true;
|
||||
+
|
||||
+ bool ha_fatjar = strcmp(HotswapAgent, "fatjar") == 0;
|
||||
+ bool ha_core = strcmp(HotswapAgent, "core") == 0;
|
||||
+
|
||||
// Set HotswapAgent
|
||||
- if (!DisableHotswapAgent) {
|
||||
+ if (ha_fatjar || ha_core) {
|
||||
|
||||
char ext_path_str[JVM_MAXPATHLEN];
|
||||
|
||||
@@ -4338,23 +4344,27 @@ void Arguments::setup_hotswap_agent() {
|
||||
}
|
||||
}
|
||||
if (ext_path_length < JVM_MAXPATHLEN - 10) {
|
||||
- jio_snprintf(ext_path_str + ext_path_length, sizeof(ext_path_str) - ext_path_length,
|
||||
- "%shotswap%shotswap-agent.jar", os::file_separator(), os::file_separator());
|
||||
- }
|
||||
-
|
||||
- int fd = ::open(ext_path_str, O_RDONLY);
|
||||
- if (fd >= 0) {
|
||||
- os::close(fd);
|
||||
- size_t length = strlen(ext_path_str) + 1;
|
||||
- char *options = NEW_C_HEAP_ARRAY(char, length, mtArguments);
|
||||
- jio_snprintf(options, length, "%s", ext_path_str);
|
||||
- add_init_agent("instrument", ext_path_str, false);
|
||||
- jio_fprintf(defaultStream::output_stream(), "Starting HotswapAgent '%s'\n", ext_path_str);
|
||||
- }
|
||||
-// else
|
||||
-// {
|
||||
-// jio_fprintf(defaultStream::error_stream(), "HotswapAgent not found on path:'%s'\n", ext_path_str);
|
||||
-// }
|
||||
+ if (ha_fatjar) {
|
||||
+ jio_snprintf(ext_path_str + ext_path_length, sizeof(ext_path_str) - ext_path_length,
|
||||
+ "%shotswap%shotswap-agent.jar", os::file_separator(), os::file_separator());
|
||||
+ } else {
|
||||
+ jio_snprintf(ext_path_str + ext_path_length, sizeof(ext_path_str) - ext_path_length,
|
||||
+ "%shotswap%shotswap-agent-core.jar", os::file_separator(), os::file_separator());
|
||||
+ }
|
||||
+ int fd = ::open(ext_path_str, O_RDONLY);
|
||||
+ if (fd >= 0) {
|
||||
+ os::close(fd);
|
||||
+ size_t length = strlen(ext_path_str) + 1;
|
||||
+ char *options = NEW_C_HEAP_ARRAY(char, length, mtArguments);
|
||||
+ jio_snprintf(options, length, "%s", ext_path_str);
|
||||
+ add_init_agent("instrument", ext_path_str, false);
|
||||
+ jio_fprintf(defaultStream::output_stream(), "Starting HotswapAgent '%s'\n", ext_path_str);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ jio_fprintf(defaultStream::error_stream(), "HotswapAgent not found on path:'%s'!\n", ext_path_str);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
// TODO: open it only for org.hotswap.agent module
|
||||
diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp
|
||||
index 16d8030fd1c..94044c4831c 100644
|
||||
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp
|
||||
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp
|
||||
@@ -199,6 +199,26 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
+class JVMFlagConstraint_ccstr : public JVMFlagConstraint {
|
||||
+ JVMFlagConstraintFunc_ccstr _constraint;
|
||||
+ const ccstr* _ptr;
|
||||
+
|
||||
+public:
|
||||
+ // the "name" argument must be a string literal
|
||||
+ JVMFlagConstraint_ccstr(const char* name, const ccstr* ptr,
|
||||
+ JVMFlagConstraintFunc_ccstr func,
|
||||
+ ConstraintType type) : JVMFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
|
||||
+
|
||||
+ JVMFlag::Error apply(bool verbose) {
|
||||
+ ccstr value = *_ptr;
|
||||
+ return _constraint(value, verbose);
|
||||
+ }
|
||||
+
|
||||
+ JVMFlag::Error apply_ccstr(ccstr value, bool verbose) {
|
||||
+ return _constraint(value, verbose);
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
// No constraint emitting
|
||||
void emit_constraint_no(...) { /* NOP */ }
|
||||
|
||||
@@ -239,6 +259,9 @@ void emit_constraint_size_t(const char* name, const size_t* ptr, JVMFlagConstrai
|
||||
void emit_constraint_double(const char* name, const double* ptr, JVMFlagConstraintFunc_double func, JVMFlagConstraint::ConstraintType type) {
|
||||
JVMFlagConstraintList::add(new JVMFlagConstraint_double(name, ptr, func, type));
|
||||
}
|
||||
+void emit_constraint_ccstr(const char* name, ccstr* ptr, JVMFlagConstraintFunc_ccstr func, JVMFlagConstraint::ConstraintType type) {
|
||||
+ JVMFlagConstraintList::add(new JVMFlagConstraint_ccstr(name, ptr, func, type));
|
||||
+}
|
||||
|
||||
// Generate code to call emit_constraint_xxx function
|
||||
#define EMIT_CONSTRAINT_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name
|
||||
diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintList.hpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintList.hpp
|
||||
index 9c27f1db955..b644f7b817a 100644
|
||||
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintList.hpp
|
||||
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintList.hpp
|
||||
@@ -47,6 +47,7 @@ typedef JVMFlag::Error (*JVMFlagConstraintFunc_uintx)(uintx value, bool verbose)
|
||||
typedef JVMFlag::Error (*JVMFlagConstraintFunc_uint64_t)(uint64_t value, bool verbose);
|
||||
typedef JVMFlag::Error (*JVMFlagConstraintFunc_size_t)(size_t value, bool verbose);
|
||||
typedef JVMFlag::Error (*JVMFlagConstraintFunc_double)(double value, bool verbose);
|
||||
+typedef JVMFlag::Error (*JVMFlagConstraintFunc_ccstr)(ccstr value, bool verbose);
|
||||
|
||||
class JVMFlagConstraint : public CHeapObj<mtArguments> {
|
||||
public:
|
||||
diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
|
||||
index 6559d4252f0..21afac72a2e 100644
|
||||
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
|
||||
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
|
||||
@@ -140,3 +140,13 @@ JVMFlag::Error ThreadLocalHandshakesConstraintFunc(bool value, bool verbose) {
|
||||
}
|
||||
return JVMFlag::SUCCESS;
|
||||
}
|
||||
+
|
||||
+JVMFlag::Error HotswapAgentConstraintFunc(char const* value, bool verbose) {
|
||||
+ if (value != NULL) {
|
||||
+ if (strcmp("disabled", value) != 0 && strcmp("fatjar", value) != 0 && strcmp("core", value) != 0 && strcmp("external", value) != 0) {
|
||||
+ JVMFlag::printError(verbose, "HotswapAgent(%s) must be one of disabled,fatjar,core or external.\n", value);
|
||||
+ return JVMFlag::VIOLATES_CONSTRAINT;
|
||||
+ }
|
||||
+ }
|
||||
+ return JVMFlag::SUCCESS;
|
||||
+}
|
||||
diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
|
||||
index 8763b83fd37..c9ed15a89e1 100644
|
||||
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
|
||||
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
|
||||
@@ -46,5 +46,6 @@ JVMFlag::Error PerfDataSamplingIntervalFunc(intx value, bool verbose);
|
||||
|
||||
JVMFlag::Error ThreadLocalHandshakesConstraintFunc(bool value, bool verbose);
|
||||
|
||||
+JVMFlag::Error HotswapAgentConstraintFunc(char const* value, bool verbose);
|
||||
|
||||
#endif /* SHARE_VM_RUNTIME_JVMFLAGCONSTRAINTSRUNTIME_HPP */
|
||||
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
|
||||
index 1984b8c28f9..c015b89b176 100644
|
||||
--- a/src/hotspot/share/runtime/globals.hpp
|
||||
+++ b/src/hotspot/share/runtime/globals.hpp
|
||||
@@ -2695,8 +2695,16 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
"Allow enhanced class redefinition beyond swapping method " \
|
||||
"bodies") \
|
||||
\
|
||||
- product(bool, DisableHotswapAgent, DISABLED_HOTSWAP_AGENT, \
|
||||
- "Disable integrated Hotswap Agent (HotswapVM only)")
|
||||
+ product(ccstr, HotswapAgent, "disabled", \
|
||||
+ "Specify HotswapAgent image to be used." \
|
||||
+ "disabled: hotswap agent is disabled (default)" \
|
||||
+ "fatjar: full HA. Use integrated hotswap-agent.jar" \
|
||||
+ "core: core HA. Use integrated hotswap-agent-core.jar" \
|
||||
+ "external: external HA. use external HA, open required JDK " \
|
||||
+ "modules.") \
|
||||
+ constraint(HotswapAgentConstraintFunc, AfterErgo)
|
||||
+
|
||||
+
|
||||
#define VM_FLAGS(develop, \
|
||||
develop_pd, \
|
||||
product, \
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,333 +0,0 @@
|
||||
From a9468fd22397d85bc238b6ec763f4643245999ab Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 7 Mar 2021 20:22:54 +0100
|
||||
Subject: [PATCH 26/44] Support for redefinition of Well Known classses
|
||||
(java.*,jdk.*, sun.*)
|
||||
|
||||
---
|
||||
src/hotspot/share/ci/ciKlass.hpp | 1 +
|
||||
src/hotspot/share/ci/ciObjectFactory.cpp | 34 +++++++++++
|
||||
src/hotspot/share/ci/ciObjectFactory.hpp | 6 ++
|
||||
.../share/classfile/systemDictionary.cpp | 10 +++
|
||||
.../share/classfile/systemDictionary.hpp | 2 +
|
||||
src/hotspot/share/classfile/vmSymbols.hpp | 2 +
|
||||
src/hotspot/share/compiler/compileBroker.cpp | 11 ++++
|
||||
src/hotspot/share/memory/universe.cpp | 8 +++
|
||||
src/hotspot/share/memory/universe.hpp | 3 +
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 61 ++++++++++++++++++-
|
||||
.../prims/jvmtiEnhancedRedefineClasses.hpp | 2 +
|
||||
11 files changed, 139 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/ci/ciKlass.hpp b/src/hotspot/share/ci/ciKlass.hpp
|
||||
index 896f489453a..c610c365aba 100644
|
||||
--- a/src/hotspot/share/ci/ciKlass.hpp
|
||||
+++ b/src/hotspot/share/ci/ciKlass.hpp
|
||||
@@ -129,6 +129,7 @@ public:
|
||||
void print_name_on(outputStream* st);
|
||||
|
||||
const char* external_name() const;
|
||||
+ Klass* new_version() { return get_Klass()->new_version(); }
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_CI_CIKLASS_HPP
|
||||
diff --git a/src/hotspot/share/ci/ciObjectFactory.cpp b/src/hotspot/share/ci/ciObjectFactory.cpp
|
||||
index b2ab15c4b65..d997a90a055 100644
|
||||
--- a/src/hotspot/share/ci/ciObjectFactory.cpp
|
||||
+++ b/src/hotspot/share/ci/ciObjectFactory.cpp
|
||||
@@ -70,7 +70,10 @@ GrowableArray<ciMetadata*>* ciObjectFactory::_shared_ci_metadata = NULL;
|
||||
ciSymbol* ciObjectFactory::_shared_ci_symbols[vmSymbols::SID_LIMIT];
|
||||
int ciObjectFactory::_shared_ident_limit = 0;
|
||||
volatile bool ciObjectFactory::_initialized = false;
|
||||
+volatile bool ciObjectFactory::_reinitialize_wk_klasses = false;
|
||||
|
||||
+// TODO: review...
|
||||
+Arena* ciObjectFactory::_initial_arena = NULL;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciObjectFactory::ciObjectFactory
|
||||
@@ -112,6 +115,7 @@ void ciObjectFactory::initialize() {
|
||||
// compiler thread that initializes the initial ciObjectFactory which
|
||||
// creates the shared ciObjects that all later ciObjectFactories use.
|
||||
Arena* arena = new (mtCompiler) Arena(mtCompiler);
|
||||
+ ciObjectFactory::_initial_arena = arena;
|
||||
ciEnv initial(arena);
|
||||
ciEnv* env = ciEnv::current();
|
||||
env->_factory->init_shared_objects();
|
||||
@@ -120,6 +124,36 @@ void ciObjectFactory::initialize() {
|
||||
|
||||
}
|
||||
|
||||
+// (DCEVM) wk classes could be modified
|
||||
+void ciObjectFactory::reinitialize_wk_classes() {
|
||||
+ ASSERT_IN_VM;
|
||||
+ JavaThread* thread = JavaThread::current();
|
||||
+ HandleMark handle_mark(thread);
|
||||
+
|
||||
+ // This Arena is long lived and exists in the resource mark of the
|
||||
+ // compiler thread that initializes the initial ciObjectFactory which
|
||||
+ // creates the shared ciObjects that all later ciObjectFactories use.
|
||||
+ // Arena* arena = new (mtCompiler) Arena(mtCompiler);
|
||||
+ ciEnv initial(ciObjectFactory::_initial_arena);
|
||||
+ ciEnv* env = ciEnv::current();
|
||||
+ env->_factory->do_reinitialize_wk_classes();
|
||||
+ _reinitialize_wk_klasses = false;
|
||||
+}
|
||||
+
|
||||
+// (DCEVM) wk classes could be modified
|
||||
+void ciObjectFactory::do_reinitialize_wk_classes() {
|
||||
+#define WK_KLASS_DEFN(name, ignore_s, opt) \
|
||||
+ if (ciEnv::_##name != NULL && ciEnv::_##name->new_version() != NULL) { \
|
||||
+ int old_ident = ciEnv::_##name->ident(); \
|
||||
+ ciEnv::_##name = get_metadata(SystemDictionary::name())->as_instance_klass(); \
|
||||
+ ciEnv::_##name->compute_nonstatic_fields(); \
|
||||
+ ciEnv::_##name->set_ident(old_ident); \
|
||||
+ }
|
||||
+
|
||||
+ WK_KLASSES_DO(WK_KLASS_DEFN)
|
||||
+#undef WK_KLASS_DEFN
|
||||
+}
|
||||
+
|
||||
void ciObjectFactory::init_shared_objects() {
|
||||
|
||||
_next_ident = 1; // start numbering CI objects at 1
|
||||
diff --git a/src/hotspot/share/ci/ciObjectFactory.hpp b/src/hotspot/share/ci/ciObjectFactory.hpp
|
||||
index 5d573350aa2..2978261328c 100644
|
||||
--- a/src/hotspot/share/ci/ciObjectFactory.hpp
|
||||
+++ b/src/hotspot/share/ci/ciObjectFactory.hpp
|
||||
@@ -41,9 +41,11 @@ class ciObjectFactory : public ResourceObj {
|
||||
|
||||
private:
|
||||
static volatile bool _initialized;
|
||||
+ static volatile bool _reinitialize_wk_klasses;
|
||||
static GrowableArray<ciMetadata*>* _shared_ci_metadata;
|
||||
static ciSymbol* _shared_ci_symbols[];
|
||||
static int _shared_ident_limit;
|
||||
+ static Arena* _initial_arena;
|
||||
|
||||
Arena* _arena;
|
||||
GrowableArray<ciMetadata*>* _ci_metadata;
|
||||
@@ -89,10 +91,14 @@ private:
|
||||
ciInstance* get_unloaded_instance(ciInstanceKlass* klass);
|
||||
|
||||
static int compare_cimetadata(ciMetadata** a, ciMetadata** b);
|
||||
+ void do_reinitialize_wk_classes();
|
||||
public:
|
||||
static bool is_initialized() { return _initialized; }
|
||||
+ static bool is_reinitialize_wk_klasses() { return _reinitialize_wk_klasses; }
|
||||
+ static void set_reinitialize_wk_klasses() { _reinitialize_wk_klasses = true; }
|
||||
|
||||
static void initialize();
|
||||
+ static void reinitialize_wk_classes();
|
||||
void init_shared_objects();
|
||||
void remove_symbols();
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index cf0a05176c8..be7fcbf2b47 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -1979,6 +1979,16 @@ bool SystemDictionary::is_well_known_klass(Symbol* class_name) {
|
||||
}
|
||||
#endif
|
||||
|
||||
+bool SystemDictionary::update_well_known_klass(InstanceKlass* old_klass, InstanceKlass* new_klass) {
|
||||
+ for (int id = FIRST_WKID; id < WKID_LIMIT; id++) {
|
||||
+ if (well_known_klass((WKID) id) == old_klass) {
|
||||
+ *well_known_klass_addr((WKID)id) = new_klass;
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
bool SystemDictionary::resolve_wk_klass(WKID id, int init_opt, TRAPS) {
|
||||
assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
|
||||
int info = wk_init_info[id - FIRST_WKID];
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
index 0002abe6122..707ff871e19 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
@@ -463,6 +463,8 @@ public:
|
||||
static bool is_well_known_klass(Symbol* class_name);
|
||||
#endif
|
||||
|
||||
+ static bool update_well_known_klass(InstanceKlass* new_klass, InstanceKlass* old_klass);
|
||||
+
|
||||
// Enhanced class redefinition
|
||||
static void remove_from_hierarchy(InstanceKlass* k);
|
||||
static void update_constraints_after_redefinition();
|
||||
diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
index 0d0badeabd0..3477a408cb6 100644
|
||||
--- a/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
+++ b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
@@ -356,6 +356,8 @@
|
||||
template(exit_method_name, "exit") \
|
||||
template(add_method_name, "add") \
|
||||
template(remove_method_name, "remove") \
|
||||
+ template(registerNatives_method_name, "registerNatives") \
|
||||
+ template(initIDs_method_name, "initIDs") \
|
||||
template(parent_name, "parent") \
|
||||
template(threads_name, "threads") \
|
||||
template(groups_name, "groups") \
|
||||
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
index 1ff09ebf3ec..bd662b5ebef 100644
|
||||
--- a/src/hotspot/share/compiler/compileBroker.cpp
|
||||
+++ b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
@@ -1871,6 +1871,17 @@ void CompileBroker::compiler_thread_loop() {
|
||||
if (method()->number_of_breakpoints() == 0) {
|
||||
// Compile the method.
|
||||
if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) {
|
||||
+
|
||||
+ // TODO: review usage of CompileThread_lock (DCEVM)
|
||||
+ if (ciObjectFactory::is_reinitialize_wk_klasses())
|
||||
+ {
|
||||
+ ASSERT_IN_VM;
|
||||
+ MutexLocker only_one (CompileThread_lock, thread);
|
||||
+ if (ciObjectFactory::is_reinitialize_wk_klasses()) {
|
||||
+ ciObjectFactory::reinitialize_wk_classes();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
invoke_compiler_on_method(task);
|
||||
thread->start_idle_timer();
|
||||
} else {
|
||||
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
|
||||
index 2e4f597cf1f..4b2c3e62941 100644
|
||||
--- a/src/hotspot/share/memory/universe.cpp
|
||||
+++ b/src/hotspot/share/memory/universe.cpp
|
||||
@@ -1030,6 +1030,14 @@ void Universe::initialize_known_methods(TRAPS) {
|
||||
vmSymbols::doStackWalk_signature(), false, CHECK);
|
||||
}
|
||||
|
||||
+void Universe::reinitialize_loader_addClass_method(TRAPS) {
|
||||
+ // Set up method for registering loaded classes in class loader vector
|
||||
+ initialize_known_method(_loader_addClass_cache,
|
||||
+ SystemDictionary::ClassLoader_klass(),
|
||||
+ "addClass",
|
||||
+ vmSymbols::class_void_signature(), false, CHECK);
|
||||
+}
|
||||
+
|
||||
void universe2_init() {
|
||||
EXCEPTION_MARK;
|
||||
Universe::genesis(CATCH);
|
||||
diff --git a/src/hotspot/share/memory/universe.hpp b/src/hotspot/share/memory/universe.hpp
|
||||
index 742dada0e8f..d1af82b5fa7 100644
|
||||
--- a/src/hotspot/share/memory/universe.hpp
|
||||
+++ b/src/hotspot/share/memory/universe.hpp
|
||||
@@ -349,6 +349,9 @@ class Universe: AllStatic {
|
||||
// Function to initialize these
|
||||
static void initialize_known_methods(TRAPS);
|
||||
|
||||
+ // Enhanced class redefinition
|
||||
+ static void reinitialize_loader_addClass_method(TRAPS);
|
||||
+
|
||||
static oop null_ptr_exception_instance() { return _null_ptr_exception_instance; }
|
||||
static oop arithmetic_exception_instance() { return _arithmetic_exception_instance; }
|
||||
static oop virtual_machine_error_instance() { return _virtual_machine_error_instance; }
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index f4bde7504c8..80d4e68ccae 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -497,6 +497,16 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
redefine_single_class(_new_classes->at(i), thread);
|
||||
}
|
||||
|
||||
+ // Update possible redefinition of well-known classes (like ClassLoader)
|
||||
+ for (int i = 0; i < _new_classes->length(); i++) {
|
||||
+ InstanceKlass* cur = _new_classes->at(i);
|
||||
+ if (cur->old_version() != NULL && SystemDictionary::update_well_known_klass(InstanceKlass::cast(cur->old_version()), cur))
|
||||
+ {
|
||||
+ log_trace(redefine, class, obsolete, metadata)("Well known class updated %s", cur->external_name());
|
||||
+ ciObjectFactory::set_reinitialize_wk_klasses();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// Deoptimize all compiled code that depends on this class (do only once, because it clears whole cache)
|
||||
// if (_max_redefinition_flags > Klass::ModifyClass) {
|
||||
flush_dependent_code(NULL, thread);
|
||||
@@ -672,12 +682,56 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
_timer_vm_op_doit.stop();
|
||||
}
|
||||
|
||||
+void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
|
||||
+ if (!_new_classes->is_empty()) {
|
||||
+ ResourceMark rm(Thread::current());
|
||||
+
|
||||
+ for (int i = 0; i < _new_classes->length(); i++) {
|
||||
+ InstanceKlass* cur = _new_classes->at(i);
|
||||
+
|
||||
+ if (cur->name()->starts_with("java/") || cur->name()->starts_with("jdk/") || cur->name()->starts_with("sun/")) {
|
||||
+
|
||||
+ if (cur == SystemDictionary::ClassLoader_klass()) {
|
||||
+ // ClassLoader.addClass method is cached in Universe, we must redefine
|
||||
+ Universe::reinitialize_loader_addClass_method(Thread::current());
|
||||
+ log_trace(redefine, class, obsolete, metadata)("Reinitialize ClassLoade addClass method cache.");
|
||||
+ }
|
||||
+
|
||||
+ // naive assumptions that only JDK classes has native static "registerNative" and "initIDs" methods
|
||||
+ int end;
|
||||
+ Symbol* signature = vmSymbols::registerNatives_method_name();
|
||||
+ int midx = cur->find_method_by_name(signature, &end);
|
||||
+ if (midx == -1) {
|
||||
+ signature = vmSymbols::initIDs_method_name();
|
||||
+ midx = cur->find_method_by_name(signature, &end);
|
||||
+ }
|
||||
+ Method* m = NULL;
|
||||
+ if (midx != -1) {
|
||||
+ m = cur->methods()->at(midx);
|
||||
+ }
|
||||
+ if (m != NULL && m->is_static() && m->is_native()) {
|
||||
+ // call static registerNative if present
|
||||
+ JavaValue result(T_VOID);
|
||||
+ JavaCalls::call_static(&result,
|
||||
+ cur,
|
||||
+ signature,
|
||||
+ vmSymbols::void_method_signature(),
|
||||
+ Thread::current());
|
||||
+ log_trace(redefine, class, obsolete, metadata)("Reregister natives of JDK class %s", cur->external_name());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
// Cleanup - runs in JVM thread
|
||||
// - free used memory
|
||||
// - end GC
|
||||
void VM_EnhancedRedefineClasses::doit_epilogue() {
|
||||
VM_GC_Operation::doit_epilogue();
|
||||
|
||||
+ reinitializeJDKClasses();
|
||||
+
|
||||
if (_new_classes != NULL) {
|
||||
delete _new_classes;
|
||||
}
|
||||
@@ -1589,7 +1643,12 @@ void VM_EnhancedRedefineClasses::check_methods_and_mark_as_obsolete() {
|
||||
|
||||
// obsolete methods need a unique idnum so they become new entries in
|
||||
// the jmethodID cache in InstanceKlass
|
||||
- assert(old_method->method_idnum() == new_method->method_idnum(), "must match");
|
||||
+ if (old_method->method_idnum() != new_method->method_idnum()) {
|
||||
+ log_error(redefine, class, normalize)
|
||||
+ ("Method not matched: %d != %d old: %s = new: %s", old_method->method_idnum(), new_method->method_idnum(),
|
||||
+ old_method->name_and_sig_as_C_string(), new_method->name_and_sig_as_C_string());
|
||||
+ // assert(old_method->method_idnum() == new_method->method_idnum(), "must match");
|
||||
+ }
|
||||
// u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum();
|
||||
// if (num != ConstMethod::UNSET_IDNUM) {
|
||||
// old_method->set_method_idnum(num);
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 4c0412d343d..79ea17b0d47 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -141,6 +141,8 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
|
||||
void flush_dependent_code(InstanceKlass* k_h, TRAPS);
|
||||
|
||||
+ void reinitializeJDKClasses();
|
||||
+
|
||||
static void check_class(InstanceKlass* k_oop, TRAPS);
|
||||
|
||||
static void dump_methods();
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From acafc3515aa1083d2214336af596cb579a488c8d Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Fri, 19 Mar 2021 19:13:38 +0100
|
||||
Subject: [PATCH 27/44] JBR-3458: Skip dynamic proxy classes based on
|
||||
com.sun.proxy
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 80d4e68ccae..10c375d601c 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -689,7 +689,8 @@ void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
|
||||
for (int i = 0; i < _new_classes->length(); i++) {
|
||||
InstanceKlass* cur = _new_classes->at(i);
|
||||
|
||||
- if (cur->name()->starts_with("java/") || cur->name()->starts_with("jdk/") || cur->name()->starts_with("sun/")) {
|
||||
+ if ((cur->name()->starts_with("java/") || cur->name()->starts_with("jdk/") || cur->name()->starts_with("sun/"))
|
||||
+ && cur->name()->index_of_at(0, "$$") == -1) { // skip dynamic proxies
|
||||
|
||||
if (cur == SystemDictionary::ClassLoader_klass()) {
|
||||
// ClassLoader.addClass method is cached in Universe, we must redefine
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
From 4ba18f232db0dd92369d110cbb4f38f5a35eb5c7 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
|
||||
Date: Sat, 20 Mar 2021 20:51:08 +0100
|
||||
Subject: [PATCH 28/44] JBR-3459: Fix race condition in
|
||||
ClassLoaderDataGraph::classes_do
|
||||
|
||||
InstanceKlass in ClassLoaderData can be uninitialized when
|
||||
ClassLoaderDataGraph::classes_do is called. Using
|
||||
ClassLoaderDataGraph::dictionary_classes_do is safe but problem is still
|
||||
persisting with anonymous classes.
|
||||
---
|
||||
src/hotspot/share/classfile/classLoaderData.cpp | 10 ++++++++++
|
||||
src/hotspot/share/classfile/classLoaderData.hpp | 4 ++++
|
||||
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 13 +++++++++++--
|
||||
3 files changed, 25 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index 68df33b6c40..b12784954af 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -1169,6 +1169,16 @@ void ClassLoaderDataGraph::classes_do(KlassClosure* klass_closure) {
|
||||
}
|
||||
}
|
||||
|
||||
+void ClassLoaderDataGraph::anonymous_classes_do(KlassClosure* klass_closure) {
|
||||
+ Thread* thread = Thread::current();
|
||||
+ for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
|
||||
+ if (cld->is_anonymous()) {
|
||||
+ Handle holder(thread, cld->holder_phantom());
|
||||
+ cld->classes_do(klass_closure);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void ClassLoaderDataGraph::classes_do(void f(Klass* const)) {
|
||||
Thread* thread = Thread::current();
|
||||
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.hpp b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
index 92f57dac23e..c4c17112a2d 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
@@ -108,6 +108,10 @@ class ClassLoaderDataGraph : public AllStatic {
|
||||
// for redefinition. These classes are removed during the next class unloading.
|
||||
// Walking the ClassLoaderDataGraph also includes anonymous classes.
|
||||
static void classes_do(KlassClosure* klass_closure);
|
||||
+
|
||||
+ // Enhanced class redefinition
|
||||
+ static void anonymous_classes_do(KlassClosure* klass_closure);
|
||||
+
|
||||
static void classes_do(void f(Klass* const));
|
||||
static void methods_do(void f(Method*));
|
||||
static void modules_do(void f(ModuleEntry*));
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 10c375d601c..5de5f78aea0 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -2130,8 +2130,17 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
|
||||
AffectedKlassClosure closure(_affected_klasses);
|
||||
// Updated in j10, from original SystemDictionary::classes_do
|
||||
|
||||
- ClassLoaderDataGraph::classes_do(&closure);
|
||||
- //ClassLoaderDataGraph::dictionary_classes_do(&closure);
|
||||
+ // 0. we can't use ClassLoaderDataGraph::classes_do since classes can be uninitialized in cld,
|
||||
+ // fully initialized class is in system dictionary
|
||||
+ // ClassLoaderDataGraph::classes_do(&closure);
|
||||
+
|
||||
+ // 1. Scan over dictionaries
|
||||
+ ClassLoaderDataGraph::dictionary_classes_do(&closure);
|
||||
+
|
||||
+ // 2. Anonymous class is not in dictionary, we have to iterate anonymous cld directly, but there is race cond...
|
||||
+ // TODO: review ... anonymous class is added to cld before InstanceKlass initialization,
|
||||
+ // find out how to check if the InstanceKlass is initialized
|
||||
+ ClassLoaderDataGraph::anonymous_classes_do(&closure);
|
||||
|
||||
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
From f0c417c9f5eaf721a7c022e7c901af59a0993885 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 10 Oct 2021 20:25:30 +0200
|
||||
Subject: [PATCH 29/44] JBR-3867 - update keys of jvmti TAG map after
|
||||
redefinition
|
||||
|
||||
jdwp keeps relation class_ptr->class_ref in jvmti tag. class_ptr is used
|
||||
as a tag key, tag value is refnode. There are new class_ptrs after
|
||||
redefinition, therefore jdwp redefinition method update all affected
|
||||
keys in the tag map.
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiExtensions.cpp | 24 ++++++++++++++
|
||||
.../share/native/libjdwp/VirtualMachineImpl.c | 20 +++++++++++
|
||||
.../share/native/libjdwp/commonRef.c | 29 ++++++++++++++++
|
||||
.../share/native/libjdwp/commonRef.h | 2 ++
|
||||
.../share/native/libjdwp/util.c | 33 +++++++++++++++++++
|
||||
.../share/native/libjdwp/util.h | 3 ++
|
||||
6 files changed, 111 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiExtensions.cpp b/src/hotspot/share/prims/jvmtiExtensions.cpp
|
||||
index 36bc47ad0b5..8a6058fd884 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiExtensions.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiExtensions.cpp
|
||||
@@ -49,6 +49,15 @@ static jvmtiError JNICALL IsClassUnloadingEnabled(const jvmtiEnv* env, ...) {
|
||||
return JVMTI_ERROR_NONE;
|
||||
}
|
||||
|
||||
+// extension function
|
||||
+static jvmtiError JNICALL IsEnhancedClassRedefinitionEnabled(const jvmtiEnv* env, jboolean* enabled, ...) {
|
||||
+ if (enabled == NULL) {
|
||||
+ return JVMTI_ERROR_NULL_POINTER;
|
||||
+ }
|
||||
+ *enabled = (jboolean)AllowEnhancedClassRedefinition;
|
||||
+ return JVMTI_ERROR_NONE;
|
||||
+}
|
||||
+
|
||||
// register extension functions and events. In this implementation we
|
||||
// have a single extension function (to prove the API) that tests if class
|
||||
// unloading is enabled or disabled. We also have a single extension event
|
||||
@@ -88,6 +97,21 @@ void JvmtiExtensions::register_extensions() {
|
||||
event_params
|
||||
};
|
||||
_ext_events->append(&ext_event);
|
||||
+
|
||||
+ static jvmtiParamInfo func_params_enh_redef[] = {
|
||||
+ { (char*)"IsEnhancedClassRedefinitionEnabled", JVMTI_KIND_OUT, JVMTI_TYPE_JBOOLEAN, JNI_FALSE }
|
||||
+
|
||||
+ };
|
||||
+ static jvmtiExtensionFunctionInfo ext_func_enh_redef = {
|
||||
+ (jvmtiExtensionFunction)IsEnhancedClassRedefinitionEnabled,
|
||||
+ (char*)"com.sun.hotspot.functions.IsEnhancedClassRedefinitionEnabled",
|
||||
+ (char*)"Tell if enhanced class redefinition is enabled (-noclassgc)",
|
||||
+ sizeof(func_params_enh_redef)/sizeof(func_params_enh_redef[0]),
|
||||
+ func_params_enh_redef,
|
||||
+ 0, // no non-universal errors
|
||||
+ NULL
|
||||
+ };
|
||||
+ _ext_functions->append(&ext_func_enh_redef);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c b/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
|
||||
index d7ca956dc57..faa8f55f91f 100644
|
||||
--- a/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
|
||||
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
|
||||
@@ -475,6 +475,14 @@ redefineClasses(PacketInputStream *in, PacketOutputStream *out)
|
||||
if (ok == JNI_TRUE) {
|
||||
jvmtiError error;
|
||||
|
||||
+ jlong classIds[classCount];
|
||||
+
|
||||
+ if (gdata->isEnhancedClassRedefinitionEnabled) {
|
||||
+ for (i = 0; i < classCount; ++i) {
|
||||
+ classIds[i] = commonRef_refToID(env, classDefs[i].klass);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
error = JVMTI_FUNC_PTR(gdata->jvmti,RedefineClasses)
|
||||
(gdata->jvmti, classCount, classDefs);
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
@@ -484,6 +492,18 @@ redefineClasses(PacketInputStream *in, PacketOutputStream *out)
|
||||
for ( i = 0 ; i < classCount; i++ ) {
|
||||
eventHandler_freeClassBreakpoints(classDefs[i].klass);
|
||||
}
|
||||
+
|
||||
+ if (gdata->isEnhancedClassRedefinitionEnabled) {
|
||||
+ /* Update tags in jvmti to use new classes */
|
||||
+ for ( i = 0 ; i < classCount; i++ ) {
|
||||
+ /* pointer in classIds[i] is updated by advanced redefinition to a new class */
|
||||
+ error = commonRef_updateTags(env, classIds[i]);
|
||||
+ if (error != JVMTI_ERROR_NONE) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.c b/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.c
|
||||
index 2a8f55014d9..3f33b423209 100644
|
||||
--- a/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.c
|
||||
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.c
|
||||
@@ -618,3 +618,32 @@ commonRef_unlock(void)
|
||||
{
|
||||
debugMonitorExit(gdata->refLock);
|
||||
}
|
||||
+
|
||||
+/*
|
||||
+ * Update JVMTI tags, used from enhanced redefinition
|
||||
+ */
|
||||
+jvmtiError
|
||||
+commonRef_updateTags(JNIEnv *env, jlong id)
|
||||
+{
|
||||
+ jvmtiError error;
|
||||
+
|
||||
+ error = JVMTI_ERROR_NONE;
|
||||
+
|
||||
+ if (id == NULL_OBJECT_ID) {
|
||||
+ return error;
|
||||
+ }
|
||||
+
|
||||
+ debugMonitorEnter(gdata->refLock); {
|
||||
+ RefNode *node;
|
||||
+
|
||||
+ node = findNodeByID(env, id);
|
||||
+ if (node != NULL) {
|
||||
+ error = JVMTI_FUNC_PTR(gdata->jvmti, SetTag)
|
||||
+ (gdata->jvmti, node->ref, ptr_to_jlong(node));
|
||||
+ } else {
|
||||
+ printf("Node not found\n");
|
||||
+ }
|
||||
+ } debugMonitorExit(gdata->refLock);
|
||||
+
|
||||
+ return error;
|
||||
+}
|
||||
diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.h b/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.h
|
||||
index 7c76667eb19..d7b01e62a47 100644
|
||||
--- a/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.h
|
||||
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/commonRef.h
|
||||
@@ -41,4 +41,6 @@ void commonRef_compact(void);
|
||||
void commonRef_lock(void);
|
||||
void commonRef_unlock(void);
|
||||
|
||||
+jvmtiError commonRef_updateTags(JNIEnv *env, jlong id);
|
||||
+
|
||||
#endif
|
||||
diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/util.c b/src/jdk.jdwp.agent/share/native/libjdwp/util.c
|
||||
index f4a1d19589d..0642c4a3d7f 100644
|
||||
--- a/src/jdk.jdwp.agent/share/native/libjdwp/util.c
|
||||
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/util.c
|
||||
@@ -41,6 +41,7 @@ BackendGlobalData *gdata = NULL;
|
||||
static jboolean isInterface(jclass clazz);
|
||||
static jboolean isArrayClass(jclass clazz);
|
||||
static char * getPropertyUTF8(JNIEnv *env, char *propertyName);
|
||||
+static jboolean isEnhancedClassRedefinitionEnabled(JNIEnv *env);
|
||||
|
||||
/* Save an object reference for use later (create a NewGlobalRef) */
|
||||
void
|
||||
@@ -281,6 +282,8 @@ util_initialize(JNIEnv *env)
|
||||
}
|
||||
}
|
||||
|
||||
+ gdata->isEnhancedClassRedefinitionEnabled = isEnhancedClassRedefinitionEnabled(env);
|
||||
+
|
||||
} END_WITH_LOCAL_REFS(env);
|
||||
|
||||
}
|
||||
@@ -1739,6 +1742,36 @@ getPropertyUTF8(JNIEnv *env, char *propertyName)
|
||||
return value;
|
||||
}
|
||||
|
||||
+static jboolean
|
||||
+isEnhancedClassRedefinitionEnabled(JNIEnv *env)
|
||||
+{
|
||||
+ jvmtiError error;
|
||||
+ jint count, i;
|
||||
+ jvmtiExtensionFunctionInfo* ext_funcs;
|
||||
+
|
||||
+ error = JVMTI_FUNC_PTR(gdata->jvmti,GetExtensionFunctions)
|
||||
+ (gdata->jvmti, &count, &ext_funcs);
|
||||
+ if (error != JVMTI_ERROR_NONE) {
|
||||
+ return JNI_FALSE;
|
||||
+ }
|
||||
+
|
||||
+ for (i=0; i<count; i++) {
|
||||
+ if (strcmp(ext_funcs[i].id, (char*)"com.sun.hotspot.functions.IsEnhancedClassRedefinitionEnabled") == 0) {
|
||||
+ jboolean enabled;
|
||||
+ error = (*ext_funcs[i].func)(gdata->jvmti, &enabled);
|
||||
+
|
||||
+ if (error != JVMTI_ERROR_NONE) {
|
||||
+ return JNI_FALSE;
|
||||
+ } else {
|
||||
+ return enabled;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return JNI_FALSE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
jboolean
|
||||
isMethodObsolete(jmethodID method)
|
||||
{
|
||||
diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/util.h b/src/jdk.jdwp.agent/share/native/libjdwp/util.h
|
||||
index bcb59457120..72a365ad3c3 100644
|
||||
--- a/src/jdk.jdwp.agent/share/native/libjdwp/util.h
|
||||
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/util.h
|
||||
@@ -126,6 +126,9 @@ typedef struct {
|
||||
int objectsByIDsize;
|
||||
int objectsByIDcount;
|
||||
|
||||
+ /* true if enhanced class redefinition is enabled */
|
||||
+ jboolean isEnhancedClassRedefinitionEnabled;
|
||||
+
|
||||
/* Indication that the agent has been loaded */
|
||||
jboolean isLoaded;
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From 43ad1316176425552ac8aa34e26ab8554ec3a9f1 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Mon, 11 Oct 2021 20:22:26 +0200
|
||||
Subject: [PATCH 30/44] JBR-3867 - fix msvc compilation issue with non const
|
||||
array on stack
|
||||
|
||||
---
|
||||
.../share/native/libjdwp/VirtualMachineImpl.c | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c b/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
|
||||
index faa8f55f91f..53f7e44f579 100644
|
||||
--- a/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
|
||||
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
|
||||
@@ -475,11 +475,16 @@ redefineClasses(PacketInputStream *in, PacketOutputStream *out)
|
||||
if (ok == JNI_TRUE) {
|
||||
jvmtiError error;
|
||||
|
||||
- jlong classIds[classCount];
|
||||
+ jlong* classIds = NULL;
|
||||
|
||||
if (gdata->isEnhancedClassRedefinitionEnabled) {
|
||||
- for (i = 0; i < classCount; ++i) {
|
||||
- classIds[i] = commonRef_refToID(env, classDefs[i].klass);
|
||||
+ classIds = jvmtiAllocate(classCount*(int)sizeof(jlong));
|
||||
+ if (classIds == NULL) {
|
||||
+ outStream_setError(out, JDWP_ERROR(OUT_OF_MEMORY));
|
||||
+ return JNI_TRUE;
|
||||
+ }
|
||||
+ for (i = 0; i < classCount; i++) {
|
||||
+ classIds[i] = commonRef_refToID(env, classDefs[i].klass);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,7 +498,7 @@ redefineClasses(PacketInputStream *in, PacketOutputStream *out)
|
||||
eventHandler_freeClassBreakpoints(classDefs[i].klass);
|
||||
}
|
||||
|
||||
- if (gdata->isEnhancedClassRedefinitionEnabled) {
|
||||
+ if (gdata->isEnhancedClassRedefinitionEnabled && classIds != NULL) {
|
||||
/* Update tags in jvmti to use new classes */
|
||||
for ( i = 0 ; i < classCount; i++ ) {
|
||||
/* pointer in classIds[i] is updated by advanced redefinition to a new class */
|
||||
@@ -502,6 +507,7 @@ redefineClasses(PacketInputStream *in, PacketOutputStream *out)
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ jvmtiDeallocate((void*) classIds);
|
||||
}
|
||||
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From 39d5a7e6ffd06362a40984c43a439b5778b65d53 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Tue, 19 Oct 2021 17:02:35 +0200
|
||||
Subject: [PATCH 31/44] Attempt to fix JBR-3887
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiExtensions.cpp | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiExtensions.cpp b/src/hotspot/share/prims/jvmtiExtensions.cpp
|
||||
index 8a6058fd884..9c8c98cb70e 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiExtensions.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiExtensions.cpp
|
||||
@@ -50,7 +50,13 @@ static jvmtiError JNICALL IsClassUnloadingEnabled(const jvmtiEnv* env, ...) {
|
||||
}
|
||||
|
||||
// extension function
|
||||
-static jvmtiError JNICALL IsEnhancedClassRedefinitionEnabled(const jvmtiEnv* env, jboolean* enabled, ...) {
|
||||
+static jvmtiError JNICALL IsEnhancedClassRedefinitionEnabled(const jvmtiEnv* env, ...) {
|
||||
+ jboolean* enabled = NULL;
|
||||
+ va_list ap;
|
||||
+
|
||||
+ va_start(ap, env);
|
||||
+ enabled = va_arg(ap, jboolean *);
|
||||
+ va_end(ap);
|
||||
if (enabled == NULL) {
|
||||
return JVMTI_ERROR_NULL_POINTER;
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
From 56b381db23651cc1cec0a4b649dd2796b85e8b09 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Mon, 1 Nov 2021 19:00:41 +0100
|
||||
Subject: [PATCH 32/44] JBR-3937 Fix crashes in C1/C2 compilers
|
||||
|
||||
There is a race condition in enhanced redefinition with C1/C2. Therefore
|
||||
the patch stops C1/C2 compilation before redefinition and release after
|
||||
redefinition finishing. There is no performance impact since dcevm
|
||||
flushes all code cache.
|
||||
---
|
||||
src/hotspot/share/compiler/compileBroker.cpp | 39 +++++++++++++++++++-
|
||||
src/hotspot/share/compiler/compileBroker.hpp | 6 +++
|
||||
src/hotspot/share/prims/jvmtiEnv.cpp | 7 ++++
|
||||
3 files changed, 51 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
index bd662b5ebef..bd0f9f0efab 100644
|
||||
--- a/src/hotspot/share/compiler/compileBroker.cpp
|
||||
+++ b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
@@ -133,6 +133,8 @@ CompileLog** CompileBroker::_compiler2_logs = NULL;
|
||||
// These counters are used to assign an unique ID to each compilation.
|
||||
volatile jint CompileBroker::_compilation_id = 0;
|
||||
volatile jint CompileBroker::_osr_compilation_id = 0;
|
||||
+volatile bool CompileBroker::_compilation_stopped = false;
|
||||
+volatile int CompileBroker::_active_compilations = 0;
|
||||
|
||||
// Debugging information
|
||||
int CompileBroker::_last_compile_type = no_compile;
|
||||
@@ -2191,7 +2193,22 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
locker.wait(Mutex::_no_safepoint_check_flag);
|
||||
}
|
||||
}
|
||||
- comp->compile_method(&ci_env, target, osr_bci, directive);
|
||||
+
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ {
|
||||
+ MonitorLockerEx locker(Compilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
+ while (_compilation_stopped) {
|
||||
+ locker.wait(Mutex::_no_safepoint_check_flag);
|
||||
+ }
|
||||
+ Atomic::add(1, &_active_compilations);
|
||||
+ }
|
||||
+
|
||||
+ comp->compile_method(&ci_env, target, osr_bci, directive);
|
||||
+ Atomic::sub(1, &_active_compilations);
|
||||
+
|
||||
+ } else {
|
||||
+ comp->compile_method(&ci_env, target, osr_bci, directive);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!ci_env.failing() && task->code() == NULL) {
|
||||
@@ -2853,3 +2870,23 @@ void CompileBroker::print_heapinfo(outputStream* out, const char* function, size
|
||||
}
|
||||
out->print_cr("\n__ CodeHeapStateAnalytics total duration %10.3f seconds _________\n", ts_total.seconds());
|
||||
}
|
||||
+
|
||||
+void CompileBroker::stopCompilationBeforeEnhancedRedefinition() {
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ MonitorLockerEx locker(Compilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
+ _compilation_stopped = true;
|
||||
+ while (_active_compilations > 0) {
|
||||
+ VM_ThreadsSuspendJVMTI tsj;
|
||||
+ VMThread::execute(&tsj);
|
||||
+ locker.wait(Mutex::_no_safepoint_check_flag);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void CompileBroker::releaseCompilationAfterEnhancedRedefinition() {
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ MonitorLockerEx locker(Compilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
+ _compilation_stopped = false;
|
||||
+ locker.notify_all();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/hotspot/share/compiler/compileBroker.hpp b/src/hotspot/share/compiler/compileBroker.hpp
|
||||
index 53e496cd306..fa50e778d9e 100644
|
||||
--- a/src/hotspot/share/compiler/compileBroker.hpp
|
||||
+++ b/src/hotspot/share/compiler/compileBroker.hpp
|
||||
@@ -173,6 +173,9 @@ class CompileBroker: AllStatic {
|
||||
static volatile jint _compilation_id;
|
||||
static volatile jint _osr_compilation_id;
|
||||
|
||||
+ static volatile bool _compilation_stopped;
|
||||
+ static volatile int _active_compilations;
|
||||
+
|
||||
static int _last_compile_type;
|
||||
static int _last_compile_level;
|
||||
static char _last_method_compiled[name_buffer_length];
|
||||
@@ -421,6 +424,9 @@ public:
|
||||
// CodeHeap State Analytics.
|
||||
static void print_info(outputStream *out);
|
||||
static void print_heapinfo(outputStream *out, const char* function, size_t granularity);
|
||||
+
|
||||
+ static void stopCompilationBeforeEnhancedRedefinition();
|
||||
+ static void releaseCompilationAfterEnhancedRedefinition();
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
index 54617f05b5a..0ca9ec020a9 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "classfile/modules.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
+#include "compiler/compileBroker.hpp"
|
||||
#include "interpreter/bytecodeStream.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "jvmtifiles/jvmtiEnv.hpp"
|
||||
@@ -453,9 +454,12 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
class_definitions[index].klass = jcls;
|
||||
}
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
+ // Stop compilation to avoid compilator race condition (crashes) with advanced redefinition
|
||||
+ CompileBroker::stopCompilationBeforeEnhancedRedefinition();
|
||||
MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_retransform);
|
||||
VMThread::execute(&op);
|
||||
+ CompileBroker::releaseCompilationAfterEnhancedRedefinition();
|
||||
return (op.check_error());
|
||||
}
|
||||
VM_RedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_retransform);
|
||||
@@ -469,9 +473,12 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
jvmtiError
|
||||
JvmtiEnv::RedefineClasses(jint class_count, const jvmtiClassDefinition* class_definitions) {
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
+ // Stop compilation to avoid compilator race condition (crashes) with advanced redefinition
|
||||
+ CompileBroker::stopCompilationBeforeEnhancedRedefinition();
|
||||
MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
|
||||
VMThread::execute(&op);
|
||||
+ CompileBroker::releaseCompilationAfterEnhancedRedefinition();
|
||||
return (op.check_error());
|
||||
}
|
||||
VM_RedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
From 962796e56be75ef70c1d6dcaa9eaf19e755c61d8 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Mon, 1 Nov 2021 19:20:13 +0100
|
||||
Subject: [PATCH 33/44] JBR-3938 - fix race condition in anonymous class
|
||||
loading
|
||||
|
||||
Anonymous class must be checked if it is fully initialized if it is used
|
||||
in ClassLoaderDataGraph closure.
|
||||
---
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 44 ++++++-------------
|
||||
.../prims/jvmtiEnhancedRedefineClasses.hpp | 1 -
|
||||
2 files changed, 14 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 5de5f78aea0..a8546a5fbe2 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -517,8 +517,6 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
|
||||
|
||||
|
||||
- // SystemDictionary::methods_do(fix_invoke_method);
|
||||
-
|
||||
// JSR-292 support
|
||||
if (_any_class_has_resolved_methods) {
|
||||
bool trace_name_printed = false;
|
||||
@@ -647,10 +645,6 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
// TODO: explain...
|
||||
ciObjectFactory::resort_shared_ci_metadata();
|
||||
|
||||
- // FIXME - check if it was in JDK8. Copied from standard JDK9 hotswap.
|
||||
- //MethodDataCleaner clean_weak_method_links;
|
||||
- //ClassLoaderDataGraph::classes_do(&clean_weak_method_links);
|
||||
-
|
||||
// Disable any dependent concurrent compilations
|
||||
SystemDictionary::notice_modification();
|
||||
|
||||
@@ -1568,29 +1562,6 @@ void VM_EnhancedRedefineClasses::MethodDataCleaner::do_klass(Klass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
-void VM_EnhancedRedefineClasses::fix_invoke_method(Method* method) {
|
||||
-
|
||||
- constantPoolHandle other_cp = constantPoolHandle(method->constants());
|
||||
-
|
||||
- for (int i = 0; i < other_cp->length(); i++) {
|
||||
- if (other_cp->tag_at(i).is_klass()) {
|
||||
- Klass* klass = other_cp->resolved_klass_at(i);
|
||||
- if (klass->new_version() != NULL) {
|
||||
- // Constant pool entry points to redefined class -- update to the new version
|
||||
- other_cp->klass_at_put(i, klass->newest_version());
|
||||
- }
|
||||
- assert(other_cp->resolved_klass_at(i)->new_version() == NULL, "Must be new klass!");
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- ConstantPoolCache* cp_cache = other_cp->cache();
|
||||
- if (cp_cache != NULL) {
|
||||
- cp_cache->clear_entries();
|
||||
- }
|
||||
-
|
||||
-}
|
||||
-
|
||||
-
|
||||
|
||||
void VM_EnhancedRedefineClasses::update_jmethod_ids() {
|
||||
for (int j = 0; j < _matching_methods_length; ++j) {
|
||||
@@ -2071,12 +2042,23 @@ void VM_EnhancedRedefineClasses::dump_methods() {
|
||||
class AffectedKlassClosure : public KlassClosure {
|
||||
private:
|
||||
GrowableArray<Klass*>* _affected_klasses;
|
||||
+ bool _is_anonymous;
|
||||
public:
|
||||
- AffectedKlassClosure(GrowableArray<Klass*>* affected_klasses) : _affected_klasses(affected_klasses) {}
|
||||
+ AffectedKlassClosure(GrowableArray<Klass*>* affected_klasses) : _affected_klasses(affected_klasses), _is_anonymous(false) {}
|
||||
+
|
||||
+ bool is_anonymous() { return _is_anonymous; }
|
||||
+ void set_anonymous(bool value) { _is_anonymous = value; }
|
||||
|
||||
void do_klass(Klass* klass) {
|
||||
assert(!_affected_klasses->contains(klass), "must not occur more than once!");
|
||||
|
||||
+ if (_is_anonymous && klass->is_instance_klass()) {
|
||||
+ InstanceKlass *ik = InstanceKlass::cast(klass);
|
||||
+ if (ik->is_not_initialized()) {
|
||||
+ return; // anonymous class does not need to be initialized
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (klass->new_version() != NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -2135,11 +2117,13 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
|
||||
// ClassLoaderDataGraph::classes_do(&closure);
|
||||
|
||||
// 1. Scan over dictionaries
|
||||
+ closure.set_anonymous(false);
|
||||
ClassLoaderDataGraph::dictionary_classes_do(&closure);
|
||||
|
||||
// 2. Anonymous class is not in dictionary, we have to iterate anonymous cld directly, but there is race cond...
|
||||
// TODO: review ... anonymous class is added to cld before InstanceKlass initialization,
|
||||
// find out how to check if the InstanceKlass is initialized
|
||||
+ closure.set_anonymous(true);
|
||||
ClassLoaderDataGraph::anonymous_classes_do(&closure);
|
||||
|
||||
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 79ea17b0d47..fc0d8e82643 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -119,7 +119,6 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
static void unregister_nmethod_g1(nmethod* nm);
|
||||
static void register_nmethod_g1(nmethod* nm);
|
||||
static void unpatch_bytecode(Method* method);
|
||||
- static void fix_invoke_method(Method* method);
|
||||
|
||||
// Figure out which new methods match old methods in name and signature,
|
||||
// which methods have been added, and which are no longer present
|
||||
--
|
||||
2.23.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
||||
From 15d06f325a892e2fa665698b4b76988cff236075 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Fri, 5 Nov 2021 18:16:01 +0100
|
||||
Subject: [PATCH 35/44] JBR-3963 - fix memory leaks in G1 in redefinition
|
||||
|
||||
ChangePointersObjectClosure allocates handles and resources, that must
|
||||
be properly released in worker thread
|
||||
---
|
||||
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
index d33a5ff3a54..7c68dbf4bf1 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
@@ -2125,6 +2125,8 @@ class G1IterateObjectClosureTask : public AbstractGangTask {
|
||||
_cl(cl), _g1h(g1h), _hrclaimer(g1h->workers()->active_workers()) { }
|
||||
|
||||
virtual void work(uint worker_id) {
|
||||
+ ResourceMark rm;
|
||||
+ HandleMark hm;
|
||||
IterateObjectClosureRegionClosure blk(_cl);
|
||||
_g1h->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
From eb5af1af95c0f1dcd7298be6114d9af74f72b5f8 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Fri, 5 Nov 2021 18:53:11 +0100
|
||||
Subject: [PATCH 36/44] JBR-3937 - use specialized DcevmCompilation_lock to
|
||||
pause C1/C2
|
||||
|
||||
Sources are synchronized now with dcevm17 code base. Compilation_lock is
|
||||
used exclusively for WhiteBox, so we use a new lock for dcevm
|
||||
---
|
||||
src/hotspot/share/compiler/compileBroker.cpp | 10 +++++-----
|
||||
src/hotspot/share/prims/jvmtiEnv.cpp | 4 ++--
|
||||
src/hotspot/share/runtime/mutexLocker.cpp | 3 +++
|
||||
src/hotspot/share/runtime/mutexLocker.hpp | 1 +
|
||||
4 files changed, 11 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
index bd0f9f0efab..448e9b1002b 100644
|
||||
--- a/src/hotspot/share/compiler/compileBroker.cpp
|
||||
+++ b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
@@ -2196,7 +2196,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
{
|
||||
- MonitorLockerEx locker(Compilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
+ MonitorLockerEx locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
while (_compilation_stopped) {
|
||||
locker.wait(Mutex::_no_safepoint_check_flag);
|
||||
}
|
||||
@@ -2873,19 +2873,19 @@ void CompileBroker::print_heapinfo(outputStream* out, const char* function, size
|
||||
|
||||
void CompileBroker::stopCompilationBeforeEnhancedRedefinition() {
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
- MonitorLockerEx locker(Compilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
+ MonitorLockerEx locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
_compilation_stopped = true;
|
||||
while (_active_compilations > 0) {
|
||||
- VM_ThreadsSuspendJVMTI tsj;
|
||||
+ VM_ThreadsSuspendJVMTI tsj; // force safepoint to run C1/C2 VM op
|
||||
VMThread::execute(&tsj);
|
||||
- locker.wait(Mutex::_no_safepoint_check_flag);
|
||||
+ locker.wait(Mutex::_no_safepoint_check_flag, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CompileBroker::releaseCompilationAfterEnhancedRedefinition() {
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
- MonitorLockerEx locker(Compilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
+ MonitorLockerEx locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
_compilation_stopped = false;
|
||||
locker.notify_all();
|
||||
}
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
index 0ca9ec020a9..221e8a20c76 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
@@ -454,9 +454,9 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
class_definitions[index].klass = jcls;
|
||||
}
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
+ MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
// Stop compilation to avoid compilator race condition (crashes) with advanced redefinition
|
||||
CompileBroker::stopCompilationBeforeEnhancedRedefinition();
|
||||
- MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_retransform);
|
||||
VMThread::execute(&op);
|
||||
CompileBroker::releaseCompilationAfterEnhancedRedefinition();
|
||||
@@ -473,9 +473,9 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
jvmtiError
|
||||
JvmtiEnv::RedefineClasses(jint class_count, const jvmtiClassDefinition* class_definitions) {
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
+ MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
// Stop compilation to avoid compilator race condition (crashes) with advanced redefinition
|
||||
CompileBroker::stopCompilationBeforeEnhancedRedefinition();
|
||||
- MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
|
||||
VMThread::execute(&op);
|
||||
CompileBroker::releaseCompilationAfterEnhancedRedefinition();
|
||||
diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
index 16e91c85fd1..ae68611e992 100644
|
||||
--- a/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
+++ b/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
@@ -95,6 +95,7 @@ Mutex* Compile_lock = NULL;
|
||||
Monitor* MethodCompileQueue_lock = NULL;
|
||||
Monitor* CompileThread_lock = NULL;
|
||||
Monitor* Compilation_lock = NULL;
|
||||
+Monitor* DcevmCompilation_lock = NULL;
|
||||
Mutex* CompileTaskAlloc_lock = NULL;
|
||||
Mutex* CompileStatistics_lock = NULL;
|
||||
Mutex* DirectivesStack_lock = NULL;
|
||||
@@ -327,6 +328,8 @@ void mutex_init() {
|
||||
def(Compilation_lock , PaddedMonitor, leaf, false, Monitor::_safepoint_check_never);
|
||||
}
|
||||
|
||||
+ def(DcevmCompilation_lock , PaddedMonitor, nonleaf+1, false, Monitor::_safepoint_check_never);
|
||||
+
|
||||
#if INCLUDE_JFR
|
||||
def(JfrMsg_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_always);
|
||||
def(JfrBuffer_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
|
||||
diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp
|
||||
index b41abcb82ae..a9530a3a0e9 100644
|
||||
--- a/src/hotspot/share/runtime/mutexLocker.hpp
|
||||
+++ b/src/hotspot/share/runtime/mutexLocker.hpp
|
||||
@@ -99,6 +99,7 @@ extern Mutex* Compile_lock; // a lock held when Compilation
|
||||
extern Monitor* MethodCompileQueue_lock; // a lock held when method compilations are enqueued, dequeued
|
||||
extern Monitor* CompileThread_lock; // a lock held by compile threads during compilation system initialization
|
||||
extern Monitor* Compilation_lock; // a lock used to pause compilation
|
||||
+extern Monitor* DcevmCompilation_lock; // a lock used to pause compilation from dcevm
|
||||
extern Mutex* CompileTaskAlloc_lock; // a lock held when CompileTasks are allocated
|
||||
extern Mutex* CompileStatistics_lock; // a lock held when updating compilation statistics
|
||||
extern Mutex* DirectivesStack_lock; // a lock held when mutating the dirstack and ref counting directives
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From eda304d04f9d7ca3d8c488d0375c77eae989a268 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Fri, 5 Nov 2021 19:36:08 +0100
|
||||
Subject: [PATCH 37/44] JBR-3964 - now G1 is the default GC in
|
||||
AllowEnhancedClassRedefinition
|
||||
|
||||
---
|
||||
src/hotspot/share/gc/shared/gcConfig.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
index 20e0ef9ee8a..aea0ae3759f 100644
|
||||
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
@@ -106,9 +106,9 @@ void GCConfig::fail_if_unsupported_gc_is_selected() {
|
||||
}
|
||||
|
||||
void GCConfig::select_gc_ergonomically() {
|
||||
- if (AllowEnhancedClassRedefinition && !UseConcMarkSweepGC && !UseG1GC) {
|
||||
+ if (AllowEnhancedClassRedefinition && !UseConcMarkSweepGC && !UseSerialGC) {
|
||||
// Enhanced class redefinition only supports serial GC at the moment
|
||||
- FLAG_SET_ERGO(bool, UseSerialGC, true);
|
||||
+ FLAG_SET_ERGO(bool, UseG1GC, true);
|
||||
} else if (os::is_server_class_machine()) {
|
||||
#if INCLUDE_G1GC
|
||||
FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
From 983a17c530f48d95cc5c48d548d991749d1d49e2 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sat, 6 Nov 2021 19:43:35 +0100
|
||||
Subject: [PATCH 38/44] Code cleanup
|
||||
|
||||
---
|
||||
src/hotspot/share/compiler/compileBroker.cpp | 2 ++
|
||||
src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp | 5 ++---
|
||||
src/hotspot/share/gc/shared/gcConfig.cpp | 2 +-
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 1 +
|
||||
4 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
index 448e9b1002b..23f3a16c589 100644
|
||||
--- a/src/hotspot/share/compiler/compileBroker.cpp
|
||||
+++ b/src/hotspot/share/compiler/compileBroker.cpp
|
||||
@@ -2872,6 +2872,8 @@ void CompileBroker::print_heapinfo(outputStream* out, const char* function, size
|
||||
}
|
||||
|
||||
void CompileBroker::stopCompilationBeforeEnhancedRedefinition() {
|
||||
+ // There are hard to fix C1/C2 race conditions with dcevm. The easiest solution
|
||||
+ // is to stop compilation.
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
MonitorLockerEx locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
|
||||
_compilation_stopped = true;
|
||||
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
|
||||
index e7d830979f6..58d9a6015e7 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
|
||||
@@ -114,7 +114,7 @@ void G1FullGCCompactTask::work(uint worker_id) {
|
||||
}
|
||||
}
|
||||
|
||||
- // TODO: (DCEV) check it
|
||||
+ // TODO: (DCEVM) check it
|
||||
G1ResetHumongousClosure hc(collector()->mark_bitmap());
|
||||
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&hc, &_claimer, worker_id);
|
||||
log_task("Compaction task", worker_id, start);
|
||||
@@ -146,8 +146,7 @@ void G1FullGCCompactTask::compact_region_dcevm(HeapRegion* hr, GrowableArray<Hea
|
||||
void G1FullGCCompactTask::serial_compaction_dcevm() {
|
||||
GCTraceTime(Debug, gc, phases) tm("Phase 4: Serial Compaction", collector()->scope()->timer());
|
||||
|
||||
- // compact remaining, not parallel compacted rescued oops using serial compact point
|
||||
-
|
||||
+ // Clear allocated resources at compact points now, since all rescued oops are copied to destination.
|
||||
for (uint i = 0; i < collector()->workers(); i++) {
|
||||
G1FullGCCompactionPoint* cp = collector()->compaction_point(i);
|
||||
DcevmSharedGC::clear_rescued_objects_heap(cp->rescued_oops_values());
|
||||
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
index aea0ae3759f..c056e564fa3 100644
|
||||
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
@@ -107,7 +107,7 @@ void GCConfig::fail_if_unsupported_gc_is_selected() {
|
||||
|
||||
void GCConfig::select_gc_ergonomically() {
|
||||
if (AllowEnhancedClassRedefinition && !UseConcMarkSweepGC && !UseSerialGC) {
|
||||
- // Enhanced class redefinition only supports serial GC at the moment
|
||||
+ // (DCEVM) use G1 as default GC in Enhanced class redefinition
|
||||
FLAG_SET_ERGO(bool, UseG1GC, true);
|
||||
} else if (os::is_server_class_machine()) {
|
||||
#if INCLUDE_G1GC
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 1e63561064a..ee6e6f1d8d5 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -548,6 +548,7 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
if (log_is_enabled(Info, redefine, class, timer)) {
|
||||
_timer_heap_iterate.start();
|
||||
}
|
||||
+ // returns after the iteration is finished
|
||||
G1CollectedHeap::heap()->object_par_iterate(&objectClosure);
|
||||
_timer_heap_iterate.stop();
|
||||
} else {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
From 8eb32c4c4dd67aeaebae168e17201559ac0fb50f Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 21 Nov 2021 16:57:57 +0100
|
||||
Subject: [PATCH 39/44] JBR-4018 - fix zero variant compilation issues
|
||||
|
||||
---
|
||||
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 12 ++++++++++++
|
||||
src/hotspot/share/runtime/arguments.cpp | 2 ++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index ee6e6f1d8d5..c2721b2aab1 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -54,7 +54,9 @@
|
||||
#include "utilities/events.hpp"
|
||||
#include "oops/constantPool.inline.hpp"
|
||||
#include "gc/cms/cmsHeap.hpp"
|
||||
+#if INCLUDE_G1GC
|
||||
#include "gc/g1/g1CollectedHeap.hpp"
|
||||
+#endif
|
||||
#include "gc/shared/dcevmSharedGC.hpp"
|
||||
|
||||
Array<Method*>* VM_EnhancedRedefineClasses::_old_methods = NULL;
|
||||
@@ -534,16 +536,21 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
// mark such nmethod's as "scavengable".
|
||||
// For now, mark all nmethod's as scavengable that are not scavengable already
|
||||
if (ScavengeRootsInCode) {
|
||||
+#if INCLUDE_G1GC
|
||||
if (UseG1GC) {
|
||||
// G1 holds references to nmethods in regions based on oops values. Since oops in nmethod can be changed in ChangePointers* closures
|
||||
// we unregister nmethods from G1 heap, then closures are processed (oops are changed) and finally we register nmethod to G1 again
|
||||
CodeCache::nmethods_do(unregister_nmethod_g1);
|
||||
} else {
|
||||
+#endif
|
||||
CodeCache::nmethods_do(mark_as_scavengable);
|
||||
+#if INCLUDE_G1GC
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
Universe::heap()->ensure_parsability(false);
|
||||
+#if INCLUDE_G1GC
|
||||
if (UseG1GC) {
|
||||
if (log_is_enabled(Info, redefine, class, timer)) {
|
||||
_timer_heap_iterate.start();
|
||||
@@ -552,19 +559,24 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
G1CollectedHeap::heap()->object_par_iterate(&objectClosure);
|
||||
_timer_heap_iterate.stop();
|
||||
} else {
|
||||
+#endif
|
||||
if (log_is_enabled(Info, redefine, class, timer)) {
|
||||
_timer_heap_iterate.start();
|
||||
}
|
||||
Universe::heap()->object_iterate(&objectClosure);
|
||||
_timer_heap_iterate.stop();
|
||||
+#if INCLUDE_G1GC
|
||||
}
|
||||
+#endif
|
||||
|
||||
Universe::root_oops_do(&oopClosureNoBarrier);
|
||||
|
||||
+#if INCLUDE_G1GC
|
||||
if (UseG1GC) {
|
||||
// this should work also for other GCs
|
||||
CodeCache::nmethods_do(register_nmethod_g1);
|
||||
}
|
||||
+#endif
|
||||
|
||||
}
|
||||
log_trace(redefine, class, obsolete, metadata)("After updating instances");
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index dce89a044e9..77238a4608d 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -3967,12 +3967,14 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
|
||||
// Set object alignment values.
|
||||
set_object_alignment();
|
||||
|
||||
+#ifndef ZERO
|
||||
if (FlightRecorder) {
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
warning("EnhancedClassRedefinition was disabled, it is not allowed in FlightRecorder.");
|
||||
AllowEnhancedClassRedefinition = false;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
setup_hotswap_agent();
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
From 96862f74063229132611259eb35f523badd0c9e1 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 28 Nov 2021 11:10:58 +0100
|
||||
Subject: [PATCH 40/44] JBR-3997 - fix _invokehandle and _invokedynamic race
|
||||
conditions
|
||||
|
||||
Old clear mechanism of CpCacheEntry has cleared partially _flags and the
|
||||
entire _f1, but both values could be later used in interpreter for
|
||||
invocation. It ended up with various types of crashes. To prevent dcevm
|
||||
crashes, we keep the old _f1 and _flags values until they are resolved
|
||||
again. We need a new flag 'is_f1_null_dcevm_shift' indicating that _f1
|
||||
is NULL (while f1 keeps old value).
|
||||
---
|
||||
src/hotspot/share/oops/cpCache.cpp | 14 ++++----------
|
||||
src/hotspot/share/oops/cpCache.hpp | 8 ++++----
|
||||
src/hotspot/share/oops/cpCache.inline.hpp | 7 ++++++-
|
||||
3 files changed, 14 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp
|
||||
index 4318df227d1..52cf5fe5bdf 100644
|
||||
--- a/src/hotspot/share/oops/cpCache.cpp
|
||||
+++ b/src/hotspot/share/oops/cpCache.cpp
|
||||
@@ -450,6 +450,8 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle&
|
||||
|
||||
release_set_f1(adapter()); // This must be the last one to set (see NOTE above)!
|
||||
|
||||
+ OrderAccess::release_store(&_flags, _flags & ~(1u << is_f1_null_dcevm_shift));
|
||||
+
|
||||
// The interpreter assembly code does not check byte_2,
|
||||
// but it is used by is_resolved, method_if_resolved, etc.
|
||||
set_bytecode_1(invoke_code);
|
||||
@@ -654,16 +656,8 @@ void ConstantPoolCacheEntry::clear_entry() {
|
||||
_indices = constant_pool_index();
|
||||
|
||||
if (clearData) {
|
||||
- if (!is_resolved_reference()) {
|
||||
- _f2 = 0;
|
||||
- }
|
||||
- // FIXME: (DCEVM) we want to clear flags, but parameter size is actually used
|
||||
- // after we return from the method, before entry is re-initialized. So let's
|
||||
- // keep parameter size the same.
|
||||
- // For example, it's used in TemplateInterpreterGenerator::generate_return_entry_for
|
||||
- // Also, we need to keep flag marking entry as one containing resolved_reference
|
||||
- _flags &= parameter_size_mask | (1 << is_resolved_ref_shift);
|
||||
- _f1 = NULL;
|
||||
+ // DCEVM: do not clear f1 now, since it can be used before cache entry is re-resolved
|
||||
+ _flags |= (1 << is_f1_null_dcevm_shift);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/hotspot/share/oops/cpCache.hpp b/src/hotspot/share/oops/cpCache.hpp
|
||||
index 2a9eb978b43..bb4e40373b2 100644
|
||||
--- a/src/hotspot/share/oops/cpCache.hpp
|
||||
+++ b/src/hotspot/share/oops/cpCache.hpp
|
||||
@@ -178,8 +178,9 @@ class ConstantPoolCacheEntry {
|
||||
tos_state_bits = 4,
|
||||
tos_state_mask = right_n_bits(tos_state_bits),
|
||||
tos_state_shift = BitsPerInt - tos_state_bits, // see verify_tos_state_shift below
|
||||
- // (DCEVM) We need to remember entries which has resolved reference indices as we don't want to clean them
|
||||
- is_resolved_ref_shift = 27,
|
||||
+ // (DCEVM) dcevm additional indicator, that f1 is NULL. DCEVM need to keep the old value of the f1 until the
|
||||
+ // cache entry is reresolved to avoid race condition
|
||||
+ is_f1_null_dcevm_shift = 27,
|
||||
// misc. option bits; can be any bit position in [16..27]
|
||||
is_field_entry_shift = 26, // (F) is it a field or a method?
|
||||
has_method_type_shift = 25, // (M) does the call site have a MethodType?
|
||||
@@ -213,7 +214,6 @@ class ConstantPoolCacheEntry {
|
||||
void initialize_resolved_reference_index(int ref_index) {
|
||||
assert(_f2 == 0, "set once"); // note: ref_index might be zero also
|
||||
_f2 = ref_index;
|
||||
- _flags = 1 << is_resolved_ref_shift;
|
||||
}
|
||||
|
||||
void set_field( // sets entry to resolved field state
|
||||
@@ -363,7 +363,6 @@ class ConstantPoolCacheEntry {
|
||||
bool is_method_entry() const { return (_flags & (1 << is_field_entry_shift)) == 0; }
|
||||
bool is_field_entry() const { return (_flags & (1 << is_field_entry_shift)) != 0; }
|
||||
bool is_long() const { return flag_state() == ltos; }
|
||||
- bool is_resolved_reference() const { return (_flags & (1 << is_resolved_ref_shift)) != 0; }
|
||||
bool is_double() const { return flag_state() == dtos; }
|
||||
TosState flag_state() const { assert((uint)number_of_states <= (uint)tos_state_mask+1, "");
|
||||
return (TosState)((_flags >> tos_state_shift) & tos_state_mask); }
|
||||
@@ -407,6 +406,7 @@ class ConstantPoolCacheEntry {
|
||||
|
||||
void verify_just_initialized(bool f2_used);
|
||||
void reinitialize(bool f2_used);
|
||||
+
|
||||
};
|
||||
|
||||
|
||||
diff --git a/src/hotspot/share/oops/cpCache.inline.hpp b/src/hotspot/share/oops/cpCache.inline.hpp
|
||||
index c876e669de3..2cf48c67a9f 100644
|
||||
--- a/src/hotspot/share/oops/cpCache.inline.hpp
|
||||
+++ b/src/hotspot/share/oops/cpCache.inline.hpp
|
||||
@@ -65,7 +65,12 @@ inline Klass* ConstantPoolCacheEntry::f1_as_klass() const {
|
||||
return (Klass*)f1;
|
||||
}
|
||||
|
||||
-inline bool ConstantPoolCacheEntry::is_f1_null() const { Metadata* f1 = f1_ord(); return f1 == NULL; }
|
||||
+inline bool ConstantPoolCacheEntry::is_f1_null() const {
|
||||
+ Metadata* f1 = f1_ord();
|
||||
+ intx flags = flags_ord();
|
||||
+ return f1 == NULL || (flags & (1 << is_f1_null_dcevm_shift)) != 0;
|
||||
+}
|
||||
+
|
||||
|
||||
inline bool ConstantPoolCacheEntry::has_appendix() const {
|
||||
return (!is_f1_null()) && (_flags & (1 << has_appendix_shift)) != 0;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From be92eb0b4440f27298330581ec34b17fdac14da9 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Mon, 29 Nov 2021 17:28:36 +0100
|
||||
Subject: [PATCH 41/44] JBR-3997 - change order of clear is_f1_null_dcevm_shift
|
||||
and set _f1
|
||||
|
||||
---
|
||||
src/hotspot/share/oops/cpCache.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp
|
||||
index 52cf5fe5bdf..a223fc17cae 100644
|
||||
--- a/src/hotspot/share/oops/cpCache.cpp
|
||||
+++ b/src/hotspot/share/oops/cpCache.cpp
|
||||
@@ -448,10 +448,10 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle&
|
||||
resolved_references->obj_at_put(method_type_index, method_type());
|
||||
}
|
||||
|
||||
- release_set_f1(adapter()); // This must be the last one to set (see NOTE above)!
|
||||
-
|
||||
OrderAccess::release_store(&_flags, _flags & ~(1u << is_f1_null_dcevm_shift));
|
||||
|
||||
+ release_set_f1(adapter()); // This must be the last one to set (see NOTE above)!
|
||||
+
|
||||
// The interpreter assembly code does not check byte_2,
|
||||
// but it is used by is_resolved, method_if_resolved, etc.
|
||||
set_bytecode_1(invoke_code);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
From 73b3c3daf4f521c103f8474708add0717adcda70 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 19 Dec 2021 10:14:48 +0100
|
||||
Subject: [PATCH 42/44] JBR-4125 - fix wrong addition of java.lang.Object as
|
||||
superclass
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index c2721b2aab1..66600206aab 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -1018,7 +1018,7 @@ int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_
|
||||
|
||||
cur_klass = new_class->super();
|
||||
while (cur_klass != NULL) {
|
||||
- if (!the_class->is_subclass_of(cur_klass->old_version())) {
|
||||
+ if (!the_class->is_subclass_of(cur_klass->is_redefining() ? cur_klass->old_version() : cur_klass)) {
|
||||
log_info(redefine, class, load)("added super class %s", cur_klass->name()->as_C_string());
|
||||
result = result | Klass::ModifyClass | Klass::ModifyInstances;
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
From d211ae68e72eac8b868c9b198929f73f385c18d7 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Wed, 29 Dec 2021 17:44:02 +0100
|
||||
Subject: [PATCH 43/44] JBR-4148 - removed meaningless copying of data to
|
||||
itself
|
||||
|
||||
---
|
||||
src/hotspot/share/oops/method.cpp | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index 2af3e71635e..55eb4e8c294 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -1448,8 +1448,6 @@ methodHandle Method::clone_with_new_data(const methodHandle& m, u_char* new_code
|
||||
|
||||
// Reset correct method/const method, method size, and parameter info
|
||||
newm->set_constMethod(newcm);
|
||||
- newm->set_new_version(newm->new_version());
|
||||
- newm->set_old_version(newm->old_version());
|
||||
newm->constMethod()->set_code_size(new_code_length);
|
||||
newm->constMethod()->set_constMethod_size(new_const_method_size);
|
||||
assert(newm->code_size() == new_code_length, "check");
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From 71dea432524297595b3193943981e18bcf35e822 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Fri, 28 Jan 2022 18:52:58 +0100
|
||||
Subject: [PATCH 44/44] Fix compilation problem - remove notice_modification
|
||||
SystemDictionary::notice_modification was removed in jdk11.0.4, it contained
|
||||
number of redefinition counter for informational purposes
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 66600206aab..ece6e71b209 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -658,8 +658,8 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
// TODO: explain...
|
||||
ciObjectFactory::resort_shared_ci_metadata();
|
||||
|
||||
- // Disable any dependent concurrent compilations
|
||||
- SystemDictionary::notice_modification();
|
||||
+ // notice_modification() was removed in 11.0.14
|
||||
+ // SystemDictionary::notice_modification();
|
||||
|
||||
// Set flag indicating that some invariants are no longer true.
|
||||
// See jvmtiExport.hpp for detailed explanation.
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
while getopts ":t" o; do
|
||||
case "${o}" in
|
||||
t)
|
||||
t="With Teamcity tests info"
|
||||
TC_PRINT=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
NEWFILEPATH=$1
|
||||
CONFIGID=$2
|
||||
BUILDID=$3
|
||||
TOKEN=$4
|
||||
#
|
||||
# Get the size of new artifact
|
||||
#
|
||||
|
||||
unameOut="$(uname -s)"
|
||||
case "${unameOut}" in
|
||||
Linux*)
|
||||
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
|
||||
;;
|
||||
Darwin*)
|
||||
NEWFILESIZE=$(stat -f%z "$NEWFILEPATH")
|
||||
;;
|
||||
CYGWIN*)
|
||||
NEWFILESIZE=$(stat -c%s$4
|
||||
#
|
||||
# Get the size of new artifact
|
||||
#
|
||||
"$NEWFILEPATH")
|
||||
;;
|
||||
MINGW*)
|
||||
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
|
||||
;;
|
||||
*)
|
||||
echo "Unknown machine: ${unameOut}"
|
||||
exit 1
|
||||
esac
|
||||
FILENAME=$(basename ${NEWFILEPATH})
|
||||
|
||||
#
|
||||
# Get pattern of artifact name
|
||||
# Base filename pattern: <BUNDLE_TYPE>-<JDK_VERSION>-<OS>-<ARCH>-b<BUILD>.tar.gz: jbr_dcevm-17.0.2-osx-x64-b1234.tar.gz
|
||||
# BUNDLE_TYPE: jbr, jbrsdk, jbr_dcevm, jbrsdk_jcef etc.
|
||||
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, windows-x64 etc.
|
||||
|
||||
BUNDLE_TYPE=jbrsdk
|
||||
OS_ARCH_PATTERN=""
|
||||
FILE_EXTENSION=tar.gz
|
||||
|
||||
re='(jbr[a-z_]*).*-[0-9_\.]+-(.+)-b[0-9]+(.+)'
|
||||
if [[ $FILENAME =~ $re ]]; then
|
||||
BUNDLE_TYPE=${BASH_REMATCH[1]}
|
||||
OS_ARCH_PATTERN=${BASH_REMATCH[2]}
|
||||
FILE_EXTENSION=${BASH_REMATCH[3]}
|
||||
fi
|
||||
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
testname_file_ext=`echo $FILE_EXTENSION | sed 's/\./_/g'`
|
||||
testname=$BUNDLE_TYPE"_"$OS_ARCH_PATTERN$testname_file_ext
|
||||
echo \#\#teamcity[testStarted name=\'$testname\']
|
||||
fi
|
||||
|
||||
|
||||
echo "BUNDLE_TYPE: " $BUNDLE_TYPE
|
||||
echo "OS_ARCH_PATTERN: " $OS_ARCH_PATTERN
|
||||
echo "FILE_EXTENSION: " $FILE_EXTENSION
|
||||
echo "New size of $FILENAME = $NEWFILESIZE bytes."
|
||||
|
||||
|
||||
function test_failed_msg() {
|
||||
if [ $3 -eq 1 ]; then
|
||||
echo \#\#teamcity[testFailed name=\'$1\' message=\'$2\']
|
||||
fi
|
||||
}
|
||||
|
||||
function test_finished_msg() {
|
||||
if [ $2 -eq 1 ]; then
|
||||
echo \#\#teamcity[testFinished name=\'$1\']
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Get previous successful build ID
|
||||
# Example:
|
||||
# CONFIGID=IntellijCustomJdk_Jdk17_Master_LinuxX64jcef
|
||||
# BUILDID=12345678
|
||||
#
|
||||
# expected return value
|
||||
# id="123".number="567"
|
||||
#
|
||||
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
|
||||
re='id=\"([0-9]+)\".+number=\"([0-9\.]+)\"'
|
||||
|
||||
# ID: Previous successful build id
|
||||
ID=0
|
||||
if [[ $CURL_RESPONSE =~ $re ]]; then
|
||||
ID=${BASH_REMATCH[1]}
|
||||
echo "BUILD Number: ${BASH_REMATCH[2]}"
|
||||
else
|
||||
msg="ERROR: can't find previous build"
|
||||
echo $msg
|
||||
echo $CURL_RESPONSE
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Get artifacts from previous successful build
|
||||
#
|
||||
# expected return value
|
||||
# name="jbrsdk_jcef*.tar.gz size="123'
|
||||
#
|
||||
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
|
||||
echo "Atrifacts of previous build of $CONFIGID :"
|
||||
echo $CURL_RESPONSE
|
||||
|
||||
# Find binary size (in response) with reg exp
|
||||
re='name=\"('$BUNDLE_TYPE'[^\"]+'${OS_ARCH_PATTERN}'[^\"]+'${FILE_EXTENSION}')\" size=\"([0-9]+)\"'
|
||||
|
||||
if [[ $CURL_RESPONSE =~ $re ]]; then
|
||||
OLDFILENAME=${BASH_REMATCH[1]}
|
||||
echo "Prev artifact name: $OLDFILENAME"
|
||||
OLDFILESIZE=${BASH_REMATCH[2]}
|
||||
echo "Prev artifact size = $OLDFILESIZE"
|
||||
|
||||
let allowedSize=OLDFILESIZE+OLDFILESIZE/20 # use 5% threshold
|
||||
echo "Allowed size = $allowedSize"
|
||||
if [[ "$NEWFILESIZE" -gt "$allowedSize" ]]; then
|
||||
msg="ERROR: new size is significally greater than prev size (need to investigate)"
|
||||
echo $msg
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
exit 1
|
||||
else
|
||||
echo "PASSED"
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
fi
|
||||
else
|
||||
msg="ERROR: can't find string with size in xml response:"
|
||||
echo $msg
|
||||
echo $CURL_RESPONSE
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,164 +0,0 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# jcef - the release bundles with jcef
|
||||
# dcevm - the release bundles with dcevm patches
|
||||
# nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-windows-aarch64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-windows-aarch64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
# Environment variables:
|
||||
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
|
||||
# By default imported modules should be located in ./jcef_win_aarch64/modular-sdk
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_win_aarch64
|
||||
# BOOT_JDK - specifies the path to the directory with a ready build of OpenJDK 11 with
|
||||
# the same architecture as the build system. It will be used as the boot jdk.
|
||||
|
||||
while getopts ":i?" o; do
|
||||
case "${o}" in
|
||||
i)
|
||||
i="incremental build"
|
||||
INC_BUILD=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
WORK_DIR=$(pwd)
|
||||
JCEF_PATH=${JCEF_PATH:=${WORK_DIR}/jcef_win_aarch64}
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${JCEF_PATH}/modular-sdk}"
|
||||
TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:=2019}
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function do_configure {
|
||||
sh ./configure \
|
||||
--openjdk-target=aarch64-unknown-cygwin \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
--with-toolchain-version=${TOOLCHAIN_VERSION} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--with-build-jdk=${BOOT_JDK} \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || do_exit $?
|
||||
}
|
||||
|
||||
function create_jbr {
|
||||
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
|
||||
case "${bundle_type}" in
|
||||
"jcef" | "dcevm" | "nomod" | "fd")
|
||||
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Exclude jdk.internal.vm.compiler and jdk.aot (because aot is not supported yet)"
|
||||
cat jb/project/tools/common/modules.list | \
|
||||
grep -v "jdk.internal.vm.compiler\|jdk.aot" \
|
||||
> modules_tmp.list
|
||||
echo ",jdk.crypto.mscapi" >> modules_tmp.list
|
||||
|
||||
rm -rf ${JBR_BUNDLE}
|
||||
|
||||
echo Running jlink....
|
||||
${BOOT_JDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules_tmp.list | sed 's/ //g' | sed 's/,\?$//g') --output ${JBR_BUNDLE} || do_exit $?
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]
|
||||
then
|
||||
rsync -av ${JCEF_PATH}/ ${JBR_BUNDLE}/bin --exclude="modular-sdk" || do_exit $?
|
||||
fi
|
||||
echo Modifying release info ...
|
||||
cat ${JSDK}/release | tr -d '\r' | grep -v 'JAVA_VERSION' | grep -v 'MODULES' >> ${JBR_BUNDLE}/release
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=windows-aarch64-normal-server-release
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-aarch64-b${build_number}
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module_arch64.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
do_reset_dcevm=1
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module_arch64.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"nomod")
|
||||
WITH_IMPORT_MODULES=""
|
||||
;;
|
||||
"fd")
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module_arch64.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=windows-aarch64-normal-server-fastdebug
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}-fastdebug
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-aarch64-fastdebug-b${build_number}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ "${bundle_type}" == "jcef" ]; then
|
||||
make LOG=info clean images test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
else
|
||||
make LOG=info clean images CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ "${bundle_type}" == "jcef" ]; then
|
||||
make LOG=info images test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
else
|
||||
make LOG=info images CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
JSDK=build/$RELEASE_NAME/images/jdk
|
||||
BASE_DIR=build/$RELEASE_NAME/images
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || do_exit $?
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]
|
||||
then
|
||||
rsync -av ${JCEF_PATH}/ ${JBRSDK_BUNDLE}/bin --exclude='modular-sdk' || do_exit $?
|
||||
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
|
||||
mv release ${JBRSDK_BUNDLE}/release
|
||||
fi
|
||||
|
||||
create_jbr || do_exit $?
|
||||
|
||||
do_exit 0
|
||||
@@ -6,6 +6,8 @@
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# jcef - the release bundles with jcef
|
||||
# jfx - the release bundles with javafx
|
||||
# jcef_jfx - the release bundles with jcef and javafx
|
||||
# dcevm - the release bundles with dcevm patches
|
||||
# nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
@@ -20,63 +22,38 @@
|
||||
#
|
||||
# Environment variables:
|
||||
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
|
||||
# By default imported modules should be located in ./jcef_win_x64/modular-sdk
|
||||
# By default imported modules should be located in ./modular-sdk
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_win_x64
|
||||
|
||||
while getopts ":i?" o; do
|
||||
case "${o}" in
|
||||
i)
|
||||
i="incremental build"
|
||||
INC_BUILD=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
WORK_DIR=$(pwd)
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${WORK_DIR}/modular-sdk}"
|
||||
JCEF_PATH=${JCEF_PATH:=${WORK_DIR}/jcef_win_x64}
|
||||
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${JCEF_PATH}/modular-sdk}"
|
||||
TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:=2017}
|
||||
TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:=2015}
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function do_configure {
|
||||
sh ./configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
--with-toolchain-version=${TOOLCHAIN_VERSION} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || do_exit $?
|
||||
}
|
||||
|
||||
function create_jbr {
|
||||
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
|
||||
case "${bundle_type}" in
|
||||
"jcef" | "dcevm" | "nomod" | "fd")
|
||||
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
|
||||
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
|
||||
;;
|
||||
"jfx_jcef")
|
||||
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
cat jb/project/tools/common/modules.list > modules_tmp.list
|
||||
echo ",jdk.crypto.mscapi" >> modules_tmp.list
|
||||
cat modules.list > modules_tmp.list
|
||||
rm -rf ${JBR_BUNDLE}
|
||||
|
||||
echo Running jlink....
|
||||
@@ -91,15 +68,24 @@ function create_jbr {
|
||||
cat ${JSDK}/release | tr -d '\r' | grep -v 'JAVA_VERSION' | grep -v 'MODULES' >> ${JBR_BUNDLE}/release
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk_${bundle_type}-${JBSDK_VERSION}
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=windows-x86_64-normal-server-release
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
|
||||
case "$bundle_type" in
|
||||
"jfx")
|
||||
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"jfx_jcef")
|
||||
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
@@ -116,36 +102,36 @@ case "$bundle_type" in
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}-fastdebug
|
||||
JBSDK=jbrsdk-${JBSDK_VERSION}-windows-x64-fastdebug-b${build_number}
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-fastdebug-b${build_number}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ "${bundle_type}" == "dcevm" ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
sh ./configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
$WITH_IMPORT_MODULES \
|
||||
--with-toolchain-version=${TOOLCHAIN_VERSION} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || do_exit $?
|
||||
|
||||
if [ "${bundle_type}" == "jcef" ]; then
|
||||
make LOG=info clean images test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ "${bundle_type}" == "dcevm" ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
make LOG=info clean images CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
|
||||
JSDK=build/$RELEASE_NAME/images/jdk
|
||||
BASE_DIR=build/$RELEASE_NAME/images
|
||||
BASE_DIR=jre
|
||||
if [ "${bundle_type}" == "fd" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
else
|
||||
JBRSDK_BUNDLE=jbrsdk_${bundle_type}
|
||||
fi
|
||||
|
||||
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || do_exit $?
|
||||
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
|
||||
# jfx - the bundle 1) jbr with javafx only will be created
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
@@ -21,7 +22,6 @@ JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:=2017}
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
@@ -35,11 +35,10 @@ PATH="/usr/local/bin:/usr/bin:${PATH}"
|
||||
--with-target-bits=32 \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=${TOOLCHAIN_VERSION} \
|
||||
--with-toolchain-version=2015 \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || exit 1
|
||||
@@ -57,8 +56,7 @@ mv release ${JBRSDK_BUNDLE}/release
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
rm -rf ${JBR_BUNDLE}
|
||||
grep -v javafx jb/project/tools/common/modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
echo ",jdk.crypto.mscapi" >> modules.list.x86
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.x86 | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# jcef - the release bundles with jcef
|
||||
# dcevm - the release bundles with dcevm patches
|
||||
# nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-windows-aarch64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-windows-aarch64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
# Environment variables:
|
||||
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
|
||||
# By default imported modules should be located in ./jcef_win_aarch64/modular-sdk
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_win_aarch64
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function pack_jbr {
|
||||
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
|
||||
case "${bundle_type}" in
|
||||
"jcef" | "dcevm" | "nomod" | "fd")
|
||||
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
JBR=$JBR_BASE_NAME-windows-aarch64-b$build_number
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/${JBR_BUNDLE}
|
||||
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || do_exit $?
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=windows-aarch64-normal-server-release
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-aarch64-b${build_number}
|
||||
case "$bundle_type" in
|
||||
"fd")
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=windows-aarch64-normal-server-fastdebug
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-aarch64-fastdebug-b${build_number}
|
||||
;;
|
||||
esac
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
BASE_DIR=.
|
||||
|
||||
if [ "${bundle_type}" == "dcevm" ] || [ "${bundle_type}" == "fd" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
[ -f "$JBSDK.tar.gz" ] && rm "$JBSDK.tar.gz"
|
||||
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || do_exit $?
|
||||
fi
|
||||
|
||||
pack_jbr $bundle_type
|
||||
|
||||
if [ "$bundle_type" == "dcevm" ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-aarch64-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -6,6 +6,8 @@
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# jcef - the release bundles with jcef
|
||||
# jfx - the release bundles with javafx
|
||||
# jcef_jfx - the release bundles with jcef and javafx
|
||||
# dcevm - the release bundles with dcevm patches
|
||||
# nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
@@ -20,7 +22,7 @@
|
||||
#
|
||||
# Environment variables:
|
||||
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
|
||||
# By default imported modules should be located in ./jcef_win_x64/modular-sdk
|
||||
# By default imported modules should be located in ./modular-sdk
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_win_x64
|
||||
|
||||
@@ -36,9 +38,12 @@ function pack_jbr {
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
|
||||
case "${bundle_type}" in
|
||||
"jcef" | "dcevm" | "nomod" | "fd")
|
||||
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
|
||||
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
|
||||
;;
|
||||
"jfx_jcef")
|
||||
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
|
||||
;;
|
||||
*)
|
||||
echo "***ERR*** bundle was not specified" && do_exit 1
|
||||
;;
|
||||
@@ -51,7 +56,7 @@ function pack_jbr {
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || do_exit $?
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk_${bundle_type}-${JBSDK_VERSION}
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=windows-x86_64-normal-server-release
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
|
||||
@@ -59,27 +64,25 @@ case "$bundle_type" in
|
||||
"fd")
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
|
||||
JBSDK=jbrsdk-${JBSDK_VERSION}-windows-x64-fastdebug-b${build_number}
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-fastdebug-b${build_number}
|
||||
;;
|
||||
esac
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
BASE_DIR=.
|
||||
if [ "${bundle_type}" == "fd" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
else
|
||||
JBRSDK_BUNDLE=jbrsdk_${bundle_type}
|
||||
fi
|
||||
|
||||
if [ "${bundle_type}" == "jcef" ] || [ "${bundle_type}" == "fd" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
[ -f "$JBSDK.tar.gz" ] && rm "$JBSDK.tar.gz"
|
||||
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || do_exit $?
|
||||
fi
|
||||
|
||||
pack_jbr $bundle_type
|
||||
|
||||
if [ "$bundle_type" == "dcevm" ]; then
|
||||
JBRSDK_TEST=jbrsdk-${JBSDK_VERSION}-windows-test-x64-b$build_number
|
||||
if [ "$bundle_type" == "jcef" ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x64-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -6,6 +6,7 @@
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
|
||||
# jfx - the bundle 1) jbr with javafx only will be created
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
|
||||
@@ -168,6 +168,14 @@ JAVADOC_TOP := \
|
||||
font-family: DejaVu Sans, Arial, Helvetica, sans-serif; \
|
||||
font-weight: normal;">$(DRAFT_TEXT)</div>
|
||||
|
||||
JDK_INDEX_CONTENT := \
|
||||
<!DOCTYPE html> \
|
||||
<html lang="en"> \
|
||||
<head> \
|
||||
<meta http-equiv="refresh" content="0;url=api/index.html"> \
|
||||
</head> \
|
||||
</html>
|
||||
|
||||
################################################################################
|
||||
# JDK javadoc titles/text snippets
|
||||
|
||||
@@ -477,7 +485,14 @@ $(eval $(call SetupApiDocsGeneration, REFERENCE_API, \
|
||||
|
||||
################################################################################
|
||||
|
||||
# Copy the global resources, including the top-level redirect index.html
|
||||
JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
|
||||
|
||||
$(JDK_INDEX_HTML):
|
||||
$(ECHO) '$(JDK_INDEX_CONTENT)' > $@
|
||||
|
||||
JDK_INDEX_TARGETS += $(JDK_INDEX_HTML)
|
||||
|
||||
# Copy the global resources
|
||||
GLOBAL_SPECS_RESOURCES_DIR := $(TOPDIR)/make/data/docs-resources/
|
||||
$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
|
||||
SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
#
|
||||
# Copyright 2000-2021 JetBrains s.r.o.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
JBR_API_ROOT_DIR := $(TOPDIR)/src/jetbrains.api
|
||||
JBR_API_TOOLS_DIR := $(JBR_API_ROOT_DIR)/tools
|
||||
JBR_API_SRC_DIR := $(JBR_API_ROOT_DIR)/src
|
||||
JBR_API_OUTPUT_DIR := $(OUTPUTDIR)/jbr-api
|
||||
JBR_API_GENSRC_DIR := $(JBR_API_OUTPUT_DIR)/gensrc
|
||||
JBR_API_BIN_DIR := $(JBR_API_OUTPUT_DIR)/bin
|
||||
JBR_API_VERSION_PROPERTIES := $(JBR_API_ROOT_DIR)/version.properties
|
||||
JBR_API_VERSION_GENSRC := $(JBR_API_OUTPUT_DIR)/jbr-api.version
|
||||
JBR_API_GENSRC_BATCH := $(JBR_API_VERSION_GENSRC)
|
||||
|
||||
JBR_API_SRC_FILES := $(call FindFiles, $(JBR_API_SRC_DIR))
|
||||
JBR_API_GENSRC_FILES := $(foreach f, $(call FindFiles, $(JBR_API_SRC_DIR)), \
|
||||
$(JBR_API_GENSRC_DIR)/$(call RelativePath, $f, $(JBR_API_SRC_DIR)))
|
||||
|
||||
ifeq ($(JBR_API_JBR_VERSION),)
|
||||
JBR_API_JBR_VERSION := <DEVELOPMENT>
|
||||
JBR_API_FAIL_ON_HASH_MISMATCH := false
|
||||
else
|
||||
.PHONY: $(JBR_API_VERSION_PROPERTIES)
|
||||
JBR_API_FAIL_ON_HASH_MISMATCH := true
|
||||
endif
|
||||
|
||||
ARCHIVE_BUILD_JBR_API_BIN := $(JBR_API_BIN_DIR)
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JBR_API, \
|
||||
SETUP := BOOT_JAVAC, \
|
||||
SRC := $(JBR_API_GENSRC_DIR), \
|
||||
EXTRA_FILES := $(JBR_API_GENSRC_FILES), \
|
||||
DEPENDS := $(JBR_API_GENSRC_FILES), \
|
||||
BIN := $(JBR_API_BIN_DIR), \
|
||||
JAR := $(JBR_API_OUTPUT_DIR)/jbr-api.jar, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupJarArchive, BUILD_JBR_API_SOURCES_JAR, \
|
||||
DEPENDENCIES := $(JBR_API_GENSRC_FILES), \
|
||||
SRCS := $(JBR_API_GENSRC_DIR), \
|
||||
JAR := $(JBR_API_OUTPUT_DIR)/jbr-api-sources.jar, \
|
||||
SUFFIXES := .java, \
|
||||
BIN := $(JBR_API_BIN_DIR), \
|
||||
))
|
||||
|
||||
# Grouped targets may not be supported, so hack dependencies: sources -> version file -> generated sources
|
||||
$(JBR_API_VERSION_GENSRC): $(JBR_API_SRC_FILES) $(JBR_API_VERSION_PROPERTIES) $(JBR_API_TOOLS_DIR)/Gensrc.java
|
||||
$(ECHO) Generating sources for JBR API
|
||||
$(JAVA_CMD) $(JAVA_FLAGS_SMALL) "$(JBR_API_TOOLS_DIR)/Gensrc.java" \
|
||||
"$(TOPDIR)/src" "$(JBR_API_OUTPUT_DIR)" "$(JBR_API_JBR_VERSION)"
|
||||
$(JBR_API_GENSRC_FILES): $(JBR_API_VERSION_GENSRC)
|
||||
$(TOUCH) $@
|
||||
|
||||
jbr-api-check-version: $(JBR_API_GENSRC_FILES) $(JBR_API_VERSION_PROPERTIES)
|
||||
$(JAVA_CMD) $(JAVA_FLAGS_SMALL) "$(JBR_API_TOOLS_DIR)/CheckVersion.java" \
|
||||
"$(JBR_API_ROOT_DIR)" "$(JBR_API_GENSRC_DIR)" "$(JBR_API_FAIL_ON_HASH_MISMATCH)"
|
||||
|
||||
jbr-api: $(BUILD_JBR_API) $(BUILD_JBR_API_SOURCES_JAR) jbr-api-check-version
|
||||
|
||||
.PHONY: jbr-api jbr-api-check-version
|
||||
|
||||
ifneq ($(JBR_API_CONF_FILE),)
|
||||
$(JBR_API_CONF_FILE): $(JBR_API_GENSRC_FILES)
|
||||
$(ECHO) "VERSION=`$(CAT) $(JBR_API_VERSION_GENSRC)`" > $(JBR_API_CONF_FILE)
|
||||
$(ECHO) "JAR=$(JBR_API_OUTPUT_DIR)/jbr-api.jar" >> $(JBR_API_CONF_FILE)
|
||||
$(ECHO) "SOURCES_JAR=$(JBR_API_OUTPUT_DIR)/jbr-api-sources.jar" >> $(JBR_API_CONF_FILE)
|
||||
jbr-api: $(JBR_API_CONF_FILE)
|
||||
.PHONY: $(JBR_API_CONF_FILE)
|
||||
endif
|
||||
@@ -1254,13 +1254,6 @@ ALL_TARGETS += clean clean-docs clean-compile-commands dist-clean $(CLEAN_DIR_TA
|
||||
$(CLEAN_SUPPORT_DIR_TARGETS) $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) \
|
||||
$(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
|
||||
|
||||
################################################################################
|
||||
# JBR API
|
||||
|
||||
jbr-api:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f JBRApi.gmk jbr-api)
|
||||
ALL_TARGETS += jbr-api
|
||||
|
||||
################################################################################
|
||||
# Declare *-only targets for each normal target
|
||||
$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
|
||||
|
||||
@@ -276,7 +276,7 @@ $(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
|
||||
|
||||
$(eval $(call ParseKeywordVariable, JTREG, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN \
|
||||
MAX_MEM RETRY_COUNT, \
|
||||
MAX_MEM, \
|
||||
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
|
||||
EXTRA_PROBLEM_LISTS AOT_MODULES, \
|
||||
))
|
||||
@@ -312,6 +312,8 @@ langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
|
||||
nashorn_JTREG_PROBLEM_LIST += $(TOPDIR)/test/nashorn/ProblemList.txt
|
||||
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
|
||||
|
||||
langtools_JTREG_MAX_MEM := 768m
|
||||
|
||||
################################################################################
|
||||
# Parse test selection
|
||||
#
|
||||
@@ -530,7 +532,6 @@ define SetupRunGtestTestBody
|
||||
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
|
||||
-jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
|
||||
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
|
||||
--gtest_catch_exceptions=0 \
|
||||
$$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
|
||||
$$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \
|
||||
> >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \
|
||||
@@ -625,7 +626,7 @@ define SetupRunJtregTestBody
|
||||
# Convert JTREG_foo into $1_JTREG_foo with a suitable value.
|
||||
$$(eval $$(call SetJtregValue,$1,JTREG_TEST_MODE,agentvm))
|
||||
$$(eval $$(call SetJtregValue,$1,JTREG_ASSERT,true))
|
||||
$$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,768m))
|
||||
$$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,512m))
|
||||
$$(eval $$(call SetJtregValue,$1,JTREG_NATIVEPATH))
|
||||
$$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
|
||||
$$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
|
||||
@@ -641,7 +642,7 @@ define SetupRunJtregTestBody
|
||||
|
||||
# Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
|
||||
# we may end up with a lot of JVM's
|
||||
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
|
||||
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
|
||||
|
||||
# SPARC is in general slower per core so need to scale up timeouts a bit.
|
||||
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
|
||||
@@ -651,7 +652,6 @@ define SetupRunJtregTestBody
|
||||
endif
|
||||
JTREG_VERBOSE ?= fail,error,summary
|
||||
JTREG_RETAIN ?= fail,error
|
||||
JTREG_RETRY_COUNT ?= 0
|
||||
|
||||
ifneq ($$($1_JTREG_MAX_MEM), 0)
|
||||
$1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
|
||||
@@ -741,7 +741,12 @@ define SetupRunJtregTestBody
|
||||
clean-workdir-$1:
|
||||
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
|
||||
|
||||
$1_COMMAND_LINE := \
|
||||
run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS)
|
||||
$$(call LogWarn)
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
|
||||
$$($1_TEST_TMP_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, ( \
|
||||
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
|
||||
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
|
||||
$$($1_JTREG_BASIC_OPTIONS) \
|
||||
@@ -749,35 +754,11 @@ define SetupRunJtregTestBody
|
||||
-dir:$$(JTREG_TOPDIR) \
|
||||
-reportDir:$$($1_TEST_RESULTS_DIR) \
|
||||
-workDir:$$($1_TEST_SUPPORT_DIR) \
|
||||
-status:$$$${JTREG_STATUS} \
|
||||
$$(JTREG_OPTIONS) \
|
||||
$$(JTREG_FAILURE_HANDLER_OPTIONS) \
|
||||
$$($1_TEST_NAME) \
|
||||
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \
|
||||
|| $$(ECHO) $$$$? > $$($1_EXITCODE)
|
||||
|
||||
|
||||
ifneq ($$(JTREG_RETRY_COUNT), 0)
|
||||
$1_COMMAND_LINE := \
|
||||
for i in {0..$$(JTREG_RETRY_COUNT)}; do \
|
||||
if [ "$$$$i" != 0 ]; then \
|
||||
$$(PRINTF) "\nRetrying Jtreg run. Attempt: $$$$i\n"; \
|
||||
fi; \
|
||||
$$($1_COMMAND_LINE); \
|
||||
if [ "`$$(CAT) $$($1_EXITCODE)`" = "0" ]; then \
|
||||
break; \
|
||||
fi; \
|
||||
export JTREG_STATUS="-status:error,fail"; \
|
||||
done
|
||||
endif
|
||||
|
||||
run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS)
|
||||
$$(call LogWarn)
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
|
||||
$$($1_TEST_TMP_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, ( \
|
||||
$$($1_COMMAND_LINE) \
|
||||
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
|
||||
))
|
||||
|
||||
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt
|
||||
|
||||
@@ -230,7 +230,7 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
|
||||
MEMORY_SIZE := $(shell $(EXPR) `/usr/sbin/sysctl -n hw.memsize` / 1024 / 1024)
|
||||
else ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
NUM_CORES := $(shell /usr/sbin/psrinfo -v | $(GREP) -c on-line)
|
||||
NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
|
||||
MEMORY_SIZE := $(shell \
|
||||
/usr/sbin/prtconf 2> /dev/null | $(GREP) "^Memory [Ss]ize" | $(AWK) '{print $$3}' \
|
||||
)
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
# Fake minimalistic spec file for RunTestsPrebuilt.gmk.
|
||||
################################################################################
|
||||
|
||||
# Make sure all shell commands are executed with the C locale
|
||||
export LC_ALL := C
|
||||
|
||||
define VerifyVariable
|
||||
ifeq ($$($1), )
|
||||
$$(info Error: Variable $1 is missing, needed by RunTestPrebuiltSpec.gmk)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -73,9 +73,9 @@ TOOL_HASHER = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
TOOL_TZDB = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.tzdb.TzdbZoneRulesCompiler
|
||||
|
||||
TOOL_BLOCKED_CERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
TOOL_BLACKLISTED_CERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
--add-exports java.base/sun.security.util=ALL-UNNAMED \
|
||||
build.tools.blockedcertsconverter.BlockedCertsConverter
|
||||
build.tools.blacklistedcertsconverter.BlacklistedCertsConverter
|
||||
|
||||
TOOL_MAKEJAVASECURITY = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.makejavasecurity.MakeJavaSecurity
|
||||
|
||||
@@ -405,7 +405,7 @@ AC_DEFUN_ONCE([BASIC_INIT],
|
||||
# Save the path variable before it gets changed
|
||||
ORIGINAL_PATH="$PATH"
|
||||
AC_SUBST(ORIGINAL_PATH)
|
||||
DATE_WHEN_CONFIGURED=`date`
|
||||
DATE_WHEN_CONFIGURED=`LANG=C date`
|
||||
AC_SUBST(DATE_WHEN_CONFIGURED)
|
||||
AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
|
||||
])
|
||||
@@ -672,16 +672,6 @@ AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Evaluates platform specific overrides for build devkit variables.
|
||||
# $1: Name of variable
|
||||
AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
|
||||
[
|
||||
if test "x[$]$1" = x; then
|
||||
eval $1="\${$1_${OPENJDK_BUILD_CPU}}"
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
|
||||
[
|
||||
|
||||
@@ -112,6 +112,7 @@ AC_DEFUN([BASIC_FIXUP_PATH_CYGWIN],
|
||||
# unix format.
|
||||
path="[$]$1"
|
||||
new_path=`$CYGPATH -u "$path"`
|
||||
|
||||
# Cygwin tries to hide some aspects of the Windows file system, such that binaries are
|
||||
# named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
|
||||
# the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
|
||||
@@ -401,19 +402,8 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
|
||||
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_BIN_W])
|
||||
$RM -rf $FIXPATH_BIN $FIXPATH_DIR
|
||||
$MKDIR -p $FIXPATH_DIR $CONFIGURESUPPORT_OUTPUTDIR/bin
|
||||
# simple cross compilation solution for fixpath for aarch64
|
||||
# Final solution should be backport of 8257679
|
||||
if test "x$COMPILE_TYPE-$OPENJDK_TARGET_CPU" = xcross-aarch64; then
|
||||
FIXPATH_CC=`$ECHO "$CC"|$SED 's|/arm64/cl|/x64/cl|I'`
|
||||
FIXPATH_LIB=`$ECHO "$LIB"|$SED 's|arm64|x64|gI'`
|
||||
else
|
||||
FIXPATH_CC=$CC
|
||||
FIXPATH_LIB=$LIB
|
||||
fi
|
||||
OLDLIB=$LIB
|
||||
export LIB="$FIXPATH_LIB"
|
||||
cd $FIXPATH_DIR
|
||||
$FIXPATH_CC $FIXPATH_SRC_W -Fe$FIXPATH_BIN_W > $FIXPATH_DIR/fixpath1.log 2>&1
|
||||
$CC $FIXPATH_SRC_W -Fe$FIXPATH_BIN_W > $FIXPATH_DIR/fixpath1.log 2>&1
|
||||
cd $CURDIR
|
||||
|
||||
if test ! -x $FIXPATH_BIN; then
|
||||
@@ -424,10 +414,9 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([if fixpath.exe works])
|
||||
cd $FIXPATH_DIR
|
||||
$FIXPATH $FIXPATH_CC $FIXPATH_SRC -Fe$FIXPATH_DIR/fixpath2.exe \
|
||||
$FIXPATH $CC $FIXPATH_SRC -Fe$FIXPATH_DIR/fixpath2.exe \
|
||||
> $FIXPATH_DIR/fixpath2.log 2>&1
|
||||
cd $CURDIR
|
||||
export LIB="$OLDLIB"
|
||||
if test ! -x $FIXPATH_DIR/fixpath2.exe; then
|
||||
AC_MSG_RESULT([no])
|
||||
cat $FIXPATH_DIR/fixpath2.log
|
||||
|
||||
20
make/autoconf/build-aux/config.guess
vendored
20
make/autoconf/build-aux/config.guess
vendored
@@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -98,23 +97,6 @@ if [ "x$OUT" = x ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix LoongArch64.
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
if [ `uname -m` = loongarch64 ]; then
|
||||
OUT=loongarch64-unknown-linux-gnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix cpu on macos-aarch64, uname -p reports arm, buildsys expects aarch64
|
||||
echo $OUT | grep arm-apple-darwin > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
if [ `uname -m` = arm64 ]; then
|
||||
OUT=aarch64`echo $OUT | sed -e 's/[^-]*//'`
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix cpu on Macosx when C preprocessor is not on the path
|
||||
echo $OUT | grep i386-apple-darwin > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
|
||||
@@ -35,7 +35,7 @@ AC_DEFUN([BPERF_CHECK_CORES],
|
||||
FOUND_CORES=yes
|
||||
elif test -x /usr/sbin/psrinfo; then
|
||||
# Looks like a Solaris system
|
||||
NUM_CORES=`/usr/sbin/psrinfo -v | grep -c on-line`
|
||||
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
|
||||
FOUND_CORES=yes
|
||||
elif test -x /usr/sbin/sysctl; then
|
||||
# Looks like a MacOSX system
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
# First include the real base spec.gmk file
|
||||
include @SPEC@
|
||||
|
||||
CC := @FIXPATH@ @BUILD_CC@
|
||||
CXX := @FIXPATH@ @BUILD_CXX@
|
||||
LD := @FIXPATH@ @BUILD_LD@
|
||||
LDCXX := @FIXPATH@ @BUILD_LDCXX@
|
||||
AS := @FIXPATH@ @BUILD_AS@
|
||||
CC := @BUILD_CC@
|
||||
CXX := @BUILD_CXX@
|
||||
LD := @BUILD_LD@
|
||||
LDCXX := @BUILD_LDCXX@
|
||||
AS := @BUILD_AS@
|
||||
NM := @BUILD_NM@
|
||||
AR := @FIXPATH@ @BUILD_AR@
|
||||
AR := @BUILD_AR@
|
||||
OBJCOPY := @BUILD_OBJCOPY@
|
||||
STRIP := @BUILD_STRIP@
|
||||
SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@
|
||||
|
||||
3
make/autoconf/configure
vendored
3
make/autoconf/configure
vendored
@@ -43,9 +43,6 @@ fi
|
||||
export CONFIG_SHELL=$BASH
|
||||
export _as_can_reexec=no
|
||||
|
||||
# Make sure all shell commands are executed with the C locale
|
||||
export LC_ALL=C
|
||||
|
||||
if test "x$CUSTOM_CONFIG_DIR" != x; then
|
||||
custom_hook=$CUSTOM_CONFIG_DIR/custom-hook.m4
|
||||
if test ! -e $custom_hook; then
|
||||
|
||||
@@ -391,6 +391,16 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS],
|
||||
CFLAGS="$CFLAGS_OLD"
|
||||
CXXFLAGS="$CXXFLAGS_OLD"
|
||||
|
||||
# Tests are only ever compiled for TARGET
|
||||
CFLAGS_TESTLIB="$CFLAGS_JDKLIB"
|
||||
CXXFLAGS_TESTLIB="$CXXFLAGS_JDKLIB"
|
||||
CFLAGS_TESTEXE="$CFLAGS_JDKEXE"
|
||||
CXXFLAGS_TESTEXE="$CXXFLAGS_JDKEXE"
|
||||
|
||||
AC_SUBST(CFLAGS_TESTLIB)
|
||||
AC_SUBST(CFLAGS_TESTEXE)
|
||||
AC_SUBST(CXXFLAGS_TESTLIB)
|
||||
AC_SUBST(CXXFLAGS_TESTEXE)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -695,9 +705,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DcpuIntel -Di586 -D$FLAGS_CPU_LEGACY_LIB"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if test "x$FLAGS_CPU" = xaarch64; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_ARM64_ -Darm64"
|
||||
elif test "x$FLAGS_CPU" = xx86_64; then
|
||||
if test "x$FLAGS_CPU" = xx86_64; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_AMD64_ -Damd64"
|
||||
else
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_X86_ -Dx86"
|
||||
@@ -707,21 +715,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
# CFLAGS PER CPU
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# COMMON to gcc and clang
|
||||
AC_MSG_CHECKING([if $1 is x86])
|
||||
if test "x$FLAGS_CPU" = xx86; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([if control flow protection is enabled by additional compiler flags])
|
||||
if echo "${EXTRA_CFLAGS}${EXTRA_CXXFLAGS}${EXTRA_ASFLAGS}" | ${GREP} -q 'fcf-protection' ; then
|
||||
# cf-protection requires CMOV and thus i686
|
||||
$1_CFLAGS_CPU="-march=i686"
|
||||
AC_MSG_RESULT([yes, forcing ${$1_CFLAGS_CPU}])
|
||||
else
|
||||
# Force compatibility with i586 on 32 bit intel platforms.
|
||||
$1_CFLAGS_CPU="-march=i586"
|
||||
AC_MSG_RESULT([no, forcing ${$1_CFLAGS_CPU}])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -51,7 +51,9 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
|
||||
|
||||
FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
|
||||
|
||||
LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}"
|
||||
LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
|
||||
LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE ${TARGET_LDFLAGS_JDK_LIBPATH}"
|
||||
AC_SUBST(LDFLAGS_TESTLIB)
|
||||
AC_SUBST(LDFLAGS_TESTEXE)
|
||||
])
|
||||
|
||||
@@ -75,7 +77,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
|
||||
# s390x : remove unused code+data in link step
|
||||
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
|
||||
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections"
|
||||
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections -Wl,--print-gc-sections"
|
||||
fi
|
||||
|
||||
BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1"
|
||||
@@ -116,7 +118,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
# Assume clang or gcc.
|
||||
# FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead.
|
||||
OS_LDFLAGS_JVM_ONLY="-Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.."
|
||||
OS_LDFLAGS="-mmacosx-version-min=$MACOSX_VERSION_MIN"
|
||||
OS_LDFLAGS_JDK_ONLY="-mmacosx-version-min=$MACOSX_VERSION_MIN"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -191,8 +193,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
# NOTE: Old build added -machine. Probably not needed.
|
||||
$1_CPU_LDFLAGS_JVM_ONLY="-machine:I386"
|
||||
$1_CPU_EXECUTABLE_LDFLAGS="-stack:327680"
|
||||
elif test "x${OPENJDK_$1_CPU}" = "xaarch64"; then
|
||||
$1_CPU_EXECUTABLE_LDFLAGS="-stack:1048576"
|
||||
else
|
||||
$1_CPU_LDFLAGS_JVM_ONLY="-machine:AMD64"
|
||||
$1_CPU_EXECUTABLE_LDFLAGS="-stack:1048576"
|
||||
@@ -201,7 +201,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
|
||||
# JVM_VARIANT_PATH depends on if this is build or target...
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
$1_LDFLAGS_JDK_LIBPATH="-libpath:\${SUPPORT_OUTPUTDIR}/modules_libs/java.base"
|
||||
$1_LDFLAGS_JDK_LIBPATH="-libpath:${OUTPUTDIR}/support/modules_libs/java.base"
|
||||
else
|
||||
$1_LDFLAGS_JDK_LIBPATH="-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
|
||||
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/${$1_JVM_VARIANT_PATH}"
|
||||
@@ -209,13 +209,13 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
|
||||
# Export variables according to old definitions, prefix with $2 if present.
|
||||
LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \
|
||||
$OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
|
||||
$OS_LDFLAGS_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
|
||||
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \
|
||||
${$1_LDFLAGS_JDK_LIBPATH} $SHARED_LIBRARY_FLAGS"
|
||||
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
|
||||
${$1_CPU_EXECUTABLE_LDFLAGS}"
|
||||
|
||||
$2JVM_LDFLAGS="$BASIC_LDFLAGS $BASIC_LDFLAGS_JVM_ONLY $OS_LDFLAGS $OS_LDFLAGS_JVM_ONLY \
|
||||
$2JVM_LDFLAGS="$BASIC_LDFLAGS $BASIC_LDFLAGS_JVM_ONLY $OS_LDFLAGS_JVM_ONLY \
|
||||
$DEBUGLEVEL_LDFLAGS $DEBUGLEVEL_LDFLAGS_JVM_ONLY $BASIC_LDFLAGS_ONLYCXX \
|
||||
${$1_CPU_LDFLAGS} ${$1_CPU_LDFLAGS_JVM_ONLY} ${$2EXTRA_LDFLAGS}"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -107,17 +107,6 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
JVM_BASIC_ASFLAGS="-x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16"
|
||||
|
||||
# Fix linker warning.
|
||||
# Code taken from make/autoconf/flags-cflags.m4 and adapted.
|
||||
JVM_BASIC_ASFLAGS="$JVM_BASIC_ASFLAGS \
|
||||
-DMAC_OS_X_VERSION_MIN_REQUIRED=$MACOSX_VERSION_MIN_NODOTS \
|
||||
-mmacosx-version-min=$MACOSX_VERSION_MIN"
|
||||
|
||||
if test -n "$MACOSX_VERSION_MAX"; then
|
||||
JVM_BASIC_ASFLAGS="$JVM_BASIC_ASFLAGS $OS_CFLAGS \
|
||||
-DMAC_OS_X_VERSION_MAX_ALLOWED=$MACOSX_VERSION_MAX_NODOTS"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -111,25 +111,19 @@ AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION],
|
||||
[
|
||||
# Additional macosx handling
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# The expected format for <version> is either nn.n.n or nn.nn.nn. See
|
||||
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h
|
||||
|
||||
# MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built
|
||||
# binaries should be compatible with, even if compiled on a newer version
|
||||
# of the OS. It currently has a hard coded value. Setting this also limits
|
||||
# exposure to API changes in header files. Bumping this is likely to
|
||||
# require code changes to build.
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = xaarch64; then
|
||||
MACOSX_VERSION_MIN=11.00.00
|
||||
else
|
||||
MACOSX_VERSION_MIN=10.9.0
|
||||
fi
|
||||
MACOSX_VERSION_MIN_NODOTS=${MACOSX_VERSION_MIN//\./}
|
||||
|
||||
AC_SUBST(MACOSX_VERSION_MIN)
|
||||
|
||||
# Setting --with-macosx-version-max=<version> makes it an error to build or
|
||||
# link to macosx APIs that are newer than the given OS version.
|
||||
# link to macosx APIs that are newer than the given OS version. The expected
|
||||
# format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h.
|
||||
AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max],
|
||||
[error on use of newer functionality. @<:@macosx@:>@])],
|
||||
[
|
||||
@@ -264,14 +258,6 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
MACHINE_FLAG="$MACHINE_FLAG -arch arm64"
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
|
||||
MACHINE_FLAG="$MACHINE_FLAG -arch x86_64"
|
||||
fi
|
||||
fi
|
||||
|
||||
# FIXME: global flags are not used yet...
|
||||
# The "global" flags will *always* be set. Without them, it is not possible to
|
||||
# get a working compilation.
|
||||
|
||||
@@ -90,7 +90,7 @@ apt_help() {
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
|
||||
openjdk)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install openjdk-11-jdk" ;;
|
||||
PKGHANDLER_COMMAND="sudo apt-get install openjdk-8-jdk" ;;
|
||||
alsa)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
|
||||
cups)
|
||||
@@ -99,8 +99,6 @@ apt_help() {
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libharfbuzz-dev" ;;
|
||||
ffi)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
|
||||
x11)
|
||||
@@ -117,7 +115,7 @@ yum_help() {
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
|
||||
openjdk)
|
||||
PKGHANDLER_COMMAND="sudo yum install java-11-openjdk-devel" ;;
|
||||
PKGHANDLER_COMMAND="sudo yum install java-1.8.0-openjdk-devel" ;;
|
||||
alsa)
|
||||
PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
|
||||
cups)
|
||||
@@ -126,8 +124,6 @@ yum_help() {
|
||||
PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo yum install harfbuzz-devel" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel" ;;
|
||||
ccache)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -221,7 +221,7 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT],
|
||||
|
||||
if test "x$ENABLE_AOT" = "xtrue"; then
|
||||
# Only enable AOT on X64 platforms.
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64" ; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
|
||||
if test -e "${TOPDIR}/src/jdk.aot"; then
|
||||
if test -e "${TOPDIR}/src/jdk.internal.vm.compiler"; then
|
||||
ENABLE_AOT="true"
|
||||
@@ -240,7 +240,7 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT],
|
||||
else
|
||||
ENABLE_AOT="false"
|
||||
if test "x$enable_aot" = "xyes"; then
|
||||
AC_MSG_ERROR([AOT is currently only supported on x86_64 and linux-aarch64. Remove --enable-aot.])
|
||||
AC_MSG_ERROR([AOT is currently only supported on x86_64 and aarch64. Remove --enable-aot.])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -278,7 +278,7 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_CDS],
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
ENABLE_CDS="false"
|
||||
if test "x$enable_cds" = "xyes"; then
|
||||
AC_MSG_ERROR([CDS is currently not supported on macOS/aarch64. Remove --enable-cds.])
|
||||
AC_MSG_ERROR([CDS is currently not supported on AIX. Remove --enable-cds.])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -363,12 +363,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
||||
# Only enable Shenandoah on supported arches, and only if requested
|
||||
AC_MSG_CHECKING([if shenandoah can be built])
|
||||
if HOTSPOT_CHECK_JVM_FEATURE(shenandoahgc); then
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
# Filter out Shenandoah from user requested features, as it's already in non-minimal set
|
||||
if HOTSPOT_CHECK_JVM_VARIANT(minimal); then
|
||||
BASIC_GET_NON_MATCHING_VALUES(JVM_FEATURES, $JVM_FEATURES, shenandoahgc)
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES shenandoahgc"
|
||||
@@ -376,7 +371,6 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
||||
fi
|
||||
else
|
||||
DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES shenandoahgc"
|
||||
AC_MSG_RESULT([no, not enabled by default])
|
||||
fi
|
||||
|
||||
# Only enable ZGC on supported platforms
|
||||
@@ -457,11 +451,10 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
||||
JVM_FEATURES_graal="graal"
|
||||
INCLUDE_GRAAL="true"
|
||||
else
|
||||
# By default enable graal build on x64/aarch64 or where AOT is available.
|
||||
# By default enable graal build on x64 or where AOT is available.
|
||||
# graal build requires jvmci.
|
||||
if test "x$JVM_FEATURES_jvmci" = "xjvmci" && \
|
||||
(test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64" || \
|
||||
test "x$ENABLE_AOT" = "xtrue") ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
JVM_FEATURES_graal="graal"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -291,7 +291,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
[AS_HELP_STRING([--with-native-debug-symbols],
|
||||
[set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
if test "x$withval" = xexternal || test "x$withval" = xzipped; then
|
||||
AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
|
||||
fi
|
||||
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
if test "x$withval" = xinternal; then
|
||||
AC_MSG_ERROR([Windows does not support the parameter 'internal' for --with-native-debug-symbols])
|
||||
fi
|
||||
@@ -300,9 +304,14 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
[
|
||||
if test "x$STATIC_BUILD" = xtrue; then
|
||||
with_native_debug_symbols="none"
|
||||
else
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# AIX doesn't support 'external' so use 'internal' as default
|
||||
with_native_debug_symbols="internal"
|
||||
else
|
||||
with_native_debug_symbols="external"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT([$with_native_debug_symbols])
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ AC_DEFUN_ONCE([LIB_SETUP_BUNDLED_LIBS],
|
||||
LIB_SETUP_LIBPNG
|
||||
LIB_SETUP_ZLIB
|
||||
LIB_SETUP_LCMS
|
||||
LIB_SETUP_HARFBUZZ
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -261,43 +260,3 @@ AC_DEFUN_ONCE([LIB_SETUP_LCMS],
|
||||
AC_SUBST(LCMS_CFLAGS)
|
||||
AC_SUBST(LCMS_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup harfbuzz
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_HARFBUZZ],
|
||||
[
|
||||
AC_ARG_WITH(harfbuzz, [AS_HELP_STRING([--with-harfbuzz],
|
||||
[use harfbuzz from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for which harfbuzz to use])
|
||||
|
||||
DEFAULT_HARFBUZZ=bundled
|
||||
# If user didn't specify, use DEFAULT_HARFBUZZ
|
||||
if test "x${with_harfbuzz}" = "x"; then
|
||||
with_harfbuzz=${DEFAULT_HARFBUZZ}
|
||||
fi
|
||||
|
||||
if test "x${with_harfbuzz}" = "xbundled"; then
|
||||
USE_EXTERNAL_HARFBUZZ=false
|
||||
HARFBUZZ_CFLAGS=""
|
||||
HARFBUZZ_LIBS=""
|
||||
AC_MSG_RESULT([bundled])
|
||||
elif test "x${with_harfbuzz}" = "xsystem"; then
|
||||
AC_MSG_RESULT([system])
|
||||
PKG_CHECK_MODULES([HARFBUZZ], [harfbuzz], [HARFBUZZ_FOUND=yes], [HARFBUZZ_FOUND=no])
|
||||
if test "x${HARFBUZZ_FOUND}" = "xyes"; then
|
||||
# PKG_CHECK_MODULES will set HARFBUZZ_CFLAGS and HARFBUZZ_LIBS
|
||||
USE_EXTERNAL_HARFBUZZ=true
|
||||
else
|
||||
HELP_MSG_MISSING_DEPENDENCY([harfbuzz])
|
||||
AC_MSG_ERROR([--with-harfbuzz=system specified, but no harfbuzz found! $HELP_MSG])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --with-harfbuzz: ${with_harfbuzz}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_HARFBUZZ)
|
||||
AC_SUBST(HARFBUZZ_CFLAGS)
|
||||
AC_SUBST(HARFBUZZ_LIBS)
|
||||
])
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user