mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-06 16:41:43 +01:00
Compare commits
197 Commits
jdk-14+28
...
jb14_0_1-b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec04f240d0 | ||
|
|
7f16bf3d2a | ||
|
|
01b1e43caf | ||
|
|
a088ea7a22 | ||
|
|
0e6072ffc4 | ||
|
|
fd420cda55 | ||
|
|
8efe07ac52 | ||
|
|
f685f2dac1 | ||
|
|
5505211785 | ||
|
|
feacdbe1ed | ||
|
|
bd239e2e67 | ||
|
|
0baf10364a | ||
|
|
2e2fe0daa7 | ||
|
|
6cab3cee0d | ||
|
|
48607c2bd8 | ||
|
|
1d90a4efaf | ||
|
|
61315cec50 | ||
|
|
6c277514cd | ||
|
|
b3f7acae0e | ||
|
|
d3d647482c | ||
|
|
a438190dd0 | ||
|
|
077c459a42 | ||
|
|
88a9f6aac1 | ||
|
|
77edf91292 | ||
|
|
1871da9d1c | ||
|
|
b63167860a | ||
|
|
de199a7120 | ||
|
|
862d57aa49 | ||
|
|
405c69f3cb | ||
|
|
d461bf7869 | ||
|
|
9fa51d6334 | ||
|
|
69e522b1c6 | ||
|
|
3105f0cd04 | ||
|
|
59ce59ba82 | ||
|
|
8ca73521c2 | ||
|
|
d0f24cad2c | ||
|
|
f7909316f1 | ||
|
|
d900c998b4 | ||
|
|
18ce94e157 | ||
|
|
768cbfdb61 | ||
|
|
7cb7464329 | ||
|
|
ab19e95c30 | ||
|
|
b8a4deee83 | ||
|
|
4de7d27f51 | ||
|
|
ddab99867f | ||
|
|
57a54f2c11 | ||
|
|
5ed4b9f2c0 | ||
|
|
ae39310243 | ||
|
|
c63a8d1090 | ||
|
|
ba7d18db86 | ||
|
|
9ec5da00bc | ||
|
|
7db8a1762f | ||
|
|
953fbd2e66 | ||
|
|
5495efdb84 | ||
|
|
06bf842d9a | ||
|
|
cdd3cc4a0b | ||
|
|
c2e69df562 | ||
|
|
8c33bba226 | ||
|
|
cdedede9ca | ||
|
|
933bb55c49 | ||
|
|
42726a87e9 | ||
|
|
2760497b01 | ||
|
|
f8f98bdbff | ||
|
|
f4f7dbd54c | ||
|
|
2f2594d5d0 | ||
|
|
4df9b91002 | ||
|
|
b94b082727 | ||
|
|
9d4f3b2c2c | ||
|
|
e3c7f43298 | ||
|
|
f7165c322a | ||
|
|
c26aa638a1 | ||
|
|
85255c54da | ||
|
|
96f5699e92 | ||
|
|
af5ff9aeee | ||
|
|
5903e20af2 | ||
|
|
995fae6d4b | ||
|
|
e3eb6dbd1f | ||
|
|
b95d34698e | ||
|
|
b4ba74321b | ||
|
|
f0c804676c | ||
|
|
bdc9d3dee2 | ||
|
|
40d0110ac6 | ||
|
|
099184950b | ||
|
|
8787b9a66d | ||
|
|
006b5e0f96 | ||
|
|
643a98d553 | ||
|
|
ae81cfa30f | ||
|
|
a91ec31636 | ||
|
|
9ec4001d87 | ||
|
|
0b70f01e98 | ||
|
|
79ec4004d7 | ||
|
|
03cd98e15b | ||
|
|
72a35c899e | ||
|
|
6ee7f3734d | ||
|
|
5ff1d72185 | ||
|
|
6d03f918cf | ||
|
|
a35d087f54 | ||
|
|
eccf39b295 | ||
|
|
1507a1fb67 | ||
|
|
27d782be64 | ||
|
|
87c5a28403 | ||
|
|
72db22cb12 | ||
|
|
0b5f4f77e4 | ||
|
|
231d9afe6f | ||
|
|
89f2d14518 | ||
|
|
ef5b447b04 | ||
|
|
4e29c964f9 | ||
|
|
03073cd46d | ||
|
|
af4ad226c8 | ||
|
|
3e9a17c53e | ||
|
|
cc99075c79 | ||
|
|
50a56141ba | ||
|
|
320d4b7f72 | ||
|
|
aa3a79a29b | ||
|
|
0cb75321ef | ||
|
|
e72f6028fb | ||
|
|
151ab6acc1 | ||
|
|
44f7fe57a8 | ||
|
|
9549cd2877 | ||
|
|
ea152dcd9b | ||
|
|
8e2c1c68f6 | ||
|
|
6fc159f17c | ||
|
|
2afe1c6c23 | ||
|
|
34b9c84af4 | ||
|
|
fca022b43b | ||
|
|
4692bc58eb | ||
|
|
2c7c8023ed | ||
|
|
0b542e3bae | ||
|
|
fe8e1aacd1 | ||
|
|
b7e74ef62f | ||
|
|
78df4d412e | ||
|
|
feccf3cdb6 | ||
|
|
89f7e1925e | ||
|
|
d6a2a079d1 | ||
|
|
b81bfcbff1 | ||
|
|
efc96d1c07 | ||
|
|
d94f8c91c9 | ||
|
|
d8e3d8af7b | ||
|
|
7cd4d9ac6a | ||
|
|
863f741611 | ||
|
|
b1df8adbf8 | ||
|
|
6e467d4d02 | ||
|
|
cd74b2a23d | ||
|
|
0a4d6f6925 | ||
|
|
e5b0568e1c | ||
|
|
0239771501 | ||
|
|
7ed4930a8e | ||
|
|
ba6cedcf24 | ||
|
|
9e09ba5e13 | ||
|
|
49b1cc8ee6 | ||
|
|
39d46a1f76 | ||
|
|
44765b8218 | ||
|
|
e7a07ea2f3 | ||
|
|
45e4c4c4dc | ||
|
|
1e67b2c457 | ||
|
|
da03b15fac | ||
|
|
417672bc9d | ||
|
|
34b08ed2a5 | ||
|
|
5acd373a10 | ||
|
|
304ab31cff | ||
|
|
773b7b6c4b | ||
|
|
950ebec4a9 | ||
|
|
51abf67ce1 | ||
|
|
4deb35453f | ||
|
|
59216c2e77 | ||
|
|
8d00c5aa0d | ||
|
|
ffdf1dea9b | ||
|
|
261f4bffae | ||
|
|
cfddf53c01 | ||
|
|
c751493f0c | ||
|
|
9847d8161b | ||
|
|
cbcb488d77 | ||
|
|
4b1be3ecf9 | ||
|
|
ca112043f1 | ||
|
|
0591a66b90 | ||
|
|
450b97f593 | ||
|
|
be6b4aab40 | ||
|
|
0562caa4cb | ||
|
|
02cc064144 | ||
|
|
796f3ba8be | ||
|
|
34e36a8c01 | ||
|
|
c5f884c6d1 | ||
|
|
a0f8febb8b | ||
|
|
10b1e756e2 | ||
|
|
68c5b95b13 | ||
|
|
be35f9ef53 | ||
|
|
24a7ba0c61 | ||
|
|
f3815c85a1 | ||
|
|
af20c6b9c4 | ||
|
|
7c32a6aeae | ||
|
|
bda0fba56b | ||
|
|
40429eea41 | ||
|
|
10b010d0f5 | ||
|
|
6cb8dfa9e3 | ||
|
|
1236be7e4a | ||
|
|
3375411e1b | ||
|
|
2215201dd5 |
11
.hgtags
11
.hgtags
@@ -600,3 +600,14 @@ c16ac7a2eba4e73cb4f7ee9294dd647860eebff0 jdk-14+21
|
||||
17d242844fc9e7d18b3eac97426490a9c246119e jdk-14+25
|
||||
288777cf0702914e5266bc1e5d380eed9032ca41 jdk-14+26
|
||||
91a3f092682fc715d991a87eb6ec6f28886d2035 jdk-14+27
|
||||
2069b4bfd23b56b6fc659fba8b75aaaa23debbe0 jdk-14+28
|
||||
563fa900fa17c290ae516c7a3a69e8c069dde304 jdk-14+29
|
||||
d54ce919da90dab361995bb4d87be9851f00537a jdk-14+30
|
||||
d54ce919da90dab361995bb4d87be9851f00537a jdk-14+31
|
||||
d54ce919da90dab361995bb4d87be9851f00537a jdk-14+31
|
||||
decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31
|
||||
2776da28515e087cc8849acf1e131a65ea7e77b6 jdk-14+32
|
||||
f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33
|
||||
a96bc204e3b31ddbf909b20088964112f052927e jdk-14+34
|
||||
4a87bb7ebfd7f6a25ec59a5982fe3607242777f8 jdk-14+35
|
||||
bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14+36
|
||||
|
||||
9
jb/project/docker/Dockerfile
Normal file
9
jb/project/docker/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
# jetbrains/runtime:jbr14env
|
||||
FROM centos:7
|
||||
|
||||
RUN yum -y install zip bzip2 unzip tar wget make autoconf automake libtool gcc gcc-c++ libstdc++-devel alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel freetype-devel file which libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel git
|
||||
# Install Java 13
|
||||
RUN wget https://download.java.net/java/GA/jdk13.0.1/cec27d702aa74d5a8630c65ae61e4305/9/GPL/openjdk-13.0.1_linux-x64_bin.tar.gz \
|
||||
-O - | tar xz -C /
|
||||
ENV JAVA_HOME /jbrsdk
|
||||
ENV PATH $JAVA_HOME/bin:$PATH
|
||||
10
jb/project/docker/x86/Dockerfile
Normal file
10
jb/project/docker/x86/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM i386/ubuntu:xenial
|
||||
|
||||
RUN linux32 apt-get update && apt-get install -y --no-install-recommends apt-utils
|
||||
RUN linux32 apt-get -y install file build-essential zip unzip tar wget curl libx11-dev libxext-dev \
|
||||
libxrender-dev libxrandr-dev libxtst-dev libxt-dev libcups2-dev libasound2-data \
|
||||
libpng12-0 libasound2 libfreetype6 libfontconfig1-dev libasound2-dev autoconf git
|
||||
RUN wget https://cdn.azul.com/zulu/bin/zulu13.31.11-ca-jdk13.0.3-linux_i686.tar.gz \
|
||||
-O - | tar xz -C /
|
||||
ENV JAVA_HOME /zulu13.31.11-ca-jdk13.0.3-linux_i686
|
||||
ENV PATH $JAVA_HOME/bin:$PATH
|
||||
3
jb/project/tools/common.sh
Normal file
3
jb/project/tools/common.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
VENDOR_NAME="JetBrains s.r.o."
|
||||
VENDOR_VERSION_STRING="JBR-${JBSDK_VERSION_WITH_DOTS}.${JDK_BUILD_NUMBER}-${build_number}"
|
||||
[ -z ${bundle_type} ] || VENDOR_VERSION_STRING="${VENDOR_VERSION_STRING}-${bundle_type}"
|
||||
34
jb/project/tools/exclude_jcef_module.patch
Normal file
34
jb/project/tools/exclude_jcef_module.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
Index: modules.list
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
--- modules.list (revision a73d4ecbefe65fd6d79b78663d916ff71b5346f7)
|
||||
+++ modules.list (date 1589581743550)
|
||||
@@ -54,5 +54,4 @@
|
||||
jdk.unsupported,
|
||||
jdk.xml.dom,
|
||||
jdk.zipfs,
|
||||
-jdk.hotspot.agent,
|
||||
-jcef
|
||||
+jdk.hotspot.agent
|
||||
Index: src/java.desktop/share/classes/module-info.java
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
--- src/java.desktop/share/classes/module-info.java (revision a73d4ecbefe65fd6d79b78663d916ff71b5346f7)
|
||||
+++ src/java.desktop/share/classes/module-info.java (date 1589581743547)
|
||||
@@ -109,11 +109,7 @@
|
||||
// see make/GensrcModuleInfo.gmk
|
||||
exports sun.awt to
|
||||
jdk.accessibility,
|
||||
- jdk.unsupported.desktop,
|
||||
- jcef;
|
||||
-
|
||||
- exports sun.lwawt.macosx to jcef;
|
||||
- exports sun.lwawt to jcef;
|
||||
+ jdk.unsupported.desktop;
|
||||
|
||||
exports java.awt.dnd.peer to jdk.unsupported.desktop;
|
||||
exports sun.awt.dnd to jdk.unsupported.desktop;
|
||||
85
jb/project/tools/linux/scripts/mkimages_aarch64.sh
Executable file
85
jb/project/tools/linux/scripts/mkimages_aarch64.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-import-modules=./modular-sdk \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=linux-aarch64-server-release || exit $?
|
||||
make images CONF=linux-aarch64-server-release test-image || exit $?
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-aarch64-b${build_number}
|
||||
BASE_DIR=build/linux-aarch64-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
|
||||
tar -pcf $JBSDK.tar \
|
||||
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
|
||||
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-aarch64-b$build_number
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.aarch64
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.aarch64 | sed s/" "//g | sed s/,$//g) \
|
||||
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
|
||||
|
||||
echo Modifying release info ...
|
||||
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
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 $?
|
||||
110
jb/project/tools/linux/scripts/mkimages_x64.sh
Executable file
110
jb/project/tools/linux/scripts/mkimages_x64.sh
Executable file
@@ -0,0 +1,110 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles with jcef
|
||||
# empty - the bundles without jcef
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function create_jbr {
|
||||
|
||||
if [ -z "${bundle_type}" ]; then
|
||||
JBR_BUNDLE=jbr
|
||||
else
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
fi
|
||||
JBR_BASE_NAME=${JBR_BUNDLE}-${JBSDK_VERSION}
|
||||
cat modules.list > modules_tmp.list
|
||||
rm -rf ${BASE_DIR}/jbr
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-x64-b$build_number
|
||||
|
||||
echo Running jlink....
|
||||
$JSDK/bin/jlink \
|
||||
--module-path $JSDK/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
if [ ! -z "${bundle_type}" ]; then
|
||||
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
|
||||
cp -R jcef_linux_x64/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
|
||||
fi
|
||||
grep -v "^JAVA_VERSION" $JSDK/release | grep -v "^MODULES" >> $BASE_DIR/$JBR_BUNDLE/release
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
tar -pcf $JBR.tar -C $BASE_DIR jbr || exit $?
|
||||
gzip $JBR.tar || exit $?
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
|
||||
|
||||
git checkout -- modules.list
|
||||
git checkout -- src/java.desktop/share/classes/module-info.java
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-import-modules=./modular-sdk \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--enable-cds=yes || exit $?
|
||||
|
||||
make images CONF=linux-x86_64-server-release || exit $?
|
||||
|
||||
JSDK=build/linux-x86_64-server-release/images/jdk
|
||||
JBSDK=$JBRSDK_BASE_NAME-linux-x64-b$build_number
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
BASE_DIR=build/linux-x86_64-server-release/images
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
if [[ "$bundle_type" == *jcef* ]]; then
|
||||
cp -R jcef_linux_x64/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
|
||||
fi
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
|
||||
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
|
||||
-C $BASE_DIR $JBRSDK_BUNDLE || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
create_jbr || exit $?
|
||||
|
||||
make test-image || exit $?
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x64-b$build_number
|
||||
|
||||
echo Creating $JBSDK_TEST.tar.gz ...
|
||||
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' test || exit $?
|
||||
gzip $JBRSDK_TEST.tar || exit $?
|
||||
82
jb/project/tools/linux/scripts/mkimages_x64_fd.sh
Executable file
82
jb/project/tools/linux/scripts/mkimages_x64_fd.sh
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=fastdebug \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-import-modules=./modular-sdk \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=linux-x86_64-server-fastdebug || exit $?
|
||||
make images CONF=linux-x86_64-server-fastdebug || exit $?
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-x64-fastdebug-b${build_number}
|
||||
BASE_DIR=build/linux-x86_64-server-fastdebug/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
cp -R jcef_linux_x64/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
|
||||
tar -pcf $JBSDK.tar \
|
||||
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
|
||||
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-x64-fastdebug-b$build_number
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list | sed s/" "//g | sed s/,$//g) \
|
||||
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
|
||||
cp -R jcef_linux_x64/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
|
||||
|
||||
echo Modifying release info ...
|
||||
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
tar -czf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
|
||||
gzip $JBR.tar || exit $?
|
||||
81
jb/project/tools/linux/scripts/mkimages_x86.sh
Executable file
81
jb/project/tools/linux/scripts/mkimages_x86.sh
Executable file
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
linux32 bash configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=$JDK_BUILD_NUMBER \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=linux-x86-server-release || exit $?
|
||||
make images CONF=linux-x86-server-release test-image || exit $?
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-x86-b${build_number}
|
||||
BASE_DIR=build/linux-x86-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
|
||||
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man -C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-x86-b$build_number
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.x86 | sed s/" "//g | sed s/,$//g) --output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
|
||||
|
||||
echo Modifying release info ...
|
||||
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
tar -pcf $JBR.tar -C $BASE_DIR $JBR_BUNDLE || exit $?
|
||||
gzip $JBR.tar || exit $?
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x86-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' --exclude='test/hotspot/gtest' test || exit $?
|
||||
gzip $JBRSDK_TEST.tar || exit $?
|
||||
16
jb/project/tools/mac/scripts/entitlements.xml
Normal file
16
jb/project/tools/mac/scripts/entitlements.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
116
jb/project/tools/mac/scripts/mkimages.sh
Executable file
116
jb/project/tools/mac/scripts/mkimages.sh
Executable file
@@ -0,0 +1,116 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles with jcef
|
||||
# empty - the bundles without jcef
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
MAJOR_JBSDK_VERSION=$(echo $JBSDK_VERSION_WITH_DOTS | awk -F "." '{print $1}')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function create_jbr {
|
||||
|
||||
if [ -z "${bundle_type}" ]; then
|
||||
JBR_BUNDLE=jbr
|
||||
else
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
fi
|
||||
JBR_BASE_NAME=${JBR_BUNDLE}-${JBSDK_VERSION}
|
||||
cat modules.list > modules_tmp.list
|
||||
rm -rf ${BASE_DIR}/jbr
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
|
||||
JRE_CONTENTS=${BASE_DIR}/${JBR_BUNDLE}/Contents
|
||||
JRE_HOME=${JRE_CONTENTS}/Home
|
||||
if [ -d "${JRE_CONTENTS}" ]; then
|
||||
rm -rf ${JRE_CONTENTS}
|
||||
fi
|
||||
mkdir -p ${JRE_CONTENTS}
|
||||
|
||||
JBR=${JBR_BASE_NAME}-osx-x64-b${build_number}
|
||||
|
||||
echo Running jlink....
|
||||
${BASE_DIR}/$JBRSDK_BUNDLE/Contents/Home/bin/jlink \
|
||||
--module-path ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JRE_HOME} || exit $?
|
||||
grep -v "^JAVA_VERSION" ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release | grep -v "^MODULES" >> ${JRE_HOME}/release
|
||||
cp -R ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/MacOS ${JRE_CONTENTS}
|
||||
cp ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Info.plist ${JRE_CONTENTS}
|
||||
|
||||
rm -rf ${JRE_CONTENTS}/Frameworks || exit $?
|
||||
[ ! -z "${bundle_type}" ] && (cp -a jcef_mac/Frameworks ${JRE_CONTENTS} || exit $?)
|
||||
|
||||
echo Creating ${JBR}.tar.gz ...
|
||||
[ ! -z "${bundle_type}" ] && cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
|
||||
COPYFILE_DISABLE=1 tar -pczf ${JBR}.tar.gz --exclude='*.dSYM' --exclude='man' -C ${BASE_DIR} jbr || exit $?
|
||||
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
git checkout -- modules.list
|
||||
git checkout -- src/java.desktop/share/classes/module-info.java
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-import-modules=./modular-sdk \
|
||||
--with-boot-jdk=`/usr/libexec/java_home -v 14` \
|
||||
--enable-cds=yes || exit $?
|
||||
|
||||
make images CONF=macosx-x86_64-server-release || exit $?
|
||||
|
||||
JSDK=build/macosx-x86_64-server-release/images/jdk-bundle
|
||||
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-b${build_number}
|
||||
|
||||
BASE_DIR=jre
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
rm -rf $BASE_DIR
|
||||
mkdir $BASE_DIR || exit $?
|
||||
cp -a $JSDK/jdk-$MAJOR_JBSDK_VERSION.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
if [[ "$bundle_type" == *jcef* ]]; then
|
||||
cp -a jcef_mac/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
|
||||
fi
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release
|
||||
COPYFILE_DISABLE=1 tar -pczf $JBSDK.tar.gz -C $BASE_DIR \
|
||||
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
|
||||
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \
|
||||
$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
create_jbr || exit $?
|
||||
|
||||
make test-image || exit $?
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-osx-test-x64-b$build_number
|
||||
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
COPYFILE_DISABLE=1 tar -pczf $JBRSDK_TEST.tar.gz -C build/macosx-x86_64-server-release/images \
|
||||
--exclude='test/jdk/demos' test || exit $?
|
||||
89
jb/project/tools/mac/scripts/mkimages_fd.sh
Executable file
89
jb/project/tools/mac/scripts/mkimages_fd.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
MAJOR_JBSDK_VERSION=$(echo $JBSDK_VERSION_WITH_DOTS | awk -F "." '{print $1}')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=fastdebug \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-import-modules=./modular-sdk \
|
||||
--with-boot-jdk=`/usr/libexec/java_home -v 14` \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=macosx-x86_64-server-fastdebug || exit $?
|
||||
make images CONF=macosx-x86_64-server-fastdebug || exit $?
|
||||
|
||||
JSDK=build/macosx-x86_64-server-fastdebug/images/jdk-bundle
|
||||
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-fastdebug-b${build_number}
|
||||
|
||||
BASE_DIR=jre
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
rm -rf $BASE_DIR
|
||||
mkdir $BASE_DIR || exit $?
|
||||
cp -a $JSDK/jdk-$MAJOR_JBSDK_VERSION.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
cp -a jcef_mac/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
|
||||
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release
|
||||
|
||||
COPYFILE_DISABLE=1 \
|
||||
tar -pczf ${JBSDK}.tar.gz -C ${BASE_DIR} \
|
||||
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
|
||||
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \
|
||||
${JBRSDK_BUNDLE} || exit $?
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JRE_CONTENTS=$BASE_DIR/$JBR_BUNDLE/Contents
|
||||
JRE_HOME=$JRE_CONTENTS/Home
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
|
||||
mkdir -p $JRE_CONTENTS
|
||||
|
||||
if [ -d "$JRE_HOME" ]; then
|
||||
rm -rf $JRE_HOME
|
||||
fi
|
||||
|
||||
JBR=${JBR_BASE_NAME}-osx-x64-fastdebug-b${build_number}
|
||||
|
||||
$BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/bin/jlink \
|
||||
--module-path $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list | sed s/" "//g) --output $JRE_HOME || exit $?
|
||||
grep -v "^JAVA_VERSION" $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/release | grep -v "^MODULES" >> $JRE_HOME/release
|
||||
cp -R $BASE_DIR/$JBRSDK_BUNDLE/Contents/MacOS $JRE_CONTENTS
|
||||
cp $BASE_DIR/$JBRSDK_BUNDLE/Contents/Info.plist $JRE_CONTENTS
|
||||
cp -a jcef_mac/Frameworks ${JRE_CONTENTS} || exit $?
|
||||
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
COPYFILE_DISABLE=1 tar -pczf $JBR.tar.gz --exclude='*.dSYM' --exclude='man' -C $BASE_DIR $JBR_BUNDLE || exit $?
|
||||
120
jb/project/tools/mac/scripts/notarize.sh
Executable file
120
jb/project/tools/mac/scripts/notarize.sh
Executable file
@@ -0,0 +1,120 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP_DIRECTORY=$1
|
||||
APPL_USER=$2
|
||||
APPL_PASSWORD=$3
|
||||
APP_NAME=$4
|
||||
BUNDLE_ID=$5
|
||||
FAKE_ROOT="${6:-fake-root}"
|
||||
|
||||
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$APPL_USER" ]] || [[ -z "$APPL_PASSWORD" ]]; then
|
||||
echo "Usage: $0 AppDirectory Username Password"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "$APP_DIRECTORY" ]]; then
|
||||
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
function publish-log() {
|
||||
id=$1
|
||||
file=$2
|
||||
curl -T "$file" "$ARTIFACTORY_URL/$id" || true
|
||||
}
|
||||
|
||||
function altool-upload() {
|
||||
# Since altool uses same file for upload token we have to trick it into using different folders for token file location
|
||||
# Also it copies zip into TMPDIR so we override it too, to simplify cleanup
|
||||
OLD_HOME="$HOME"
|
||||
export HOME="$FAKE_ROOT/home"
|
||||
export TMPDIR="$FAKE_ROOT/tmp"
|
||||
mkdir -p "$HOME"
|
||||
mkdir -p "$TMPDIR"
|
||||
export _JAVA_OPTIONS="-Duser.home=$HOME -Djava.io.tmpdir=$TMPDIR"
|
||||
# Reduce amount of downloads, cache transporter libraries
|
||||
shared_itmstransporter="$OLD_HOME/shared-itmstransporter"
|
||||
if [[ -f "$shared_itmstransporter" ]]; then
|
||||
cp -r "$shared_itmstransporter" "$HOME/.itmstransporter"
|
||||
fi
|
||||
# For some reason altool prints everything to stderr, not stdout
|
||||
set +e
|
||||
xcrun altool --notarize-app \
|
||||
--username "$APPL_USER" --password "$APPL_PASSWORD" \
|
||||
--primary-bundle-id "$BUNDLE_ID" \
|
||||
--asc-provider JetBrainssro --file "$1" 2>&1 | tee "altool.init.out"
|
||||
unset TMPDIR
|
||||
export HOME="$OLD_HOME"
|
||||
set -e
|
||||
}
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
file="$APP_NAME.zip"
|
||||
|
||||
log "Zipping $file..."
|
||||
rm -rf "$file"
|
||||
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY/Contents" "$file"
|
||||
|
||||
log "Notarizing $file..."
|
||||
rm -rf "altool.init.out" "altool.check.out"
|
||||
altool-upload "$file"
|
||||
|
||||
rm -rf "$file"
|
||||
|
||||
notarization_info="$(grep -e "RequestUUID" "altool.init.out" | grep -oE '([0-9a-f-]{36})')"
|
||||
|
||||
if [ -z "$notarization_info" ]; then
|
||||
log "Faile to read RequestUUID from altool.init.out"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
PATH="$PATH:/usr/local/bin/"
|
||||
|
||||
log "Notarization request sent, awaiting response"
|
||||
spent=0
|
||||
|
||||
while true; do
|
||||
# For some reason altool prints everything to stderr, not stdout
|
||||
xcrun altool --username "$APPL_USER" --notarization-info "$notarization_info" --password "$APPL_PASSWORD" >"altool.check.out" 2>&1 || true
|
||||
status="$(grep -oe 'Status: .*' "altool.check.out" | cut -c 9- || true)"
|
||||
log "Current status: $status"
|
||||
if [ "$status" = "invalid" ]; then
|
||||
log "Notarization failed"
|
||||
ec=1
|
||||
elif [ "$status" = "success" ]; then
|
||||
log "Notarization succeeded"
|
||||
ec=0
|
||||
else
|
||||
if [ "$status" != "in progress" ]; then
|
||||
log "Unknown notarization status, waiting more, altool output:"
|
||||
cat "altool.check.out"
|
||||
fi
|
||||
if [[ $spent -gt 60 ]]; then
|
||||
log "Waiting time out (apx 60 minutes)"
|
||||
ec=2
|
||||
break
|
||||
fi
|
||||
sleep 60
|
||||
((spent += 1))
|
||||
continue
|
||||
fi
|
||||
developer_log="developer_log.json"
|
||||
log "Fetching $developer_log"
|
||||
# TODO: Replace cut with trim or something better
|
||||
url="$(grep -oe 'LogFileURL: .*' "altool.check.out" | cut -c 13-)"
|
||||
wget "$url" -O "$developer_log" && cat "$developer_log" || true
|
||||
if [ $ec != 0 ]; then
|
||||
log "Publishing $developer_log"
|
||||
publish-log "$notarization_info" "$developer_log"
|
||||
fi
|
||||
break
|
||||
done
|
||||
cat "altool.check.out"
|
||||
|
||||
rm -rf "altool.init.out" "altool.check.out"
|
||||
exit $ec
|
||||
94
jb/project/tools/mac/scripts/sign.sh
Executable file
94
jb/project/tools/mac/scripts/sign.sh
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP_DIRECTORY=$1
|
||||
JB_CERT=$2
|
||||
|
||||
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$JB_CERT" ]]; then
|
||||
echo "Usage: $0 AppDirectory CertificateID"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "$APP_DIRECTORY" ]]; then
|
||||
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
# Cleanup files left from previous sign attempt (if any)
|
||||
find "$APP_DIRECTORY" -name '*.cstemp' -exec rm '{}' \;
|
||||
|
||||
log "Signing libraries and executables..."
|
||||
# -perm +111 searches for executables
|
||||
for f in \
|
||||
"Contents/Home/bin" \
|
||||
"Contents/Home/lib" \
|
||||
"Contents/Frameworks"; do
|
||||
if [ -d "$APP_DIRECTORY/$f" ]; then
|
||||
find "$APP_DIRECTORY/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
|
||||
-exec codesign --timestamp \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--entitlements entitlements.xml {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
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 "$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"
|
||||
|
||||
rm -rf jarfolder jar.jar
|
||||
mkdir jarfolder
|
||||
filename="${file##*/}"
|
||||
log "Filename: $filename"
|
||||
cp "$file" jarfolder && (cd jarfolder && jar xf "$filename" && rm "$filename")
|
||||
|
||||
find jarfolder \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "jattach" \) \
|
||||
-exec codesign --timestamp \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--entitlements entitlements.xml {} \;
|
||||
|
||||
(cd jarfolder; zip -q -r -o ../jar.jar .)
|
||||
mv jar.jar "$file"
|
||||
done
|
||||
|
||||
rm -rf jarfolder jar.jar
|
||||
|
||||
log "Signing other files..."
|
||||
for f in \
|
||||
"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 \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--entitlements entitlements.xml {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
#log "Signing executable..."
|
||||
#codesign --timestamp \
|
||||
# -v -s "$JB_CERT" --options=runtime \
|
||||
# --force \
|
||||
# --entitlements entitlements.xml "$APP_DIRECTORY/Contents/MacOS/idea"
|
||||
|
||||
log "Signing whole app..."
|
||||
codesign --timestamp \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements entitlements.xml "$APP_DIRECTORY"
|
||||
|
||||
log "Verifying java is not broken"
|
||||
find "$APP_DIRECTORY" \
|
||||
-type f -name 'java' -perm +111 -exec {} -version \;
|
||||
138
jb/project/tools/mac/scripts/signapp.sh
Executable file
138
jb/project/tools/mac/scripts/signapp.sh
Executable file
@@ -0,0 +1,138 @@
|
||||
#!/bin/bash
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
|
||||
export COPYFILE_DISABLE=true
|
||||
|
||||
INPUT_FILE=$1
|
||||
EXPLODED=$2.exploded
|
||||
BACKUP_JMODS=$2.backup
|
||||
USERNAME=$3
|
||||
PASSWORD=$4
|
||||
CODESIGN_STRING=$5
|
||||
NOTARIZE=$6
|
||||
BUNDLE_ID=$7
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
log "Deleting $EXPLODED ..."
|
||||
if test -d "$EXPLODED"; then
|
||||
find "$EXPLODED" -mindepth 1 -maxdepth 1 -exec chmod -R u+wx '{}' \;
|
||||
fi
|
||||
rm -rf "$EXPLODED"
|
||||
mkdir "$EXPLODED"
|
||||
rm -rf "$BACKUP_JMODS"
|
||||
mkdir "$BACKUP_JMODS"
|
||||
|
||||
log "Unzipping $INPUT_FILE to $EXPLODED ..."
|
||||
tar -xzvf "$INPUT_FILE" --directory $EXPLODED
|
||||
rm "$INPUT_FILE"
|
||||
BUILD_NAME="$(ls "$EXPLODED")"
|
||||
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/jmods; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/Home/jmods $BACKUP_JMODS
|
||||
fi
|
||||
if test -f $EXPLODED/$BUILD_NAME/Contents/MacOS/libjli.dylib; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/MacOS/libjli.dylib $BACKUP_JMODS
|
||||
fi
|
||||
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/Frameworks; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/Home/Frameworks $BACKUP_JMODS
|
||||
fi
|
||||
|
||||
log "$INPUT_FILE extracted and removed"
|
||||
|
||||
APPLICATION_PATH="$EXPLODED/$BUILD_NAME"
|
||||
|
||||
find "$APPLICATION_PATH/Contents/Home/bin" \
|
||||
-maxdepth 1 -type f -name '*.jnilib' -print0 |
|
||||
while IFS= read -r -d $'\0' file; do
|
||||
if [ -f "$file" ]; then
|
||||
log "Linking $file"
|
||||
b="$(basename "$file" .jnilib)"
|
||||
ln -sf "$b.jnilib" "$(dirname "$file")/$b.dylib"
|
||||
fi
|
||||
done
|
||||
|
||||
find "$APPLICATION_PATH/Contents/" \
|
||||
-maxdepth 1 -type f -name '*.txt' -print0 |
|
||||
while IFS= read -r -d $'\0' file; do
|
||||
if [ -f "$file" ]; then
|
||||
log "Moving $file"
|
||||
mv "$file" "$APPLICATION_PATH/Contents/Resources"
|
||||
fi
|
||||
done
|
||||
|
||||
non_plist=$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist' | wc -l)
|
||||
if [[ $non_plist -gt 0 ]]; then
|
||||
log "Only Info.plist file is allowed in Contents directory but found $non_plist file(s):"
|
||||
log "$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Unlocking keychain..."
|
||||
# Make sure *.p12 is imported into local KeyChain
|
||||
security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
|
||||
|
||||
attempt=1
|
||||
limit=3
|
||||
set +e
|
||||
while [[ $attempt -le $limit ]]; do
|
||||
log "Signing (attempt $attempt) $APPLICATION_PATH ..."
|
||||
./sign.sh "$APPLICATION_PATH" "$CODESIGN_STRING"
|
||||
ec=$?
|
||||
if [[ $ec -ne 0 ]]; then
|
||||
((attempt += 1))
|
||||
if [ $attempt -eq $limit ]; then
|
||||
set -e
|
||||
fi
|
||||
log "Signing failed, wait for 30 sec and try to sign again"
|
||||
sleep 30
|
||||
else
|
||||
log "Signing done"
|
||||
codesign -v "$APPLICATION_PATH" -vvvvv
|
||||
log "Check sign done"
|
||||
((attempt += limit))
|
||||
fi
|
||||
done
|
||||
|
||||
set -e
|
||||
|
||||
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" "$BUNDLE_ID" "$FAKE_ROOT"
|
||||
rm -rf "$FAKE_ROOT"
|
||||
|
||||
set +e
|
||||
log "Stapling..."
|
||||
xcrun stapler staple "$APPLICATION_PATH"
|
||||
else
|
||||
log "Notarization disabled"
|
||||
log "Stapling disabled"
|
||||
fi
|
||||
|
||||
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 $EXPLODED/$BUILD_NAME/Contents/Home
|
||||
fi
|
||||
|
||||
COPYFILE_DISABLE=1 tar -pczf $INPUT_FILE --exclude='*.dSYM' --exclude='man' -C $EXPLODED $BUILD_NAME
|
||||
log "Finished zipping"
|
||||
)
|
||||
rm -rf "$EXPLODED"
|
||||
log "Done"
|
||||
82
jb/project/tools/windows/scripts/mkimages_x64.sh
Executable file
82
jb/project/tools/windows/scripts/mkimages_x64.sh
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles with jcef
|
||||
# empty - the bundles without jcef
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
function create_jbr {
|
||||
|
||||
if [ -z "${bundle_type}" ]; then
|
||||
JBR_BUNDLE=jbr
|
||||
else
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
fi
|
||||
cat modules.list > modules_tmp.list
|
||||
rm -rf ${JBR_BUNDLE}
|
||||
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
|
||||
|
||||
[ ! -z "${bundle_type}" ] && (cp -R jcef_win_x64/* ${JBR_BUNDLE}/bin || exit $?)
|
||||
echo Modifying release info ...
|
||||
cat ${JSDK}/release | tr -d '\r' | grep -v 'JAVA_VERSION' | grep -v 'MODULES' >> ${JBR_BUNDLE}/release
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WORK_DIR=$(pwd)
|
||||
|
||||
git checkout -- modules.list
|
||||
git checkout -- src/java.desktop/share/classes/module-info.java
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
PATH="/usr/local/bin:/usr/bin:${PATH}"
|
||||
sh ./configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-target-bits=64 \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=${TOOLCHAIN_VERSION} \
|
||||
--with-import-modules=${WORK_DIR}/modular-sdk \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || exit 1
|
||||
|
||||
make LOG=info images CONF=windows-x86_64-server-release test-image || exit 1
|
||||
|
||||
JSDK=build/windows-x86_64-server-release/images/jdk
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
|
||||
BASE_DIR=build/windows-x86_64-server-release/images
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
|
||||
cp -R jcef_win_x64/* ${JBRSDK_BUNDLE}/bin
|
||||
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
|
||||
mv release ${JBRSDK_BUNDLE}/release
|
||||
|
||||
create_jbr || exit $?
|
||||
66
jb/project/tools/windows/scripts/mkimages_x86.sh
Executable file
66
jb/project/tools/windows/scripts/mkimages_x86.sh
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
|
||||
# jfx - the bundle 1) jbr with javafx only will be created
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WORK_DIR=$(pwd)
|
||||
|
||||
[ -z "$bundle_type" ] && git apply -p0 < jb/project/tools/exclude_jcef_module.patch
|
||||
|
||||
PATH="/usr/local/bin:/usr/bin:${PATH}"
|
||||
./configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-target-bits=32 \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=${TOOLCHAIN_VERSION} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || exit 1
|
||||
make clean CONF=windows-x86-server-release || exit 1
|
||||
make LOG=info images CONF=windows-x86-server-release test-image || exit 1
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x86-b${build_number}
|
||||
BASE_DIR=build/windows-x86-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
|
||||
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
|
||||
mv release ${JBRSDK_BUNDLE}/release
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
rm -rf ${JBR_BUNDLE}
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.x86 | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
|
||||
|
||||
echo Modifying release info ...
|
||||
#grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release
|
||||
57
jb/project/tools/windows/scripts/pack_x64.sh
Executable file
57
jb/project/tools/windows/scripts/pack_x64.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# jcef - the bundles with jcef
|
||||
# empty - the bundles without jcef
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
|
||||
function pack_jbr {
|
||||
|
||||
if [ -z "${bundle_type}" ]; then
|
||||
JBR_BUNDLE=jbr
|
||||
else
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
rm -rf ${BASE_DIR}/jbr
|
||||
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
|
||||
fi
|
||||
JBR_BASE_NAME=${JBR_BUNDLE}-${JBSDK_VERSION}
|
||||
|
||||
JBR=$JBR_BASE_NAME-windows-x64-b$build_number
|
||||
echo Creating $JBR.tar.gz ...
|
||||
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || exit 1
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
|
||||
IMAGES_DIR=build/windows-x86_64-server-release/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JBSDK=$JBRSDK_BASE_NAME-windows-x64-b$build_number
|
||||
BASE_DIR=.
|
||||
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
|
||||
|
||||
pack_jbr $bundle_type
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x64-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || exit 1
|
||||
45
jb/project/tools/windows/scripts/pack_x86.sh
Executable file
45
jb/project/tools/windows/scripts/pack_x86.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to bu built; possible values:
|
||||
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
|
||||
# jfx - the bundle 1) jbr with javafx only will be created
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
|
||||
IMAGES_DIR=build/windows-x86-server-release/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JBSDK=$JBRSDK_BASE_NAME-windows-x86-b$build_number
|
||||
BASE_DIR=.
|
||||
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
|
||||
|
||||
JBR=$JBR_BASE_NAME-windows-x86-b$build_number
|
||||
echo Creating $JBR.tar.gz ...
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR ${JBR_BUNDLE} || exit 1
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x86-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || exit 1
|
||||
@@ -345,10 +345,27 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
||||
fi
|
||||
|
||||
# Only enable ZGC on supported platforms
|
||||
if (test "x$OPENJDK_TARGET_OS" = "xwindows" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"); then
|
||||
AC_MSG_CHECKING([if zgc can be built on windows])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <windows.h>]],
|
||||
[[struct MEM_EXTENDED_PARAMETER x;]])
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
CAN_BUILD_ZGC_ON_WINDOWS="yes"
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no, missing required APIs])
|
||||
CAN_BUILD_ZGC_ON_WINDOWS="no"
|
||||
]
|
||||
)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if zgc can be built])
|
||||
if (test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64") || \
|
||||
(test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xaarch64") || \
|
||||
(test "x$OPENJDK_TARGET_OS" = "xwindows" && test "x$OPENJDK_TARGET_CPU" = "xx86_64") || \
|
||||
(test "x$CAN_BUILD_ZGC_ON_WINDOWS" = "xyes") || \
|
||||
(test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"); then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
|
||||
@@ -38,7 +38,7 @@ DEFAULT_VERSION_CLASSFILE_MAJOR=58 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="13 14"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=14
|
||||
DEFAULT_PROMOTED_VERSION_PRE=ea
|
||||
DEFAULT_PROMOTED_VERSION_PRE=
|
||||
|
||||
LAUNCHER_NAME=openjdk
|
||||
PRODUCT_NAME=OpenJDK
|
||||
|
||||
@@ -154,6 +154,7 @@ public class GenerateJfrFiles {
|
||||
boolean startTime;
|
||||
boolean periodic;
|
||||
boolean cutoff;
|
||||
String commitState;
|
||||
}
|
||||
|
||||
static class FieldElement {
|
||||
@@ -219,14 +220,15 @@ public class GenerateJfrFiles {
|
||||
currentType.name = attributes.getValue("name");
|
||||
break;
|
||||
case "Event":
|
||||
EventElement eventtType = new EventElement();
|
||||
eventtType.name = attributes.getValue("name");
|
||||
eventtType.thread = getBoolean(attributes, "thread", false);
|
||||
eventtType.stackTrace = getBoolean(attributes, "stackTrace", false);
|
||||
eventtType.startTime = getBoolean(attributes, "startTime", true);
|
||||
eventtType.periodic = attributes.getValue("period") != null;
|
||||
eventtType.cutoff = getBoolean(attributes, "cutoff", false);
|
||||
currentType = eventtType;
|
||||
EventElement eventType = new EventElement();
|
||||
eventType.name = attributes.getValue("name");
|
||||
eventType.thread = getBoolean(attributes, "thread", false);
|
||||
eventType.stackTrace = getBoolean(attributes, "stackTrace", false);
|
||||
eventType.startTime = getBoolean(attributes, "startTime", true);
|
||||
eventType.periodic = attributes.getValue("period") != null;
|
||||
eventType.cutoff = getBoolean(attributes, "cutoff", false);
|
||||
eventType.commitState = attributes.getValue("commitState");
|
||||
currentType = eventType;
|
||||
break;
|
||||
case "Field":
|
||||
currentField = new FieldElement(metadata);
|
||||
@@ -459,6 +461,7 @@ public class GenerateJfrFiles {
|
||||
out.write("#include \"utilities/ticks.hpp\"");
|
||||
out.write("#if INCLUDE_JFR");
|
||||
out.write("#include \"jfr/recorder/service/jfrEvent.hpp\"");
|
||||
out.write("#include \"jfr/support/jfrEpochSynchronization.hpp\"");
|
||||
out.write("/*");
|
||||
out.write(" * Each event class has an assert member function verify() which is invoked");
|
||||
out.write(" * just before the engine writes the event and its fields to the data stream.");
|
||||
@@ -523,7 +526,7 @@ public class GenerateJfrFiles {
|
||||
}
|
||||
out.write("");
|
||||
if (!empty) {
|
||||
printWriteData(out, t.fields);
|
||||
printWriteData(out, t.fields, null);
|
||||
}
|
||||
out.write("};");
|
||||
out.write("");
|
||||
@@ -566,7 +569,7 @@ public class GenerateJfrFiles {
|
||||
}
|
||||
out.write("");
|
||||
if (!empty) {
|
||||
printWriteData(out, event.fields);
|
||||
printWriteData(out, event.fields, event.commitState);
|
||||
out.write("");
|
||||
}
|
||||
out.write(" using JfrEvent<Event" + event.name + ">::commit; // else commit() is hidden by overloaded versions in this class");
|
||||
@@ -578,9 +581,13 @@ public class GenerateJfrFiles {
|
||||
out.write("};");
|
||||
}
|
||||
|
||||
private static void printWriteData(Printer out, List<FieldElement> fields) {
|
||||
private static void printWriteData(Printer out, List<FieldElement> fields, String commitState) {
|
||||
out.write(" template <typename Writer>");
|
||||
out.write(" void writeData(Writer& w) {");
|
||||
if (("_thread_in_native").equals(commitState)) {
|
||||
out.write(" // explicit epoch synchronization check");
|
||||
out.write(" JfrEpochSynchronization sync;");
|
||||
}
|
||||
for (FieldElement field : fields) {
|
||||
if (field.struct) {
|
||||
out.write(" _" + field.name + ".writeData(w);");
|
||||
|
||||
57
modules.list
Normal file
57
modules.list
Normal file
@@ -0,0 +1,57 @@
|
||||
java.base,
|
||||
java.compiler,
|
||||
java.datatransfer,
|
||||
java.desktop,
|
||||
java.instrument,
|
||||
java.logging,
|
||||
java.management,
|
||||
java.management.rmi,
|
||||
java.naming,
|
||||
java.net.http,
|
||||
java.prefs,
|
||||
java.rmi,
|
||||
java.scripting,
|
||||
java.se,
|
||||
java.security.jgss,
|
||||
java.security.sasl,
|
||||
java.smartcardio,
|
||||
java.sql,
|
||||
java.sql.rowset,
|
||||
java.transaction.xa,
|
||||
java.xml,
|
||||
java.xml.crypto,
|
||||
jdk.accessibility,
|
||||
jdk.aot,
|
||||
jdk.attach,
|
||||
jdk.charsets,
|
||||
jdk.compiler,
|
||||
jdk.crypto.cryptoki,
|
||||
jdk.crypto.ec,
|
||||
jdk.dynalink,
|
||||
jdk.httpserver,
|
||||
jdk.internal.ed,
|
||||
jdk.internal.le,
|
||||
jdk.internal.vm.ci,
|
||||
jdk.internal.vm.compiler,
|
||||
jdk.internal.vm.compiler.management,
|
||||
jdk.jdi,
|
||||
jdk.jdwp.agent,
|
||||
jdk.jfr,
|
||||
jdk.jsobject,
|
||||
jdk.localedata,
|
||||
jdk.management,
|
||||
jdk.management.agent,
|
||||
jdk.management.jfr,
|
||||
jdk.naming.dns,
|
||||
jdk.naming.rmi,
|
||||
jdk.net,
|
||||
jdk.scripting.nashorn,
|
||||
jdk.scripting.nashorn.shell,
|
||||
jdk.sctp,
|
||||
jdk.security.auth,
|
||||
jdk.security.jgss,
|
||||
jdk.unsupported,
|
||||
jdk.xml.dom,
|
||||
jdk.zipfs,
|
||||
jdk.hotspot.agent,
|
||||
jcef
|
||||
@@ -2297,7 +2297,7 @@ const bool Matcher::need_masked_shift_count = false;
|
||||
// No support for generic vector operands.
|
||||
const bool Matcher::supports_generic_vector_operands = false;
|
||||
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
|
||||
ShouldNotReachHere(); // generic vector operands not supported
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
|
||||
opr = as_oop_opr(reg);
|
||||
} else if (type == T_METADATA) {
|
||||
opr = as_metadata_opr(reg);
|
||||
} else if (type == T_ADDRESS) {
|
||||
opr = as_address_opr(reg);
|
||||
} else {
|
||||
opr = as_opr(reg);
|
||||
}
|
||||
|
||||
@@ -759,7 +759,7 @@ void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool po
|
||||
if (is_reference_type(type)) {
|
||||
__ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix()));
|
||||
__ verify_oop(src->as_register());
|
||||
} else if (type == T_METADATA || type == T_DOUBLE) {
|
||||
} else if (type == T_METADATA || type == T_DOUBLE || type == T_ADDRESS) {
|
||||
__ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix()));
|
||||
} else {
|
||||
__ strw(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix()));
|
||||
@@ -872,7 +872,7 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
|
||||
if (is_reference_type(type)) {
|
||||
__ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
__ verify_oop(dest->as_register());
|
||||
} else if (type == T_METADATA) {
|
||||
} else if (type == T_METADATA || type == T_ADDRESS) {
|
||||
__ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
} else {
|
||||
__ ldrw(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
|
||||
@@ -1080,7 +1080,7 @@ const bool Matcher::convi2l_type_required = true;
|
||||
// No support for generic vector operands.
|
||||
const bool Matcher::supports_generic_vector_operands = false;
|
||||
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
|
||||
ShouldNotReachHere(); // generic vector operands not supported
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -80,10 +80,12 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
|
||||
Register reg = r_1->as_Register();
|
||||
if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
|
||||
opr = as_long_opr(reg, r_2->as_Register());
|
||||
} else if (type == T_OBJECT || type == T_ARRAY) {
|
||||
} else if (is_reference_type(type)) {
|
||||
opr = as_oop_opr(reg);
|
||||
} else if (type == T_METADATA) {
|
||||
opr = as_metadata_opr(reg);
|
||||
} else if (type == T_ADDRESS) {
|
||||
opr = as_address_opr(reg);
|
||||
} else {
|
||||
// PreferInterpreterNativeStubs should ensure we never need to
|
||||
// handle a long opr passed as R3+stack_slot
|
||||
|
||||
@@ -54,6 +54,10 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) {
|
||||
opr = as_long_opr(reg);
|
||||
} else if (is_reference_type(type)) {
|
||||
opr = as_oop_opr(reg);
|
||||
} else if (type == T_METADATA) {
|
||||
opr = as_metadata_opr(reg);
|
||||
} else if (type == T_ADDRESS) {
|
||||
opr = as_address_opr(reg);
|
||||
} else {
|
||||
opr = as_opr(reg);
|
||||
}
|
||||
|
||||
@@ -2429,7 +2429,7 @@ const bool Matcher::need_masked_shift_count = true;
|
||||
// No support for generic vector operands.
|
||||
const bool Matcher::supports_generic_vector_operands = false;
|
||||
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
|
||||
ShouldNotReachHere(); // generic vector operands not supported
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ void PatchingStub::align_patch_site(MacroAssembler* masm) {
|
||||
void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
// Copy original code here.
|
||||
assert(NativeGeneralJump::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF,
|
||||
"not enough room for call");
|
||||
"not enough room for call, need %d", _bytes_to_copy);
|
||||
|
||||
NearLabel call_patch;
|
||||
|
||||
@@ -331,7 +331,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
// Make a copy the code which is going to be patched.
|
||||
// Make a copy of the code which is going to be patched.
|
||||
for (int i = 0; i < _bytes_to_copy; i++) {
|
||||
address ptr = (address)(_pc_start + i);
|
||||
int a_byte = (*ptr) & 0xFF;
|
||||
|
||||
@@ -50,6 +50,8 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) {
|
||||
opr = as_oop_opr(reg);
|
||||
} else if (type == T_METADATA) {
|
||||
opr = as_metadata_opr(reg);
|
||||
} else if (type == T_ADDRESS) {
|
||||
opr = as_address_opr(reg);
|
||||
} else {
|
||||
opr = as_opr(reg);
|
||||
}
|
||||
|
||||
@@ -897,7 +897,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, LIR_P
|
||||
bool needs_patching = (patch_code != lir_patch_none);
|
||||
|
||||
if (addr->base()->type() == T_OBJECT) {
|
||||
__ verify_oop(src);
|
||||
__ verify_oop(src, FILE_AND_LINE);
|
||||
}
|
||||
|
||||
PatchingStub* patch = NULL;
|
||||
@@ -972,7 +972,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, LIR_P
|
||||
} else {
|
||||
__ z_lg(dest->as_register(), disp_value, disp_reg, src);
|
||||
}
|
||||
__ verify_oop(dest->as_register());
|
||||
__ verify_oop(dest->as_register(), FILE_AND_LINE);
|
||||
break;
|
||||
}
|
||||
case T_FLOAT:
|
||||
@@ -1006,8 +1006,8 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
|
||||
if (dest->is_single_cpu()) {
|
||||
if (is_reference_type(type)) {
|
||||
__ mem2reg_opt(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()), true);
|
||||
__ verify_oop(dest->as_register());
|
||||
} else if (type == T_METADATA) {
|
||||
__ verify_oop(dest->as_register(), FILE_AND_LINE);
|
||||
} else if (type == T_METADATA || type == T_ADDRESS) {
|
||||
__ mem2reg_opt(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()), true);
|
||||
} else {
|
||||
__ mem2reg_opt(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()), false);
|
||||
@@ -1033,9 +1033,9 @@ void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool po
|
||||
if (src->is_single_cpu()) {
|
||||
const Address dst = frame_map()->address_for_slot(dest->single_stack_ix());
|
||||
if (is_reference_type(type)) {
|
||||
__ verify_oop(src->as_register());
|
||||
__ verify_oop(src->as_register(), FILE_AND_LINE);
|
||||
__ reg2mem_opt(src->as_register(), dst, true);
|
||||
} else if (type == T_METADATA) {
|
||||
} else if (type == T_METADATA || type == T_ADDRESS) {
|
||||
__ reg2mem_opt(src->as_register(), dst, true);
|
||||
} else {
|
||||
__ reg2mem_opt(src->as_register(), dst, false);
|
||||
@@ -1079,7 +1079,7 @@ void LIR_Assembler::reg2reg(LIR_Opr from_reg, LIR_Opr to_reg) {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
if (is_reference_type(to_reg->type())) {
|
||||
__ verify_oop(to_reg->as_register());
|
||||
__ verify_oop(to_reg->as_register(), FILE_AND_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1095,7 +1095,7 @@ void LIR_Assembler::reg2mem(LIR_Opr from, LIR_Opr dest_opr, BasicType type,
|
||||
bool needs_patching = (patch_code != lir_patch_none);
|
||||
|
||||
if (addr->base()->is_oop_register()) {
|
||||
__ verify_oop(dest);
|
||||
__ verify_oop(dest, FILE_AND_LINE);
|
||||
}
|
||||
|
||||
PatchingStub* patch = NULL;
|
||||
@@ -1130,7 +1130,7 @@ void LIR_Assembler::reg2mem(LIR_Opr from, LIR_Opr dest_opr, BasicType type,
|
||||
assert(disp_reg != Z_R0 || Immediate::is_simm20(disp_value), "should have set this up");
|
||||
|
||||
if (is_reference_type(type)) {
|
||||
__ verify_oop(from->as_register());
|
||||
__ verify_oop(from->as_register(), FILE_AND_LINE);
|
||||
}
|
||||
|
||||
bool short_disp = Immediate::is_uimm12(disp_value);
|
||||
@@ -2412,7 +2412,7 @@ void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) {
|
||||
op->klass()->as_register(),
|
||||
*op->stub()->entry());
|
||||
__ bind(*op->stub()->continuation());
|
||||
__ verify_oop(op->obj()->as_register());
|
||||
__ verify_oop(op->obj()->as_register(), FILE_AND_LINE);
|
||||
}
|
||||
|
||||
void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
|
||||
@@ -2548,7 +2548,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
}
|
||||
assert(obj != k_RInfo, "must be different");
|
||||
|
||||
__ verify_oop(obj);
|
||||
__ verify_oop(obj, FILE_AND_LINE);
|
||||
|
||||
// Get object class.
|
||||
// Not a safepoint as obj null check happens earlier.
|
||||
@@ -3009,7 +3009,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
|
||||
assert(do_null || do_update, "why are we here?");
|
||||
assert(!TypeEntries::was_null_seen(current_klass) || do_update, "why are we here?");
|
||||
|
||||
__ verify_oop(obj);
|
||||
__ verify_oop(obj, FILE_AND_LINE);
|
||||
|
||||
if (do_null || tmp1 != obj DEBUG_ONLY(|| true)) {
|
||||
__ z_ltgr(tmp1, obj);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
|
||||
Label ic_miss, ic_hit;
|
||||
verify_oop(receiver);
|
||||
verify_oop(receiver, FILE_AND_LINE);
|
||||
int klass_offset = oopDesc::klass_offset_in_bytes();
|
||||
|
||||
if (!ImplicitNullChecks || MacroAssembler::needs_explicit_null_check(klass_offset)) {
|
||||
@@ -83,7 +83,7 @@ void C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hd
|
||||
assert_different_registers(hdr, obj, disp_hdr);
|
||||
NearLabel done;
|
||||
|
||||
verify_oop(obj);
|
||||
verify_oop(obj, FILE_AND_LINE);
|
||||
|
||||
// Load object header.
|
||||
z_lg(hdr, Address(obj, hdr_offset));
|
||||
@@ -158,7 +158,7 @@ void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_
|
||||
// Load object.
|
||||
z_lg(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
|
||||
}
|
||||
verify_oop(obj);
|
||||
verify_oop(obj, FILE_AND_LINE);
|
||||
// Test if object header is pointing to the displaced header, and if so, restore
|
||||
// the displaced header in the object. If the object header is not pointing to
|
||||
// the displaced header, get the object header instead.
|
||||
@@ -278,7 +278,7 @@ void C1_MacroAssembler::initialize_object(
|
||||
// call(RuntimeAddress(Runtime1::entry_for (Runtime1::dtrace_object_alloc_id)));
|
||||
// }
|
||||
|
||||
verify_oop(obj);
|
||||
verify_oop(obj, FILE_AND_LINE);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::allocate_array(
|
||||
@@ -336,16 +336,15 @@ void C1_MacroAssembler::allocate_array(
|
||||
// call(RuntimeAddress(Runtime1::entry_for (Runtime1::dtrace_object_alloc_id)));
|
||||
// }
|
||||
|
||||
verify_oop(obj);
|
||||
verify_oop(obj, FILE_AND_LINE);
|
||||
}
|
||||
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
|
||||
Unimplemented();
|
||||
// if (!VerifyOops) return;
|
||||
// verify_oop_addr(Address(SP, stack_offset + STACK_BIAS));
|
||||
if (!VerifyOops) return;
|
||||
verify_oop_addr(Address(Z_SP, stack_offset), FILE_AND_LINE);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::verify_not_null_oop(Register r) {
|
||||
@@ -354,7 +353,7 @@ void C1_MacroAssembler::verify_not_null_oop(Register r) {
|
||||
compareU64_and_branch(r, (intptr_t)0, bcondNotEqual, not_null);
|
||||
stop("non-null oop required");
|
||||
bind(not_null);
|
||||
verify_oop(r);
|
||||
verify_oop(r, FILE_AND_LINE);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::invalidate_registers(Register preserve1,
|
||||
|
||||
@@ -339,7 +339,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
|
||||
oop_maps->add_gc_map(call_offset, map);
|
||||
restore_live_registers_except_r2(sasm);
|
||||
|
||||
__ verify_oop(obj);
|
||||
__ verify_oop(obj, FILE_AND_LINE);
|
||||
__ z_br(Z_R14);
|
||||
}
|
||||
break;
|
||||
@@ -405,7 +405,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
|
||||
oop_maps->add_gc_map(call_offset, map);
|
||||
restore_live_registers_except_r2(sasm);
|
||||
|
||||
__ verify_oop(obj);
|
||||
__ verify_oop(obj, FILE_AND_LINE);
|
||||
__ z_br(Z_R14);
|
||||
}
|
||||
break;
|
||||
@@ -423,7 +423,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
|
||||
restore_live_registers_except_r2(sasm);
|
||||
|
||||
// Z_R2,: new multi array
|
||||
__ verify_oop(Z_R2);
|
||||
__ verify_oop(Z_R2, FILE_AND_LINE);
|
||||
__ z_br(Z_R14);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -400,11 +400,11 @@ void G1BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value
|
||||
|
||||
__ z_tmll(tmp1, JNIHandles::weak_tag_mask); // Test for jweak tag.
|
||||
__ z_braz(Lnot_weak);
|
||||
__ verify_oop(value);
|
||||
__ verify_oop(value, FILE_AND_LINE);
|
||||
DecoratorSet decorators = IN_NATIVE | ON_PHANTOM_OOP_REF;
|
||||
g1_write_barrier_pre(masm, decorators, (const Address*)NULL, value, noreg, tmp1, tmp2, true);
|
||||
__ bind(Lnot_weak);
|
||||
__ verify_oop(value);
|
||||
__ verify_oop(value, FILE_AND_LINE);
|
||||
__ bind(Ldone);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ void BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value,
|
||||
__ z_nill(value, ~JNIHandles::weak_tag_mask);
|
||||
__ z_lg(value, 0, value); // Resolve (untagged) jobject.
|
||||
|
||||
__ verify_oop(value);
|
||||
__ verify_oop(value, FILE_AND_LINE);
|
||||
__ bind(Ldone);
|
||||
}
|
||||
|
||||
|
||||
@@ -1664,7 +1664,7 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Address mdo_addr,
|
||||
compareU64_and_branch(obj, (intptr_t)0, Assembler::bcondEqual, null_seen);
|
||||
}
|
||||
|
||||
verify_oop(obj);
|
||||
MacroAssembler::verify_oop(obj, FILE_AND_LINE);
|
||||
load_klass(klass, obj);
|
||||
|
||||
// Klass seen before, nothing to do (regardless of unknown bit).
|
||||
@@ -2073,7 +2073,7 @@ void InterpreterMacroAssembler::access_local_int(Register index, Register dst) {
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) {
|
||||
if (state == atos) { MacroAssembler::verify_oop(reg); }
|
||||
if (state == atos) { MacroAssembler::verify_oop(reg, FILE_AND_LINE); }
|
||||
}
|
||||
|
||||
// Inline assembly for:
|
||||
|
||||
@@ -3587,7 +3587,7 @@ void MacroAssembler::get_vm_result(Register oop_result) {
|
||||
z_lg(oop_result, Address(Z_thread, JavaThread::vm_result_offset()));
|
||||
clear_mem(Address(Z_thread, JavaThread::vm_result_offset()), sizeof(void*));
|
||||
|
||||
verify_oop(oop_result);
|
||||
verify_oop(oop_result, FILE_AND_LINE);
|
||||
}
|
||||
|
||||
void MacroAssembler::get_vm_result_2(Register result) {
|
||||
@@ -6813,26 +6813,94 @@ void MacroAssembler::verify_thread() {
|
||||
}
|
||||
}
|
||||
|
||||
// Save and restore functions: Exclude Z_R0.
|
||||
void MacroAssembler::save_volatile_regs(Register dst, int offset, bool include_fp, bool include_flags) {
|
||||
z_stmg(Z_R1, Z_R5, offset, dst); offset += 5 * BytesPerWord;
|
||||
if (include_fp) {
|
||||
z_std(Z_F0, Address(dst, offset)); offset += BytesPerWord;
|
||||
z_std(Z_F1, Address(dst, offset)); offset += BytesPerWord;
|
||||
z_std(Z_F2, Address(dst, offset)); offset += BytesPerWord;
|
||||
z_std(Z_F3, Address(dst, offset)); offset += BytesPerWord;
|
||||
z_std(Z_F4, Address(dst, offset)); offset += BytesPerWord;
|
||||
z_std(Z_F5, Address(dst, offset)); offset += BytesPerWord;
|
||||
z_std(Z_F6, Address(dst, offset)); offset += BytesPerWord;
|
||||
z_std(Z_F7, Address(dst, offset)); offset += BytesPerWord;
|
||||
}
|
||||
if (include_flags) {
|
||||
Label done;
|
||||
z_mvi(Address(dst, offset), 2); // encoding: equal
|
||||
z_bre(done);
|
||||
z_mvi(Address(dst, offset), 4); // encoding: higher
|
||||
z_brh(done);
|
||||
z_mvi(Address(dst, offset), 1); // encoding: lower
|
||||
bind(done);
|
||||
}
|
||||
}
|
||||
void MacroAssembler::restore_volatile_regs(Register src, int offset, bool include_fp, bool include_flags) {
|
||||
z_lmg(Z_R1, Z_R5, offset, src); offset += 5 * BytesPerWord;
|
||||
if (include_fp) {
|
||||
z_ld(Z_F0, Address(src, offset)); offset += BytesPerWord;
|
||||
z_ld(Z_F1, Address(src, offset)); offset += BytesPerWord;
|
||||
z_ld(Z_F2, Address(src, offset)); offset += BytesPerWord;
|
||||
z_ld(Z_F3, Address(src, offset)); offset += BytesPerWord;
|
||||
z_ld(Z_F4, Address(src, offset)); offset += BytesPerWord;
|
||||
z_ld(Z_F5, Address(src, offset)); offset += BytesPerWord;
|
||||
z_ld(Z_F6, Address(src, offset)); offset += BytesPerWord;
|
||||
z_ld(Z_F7, Address(src, offset)); offset += BytesPerWord;
|
||||
}
|
||||
if (include_flags) {
|
||||
z_cli(Address(src, offset), 2); // see encoding above
|
||||
}
|
||||
}
|
||||
|
||||
// Plausibility check for oops.
|
||||
void MacroAssembler::verify_oop(Register oop, const char* msg) {
|
||||
if (!VerifyOops) return;
|
||||
|
||||
BLOCK_COMMENT("verify_oop {");
|
||||
Register tmp = Z_R0;
|
||||
unsigned int nbytes_save = 5*BytesPerWord;
|
||||
address entry = StubRoutines::verify_oop_subroutine_entry_address();
|
||||
unsigned int nbytes_save = (5 + 8 + 1) * BytesPerWord;
|
||||
address entry_addr = StubRoutines::verify_oop_subroutine_entry_address();
|
||||
|
||||
save_return_pc();
|
||||
push_frame_abi160(nbytes_save);
|
||||
z_stmg(Z_R1, Z_R5, frame::z_abi_160_size, Z_SP);
|
||||
|
||||
z_lgr(Z_ARG2, oop);
|
||||
load_const(Z_ARG1, (address) msg);
|
||||
load_const(Z_R1, entry);
|
||||
// Push frame, but preserve flags
|
||||
z_lgr(Z_R0, Z_SP);
|
||||
z_lay(Z_SP, -((int64_t)nbytes_save + frame::z_abi_160_size), Z_SP);
|
||||
z_stg(Z_R0, _z_abi(callers_sp), Z_SP);
|
||||
|
||||
save_volatile_regs(Z_SP, frame::z_abi_160_size, true, true);
|
||||
|
||||
lgr_if_needed(Z_ARG2, oop);
|
||||
load_const_optimized(Z_ARG1, (address)msg);
|
||||
load_const_optimized(Z_R1, entry_addr);
|
||||
z_lg(Z_R1, 0, Z_R1);
|
||||
call_c(Z_R1);
|
||||
|
||||
z_lmg(Z_R1, Z_R5, frame::z_abi_160_size, Z_SP);
|
||||
restore_volatile_regs(Z_SP, frame::z_abi_160_size, true, true);
|
||||
pop_frame();
|
||||
restore_return_pc();
|
||||
|
||||
BLOCK_COMMENT("} verify_oop ");
|
||||
}
|
||||
|
||||
void MacroAssembler::verify_oop_addr(Address addr, const char* msg) {
|
||||
if (!VerifyOops) return;
|
||||
|
||||
BLOCK_COMMENT("verify_oop {");
|
||||
unsigned int nbytes_save = (5 + 8) * BytesPerWord;
|
||||
address entry_addr = StubRoutines::verify_oop_subroutine_entry_address();
|
||||
|
||||
save_return_pc();
|
||||
unsigned int frame_size = push_frame_abi160(nbytes_save); // kills Z_R0
|
||||
save_volatile_regs(Z_SP, frame::z_abi_160_size, true, false);
|
||||
|
||||
z_lg(Z_ARG2, addr.plus_disp(frame_size));
|
||||
load_const_optimized(Z_ARG1, (address)msg);
|
||||
load_const_optimized(Z_R1, entry_addr);
|
||||
z_lg(Z_R1, 0, Z_R1);
|
||||
call_c(Z_R1);
|
||||
|
||||
restore_volatile_regs(Z_SP, frame::z_abi_160_size, true, false);
|
||||
pop_frame();
|
||||
restore_return_pc();
|
||||
|
||||
|
||||
@@ -973,8 +973,15 @@ class MacroAssembler: public Assembler {
|
||||
// Verify Z_thread contents.
|
||||
void verify_thread();
|
||||
|
||||
// Save and restore functions: Exclude Z_R0.
|
||||
void save_volatile_regs( Register dst, int offset, bool include_fp, bool include_flags);
|
||||
void restore_volatile_regs(Register src, int offset, bool include_fp, bool include_flags);
|
||||
|
||||
// Only if +VerifyOops.
|
||||
// Kills Z_R0.
|
||||
void verify_oop(Register reg, const char* s = "broken oop");
|
||||
// Kills Z_R0, condition code.
|
||||
void verify_oop_addr(Address addr, const char* msg = "contains broken oop");
|
||||
|
||||
// TODO: verify_method and klass metadata (compare against vptr?).
|
||||
void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
|
||||
|
||||
@@ -85,7 +85,7 @@ void MethodHandles::verify_klass(MacroAssembler* _masm,
|
||||
|
||||
BLOCK_COMMENT("verify_klass {");
|
||||
|
||||
__ verify_oop(obj_reg);
|
||||
__ verify_oop(obj_reg, FILE_AND_LINE);
|
||||
__ compareU64_and_branch(obj_reg, (intptr_t)0L, Assembler::bcondEqual, L_bad);
|
||||
__ load_klass(temp_reg, obj_reg);
|
||||
// klass_addr is a klass in allstatic SystemDictionaryHandles. Can't get GCed.
|
||||
@@ -194,22 +194,22 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
|
||||
BLOCK_COMMENT("jump_to_lambda_form {");
|
||||
|
||||
// Load the invoker, as MH -> MH.form -> LF.vmentry
|
||||
__ verify_oop(recv);
|
||||
__ verify_oop(recv, FILE_AND_LINE);
|
||||
__ load_heap_oop(method_temp,
|
||||
Address(recv,
|
||||
NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes())),
|
||||
noreg, noreg, IS_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ verify_oop(method_temp, FILE_AND_LINE);
|
||||
__ load_heap_oop(method_temp,
|
||||
Address(method_temp,
|
||||
NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes())),
|
||||
noreg, noreg, IS_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ verify_oop(method_temp, FILE_AND_LINE);
|
||||
__ load_heap_oop(method_temp,
|
||||
Address(method_temp,
|
||||
NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes())),
|
||||
noreg, noreg, IS_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ verify_oop(method_temp, FILE_AND_LINE);
|
||||
__ z_lg(method_temp,
|
||||
Address(method_temp,
|
||||
NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes())));
|
||||
@@ -385,7 +385,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
Register temp1_recv_klass = temp1;
|
||||
|
||||
if (iid != vmIntrinsics::_linkToStatic) {
|
||||
__ verify_oop(receiver_reg);
|
||||
__ verify_oop(receiver_reg, FILE_AND_LINE);
|
||||
if (iid == vmIntrinsics::_linkToSpecial) {
|
||||
// Don't actually load the klass; just null-check the receiver.
|
||||
__ null_check(receiver_reg);
|
||||
|
||||
@@ -1661,7 +1661,7 @@ const bool Matcher::need_masked_shift_count = false;
|
||||
// No support for generic vector operands.
|
||||
const bool Matcher::supports_generic_vector_operands = false;
|
||||
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
|
||||
ShouldNotReachHere(); // generic vector operands not supported
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -892,9 +892,9 @@ static void verify_oop_args(MacroAssembler *masm,
|
||||
if (r->is_stack()) {
|
||||
__ z_lg(Z_R0_scratch,
|
||||
Address(Z_SP, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
|
||||
__ verify_oop(Z_R0_scratch);
|
||||
__ verify_oop(Z_R0_scratch, FILE_AND_LINE);
|
||||
} else {
|
||||
__ verify_oop(r->as_Register());
|
||||
__ verify_oop(r->as_Register(), FILE_AND_LINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2686,7 +2686,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
|
||||
__ z_ltgr(Z_ARG1, Z_ARG1);
|
||||
__ z_bre(ic_miss);
|
||||
}
|
||||
__ verify_oop(Z_ARG1);
|
||||
__ verify_oop(Z_ARG1, FILE_AND_LINE);
|
||||
|
||||
// Check ic: object class <-> cached class
|
||||
// Compress cached class for comparison. That's more efficient.
|
||||
@@ -2955,7 +2955,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
#ifdef ASSERT
|
||||
// verify that there is really an exception oop in JavaThread
|
||||
__ z_lg(Z_ARG1, Address(Z_thread, JavaThread::exception_oop_offset()));
|
||||
__ verify_oop(Z_ARG1);
|
||||
__ MacroAssembler::verify_oop(Z_ARG1, FILE_AND_LINE);
|
||||
|
||||
// verify that there is no pending exception
|
||||
__ asm_assert_mem8_is_zero(in_bytes(Thread::pending_exception_offset()), Z_thread,
|
||||
|
||||
@@ -667,6 +667,17 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
#if !defined(PRODUCT)
|
||||
// Wrapper which calls oopDesc::is_oop_or_null()
|
||||
// Only called by MacroAssembler::verify_oop
|
||||
static void verify_oop_helper(const char* message, oopDesc* o) {
|
||||
if (!oopDesc::is_oop_or_null(o)) {
|
||||
fatal("%s. oop: " PTR_FORMAT, message, p2i(o));
|
||||
}
|
||||
++ StubRoutines::_verify_oop_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Return address of code to be called from code generated by
|
||||
// MacroAssembler::verify_oop.
|
||||
//
|
||||
@@ -679,6 +690,11 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// StubCodeMark mark(this, "StubRoutines", "verify_oop_stub");
|
||||
|
||||
address start = 0;
|
||||
|
||||
#if !defined(PRODUCT)
|
||||
start = CAST_FROM_FN_PTR(address, verify_oop_helper);
|
||||
#endif
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) {
|
||||
opr = as_oop_opr(reg);
|
||||
} else if (type == T_METADATA) {
|
||||
opr = as_metadata_opr(reg);
|
||||
} else if (type == T_ADDRESS) {
|
||||
opr = as_address_opr(reg);
|
||||
} else {
|
||||
opr = as_opr(reg);
|
||||
}
|
||||
|
||||
@@ -1818,7 +1818,7 @@ const bool Matcher::need_masked_shift_count = false;
|
||||
// No support for generic vector operands.
|
||||
const bool Matcher::supports_generic_vector_operands = false;
|
||||
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
|
||||
ShouldNotReachHere(); // generic vector operands not supported
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
|
||||
opr = as_oop_opr(reg);
|
||||
} else if (type == T_METADATA) {
|
||||
opr = as_metadata_opr(reg);
|
||||
} else if (type == T_ADDRESS) {
|
||||
opr = as_address_opr(reg);
|
||||
} else {
|
||||
opr = as_opr(reg);
|
||||
}
|
||||
|
||||
@@ -935,7 +935,7 @@ void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool po
|
||||
if (is_reference_type(type)) {
|
||||
__ verify_oop(src->as_register());
|
||||
__ movptr (dst, src->as_register());
|
||||
} else if (type == T_METADATA) {
|
||||
} else if (type == T_METADATA || type == T_ADDRESS) {
|
||||
__ movptr (dst, src->as_register());
|
||||
} else {
|
||||
__ movl (dst, src->as_register());
|
||||
@@ -1116,7 +1116,7 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
|
||||
if (is_reference_type(type)) {
|
||||
__ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
__ verify_oop(dest->as_register());
|
||||
} else if (type == T_METADATA) {
|
||||
} else if (type == T_METADATA || type == T_ADDRESS) {
|
||||
__ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
} else {
|
||||
__ movl(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
|
||||
@@ -512,6 +512,19 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
|
||||
// 3: apply keep-alive barrier if needed
|
||||
if (ShenandoahBarrierSet::need_keep_alive_barrier(decorators, type)) {
|
||||
__ push_IU_state();
|
||||
// That path can be reached from the c2i adapter with live fp
|
||||
// arguments in registers.
|
||||
LP64_ONLY(assert(Argument::n_float_register_parameters_j == 8, "8 fp registers to save at java call"));
|
||||
__ subptr(rsp, 64);
|
||||
__ movdbl(Address(rsp, 0), xmm0);
|
||||
__ movdbl(Address(rsp, 8), xmm1);
|
||||
__ movdbl(Address(rsp, 16), xmm2);
|
||||
__ movdbl(Address(rsp, 24), xmm3);
|
||||
__ movdbl(Address(rsp, 32), xmm4);
|
||||
__ movdbl(Address(rsp, 40), xmm5);
|
||||
__ movdbl(Address(rsp, 48), xmm6);
|
||||
__ movdbl(Address(rsp, 56), xmm7);
|
||||
|
||||
Register thread = NOT_LP64(tmp_thread) LP64_ONLY(r15_thread);
|
||||
assert_different_registers(dst, tmp1, tmp_thread);
|
||||
if (!thread->is_valid()) {
|
||||
@@ -527,6 +540,15 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
|
||||
tmp1 /* tmp */,
|
||||
true /* tosca_live */,
|
||||
true /* expand_call */);
|
||||
__ movdbl(xmm0, Address(rsp, 0));
|
||||
__ movdbl(xmm1, Address(rsp, 8));
|
||||
__ movdbl(xmm2, Address(rsp, 16));
|
||||
__ movdbl(xmm3, Address(rsp, 24));
|
||||
__ movdbl(xmm4, Address(rsp, 32));
|
||||
__ movdbl(xmm5, Address(rsp, 40));
|
||||
__ movdbl(xmm6, Address(rsp, 48));
|
||||
__ movdbl(xmm7, Address(rsp, 56));
|
||||
__ addptr(rsp, 64);
|
||||
__ pop_IU_state();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "code/nativeInst.hpp"
|
||||
#include "code/vtableStubs.hpp"
|
||||
#include "gc/shared/gcLocker.hpp"
|
||||
#include "gc/shared/barrierSet.hpp"
|
||||
#include "gc/shared/barrierSetAssembler.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
|
||||
@@ -1438,9 +1438,14 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType
|
||||
// x86 supports generic vector operands: vec and legVec.
|
||||
const bool Matcher::supports_generic_vector_operands = true;
|
||||
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* generic_opnd, uint ideal_reg) {
|
||||
MachOper* Matcher::specialize_generic_vector_operand(MachOper* generic_opnd, uint ideal_reg, bool is_temp) {
|
||||
assert(Matcher::is_generic_vector(generic_opnd), "not generic");
|
||||
bool legacy = (generic_opnd->opcode() == LEGVEC);
|
||||
if (!VM_Version::supports_avx512vlbwdq() && // KNL
|
||||
is_temp && !legacy && (ideal_reg == Op_VecZ)) {
|
||||
// Conservatively specialize 512bit vec TEMP operands to legVecZ (zmm0-15) on KNL.
|
||||
return new legVecZOper();
|
||||
}
|
||||
if (legacy) {
|
||||
switch (ideal_reg) {
|
||||
case Op_VecS: return new legVecSOper();
|
||||
@@ -2138,7 +2143,7 @@ operand vecZ() %{
|
||||
|
||||
// Replaces legVec during post-selection cleanup. See above.
|
||||
operand legVecZ() %{
|
||||
constraint(ALLOC_IN_RC(vectorz_reg_vl));
|
||||
constraint(ALLOC_IN_RC(vectorz_reg_legacy));
|
||||
match(VecZ);
|
||||
|
||||
format %{ %}
|
||||
|
||||
@@ -465,6 +465,7 @@ void AOTCodeHeap::link_shared_runtime_symbols() {
|
||||
SET_AOT_GLOBAL_SYMBOL_VALUE("_resolve_virtual_entry", address, SharedRuntime::get_resolve_virtual_call_stub());
|
||||
SET_AOT_GLOBAL_SYMBOL_VALUE("_resolve_opt_virtual_entry", address, SharedRuntime::get_resolve_opt_virtual_call_stub());
|
||||
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_deopt_blob_unpack", address, SharedRuntime::deopt_blob()->unpack());
|
||||
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_deopt_blob_unpack_with_exception_in_tls", address, SharedRuntime::deopt_blob()->unpack_with_exception_in_tls());
|
||||
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_deopt_blob_uncommon_trap", address, SharedRuntime::deopt_blob()->uncommon_trap());
|
||||
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_ic_miss_stub", address, SharedRuntime::get_ic_miss_stub());
|
||||
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_handle_wrong_method_stub", address, SharedRuntime::get_handle_wrong_method_stub());
|
||||
|
||||
@@ -185,6 +185,10 @@ class FrameMap : public CompilationResourceObj {
|
||||
return LIR_OprFact::single_cpu_metadata(cpu_reg2rnr(r));
|
||||
}
|
||||
|
||||
static LIR_Opr as_address_opr(Register r) {
|
||||
return LIR_OprFact::single_cpu_address(cpu_reg2rnr(r));
|
||||
}
|
||||
|
||||
FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size);
|
||||
bool finalize_frame(int nof_slots);
|
||||
|
||||
|
||||
@@ -371,7 +371,11 @@ Klass* ClassListParser::load_current_class(TRAPS) {
|
||||
if (!HAS_PENDING_EXCEPTION && (obj != NULL)) {
|
||||
klass = java_lang_Class::as_Klass(obj);
|
||||
} else { // load classes in bootclasspath/a
|
||||
tty->print_cr("Class %s was not loaded from the system classloader", this->current_class_name());
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
oop throwable = PENDING_EXCEPTION;
|
||||
java_lang_Throwable::print(throwable, tty);
|
||||
tty->cr();
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
}
|
||||
|
||||
@@ -380,6 +384,7 @@ Klass* ClassListParser::load_current_class(TRAPS) {
|
||||
if (k != NULL) {
|
||||
klass = k;
|
||||
} else {
|
||||
tty->print_cr("Class %s is not found from SystemDictionary::resolve_or_null(..) == null", this->current_class_name());
|
||||
if (!HAS_PENDING_EXCEPTION) {
|
||||
THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@ InstanceKlass* ClassLoaderExt::load_class(Symbol* name, const char* path, TRAPS)
|
||||
ClassFileStream* stream = NULL;
|
||||
ClassPathEntry* e = find_classpath_entry_from_cache(path, CHECK_NULL);
|
||||
if (e == NULL) {
|
||||
log_warning(cds)("Preload Warning: ClassPathEntry is not found for class %s and path %s", class_name, path);
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
@@ -329,12 +330,14 @@ ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path
|
||||
struct stat st;
|
||||
if (os::stat(path, &st) != 0) {
|
||||
// File or directory not found
|
||||
log_warning(cds)("Preload Warning: Source path %s is not found", path);
|
||||
return NULL;
|
||||
}
|
||||
ClassPathEntry* new_entry = NULL;
|
||||
|
||||
new_entry = create_class_path_entry(path, &st, false, false, false, CHECK_NULL);
|
||||
if (new_entry == NULL) {
|
||||
log_warning(cds)("Preload Warning: The create_class_path_entry() call for path %s returned NULL", path);
|
||||
return NULL;
|
||||
}
|
||||
ccpe._path = strdup(path);
|
||||
|
||||
@@ -51,7 +51,15 @@ void DebugInfoWriteStream::write_metadata(Metadata* h) {
|
||||
}
|
||||
|
||||
oop DebugInfoReadStream::read_oop() {
|
||||
oop o = code()->oop_at(read_int());
|
||||
nmethod* nm = const_cast<CompiledMethod*>(code())->as_nmethod_or_null();
|
||||
oop o;
|
||||
if (nm != NULL) {
|
||||
// Despite these oops being found inside nmethods that are on-stack,
|
||||
// they are not kept alive by all GCs (e.g. G1 and Shenandoah).
|
||||
o = nm->oop_at_phantom(read_int());
|
||||
} else {
|
||||
o = code()->oop_at(read_int());
|
||||
}
|
||||
assert(oopDesc::is_oop_or_null(o), "oop only");
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ void CompilationPolicy::compile_if_required(const methodHandle& selected_method,
|
||||
return;
|
||||
}
|
||||
CompileBroker::compile_method(selected_method, InvocationEntryBci,
|
||||
CompilationPolicy::policy()->initial_compile_level(),
|
||||
CompilationPolicy::policy()->initial_compile_level(selected_method),
|
||||
methodHandle(), 0, CompileTask::Reason_MustBeCompiled, CHECK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
static CompileTask* select_task_helper(CompileQueue* compile_queue);
|
||||
|
||||
// Return initial compile level that is used with Xcomp
|
||||
virtual CompLevel initial_compile_level() = 0;
|
||||
virtual CompLevel initial_compile_level(const methodHandle& method) = 0;
|
||||
virtual int compiler_count(CompLevel comp_level) = 0;
|
||||
// main notification entry, return a pointer to an nmethod if the OSR is required,
|
||||
// returns NULL otherwise.
|
||||
@@ -97,7 +97,7 @@ class SimpleCompPolicy : public CompilationPolicy {
|
||||
void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread);
|
||||
public:
|
||||
SimpleCompPolicy() : _compiler_count(0) { }
|
||||
virtual CompLevel initial_compile_level() { return CompLevel_highest_tier; }
|
||||
virtual CompLevel initial_compile_level(const methodHandle& m) { return CompLevel_highest_tier; }
|
||||
virtual int compiler_count(CompLevel comp_level);
|
||||
virtual void do_safepoint_work();
|
||||
virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
|
||||
|
||||
@@ -57,9 +57,6 @@ bool CompilationModeFlag::initialize() {
|
||||
jio_fprintf(defaultStream::error_stream(), "Unsupported compilation mode '%s', supported modes are: quick-only, high-only, high-only-quick-internal\n", CompilationMode);
|
||||
return false;
|
||||
}
|
||||
if (disable_intermediate()) {
|
||||
CompLevel_initial_compile = CompLevel_full_optimization;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -74,16 +71,6 @@ CompLevel CompLevel_highest_tier = CompLevel_simple; // pure C
|
||||
CompLevel CompLevel_highest_tier = CompLevel_none;
|
||||
#endif
|
||||
|
||||
#if defined(TIERED)
|
||||
CompLevel CompLevel_initial_compile = CompLevel_full_profile; // tiered
|
||||
#elif defined(COMPILER1) || INCLUDE_JVMCI
|
||||
CompLevel CompLevel_initial_compile = CompLevel_simple; // pure C1 or JVMCI
|
||||
#elif defined(COMPILER2)
|
||||
CompLevel CompLevel_initial_compile = CompLevel_full_optimization; // pure C2
|
||||
#else
|
||||
CompLevel CompLevel_initial_compile = CompLevel_none;
|
||||
#endif
|
||||
|
||||
#if defined(COMPILER2)
|
||||
CompMode Compilation_mode = CompMode_server;
|
||||
#elif defined(COMPILER1)
|
||||
@@ -145,7 +132,6 @@ intx CompilerConfig::scaled_freq_log(intx freq_log, double scale) {
|
||||
void set_client_compilation_mode() {
|
||||
Compilation_mode = CompMode_client;
|
||||
CompLevel_highest_tier = CompLevel_simple;
|
||||
CompLevel_initial_compile = CompLevel_simple;
|
||||
FLAG_SET_ERGO(TieredCompilation, false);
|
||||
FLAG_SET_ERGO(ProfileInterpreter, false);
|
||||
#if INCLUDE_JVMCI
|
||||
|
||||
@@ -83,7 +83,6 @@ public:
|
||||
#endif
|
||||
|
||||
extern CompLevel CompLevel_highest_tier;
|
||||
extern CompLevel CompLevel_initial_compile;
|
||||
|
||||
enum CompMode {
|
||||
CompMode_none = 0,
|
||||
|
||||
@@ -307,6 +307,78 @@ void TieredThresholdPolicy::initialize() {
|
||||
set_start_time(os::javaTimeMillis());
|
||||
}
|
||||
|
||||
|
||||
#ifdef ASSERT
|
||||
bool TieredThresholdPolicy::verify_level(CompLevel level) {
|
||||
// AOT and interpreter levels are always valid.
|
||||
if (level == CompLevel_aot || level == CompLevel_none) {
|
||||
return true;
|
||||
}
|
||||
if (CompilationModeFlag::normal()) {
|
||||
return true;
|
||||
} else if (CompilationModeFlag::quick_only()) {
|
||||
return level == CompLevel_simple;
|
||||
} else if (CompilationModeFlag::high_only()) {
|
||||
return level == CompLevel_full_optimization;
|
||||
} else if (CompilationModeFlag::high_only_quick_internal()) {
|
||||
return level == CompLevel_full_optimization || level == CompLevel_simple;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
CompLevel TieredThresholdPolicy::limit_level(CompLevel level) {
|
||||
if (CompilationModeFlag::quick_only()) {
|
||||
level = MIN2(level, CompLevel_simple);
|
||||
}
|
||||
assert(verify_level(level), "Invalid compilation level %d", level);
|
||||
if (level <= TieredStopAtLevel) {
|
||||
return level;
|
||||
}
|
||||
// Some compilation levels are not valid depending on a compilation mode:
|
||||
// a) quick_only - levels 2,3,4 are invalid; levels -1,0,1 are valid;
|
||||
// b) high_only - levels 1,2,3 are invalid; levels -1,0,4 are valid;
|
||||
// c) high_only_quick_internal - levels 2,3 are invalid; levels -1,0,1,4 are valid.
|
||||
// The invalid levels are actually sequential so a single comparison is sufficient.
|
||||
// Down here we already have (level > TieredStopAtLevel), which also implies that
|
||||
// (TieredStopAtLevel < Highest Possible Level), so we need to return a level that is:
|
||||
// a) a max level that is strictly less than the highest for a given compilation mode
|
||||
// b) less or equal to TieredStopAtLevel
|
||||
if (CompilationModeFlag::normal() || CompilationModeFlag::quick_only()) {
|
||||
return (CompLevel)TieredStopAtLevel;
|
||||
}
|
||||
|
||||
if (CompilationModeFlag::high_only() || CompilationModeFlag::high_only_quick_internal()) {
|
||||
return MIN2(CompLevel_none, (CompLevel)TieredStopAtLevel);
|
||||
}
|
||||
|
||||
ShouldNotReachHere();
|
||||
return CompLevel_any;
|
||||
}
|
||||
|
||||
CompLevel TieredThresholdPolicy::initial_compile_level_helper(const methodHandle& method) {
|
||||
if (CompilationModeFlag::normal()) {
|
||||
return CompLevel_full_profile;
|
||||
} else if (CompilationModeFlag::quick_only()) {
|
||||
return CompLevel_simple;
|
||||
} else if (CompilationModeFlag::high_only()) {
|
||||
return CompLevel_full_optimization;
|
||||
} else if (CompilationModeFlag::high_only_quick_internal()) {
|
||||
if (force_comp_at_level_simple(method)) {
|
||||
return CompLevel_simple;
|
||||
} else {
|
||||
return CompLevel_full_optimization;
|
||||
}
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
return CompLevel_any;
|
||||
}
|
||||
|
||||
CompLevel TieredThresholdPolicy::initial_compile_level(const methodHandle& method) {
|
||||
return limit_level(initial_compile_level_helper(method));
|
||||
}
|
||||
|
||||
void TieredThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {
|
||||
if (!counter->carry() && counter->count() > InvocationCounter::count_limit / 2) {
|
||||
counter->set_carry_flag();
|
||||
@@ -457,12 +529,7 @@ nmethod* TieredThresholdPolicy::event(const methodHandle& method, const methodHa
|
||||
|
||||
// Check if the method can be compiled, change level if necessary
|
||||
void TieredThresholdPolicy::compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
|
||||
assert(level <= TieredStopAtLevel, "Invalid compilation level");
|
||||
if (CompilationModeFlag::quick_only()) {
|
||||
assert(level <= CompLevel_simple, "Invalid compilation level");
|
||||
} else if (CompilationModeFlag::disable_intermediate()) {
|
||||
assert(level != CompLevel_full_profile && level != CompLevel_limited_profile, "C1 profiling levels shouldn't be used with intermediate levels disabled");
|
||||
}
|
||||
assert(verify_level(level) && level <= TieredStopAtLevel, "Invalid compilation level %d", level);
|
||||
|
||||
if (level == CompLevel_none) {
|
||||
if (mh->has_compiled_code()) {
|
||||
@@ -924,9 +991,11 @@ CompLevel TieredThresholdPolicy::common(Predicate p, const methodHandle& method,
|
||||
}
|
||||
}
|
||||
}
|
||||
return MIN2(next_level, CompilationModeFlag::quick_only() ? CompLevel_simple : (CompLevel)TieredStopAtLevel);
|
||||
return limit_level(next_level);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Determine if a method should be compiled with a normal entry point at a different level.
|
||||
CompLevel TieredThresholdPolicy::call_event(const methodHandle& method, CompLevel cur_level, JavaThread* thread) {
|
||||
CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
|
||||
@@ -1027,7 +1096,7 @@ void TieredThresholdPolicy::method_back_branch_event(const methodHandle& mh, con
|
||||
if (level == CompLevel_aot) {
|
||||
// Recompile the enclosing method to prevent infinite OSRs. Stay at AOT level while it's compiling.
|
||||
if (max_osr_level != CompLevel_none && !CompileBroker::compilation_is_in_queue(mh)) {
|
||||
CompLevel enclosing_level = MIN2(CompilationModeFlag::quick_only() ? CompLevel_simple : (CompLevel)TieredStopAtLevel, CompLevel_full_profile);
|
||||
CompLevel enclosing_level = limit_level(CompLevel_full_profile);
|
||||
compile(mh, InvocationEntryBci, enclosing_level, thread);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -170,8 +170,14 @@ class TieredThresholdPolicy : public CompilationPolicy {
|
||||
inline void set_carry_if_necessary(InvocationCounter *counter);
|
||||
// Set carry flags in the counters (in Method* and MDO).
|
||||
inline void handle_counter_overflow(Method* method);
|
||||
// Verify that a level is consistent with the compilation mode
|
||||
bool verify_level(CompLevel level);
|
||||
// Clamp the request level according to various constraints.
|
||||
inline CompLevel limit_level(CompLevel level);
|
||||
// Return desired initial compilation level for Xcomp
|
||||
CompLevel initial_compile_level_helper(const methodHandle& method);
|
||||
// Call and loop predicates determine whether a transition to a higher compilation
|
||||
// level should be performed (pointers to predicate functions are passed to common_TF().
|
||||
// level should be performed (pointers to predicate functions are passed to common().
|
||||
// Predicates also take compiler load into account.
|
||||
typedef bool (TieredThresholdPolicy::*Predicate)(int i, int b, CompLevel cur_level, const methodHandle& method);
|
||||
bool call_predicate(int i, int b, CompLevel cur_level, const methodHandle& method);
|
||||
@@ -253,7 +259,8 @@ public:
|
||||
if (is_c2_compile(comp_level)) return c2_count();
|
||||
return 0;
|
||||
}
|
||||
virtual CompLevel initial_compile_level() { return MIN2((CompLevel)TieredStopAtLevel, CompLevel_initial_compile); }
|
||||
// Return initial compile level to use with Xcomp (depends on compilation mode).
|
||||
virtual CompLevel initial_compile_level(const methodHandle& method);
|
||||
virtual void do_safepoint_work() { }
|
||||
virtual void delay_compilation(Method* method) { }
|
||||
virtual void disable_compilation(Method* method) { }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
/*
|
||||
* Copyright (c) 2001, 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
|
||||
@@ -2151,6 +2151,13 @@ bool G1CollectedHeap::try_collect_concurrently(GCCause::Cause cause,
|
||||
return op.gc_succeeded();
|
||||
}
|
||||
|
||||
// If VMOp skipped initiating concurrent marking cycle because
|
||||
// we're terminating, then we're done.
|
||||
if (op.terminating()) {
|
||||
LOG_COLLECT_CONCURRENTLY(cause, "skipped: terminating");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lock to get consistent set of values.
|
||||
uint old_marking_started_after;
|
||||
uint old_marking_completed_after;
|
||||
|
||||
@@ -152,7 +152,8 @@ protected:
|
||||
|
||||
enum G1Barrier {
|
||||
G1BarrierNone,
|
||||
G1BarrierCLD
|
||||
G1BarrierCLD,
|
||||
G1BarrierNoOptRoots // Do not collect optional roots.
|
||||
};
|
||||
|
||||
enum G1Mark {
|
||||
|
||||
@@ -246,7 +246,7 @@ void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) {
|
||||
} else {
|
||||
if (state.is_humongous()) {
|
||||
_g1h->set_humongous_is_live(obj);
|
||||
} else if (state.is_optional()) {
|
||||
} else if ((barrier != G1BarrierNoOptRoots) && state.is_optional()) {
|
||||
_par_scan_state->remember_root_into_optional_region(p);
|
||||
}
|
||||
|
||||
|
||||
@@ -305,6 +305,15 @@ public:
|
||||
}
|
||||
|
||||
void prepare() {
|
||||
// Reset the claim and clear scan top for all regions, including
|
||||
// regions currently not available or free. Since regions might
|
||||
// become used during the collection these values must be valid
|
||||
// for those regions as well.
|
||||
for (size_t i = 0; i < _max_regions; i++) {
|
||||
reset_region_claim((uint)i);
|
||||
clear_scan_top((uint)i);
|
||||
}
|
||||
|
||||
_all_dirty_regions = new G1DirtyRegions(_max_regions);
|
||||
_next_dirty_regions = new G1DirtyRegions(_max_regions);
|
||||
}
|
||||
@@ -885,7 +894,6 @@ void G1RemSet::scan_collection_set_regions(G1ParScanThreadState* pss,
|
||||
void G1RemSet::prepare_region_for_scan(HeapRegion* region) {
|
||||
uint hrm_index = region->hrm_index();
|
||||
|
||||
_scan_state->reset_region_claim(hrm_index);
|
||||
if (region->in_collection_set()) {
|
||||
// Young regions had their card table marked as young at their allocation;
|
||||
// we need to make sure that these marks are cleared at the end of GC, *but*
|
||||
@@ -893,7 +901,6 @@ void G1RemSet::prepare_region_for_scan(HeapRegion* region) {
|
||||
// So directly add them to the "all_dirty_regions".
|
||||
// Same for regions in the (initial) collection set: they may contain cards from
|
||||
// the log buffers, make sure they are cleaned.
|
||||
_scan_state->clear_scan_top(hrm_index);
|
||||
_scan_state->add_all_dirty_region(hrm_index);
|
||||
} else if (region->is_old_or_humongous_or_archive()) {
|
||||
_scan_state->set_scan_top(hrm_index, region->top());
|
||||
|
||||
@@ -40,6 +40,14 @@ class G1SharedClosures {
|
||||
public:
|
||||
G1ParCopyClosure<G1BarrierNone, Mark> _oops;
|
||||
G1ParCopyClosure<G1BarrierCLD, Mark> _oops_in_cld;
|
||||
// We do not need (and actually should not) collect oops from nmethods into the
|
||||
// optional collection set as we already automatically collect the corresponding
|
||||
// nmethods in the region's strong code roots set. So set G1BarrierNoOptRoots in
|
||||
// this closure.
|
||||
// If these were present there would be opportunity for multiple threads to try
|
||||
// to change this oop* at the same time. Since embedded oops are not necessarily
|
||||
// word-aligned, this could lead to word tearing during update and crashes.
|
||||
G1ParCopyClosure<G1BarrierNoOptRoots, Mark> _oops_in_nmethod;
|
||||
|
||||
G1CLDScanClosure _clds;
|
||||
G1CodeBlobClosure _codeblobs;
|
||||
@@ -47,6 +55,7 @@ public:
|
||||
G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty) :
|
||||
_oops(g1h, pss),
|
||||
_oops_in_cld(g1h, pss),
|
||||
_oops_in_nmethod(g1h, pss),
|
||||
_clds(&_oops_in_cld, process_only_dirty),
|
||||
_codeblobs(pss->worker_id(), &_oops, needs_strong_processing()) {}
|
||||
_codeblobs(pss->worker_id(), &_oops_in_nmethod, needs_strong_processing()) {}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@@ -47,6 +47,7 @@ VM_G1TryInitiateConcMark::VM_G1TryInitiateConcMark(uint gc_count_before,
|
||||
_target_pause_time_ms(target_pause_time_ms),
|
||||
_transient_failure(false),
|
||||
_cycle_already_in_progress(false),
|
||||
_terminating(false),
|
||||
_gc_succeeded(false)
|
||||
{}
|
||||
|
||||
@@ -66,7 +67,17 @@ void VM_G1TryInitiateConcMark::doit() {
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
|
||||
GCCauseSetter x(g1h, _gc_cause);
|
||||
if (!g1h->policy()->force_initial_mark_if_outside_cycle(_gc_cause)) {
|
||||
|
||||
// Record for handling by caller.
|
||||
_terminating = g1h->_cm_thread->should_terminate();
|
||||
|
||||
if (_terminating && GCCause::is_user_requested_gc(_gc_cause)) {
|
||||
// When terminating, the request to initiate a concurrent cycle will be
|
||||
// ignored by do_collection_pause_at_safepoint; instead it will just do
|
||||
// a young-only or mixed GC (depending on phase). For a user request
|
||||
// there's no point in even doing that much, so done. For some non-user
|
||||
// requests the alternative GC might still be needed.
|
||||
} else if (!g1h->policy()->force_initial_mark_if_outside_cycle(_gc_cause)) {
|
||||
// Failure to force the next GC pause to be an initial mark indicates
|
||||
// there is already a concurrent marking cycle in progress. Set flag
|
||||
// to notify the caller and return immediately.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@@ -52,6 +52,7 @@ class VM_G1TryInitiateConcMark : public VM_GC_Operation {
|
||||
double _target_pause_time_ms;
|
||||
bool _transient_failure;
|
||||
bool _cycle_already_in_progress;
|
||||
bool _terminating;
|
||||
bool _gc_succeeded;
|
||||
|
||||
public:
|
||||
@@ -63,6 +64,7 @@ public:
|
||||
virtual void doit();
|
||||
bool transient_failure() const { return _transient_failure; }
|
||||
bool cycle_already_in_progress() const { return _cycle_already_in_progress; }
|
||||
bool terminating() const { return _terminating; }
|
||||
bool gc_succeeded() const { return _gc_succeeded; }
|
||||
};
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t siz
|
||||
HandleMark hm; // Discard invalid handles created during verification
|
||||
Universe::verify("Before GC");
|
||||
}
|
||||
COMPILER2_PRESENT(DerivedPointerTable::clear());
|
||||
COMPILER2_OR_JVMCI_PRESENT(DerivedPointerTable::clear());
|
||||
|
||||
if (restore_marks_for_biased_locking) {
|
||||
// We perform this mark word preservation work lazily
|
||||
@@ -520,7 +520,7 @@ void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t siz
|
||||
rp->verify_no_references_recorded();
|
||||
}
|
||||
|
||||
COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
|
||||
COMPILER2_OR_JVMCI_PRESENT(DerivedPointerTable::update_pointers());
|
||||
|
||||
gen->stat_record()->accumulated_time.stop();
|
||||
|
||||
|
||||
@@ -199,12 +199,8 @@ oop ShenandoahBarrierSet::load_reference_barrier_impl(oop obj) {
|
||||
_heap->in_collection_set(obj) &&
|
||||
obj == fwd) {
|
||||
Thread *t = Thread::current();
|
||||
if (t->is_GC_task_thread()) {
|
||||
return _heap->evacuate_object(obj, t);
|
||||
} else {
|
||||
ShenandoahEvacOOMScope oom_evac_scope;
|
||||
return _heap->evacuate_object(obj, t);
|
||||
}
|
||||
ShenandoahEvacOOMScope oom_evac_scope;
|
||||
return _heap->evacuate_object(obj, t);
|
||||
} else {
|
||||
return fwd;
|
||||
}
|
||||
@@ -252,9 +248,7 @@ oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, oop* load_addr)
|
||||
}
|
||||
|
||||
oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, narrowOop* load_addr) {
|
||||
// Assumption: narrow oop version should not be used anywhere.
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
return load_reference_barrier_native_impl(obj, load_addr);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@@ -264,7 +258,7 @@ oop ShenandoahBarrierSet::load_reference_barrier_native_impl(oop obj, T* load_ad
|
||||
}
|
||||
|
||||
ShenandoahMarkingContext* const marking_context = _heap->marking_context();
|
||||
if (_heap->is_evacuation_in_progress() && !marking_context->is_marked(obj)) {
|
||||
if (_heap->is_concurrent_root_in_progress() && !marking_context->is_marked(obj)) {
|
||||
Thread* thr = Thread::current();
|
||||
if (thr->is_Java_thread()) {
|
||||
return NULL;
|
||||
|
||||
@@ -57,7 +57,6 @@ bool ShenandoahBarrierSetNMethod::nmethod_entry_barrier(nmethod* nm) {
|
||||
}
|
||||
|
||||
// Heal oops and disarm
|
||||
ShenandoahEvacOOMScope scope;
|
||||
ShenandoahNMethod::heal_nmethod(nm);
|
||||
ShenandoahNMethod::disarm_nmethod(nm);
|
||||
return true;
|
||||
|
||||
@@ -111,12 +111,13 @@ ShenandoahEvacuateUpdateRootsClosure::ShenandoahEvacuateUpdateRootsClosure() :
|
||||
|
||||
template <class T>
|
||||
void ShenandoahEvacuateUpdateRootsClosure::do_oop_work(T* p) {
|
||||
assert(_heap->is_evacuation_in_progress(), "Only do this when evacuation is in progress");
|
||||
assert(_heap->is_concurrent_root_in_progress(), "Only do this when evacuation is in progress");
|
||||
|
||||
T o = RawAccess<>::oop_load(p);
|
||||
if (! CompressedOops::is_null(o)) {
|
||||
oop obj = CompressedOops::decode_not_null(o);
|
||||
if (_heap->in_collection_set(obj)) {
|
||||
assert(_heap->is_evacuation_in_progress(), "Only do this when evacuation is in progress");
|
||||
shenandoah_assert_marked(p, obj);
|
||||
oop resolved = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
|
||||
if (resolved == obj) {
|
||||
@@ -139,11 +140,12 @@ ShenandoahEvacUpdateOopStorageRootsClosure::ShenandoahEvacUpdateOopStorageRootsC
|
||||
}
|
||||
|
||||
void ShenandoahEvacUpdateOopStorageRootsClosure::do_oop(oop* p) {
|
||||
assert(_heap->is_evacuation_in_progress(), "Only do this when evacuation is in progress");
|
||||
assert(_heap->is_concurrent_root_in_progress(), "Only do this when evacuation is in progress");
|
||||
|
||||
oop obj = RawAccess<>::oop_load(p);
|
||||
if (! CompressedOops::is_null(obj)) {
|
||||
if (_heap->in_collection_set(obj)) {
|
||||
assert(_heap->is_evacuation_in_progress(), "Only do this when evacuation is in progress");
|
||||
shenandoah_assert_marked(p, obj);
|
||||
oop resolved = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
|
||||
if (resolved == obj) {
|
||||
|
||||
@@ -155,7 +155,7 @@ void ShenandoahCodeRoots::flush_nmethod(nmethod* nm) {
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahCodeRoots::prepare_concurrent_unloading() {
|
||||
void ShenandoahCodeRoots::arm_nmethods() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
|
||||
_disarmed_value ++;
|
||||
// 0 is reserved for new nmethod
|
||||
@@ -215,7 +215,6 @@ public:
|
||||
|
||||
if (nm->is_unloading()) {
|
||||
ShenandoahReentrantLocker locker(nm_data->lock());
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
unlink(nm);
|
||||
return;
|
||||
}
|
||||
@@ -223,8 +222,9 @@ public:
|
||||
ShenandoahReentrantLocker locker(nm_data->lock());
|
||||
|
||||
// Heal oops and disarm
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
ShenandoahNMethod::heal_nmethod(nm);
|
||||
if (_heap->is_evacuation_in_progress()) {
|
||||
ShenandoahNMethod::heal_nmethod(nm);
|
||||
}
|
||||
ShenandoahNMethod::disarm_nmethod(nm);
|
||||
|
||||
// Clear compiled ICs and exception caches
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
// Concurrent nmethod unloading support
|
||||
static void unlink(WorkGang* workers, bool unloading_occurred);
|
||||
static void purge(WorkGang* workers);
|
||||
static void prepare_concurrent_unloading();
|
||||
static void arm_nmethods();
|
||||
static int disarmed_value() { return _disarmed_value; }
|
||||
static int* disarmed_value_address() { return &_disarmed_value; }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2019, 2020, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
@@ -47,6 +47,8 @@ bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() {
|
||||
}
|
||||
|
||||
bool ShenandoahConcurrentRoots::should_do_concurrent_class_unloading() {
|
||||
ShenandoahHeap* const heap = ShenandoahHeap::heap();
|
||||
return can_do_concurrent_class_unloading() &&
|
||||
!ShenandoahHeap::heap()->is_stw_gc_in_progress();
|
||||
heap->unload_classes() &&
|
||||
!heap->is_stw_gc_in_progress();
|
||||
}
|
||||
|
||||
@@ -123,11 +123,3 @@ ShenandoahEvacOOMScope::ShenandoahEvacOOMScope() {
|
||||
ShenandoahEvacOOMScope::~ShenandoahEvacOOMScope() {
|
||||
ShenandoahHeap::heap()->leave_evacuation();
|
||||
}
|
||||
|
||||
ShenandoahEvacOOMScopeLeaver::ShenandoahEvacOOMScopeLeaver() {
|
||||
ShenandoahHeap::heap()->leave_evacuation();
|
||||
}
|
||||
|
||||
ShenandoahEvacOOMScopeLeaver::~ShenandoahEvacOOMScopeLeaver() {
|
||||
ShenandoahHeap::heap()->enter_evacuation();
|
||||
}
|
||||
|
||||
@@ -119,10 +119,4 @@ public:
|
||||
~ShenandoahEvacOOMScope();
|
||||
};
|
||||
|
||||
class ShenandoahEvacOOMScopeLeaver : public StackObj {
|
||||
public:
|
||||
ShenandoahEvacOOMScopeLeaver();
|
||||
~ShenandoahEvacOOMScopeLeaver();
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHEVACOOMHANDLER_HPP
|
||||
|
||||
@@ -542,6 +542,7 @@ void ShenandoahHeap::print_on(outputStream* st) const {
|
||||
if (is_degenerated_gc_in_progress()) st->print("degenerated gc, ");
|
||||
if (is_full_gc_in_progress()) st->print("full gc, ");
|
||||
if (is_full_gc_move_in_progress()) st->print("full gc move, ");
|
||||
if (is_concurrent_root_in_progress()) st->print("concurrent roots, ");
|
||||
|
||||
if (cancelled_gc()) {
|
||||
st->print("cancelled");
|
||||
@@ -1329,7 +1330,9 @@ void ShenandoahHeap::object_iterate(ObjectClosure* cl) {
|
||||
|
||||
// Keep alive an object that was loaded with AS_NO_KEEPALIVE.
|
||||
void ShenandoahHeap::keep_alive(oop obj) {
|
||||
ShenandoahBarrierSet::barrier_set()->enqueue(obj);
|
||||
if (is_concurrent_mark_in_progress()) {
|
||||
ShenandoahBarrierSet::barrier_set()->enqueue(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahHeap::heap_region_iterate(ShenandoahHeapRegionClosure* blk) const {
|
||||
@@ -1540,6 +1543,11 @@ void ShenandoahHeap::op_final_mark() {
|
||||
_free_set->rebuild();
|
||||
}
|
||||
|
||||
if (!is_degenerated_gc_in_progress()) {
|
||||
prepare_concurrent_roots();
|
||||
prepare_concurrent_unloading();
|
||||
}
|
||||
|
||||
// If collection set has candidates, start evacuation.
|
||||
// Otherwise, bypass the rest of the cycle.
|
||||
if (!collection_set()->is_empty()) {
|
||||
@@ -1554,8 +1562,9 @@ void ShenandoahHeap::op_final_mark() {
|
||||
set_has_forwarded_objects(true);
|
||||
|
||||
if (!is_degenerated_gc_in_progress()) {
|
||||
prepare_concurrent_roots();
|
||||
prepare_concurrent_unloading();
|
||||
if (ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
|
||||
ShenandoahCodeRoots::arm_nmethods();
|
||||
}
|
||||
evacuate_and_update_roots();
|
||||
}
|
||||
|
||||
@@ -1669,7 +1678,7 @@ public:
|
||||
};
|
||||
|
||||
void ShenandoahHeap::op_roots() {
|
||||
if (is_evacuation_in_progress()) {
|
||||
if (is_concurrent_root_in_progress()) {
|
||||
if (ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
|
||||
_unloader.unload();
|
||||
}
|
||||
@@ -2235,7 +2244,6 @@ void ShenandoahHeap::prepare_concurrent_roots() {
|
||||
void ShenandoahHeap::prepare_concurrent_unloading() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
|
||||
if (ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
|
||||
ShenandoahCodeRoots::prepare_concurrent_unloading();
|
||||
_unloader.prepare();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ void ShenandoahNMethod::heal_nmethod(nmethod* nm) {
|
||||
assert(data != NULL, "Sanity");
|
||||
assert(data->lock()->owned_by_self(), "Must hold the lock");
|
||||
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
ShenandoahEvacuateUpdateRootsClosure cl;
|
||||
data->oops_do(&cl, true /*fix relocation*/);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ ShenandoahClassUnloadingTask::ShenandoahClassUnloadingTask(BoolObjectClosure* is
|
||||
}
|
||||
|
||||
void ShenandoahClassUnloadingTask::work(uint worker_id) {
|
||||
ShenandoahEvacOOMScope scope;
|
||||
_code_cache_task.work(worker_id);
|
||||
// Clean all klasses that were not unloaded.
|
||||
// The weak metadata in klass doesn't need to be
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2019, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2015, 2020, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
@@ -226,6 +226,7 @@ private:
|
||||
ShenandoahThreadRoots _thread_roots;
|
||||
ShenandoahCodeCacheRoots<ITR> _code_roots;
|
||||
ShenandoahVMRoots<false /*concurrent*/ > _vm_roots;
|
||||
ShenandoahStringDedupRoots _dedup_roots;
|
||||
ShenandoahClassLoaderDataRoots<false /*concurrent*/, false /*single threaded*/>
|
||||
_cld_roots;
|
||||
public:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2019, 2020, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
@@ -250,6 +250,9 @@ void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDC
|
||||
if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
|
||||
_code_roots.code_blobs_do(code, worker_id);
|
||||
}
|
||||
|
||||
AlwaysTrueClosure always_true;
|
||||
_dedup_roots.oops_do(&always_true, oops, worker_id);
|
||||
}
|
||||
|
||||
template <typename ITR>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
@@ -173,7 +173,6 @@ public:
|
||||
void work(uint worker_id) {
|
||||
ShenandoahParallelWorkerSession worker_session(worker_id);
|
||||
|
||||
ShenandoahEvacOOMScope oom_evac_scope;
|
||||
ShenandoahObjToScanQueueSet* queues = _heap->traversal_gc()->task_queues();
|
||||
ShenandoahObjToScanQueue* q = queues->queue(worker_id);
|
||||
|
||||
@@ -194,9 +193,6 @@ public:
|
||||
} else {
|
||||
_rp->roots_do(worker_id, &roots_cl, &cld_cl, &code_cl);
|
||||
}
|
||||
|
||||
AlwaysTrueClosure is_alive;
|
||||
_dedup_roots.oops_do(&is_alive, &roots_cl, worker_id);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -214,7 +210,6 @@ public:
|
||||
void work(uint worker_id) {
|
||||
ShenandoahConcurrentWorkerSession worker_session(worker_id);
|
||||
ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers);
|
||||
ShenandoahEvacOOMScope oom_evac_scope;
|
||||
ShenandoahTraversalGC* traversal_gc = _heap->traversal_gc();
|
||||
|
||||
// Drain all outstanding work in queues.
|
||||
@@ -237,7 +232,6 @@ public:
|
||||
void work(uint worker_id) {
|
||||
ShenandoahParallelWorkerSession worker_session(worker_id);
|
||||
|
||||
ShenandoahEvacOOMScope oom_evac_scope;
|
||||
ShenandoahTraversalGC* traversal_gc = _heap->traversal_gc();
|
||||
|
||||
ShenandoahObjToScanQueueSet* queues = traversal_gc->task_queues();
|
||||
@@ -542,7 +536,6 @@ void ShenandoahTraversalGC::main_loop_work(T* cl, jushort* live_data, uint worke
|
||||
|
||||
if (work == 0) {
|
||||
// No more work, try to terminate
|
||||
ShenandoahEvacOOMScopeLeaver oom_scope_leaver;
|
||||
ShenandoahSuspendibleThreadSetLeaver stsl(sts_yield && ShenandoahSuspendibleWorkers);
|
||||
ShenandoahTerminationTimingsTracker term_tracker(worker_id);
|
||||
ShenandoahTerminatorTerminator tt(_heap);
|
||||
@@ -811,7 +804,6 @@ private:
|
||||
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) {
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
_traversal_gc->process_oop<T, false /* string dedup */, false /* degen */, true /* atomic update */>(p, _thread, _queue, _mark_context);
|
||||
}
|
||||
|
||||
@@ -834,7 +826,6 @@ private:
|
||||
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) {
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
_traversal_gc->process_oop<T, false /* string dedup */, true /* degen */, false /* atomic update */>(p, _thread, _queue, _mark_context);
|
||||
}
|
||||
|
||||
@@ -861,7 +852,6 @@ public:
|
||||
assert(worker_id == 0, "The code below is single-threaded, only one worker is expected");
|
||||
ShenandoahParallelWorkerSession worker_session(worker_id);
|
||||
ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers);
|
||||
ShenandoahEvacOOMScope oom_evac_scope;
|
||||
|
||||
ShenandoahHeap* sh = ShenandoahHeap::heap();
|
||||
|
||||
@@ -968,7 +958,6 @@ public:
|
||||
assert(sh->process_references(), "why else would we be here?");
|
||||
shenandoah_assert_rp_isalive_installed();
|
||||
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
traversal_gc->main_loop(_worker_id, _terminator, false);
|
||||
|
||||
if (_reset_terminator) {
|
||||
@@ -1010,7 +999,6 @@ public:
|
||||
}
|
||||
|
||||
void work(uint worker_id) {
|
||||
ShenandoahEvacOOMScope oom_evac_scope;
|
||||
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
|
||||
ShenandoahHeap* heap = ShenandoahHeap::heap();
|
||||
ShenandoahTraversalDrainMarkingStackClosure complete_gc(worker_id, _terminator);
|
||||
|
||||
@@ -51,6 +51,7 @@ void ShenandoahTraversalGC::process_oop(T* p, Thread* thread, ShenandoahObjToSca
|
||||
} else if (_heap->in_collection_set(obj)) {
|
||||
oop forw = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
|
||||
if (obj == forw) {
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
forw = _heap->evacuate_object(obj, thread);
|
||||
}
|
||||
shenandoah_assert_forwarded_except(p, obj, _heap->cancelled_gc());
|
||||
|
||||
@@ -79,7 +79,7 @@ class ShenandoahIsUnloadingBehaviour : public IsUnloadingBehaviour {
|
||||
public:
|
||||
virtual bool is_unloading(CompiledMethod* method) const {
|
||||
nmethod* const nm = method->as_nmethod();
|
||||
guarantee(ShenandoahHeap::heap()->is_evacuation_in_progress(), "Only this phase");
|
||||
guarantee(ShenandoahHeap::heap()->is_concurrent_root_in_progress(), "Only this phase");
|
||||
ShenandoahNMethod* data = ShenandoahNMethod::gc_data(nm);
|
||||
ShenandoahReentrantLocker locker(data->lock());
|
||||
ShenandoahIsUnloadingOopClosure cl;
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
|
||||
void ShenandoahUnload::unload() {
|
||||
assert(ShenandoahConcurrentRoots::can_do_concurrent_class_unloading(), "Why we here?");
|
||||
if (!ShenandoahHeap::heap()->is_evacuation_in_progress()) {
|
||||
if (!ShenandoahHeap::heap()->is_concurrent_root_in_progress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ ZRootsIterator::ZRootsIterator(bool visit_jvmti_weak_export) :
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
|
||||
ZStatTimer timer(ZSubPhasePauseRootsSetup);
|
||||
Threads::change_thread_claim_token();
|
||||
COMPILER2_PRESENT(DerivedPointerTable::clear());
|
||||
COMPILER2_OR_JVMCI_PRESENT(DerivedPointerTable::clear());
|
||||
if (ClassUnloading) {
|
||||
nmethod::oops_do_marking_prologue();
|
||||
} else {
|
||||
@@ -207,7 +207,7 @@ ZRootsIterator::~ZRootsIterator() {
|
||||
ZNMethod::oops_do_end();
|
||||
}
|
||||
|
||||
COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
|
||||
COMPILER2_OR_JVMCI_PRESENT(DerivedPointerTable::update_pointers());
|
||||
Threads::assert_all_threads_claimed();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@@ -131,7 +131,7 @@ void BFSClosure::closure_impl(UnifiedOopRef reference, const oop pointee) {
|
||||
if (!_mark_bits->is_marked(pointee)) {
|
||||
_mark_bits->mark_obj(pointee);
|
||||
// is the pointee a sample object?
|
||||
if (NULL == pointee->mark().to_pointer()) {
|
||||
if (pointee->mark().is_marked()) {
|
||||
add_chain(reference, pointee);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void BFSClosure::closure_impl(UnifiedOopRef reference, const oop pointee) {
|
||||
|
||||
void BFSClosure::add_chain(UnifiedOopRef reference, const oop pointee) {
|
||||
assert(pointee != NULL, "invariant");
|
||||
assert(NULL == pointee->mark().to_pointer(), "invariant");
|
||||
assert(pointee->mark().is_marked(), "invariant");
|
||||
Edge leak_edge(_current_parent, reference);
|
||||
_edge_store->put_chain(&leak_edge, _current_parent == NULL ? 1 : _current_frontier_level + 2);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@@ -121,7 +121,7 @@ void DFSClosure::closure_impl(UnifiedOopRef reference, const oop pointee) {
|
||||
assert(_mark_bits->is_marked(pointee), "invariant");
|
||||
|
||||
// is the pointee a sample object?
|
||||
if (NULL == pointee->mark().to_pointer()) {
|
||||
if (pointee->mark().is_marked()) {
|
||||
add_chain();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@@ -231,7 +231,7 @@ StoredEdge* EdgeStore::associate_leak_context_with_candidate(const Edge* edge) {
|
||||
StoredEdge* const leak_context_edge = put(edge->reference());
|
||||
oop sample_object = edge->pointee();
|
||||
assert(sample_object != NULL, "invariant");
|
||||
assert(NULL == sample_object->mark().to_pointer(), "invariant");
|
||||
assert(sample_object->mark().is_marked(), "invariant");
|
||||
sample_object->set_mark(markWord::from_pointer(leak_context_edge));
|
||||
return leak_context_edge;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 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
|
||||
@@ -67,14 +67,11 @@ class ObjectSampleMarker : public StackObj {
|
||||
assert(obj != NULL, "invariant");
|
||||
// save the original markWord
|
||||
_store->push(ObjectSampleMarkWord(obj, obj->mark()));
|
||||
// now we will "poison" the mark word of the sample object
|
||||
// to the intermediate monitor INFLATING state.
|
||||
// This is an "impossible" state during a safepoint,
|
||||
// hence we will use it to quickly identify sample objects
|
||||
// during the reachability search from gc roots.
|
||||
assert(NULL == markWord::INFLATING().to_pointer(), "invariant");
|
||||
obj->set_mark(markWord::INFLATING());
|
||||
assert(NULL == obj->mark().to_pointer(), "invariant");
|
||||
// now we will set the mark word to "marked" in order to quickly
|
||||
// identify sample objects during the reachability search from gc roots.
|
||||
assert(!obj->mark().is_marked(), "should only mark an object once");
|
||||
obj->set_mark(markWord::prototype().set_marked());
|
||||
assert(obj->mark().is_marked(), "invariant");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 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
|
||||
@@ -53,12 +53,15 @@ EventEmitter::~EventEmitter() {
|
||||
}
|
||||
|
||||
void EventEmitter::emit(ObjectSampler* sampler, int64_t cutoff_ticks, bool emit_all) {
|
||||
assert(JfrStream_lock->owned_by_self(), "invariant");
|
||||
assert(sampler != NULL, "invariant");
|
||||
ResourceMark rm;
|
||||
EdgeStore edge_store;
|
||||
if (cutoff_ticks <= 0) {
|
||||
// no reference chains
|
||||
MutexLocker lock(JfrStream_lock, Mutex::_no_safepoint_check_flag);
|
||||
// The lock is needed here to prevent the recorder thread (running flush())
|
||||
// from writing old object events out from the thread local buffer
|
||||
// before the required constant pools have been serialized.
|
||||
JfrTicks time_stamp = JfrTicks::now();
|
||||
EventEmitter emitter(time_stamp, time_stamp);
|
||||
emitter.write_events(sampler, &edge_store, emit_all);
|
||||
@@ -113,7 +116,9 @@ void EventEmitter::write_event(const ObjectSample* sample, EdgeStore* edge_store
|
||||
traceid gc_root_id = 0;
|
||||
const Edge* edge = NULL;
|
||||
if (SafepointSynchronize::is_at_safepoint()) {
|
||||
edge = (const Edge*)(sample->object())->mark().to_pointer();
|
||||
if (!sample->object()->mark().is_marked()) {
|
||||
edge = (const Edge*)(sample->object())->mark().to_pointer();
|
||||
}
|
||||
}
|
||||
if (edge == NULL) {
|
||||
// In order to dump out a representation of the event
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@@ -35,8 +35,10 @@
|
||||
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp"
|
||||
#include "jfr/recorder/service/jfrOptionSet.hpp"
|
||||
#include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp"
|
||||
#include "jfr/support/jfrMethodLookup.hpp"
|
||||
#include "jfr/utilities/jfrHashtable.hpp"
|
||||
#include "jfr/utilities/jfrTypes.hpp"
|
||||
#include "oops/instanceKlass.inline.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
@@ -108,6 +110,7 @@ void ObjectSampleCheckpoint::on_thread_exit(JavaThread* jt) {
|
||||
static GrowableArray<traceid>* unloaded_klass_set = NULL;
|
||||
|
||||
static void add_to_unloaded_klass_set(traceid klass_id) {
|
||||
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
|
||||
if (unloaded_klass_set == NULL) {
|
||||
unloaded_klass_set = c_heap_allocate_array<traceid>();
|
||||
}
|
||||
@@ -115,14 +118,16 @@ static void add_to_unloaded_klass_set(traceid klass_id) {
|
||||
}
|
||||
|
||||
static void sort_unloaded_klass_set() {
|
||||
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
|
||||
if (unloaded_klass_set != NULL && unloaded_klass_set->length() > 1) {
|
||||
unloaded_klass_set->sort(sort_traceid);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectSampleCheckpoint::on_klass_unload(const Klass* k) {
|
||||
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
|
||||
assert(k != NULL, "invariant");
|
||||
add_to_unloaded_klass_set(TRACE_ID(k));
|
||||
add_to_unloaded_klass_set(JfrTraceId::get(k));
|
||||
}
|
||||
|
||||
template <typename Processor>
|
||||
@@ -295,29 +300,31 @@ void ObjectSampleCheckpoint::on_rotation(const ObjectSampler* sampler, JfrStackT
|
||||
assert(JfrStream_lock->owned_by_self(), "invariant");
|
||||
assert(sampler != NULL, "invariant");
|
||||
assert(LeakProfiler::is_running(), "invariant");
|
||||
MutexLocker lock(ClassLoaderDataGraph_lock);
|
||||
// the lock is needed to ensure the unload lists do not grow in the middle of inspection.
|
||||
install_stack_traces(sampler, stack_trace_repo);
|
||||
}
|
||||
|
||||
static traceid get_klass_id(traceid method_id) {
|
||||
static bool is_klass_unloaded(traceid klass_id) {
|
||||
assert(ClassLoaderDataGraph_lock->owned_by_self(), "invariant");
|
||||
return unloaded_klass_set != NULL && predicate(unloaded_klass_set, klass_id);
|
||||
}
|
||||
|
||||
static bool is_processed(traceid method_id) {
|
||||
assert(method_id != 0, "invariant");
|
||||
return method_id >> TRACE_ID_SHIFT;
|
||||
}
|
||||
|
||||
static bool is_klass_unloaded(traceid method_id) {
|
||||
return unloaded_klass_set != NULL && predicate(unloaded_klass_set, get_klass_id(method_id));
|
||||
}
|
||||
|
||||
static bool is_processed(traceid id) {
|
||||
assert(id != 0, "invariant");
|
||||
assert(id_set != NULL, "invariant");
|
||||
return mutable_predicate(id_set, id);
|
||||
return mutable_predicate(id_set, method_id);
|
||||
}
|
||||
|
||||
void ObjectSampleCheckpoint::add_to_leakp_set(const Method* method, traceid method_id) {
|
||||
if (is_processed(method_id) || is_klass_unloaded(method_id)) {
|
||||
void ObjectSampleCheckpoint::add_to_leakp_set(const InstanceKlass* ik, traceid method_id) {
|
||||
assert(ik != NULL, "invariant");
|
||||
if (is_processed(method_id) || is_klass_unloaded(JfrMethodLookup::klass_id(method_id))) {
|
||||
return;
|
||||
}
|
||||
JfrTraceId::set_leakp(method);
|
||||
const Method* const method = JfrMethodLookup::lookup(ik, method_id);
|
||||
assert(method != NULL, "invariant");
|
||||
assert(method->method_holder() == ik, "invariant");
|
||||
JfrTraceId::set_leakp(ik, method);
|
||||
}
|
||||
|
||||
void ObjectSampleCheckpoint::write_stacktrace(const JfrStackTrace* trace, JfrCheckpointWriter& writer) {
|
||||
@@ -330,7 +337,7 @@ void ObjectSampleCheckpoint::write_stacktrace(const JfrStackTrace* trace, JfrChe
|
||||
for (u4 i = 0; i < trace->_nr_of_frames; ++i) {
|
||||
const JfrStackFrame& frame = trace->_frames[i];
|
||||
frame.write(writer);
|
||||
add_to_leakp_set(frame._method, frame._methodid);
|
||||
add_to_leakp_set(frame._klass, frame._methodid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,6 +420,7 @@ void ObjectSampleCheckpoint::write(const ObjectSampler* sampler, EdgeStore* edge
|
||||
}
|
||||
|
||||
static void clear_unloaded_klass_set() {
|
||||
assert(ClassLoaderDataGraph_lock->owned_by_self(), "invariant");
|
||||
if (unloaded_klass_set != NULL && unloaded_klass_set->is_nonempty()) {
|
||||
unloaded_klass_set->clear();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@@ -29,12 +29,12 @@
|
||||
#include "jfr/utilities/jfrTypes.hpp"
|
||||
|
||||
class EdgeStore;
|
||||
class InstanceKlass;
|
||||
class JavaThread;
|
||||
class JfrCheckpointWriter;
|
||||
class JfrStackTrace;
|
||||
class JfrStackTraceRepository;
|
||||
class Klass;
|
||||
class Method;
|
||||
class ObjectSample;
|
||||
class ObjectSampleMarker;
|
||||
class ObjectSampler;
|
||||
@@ -45,7 +45,7 @@ class ObjectSampleCheckpoint : AllStatic {
|
||||
friend class PathToGcRootsOperation;
|
||||
friend class StackTraceBlobInstaller;
|
||||
private:
|
||||
static void add_to_leakp_set(const Method* method, traceid method_id);
|
||||
static void add_to_leakp_set(const InstanceKlass* ik, traceid method_id);
|
||||
static int save_mark_words(const ObjectSampler* sampler, ObjectSampleMarker& marker, bool emit_all);
|
||||
static void write_stacktrace(const JfrStackTrace* trace, JfrCheckpointWriter& writer);
|
||||
static void write(const ObjectSampler* sampler, EdgeStore* edge_store, bool emit_all, Thread* thread);
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "jfr/recorder/service/jfrOptionSet.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "runtime/thread.inline.hpp"
|
||||
#include "runtime/vmThread.hpp"
|
||||
|
||||
@@ -83,7 +82,6 @@ void LeakProfiler::emit_events(int64_t cutoff_ticks, bool emit_all) {
|
||||
if (!is_running()) {
|
||||
return;
|
||||
}
|
||||
MutexLocker lock(JfrStream_lock);
|
||||
// exclusive access to object sampler instance
|
||||
ObjectSampler* const sampler = ObjectSampler::acquire();
|
||||
assert(sampler != NULL, "invariant");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2012, 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
|
||||
@@ -464,7 +464,7 @@
|
||||
<Field type="ulong" contentType="bytes" name="used" label="Used" />
|
||||
</Event>
|
||||
|
||||
<Event name="Compilation" category="Java Virtual Machine, Compiler" label="Compilation" thread="true">
|
||||
<Event name="Compilation" category="Java Virtual Machine, Compiler" label="Compilation" thread="true" commitState="_thread_in_native">
|
||||
<Field type="uint" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
||||
<Field type="CompilerType" name="compiler" label="Compiler" />
|
||||
<Field type="Method" name="method" label="Method" />
|
||||
@@ -492,7 +492,7 @@
|
||||
<Field type="string" name="descriptor" label="Method Descriptor" />
|
||||
</Type>
|
||||
|
||||
<Event name="CompilerInlining" category="Java Virtual Machine, Compiler, Optimization" label="Method Inlining" thread="true" startTime="false">
|
||||
<Event name="CompilerInlining" category="Java Virtual Machine, Compiler, Optimization" label="Method Inlining" thread="true" startTime="false" commitState="_thread_in_native">
|
||||
<Field type="uint" name="compileId" label="Compilation Identifier" relation="CompileId" />
|
||||
<Field type="Method" name="caller" label="Caller Method" />
|
||||
<Field type="CalleeMethod" name="callee" struct="true" label="Callee Method" />
|
||||
@@ -1023,36 +1023,6 @@
|
||||
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
|
||||
</Event>
|
||||
|
||||
<Event name="FlushStorage" category="Flight Recorder" label="Flush Storage" thread="false" experimental="true">
|
||||
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
|
||||
<Field type="ulong" name="elements" label="Elements Written" />
|
||||
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
|
||||
</Event>
|
||||
|
||||
<Event name="FlushStacktrace" category="Flight Recorder" label="Flush Stacktrace" thread="false" experimental="true">
|
||||
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
|
||||
<Field type="ulong" name="elements" label="Elements Written" />
|
||||
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
|
||||
</Event>
|
||||
|
||||
<Event name="FlushStringPool" category="Flight Recorder" label="Flush String Pool" thread="false" experimental="true">
|
||||
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
|
||||
<Field type="ulong" name="elements" label="Elements Written" />
|
||||
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
|
||||
</Event>
|
||||
|
||||
<Event name="FlushMetadata" category="Flight Recorder" label="Flush Metadata" thread="false" experimental="true">
|
||||
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
|
||||
<Field type="ulong" name="elements" label="Elements Written" />
|
||||
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
|
||||
</Event>
|
||||
|
||||
<Event name="FlushTypeSet" category="Flight Recorder" label="Flush Type Set" thread="false" experimental="true">
|
||||
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
|
||||
<Field type="ulong" name="elements" label="Elements Written" />
|
||||
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
|
||||
</Event>
|
||||
|
||||
<Type name="DeoptimizationReason" label="Deoptimization Reason">
|
||||
<Field type="string" name="reason" label="Reason" />
|
||||
</Type>
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<xs:attribute name="stackTrace" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="period" type="periodType" use="optional" />
|
||||
<xs:attribute name="cutoff" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="commitState" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element maxOccurs="unbounded" name="Type">
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/mutex.hpp"
|
||||
#include "runtime/orderAccess.hpp"
|
||||
#include "runtime/os.inline.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
|
||||
@@ -172,7 +172,7 @@ static BufferPtr lease_free(size_t size, JfrCheckpointMspace* mspace, size_t ret
|
||||
}
|
||||
|
||||
bool JfrCheckpointManager::use_epoch_transition_mspace(const Thread* thread) const {
|
||||
return _service_thread != thread && _checkpoint_epoch_state != JfrTraceIdEpoch::epoch();
|
||||
return _service_thread != thread && Atomic::load_acquire(&_checkpoint_epoch_state) != JfrTraceIdEpoch::epoch();
|
||||
}
|
||||
|
||||
static const size_t lease_retry = 10;
|
||||
@@ -333,7 +333,19 @@ static size_t write_mspace(JfrCheckpointMspace* mspace, JfrChunkWriter& chunkwri
|
||||
return wo.processed();
|
||||
}
|
||||
|
||||
void JfrCheckpointManager::synchronize_epoch() {
|
||||
void JfrCheckpointManager::begin_epoch_shift() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "invariant");
|
||||
JfrTraceIdEpoch::begin_epoch_shift();
|
||||
}
|
||||
|
||||
void JfrCheckpointManager::end_epoch_shift() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "invariant");
|
||||
debug_only(const u1 current_epoch = JfrTraceIdEpoch::current();)
|
||||
JfrTraceIdEpoch::end_epoch_shift();
|
||||
assert(current_epoch != JfrTraceIdEpoch::current(), "invariant");
|
||||
}
|
||||
|
||||
void JfrCheckpointManager::synchronize_checkpoint_manager_with_current_epoch() {
|
||||
assert(_checkpoint_epoch_state != JfrTraceIdEpoch::epoch(), "invariant");
|
||||
OrderAccess::storestore();
|
||||
_checkpoint_epoch_state = JfrTraceIdEpoch::epoch();
|
||||
@@ -341,7 +353,7 @@ void JfrCheckpointManager::synchronize_epoch() {
|
||||
|
||||
size_t JfrCheckpointManager::write() {
|
||||
const size_t processed = write_mspace<MutexedWriteOp, CompositeOperation>(_free_list_mspace, _chunkwriter);
|
||||
synchronize_epoch();
|
||||
synchronize_checkpoint_manager_with_current_epoch();
|
||||
return processed;
|
||||
}
|
||||
|
||||
@@ -361,11 +373,11 @@ size_t JfrCheckpointManager::flush() {
|
||||
|
||||
typedef DiscardOp<DefaultDiscarder<JfrBuffer> > DiscardOperation;
|
||||
size_t JfrCheckpointManager::clear() {
|
||||
JfrTypeSet::clear();
|
||||
clear_type_set();
|
||||
DiscardOperation discarder(mutexed); // mutexed discard mode
|
||||
process_free_list(discarder, _free_list_mspace);
|
||||
process_free_list(discarder, _epoch_transition_mspace);
|
||||
synchronize_epoch();
|
||||
synchronize_checkpoint_manager_with_current_epoch();
|
||||
return discarder.elements();
|
||||
}
|
||||
|
||||
@@ -410,18 +422,21 @@ size_t JfrCheckpointManager::write_static_type_set_and_threads() {
|
||||
return write_epoch_transition_mspace();
|
||||
}
|
||||
|
||||
void JfrCheckpointManager::shift_epoch() {
|
||||
debug_only(const u1 current_epoch = JfrTraceIdEpoch::current();)
|
||||
JfrTraceIdEpoch::shift_epoch();
|
||||
assert(current_epoch != JfrTraceIdEpoch::current(), "invariant");
|
||||
}
|
||||
|
||||
void JfrCheckpointManager::on_rotation() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "invariant");
|
||||
JfrTypeManager::on_rotation();
|
||||
notify_threads();
|
||||
}
|
||||
|
||||
void JfrCheckpointManager::clear_type_set() {
|
||||
assert(!SafepointSynchronize::is_at_safepoint(), "invariant");
|
||||
assert(!JfrRecorder::is_recording(), "invariant");
|
||||
// can safepoint here
|
||||
MutexLocker cld_lock(ClassLoaderDataGraph_lock);
|
||||
MutexLocker module_lock(Module_lock);
|
||||
JfrTypeSet::clear();
|
||||
}
|
||||
|
||||
void JfrCheckpointManager::write_type_set() {
|
||||
assert(!SafepointSynchronize::is_at_safepoint(), "invariant");
|
||||
if (LeakProfiler::is_running()) {
|
||||
|
||||
@@ -85,11 +85,14 @@ class JfrCheckpointManager : public JfrCHeapObj {
|
||||
size_t write_threads();
|
||||
size_t write_static_type_set_and_threads();
|
||||
bool is_type_set_required();
|
||||
void clear_type_set();
|
||||
void write_type_set();
|
||||
static void write_type_set_for_unloaded_classes();
|
||||
|
||||
void shift_epoch();
|
||||
void synchronize_epoch();
|
||||
void begin_epoch_shift();
|
||||
void end_epoch_shift();
|
||||
void synchronize_checkpoint_manager_with_current_epoch();
|
||||
|
||||
void notify_threads();
|
||||
|
||||
JfrCheckpointManager(JfrChunkWriter& cw);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user