Compare commits

..

3 Commits
236 ... 143

Author SHA1 Message Date
Vitaly Provodin
799b46db7d port dcevm fixes for JBR-3867 and JBR-3887
JBR-3867 update keys of jvmti TAG map after redefinition

JBR-3887 fix M1 dcevm SIGBUS crash by using correct var arg processing
2021-10-23 08:32:07 +07:00
Anton Tarasov
172b3a6400 include a11y test into regular runs after fixing JBR-3730 & JBR-3733 2021-10-23 08:32:02 +07:00
Vitaly Provodin
9fa58395c9 JBR-3902 create jbr_all test group 2021-10-23 08:31:59 +07:00
420 changed files with 4313 additions and 8692 deletions

View File

@@ -11,7 +11,7 @@ can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntim
| IDE Version | Latest JBR | Date Released |
| --- | --- | --- |
| 2021.3 | [17_0_1-b164.8](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17_0_1b164.8) | 15-Nov-2021 |
| 2021.3 | [17-b106.1](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17b106.1) | 28-Sep-2021 |
## Contents
- [Welcome to JetBrains Runtime](#jetbrains-runtime)

View File

@@ -96,7 +96,6 @@
<li><a href="#specific-build-issues">Specific Build Issues</a></li>
<li><a href="#getting-help">Getting Help</a></li>
</ul></li>
<li><a href="#reproducible-builds">Reproducible Builds</a></li>
<li><a href="#hints-and-suggestions-for-advanced-users">Hints and Suggestions for Advanced Users</a><ul>
<li><a href="#bash-completion">Bash Completion</a></li>
<li><a href="#using-multiple-configurations">Using Multiple Configurations</a></li>
@@ -885,32 +884,6 @@ spawn failed</code></pre>
<h3 id="getting-help">Getting Help</h3>
<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="reproducible-builds">Reproducible Builds</h2>
<p>Build reproducibility is the property of getting exactly the same bits out when building, every time, independent on who builds the product, or where. This is for many reasons a harder goal than it initially appears, but it is an important goal, for security reasons and others. Please see <a href="https://reproducible-builds.org">Reproducible Builds</a> for more information about the background and reasons for reproducible builds.</p>
<p>Currently, it is not possible to build OpenJDK fully reproducibly, but getting there is an ongoing effort. There are some things you can do to minimize non-determinism and make a larger part of the build reproducible:</p>
<ul>
<li>Turn on build system support for reproducible builds</li>
</ul>
<p>Add the flag <code>--enable-reproducible-build</code> to your <code>configure</code> command line. This will turn on support for reproducible builds where it could otherwise be lacking.</p>
<ul>
<li>Do not rely on <code>configure</code>'s default adhoc version strings</li>
</ul>
<p>Default adhoc version strings OPT segment include user name, source directory and timestamp. You can either override just the OPT segment using <code>--with-version-opt=&lt;any fixed string&gt;</code>, or you can specify the entire version string using <code>--with-version-string=&lt;your version&gt;</code>.</p>
<ul>
<li>Specify how the build sets <code>SOURCE_DATE_EPOCH</code></li>
</ul>
<p>The JDK build system will set the <code>SOURCE_DATE_EPOCH</code> environment variable during building, depending on the value of the <code>--with-source-date</code> option for <code>configure</code>. The default value is <code>updated</code>, which means that <code>SOURCE_DATE_EPOCH</code> will be set to the current time each time you are running <code>make</code>.</p>
<p>The <a href="https://reproducible-builds.org/docs/source-date-epoch/"><code>SOURCE_DATE_EPOCH</code> environment variable</a> is an industry standard, that many tools, such as gcc, recognize, and use in place of the current time when generating output.</p>
<p>For reproducible builds, you need to set this to a fixed value. You can use the special value <code>version</code> which will use the nominal release date for the current JDK version, or a value describing a date, either an epoch based timestamp as an integer, or a valid ISO-8601 date.</p>
<p><strong>Hint:</strong> If your build environment already sets <code>SOURCE_DATE_EPOCH</code>, you can propagate this using <code>--with-source-date=$SOURCE_DATE_EPOCH</code>.</p>
<ul>
<li>Specify a hotspot build time</li>
</ul>
<p>Set a fixed hotspot build time. This will be included in the hotspot library (<code>libjvm.so</code> or <code>jvm.dll</code>) and defaults to the current time when building hotspot. Use <code>--with-hotspot-build-time=&lt;any fixed string&gt;</code> for reproducible builds. It's a string so you don't need to format it specifically, so e.g. <code>n/a</code> will do. Another solution is to use the <code>SOURCE_DATE_EPOCH</code> variable, e.g. <code>--with-hotspot-build-time=$(date --date=@$SOURCE_DATE_EPOCH)</code>.</p>
<ul>
<li>Copyright year</li>
</ul>
<p>The copyright year in some generated text files are normally set to the current year. This can be overridden by <code>--with-copyright-year=&lt;year&gt;</code>. For fully reproducible builds, this needs to be set to a fixed value.</p>
<h2 id="hints-and-suggestions-for-advanced-users">Hints and Suggestions for Advanced Users</h2>
<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>&lt;tab&gt;</code> or <code>&lt;tab&gt;&lt;tab&gt;</code>). To use this functionality, make sure you enable completion in your <code>~/.bashrc</code> (see instructions for bash in your operating system).</p>

View File

@@ -1503,68 +1503,6 @@ If you need general help or advice about developing for the JDK, you can also
contact the Adoption Group. See the section on [Contributing to OpenJDK](
#contributing-to-openjdk) for more information.
## Reproducible Builds
Build reproducibility is the property of getting exactly the same bits out when
building, every time, independent on who builds the product, or where. This is
for many reasons a harder goal than it initially appears, but it is an important
goal, for security reasons and others. Please see [Reproducible Builds](
https://reproducible-builds.org) for more information about the background and
reasons for reproducible builds.
Currently, it is not possible to build OpenJDK fully reproducibly, but getting
there is an ongoing effort. There are some things you can do to minimize
non-determinism and make a larger part of the build reproducible:
* Turn on build system support for reproducible builds
Add the flag `--enable-reproducible-build` to your `configure` command line.
This will turn on support for reproducible builds where it could otherwise be
lacking.
* Do not rely on `configure`'s default adhoc version strings
Default adhoc version strings OPT segment include user name, source directory
and timestamp. You can either override just the OPT segment using
`--with-version-opt=<any fixed string>`, or you can specify the entire version
string using `--with-version-string=<your version>`.
* Specify how the build sets `SOURCE_DATE_EPOCH`
The JDK build system will set the `SOURCE_DATE_EPOCH` environment variable
during building, depending on the value of the `--with-source-date` option for
`configure`. The default value is `updated`, which means that
`SOURCE_DATE_EPOCH` will be set to the current time each time you are running
`make`.
The [`SOURCE_DATE_EPOCH` environment variable](
https://reproducible-builds.org/docs/source-date-epoch/) is an industry
standard, that many tools, such as gcc, recognize, and use in place of the
current time when generating output.
For reproducible builds, you need to set this to a fixed value. You can use the
special value `version` which will use the nominal release date for the current
JDK version, or a value describing a date, either an epoch based timestamp as an
integer, or a valid ISO-8601 date.
**Hint:** If your build environment already sets `SOURCE_DATE_EPOCH`, you can
propagate this using `--with-source-date=$SOURCE_DATE_EPOCH`.
* Specify a hotspot build time
Set a fixed hotspot build time. This will be included in the hotspot library
(`libjvm.so` or `jvm.dll`) and defaults to the current time when building
hotspot. Use `--with-hotspot-build-time=<any fixed string>` for reproducible
builds. It's a string so you don't need to format it specifically, so e.g. `n/a`
will do. Another solution is to use the `SOURCE_DATE_EPOCH` variable, e.g.
`--with-hotspot-build-time=$(date --date=@$SOURCE_DATE_EPOCH)`.
* Copyright year
The copyright year in some generated text files are normally set to the current
year. This can be overridden by `--with-copyright-year=<year>`. For fully
reproducible builds, this needs to be set to a fixed value.
## Hints and Suggestions for Advanced Users
### Bash Completion

View File

@@ -1,47 +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/ubuntu:focal-20211006
# Install the necessary build tools
RUN export DEBIAN_FRONTEND=noninteractive \
export DEBCONF_NONINTERACTIVE_SEEN=true && \
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
apt-get update -qy && \
apt-get install -qy \
autoconf \
build-essential \
bzip2 \
file \
g++-10=10.3.0-1ubuntu1~20.04 \
gcc-10=10.3.0-1ubuntu1~20.04 \
git \
libasound2-dev \
libcups2-dev \
libfontconfig1-dev \
libx11-dev \
libxext-dev \
libxrandr-dev \
libxrender-dev \
libxt-dev \
libxtst-dev \
make \
tar \
unzip \
zip && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
apt-get clean -qy && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set up boot JDK for building
COPY boot_jdk.tar.gz /jdk17/
RUN cd /jdk17 && tar --strip-components=1 -xzf boot_jdk.tar.gz && rm /jdk17/boot_jdk.tar.gz
ENV BOOT_JDK=/jdk17
RUN git config --global user.email "teamcity@jetbrains.com" && \
git config --global user.name "builduser"

View File

@@ -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.
sha256sum -c - <<EOF
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
EOF
docker build -t jbr17buildenv -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.

View File

@@ -6,38 +6,6 @@ do_reset_changes=0
do_reset_dcevm=0
HEAD_REVISION=0
OS_NAME=$(uname -s)
# Enable reproducible builds
TZ=UTC
export TZ
SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)"
export SOURCE_DATE_EPOCH
USER=builduser
export USER
case "$OS_NAME" in
Linux)
COPYRIGHT_YEAR="$(date --utc --date=@$SOURCE_DATE_EPOCH +%Y)"
BUILD_TIME="$(date --utc --date=@$SOURCE_DATE_EPOCH +%F)"
REPRODUCIBLE_TAR_OPTS="--mtime=@$SOURCE_DATE_EPOCH --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"
;;
Darwin)
COPYRIGHT_YEAR="$(date -u -r $SOURCE_DATE_EPOCH +%Y)"
BUILD_TIME="$(date -u -r $SOURCE_DATE_EPOCH +%F)"
TOUCH_TIME="$(date -u -r $SOURCE_DATE_EPOCH +%Y%m%d%H%M.%S)"
REPRODUCIBLE_TAR_OPTS="--uid 0 --gid 0 --numeric-owner"
;;
*)
# TODO: Windows
;;
esac
REPRODUCIBLE_BUILD_OPTS="--enable-reproducible-build
--with-source-date=$SOURCE_DATE_EPOCH
--with-hotspot-build-time=$BUILD_TIME
--with-copyright-year=$COPYRIGHT_YEAR
--with-native-debug-symbols=none"
function do_exit() {
exit_code=$1
[ $do_reset_changes -eq 1 ] && git checkout HEAD modules.list src/java.desktop/share/classes/module-info.java

View File

@@ -24,6 +24,8 @@ source jb/project/tools/common/scripts/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
sh configure \
--with-debug-level=release \
--with-vendor-name="${VENDOR_NAME}" \
@@ -33,9 +35,7 @@ sh configure \
--with-version-build="${JDK_BUILD_NUMBER}" \
--with-version-opt=b${build_number} \
--with-boot-jdk=${BOOT_JDK} \
--enable-cds=yes \
$REPRODUCIBLE_BUILD_OPTS \
|| exit $?
--enable-cds=yes || exit $?
make clean CONF=linux-aarch64-server-release || exit $?
make images CONF=linux-aarch64-server-release test-image || exit $?
@@ -54,11 +54,9 @@ echo Creating $JBSDK.tar.gz ...
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
# NB: --sort=name requires tar1.28
tar $REPRODUCIBLE_TAR_OPTS --sort=name -pcf $JBSDK.tar \
tar -pcf $JBSDK.tar \
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
touch -c -d @$SOURCE_DATE_EPOCH $JBRSDK.tar
gzip $JBSDK.tar || exit $?
JBR_BUNDLE=jbr
@@ -77,11 +75,10 @@ echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
echo Creating $JBR.tar.gz ...
tar $REPRODUCIBLE_TAR_OPTS --sort=name -pcf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
touch -c -d @$SOURCE_DATE_EPOCH $JBR.tar
tar -pcf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
gzip $JBR.tar || exit $?
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 $?
gzip $JBRSDK_TEST.tar || exit $?

View File

@@ -21,16 +21,6 @@
# 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
@@ -40,21 +30,6 @@ JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
source jb/project/tools/common/scripts/common.sh
function do_configure {
sh configure \
$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" \
--enable-cds=yes \
$REPRODUCIBLE_BUILD_OPTS \
|| do_exit $?
}
function create_image_bundle {
__bundle_name=$1
__arch_name=$2
@@ -81,14 +56,8 @@ function create_image_bundle {
[ -f "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper
echo Creating "$JBR".tar.gz ...
(cd "$IMAGES_DIR" &&
find "$__arch_name" -print0 | LC_ALL=C sort -z | \
tar $REPRODUCIBLE_TAR_OPTS \
--no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
tar -pcf "$JBR".tar -C "$IMAGES_DIR" "$__arch_name" || do_exit $?
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
gzip "$JBR".tar || do_exit $?
rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
}
@@ -116,10 +85,18 @@ case "$bundle_type" in
;;
esac
if [ -z "$INC_BUILD" ]; then
do_configure || do_exit $?
make clean CONF=$RELEASE_NAME || do_exit $?
fi
sh configure \
$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" \
--enable-cds=yes || do_exit $?
make clean CONF=$RELEASE_NAME || exit $?
make images CONF=$RELEASE_NAME || do_exit $?
IMAGES_DIR=build/$RELEASE_NAME/images
@@ -158,4 +135,4 @@ if [ -z "$bundle_type" ]; then
gzip "$JBRSDK_TEST".tar || do_exit $?
fi
do_exit 0
do_exit 0

View File

@@ -20,18 +20,6 @@
# Environment variables:
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_mac
# MACOSX_VERSION_MAX - specifies value for the --with-macosx-version-max parameter. By default it is 10.12.00 for x64
# and 11.00.00 for 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
@@ -43,48 +31,15 @@ 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}
architecture=${architecture:=x64}
MAJOR_JBSDK_VERSION=$(echo "$JBSDK_VERSION_WITH_DOTS" | awk -F "." '{print $1}')
BOOT_JDK=${BOOT_JDK:=$(/usr/libexec/java_home -v 16)}
source jb/project/tools/common/scripts/common.sh
function do_configure {
if [[ "${architecture}" == *aarch64* ]]; then
sh configure \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-macosx-bundle-name-base=${VENDOR_VERSION_STRING} \
--with-macosx-bundle-id-base="com.jetbrains.jbr" \
--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-macosx-version-max="${MACOSX_VERSION_MAX:="11.00.00"}" \
--disable-hotspot-gtest --disable-javac-server --disable-full-docs --disable-manpages \
--enable-cds=no \
--with-extra-cflags="-F$(pwd)/Frameworks" \
--with-extra-cxxflags="-F$(pwd)/Frameworks" \
--with-extra-ldflags="-F$(pwd)/Frameworks" \
$REPRODUCIBLE_BUILD_OPTS \
|| do_exit $?
else
sh configure \
$WITH_DEBUG_LEVEL \
--with-vendor-name="$VENDOR_NAME" \
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
--with-macosx-bundle-name-base=${VENDOR_VERSION_STRING} \
--with-macosx-bundle-id-base="com.jetbrains.jbr" \
--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-macosx-version-max="${MACOSX_VERSION_MAX:="10.12.00"}" \
--enable-cds=yes \
$REPRODUCIBLE_BUILD_OPTS \
|| do_exit $?
fi
function copyJNF {
__contents_dir=$1
mkdir -p ${__contents_dir}/Frameworks
cp -Rp Frameworks/JavaNativeFoundation.framework ${__contents_dir}/Frameworks
}
function create_image_bundle {
@@ -117,17 +72,16 @@ function create_image_bundle {
cp -R "$JSDK"/../MacOS "$JRE_CONTENTS"
cp "$JSDK"/../Info.plist "$JRE_CONTENTS"
if [[ "${architecture}" == *aarch64* ]]; then
# we can't notarize this library as usual framework (with headers and tbd-file)
# but single library notarizes correctly
copyJNF $JRE_CONTENTS
fi
[ -n "$bundle_type" ] && (cp -a $JCEF_PATH/Frameworks "$JRE_CONTENTS" || do_exit $?)
echo Creating "$JBR".tar.gz ...
# Normalize timestamp
find "$tmp"/"$__arch_name" -print0 | xargs -0 touch -c -h -t "$TOUCH_TIME"
(cd "$tmp" &&
find "$__arch_name" -print0 | LC_ALL=C sort -z | \
COPYFILE_DISABLE=1 tar $REPRODUCIBLE_TAR_OPTS --no-recursion --null -T - \
-czf "$JBR".tar.gz --exclude='*.dSYM' --exclude='man') || do_exit $?
mv "$tmp"/"$JBR".tar.gz "$JBR".tar.gz
COPYFILE_DISABLE=1 tar -pczf "$JBR".tar.gz --exclude='*.dSYM' --exclude='man' -C "$tmp" "$__arch_name" || do_exit $?
rm -rf "$tmp"
}
@@ -159,18 +113,38 @@ case "$bundle_type" in
;;
esac
if [ -z "$INC_BUILD" ]; then
do_configure || do_exit $?
make clean CONF=$RELEASE_NAME || do_exit $?
if [[ "${architecture}" == *aarch64* ]]; then
sh configure \
$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" \
--disable-hotspot-gtest --disable-javac-server --disable-full-docs --disable-manpages \
--enable-cds=no \
--with-extra-cflags="-F$(pwd)/Frameworks" \
--with-extra-cxxflags="-F$(pwd)/Frameworks" \
--with-extra-ldflags="-F$(pwd)/Frameworks" || do_exit $?
else
sh configure \
$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" \
--enable-cds=yes || do_exit $?
fi
make clean CONF=$RELEASE_NAME || do_exit $?
make images CONF=$RELEASE_NAME || do_exit $?
IMAGES_DIR=build/$RELEASE_NAME/images
major_version=$(echo "$JBSDK_VERSION_WITH_DOTS" | awk -F "." '{print $1}')
minor_version=$(echo "$JBSDK_VERSION_WITH_DOTS" | awk -F "." '{print $3}')
[ -z "$minor_version" -o "$minor_version" = "0" ] && version_dir=$major_version || version_dir=$JBSDK_VERSION_WITH_DOTS
JSDK=$IMAGES_DIR/jdk-bundle/jdk-$version_dir.jdk/Contents/Home
JSDK=$IMAGES_DIR/jdk-bundle/jdk-$MAJOR_JBSDK_VERSION.jdk/Contents/Home
JSDK_MODS_DIR=$IMAGES_DIR/jmods
JBRSDK_BUNDLE=jbrsdk
@@ -201,4 +175,4 @@ if [ -z "$bundle_type" ]; then
COPYFILE_DISABLE=1 tar -pczf "$JBRSDK_TEST".tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
fi
do_exit 0
do_exit 0

View File

@@ -1,4 +1,4 @@
#!/bin/bash -x
#!/bin/bash
APP_DIRECTORY=$1
APPL_USER=$2
@@ -54,15 +54,17 @@ function altool-upload() {
#immediately exit script with an error if a command fails
set -euo pipefail
#file="$APP_NAME.zip"
file="$APP_NAME.zip"
#log "Zipping $file..."
#rm -rf "$file"
#ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY" "$file"
log "Zipping $file..."
rm -rf "$file"
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY" "$file"
log "Notarizing $APP_NAME..."
log "Notarizing $file..."
rm -rf "altool.init.out" "altool.check.out"
altool-upload "$APP_NAME"
altool-upload "$file"
rm -rf "$file"
notarization_info="$(grep -e "RequestUUID" "altool.init.out" | grep -oE '([0-9a-f-]{36})')"

View File

@@ -1,17 +1,14 @@
#!/bin/bash -x
#!/bin/bash
APPLICATION_PATH=$1
APP_NAME=$2
BUNDLE_ID=$3
JB_DEVELOPER_CERT=$4
JB_INSTALLER_CERT=$5
APP_DIRECTORY=$1
JB_CERT=$2
if [[ -z "$APPLICATION_PATH" ]] || [[ -z "$JB_DEVELOPER_CERT" ]]; then
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$JB_CERT" ]]; then
echo "Usage: $0 AppDirectory CertificateID"
exit 1
fi
if [[ ! -d "$APPLICATION_PATH" ]]; then
echo "AppDirectory '$APPLICATION_PATH' does not exist or not a directory"
if [[ ! -d "$APP_DIRECTORY" ]]; then
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
exit 1
fi
@@ -23,30 +20,43 @@ function log() {
set -euo pipefail
# Cleanup files left from previous sign attempt (if any)
find "$APPLICATION_PATH" -name '*.cstemp' -exec rm '{}' \;
find "$APP_DIRECTORY" -name '*.cstemp' -exec rm '{}' \;
log "Signing libraries and executables..."
# -perm +111 searches for executables
for f in \
"Contents/Home/lib" "Contents/MacOS" \
"Contents/Home/Frameworks" \
"Contents/Frameworks"; do
if [ -d "$APPLICATION_PATH/$f" ]; then
find "$APPLICATION_PATH/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "*.node" -o -perm +111 \) \
-exec codesign --timestamp \
-v -s "$JB_DEVELOPER_CERT" --options=runtime --force \
"Contents/Home/bin" \
"Contents/Home/lib"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
-exec codesign --timestamp --force \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
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
# `-e` prevents `grep -q && printf` loginc
# with `-o pipefail` there's no input for 'while' loop
find "$APPLICATION_PATH" -name '*.jar' \
-exec sh -c "set -u; unzip -l \"\$0\" | grep -q -e '\.dylib\$' -e '\.jnilib\$' -e '\.so\$' -e '\.tbd\$' -e '^jattach\$' && printf \"\$0\0\" " {} \; |
find "$APP_DIRECTORY" -name '*.jar' \
-exec sh -c "set -u; unzip -l \"\$0\" | grep -q -e '\.dylib\$' -e '\.jnilib\$' -e '\.so\$' -e '^jattach\$' && printf \"\$0\0\" " {} \; |
while IFS= read -r -d $'\0' file; do
log "Processing libraries in $file"
@@ -57,13 +67,12 @@ find "$APPLICATION_PATH" -name '*.jar' \
cp "$file" jarfolder && (cd jarfolder && jar xf "$filename" && rm "$filename")
find jarfolder \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "jattach" \) \
-exec codesign --timestamp \
--force \
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "jattach" \) \
-exec codesign --timestamp --force \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
(cd jarfolder; zip -q -r -o -0 ../jar.jar .)
(cd jarfolder; zip -q -r -o ../jar.jar .)
mv jar.jar "$file"
done
@@ -71,41 +80,28 @@ rm -rf jarfolder jar.jar
log "Signing other files..."
for f in \
"Contents/Home/bin"; do
if [ -d "$APPLICATION_PATH/$f" ]; then
find "$APPLICATION_PATH/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -perm +111 \) \
-exec codesign --timestamp \
-v -s "$JB_DEVELOPER_CERT" --options=runtime --force \
"Contents/MacOS"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
-exec codesign --timestamp --force \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
fi
done
#log "Signing executable..."
#codesign --timestamp \
# -v -s "$JB_DEVELOPER_CERT" --options=runtime \
# -v -s "$JB_CERT" --options=runtime \
# --force \
# --entitlements entitlements.xml "$APPLICATION_PATH/Contents/MacOS/idea"
# --entitlements entitlements.xml "$APP_DIRECTORY/Contents/MacOS/idea"
log "Signing whole app..."
codesign --timestamp \
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
-v -s "$JB_CERT" --options=runtime \
--force \
--entitlements entitlements.xml "$APPLICATION_PATH"
BUILD_NAME=$(echo $APPLICATION_PATH | awk -F"/" '{ print $2 }')
log "Creating $APP_NAME.pkg..."
rm -rf "$APP_NAME.pkg"
pkgbuild --identifier $BUNDLE_ID --sign "$JB_INSTALLER_CERT" --root $APPLICATION_PATH \
--install-location /Library/Java/JavaVirtualMachines/${BUILD_NAME} ${APP_NAME}.pkg
#log "Signing whole app..."
#codesign --timestamp \
# -v -s "$JB_DEVELOPER_CERT" --options=runtime \
# --force \
# --entitlements entitlements.xml $APP_NAME.pkg
--entitlements entitlements.xml "$APP_DIRECTORY"
log "Verifying java is not broken"
find "$APPLICATION_PATH" \
find "$APP_DIRECTORY" \
-type f -name 'java' -perm +111 -exec {} -version \;

View File

@@ -12,9 +12,8 @@ BACKUP_JMODS=$2.backup
USERNAME=$3
PASSWORD=$4
CODESIGN_STRING=$5
JB_INSTALLER_CERT=$6
NOTARIZE=$7
BUNDLE_ID=$8
NOTARIZE=$6
BUNDLE_ID=$7
cd "$(dirname "$0")"
@@ -34,7 +33,7 @@ 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
sed -i '' s/BNDL/APPL/ $EXPLODED/$BUILD_NAME/Contents/Info.plist
rm -f $EXPLODED/$BUILD_NAME/Contents/CodeResources
rm "$INPUT_FILE"
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/jmods; then
@@ -43,9 +42,7 @@ fi
log "$INPUT_FILE extracted and removed"
APP_NAME=$(echo ${INPUT_FILE} | awk -F".tar" '{ print $1 }')
APPLICATION_PATH=$(sed "s/osx-//" <<< "$EXPLODED/$APP_NAME")
mv $EXPLODED/$BUILD_NAME $APPLICATION_PATH
APPLICATION_PATH="$EXPLODED/$BUILD_NAME"
find "$APPLICATION_PATH/Contents/Home/bin" \
-maxdepth 1 -type f -name '*.jnilib' -print0 |
@@ -82,7 +79,7 @@ limit=3
set +e
while [[ $attempt -le $limit ]]; do
log "Signing (attempt $attempt) $APPLICATION_PATH ..."
./sign.sh "$APPLICATION_PATH" "$APP_NAME" "$BUNDLE_ID" "$CODESIGN_STRING" "$JB_INSTALLER_CERT"
./sign.sh "$APPLICATION_PATH" "$CODESIGN_STRING"
ec=$?
if [[ $ec -ne 0 ]]; then
((attempt += 1))
@@ -95,7 +92,6 @@ while [[ $attempt -le $limit ]]; do
log "Signing done"
codesign -v "$APPLICATION_PATH" -vvvvv
log "Check sign done"
spctl -a -v $APPLICATION_PATH
((attempt += limit))
fi
done
@@ -106,12 +102,13 @@ if [ "$NOTARIZE" = "yes" ]; then
log "Notarizing..."
# shellcheck disable=SC1090
source "$HOME/.notarize_token"
APP_NAME=$(echo ${INPUT_FILE} | awk -F"." '{ print $1 }')
# Since notarization tool uses same file for upload token we have to trick it into using different folders, hence fake root
# Also it leaves copy of zip file in TMPDIR, so notarize.sh overrides it and uses FAKE_ROOT as location for temp TMPDIR
FAKE_ROOT="$(pwd)/fake-root"
mkdir -p "$FAKE_ROOT"
echo "Notarization will use fake root: $FAKE_ROOT"
./notarize.sh "$APPLICATION_PATH" "$APPLE_USERNAME" "$APPLE_PASSWORD" "$APP_NAME.pkg" "$BUNDLE_ID" "$FAKE_ROOT"
./notarize.sh "$APPLICATION_PATH" "$APPLE_USERNAME" "$APPLE_PASSWORD" "$APP_NAME" "$BUNDLE_ID" "$FAKE_ROOT"
rm -rf "$FAKE_ROOT"
set +e
@@ -127,11 +124,10 @@ log "Zipping $BUILD_NAME to $INPUT_FILE ..."
#cd "$EXPLODED"
#ditto -c -k --sequesterRsrc --keepParent "$BUILD_NAME" "../$INPUT_FILE"
if test -d $BACKUP_JMODS/jmods; then
mv $BACKUP_JMODS/jmods $APPLICATION_PATH/Contents/Home
mv $BACKUP_JMODS/jmods $EXPLODED/$BUILD_NAME/Contents/Home
fi
mv $APPLICATION_PATH $EXPLODED/$BUILD_NAME
tar -pczvf $INPUT_FILE --exclude='man' -C $EXPLODED $BUILD_NAME
tar -pczvf $INPUT_FILE --exclude='*.dSYM' --exclude='man' -C $EXPLODED $BUILD_NAME
log "Finished zipping"
)
rm -rf "$EXPLODED"

View File

@@ -1,7 +1,7 @@
From b936da7d9d3572a4ded40a5ba74d51dead91e832 Mon Sep 17 00:00:00 2001
From 51f91f7ccd3638360afcc8333d086bd2d5852b0e Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 14 Nov 2018 21:09:39 +0100
Subject: [PATCH 01/45] Apply basic dcevm11 patch
Subject: [PATCH 01/42] Apply basic dcevm11 patch
---
src/hotspot/share/ci/ciObjectFactory.cpp | 25 +
@@ -125,7 +125,7 @@ index 83f4bcf248f..fdefc8e3b92 100644
#endif // SHARE_CI_CIOBJECTFACTORY_HPP
diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp
index 0999d7dced7..14e86466cda 100644
index 41da1214f2b..906798b029d 100644
--- a/src/hotspot/share/classfile/classFileParser.cpp
+++ b/src/hotspot/share/classfile/classFileParser.cpp
@@ -852,6 +852,8 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
@@ -137,7 +137,7 @@ index 0999d7dced7..14e86466cda 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)",
@@ -4017,7 +4019,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
@@ -4010,7 +4012,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()) {
@@ -146,7 +146,7 @@ index 0999d7dced7..14e86466cda 100644
if (need_verify)
is_array = super_klass->is_array_klass();
} else if (need_verify) {
@@ -4157,7 +4159,10 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
@@ -4150,7 +4152,10 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
if (!_has_empty_finalizer) {
if (_has_finalizer ||
(super != NULL && super->has_finalizer())) {
@@ -158,7 +158,7 @@ index 0999d7dced7..14e86466cda 100644
}
}
@@ -5504,6 +5509,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
@@ -5497,6 +5502,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
ClassLoaderData* loader_data,
const ClassLoadInfo* cl_info,
Publicity pub_level,
@@ -166,7 +166,7 @@ index 0999d7dced7..14e86466cda 100644
TRAPS) :
_stream(stream),
_class_name(NULL),
@@ -5562,7 +5568,8 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
@@ -5555,7 +5561,8 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
_has_finalizer(false),
_has_empty_finalizer(false),
_has_vanilla_constructor(false),
@@ -176,7 +176,7 @@ index 0999d7dced7..14e86466cda 100644
_class_name = name != NULL ? name : vmSymbols::unknown_class_name();
_class_name->increment_refcount();
@@ -5961,14 +5968,15 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
@@ -5954,14 +5961,15 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
CHECK);
}
Handle loader(THREAD, _loader_data->class_loader());
@@ -843,7 +843,7 @@ index f4d40685ddc..0c774dfeb51 100644
Handle class_loader,
InstanceKlass* k, TRAPS);
diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp
index 9bebe3a5faf..d3045ca69f9 100644
index 47468a16a20..bbabe2976bf 100644
--- a/src/hotspot/share/classfile/verifier.cpp
+++ b/src/hotspot/share/classfile/verifier.cpp
@@ -270,7 +270,7 @@ bool Verifier::is_eligible_for_verification(InstanceKlass* klass, bool should_ve
@@ -5674,7 +5674,7 @@ index 233608bc7b1..b934302f422 100644
// RedefineClasses support
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index cdc67e970bf..69d319e1f29 100644
index 208d8a04f73..ee8d2d11ce4 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -964,7 +964,8 @@ bool InstanceKlass::link_class_impl(TRAPS) {
@@ -5771,7 +5771,7 @@ index cdc67e970bf..69d319e1f29 100644
#ifndef PRODUCT
void InstanceKlass::print_dependent_nmethods(bool verbose) {
dependencies().print_dependent_nmethods(verbose);
@@ -3745,7 +3794,7 @@ void InstanceKlass::verify_on(outputStream* st) {
@@ -3733,7 +3782,7 @@ void InstanceKlass::verify_on(outputStream* st) {
}
guarantee(sib->is_klass(), "should be klass");

View File

@@ -1,7 +1,7 @@
From 269611e5ccc24a29685bd38aff50c9681506dd26 Mon Sep 17 00:00:00 2001
From 53a078caced2b0812e45cf2586b5e9036ee142ae Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 14 Nov 2018 21:18:22 +0100
Subject: [PATCH 02/45] dcevm11 fixes
Subject: [PATCH 02/42] dcevm11 fixes
1. We need to set classRedefinitionCount on new class, not old class.
@@ -89,7 +89,7 @@ dmh
delete mode 100644 src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp
diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp
index 14e86466cda..a7bbb0252dc 100644
index 906798b029d..e1dfda7d26b 100644
--- a/src/hotspot/share/classfile/classFileParser.cpp
+++ b/src/hotspot/share/classfile/classFileParser.cpp
@@ -852,6 +852,7 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
@@ -100,7 +100,7 @@ index 14e86466cda..a7bbb0252dc 100644
interf = (Klass *) maybe_newest(interf);
if (!interf->is_interface()) {
@@ -4019,6 +4020,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
@@ -4012,6 +4013,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()) {
@@ -108,7 +108,7 @@ index 14e86466cda..a7bbb0252dc 100644
super_klass = InstanceKlass::cast(maybe_newest(cp->resolved_klass_at(super_class_index)));
if (need_verify)
is_array = super_klass->is_array_klass();
@@ -4159,7 +4161,7 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
@@ -4152,7 +4154,7 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
if (!_has_empty_finalizer) {
if (_has_finalizer ||
(super != NULL && super->has_finalizer())) {
@@ -4365,7 +4365,7 @@ index 9c1961619c1..167cb274661 100644
}
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 69d319e1f29..db5b8da58fc 100644
index ee8d2d11ce4..9327652d8fe 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -1275,6 +1275,15 @@ void InstanceKlass::init_implementor() {
@@ -4423,7 +4423,7 @@ index 69d319e1f29..db5b8da58fc 100644
bool InstanceKlass::update_jmethod_id(Method* method, jmethodID newMethodID) {
size_t idnum = (size_t)method->method_idnum();
jmethodID* jmeths = methods_jmethod_ids_acquire();
@@ -3794,6 +3804,7 @@ void InstanceKlass::verify_on(outputStream* st) {
@@ -3782,6 +3792,7 @@ void InstanceKlass::verify_on(outputStream* st) {
}
guarantee(sib->is_klass(), "should be klass");

View File

@@ -1,7 +1,7 @@
From 9b18096f241be0350245868e8cf26729f6c3d110 Mon Sep 17 00:00:00 2001
From 6e99aea309783dab138d3789b0039128bcc7344a Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 11 Mar 2020 14:19:34 +0100
Subject: [PATCH 03/45] Fix class cast exception on redefinition of class A,
Subject: [PATCH 03/42] 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 03/45] 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 db5b8da58fc..6d9e5116df1 100644
index 9327652d8fe..c18a5822939 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -908,7 +908,10 @@ bool InstanceKlass::link_class_impl(TRAPS) {

View File

@@ -1,7 +1,7 @@
From 784dd5e16922110b0ee802d5bf1063e2b94499bc Mon Sep 17 00:00:00 2001
From 146b85fb6af764594999cb9922fd820798f3e9cc Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 4 Oct 2020 21:12:12 +0200
Subject: [PATCH 04/45] Support for Lambda class redefinition
Subject: [PATCH 04/42] Support for Lambda class redefinition
---
.../share/classfile/classLoaderData.cpp | 9 +++

View File

@@ -1,7 +1,7 @@
From 97ab12615a56e90993b5df4615c6dbd7eb856ebb Mon Sep 17 00:00:00 2001
From 57d2451903b84dfc772cc0bf6957a52ee5e8c0f3 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 23 May 2020 10:02:15 +0200
Subject: [PATCH 05/45] Fix "no original bytecode found" error if method with
Subject: [PATCH 05/42] Fix "no original bytecode found" error if method with
bkp is missing
Sometimes IDE can deploy class with erroneous method, such method has

View File

@@ -1,7 +1,7 @@
From cb8d0e41bed94d0c8b8a4c51f692a4ca66dc3672 Mon Sep 17 00:00:00 2001
From d606e7de6dfe1204128a8ac034d8f57ad6130e0a Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 24 May 2020 12:07:42 +0200
Subject: [PATCH 06/45] Replace deleted method with
Subject: [PATCH 06/42] Replace deleted method with
Universe::throw_no_such_method_error
+ Change log level in advanced redefinition

View File

@@ -1,7 +1,7 @@
From cfd0e2b3070e7ad75bcf3f320b2c35ac432f9ee9 Mon Sep 17 00:00:00 2001
From 2365d0dc56b6b28ee3355e89ecf981a42fdfe440 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Jun 2020 17:43:52 +0200
Subject: [PATCH 07/45] Support for G1 gc
Subject: [PATCH 07/42] Support for G1 gc
---
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 23 +++

View File

@@ -1,7 +1,7 @@
From 74de59c61db380a0e1c85686714bd9a3f1b29210 Mon Sep 17 00:00:00 2001
From e818e4a83fafc07142b7b7279c633823d5d8ab23 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Tue, 6 Oct 2020 22:15:31 +0200
Subject: [PATCH 08/45] AllowEnhancedClassRedefinition is false (disabled) by
Subject: [PATCH 08/42] AllowEnhancedClassRedefinition is false (disabled) by
default
---

View File

@@ -1,7 +1,7 @@
From c00c2a58550ae33ab2c842b521bf3b73163a93a1 Mon Sep 17 00:00:00 2001
From 737c3616d674224661dd8751861f0365d9591d80 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Mon, 19 Oct 2020 20:00:04 +0200
Subject: [PATCH 09/45] Set HOTSPOT_VM_DISTRO=Dynamic Code Evolution
Subject: [PATCH 09/42] Set HOTSPOT_VM_DISTRO=Dynamic Code Evolution
---
make/autoconf/version-numbers | 55 +++++++++++++++++++++++++++++++++++

View File

@@ -1,7 +1,7 @@
From c04d57e5278aa5d3cb6ef53fc161d2b6b4f19f3c Mon Sep 17 00:00:00 2001
From b14f6ba2d743aacf15dedfe8ad677f176683d51c Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 23 Oct 2020 10:20:26 +0200
Subject: [PATCH 10/45] Clear dcevm code separation
Subject: [PATCH 10/42] Clear dcevm code separation
---
src/hotspot/share/classfile/systemDictionary.cpp | 3 +--
@@ -132,7 +132,7 @@ index b934302f422..d7ae5edc7b3 100644
void set_field( // sets entry to resolved field state
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 6d9e5116df1..1e2b40dd1f2 100644
index c18a5822939..994f6bf266f 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -968,7 +968,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
@@ -153,7 +153,7 @@ index 6d9e5116df1..1e2b40dd1f2 100644
wait = true;
jt->set_class_to_be_initialized(this);
ol.wait_uninterruptibly(jt);
@@ -3808,7 +3808,7 @@ void InstanceKlass::verify_on(outputStream* st) {
@@ -3796,7 +3796,7 @@ void InstanceKlass::verify_on(outputStream* st) {
guarantee(sib->is_klass(), "should be klass");
// TODO: (DCEVM) explain

View File

@@ -1,7 +1,7 @@
From 3e9df9bdd901f1a7f7af57f2d37a738c059e3bb3 Mon Sep 17 00:00:00 2001
From 3957393df0bd440fe90f4a8eea007b3354a45b98 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 11 Nov 2020 18:45:15 +0100
Subject: [PATCH 11/45] Fix LoadedClassesClosure - fixes problems with remote
Subject: [PATCH 11/42] Fix LoadedClassesClosure - fixes problems with remote
debugging
---

View File

@@ -1,7 +1,7 @@
From 9b3a0f4afda0051f7c653162ff4192d55ecceb4f Mon Sep 17 00:00:00 2001
From f583e16509936d6873c4a2dac936d9089cc402a1 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 10:10:02 +0100
Subject: [PATCH 12/45] dcevm15 - fix java15 compilation issues
Subject: [PATCH 12/42] dcevm15 - fix java15 compilation issues
---
.../share/classfile/classFileParser.hpp | 8 +-
@@ -322,7 +322,7 @@ index bec9c91d40a..29a81348d2d 100644
// Old and new address are in same space, so just compare the address.
// Must rescue if object moves towards the top of the space.
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 1e2b40dd1f2..c181fe044e2 100644
index 994f6bf266f..ef0091fe288 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -1281,7 +1281,7 @@ void InstanceKlass::init_implementor() {

View File

@@ -1,7 +1,7 @@
From 2a27d36f5fbb0ebd94da192355f3946138c495bd Mon Sep 17 00:00:00 2001
From 4c98b29fed42b51e399f2ae0dc06f0c7a4397e2c Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 22 Nov 2020 19:51:46 +0100
Subject: [PATCH 13/45] dcevm15 - add ClassLoaderDataGraph_lock on
Subject: [PATCH 13/42] dcevm15 - add ClassLoaderDataGraph_lock on
ClassLoaderDataGraph::classes_do
ClassLoaderDataGraph::classes_do and need safepoint or lock,

View File

@@ -1,7 +1,7 @@
From 09af8da3c8fcb6d97917951673a56696fd7d6a2b Mon Sep 17 00:00:00 2001
From b312e64db8532c57658d1f39269d73969ecf98d4 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 22 Nov 2020 12:05:50 +0100
Subject: [PATCH 14/45] dcevm15 - fix Universe::root_oops_do
Subject: [PATCH 14/42] dcevm15 - fix Universe::root_oops_do
Removed ClassLoaderDataGraph::cld_do was cause of crashes due multiple
oop patching. ClassLoaderDataGraph::cld_do replaced in dcevm15

View File

@@ -1,7 +1,7 @@
From fc0d2894212fd2186498d3341dddf2f201965686 Mon Sep 17 00:00:00 2001
From b99bae1157fea7a62a2c9d2f10aaf722de1a5299 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 28 Nov 2020 19:29:42 +0100
Subject: [PATCH 15/45] dcevm15 - check if has_nestmate_access_to has newest
Subject: [PATCH 15/42] dcevm15 - check if has_nestmate_access_to has newest
host class
---
@@ -9,7 +9,7 @@ Subject: [PATCH 15/45] dcevm15 - check if has_nestmate_access_to has newest
1 file changed, 5 insertions(+)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index c181fe044e2..a8ac12450d7 100644
index ef0091fe288..b4d09e92830 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -398,6 +398,11 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {

View File

@@ -1,7 +1,7 @@
From d20a52a5e7a87003da6f3e4bda39ec2976868a75 Mon Sep 17 00:00:00 2001
From 936d83f295468e7c0e51b759def1d8664cca2a6e Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 29 Nov 2020 17:18:16 +0100
Subject: [PATCH 16/45] dcevm15 - mark_as_scavengable only alive methods
Subject: [PATCH 16/42] dcevm15 - mark_as_scavengable only alive methods
---
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 14 ++++++++------

View File

@@ -1,7 +1,7 @@
From b315e7cd828e79d63562b0296b97795015b644af Mon Sep 17 00:00:00 2001
From 50e3023f20fbea76fcc644a037bebc3ee5afc212 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 29 Nov 2020 20:05:03 +0100
Subject: [PATCH 17/45] dcevm15 - fix hidded classes
Subject: [PATCH 17/42] dcevm15 - fix hidded classes
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 41 ++++++++++++++-----

View File

@@ -1,7 +1,7 @@
From 25d78e62a702ad754c1a3a0136db1453089f008e Mon Sep 17 00:00:00 2001
From 21a17a7caf43236590d2e7319e176cb19c42f9aa Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 29 Nov 2020 20:08:57 +0100
Subject: [PATCH 18/45] dcevm15 - DON'T clear F2 in CP cache after indy
Subject: [PATCH 18/42] dcevm15 - DON'T clear F2 in CP cache after indy
unevolving
It's not clear why it was cleared in dcevm7-11

View File

@@ -1,7 +1,7 @@
From b84814b31883b0f5441fca6d77b18c7426d26c36 Mon Sep 17 00:00:00 2001
From e286bbfb6ef8235be6aa9b41e30e9ed36cfd177d Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 22 Nov 2020 12:03:32 +0100
Subject: [PATCH 19/45] Cleanup and review comments
Subject: [PATCH 19/42] Cleanup and review comments
---
src/hotspot/share/classfile/classLoaderDataGraph.hpp | 2 +-

View File

@@ -1,7 +1,7 @@
From 9da70fec073a442e9c0aee19a5ec643c1f84cea5 Mon Sep 17 00:00:00 2001
From a755a90e2845ef3a30f3f03185ecee1a71182606 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 10:11:10 +0100
Subject: [PATCH 20/45] Disable AllowEnhancedClassRedefinition in flight
Subject: [PATCH 20/42] Disable AllowEnhancedClassRedefinition in flight
recorder
---

View File

@@ -1,7 +1,7 @@
From 5d065e823c431a80251696c2543f6c98e68f00a6 Mon Sep 17 00:00:00 2001
From 8770c3da756a6193d69bb8c23aa992584edcb723 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 09:44:28 +0100
Subject: [PATCH 21/45] dcevm17 - fix compilation issues
Subject: [PATCH 21/42] dcevm17 - fix compilation issues
---
.../share/classfile/classLoaderData.cpp | 2 +-
@@ -511,7 +511,7 @@ index cb320076a55..4b2211c415e 100644
static void serialize(SerializeClosure* f);
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index a8ac12450d7..ab2d7f10f9c 100644
index b4d09e92830..c2de2bec7d4 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -1286,7 +1286,7 @@ void InstanceKlass::init_implementor() {
@@ -523,7 +523,7 @@ index a8ac12450d7..ab2d7f10f9c 100644
assert(addr != NULL, "null addr");
if (addr != NULL) {
*addr = NULL;
@@ -3828,7 +3828,7 @@ void InstanceKlass::verify_on(outputStream* st) {
@@ -3816,7 +3816,7 @@ void InstanceKlass::verify_on(outputStream* st) {
guarantee(sib->is_klass(), "should be klass");
// TODO: (DCEVM) explain

View File

@@ -1,7 +1,7 @@
From 09f5f22d61675a9f8909e903fa6e6f51507b656c Mon Sep 17 00:00:00 2001
From d170fa0a21d5c62348fe77eeaa81b16c8c51531a Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 11:38:48 +0100
Subject: [PATCH 22/45] Fix crash on GrowableArray allocation in C_HEAP
Subject: [PATCH 22/42] Fix crash on GrowableArray allocation in C_HEAP
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 4 ++--

View File

@@ -1,7 +1,7 @@
From 90b8572ff42dd5f64a6d2063aab6842bceddcf55 Mon Sep 17 00:00:00 2001
From 8f59a799ec9996f3d92843f1a9f8504390c20009 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 11:39:05 +0100
Subject: [PATCH 23/45] Rename confusing method name old_if_redefined to
Subject: [PATCH 23/42] Rename confusing method name old_if_redefined to
old_if_redefining
---

View File

@@ -1,7 +1,7 @@
From 86f7318e889fcb0d883501b4a70105d087b39482 Mon Sep 17 00:00:00 2001
From cc05b370b2fdf4c367bb9b6e4a21b9f97ae53dcf Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 12:33:47 +0100
Subject: [PATCH 24/45] Check InstanceKlass::has_nestmate_access_to with active
Subject: [PATCH 24/42] Check InstanceKlass::has_nestmate_access_to with active
classes
Dcevm can leave old host in nested class if nested class is not
@@ -11,7 +11,7 @@ redefined together with host class
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index ab2d7f10f9c..bcb0da6301f 100644
index c2de2bec7d4..3cc96f98f41 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -398,9 +398,9 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {

View File

@@ -1,7 +1,7 @@
From 79ea607bf68161cfcee3a681d14540cffe5589a3 Mon Sep 17 00:00:00 2001
From fdc87a0203f5aa1a21b3bf2e7a5aa114739f66cf Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 13 Feb 2021 20:47:52 +0100
Subject: [PATCH 25/45] JBR-3111 Update class in all dictionaries where it was
Subject: [PATCH 25/42] JBR-3111 Update class in all dictionaries where it was
already defined
This patch keeps compatibility with std redefinition, that does not

View File

@@ -1,7 +1,7 @@
From 99c65ab84080d35c1ba1df6efd5641ad3ab9e1e8 Mon Sep 17 00:00:00 2001
From a33424d92f6001c9f9cb627b620f490fdfbc1196 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 20 Feb 2021 15:47:47 +0100
Subject: [PATCH 26/45] Add ClassLoaderDataGraph_lock to define new class in
Subject: [PATCH 26/42] Add ClassLoaderDataGraph_lock to define new class in
enhanced redefiniton
ClassLoaderDataGraph locking for introduced in redefinition in

View File

@@ -1,7 +1,7 @@
From e7e7920986355d6fd5ad0c333ec780c93583d030 Mon Sep 17 00:00:00 2001
From e85a74a6bd33e5d81569ec209311e698de402990 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Thu, 18 Jun 2020 18:40:11 +0200
Subject: [PATCH 27/45] JBR-3140 - support for modularized HotswapAgent
Subject: [PATCH 27/42] JBR-3140 - support for modularized HotswapAgent
Add -XX:HotswapAgent=[disabled,fatjar.core]
---

View File

@@ -1,7 +1,7 @@
From 854df9651b358f3a8d89cd8a7d60fed26ca3d1d5 Mon Sep 17 00:00:00 2001
From b2e59ba5f246798f4901fa16d8fd3aeceac8309e 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 28/45] Support for redefinition of Well Known classses
Subject: [PATCH 28/42] Support for redefinition of Well Known classses
(java.*,jdk.*, sun.*)
---

View File

@@ -1,7 +1,7 @@
From 01f4cb9929cad1512d02e20cc7538a29ff0d3ef1 Mon Sep 17 00:00:00 2001
From 76c2c517d54f0fdbae2cb10cceb6c1aab7ee3a7b Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 15 May 2021 10:31:28 +0200
Subject: [PATCH 29/45] Fix fastdebug compilation issues - cast_to_oop
Subject: [PATCH 29/42] Fix fastdebug compilation issues - cast_to_oop
---
.../share/gc/g1/g1FullGCCompactTask.cpp | 12 +++++-----

View File

@@ -1,7 +1,7 @@
From cac2eac1986ae05e264b2213d0d2658e2f57f07f Mon Sep 17 00:00:00 2001
From e3dcad4df8369cfa4a5eb90058ce265c0233b272 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 30/45] JBR-3458: Skip dynamic proxy classes based on
Subject: [PATCH 30/42] JBR-3458: Skip dynamic proxy classes based on
com.sun.proxy
---

View File

@@ -1,7 +1,7 @@
From 4c87af809d20a12553f155110592a9f230ec0ea5 Mon Sep 17 00:00:00 2001
From b57c414d7885df5142a4a6bbf78001e96938f8ac 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 31/45] JBR-3459: Fix race condition in
Subject: [PATCH 31/42] JBR-3459: Fix race condition in
ClassLoaderDataGraph::classes_do
InstanceKlass in ClassLoaderData can be uninitialized when

View File

@@ -1,7 +1,7 @@
From c4941350aa7d3c5df3a20652f640fe446ff00c5c Mon Sep 17 00:00:00 2001
From 66d53205a84c8e4db40fb2fc91f563cde458afcc Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 15 May 2021 13:01:25 +0200
Subject: [PATCH 32/45] Fix compilation problems
Subject: [PATCH 32/42] Fix compilation problems
---
src/hotspot/share/oops/instanceKlass.cpp | 2 +-
@@ -9,7 +9,7 @@ Subject: [PATCH 32/45] Fix compilation problems
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index bcb0da6301f..c5f37d42a9a 100644
index 3cc96f98f41..c54b6b1bf46 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -978,7 +978,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {

View File

@@ -1,7 +1,7 @@
From dad40d31ec8a1633189e70eff57ae5fd21544b20 Mon Sep 17 00:00:00 2001
From fd5b6cd29a5dfed532b0c6ac80c94271f388c5bc Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 20 Jun 2021 19:11:16 +0200
Subject: [PATCH 33/45] Fix dcevm issues related to refactorization of Thread
Subject: [PATCH 33/42] Fix dcevm issues related to refactorization of Thread
to JavaThread
---

View File

@@ -1,7 +1,7 @@
From 7fcef1a84c37c568c0afafb8cb22303efda68f0d Mon Sep 17 00:00:00 2001
From 52c661cebf92d4ad68058ada5d3463e54428aee7 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 20 Jun 2021 19:42:51 +0200
Subject: [PATCH 34/45] Fix init_method_MemberName after Thread to JavaThread
Subject: [PATCH 34/42] Fix init_method_MemberName after Thread to JavaThread
refactorization
---
@@ -78,7 +78,7 @@ index 9eeb10cc6fd..871eaab7464 100644
BasicType result_type() const { return selected_method()->result_type(); }
CallKind call_kind() const { return _call_kind; }
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index c5f37d42a9a..9920e7fb25d 100644
index c54b6b1bf46..8d259451032 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -1643,21 +1643,6 @@ void InstanceKlass::methods_do(void f(Method* method)) {

View File

@@ -1,7 +1,7 @@
From e16371268f8ba1c752dc61635a09c94e978f5117 Mon Sep 17 00:00:00 2001
From 523ce6dd1559af84ebd6e4f10e7de9142f88d9d0 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Mon, 21 Jun 2021 20:44:17 +0200
Subject: [PATCH 35/45] Fix "implicit conversion of NULL constant to 'bool'"
Subject: [PATCH 35/42] Fix "implicit conversion of NULL constant to 'bool'"
---
src/hotspot/share/prims/jvmtiRedefineClasses.cpp | 2 +-

View File

@@ -1,7 +1,7 @@
From 4d7390cedc3d06281f6a89f12b469108f11aab42 Mon Sep 17 00:00:00 2001
From df4c29b24d41069168ee5647b2737348d9902090 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 30 Jun 2021 18:30:00 +0200
Subject: [PATCH 36/45] Fix, pass SystemDictionary::resolve_from_stream cl_info
Subject: [PATCH 36/42] Fix, pass SystemDictionary::resolve_from_stream cl_info
param
---

View File

@@ -1,7 +1,7 @@
From 24fe3ebd655068b819a437af62d40c2ee9ed7171 Mon Sep 17 00:00:00 2001
From 47ae71afaf12c7bab4f928579b154ec72aad3c02 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 30 Jun 2021 18:50:38 +0200
Subject: [PATCH 37/45] Search for affected classes in all initialized classes
Subject: [PATCH 37/42] Search for affected classes in all initialized classes
in cld
Fix also case when lambda interface is redefined. Lambda class is

View File

@@ -1,7 +1,7 @@
From 3e62ad1914f202d2d3fe907036924e181cd60fcb Mon Sep 17 00:00:00 2001
From e9c3042e13c5fe58cac7409b1f93a4dc287cc14a Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 30 Jun 2021 18:58:47 +0200
Subject: [PATCH 38/45] Fix compilation issue
Subject: [PATCH 38/42] Fix compilation issue
---
src/hotspot/share/interpreter/linkResolver.cpp | 4 ++--

View File

@@ -1,7 +1,7 @@
From 4cfb8eb8caa9b13f54f21cdd34b4d761b2b488cc Mon Sep 17 00:00:00 2001
From f303ef1fec703144efe6b9989a1a71fae0fb4263 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Tue, 27 Jul 2021 21:32:51 +0200
Subject: [PATCH 39/45] Remove duplicated lambdaFormInvokers.cpp
Subject: [PATCH 39/42] Remove duplicated lambdaFormInvokers.cpp
---
.../share/classfile/lambdaFormInvokers.cpp | 152 ------------------

View File

@@ -1,7 +1,7 @@
From 92651c5d109896613e14792aa96ed5226a797f9b Mon Sep 17 00:00:00 2001
From 9cb4aaf17c8e35f39aed0dfa33e173b40968eee6 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 40/45] JBR-3867 - update keys of jvmti TAG map after
Subject: [PATCH 40/42] JBR-3867 - update keys of jvmti TAG map after
redefinition
jdwp keeps relation class_ptr->class_ref in jvmti tag. class_ptr is used

View File

@@ -1,7 +1,7 @@
From 7cfd70e1e43bca677b9827a5a7643bb604e6ae38 Mon Sep 17 00:00:00 2001
From db54a42adf258e2ba3459fe017221cf2cf49c33f 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 41/45] JBR-3867 - fix msvc compilation issue with non const
Subject: [PATCH 41/42] JBR-3867 - fix msvc compilation issue with non const
array on stack
---

View File

@@ -1,7 +1,7 @@
From d41ca807dcf4f192bc730c577acb5d2bff0aa3f7 Mon Sep 17 00:00:00 2001
From 976b5f8b1326fee64febef8771d7cebee46bada9 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 42/45] Attempt to fix JBR-3887
Subject: [PATCH 42/42] Attempt to fix JBR-3887
---
src/hotspot/share/prims/jvmtiExtensions.cpp | 8 +++++++-

View File

@@ -1,180 +0,0 @@
From 91534f381bf08471b7e6e5064d561fb75e2890c6 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 43/45] 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 | 38 ++++++++++++++++++--
src/hotspot/share/compiler/compileBroker.hpp | 6 ++++
src/hotspot/share/prims/jvmtiEnv.cpp | 7 ++++
src/hotspot/share/runtime/mutexLocker.cpp | 3 ++
src/hotspot/share/runtime/mutexLocker.hpp | 1 +
5 files changed, 53 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
index aaf8e4b1f1e..878bc265d2f 100644
--- a/src/hotspot/share/compiler/compileBroker.cpp
+++ b/src/hotspot/share/compiler/compileBroker.cpp
@@ -140,6 +140,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;
// Performance counters
PerfCounter* CompileBroker::_perf_total_compilation = NULL;
@@ -2320,8 +2322,19 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
locker.wait();
}
}
- comp->compile_method(&ci_env, target, osr_bci, true, directive);
-
+ if (AllowEnhancedClassRedefinition) {
+ {
+ MonitorLocker locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
+ while (_compilation_stopped) {
+ locker.wait();
+ }
+ Atomic::add(&_active_compilations, 1);
+ }
+ comp->compile_method(&ci_env, target, osr_bci, true, directive);
+ Atomic::sub(&_active_compilations, 1);
+ } else {
+ comp->compile_method(&ci_env, target, osr_bci, true, directive);
+ }
/* Repeat compilation without installing code for profiling purposes */
int repeat_compilation_count = directive->RepeatCompilationOption;
while (repeat_compilation_count > 0) {
@@ -2329,6 +2342,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
comp->compile_method(&ci_env, target, osr_bci, false , directive);
repeat_compilation_count--;
}
+
}
if (!ci_env.failing() && task->code() == NULL) {
@@ -2942,3 +2956,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) {
+ MonitorLocker locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
+ _compilation_stopped = true;
+ while (_active_compilations > 0) {
+ VM_ThreadsSuspendJVMTI tsj; // force safepoint to run C1/C2 VM op
+ VMThread::execute(&tsj);
+ locker.wait(10);
+ }
+ }
+}
+
+void CompileBroker::releaseCompilationAfterEnhancedRedefinition() {
+ if (AllowEnhancedClassRedefinition) {
+ MonitorLocker locker(DcevmCompilation_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 0b721f83121..f146ff5c93d 100644
--- a/src/hotspot/share/compiler/compileBroker.hpp
+++ b/src/hotspot/share/compiler/compileBroker.hpp
@@ -175,6 +175,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 CompileQueue* _c2_compile_queue;
static CompileQueue* _c1_compile_queue;
@@ -423,6 +426,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_COMPILER_COMPILEBROKER_HPP
diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
index 8970d7991b7..9ca8e660197 100644
--- a/src/hotspot/share/prims/jvmtiEnv.cpp
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp
@@ -31,6 +31,7 @@
#include "classfile/vmClasses.hpp"
#include "classfile/vmSymbols.hpp"
#include "gc/shared/collectedHeap.hpp"
+#include "compiler/compileBroker.hpp"
#include "interpreter/bytecodeStream.hpp"
#include "interpreter/interpreter.hpp"
#include "jfr/jfrEvents.hpp"
@@ -458,8 +459,11 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
if (AllowEnhancedClassRedefinition) {
MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
+ // Stop compilation to avoid compilator race condition (crashes) with advanced redefinition
+ CompileBroker::stopCompilationBeforeEnhancedRedefinition();
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_retransform);
VMThread::execute(&op);
+ CompileBroker::releaseCompilationAfterEnhancedRedefinition();
op_id = op.id();
error = (op.check_error());
} else {
@@ -489,8 +493,11 @@ JvmtiEnv::RedefineClasses(jint class_count, const jvmtiClassDefinition* class_de
if (AllowEnhancedClassRedefinition) {
MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
+ // Stop compilation to avoid compilator race condition (crashes) with advanced redefinition
+ CompileBroker::stopCompilationBeforeEnhancedRedefinition();
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
VMThread::execute(&op);
+ CompileBroker::releaseCompilationAfterEnhancedRedefinition();
op_id = op.id();
error = (op.check_error());
} else {
diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp
index 83982382e6f..beb36ebc177 100644
--- a/src/hotspot/share/runtime/mutexLocker.cpp
+++ b/src/hotspot/share/runtime/mutexLocker.cpp
@@ -84,6 +84,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;
@@ -318,6 +319,8 @@ void mutex_init() {
def(Compilation_lock , PaddedMonitor, leaf, false, _safepoint_check_never);
}
+ def(DcevmCompilation_lock , PaddedMonitor, nonleaf+1, false, _safepoint_check_never);
+
#if INCLUDE_JFR
def(JfrMsg_lock , PaddedMonitor, leaf, true, _safepoint_check_always);
def(JfrBuffer_lock , PaddedMutex , leaf, true, _safepoint_check_never);
diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp
index 65a6366bbfb..4333bd51464 100644
--- a/src/hotspot/share/runtime/mutexLocker.hpp
+++ b/src/hotspot/share/runtime/mutexLocker.hpp
@@ -80,6 +80,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

View File

@@ -1,111 +0,0 @@
From c45eb681e77d16b7e873c8e4dbd19f98879a102a Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 6 Nov 2021 19:47:08 +0100
Subject: [PATCH 44/45] G1 fixes, code cleanup
---
src/hotspot/share/compiler/compileBroker.cpp | 2 ++
src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp | 4 +---
src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp | 4 ++++
src/hotspot/share/gc/shared/gcConfig.cpp | 6 +++---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 3 ++-
5 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
index 878bc265d2f..d8275508f9b 100644
--- a/src/hotspot/share/compiler/compileBroker.cpp
+++ b/src/hotspot/share/compiler/compileBroker.cpp
@@ -2958,6 +2958,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) {
MonitorLocker 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 765630a9826..c5bffc9bc49 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
@@ -140,7 +140,6 @@ void G1FullGCCompactTask::compact_region_dcevm(HeapRegion* hr, GrowableArray<Hea
hr->apply_to_marked_objects(collector()->mark_bitmap(), &compact);
// Once all objects have been moved the liveness information
// needs be cleared.
- collector()->mark_bitmap()->clear_region(hr);
if (G1VerifyBitmaps) {
collector()->mark_bitmap()->clear_region(hr);
}
@@ -150,8 +149,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/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
index 93c066383a1..aa199f57dd7 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
@@ -146,6 +146,9 @@ bool G1FullGCPrepareTask::G1CalculatePointersClosure::should_compact(HeapRegion*
if (hr->is_pinned()) {
return false;
}
+ if (Universe::is_redefining_gc_run()) {
+ return true;
+ }
size_t live_words = _collector->live_words(hr->hrm_index());
size_t live_words_threshold = _collector->scope()->region_compaction_threshold();
// High live ratio region will not be compacted.
@@ -324,6 +327,7 @@ bool G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::must_rescue(oop old_
int new_size = old_obj->size_given_klass(oop(old_obj)->klass()->new_version());
int original_size = old_obj->size();
+ // what if old_obj > new_obj ?
bool overlap = (cast_from_oop<HeapWord*>(old_obj) + original_size < cast_from_oop<HeapWord*>(new_obj) + new_size);
return overlap;
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
index 8e78696bef5..f8365f94214 100644
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
@@ -96,9 +96,9 @@ void GCConfig::fail_if_non_included_gc_is_selected() {
}
void GCConfig::select_gc_ergonomically() {
- if (AllowEnhancedClassRedefinition && !UseG1GC) {
- // (DCEVM) Enhanced class redefinition only supports serial GC at the moment
- FLAG_SET_ERGO(UseSerialGC, true);
+ if (AllowEnhancedClassRedefinition && !UseSerialGC) {
+ // (DCEVM) use G1 as default GC in Enhanced class redefinition
+ FLAG_SET_ERGO(UseG1GC, true);
} else if (os::is_server_class_machine()) {
#if INCLUDE_G1GC
FLAG_SET_ERGO_IF_DEFAULT(UseG1GC, true);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 8615806ac98..32e0fcbe62b 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -385,7 +385,7 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
bool oop_updated = false;
if (obj->is_instance() && InstanceKlass::cast(obj->klass())->is_mirror_instance_klass()) {
Klass* klass = java_lang_Class::as_Klass(obj);
- if (klass != NULL && klass->is_instance_klass()) {
+ if (klass != NULL && klass->is_instance_klass() && klass->new_version() != NULL) {
assert(obj == InstanceKlass::cast(klass)->java_mirror(), "just checking");
if (klass->new_version() != NULL) {
obj = InstanceKlass::cast(klass->new_version())->java_mirror();
@@ -578,6 +578,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

View File

@@ -1,35 +0,0 @@
From bb7c41e91326eaa90e25e02e13a2559adf41ae9e Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Mon, 8 Nov 2021 19:51:41 +0100
Subject: [PATCH 45/45] JBR-3867 - fix dcevm redefinition stops due the not
updated weak oops
Dcevm must update also oops in weak storage using WeakProcessor. Oops
storage is new concept in java17.
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 32e0fcbe62b..35dfc1a66d1 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -67,6 +67,7 @@
#include "gc/shared/dcevmSharedGC.hpp"
#include "gc/shared/scavengableNMethods.hpp"
#include "gc/shared/oopStorageSet.inline.hpp"
+#include "gc/shared/weakProcessor.hpp"
#include "ci/ciObjectFactory.hpp"
Array<Method*>* VM_EnhancedRedefineClasses::_old_methods = NULL;
@@ -250,6 +251,7 @@ void VM_EnhancedRedefineClasses::root_oops_do(OopClosure *oopClosure) {
Threads::oops_do(oopClosure, NULL);
OopStorageSet::strong_oops_do(oopClosure);
+ WeakProcessor::oops_do(oopClosure);
CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
CodeCache::blobs_do(&blobClosure);
--
2.23.0

View File

@@ -21,16 +21,6 @@
# 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
@@ -41,21 +31,6 @@ JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_x64}
source jb/project/tools/common/scripts/common.sh
function do_configure {
sh ./configure \
$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-toolchain-version=$TOOLCHAIN_VERSION \
--with-boot-jdk=$BOOT_JDK \
--disable-ccache \
--enable-cds=yes || do_exit $?
}
function create_image_bundle {
__bundle_name=$1
__arch_name=$2
@@ -100,19 +75,23 @@ case "$bundle_type" in
;;
esac
if [ -z "$INC_BUILD" ]; then
do_configure || do_exit $?
if [ -z "$bundle_type" ]; then
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
else
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
fi
sh ./configure \
$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-toolchain-version=$TOOLCHAIN_VERSION \
--with-boot-jdk=$BOOT_JDK \
--disable-ccache \
--enable-cds=yes || do_exit $?
if [ -z "$bundle_type" ]; then
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
else
if [ -z "$bundle_type" ]; 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 CONF=$RELEASE_NAME clean images || do_exit $?
fi
IMAGES_DIR=build/$RELEASE_NAME/images

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 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
@@ -88,10 +88,7 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
$(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \
exit $$exitcode \
)
$(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.SortClasslist $@.raw.3 > $@
$(GREP) -v HelloClasslist $@.raw.2 > $@
# The jli trace is created by the same recipe as classlist. By declaring these
# dependencies, make will correctly rebuild both jli trace and classlist

View File

@@ -324,7 +324,7 @@ $(eval $(call SetupTarget, vscode-project-ccls, \
# aren't built until after libjava and libjvm are available to link to.
$(eval $(call SetupTarget, demos-jdk, \
MAKEFILE := CompileDemos, \
DEPS := java.base-libs exploded-image buildtools-jdk, \
DEPS := java.base-libs exploded-image, \
))
$(eval $(call SetupTarget, test-image-demos-jdk, \
@@ -383,12 +383,12 @@ bootcycle-images:
$(eval $(call SetupTarget, zip-security, \
MAKEFILE := ZipSecurity, \
DEPS := buildtools-jdk java.base-java java.security.jgss-java java.security.jgss-libs, \
DEPS := java.base-java java.security.jgss-java java.security.jgss-libs, \
))
$(eval $(call SetupTarget, zip-source, \
MAKEFILE := ZipSource, \
DEPS := buildtools-jdk gensrc, \
DEPS := gensrc, \
))
$(eval $(call SetupTarget, jrtfs-jar, \
@@ -508,13 +508,13 @@ $(eval $(call SetupTarget, docs-jdk-index, \
$(eval $(call SetupTarget, docs-zip, \
MAKEFILE := Docs, \
TARGET := docs-zip, \
DEPS := docs-jdk buildtools-jdk, \
DEPS := docs-jdk, \
))
$(eval $(call SetupTarget, docs-specs-zip, \
MAKEFILE := Docs, \
TARGET := docs-specs-zip, \
DEPS := docs-jdk-specs buildtools-jdk, \
DEPS := docs-jdk-specs, \
))
$(eval $(call SetupTarget, update-build-docs, \

View File

@@ -80,8 +80,6 @@ TOOL_GENERATECACERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_class
TOOL_GENERATEEMOJIDATA = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.generateemojidata.GenerateEmojiData
TOOL_MAKEZIPREPRODUCIBLE = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.makezipreproducible.MakeZipReproducible
# TODO: There are references to the jdwpgen.jar in jdk/make/netbeans/jdwpgen/build.xml
# and nbproject/project.properties in the same dir. Needs to be looked at.

View File

@@ -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
@@ -94,6 +94,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
# Locate the directory of this script.
AUTOCONF_DIR=$TOPDIR/make/autoconf
# Setup username (for use in adhoc version strings etc)
# Outer [ ] to quote m4.
[ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
AC_SUBST(USERNAME)
])
###############################################################################

View File

@@ -356,14 +356,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
fi
AC_SUBST(IS_GNU_TIME)
# Check if it's GNU date
check_date=`$DATE --version 2>&1 | $GREP GNU`
if test "x$check_date" != x; then
IS_GNU_DATE=yes
else
IS_GNU_DATE=no
fi
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
UTIL_REQUIRE_PROGS(DSYMUTIL, dsymutil)
UTIL_REQUIRE_PROGS(MIG, mig)

View File

@@ -89,11 +89,11 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS],
# Fix linker warning.
# Code taken from make/autoconf/flags-cflags.m4 and adapted.
JVM_BASIC_ASFLAGS+=" -DMAC_OS_X_VERSION_MIN_REQUIRED=$MACOSX_VERSION_MIN_NODOTS \
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+=" $OS_CFLAGS \
JVM_BASIC_ASFLAGS+="$OS_CFLAGS \
-DMAC_OS_X_VERSION_MAX_ALLOWED=$MACOSX_VERSION_MAX_NODOTS"
fi
fi

View File

@@ -199,12 +199,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
AC_MSG_ERROR([Copyright year must have a value])
elif test "x$with_copyright_year" != x; then
COPYRIGHT_YEAR="$with_copyright_year"
elif test "x$SOURCE_DATE_EPOCH" != x; then
if test "x$IS_GNU_DATE" = xyes; then
COPYRIGHT_YEAR=`date --date=@$SOURCE_DATE_EPOCH +%Y`
else
COPYRIGHT_YEAR=`date -j -f %s $SOURCE_DATE_EPOCH +%Y`
fi
else
COPYRIGHT_YEAR=`$DATE +'%Y'`
fi
@@ -741,7 +735,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_REPRODUCIBLE_BUILD],
if test "x$OPENJDK_BUILD_OS" = xwindows && \
test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = xfalse && \
test "x$ENABLE_REPRODUCIBLE_BUILD" = xfalse; then
AC_MSG_NOTICE([On Windows it is not possible to combine --disable-reproducible-build])
AC_MSG_NOTICE([On Windows it is not possible to combine --disable-reproducible-builds])
AC_MSG_NOTICE([with --disable-absolute-paths-in-output.])
AC_MSG_ERROR([Cannot continue])
fi

View File

@@ -69,17 +69,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
AC_SUBST(JDK_RC_PLATFORM_NAME)
AC_SUBST(HOTSPOT_VM_DISTRO)
# Setup username (for use in adhoc version strings etc)
AC_ARG_WITH([build-user], [AS_HELP_STRING([--with-build-user],
[build username to use in version strings])])
if test "x$with_build_user" != x; then
USERNAME="$with_build_user"
else
# Outer [ ] to quote m4.
[ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
fi
AC_SUBST(USERNAME)
# Set the JDK RC name
AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name],
[Set JDK RC name. This is used for FileDescription and ProductName properties

View File

@@ -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
@@ -26,9 +26,6 @@
ifndef _ZIP_ARCHIVE_GMK
_ZIP_ARCHIVE_GMK := 1
# Depends on build tools for MakeZipReproducible
include ../ToolsJdk.gmk
ifeq (,$(_MAKEBASE_GMK))
$(error You must include MakeBase.gmk prior to including ZipArchive.gmk)
endif
@@ -54,8 +51,6 @@ endif
# FOLLOW_SYMLINKS - Set to explicitly follow symlinks. Affects performance of
# finding files.
# ZIP_OPTIONS extra options to pass to zip
# REPRODUCIBLE override ENABLE_REPRODUCIBLE_BUILD (to make zip reproducible or not)
SetupZipArchive = $(NamedParamsMacroTemplate)
define SetupZipArchiveBody
@@ -129,10 +124,6 @@ define SetupZipArchiveBody
) \
)
ifeq ($$($1_REPRODUCIBLE), )
$1_REPRODUCIBLE := $$(ENABLE_REPRODUCIBLE_BUILD)
endif
# Use a slightly shorter name for logging, but with enough path to identify this zip.
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_ZIP))
@@ -143,8 +134,6 @@ define SetupZipArchiveBody
# dir is very small.
# If zip has nothing to do, it returns 12 and would fail the build. Check for 12
# and only fail if it's not.
# For reproducible builds set the zip access & modify times to SOURCE_DATE_EPOCH
# by using a ziptmp folder to generate final zip from using MakeZipReproducible.
$$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
$$(call LogWarn, Updating $$($1_NAME))
$$(call MakeTargetDir)
@@ -174,18 +163,7 @@ define SetupZipArchiveBody
$$($1_ZIP_EXCLUDES_$$s) \
|| test "$$$$?" = "12" \
))$$(NEWLINE) \
) true
ifeq ($$($1_REPRODUCIBLE), true)
$$(call ExecuteWithLog, \
$$(SUPPORT_OUTPUTDIR)/makezipreproducible/$$(patsubst $$(OUTPUTDIR)/%,%, $$@), \
($(RM) $$(SUPPORT_OUTPUTDIR)/ziptmp/$1/tmp.zip && \
$(MKDIR) -p $$(SUPPORT_OUTPUTDIR)/ziptmp/$1 && \
$(TOOL_MAKEZIPREPRODUCIBLE) -f $$(SUPPORT_OUTPUTDIR)/ziptmp/$1/tmp.zip \
-t $(SOURCE_DATE_EPOCH) $$@ && \
$(RM) $$@ && \
$(MV) $$(SUPPORT_OUTPUTDIR)/ziptmp/$1/tmp.zip $$@ \
))
endif
) true \
$(TOUCH) $$@
# Add zip to target list

View File

@@ -28,12 +28,12 @@
DEFAULT_VERSION_FEATURE=17
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=1
DEFAULT_VERSION_UPDATE=0
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2021-10-19
DEFAULT_VERSION_DATE=2021-09-14
DEFAULT_VERSION_CLASSFILE_MAJOR=61 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11

View File

@@ -0,0 +1,27 @@
Owner: CN=DST Root CA X3, O=Digital Signature Trust Co.
Issuer: CN=DST Root CA X3, O=Digital Signature Trust Co.
Serial number: 44afb080d6a327ba893039862ef8406b
Valid from: Sat Sep 30 21:12:19 GMT 2000 until: Thu Sep 30 14:01:15 GMT 2021
Signature algorithm name: SHA1withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
-----BEGIN CERTIFICATE-----
MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow
PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD
Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O
rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq
OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b
xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw
7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD
aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG
SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69
ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr
AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz
R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5
JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
-----END CERTIFICATE-----

View File

@@ -1,82 +0,0 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This application is meant to be run to create a classlist file representing
* common use.
*
* The classlist is produced by adding -XX:DumpLoadedClassList=classlist
*/
package build.tools.classlist;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.util.Scanner;
/**
* The classlist generated by build.tools.classlist.HelloClasslist
* may have non-deterministic contents, affected by Java thread execution order.
* SortClasslist sorts the file to make the JDK image's contents more deterministic.
*/
public class SortClasslist {
public static void main(String args[]) throws FileNotFoundException {
ArrayList<String> classes = new ArrayList<>();
ArrayList<String> lambdas = new ArrayList<>();
FileInputStream fis = new FileInputStream(args[0]);
Scanner scanner = new Scanner(fis);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (line.startsWith("#")) {
// Comments -- print them first without sorting. These appear only at the top
// of the file.
System.out.println(line);
} else if (line.startsWith("@")) {
// @lambda-form-invoker, @lambda-proxy, etc.
lambdas.add(line);
} else {
// We should find a pattern like this:
//
// <beginning of line>java/lang/Object<end of line>
final String className = line;
classes.add(className);
}
}
Collections.sort(classes);
Collections.sort(lambdas);
for (String s : classes) {
System.out.println(s);
}
for (String s : lambdas) {
System.out.println(s);
}
}
}

View File

@@ -114,7 +114,6 @@ public class CLDRConverter {
ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_DEFAULT);
private static Set<String> AVAILABLE_TZIDS;
static int copyrightYear;
private static String zoneNameTempFile;
private static String tzDataDir;
private static final Map<String, String> canonicalTZMap = new HashMap<>();
@@ -218,10 +217,6 @@ public class CLDRConverter {
verbose = true;
break;
case "-year":
copyrightYear = Integer.parseInt(args[++i]);
break;
case "-zntempfile":
zoneNameTempFile = args[++i];
break;
@@ -240,7 +235,7 @@ public class CLDRConverter {
}
}
} catch (RuntimeException e) {
severe("unknown or incomplete arg(s): " + currentArg);
severe("unknown or imcomplete arg(s): " + currentArg);
usage();
System.exit(1);
}
@@ -265,10 +260,6 @@ public class CLDRConverter {
setupBaseLocales("en-US");
}
if (copyrightYear == 0) {
copyrightYear = ZonedDateTime.now(ZoneId.of("America/Los_Angeles")).getYear();
}
bundleGenerator = new ResourceBundleGenerator();
// Parse data independent of locales
@@ -301,7 +292,6 @@ public class CLDRConverter {
+ "\t-basemodule generates bundles that go into java.base module%n"
+ "\t-baselocales loc(,loc)* locales that go into the base module%n"
+ "\t-o dir output directory (default: ./build/gensrc)%n"
+ "\t-year year copyright year in output%n"
+ "\t-zntempfile template file for java.time.format.ZoneName.java%n"
+ "\t-tzdatadir tzdata directory for java.time.format.ZoneName.java%n"
+ "\t-utf8 use UTF-8 rather than \\uxxxx (for debug)%n");

View File

@@ -26,7 +26,6 @@
package build.tools.cldrconverter;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
@@ -132,7 +131,8 @@ class CopyrightHeaders {
" * questions.\n" +
" */\n";
static String getOracleCopyright(int year) {
static String getOracleCopyright() {
int year = getYear();
return String.format(year > 2012 ? ORACLE_AFTER2012 : ORACLE2012, year);
}
@@ -140,10 +140,16 @@ class CopyrightHeaders {
return UNICODE;
}
static String getOpenJDKCopyright(int year) {
static String getOpenJDKCopyright() {
int year = getYear();
return String.format(year > 2012 ? OPENJDK_AFTER2012 : OPENJDK2012, year);
}
private static int getYear() {
return new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"),
Locale.US).get(Calendar.YEAR);
}
// no instantiation
private CopyrightHeaders() {
}

View File

@@ -198,7 +198,7 @@ class ResourceBundleGenerator implements BundleGenerator {
try (PrintWriter out = new PrintWriter(file, encoding)) {
// Output copyright headers
out.println(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear));
out.println(CopyrightHeaders.getOpenJDKCopyright());
out.println(CopyrightHeaders.getUnicodeCopyright());
if (useJava) {
@@ -266,7 +266,7 @@ class ResourceBundleGenerator implements BundleGenerator {
CLDRConverter.info("Generating file " + file);
try (PrintWriter out = new PrintWriter(file, "us-ascii")) {
out.printf(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear));
out.printf(CopyrightHeaders.getOpenJDKCopyright());
out.printf((CLDRConverter.isBaseModule ? "package sun.util.cldr;\n\n" :
"package sun.util.resources.cldr.provider;\n\n")

View File

@@ -30,15 +30,13 @@ import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.stream.Collectors;
@@ -54,19 +52,17 @@ import java.util.stream.Collectors;
public class EquivMapsGenerator {
public static void main(String[] args) throws Exception {
if (args.length != 3) {
if (args.length != 2) {
System.err.println("Usage: java EquivMapsGenerator"
+ " language-subtag-registry.txt LocaleEquivalentMaps.java copyrightYear");
+ " language-subtag-registry.txt LocaleEquivalentMaps.java");
System.exit(1);
}
copyrightYear = Integer.parseInt(args[2]);
readLSRfile(args[0]);
generateEquivalentMap();
generateSourceCode(args[1]);
}
private static String LSRrevisionDate;
private static int copyrightYear;
private static Map<String, StringBuilder> initialLanguageMap =
new TreeMap<>();
private static Map<String, StringBuilder> initialRegionVariantMap =
@@ -250,7 +246,9 @@ public class EquivMapsGenerator {
+ "}";
private static String getOpenJDKCopyright() {
return String.format(Locale.US, COPYRIGHT, copyrightYear);
int year = ZonedDateTime.now(ZoneId
.of("America/Los_Angeles")).getYear();
return String.format(Locale.US, COPYRIGHT, year);
}
/**

View File

@@ -1,231 +0,0 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package build.tools.makezipreproducible;
import java.io.*;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
/**
* Generate a zip file in a "reproducible" manner from the input zip file.
* Standard zip tools rely on OS file list querying whose ordering can vary
* by platform architecture, this class ensures the zip entries are ordered
* and also supports SOURCE_DATE_EPOCH timestamps.
*/
public class MakeZipReproducible {
String input_file = null;
String fname = null;
String zname = "";
long timestamp = -1L;
boolean verbose = false;
// Keep a sorted Set of ZipEntrys to be processed, so that the zip is reproducible
SortedMap<String, ZipEntry> entries = new TreeMap<String, ZipEntry>();
private boolean ok;
public MakeZipReproducible() {
}
public synchronized boolean run(String args[]) {
ok = true;
if (!parseArgs(args)) {
return false;
}
try {
zname = fname.replace(File.separatorChar, '/');
if (zname.startsWith("./")) {
zname = zname.substring(2);
}
if (verbose) System.out.println("Input zip file: " + input_file);
File inFile = new File(input_file);
if (!inFile.exists()) {
error("Input zip file does not exist");
ok = false;
} else {
File zipFile = new File(fname);
// Check archive to create does not exist
if (!zipFile.exists()) {
// Process input ZipEntries
ok = processInputEntries(inFile);
if (ok) {
try (FileOutputStream out = new FileOutputStream(fname)) {
ok = create(inFile, new BufferedOutputStream(out, 4096));
}
} else {
}
} else {
error("Target zip file "+fname+" already exists.");
ok = false;
}
}
} catch (IOException e) {
fatalError(e);
ok = false;
} catch (Error ee) {
ee.printStackTrace();
ok = false;
} catch (Throwable t) {
t.printStackTrace();
ok = false;
}
return ok;
}
boolean parseArgs(String args[]) {
try {
boolean parsingIncludes = false;
boolean parsingExcludes = false;
int count = 0;
while(count < args.length) {
if (args[count].startsWith("-")) {
String flag = args[count].substring(1);
switch (flag.charAt(0)) {
case 'f':
fname = args[++count];
break;
case 't':
// SOURCE_DATE_EPOCH timestamp specified
timestamp = Long.parseLong(args[++count]) * 1000;
break;
case 'v':
verbose = true;
break;
default:
error(String.format("Illegal option -%s", String.valueOf(flag.charAt(0))));
usageError();
return false;
}
} else {
// input zip file
if (input_file != null) {
error("Input zip file already specified");
usageError();
return false;
}
input_file = args[count];
}
count++;
}
} catch (ArrayIndexOutOfBoundsException e) {
usageError();
return false;
} catch (NumberFormatException e) {
usageError();
return false;
}
if (fname == null) {
error("-f <outputArchiveName> must be specified");
usageError();
return false;
}
// If no files specified then default to current directory
if (input_file == null) {
error("No input zip file specified");
usageError();
return false;
}
return true;
}
// Process input zip file and add to sorted entries set
boolean processInputEntries(File inFile) throws IOException {
ZipFile zipFile = new ZipFile(inFile);
zipFile.stream().forEach(entry -> entries.put(entry.getName(), entry));
return true;
}
// Create new zip from entries
boolean create(File inFile, OutputStream out) throws IOException
{
try (ZipFile zipFile = new ZipFile(inFile);
ZipOutputStream zos = new ZipOutputStream(out)) {
for (Map.Entry<String, ZipEntry> entry : entries.entrySet()) {
ZipEntry zipEntry = entry.getValue();
if (zipEntry.getSize() > 0) {
try (InputStream eis = zipFile.getInputStream(zipEntry)) {
addEntry(zos, zipEntry, eis);
}
} else {
addEntry(zos, zipEntry, null);
}
}
}
return true;
}
// Add Entry and data to Zip
void addEntry(ZipOutputStream zos, ZipEntry entry, InputStream entryInputStream) throws IOException {
if (verbose) {
System.out.println("Adding: "+entry.getName());
}
// Set to specified timestamp if set otherwise leave as original lastModified time
if (timestamp != -1L) {
entry.setTime(timestamp);
}
zos.putNextEntry(entry);
if (entry.getSize() > 0 && entryInputStream != null) {
entryInputStream.transferTo(zos);
}
zos.closeEntry();
}
void usageError() {
error(
"Usage: MakeZipReproducible [-v] [-t <SOURCE_DATE_EPOCH>] -f <output_zip_file> <input_zip_file>\n" +
"Options:\n" +
" -v verbose output\n" +
" -f specify archive file name to create\n" +
" -t specific SOURCE_DATE_EPOCH value to use for timestamps\n" +
" input_zip_file re-written as a reproducible zip output_zip_file.\n");
}
void fatalError(Exception e) {
e.printStackTrace();
}
protected void error(String s) {
System.err.println(s);
}
public static void main(String args[]) {
MakeZipReproducible z = new MakeZipReproducible();
System.exit(z.run(args) ? 0 : 1);
}
}

View File

@@ -62,7 +62,6 @@ $(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \
-baselocales "en-US" \
-o $(GENSRC_DIR) \
-basemodule \
-year $(COPYRIGHT_YEAR) \
-zntempfile $(ZONENAME_TEMPLATE) \
-tzdatadir $(TZ_DATA_DIR))
$(TOUCH) $@
@@ -100,7 +99,7 @@ GENSRC_LSREQUIVMAPS := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/Loc
$(GENSRC_LSREQUIVMAPS): $(TOPDIR)/make/data/lsrdata/language-subtag-registry.txt $(BUILD_TOOLS_JDK)
$(call MakeDir, $(@D))
$(TOOL_GENERATELSREQUIVMAPS) $< $@ $(COPYRIGHT_YEAR)
$(TOOL_GENERATELSREQUIVMAPS) $< $@
TARGETS += $(GENSRC_LSREQUIVMAPS)

View File

@@ -436,7 +436,7 @@ endif
ifeq ($(USE_EXTERNAL_HARFBUZZ), true)
LIBFONTMANAGER_EXTRA_SRC =
BUILD_LIBFONTMANAGER_FONTLIB += $(HARFBUZZ_LIBS)
BUILD_LIBFONTMANAGER_FONTLIB += $(LIBHARFBUZZ_LIBS)
else
LIBFONTMANAGER_EXTRA_SRC = libharfbuzz
@@ -837,19 +837,6 @@ endif
################################################################################
# MACOSX_METAL_VERSION_MIN specifies the lowest version of Macosx
# that should be used to compile Metal shaders. We support Metal
# pipeline only on Macosx >=10.14. For Macosx versions <10.14 even if
# we enable Metal pipeline using -Dsun.java2d.metal=true, at
# runtime we force it to use OpenGL pipeline. And MACOSX_VERSION_MIN
# for aarch64 has always been >10.14 so we use continue to use
# MACOSX_VERSION_MIN for aarch64.
ifeq ($(OPENJDK_TARGET_CPU_ARCH), xaarch64)
MACOSX_METAL_VERSION_MIN=$(MACOSX_VERSION_MIN)
else
MACOSX_METAL_VERSION_MIN=10.14.0
endif
ifeq ($(call isTargetOs, macosx), true)
SHADERS_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal
SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui
@@ -861,9 +848,7 @@ ifeq ($(call isTargetOs, macosx), true)
DEPS := $(SHADERS_SRC), \
OUTPUT_FILE := $(SHADERS_AIR), \
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
COMMAND := $(METAL) -c -std=osx-metal2.0 \
-mmacosx-version-min=$(MACOSX_METAL_VERSION_MIN) \
-o $(SHADERS_AIR) $(SHADERS_SRC), \
COMMAND := $(METAL) -c -std=osx-metal2.0 -o $(SHADERS_AIR) $(SHADERS_SRC), \
))
$(eval $(call SetupExecute, metallib_shaders, \

View File

@@ -72,9 +72,7 @@ $(JDK_JAVADOC_DIR)/_element_lists.marker: \
$(MODULE_INFOS)
$(call MakeTargetDir)
$(call LogInfo, Creating javadoc element lists)
$(RM) $(ELEMENT_LISTS_DIR)/element-list-{$(call CommaList, \
$(call sequence, $(GENERATE_SYMBOLS_FROM_JDK_VERSION), \
$(JDK_SOURCE_TARGET_VERSION)))}.txt
$(RM) -r $(ELEMENT_LISTS_DIR)
# Generate element-list files for JDK 11 to current-1
$(call ExecuteWithLog, $@_historic, \
$(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \

View File

@@ -46,7 +46,6 @@ $(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \
$(call ExecuteWithLog, $@, \
$(TOOL_CLDRCONVERTER) -base $(CLDR_DATA_DIR) \
-baselocales "en-US" \
-year $(COPYRIGHT_YEAR) \
-o $(GENSRC_DIR))
$(TOUCH) $@

View File

@@ -356,8 +356,8 @@ compare_general_files() {
"
$CAT $OTHER_DIR/$f | eval "$SVG_FILTER" > $OTHER_FILE
$CAT $THIS_DIR/$f | eval "$SVG_FILTER" > $THIS_FILE
elif [ "$SUFFIX" = "jar_contents" ]; then
# The jar_contents files may have some lines in random order
elif [[ "$f" = *"/lib/classlist" ]] || [ "$SUFFIX" = "jar_contents" ]; then
# The classlist files may have some lines in random order
OTHER_FILE=$WORK_DIR/$f.other
THIS_FILE=$WORK_DIR/$f.this
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)

View File

@@ -2837,7 +2837,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
}
#endif
// first time here. Set profile type.
__ str(tmp, mdo_addr);
__ ldr(tmp, mdo_addr);
} else {
assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent");

View File

@@ -2669,7 +2669,9 @@ int os::open(const char *path, int oflag, int mode) {
// create binary file, rewriting existing file if required
int os::create_binary_file(const char* path, bool rewrite_existing) {
int oflags = O_WRONLY | O_CREAT;
oflags |= rewrite_existing ? O_TRUNC : O_EXCL;
if (!rewrite_existing) {
oflags |= O_EXCL;
}
return ::open64(path, oflags, S_IREAD | S_IWRITE);
}

View File

@@ -2359,7 +2359,9 @@ int os::open(const char *path, int oflag, int mode) {
// create binary file, rewriting existing file if required
int os::create_binary_file(const char* path, bool rewrite_existing) {
int oflags = O_WRONLY | O_CREAT;
oflags |= rewrite_existing ? O_TRUNC : O_EXCL;
if (!rewrite_existing) {
oflags |= O_EXCL;
}
return ::open(path, oflags, S_IREAD | S_IWRITE);
}

View File

@@ -4972,7 +4972,9 @@ int os::open(const char *path, int oflag, int mode) {
// create binary file, rewriting existing file if required
int os::create_binary_file(const char* path, bool rewrite_existing) {
int oflags = O_WRONLY | O_CREAT;
oflags |= rewrite_existing ? O_TRUNC : O_EXCL;
if (!rewrite_existing) {
oflags |= O_EXCL;
}
return ::open64(path, oflags, S_IREAD | S_IWRITE);
}

View File

@@ -1885,11 +1885,7 @@ int os::fork_and_exec(const char* cmd, bool prefer_vfork) {
// Use always vfork on AIX, since its safe and helps with analyzing OOM situations.
// Otherwise leave it up to the caller.
AIX_ONLY(prefer_vfork = true;)
#ifdef __APPLE__
pid = ::fork();
#else
pid = prefer_vfork ? ::vfork() : ::fork();
#endif
if (pid < 0) {
// fork failed

View File

@@ -4948,7 +4948,9 @@ bool os::dir_is_empty(const char* path) {
// create binary file, rewriting existing file if required
int os::create_binary_file(const char* path, bool rewrite_existing) {
int oflags = _O_CREAT | _O_WRONLY | _O_BINARY;
oflags |= rewrite_existing ? _O_TRUNC : _O_EXCL;
if (!rewrite_existing) {
oflags |= _O_EXCL;
}
return ::open(path, oflags, _S_IREAD | _S_IWRITE);
}

View File

@@ -839,19 +839,6 @@ bool BlockBegin::try_merge(ValueStack* new_state) {
}
}
for_each_stack_value(existing_state, index, existing_value) {
if ( !(existing_value->as_Phi() != NULL && existing_value->as_Phi()->block() == this)) {
TRACE_PHI(tty->print_cr("Re-entered loop head without existing phi for stack - bailout"));
return false;
}
}
for_each_local_value(existing_state, index, existing_value) {
if (!(existing_value == new_state->local_at(index) || (existing_value->as_Phi() != NULL && existing_value->as_Phi()->as_Phi()->block() == this))) {
TRACE_PHI(tty->print_cr("Re-entered loop head without existing phi for modified local - bailout"));
return false;
}
}
#ifdef ASSERT
// check that all necessary phi functions are present
for_each_stack_value(existing_state, index, existing_value) {

View File

@@ -3135,13 +3135,6 @@ u2 ClassFileParser::parse_classfile_inner_classes_attribute(const ClassFileStrea
valid_klass_reference_at(outer_class_info_index),
"outer_class_info_index %u has bad constant type in class file %s",
outer_class_info_index, CHECK_0);
if (outer_class_info_index != 0) {
const Symbol* const outer_class_name = cp->klass_name_at(outer_class_info_index);
char* bytes = (char*)outer_class_name->bytes();
guarantee_property(bytes[0] != JVM_SIGNATURE_ARRAY,
"Outer class is an array class in class file %s", CHECK_0);
}
// Inner class name
const u2 inner_name_index = cfs->get_u2_fast();
check_property(

View File

@@ -2316,7 +2316,6 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs,
// Get field name and signature
Symbol* field_name = cp->name_ref_at(index);
Symbol* field_sig = cp->signature_ref_at(index);
bool is_getfield = false;
// Field signature was checked in ClassFileParser.
assert(SignatureVerifier::is_valid_type_signature(field_sig),
@@ -2363,9 +2362,11 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs,
break;
}
case Bytecodes::_getfield: {
is_getfield = true;
stack_object_type = current_frame->pop_stack(
target_class_type, CHECK_VERIFY(this));
for (int i = 0; i < n; i++) {
current_frame->push_stack(field_type[i], CHECK_VERIFY(this));
}
goto check_protected;
}
case Bytecodes::_putfield: {
@@ -2395,15 +2396,7 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs,
check_protected: {
if (_this_type == stack_object_type)
break; // stack_object_type must be assignable to _current_class_type
if (was_recursively_verified()) {
if (is_getfield) {
// Push field type for getfield.
for (int i = 0; i < n; i++) {
current_frame->push_stack(field_type[i], CHECK_VERIFY(this));
}
}
return;
}
if (was_recursively_verified()) return;
Symbol* ref_class_name =
cp->klass_name_at(cp->klass_ref_index_at(index));
if (!name_in_supers(ref_class_name, current_class()))
@@ -2432,12 +2425,6 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs,
}
default: ShouldNotReachHere();
}
if (is_getfield) {
// Push field type for getfield after doing protection check.
for (int i = 0; i < n; i++) {
current_frame->push_stack(field_type[i], CHECK_VERIFY(this));
}
}
}
// Look at the method's handlers. If the bci is in the handler's try block

View File

@@ -1835,26 +1835,6 @@ Klass* Dependencies::find_witness_AME(InstanceKlass* ctxk, Method* m, KlassDepCh
return NULL;
}
// This function is used by find_unique_concrete_method(non vtable based)
// to check whether subtype method overrides the base method.
static bool overrides(Method* sub_m, Method* base_m) {
assert(base_m != NULL, "base method should be non null");
if (sub_m == NULL) {
return false;
}
/**
* If base_m is public or protected then sub_m always overrides.
* If base_m is !public, !protected and !private (i.e. base_m is package private)
* then sub_m should be in the same package as that of base_m.
* For package private base_m this is conservative approach as it allows only subset of all allowed cases in
* the jvm specification.
**/
if (base_m->is_public() || base_m->is_protected() ||
base_m->method_holder()->is_same_class_package(sub_m->method_holder())) {
return true;
}
return false;
}
// Find the set of all non-abstract methods under ctxk that match m.
// (The method m must be defined or inherited in ctxk.)
@@ -1892,9 +1872,6 @@ Method* Dependencies::find_unique_concrete_method(InstanceKlass* ctxk, Method* m
} else if (Dependencies::find_witness_AME(ctxk, fm) != NULL) {
// Found a concrete subtype which does not override abstract root method.
return NULL;
} else if (!overrides(fm, m)) {
// Found method doesn't override abstract root method.
return NULL;
}
assert(Dependencies::is_concrete_root_method(fm, ctxk) == Dependencies::is_concrete_method(m, ctxk), "mismatch");
#ifndef PRODUCT

View File

@@ -54,11 +54,11 @@ public:
static bool need_keep_alive_barrier(DecoratorSet decorators, BasicType type);
static bool is_strong_access(DecoratorSet decorators) {
return (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF)) == 0;
return (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF | ON_UNKNOWN_OOP_REF)) == 0;
}
static bool is_weak_access(DecoratorSet decorators) {
return (decorators & ON_WEAK_OOP_REF) != 0;
return (decorators & (ON_WEAK_OOP_REF | ON_UNKNOWN_OOP_REF)) != 0;
}
static bool is_phantom_access(DecoratorSet decorators) {
@@ -90,6 +90,8 @@ public:
inline void satb_enqueue(oop value);
inline void iu_barrier(oop obj);
template <DecoratorSet decorators>
inline void keep_alive_if_weak(oop value);
inline void keep_alive_if_weak(DecoratorSet decorators, oop value);
inline void enqueue(oop obj);
@@ -99,17 +101,8 @@ public:
template <class T>
inline oop load_reference_barrier_mutator(oop obj, T* load_addr);
template <class T>
inline oop load_reference_barrier(DecoratorSet decorators, oop obj, T* load_addr);
template <typename T>
inline oop oop_load(DecoratorSet decorators, T* addr);
template <typename T>
inline oop oop_cmpxchg(DecoratorSet decorators, T* addr, oop compare_value, oop new_value);
template <typename T>
inline oop oop_xchg(DecoratorSet decorators, T* addr, oop new_value);
template <DecoratorSet decorators, class T>
inline oop load_reference_barrier(oop obj, T* load_addr);
private:
template <class T>

View File

@@ -99,21 +99,21 @@ inline oop ShenandoahBarrierSet::load_reference_barrier(oop obj) {
return obj;
}
template <class T>
inline oop ShenandoahBarrierSet::load_reference_barrier(DecoratorSet decorators, oop obj, T* load_addr) {
template <DecoratorSet decorators, class T>
inline oop ShenandoahBarrierSet::load_reference_barrier(oop obj, T* load_addr) {
if (obj == NULL) {
return NULL;
}
// Prevent resurrection of unreachable phantom (i.e. weak-native) references.
if ((decorators & ON_PHANTOM_OOP_REF) != 0 &&
if (HasDecorator<decorators, ON_PHANTOM_OOP_REF>::value &&
_heap->is_concurrent_weak_root_in_progress() &&
!_heap->marking_context()->is_marked(obj)) {
return NULL;
}
// Prevent resurrection of unreachable weak references.
if ((decorators & ON_WEAK_OOP_REF) != 0 &&
if ((HasDecorator<decorators, ON_WEAK_OOP_REF>::value || HasDecorator<decorators, ON_UNKNOWN_OOP_REF>::value) &&
_heap->is_concurrent_weak_root_in_progress() &&
!_heap->marking_context()->is_marked_strong(obj)) {
return NULL;
@@ -121,7 +121,7 @@ inline oop ShenandoahBarrierSet::load_reference_barrier(DecoratorSet decorators,
// Prevent resurrection of unreachable objects that are visited during
// concurrent class-unloading.
if ((decorators & AS_NO_KEEPALIVE) != 0 &&
if (HasDecorator<decorators, AS_NO_KEEPALIVE>::value &&
_heap->is_evacuation_in_progress() &&
!_heap->marking_context()->is_marked(obj)) {
return obj;
@@ -184,64 +184,45 @@ inline void ShenandoahBarrierSet::keep_alive_if_weak(DecoratorSet decorators, oo
}
}
template <typename T>
inline oop ShenandoahBarrierSet::oop_load(DecoratorSet decorators, T* addr) {
oop value = RawAccess<>::oop_load(addr);
value = load_reference_barrier(decorators, value, addr);
keep_alive_if_weak(decorators, value);
return value;
}
template <typename T>
inline oop ShenandoahBarrierSet::oop_cmpxchg(DecoratorSet decorators, T* addr, oop compare_value, oop new_value) {
iu_barrier(new_value);
oop res;
oop expected = compare_value;
do {
compare_value = expected;
res = RawAccess<>::oop_atomic_cmpxchg(addr, compare_value, new_value);
expected = res;
} while ((compare_value != expected) && (resolve_forwarded(compare_value) == resolve_forwarded(expected)));
// Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
// because it must be the previous value.
res = load_reference_barrier(decorators, res, reinterpret_cast<T*>(NULL));
satb_enqueue(res);
return res;
}
template <typename T>
inline oop ShenandoahBarrierSet::oop_xchg(DecoratorSet decorators, T* addr, oop new_value) {
iu_barrier(new_value);
oop previous = RawAccess<>::oop_atomic_xchg(addr, new_value);
// Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
// because it must be the previous value.
previous = load_reference_barrier<T>(decorators, previous, reinterpret_cast<T*>(NULL));
satb_enqueue(previous);
return previous;
template <DecoratorSet decorators>
inline void ShenandoahBarrierSet::keep_alive_if_weak(oop value) {
assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
if (!HasDecorator<decorators, ON_STRONG_OOP_REF>::value &&
!HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
satb_enqueue(value);
}
}
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "must be absent");
ShenandoahBarrierSet* const bs = ShenandoahBarrierSet::barrier_set();
return bs->oop_load(decorators, addr);
oop value = Raw::oop_load_not_in_heap(addr);
if (value != NULL) {
ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
value = bs->load_reference_barrier<decorators, T>(value, addr);
bs->keep_alive_if_weak<decorators>(value);
}
return value;
}
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {
assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "must be absent");
ShenandoahBarrierSet* const bs = ShenandoahBarrierSet::barrier_set();
return bs->oop_load(decorators, addr);
oop value = Raw::oop_load_in_heap(addr);
ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
value = bs->load_reference_barrier<decorators, T>(value, addr);
bs->keep_alive_if_weak<decorators>(value);
return value;
}
template <DecoratorSet decorators, typename BarrierSetT>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap_at(oop base, ptrdiff_t offset) {
ShenandoahBarrierSet* const bs = ShenandoahBarrierSet::barrier_set();
oop value = Raw::oop_load_in_heap_at(base, offset);
ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
DecoratorSet resolved_decorators = AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset);
return bs->oop_load(resolved_decorators, AccessInternal::oop_field_addr<decorators>(base, offset));
value = bs->load_reference_barrier<decorators>(value, AccessInternal::oop_field_addr<decorators>(base, offset));
bs->keep_alive_if_weak(resolved_decorators, value);
return value;
}
template <DecoratorSet decorators, typename BarrierSetT>
@@ -273,49 +254,59 @@ inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_st
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_cmpxchg_not_in_heap(T* addr, oop compare_value, oop new_value) {
assert((decorators & (AS_NO_KEEPALIVE | ON_UNKNOWN_OOP_REF)) == 0, "must be absent");
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
return bs->oop_cmpxchg(decorators, addr, compare_value, new_value);
bs->iu_barrier(new_value);
oop res;
oop expected = compare_value;
do {
compare_value = expected;
res = Raw::oop_atomic_cmpxchg(addr, compare_value, new_value);
expected = res;
} while ((compare_value != expected) && (resolve_forwarded(compare_value) == resolve_forwarded(expected)));
// Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
// because it must be the previous value.
res = ShenandoahBarrierSet::barrier_set()->load_reference_barrier<decorators, T>(res, NULL);
bs->satb_enqueue(res);
return res;
}
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_cmpxchg_in_heap(T* addr, oop compare_value, oop new_value) {
assert((decorators & (AS_NO_KEEPALIVE | ON_UNKNOWN_OOP_REF)) == 0, "must be absent");
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
return bs->oop_cmpxchg(decorators, addr, compare_value, new_value);
return oop_atomic_cmpxchg_not_in_heap(addr, compare_value, new_value);
}
template <DecoratorSet decorators, typename BarrierSetT>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_cmpxchg_in_heap_at(oop base, ptrdiff_t offset, oop compare_value, oop new_value) {
assert((decorators & AS_NO_KEEPALIVE) == 0, "must be absent");
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
DecoratorSet resolved_decorators = AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset);
return bs->oop_cmpxchg(resolved_decorators, AccessInternal::oop_field_addr<decorators>(base, offset), compare_value, new_value);
return oop_atomic_cmpxchg_in_heap(AccessInternal::oop_field_addr<decorators>(base, offset), compare_value, new_value);
}
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_xchg_not_in_heap(T* addr, oop new_value) {
assert((decorators & (AS_NO_KEEPALIVE | ON_UNKNOWN_OOP_REF)) == 0, "must be absent");
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
return bs->oop_xchg(decorators, addr, new_value);
bs->iu_barrier(new_value);
oop previous = Raw::oop_atomic_xchg(addr, new_value);
// Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
// because it must be the previous value.
previous = ShenandoahBarrierSet::barrier_set()->load_reference_barrier<decorators, T>(previous, NULL);
bs->satb_enqueue(previous);
return previous;
}
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_xchg_in_heap(T* addr, oop new_value) {
assert((decorators & (AS_NO_KEEPALIVE | ON_UNKNOWN_OOP_REF)) == 0, "must be absent");
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
return bs->oop_xchg(decorators, addr, new_value);
return oop_atomic_xchg_not_in_heap(addr, new_value);
}
template <DecoratorSet decorators, typename BarrierSetT>
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_xchg_in_heap_at(oop base, ptrdiff_t offset, oop new_value) {
assert((decorators & AS_NO_KEEPALIVE) == 0, "must be absent");
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
DecoratorSet resolved_decorators = AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset);
return bs->oop_xchg(resolved_decorators, AccessInternal::oop_field_addr<decorators>(base, offset), new_value);
return oop_atomic_xchg_in_heap(AccessInternal::oop_field_addr<decorators>(base, offset), new_value);
}
// Clone barrier support

View File

@@ -68,17 +68,17 @@ JRT_LEAF(void, ShenandoahRuntime::shenandoah_clone_barrier(oopDesc* src))
JRT_END
JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak(oopDesc * src, oop* load_addr))
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<oop>(ON_WEAK_OOP_REF, oop(src), load_addr);
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<ON_WEAK_OOP_REF, oop>(oop(src), load_addr);
JRT_END
JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak_narrow(oopDesc * src, narrowOop* load_addr))
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<narrowOop>(ON_WEAK_OOP_REF, oop(src), load_addr);
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<ON_WEAK_OOP_REF, narrowOop>(oop(src), load_addr);
JRT_END
JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom(oopDesc * src, oop* load_addr))
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<oop>(ON_PHANTOM_OOP_REF, oop(src), load_addr);
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<ON_PHANTOM_OOP_REF, oop>(oop(src), load_addr);
JRT_END
JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom_narrow(oopDesc * src, narrowOop* load_addr))
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<narrowOop>(ON_PHANTOM_OOP_REF, oop(src), load_addr);
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<ON_PHANTOM_OOP_REF, narrowOop>(oop(src), load_addr);
JRT_END

View File

@@ -268,16 +268,24 @@ static const TypeFunc* clone_type() {
void ZBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* ac) const {
Node* const src = ac->in(ArrayCopyNode::Src);
const TypeAryPtr* ary_ptr = src->get_ptr_type()->isa_aryptr();
if (ac->is_clone_array() && ary_ptr != NULL) {
BasicType bt = ary_ptr->elem()->array_element_basic_type();
if (is_reference_type(bt)) {
// Clone object array
bt = T_OBJECT;
} else {
// Clone primitive array
if (ac->is_clone_array()) {
const TypeAryPtr* ary_ptr = src->get_ptr_type()->isa_aryptr();
BasicType bt;
if (ary_ptr == NULL) {
// ary_ptr can be null iff we are running with StressReflectiveCode
// This code will be unreachable
assert(StressReflectiveCode, "Guard against surprises");
bt = T_LONG;
} else {
bt = ary_ptr->elem()->array_element_basic_type();
if (is_reference_type(bt)) {
// Clone object array
bt = T_OBJECT;
} else {
// Clone primitive array
bt = T_LONG;
}
}
Node* ctrl = ac->in(TypeFunc::Control);
@@ -292,16 +300,13 @@ void ZBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* a
// BarrierSetC2::clone sets the offsets via BarrierSetC2::arraycopy_payload_base_offset
// which 8-byte aligns them to allow for word size copies. Make sure the offsets point
// to the first element in the array when cloning object arrays. Otherwise, load
// barriers are applied to parts of the header. Also adjust the length accordingly.
// barriers are applied to parts of the header.
assert(src_offset == dest_offset, "should be equal");
jlong offset = src_offset->get_long();
if (offset != arrayOopDesc::base_offset_in_bytes(T_OBJECT)) {
assert(!UseCompressedClassPointers, "should only happen without compressed class pointers");
assert((arrayOopDesc::base_offset_in_bytes(T_OBJECT) - offset) == BytesPerLong, "unexpected offset");
length = phase->transform_later(new SubLNode(length, phase->longcon(1))); // Size is in longs
src_offset = phase->longcon(arrayOopDesc::base_offset_in_bytes(T_OBJECT));
dest_offset = src_offset;
}
assert((src_offset->get_long() == arrayOopDesc::base_offset_in_bytes(T_OBJECT) && UseCompressedClassPointers) ||
(src_offset->get_long() == arrayOopDesc::length_offset_in_bytes() && !UseCompressedClassPointers),
"unexpected offset for object array clone");
src_offset = phase->longcon(arrayOopDesc::base_offset_in_bytes(T_OBJECT));
dest_offset = src_offset;
}
Node* payload_src = phase->basic_plus_adr(src, src_offset);
Node* payload_dst = phase->basic_plus_adr(dest, dest_offset);
@@ -325,11 +330,12 @@ void ZBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* a
Node* const dst = ac->in(ArrayCopyNode::Dest);
Node* const size = ac->in(ArrayCopyNode::Length);
assert(ac->is_clone_inst(), "Sanity check");
assert(size->bottom_type()->is_long(), "Should be long");
// The native clone we are calling here expects the instance size in words
// Add header/offset size to payload size to get instance size.
Node* const base_offset = phase->longcon(arraycopy_payload_base_offset(ac->is_clone_array()) >> LogBytesPerLong);
Node* const base_offset = phase->longcon(arraycopy_payload_base_offset(false) >> LogBytesPerLong);
Node* const full_size = phase->transform_later(new AddLNode(size, base_offset));
Node* const call = phase->make_leaf_call(ctrl,

View File

@@ -113,12 +113,10 @@ class JfrNetworkInterfaceName : public JfrSerializer {
void serialize(JfrCheckpointWriter& writer) {} // we write each constant lazily
void on_rotation() {
if (_interfaces != NULL) {
for (int i = 0; i < _interfaces->length(); ++i) {
const InterfaceEntry &entry = _interfaces->at(i);
if (entry.written) {
entry.written = false;
}
for (int i = 0; i < _interfaces->length(); ++i) {
const InterfaceEntry& entry = _interfaces->at(i);
if (entry.written) {
entry.written = false;
}
}
}

View File

@@ -3011,18 +3011,6 @@ InstanceKlass* InstanceKlass::compute_enclosing_class(bool* inner_is_member, TRA
constantPoolHandle i_cp(THREAD, constants());
if (ooff != 0) {
Klass* ok = i_cp->klass_at(ooff, CHECK_NULL);
if (!ok->is_instance_klass()) {
// If the outer class is not an instance klass then it cannot have
// declared any inner classes.
ResourceMark rm(THREAD);
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IncompatibleClassChangeError(),
"%s and %s disagree on InnerClasses attribute",
ok->external_name(),
external_name());
return NULL;
}
outer_klass = InstanceKlass::cast(ok);
*inner_is_member = true;
}

View File

@@ -736,6 +736,13 @@ void CallGenerator::do_late_inline_helper() {
C->set_default_node_notes(entry_nn);
}
// Virtual call involves a receiver null check which can be made implicit.
if (is_virtual_late_inline()) {
GraphKit kit(jvms);
kit.null_check_receiver();
jvms = kit.transfer_exceptions_into_jvms();
}
// Now perform the inlining using the synthesized JVMState
JVMState* new_jvms = inline_cg()->generate(jvms);
if (new_jvms == NULL) return; // no change

View File

@@ -529,6 +529,13 @@ void GraphKit::uncommon_trap_if_should_post_on_exceptions(Deoptimization::DeoptR
void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) {
bool must_throw = true;
if (env()->jvmti_can_post_on_exceptions()) {
// check if we must post exception events, take uncommon trap if so
uncommon_trap_if_should_post_on_exceptions(reason, must_throw);
// here if should_post_on_exceptions is false
// continue on with the normal codegen
}
// If this particular condition has not yet happened at this
// bytecode, then use the uncommon trap mechanism, and allow for
// a future recompilation if several traps occur here.
@@ -591,13 +598,6 @@ void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) {
}
if (failing()) { stop(); return; } // exception allocation might fail
if (ex_obj != NULL) {
if (env()->jvmti_can_post_on_exceptions()) {
// check if we must post exception events, take uncommon trap if so
uncommon_trap_if_should_post_on_exceptions(reason, must_throw);
// here if should_post_on_exceptions is false
// continue on with the normal codegen
}
// Cheat with a preallocated exception object.
if (C->log() != NULL)
C->log()->elem("hot_throw preallocated='1' reason='%s'",

View File

@@ -114,11 +114,10 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
if( !t->singleton() ) return NULL;
// No intervening control, like a simple Call
Node* r = iff->in(0);
if (!r->is_Region() || r->is_Loop() || phi->region() != r || r->as_Region()->is_copy()) {
return NULL;
}
Node *r = iff->in(0);
if( !r->is_Region() ) return NULL;
if (r->is_Loop()) return NULL;
if( phi->region() != r ) return NULL;
// No other users of the cmp/bool
if (b->outcnt() != 1 || cmp->outcnt() != 1) {
//tty->print_cr("many users of cmp/bool");
@@ -244,23 +243,13 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
}
Node* proj = PhaseIdealLoop::find_predicate(r->in(ii));
if (proj != NULL) {
// Bail out if splitting through a region with a predicate input (could
// also be a loop header before loop opts creates a LoopNode for it).
return NULL;
}
}
// If all the defs of the phi are the same constant, we already have the desired end state.
// Skip the split that would create empty phi and region nodes.
if ((r->req() - req_c) == 1) {
return NULL;
}
// At this point we know that we can apply the split if optimization. If the region is still on the worklist,
// we should wait until it is processed. The region might be removed which makes this optimization redundant.
// This also avoids the creation of dead data loops when rewiring data nodes below when a region is dying.
if (igvn->_worklist.member(r)) {
igvn->_worklist.push(iff); // retry split if later again
if((r->req() - req_c) == 1) {
return NULL;
}

View File

@@ -3362,7 +3362,6 @@ bool IdealLoopTree::iteration_split_impl(PhaseIdealLoop *phase, Node_List &old_n
phase->do_peeling(this, old_new);
} else if (policy_unswitching(phase)) {
phase->do_unswitching(this, old_new);
return false; // need to recalculate idom data
}
return true;
}
@@ -3381,7 +3380,7 @@ bool IdealLoopTree::iteration_split_impl(PhaseIdealLoop *phase, Node_List &old_n
if (cl->is_normal_loop()) {
if (policy_unswitching(phase)) {
phase->do_unswitching(this, old_new);
return false; // need to recalculate idom data
return true;
}
if (policy_maximally_unroll(phase)) {
// Here we did some unrolling and peeling. Eventually we will
@@ -3494,7 +3493,6 @@ bool IdealLoopTree::iteration_split(PhaseIdealLoop* phase, Node_List &old_new) {
AutoNodeBudget node_budget(phase);
if (policy_unswitching(phase)) {
phase->do_unswitching(this, old_new);
return false; // need to recalculate idom data
}
}
}

Some files were not shown because too many files have changed in this diff Show More