mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-09 10:01:41 +01:00
Compare commits
380 Commits
vkempik/rv
...
jb17-b600
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1750c6f390 | ||
|
|
fb725c15c4 | ||
|
|
436e76c6f4 | ||
|
|
1140243cf5 | ||
|
|
69fe60e162 | ||
|
|
6abfb62f94 | ||
|
|
b0c967f67c | ||
|
|
ccd78be3e2 | ||
|
|
a5285078e9 | ||
|
|
f557760e16 | ||
|
|
292246a53e | ||
|
|
82bbe56bd7 | ||
|
|
d443004009 | ||
|
|
eef606b605 | ||
|
|
345f52a4ec | ||
|
|
a52ed88377 | ||
|
|
da53a4dda4 | ||
|
|
a941dafa0b | ||
|
|
8e6b8bcbc9 | ||
|
|
a1b6ceb0b0 | ||
|
|
eab8881f02 | ||
|
|
f863a14b19 | ||
|
|
bd30286bf1 | ||
|
|
9fd49f2c75 | ||
|
|
820bc169b2 | ||
|
|
e90ffa06c1 | ||
|
|
8f0a0800c0 | ||
|
|
890bd435b8 | ||
|
|
6c1e8f9ef3 | ||
|
|
19c777ecb2 | ||
|
|
339724dc15 | ||
|
|
5a57b7610f | ||
|
|
3b8a2c2a96 | ||
|
|
0fa5fab938 | ||
|
|
056d5d6e6b | ||
|
|
030b686740 | ||
|
|
bb525776f4 | ||
|
|
b3e080a26b | ||
|
|
f1cd491d10 | ||
|
|
048a0a0f5c | ||
|
|
cf8740ad08 | ||
|
|
dc1b49b5a6 | ||
|
|
cc78d0b872 | ||
|
|
5a82f557ad | ||
|
|
30639cd55a | ||
|
|
2067181181 | ||
|
|
60f90078b7 | ||
|
|
6678e14181 | ||
|
|
88a58263ff | ||
|
|
98a07f0df1 | ||
|
|
5f3b133afb | ||
|
|
c648ccd547 | ||
|
|
d9482099a9 | ||
|
|
7bda23a925 | ||
|
|
ffa2b4fd28 | ||
|
|
0c8d7e4d96 | ||
|
|
040270882a | ||
|
|
9b133dea20 | ||
|
|
0dab88ba34 | ||
|
|
ea68b428df | ||
|
|
690d1594f5 | ||
|
|
f44f138ff5 | ||
|
|
d12493ee17 | ||
|
|
1d142fe2d3 | ||
|
|
19925e2cf1 | ||
|
|
3611393e41 | ||
|
|
8d0b9b0544 | ||
|
|
e702c1ee8c | ||
|
|
31355fa74e | ||
|
|
ac07460e44 | ||
|
|
b94148b818 | ||
|
|
5852f6cff5 | ||
|
|
de4f86c455 | ||
|
|
44e025e286 | ||
|
|
193831fda6 | ||
|
|
b664e66d02 | ||
|
|
cd4f3ba18d | ||
|
|
2578bba2ae | ||
|
|
3839a0d732 | ||
|
|
0c355821ef | ||
|
|
4b42ee38d5 | ||
|
|
14327f0ab1 | ||
|
|
18561e3192 | ||
|
|
51ae74bb99 | ||
|
|
a8c038b872 | ||
|
|
d53e4daaee | ||
|
|
9886b49f70 | ||
|
|
e2749ccd05 | ||
|
|
0e80e5e9ac | ||
|
|
6fb25ac8e8 | ||
|
|
80d0ac8b33 | ||
|
|
a4c7ea5e59 | ||
|
|
81f8f2bff6 | ||
|
|
c9d518f6ff | ||
|
|
7ec60c2d73 | ||
|
|
721d8800c8 | ||
|
|
906f84c120 | ||
|
|
4e6c088081 | ||
|
|
f651cd87b7 | ||
|
|
a3c17f3386 | ||
|
|
3a1da92c5a | ||
|
|
5144f2c5b7 | ||
|
|
bdce3e9f2c | ||
|
|
b0f61372a8 | ||
|
|
99645ecbdd | ||
|
|
6c2ce3ae7a | ||
|
|
8dbb4c73c3 | ||
|
|
2531e69aa6 | ||
|
|
cb8e82d992 | ||
|
|
37c6d5f230 | ||
|
|
1cb571cc21 | ||
|
|
d616a12a70 | ||
|
|
ea64bb8fe9 | ||
|
|
f1735b17cc | ||
|
|
35c2fca802 | ||
|
|
ea352d0d5c | ||
|
|
9fa23a4646 | ||
|
|
bc093901cd | ||
|
|
4bcda1856e | ||
|
|
df641aa323 | ||
|
|
4fadc15610 | ||
|
|
35e5d01d8a | ||
|
|
f5a0c2350c | ||
|
|
5b4cbd3d28 | ||
|
|
fed4540405 | ||
|
|
01a0d697dd | ||
|
|
4fe8b8899d | ||
|
|
aca2dbec8f | ||
|
|
289fdf2bad | ||
|
|
53ba6a8dd7 | ||
|
|
347fafdbd3 | ||
|
|
6afa1299ba | ||
|
|
7e31edd17a | ||
|
|
9a008025fc | ||
|
|
d8cc532974 | ||
|
|
52f1b71aa9 | ||
|
|
60fa5fb29f | ||
|
|
da5ecfd226 | ||
|
|
fc62424ae9 | ||
|
|
b81e3e2ac0 | ||
|
|
f4f173a412 | ||
|
|
0e558ecf98 | ||
|
|
581f482673 | ||
|
|
d5b3f364f6 | ||
|
|
bbcd8deeeb | ||
|
|
365453fa0f | ||
|
|
68ee5e4016 | ||
|
|
885b0c8783 | ||
|
|
33ec34dec9 | ||
|
|
97328400a5 | ||
|
|
b05a97af4b | ||
|
|
5fb41b33ec | ||
|
|
f25e8d1e6c | ||
|
|
a18a738b42 | ||
|
|
6f0b639b91 | ||
|
|
f6a6e6c73e | ||
|
|
1769afd114 | ||
|
|
5f8e015a0e | ||
|
|
f0e2d13c7f | ||
|
|
46b98f0839 | ||
|
|
0a0b9b84f8 | ||
|
|
d3a5335623 | ||
|
|
f8d74332c7 | ||
|
|
c5e48f486e | ||
|
|
2aef52d677 | ||
|
|
2c08acd036 | ||
|
|
2671018ace | ||
|
|
c08e4adb6f | ||
|
|
2d691a8eb4 | ||
|
|
5295d4e22a | ||
|
|
38905c8f5c | ||
|
|
603349e45e | ||
|
|
3e6b06801f | ||
|
|
552791caa2 | ||
|
|
4149771026 | ||
|
|
451a156edf | ||
|
|
f6c2765bc1 | ||
|
|
a97a083d49 | ||
|
|
260e73b53c | ||
|
|
ccf87b2cdf | ||
|
|
7cb35a057a | ||
|
|
907856ba20 | ||
|
|
21fadd66a3 | ||
|
|
943e557f56 | ||
|
|
9ede4c2d01 | ||
|
|
9523a7e838 | ||
|
|
5496fc25ba | ||
|
|
54d5e24779 | ||
|
|
ddf765b7d4 | ||
|
|
98e96aa70e | ||
|
|
e07c0980c6 | ||
|
|
69952038c4 | ||
|
|
2a5860d457 | ||
|
|
e72eb44dc2 | ||
|
|
456602c63d | ||
|
|
7066357e81 | ||
|
|
fc1396c1b2 | ||
|
|
3562039b4d | ||
|
|
1fb8c36855 | ||
|
|
06bdd7888c | ||
|
|
92965c3b42 | ||
|
|
2259ae2925 | ||
|
|
8d3d31c2e1 | ||
|
|
8dc24126e0 | ||
|
|
3554cb073d | ||
|
|
e031d013e6 | ||
|
|
a9b0bd028b | ||
|
|
4a7d5d9314 | ||
|
|
3a17af9b19 | ||
|
|
1a79359b1b | ||
|
|
643d374487 | ||
|
|
8c5557ce89 | ||
|
|
83f23743c7 | ||
|
|
9074de396d | ||
|
|
59c4b50ebb | ||
|
|
2a54e2e249 | ||
|
|
0edfb1635e | ||
|
|
89406c45b1 | ||
|
|
8266965e16 | ||
|
|
76a9f418e1 | ||
|
|
4dd36d6616 | ||
|
|
014109dcf4 | ||
|
|
0cba17ba56 | ||
|
|
ec5e19636c | ||
|
|
8d54d7a8ee | ||
|
|
26ffc41cfd | ||
|
|
1fb1d7d57a | ||
|
|
fc2abce839 | ||
|
|
8e0aeafe57 | ||
|
|
5bfd7b9f06 | ||
|
|
bb6231981b | ||
|
|
9423a22849 | ||
|
|
df6efce0cf | ||
|
|
9872c47fce | ||
|
|
703aac308e | ||
|
|
3c222af77b | ||
|
|
d6e5726d49 | ||
|
|
a35ead5c58 | ||
|
|
6ddec9f6b8 | ||
|
|
748d3e0c40 | ||
|
|
d8ff4e42ba | ||
|
|
2fb149272c | ||
|
|
f421239562 | ||
|
|
a8fb85170f | ||
|
|
25d731277f | ||
|
|
2d7b8fe2f7 | ||
|
|
351a249837 | ||
|
|
a15e8b1aca | ||
|
|
b8962e2f78 | ||
|
|
24b1a67cf4 | ||
|
|
5a46090e29 | ||
|
|
fd711cc60e | ||
|
|
421958cb07 | ||
|
|
7675fc735e | ||
|
|
a6848f22ed | ||
|
|
88078f9bc2 | ||
|
|
3334e1d215 | ||
|
|
3d08ee109f | ||
|
|
70b5f410c2 | ||
|
|
49df388240 | ||
|
|
30502f407c | ||
|
|
304104d56b | ||
|
|
f3da094fc4 | ||
|
|
76a0d55325 | ||
|
|
e48bdaef3e | ||
|
|
3c8157af87 | ||
|
|
8f029fb882 | ||
|
|
95ab9e2149 | ||
|
|
85928d8628 | ||
|
|
89b415d560 | ||
|
|
19aaab7d52 | ||
|
|
1d94c4548c | ||
|
|
4bb176f31a | ||
|
|
fbd681580e | ||
|
|
3cd791a819 | ||
|
|
d7873e0f25 | ||
|
|
50edf75948 | ||
|
|
94be775252 | ||
|
|
785e1d46bd | ||
|
|
7468974488 | ||
|
|
ebfa8e4b4d | ||
|
|
2b389bee66 | ||
|
|
9b32c2a577 | ||
|
|
a6f4cb2174 | ||
|
|
05a623178f | ||
|
|
b31f84efd6 | ||
|
|
e34677587d | ||
|
|
3e368f51a4 | ||
|
|
f20bbd0c7a | ||
|
|
1a56eecedd | ||
|
|
3c56771eeb | ||
|
|
ec748f84fb | ||
|
|
7f4f822670 | ||
|
|
1573ab4f8c | ||
|
|
f4f0beb75e | ||
|
|
d0671eee76 | ||
|
|
c55bf03680 | ||
|
|
4d69e3ac47 | ||
|
|
8b9a00915d | ||
|
|
37e95663b2 | ||
|
|
5103549342 | ||
|
|
df9cc387a0 | ||
|
|
9af4a30780 | ||
|
|
b6b13b59cc | ||
|
|
21a30251eb | ||
|
|
e67438409d | ||
|
|
9e8791461f | ||
|
|
f2750fbb5f | ||
|
|
7608f4fe17 | ||
|
|
acb42be927 | ||
|
|
b0c8d6fec7 | ||
|
|
d2e8094682 | ||
|
|
e806a9b30d | ||
|
|
89cd3c625d | ||
|
|
ea11e74aca | ||
|
|
47ffba7109 | ||
|
|
91629c8401 | ||
|
|
ecd3bd94eb | ||
|
|
1a5fba9910 | ||
|
|
a2d3da2434 | ||
|
|
11da1aa07f | ||
|
|
87d8bda745 | ||
|
|
b8d373e711 | ||
|
|
4e8864552d | ||
|
|
57cd74977e | ||
|
|
845d9cd2a7 | ||
|
|
abd349c4c9 | ||
|
|
3c7af3d9ac | ||
|
|
62f8abdea8 | ||
|
|
2fc6a7d38b | ||
|
|
004cba3473 | ||
|
|
a89da55450 | ||
|
|
04544a5f96 | ||
|
|
8dda13944a | ||
|
|
21865fd478 | ||
|
|
a4b4baeafb | ||
|
|
2f68e2a4b6 | ||
|
|
55a8176c6d | ||
|
|
7f66caa16e | ||
|
|
08aeb1b30f | ||
|
|
b4a19f1154 | ||
|
|
2b2b48c6af | ||
|
|
38cc9f2592 | ||
|
|
94d95ad55c | ||
|
|
5b49bd750a | ||
|
|
6dc194e089 | ||
|
|
1f9120c283 | ||
|
|
0301983b6a | ||
|
|
73d3da2f28 | ||
|
|
321a4a3f83 | ||
|
|
8490a25a0f | ||
|
|
9fbb44cae7 | ||
|
|
d10e161b72 | ||
|
|
c9670beb62 | ||
|
|
a0f8c27bdf | ||
|
|
c39e4a4fcd | ||
|
|
51993ea193 | ||
|
|
30885a997e | ||
|
|
929d5352c4 | ||
|
|
5332227582 | ||
|
|
4fb8ed7e15 | ||
|
|
b477e4bb20 | ||
|
|
91d6a17b71 | ||
|
|
99653a7246 | ||
|
|
2d4764e6a5 | ||
|
|
1a5d095ffc | ||
|
|
6e54137bec | ||
|
|
9ae2d19d82 | ||
|
|
5ed37e2ade | ||
|
|
7f2f3dd782 | ||
|
|
c0f008e54d | ||
|
|
83521a04b4 | ||
|
|
a1c716f556 | ||
|
|
e5085c2252 | ||
|
|
bf7b0d3d01 | ||
|
|
6dc33960aa | ||
|
|
afe1cbc136 | ||
|
|
17e5d307b3 | ||
|
|
a3f12a2a6f | ||
|
|
f42feb1eab |
268
.github/workflows/submit.yml
vendored
268
.github/workflows/submit.yml
vendored
@@ -12,6 +12,10 @@ on:
|
||||
required: true
|
||||
default: "Linux additional (hotspot only), Linux x64, Linux x86, Windows aarch64, Windows x64, macOS x64"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
prerequisites:
|
||||
name: Prerequisites
|
||||
@@ -19,6 +23,7 @@ jobs:
|
||||
outputs:
|
||||
should_run: ${{ steps.check_submit.outputs.should_run }}
|
||||
bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }}
|
||||
jdk_version: ${{ steps.check_jdk_versions.outputs.jdk_version }}
|
||||
platform_linux_additional: ${{ steps.check_platforms.outputs.platform_linux_additional }}
|
||||
platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }}
|
||||
platform_linux_x86: ${{ steps.check_platforms.outputs.platform_linux_x86 }}
|
||||
@@ -51,7 +56,7 @@ jobs:
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
@@ -66,20 +71,40 @@ jobs:
|
||||
run: "echo '${{ steps.check_deps.outputs.dependencies }}'"
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Determine full JDK versions
|
||||
id: check_jdk_versions
|
||||
shell: bash
|
||||
run: |
|
||||
FEATURE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_FEATURE }}
|
||||
INTERIM=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_INTERIM }}
|
||||
UPDATE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_UPDATE }}
|
||||
PATCH=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_PATCH }}
|
||||
if [ "x${PATCH}" != "x0" ]; then
|
||||
V=${FEATURE}.${INTERIM}.${UPDATE}.${PATCH}
|
||||
elif [ "x${UPDATE}" != "x0" ]; then
|
||||
V=${FEATURE}.${INTERIM}.${UPDATE}
|
||||
elif [ "x${INTERIM}" != "x0" ]; then
|
||||
V={FEATURE}.${INTERIM}
|
||||
else
|
||||
V=${FEATURE}
|
||||
fi
|
||||
echo "::set-output name=jdk_version::${V}"
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Determine the jtreg ref to checkout
|
||||
run: "echo JTREG_REF=jtreg-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}+${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }} >> $GITHUB_ENV"
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Check if a jtreg image is present in the cache
|
||||
id: jtreg
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/jtreg/
|
||||
key: jtreg-${{ env.JTREG_REF }}-v1
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Checkout the jtreg source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "openjdk/jtreg"
|
||||
ref: ${{ env.JTREG_REF }}
|
||||
@@ -97,7 +122,7 @@ jobs:
|
||||
if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Store jtreg for use by later steps
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ steps.check_bundle_id.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
@@ -121,7 +146,7 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
|
||||
@@ -129,13 +154,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -151,21 +176,21 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
@@ -197,7 +222,7 @@ jobs:
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
@@ -250,7 +275,7 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
|
||||
@@ -258,11 +283,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -278,14 +303,14 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
@@ -293,14 +318,14 @@ jobs:
|
||||
|
||||
- name: Restore build artifacts
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x64${{ matrix.artifact }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build artifacts (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x64${{ matrix.artifact }}
|
||||
@@ -322,6 +347,7 @@ jobs:
|
||||
echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
|
||||
|
||||
- name: Run tests
|
||||
id: run_tests
|
||||
run: >
|
||||
JDK_IMAGE_DIR=${{ env.imageroot }}
|
||||
TEST_IMAGE_DIR=${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}
|
||||
@@ -337,7 +363,7 @@ jobs:
|
||||
JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
|
||||
|
||||
- name: Check that all tests executed successfully
|
||||
if: always()
|
||||
if: steps.run_tests.outcome != 'skipped'
|
||||
run: >
|
||||
if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
|
||||
cat build/*/test-results/*/text/newfailures.txt ;
|
||||
@@ -372,14 +398,14 @@ jobs:
|
||||
|
||||
- name: Persist test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/linux-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
|
||||
- name: Persist test outputs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/linux-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
@@ -432,7 +458,7 @@ jobs:
|
||||
gnu-arch: powerpc64le
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
|
||||
@@ -440,13 +466,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -462,14 +488,14 @@ jobs:
|
||||
|
||||
- name: Restore build JDK
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x64_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x64
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build JDK (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x64_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x64
|
||||
@@ -500,7 +526,7 @@ jobs:
|
||||
|
||||
- name: Cache sysroot
|
||||
id: cache-sysroot
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/sysroot-${{ matrix.debian-arch }}/
|
||||
key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('jdk/.github/workflows/submit.yml') }}
|
||||
@@ -580,7 +606,7 @@ jobs:
|
||||
|
||||
# Reduced 32-bit build uses the same boot JDK as 64-bit build
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
|
||||
@@ -588,13 +614,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -610,21 +636,21 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
@@ -663,7 +689,7 @@ jobs:
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
@@ -717,7 +743,7 @@ jobs:
|
||||
|
||||
# Reduced 32-bit build uses the same boot JDK as 64-bit build
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
|
||||
@@ -725,11 +751,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -745,14 +771,14 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
@@ -760,14 +786,14 @@ jobs:
|
||||
|
||||
- name: Restore build artifacts
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x86${{ matrix.artifact }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build artifacts (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x86${{ matrix.artifact }}
|
||||
@@ -789,6 +815,7 @@ jobs:
|
||||
echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
|
||||
|
||||
- name: Run tests
|
||||
id: run_tests
|
||||
run: >
|
||||
JDK_IMAGE_DIR=${{ env.imageroot }}
|
||||
TEST_IMAGE_DIR=${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}
|
||||
@@ -804,7 +831,7 @@ jobs:
|
||||
JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
|
||||
|
||||
- name: Check that all tests executed successfully
|
||||
if: always()
|
||||
if: steps.run_tests.outcome != 'skipped'
|
||||
run: >
|
||||
if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
|
||||
cat build/*/test-results/*/text/newfailures.txt ;
|
||||
@@ -839,14 +866,14 @@ jobs:
|
||||
|
||||
- name: Persist test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/linux-x86${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
|
||||
- name: Persist test outputs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/linux-x86${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
@@ -868,34 +895,45 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Restore cygwin installer from cache
|
||||
id: cygwin-installer
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/cygwin/setup-x86_64.exe
|
||||
key: cygwin-installer
|
||||
|
||||
- name: Download cygwin installer
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
if: steps.cygwin-installer.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore cygwin packages from cache
|
||||
id: cygwin
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/cygwin/packages
|
||||
key: cygwin-packages-${{ runner.os }}-v1
|
||||
|
||||
- name: Install cygwin
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.2.0-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.3.5-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -957,34 +995,45 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Restore cygwin installer from cache
|
||||
id: cygwin-installer
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/cygwin/setup-x86_64.exe
|
||||
key: cygwin-installer
|
||||
|
||||
- name: Download cygwin installer
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
if: steps.cygwin-installer.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore cygwin packages from cache
|
||||
id: cygwin
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/cygwin/packages
|
||||
key: cygwin-packages-${{ runner.os }}-v1
|
||||
|
||||
- name: Install cygwin
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.2.0-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.3.5-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -1000,7 +1049,7 @@ jobs:
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
@@ -1008,14 +1057,14 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
@@ -1055,7 +1104,7 @@ jobs:
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
@@ -1109,7 +1158,7 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
|
||||
@@ -1117,11 +1166,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -1136,29 +1185,40 @@ jobs:
|
||||
Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore cygwin installer from cache
|
||||
id: cygwin-installer
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/cygwin/setup-x86_64.exe
|
||||
key: cygwin-installer
|
||||
|
||||
- name: Download cygwin installer
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
if: steps.cygwin-installer.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore cygwin packages from cache
|
||||
id: cygwin
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/cygwin/packages
|
||||
key: cygwin-packages-${{ runner.os }}-v1
|
||||
|
||||
- name: Install cygwin
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.2.0-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.3.5-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
@@ -1166,14 +1226,14 @@ jobs:
|
||||
|
||||
- name: Restore build artifacts
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-windows-x64${{ matrix.artifact }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build artifacts (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-windows-x64${{ matrix.artifact }}
|
||||
@@ -1198,6 +1258,7 @@ jobs:
|
||||
run: echo ("imageroot=" + (Get-ChildItem -Path $HOME/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }} -Filter release -Recurse -ErrorAction SilentlyContinue -Force).DirectoryName) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
|
||||
- name: Run tests
|
||||
id: run_tests
|
||||
run: >
|
||||
$env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
|
||||
$env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
|
||||
@@ -1216,7 +1277,7 @@ jobs:
|
||||
JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
|
||||
|
||||
- name: Check that all tests executed successfully
|
||||
if: always()
|
||||
if: steps.run_tests.outcome != 'skipped'
|
||||
run: >
|
||||
if ((Get-ChildItem -Path build\*\test-results\test-summary.txt -Recurse | Select-String -Pattern "TEST SUCCESS" ).Count -eq 0) {
|
||||
Get-Content -Path build\*\test-results\*\*\newfailures.txt ;
|
||||
@@ -1253,14 +1314,14 @@ jobs:
|
||||
|
||||
- name: Persist test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/windows-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
|
||||
- name: Persist test outputs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/windows-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
@@ -1284,7 +1345,7 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
|
||||
@@ -1292,13 +1353,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -1314,21 +1375,21 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
@@ -1360,7 +1421,7 @@ jobs:
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
@@ -1386,7 +1447,7 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
|
||||
@@ -1394,13 +1455,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -1416,21 +1477,21 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
@@ -1463,7 +1524,7 @@ jobs:
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-macos-aarch64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
@@ -1517,7 +1578,7 @@ jobs:
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}"
|
||||
JDK_VERSION: "${{ needs.prerequisites.outputs.jdk_version }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
|
||||
@@ -1525,11 +1586,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
@@ -1545,14 +1606,14 @@ jobs:
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
@@ -1560,14 +1621,14 @@ jobs:
|
||||
|
||||
- name: Restore build artifacts
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-macos-x64${{ matrix.artifact }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build artifacts (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-macos-x64${{ matrix.artifact }}
|
||||
@@ -1595,6 +1656,7 @@ jobs:
|
||||
echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
|
||||
|
||||
- name: Run tests
|
||||
id: run_tests
|
||||
run: >
|
||||
JDK_IMAGE_DIR=${{ env.imageroot }}
|
||||
TEST_IMAGE_DIR=${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin-tests${{ matrix.artifact }}
|
||||
@@ -1610,7 +1672,7 @@ jobs:
|
||||
JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
|
||||
|
||||
- name: Check that all tests executed successfully
|
||||
if: always()
|
||||
if: steps.run_tests.outcome != 'skipped'
|
||||
run: >
|
||||
if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
|
||||
cat build/*/test-results/*/text/newfailures.txt ;
|
||||
@@ -1645,14 +1707,14 @@ jobs:
|
||||
|
||||
- name: Persist test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/macos-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
|
||||
- name: Persist test outputs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ~/macos-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
|
||||
continue-on-error: true
|
||||
@@ -1675,7 +1737,7 @@ jobs:
|
||||
steps:
|
||||
- name: Determine current artifacts endpoint
|
||||
id: actions_runtime
|
||||
uses: actions/github-script@v3
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: "return { url: process.env['ACTIONS_RUNTIME_URL'], token: process.env['ACTIONS_RUNTIME_TOKEN'] }"
|
||||
|
||||
@@ -1698,7 +1760,7 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Fetch remaining artifacts (test results)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: test-results
|
||||
|
||||
@@ -1715,7 +1777,7 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Upload a combined test results artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-results_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: test-results
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[general]
|
||||
project=jdk-updates
|
||||
jbs=JDK
|
||||
version=17.0.3
|
||||
version=17.0.4.1
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
|
||||
|
||||
@@ -11,8 +11,8 @@ can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntim
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
| --- | --- | --- |
|
||||
| 2022.1 | [17_0_2-b315.1](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17_0_2b315.1) | 09-Feb-2022 |
|
||||
| 2021.3 | [17_0_1-b164.8](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17_0_1b164.8) | 15-Nov-2021 |
|
||||
| 2022.2 | [17.0.4-b469.53](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.4b469.53)| 31-Aug-2022 |
|
||||
|
||||
|
||||
## Contents
|
||||
- [Welcome to JetBrains Runtime](#jetbrains-runtime)
|
||||
|
||||
@@ -114,8 +114,8 @@ cd "$SCRIPT_DIR/.." ; OPENJDK_DIR=`pwd`
|
||||
IDEA_MAKE="$OPENJDK_DIR/make/ide/idea/jdk"
|
||||
IDEA_TEMPLATE="$IDEA_MAKE/template"
|
||||
|
||||
cp -rn "$TOPLEVEL_DIR/jb/project/idea-project-files"/* "$IDEA_OUTPUT"
|
||||
cp -rn "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
|
||||
cp -r "$TOPLEVEL_DIR/jb/project/idea-project-files"/* "$IDEA_OUTPUT"
|
||||
cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
|
||||
|
||||
#override template
|
||||
if [ -d "$TEMPLATES_OVERRIDE" ] ; then
|
||||
@@ -321,4 +321,4 @@ if [ "$VERBOSE" = true ] ; then
|
||||
echo "
|
||||
Now you can open \"$IDEA_PROJECT_DIR\" as IDEA project
|
||||
You can also run 'bash \"$IDEA_OUTPUT/jdk-clion/update-project.sh\"' to generate Clion project"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_musl_x64.sh script.
|
||||
|
||||
# Pull a concrete version of Linux that does NOT recieve updates after it's
|
||||
# been created. This is so that the image is as stable as possible to make
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
FROM ubuntu:jammy
|
||||
|
||||
# Install the necessary build tools
|
||||
RUN apt install build-essential autoconf
|
||||
|
||||
# Set up boot JDK for building
|
||||
COPY boot_jdk_amd64.tar.gz /jdk17/
|
||||
RUN cd /jdk17 && tar --strip-components=1 -xzf boot_jdk_musl_amd64.tar.gz && rm /jdk17/boot_jdk_amd64.tar.gz
|
||||
ENV BOOT_JDK=/jdk17
|
||||
|
||||
COPY sdk-x86_64-linux-gnu-to-riscv64-linux-gnu-20220423.tar.gz /devkit/
|
||||
RUN cd /devkit && tar --strip-components=1 -xzf sdk-x86_64-linux-gnu-to-riscv64-linux-gnu-20220423.tar.gz && rm /devkit/sdk-x86_64-linux-gnu-to-riscv64-linux-gnu-20220423.tar.gz
|
||||
ENV DEVKIT_PATH=/devkit
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser"
|
||||
@@ -1,7 +1,55 @@
|
||||
FROM i386/ubuntu:xenial
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_x86.sh script.
|
||||
|
||||
RUN linux32 apt-get update && apt-get install -y --no-install-recommends apt-utils
|
||||
COPY jbrsdk-11.0.5-b1 /jbrsdk-11.0.5-b1
|
||||
RUN linux32 apt-get -y install file build-essential zip unzip curl libx11-dev libxext-dev \
|
||||
libxrender-dev libxrandr-dev libxtst-dev libxt-dev libcups2-dev libasound2-data \
|
||||
libpng12-0 libasound2 libfreetype6 libfontconfig1-dev libasound2-dev autoconf
|
||||
# Pull a concrete version of Linux that does NOT receive updates after it's
|
||||
# been created. This is so that the image is as stable as possible to make
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
#FROM i386/ubuntu:xenial
|
||||
#FROM i386/ubuntu:bionic
|
||||
FROM i386/ubuntu:focal
|
||||
|
||||
RUN linux32 \
|
||||
apt-get update && apt-get install -y --no-install-recommends apt-utils
|
||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
export DEBCONF_NONINTERACTIVE_SEEN=true && \
|
||||
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
|
||||
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
|
||||
linux32 \
|
||||
apt-get -y install \
|
||||
autoconf \
|
||||
build-essential \
|
||||
curl \
|
||||
file \
|
||||
git \
|
||||
libx11-dev \
|
||||
libxext-dev \
|
||||
libxrender-dev \
|
||||
libxrandr-dev \
|
||||
libxtst-dev \
|
||||
libxt-dev \
|
||||
libcups2-dev \
|
||||
libasound2-data \
|
||||
# libpng12-0 \
|
||||
libasound2 \
|
||||
libfreetype6 \
|
||||
libfontconfig1-dev \
|
||||
libasound2-dev \
|
||||
rsync \
|
||||
unzip \
|
||||
zip
|
||||
RUN linux32 \
|
||||
apt-get -y install \
|
||||
g++-10 \
|
||||
gcc-10 && \
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
|
||||
apt-get clean -qy && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Set up boot JDK for building
|
||||
COPY boot_jdk_x86.tar.gz /jdk17/
|
||||
RUN cd /jdk17 && tar --strip-components=1 -xzf boot_jdk_x86.tar.gz && rm /jdk17/boot_jdk_x86.tar.gz
|
||||
ENV BOOT_JDK=/jdk17
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser"
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# This script creates a Docker image suitable for building AArch64 variant
|
||||
# of the JetBrains Runtime version 17.
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# This script creates a Docker image suitable for building musl AArch64 variant
|
||||
# of the JetBrains Runtime version 17.
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# This script creates a Docker image suitable for building musl-x64 variant
|
||||
# of the JetBrains Runtime version 17.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# This script creates a Docker image suitable for cross building riscv variant
|
||||
# of the JetBrains Runtime version 17. Host is x86_64
|
||||
# This script creates a Docker image suitable for building x86 variant
|
||||
# of the JetBrains Runtime version 17.
|
||||
|
||||
BOOT_JDK_REMOTE_FILE=zulu17.34.19-ca-jdk17.0.3-linux_x64.tar.gz
|
||||
BOOT_JDK_SHA=caa17c167d045631f9fd85de246bc5313f29cef5ebb1c21524508d3e1196590c
|
||||
BOOT_JDK_LOCAL_FILE=boot_jdk_amd64.tar.gz
|
||||
BOOT_JDK_REMOTE_FILE=zulu17.34.19-ca-jdk17.0.3-linux_i686.tar.gz
|
||||
BOOT_JDK_SHA=1c35c374ba0001e675d6e80819d5be900c4e141636d5e484992a8c550be14481
|
||||
BOOT_JDK_LOCAL_FILE=boot_jdk_x86.tar.gz
|
||||
|
||||
if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
|
||||
# Obtain "boot JDK" from outside of the container.
|
||||
@@ -19,7 +19,7 @@ sha256sum -c - <<EOF
|
||||
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
|
||||
EOF
|
||||
|
||||
docker build -t jbr17buildenv -f Dockerfile.riscv_on_x64 .
|
||||
docker build -t jetbrains/runtime:jbr17env_x86 -f Dockerfile.x86 .
|
||||
|
||||
# NB: the resulting container can (and should) be used without the network
|
||||
# connection (--network none) during build in order to reduce the chance
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# $1 - Boot JDK
|
||||
# $2 - JBR part of API version
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
function do_maketest() {
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
function check_bundle_type_maketest() {
|
||||
# check whether last char is 't', if so remove it
|
||||
if [ "${bundle_type: -1}" == "t" ]; then
|
||||
echo ${bundle_type%?}
|
||||
return 1
|
||||
bundle_type="${bundle_type%?}"
|
||||
do_maketest=1
|
||||
else
|
||||
echo ${bundle_type}
|
||||
return 0
|
||||
do_maketest=0
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -16,26 +19,31 @@ function getVersionProp() {
|
||||
|
||||
while getopts ":i?" o; do
|
||||
case "${o}" in
|
||||
i)
|
||||
i="incremental build"
|
||||
INC_BUILD=1
|
||||
;;
|
||||
i) INC_BUILD=1 ;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Required at least two arguments: build_number bundle_type"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_number=$1
|
||||
bundle_type=$2
|
||||
architecture=$3 # aarch64 or x64
|
||||
# shellcheck disable=SC2034
|
||||
architecture=${3:-x64} # aarch64 or x64
|
||||
|
||||
check_bundle_type_maketest
|
||||
|
||||
bundle_type=$(do_maketest)
|
||||
do_maketest=$?
|
||||
tag_prefix="jbr-"
|
||||
OPENJDK_TAG=$(git log --simplify-by-decoration --decorate=short --pretty=short | grep "$tag_prefix" | cut -d "(" -f2 | cut -d ")" -f1 | awk '{print $2}' | sort -t "-" -k 2 -g | tail -n 1 | tr -d ",")
|
||||
VERSION_FEATURE=$(getVersionProp "DEFAULT_VERSION_FEATURE")
|
||||
VERSION_INTERIM=$(getVersionProp "DEFAULT_VERSION_INTERIM")
|
||||
VERSION_UPDATE=$(getVersionProp "DEFAULT_VERSION_UPDATE")
|
||||
VERSION_PATCH=$(getVersionProp "DEFAULT_VERSION_PATCH")
|
||||
[[ $VERSION_UPDATE = 0 ]] && JBSDK_VERSION="$VERSION_FEATURE" || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}"
|
||||
[[ $VERSION_PATCH = 0 ]] || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}.${VERSION_PATCH}"
|
||||
echo "##teamcity[setParameter name='env.JBSDK_VERSION' value='${JBSDK_VERSION}']"
|
||||
JDK_BUILD_NUMBER=${JDK_BUILD_NUMBER:=$(echo $OPENJDK_TAG | awk -F "-|[+]" '{print $3}')}
|
||||
[ -z $JDK_BUILD_NUMBER ] && JDK_BUILD_NUMBER=1
|
||||
@@ -49,6 +57,11 @@ do_reset_changes=0
|
||||
do_reset_dcevm=0
|
||||
HEAD_REVISION=0
|
||||
|
||||
STATIC_CONF_ARGS=""
|
||||
common_conf_props_file="jb/project/tools/common/static_conf_args.txt"
|
||||
if [[ -f "$common_conf_props_file" ]]; then
|
||||
STATIC_CONF_ARGS=$(<$common_conf_props_file)
|
||||
fi
|
||||
OS_NAME=$(uname -s)
|
||||
# Enable reproducible builds
|
||||
TZ=UTC
|
||||
@@ -87,11 +100,18 @@ REPRODUCIBLE_BUILD_OPTS="--enable-reproducible-build
|
||||
|
||||
function zip_native_debug_symbols() {
|
||||
image_bundle_path=$(echo $1 | cut -d"/" -f-4)
|
||||
jdk_name=$(echo $1 | cut -d"/" -f5)
|
||||
jbr_diz_name=$2
|
||||
|
||||
(cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} ../../../../dizfiles \; )
|
||||
[ -d "dizfiles" ] && rm -rf dizfiles
|
||||
mkdir dizfiles
|
||||
|
||||
(cd dizfiles && find . -print0 | COPYFILE_DISABLE=1 \
|
||||
rsync_target="../../../../dizfiles"
|
||||
[ -z "$jdk_name" ] && rsync_target=$rsync_target"/"$jbr_diz_name
|
||||
(cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} $rsync_target \;)
|
||||
[ ! -z "$jdk_name" ] && mv dizfiles/$jdk_name dizfiles/$jbr_diz_name
|
||||
|
||||
(cd dizfiles && find $jbr_diz_name -print0 | COPYFILE_DISABLE=1 \
|
||||
tar --no-recursion --null -T - -czf ../"$jbr_diz_name".tar.gz) || do_exit $?
|
||||
}
|
||||
|
||||
@@ -126,7 +146,7 @@ function update_jsdk_mods() {
|
||||
# re-create java.base.jmod with updated hashes
|
||||
tmp=.java.base.$$.tmp
|
||||
mkdir "$tmp" || exit $?
|
||||
hash_modules=$("$JSDK"/bin/jmod describe "$__orig_jsdk_mods"/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
|
||||
hash_modules=$("$__jsdk"/bin/jmod describe "$__orig_jsdk_mods"/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
|
||||
"$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.base.jmod || exit $?
|
||||
rm "$__updated_jsdk_mods"/java.base.jmod || exit $? # temp exclude from path
|
||||
"$__jsdk"/bin/jmod \
|
||||
|
||||
1
jb/project/tools/common/static_conf_args.txt
Normal file
1
jb/project/tools/common/static_conf_args.txt
Normal file
@@ -0,0 +1 @@
|
||||
--with-vendor-vm-bug-url=https://youtrack.jetbrains.com/issues/JBR
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
@@ -32,6 +35,7 @@ function do_configure {
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
|| do_exit $?
|
||||
@@ -53,41 +57,44 @@ function create_image_bundle {
|
||||
__modules=$4
|
||||
|
||||
libc_type_suffix=''
|
||||
fastdebug_infix=''
|
||||
|
||||
if is_musl; then libc_type_suffix='musl-' ; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix:-}b${build_number}
|
||||
|
||||
|
||||
echo Running jlink....
|
||||
[ -d "$IMAGES_DIR"/"$__arch_name" ] && rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
$JSDK/bin/jlink \
|
||||
--module-path "$__modules_path" --no-man-pages --compress=2 \
|
||||
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__arch_name"
|
||||
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__arch_name"/release
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__arch_name"/release > release
|
||||
mv release "$IMAGES_DIR"/"$__arch_name"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__arch_name"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__arch_name"/jmods
|
||||
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__root_dir"/release > release
|
||||
mv release "$IMAGES_DIR"/"$__root_dir"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
[ -f "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper
|
||||
[ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
|
||||
(cd "$IMAGES_DIR" &&
|
||||
find "$__arch_name" -print0 | LC_ALL=C sort -z | \
|
||||
find "$__root_dir" -print0 | LC_ALL=C sort -z | \
|
||||
tar $REPRODUCIBLE_TAR_OPTS \
|
||||
--no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
|
||||
mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
|
||||
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
|
||||
touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
|
||||
gzip "$JBR".tar || do_exit $?
|
||||
rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
@@ -108,7 +115,7 @@ case "$bundle_type" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
@@ -128,6 +135,8 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built;possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# This script makes test-image along with JDK images when bundle_type is set to "jcef".
|
||||
# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
|
||||
#
|
||||
# Environment variables:
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
|
||||
# to configure
|
||||
# By default JDK_BUILD_NUMBER is set zero
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_linux_x64
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
|
||||
|
||||
function do_configure {
|
||||
sh configure \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
--openjdk-target=riscv64-unknown-linux-gnu \
|
||||
--with-devkit="$DEVKIT_PATH"
|
||||
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build="$JDK_BUILD_NUMBER" \
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--with-build-jdk="$BUILD_JDK" \
|
||||
--disable-warnings-as-errors \
|
||||
--enable-cds=yes \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
|| do_exit $?
|
||||
}
|
||||
|
||||
function is_musl {
|
||||
#old check doesn't work with cross-compiling, so return 0 always
|
||||
return 0
|
||||
}
|
||||
|
||||
function create_image_bundle {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
__modules_path=$3
|
||||
__modules=$4
|
||||
|
||||
libc_type_suffix=''
|
||||
|
||||
if is_musl; then libc_type_suffix='musl-' ; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Running jlink....
|
||||
[ -d "$IMAGES_DIR"/"$__arch_name" ] && rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
$JSDK/bin/jlink \
|
||||
--module-path "$__modules_path" --no-man-pages --compress=2 \
|
||||
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__arch_name"
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__arch_name"/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__arch_name"/release > release
|
||||
mv release "$IMAGES_DIR"/"$__arch_name"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__arch_name"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__arch_name"/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
[ -f "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
|
||||
(cd "$IMAGES_DIR" &&
|
||||
find "$__arch_name" -print0 | LC_ALL=C sort -z | \
|
||||
tar $REPRODUCIBLE_TAR_OPTS \
|
||||
--no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
|
||||
mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
|
||||
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
|
||||
touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
|
||||
gzip "$JBR".tar || do_exit $?
|
||||
rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=linux-riscv-server-release
|
||||
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
do_reset_changes=1
|
||||
do_maketest=1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=linux-riscv-server-fastdebug
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
make images CONF=$RELEASE_NAME || do_exit $?
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JSDK_MODS_DIR=$IMAGES_DIR/jmods
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
|
||||
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
# create sdk image bundle
|
||||
modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
fi
|
||||
|
||||
do_exit 0
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
@@ -32,6 +35,7 @@ function do_configure {
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
|| do_exit $?
|
||||
@@ -53,41 +57,43 @@ function create_image_bundle {
|
||||
__modules=$4
|
||||
|
||||
libc_type_suffix=''
|
||||
fastdebug_infix=''
|
||||
|
||||
if is_musl; then libc_type_suffix='musl-' ; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix:-}b${build_number}
|
||||
|
||||
echo Running jlink....
|
||||
[ -d "$IMAGES_DIR"/"$__arch_name" ] && rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
$JSDK/bin/jlink \
|
||||
--module-path "$__modules_path" --no-man-pages --compress=2 \
|
||||
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__arch_name"
|
||||
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__arch_name"/release
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__arch_name"/release > release
|
||||
mv release "$IMAGES_DIR"/"$__arch_name"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__arch_name"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__arch_name"/jmods
|
||||
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__root_dir"/release > release
|
||||
mv release "$IMAGES_DIR"/"$__root_dir"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
[ -f "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper
|
||||
[ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
|
||||
(cd "$IMAGES_DIR" &&
|
||||
find "$__arch_name" -print0 | LC_ALL=C sort -z | \
|
||||
find "$__root_dir" -print0 | LC_ALL=C sort -z | \
|
||||
tar $REPRODUCIBLE_TAR_OPTS \
|
||||
--no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
|
||||
mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
|
||||
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
|
||||
touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
|
||||
gzip "$JBR".tar || do_exit $?
|
||||
rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
#rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
@@ -108,7 +114,7 @@ case "$bundle_type" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
@@ -128,6 +134,8 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
|
||||
@@ -1,80 +1,143 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -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
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built;possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# 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/scripts/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
function do_configure {
|
||||
linux32 bash configure \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build="$JDK_BUILD_NUMBER" \
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
$STATIC_CONF_ARGS \
|
||||
--enable-cds=yes \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
|| do_exit $?
|
||||
}
|
||||
|
||||
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
|
||||
function is_musl {
|
||||
libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
|
||||
if [ -z $libc ]; then
|
||||
# This is not Musl, return 1 == false
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
linux32 bash configure \
|
||||
--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 $?
|
||||
function create_image_bundle {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
__modules_path=$3
|
||||
__modules=$4
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-x86-b${build_number}
|
||||
BASE_DIR=build/linux-x86-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
libc_type_suffix=''
|
||||
fastdebug_infix=''
|
||||
|
||||
if is_musl; then libc_type_suffix='musl-' ; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix:-}b${build_number}
|
||||
|
||||
echo Running jlink....
|
||||
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
$JSDK/bin/jlink \
|
||||
--module-path "$__modules_path" --no-man-pages --compress=2 \
|
||||
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__root_dir"/release > release
|
||||
mv release "$IMAGES_DIR"/"$__root_dir"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
[ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
|
||||
(cd "$IMAGES_DIR" &&
|
||||
find "$__root_dir" -print0 | LC_ALL=C sort -z | \
|
||||
tar $REPRODUCIBLE_TAR_OPTS \
|
||||
--no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
|
||||
mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
|
||||
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
|
||||
touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
|
||||
gzip "$JBR".tar || do_exit $?
|
||||
rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=linux-x86-server-release
|
||||
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
echo "not implemented" && do_exit 1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=linux-x86-server-fastdebug
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
make images CONF=$RELEASE_NAME || do_exit $?
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JSDK_MODS_DIR=$IMAGES_DIR/jmods
|
||||
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 $?
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
# create runtime image bundle
|
||||
modules=$(grep -v "jdk.internal.vm" jb/project/tools/common/modules.list | xargs | sed s/" "//g) || do_exit $?
|
||||
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man -C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
# create sdk image bundle
|
||||
modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x86-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
fi
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-x86-b$build_number
|
||||
grep -v javafx jb/project/tools/common/modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
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 $?
|
||||
do_exit 0
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
@@ -22,7 +25,6 @@
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
JCEF_PATH=${JCEF_PATH:=./jcef_mac}
|
||||
architecture=${architecture:=x64}
|
||||
BOOT_JDK=${BOOT_JDK:=$(/usr/libexec/java_home -v 16)}
|
||||
|
||||
function do_configure {
|
||||
@@ -44,6 +46,7 @@ function do_configure {
|
||||
--with-extra-cflags="-F$(pwd)/Frameworks" \
|
||||
--with-extra-cxxflags="-F$(pwd)/Frameworks" \
|
||||
--with-extra-ldflags="-F$(pwd)/Frameworks" \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
|| do_exit $?
|
||||
@@ -61,6 +64,7 @@ function do_configure {
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--with-macosx-version-max="${MACOSX_VERSION_MAX:="10.12.00"}" \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
|| do_exit $?
|
||||
@@ -73,13 +77,16 @@ function create_image_bundle {
|
||||
__modules_path=$3
|
||||
__modules=$4
|
||||
|
||||
fastdebug_infix=''
|
||||
|
||||
tmp=.bundle.$$.tmp
|
||||
mkdir "$tmp" || do_exit $?
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix}b${build_number}
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
|
||||
|
||||
JRE_CONTENTS=$tmp/$__arch_name/Contents
|
||||
JRE_CONTENTS=$tmp/$__root_dir/Contents
|
||||
mkdir -p "$JRE_CONTENTS" || do_exit $?
|
||||
|
||||
echo Running jlink...
|
||||
@@ -103,10 +110,10 @@ function create_image_bundle {
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
# Normalize timestamp
|
||||
find "$tmp"/"$__arch_name" -print0 | xargs -0 touch -c -h -t "$TOUCH_TIME"
|
||||
find "$tmp"/"$__root_dir" -print0 | xargs -0 touch -c -h -t "$TOUCH_TIME"
|
||||
|
||||
(cd "$tmp" &&
|
||||
find "$__arch_name" -print0 | LC_ALL=C sort -z | \
|
||||
find "$__root_dir" -print0 | LC_ALL=C sort -z | \
|
||||
COPYFILE_DISABLE=1 tar $REPRODUCIBLE_TAR_OPTS --no-recursion --null -T - \
|
||||
-czf "$JBR".tar.gz --exclude='*.dSYM' --exclude='man') || do_exit $?
|
||||
mv "$tmp"/"$JBR".tar.gz "$JBR".tar.gz
|
||||
@@ -136,7 +143,7 @@ case "$bundle_type" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
fi
|
||||
@@ -154,6 +161,8 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
APP_DIRECTORY=$1
|
||||
APPL_USER=$2
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
APPLICATION_PATH=$1
|
||||
APP_NAME=$2
|
||||
@@ -97,8 +100,11 @@ BUILD_NAME=$(echo $APPLICATION_PATH | awk -F"/" '{ print $2 }')
|
||||
|
||||
log "Creating $APP_NAME.pkg..."
|
||||
rm -rf "$APP_NAME.pkg"
|
||||
pkgbuild --identifier $BUNDLE_ID --sign "$JB_INSTALLER_CERT" --root $APPLICATION_PATH \
|
||||
--install-location /Library/Java/JavaVirtualMachines/${BUILD_NAME} ${APP_NAME}.pkg
|
||||
|
||||
mkdir -p unsigned
|
||||
pkgbuild --identifier $BUNDLE_ID --root $APPLICATION_PATH \
|
||||
--install-location /Library/Java/JavaVirtualMachines/${BUILD_NAME} unsigned/${APP_NAME}.pkg
|
||||
productsign --timestamp --sign "$JB_INSTALLER_CERT" unsigned/${APP_NAME}.pkg ${APP_NAME}.pkg
|
||||
|
||||
#log "Signing whole app..."
|
||||
#codesign --timestamp \
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
|
||||
export COPYFILE_DISABLE=true
|
||||
@@ -44,8 +45,7 @@ fi
|
||||
log "$INPUT_FILE extracted and removed"
|
||||
|
||||
APP_NAME=$(echo ${INPUT_FILE} | awk -F".tar" '{ print $1 }')
|
||||
APPLICATION_PATH=$(sed "s/osx-//" <<< "$EXPLODED/$APP_NAME")
|
||||
mv $EXPLODED/$BUILD_NAME $APPLICATION_PATH
|
||||
APPLICATION_PATH=$EXPLODED/$(ls $EXPLODED)
|
||||
|
||||
find "$APPLICATION_PATH/Contents/Home/bin" \
|
||||
-maxdepth 1 -type f -name '*.jnilib' -print0 |
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TC_PRINT=0
|
||||
# Always print TeamCity service messages if running under TeamCity
|
||||
[[ -n "${TEAMCITY_VERSION:-}" ]] && TC_PRINT=1
|
||||
|
||||
while getopts ":t" o; do
|
||||
case "${o}" in
|
||||
t)
|
||||
t="With Teamcity tests info"
|
||||
TC_PRINT=1
|
||||
;;
|
||||
t) TC_PRINT=1 ;;
|
||||
*);;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
NEWFILEPATH=$1
|
||||
CONFIGID=$2
|
||||
BUILDID=$3
|
||||
TOKEN=$4
|
||||
NEWFILEPATH="$1"
|
||||
CONFIGID="$2"
|
||||
BUILDID="$3"
|
||||
TOKEN="$4"
|
||||
|
||||
if [ ! -f "$NEWFILEPATH" ]; then
|
||||
echo "File not found: $NEWFILEPATH"
|
||||
exit 1
|
||||
fi
|
||||
#
|
||||
# Get the size of new artifact
|
||||
#
|
||||
@@ -28,11 +36,7 @@ case "${unameOut}" in
|
||||
NEWFILESIZE=$(stat -f%z "$NEWFILEPATH")
|
||||
;;
|
||||
CYGWIN*)
|
||||
NEWFILESIZE=$(stat -c%s$4
|
||||
#
|
||||
# Get the size of new artifact
|
||||
#
|
||||
"$NEWFILEPATH")
|
||||
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
|
||||
;;
|
||||
MINGW*)
|
||||
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
|
||||
@@ -41,13 +45,13 @@ case "${unameOut}" in
|
||||
echo "Unknown machine: ${unameOut}"
|
||||
exit 1
|
||||
esac
|
||||
FILENAME=$(basename ${NEWFILEPATH})
|
||||
FILENAME=$(basename "${NEWFILEPATH}")
|
||||
|
||||
#
|
||||
# Get pattern of artifact name
|
||||
# Base filename pattern: <BUNDLE_TYPE>-<JDK_VERSION>-<OS>-<ARCH>-b<BUILD>.tar.gz: jbr_dcevm-17.0.2-osx-x64-b1234.tar.gz
|
||||
# BUNDLE_TYPE: jbr, jbrsdk, jbr_dcevm, jbrsdk_jcef etc.
|
||||
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, windows-x64 etc.
|
||||
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, linux-musl-x64, windows-x64 etc.
|
||||
|
||||
BUNDLE_TYPE=jbrsdk
|
||||
OS_ARCH_PATTERN=""
|
||||
@@ -58,33 +62,37 @@ if [[ $FILENAME =~ $re ]]; then
|
||||
BUNDLE_TYPE=${BASH_REMATCH[1]}
|
||||
OS_ARCH_PATTERN=${BASH_REMATCH[2]}
|
||||
FILE_EXTENSION=${BASH_REMATCH[3]}
|
||||
else
|
||||
echo "File name $FILENAME does not match regex $re"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
testname_file_ext=`echo $FILE_EXTENSION | sed 's/\./_/g'`
|
||||
testname=$BUNDLE_TYPE"_"$OS_ARCH_PATTERN$testname_file_ext
|
||||
echo \#\#teamcity[testStarted name=\'$testname\']
|
||||
fi
|
||||
|
||||
|
||||
echo "BUNDLE_TYPE: " $BUNDLE_TYPE
|
||||
echo "OS_ARCH_PATTERN: " $OS_ARCH_PATTERN
|
||||
echo "FILE_EXTENSION: " $FILE_EXTENSION
|
||||
echo "New size of $FILENAME = $NEWFILESIZE bytes."
|
||||
|
||||
function test_started_msg() {
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
echo "##teamcity[testStarted name='$1']"
|
||||
fi
|
||||
}
|
||||
|
||||
function test_failed_msg() {
|
||||
if [ $3 -eq 1 ]; then
|
||||
echo \#\#teamcity[testFailed name=\'$1\' message=\'$2\']
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
echo "##teamcity[testFailed name='$1' message='$2']"
|
||||
fi
|
||||
}
|
||||
|
||||
function test_finished_msg() {
|
||||
if [ $2 -eq 1 ]; then
|
||||
echo \#\#teamcity[testFinished name=\'$1\']
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
echo "##teamcity[testFinished name='$1']"
|
||||
fi
|
||||
}
|
||||
|
||||
test_name="${BUNDLE_TYPE}_${OS_ARCH_PATTERN//\-/_}${FILE_EXTENSION//\./_}"
|
||||
test_started_msg "$test_name"
|
||||
|
||||
echo "BUNDLE_TYPE: $BUNDLE_TYPE"
|
||||
echo "OS_ARCH_PATTERN: $OS_ARCH_PATTERN"
|
||||
echo "FILE_EXTENSION: $FILE_EXTENSION"
|
||||
echo "Size of $FILENAME is $NEWFILESIZE bytes"
|
||||
|
||||
#
|
||||
# Get previous successful build ID
|
||||
# Example:
|
||||
@@ -94,20 +102,21 @@ function test_finished_msg() {
|
||||
# expected return value
|
||||
# id="123".number="567"
|
||||
#
|
||||
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
|
||||
CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
|
||||
re='id=\"([0-9]+)\".+number=\"([0-9\.]+)\"'
|
||||
|
||||
# ID: Previous successful build id
|
||||
ID=0
|
||||
if [[ $CURL_RESPONSE =~ $re ]]; then
|
||||
ID=${BASH_REMATCH[1]}
|
||||
echo "BUILD Number: ${BASH_REMATCH[2]}"
|
||||
echo "Previous build ID: $ID"
|
||||
echo "Previous build number: ${BASH_REMATCH[2]}"
|
||||
else
|
||||
msg="ERROR: can't find previous build"
|
||||
echo $msg
|
||||
echo $CURL_RESPONSE
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
msg="ERROR: cannot find previous build"
|
||||
echo "$msg"
|
||||
echo "$CURL_RESPONSE"
|
||||
test_failed_msg "$test_name" "$msg"
|
||||
test_finished_msg "$test_name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -117,36 +126,37 @@ fi
|
||||
# expected return value
|
||||
# name="jbrsdk_jcef*.tar.gz size="123'
|
||||
#
|
||||
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
|
||||
echo "Atrifacts of previous build of $CONFIGID :"
|
||||
echo $CURL_RESPONSE
|
||||
CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
|
||||
echo "Artifacts of the previous build:"
|
||||
echo "$CURL_RESPONSE"
|
||||
|
||||
# Find binary size (in response) with reg exp
|
||||
re='name=\"('$BUNDLE_TYPE'[^\"]+'${OS_ARCH_PATTERN}'[^\"]+'${FILE_EXTENSION}')\" size=\"([0-9]+)\"'
|
||||
re="name=\"(${BUNDLE_TYPE}[^\"]+${OS_ARCH_PATTERN}[^\"]+${FILE_EXTENSION})\" size=\"([0-9]+)\""
|
||||
|
||||
if [[ $CURL_RESPONSE =~ $re ]]; then
|
||||
OLDFILENAME=${BASH_REMATCH[1]}
|
||||
echo "Prev artifact name: $OLDFILENAME"
|
||||
OLDFILESIZE=${BASH_REMATCH[2]}
|
||||
echo "Prev artifact size = $OLDFILESIZE"
|
||||
prevFileName=${BASH_REMATCH[1]}
|
||||
echo "Previous artifact name: $prevFileName"
|
||||
prevFileSize=${BASH_REMATCH[2]}
|
||||
echo "Previous artifact size: $prevFileSize"
|
||||
|
||||
let allowedSize=OLDFILESIZE+OLDFILESIZE/20 # use 5% threshold
|
||||
echo "Allowed size = $allowedSize"
|
||||
((allowedSize=prevFileSize+prevFileSize/20)) # use 5% threshold
|
||||
echo "Allowed size: $allowedSize"
|
||||
if [[ "$NEWFILESIZE" -gt "$allowedSize" ]]; then
|
||||
msg="ERROR: new size is significally greater than prev size (need to investigate)"
|
||||
echo $msg
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
msg="ERROR: new size is significantly greater than previous size (need to investigate)"
|
||||
echo "$msg"
|
||||
test_failed_msg "$test_name" "$msg"
|
||||
test_finished_msg "$test_name"
|
||||
exit 1
|
||||
else
|
||||
echo "PASSED"
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
test_finished_msg "$test_name"
|
||||
fi
|
||||
else
|
||||
msg="ERROR: can't find string with size in xml response:"
|
||||
echo $msg
|
||||
echo $CURL_RESPONSE
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
msg="ERROR: cannot find string with size in xml response:"
|
||||
echo "Regex: $re"
|
||||
echo "$msg"
|
||||
echo "$CURL_RESPONSE"
|
||||
test_failed_msg "$test_name" "$msg"
|
||||
test_finished_msg "$test_name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
usage ()
|
||||
{
|
||||
@@ -57,7 +60,13 @@ else
|
||||
testContent=`paste -d '\t' $refFile <(echo "$curValues") | tail -n +1`
|
||||
fi
|
||||
|
||||
testContent=`echo "$testContent" | awk -F'\t' '{ if ($3>$2+$2*0.1) {print "* "$1"\t"$2"\t"$3"\t"(($2==0)?"-":$3/$2)} else {print " "$1"\t"$2"\t"$3"\t"(($2==0)?"-":$3/$2)} }'`
|
||||
testContent=`echo "$testContent" | tr "," "." | awk -F'\t' '{
|
||||
if ($3>$2+$2*0.1) {
|
||||
print "* "$1"\t"$2"\t"$3"\t"(($2>0)?$3/$2:"-")
|
||||
} else {
|
||||
print " "$1"\t"$2"\t"$3"\t"(($2>0)?$3/$2:"-")
|
||||
}
|
||||
}'`
|
||||
if [ -z $noHeaders ]; then
|
||||
echo "$header" > $resFile
|
||||
fi
|
||||
@@ -68,11 +77,12 @@ if [ -z $tc ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
failed=0
|
||||
echo "$testContent" 2>&1 | (
|
||||
while read -r s; do
|
||||
testname=`echo "$s" | cut -f 1 | tr -d "[:space:]" | tr -d "*"`
|
||||
duration=`echo "$s" | cut -f 3`
|
||||
failed=`echo "$s" | cut -c1 | grep -c "*"`
|
||||
echo "$s" | cut -c1 | grep -c "*" && failed=1
|
||||
echo \#\#teamcity[testStarted name=\'$testNamePrefix$testname\']
|
||||
echo "===>$s"
|
||||
echo \#\#teamcity[buildStatisticValue key=\'$testNamePrefix$testname\' value=\'$duration\']
|
||||
|
||||
142
jb/project/tools/windows/scripts/mkimages_aarch64.sh
Normal file
142
jb/project/tools/windows/scripts/mkimages_aarch64.sh
Normal file
@@ -0,0 +1,142 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built;possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# This script makes test-image along with JDK images when bundle_type is set to "jcef".
|
||||
# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
|
||||
#
|
||||
# Environment variables:
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
|
||||
# to configure
|
||||
# By default JDK_BUILD_NUMBER is set zero
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_win_aarch64
|
||||
|
||||
if [ -z "$BUILD_JDK" ]; then
|
||||
echo "BUILD_JDK environment variable must be specified and point to a JDK built from the current sources" \
|
||||
" and is able to run on the build system. See OpenJDK documentation for --with-build-jdk for more info."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
WORK_DIR=$(pwd)
|
||||
JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_aarch64}
|
||||
|
||||
function do_configure {
|
||||
sh ./configure \
|
||||
--enable-option-checking=fatal \
|
||||
--openjdk-target=aarch64-unknown-cygwin \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=$JDK_BUILD_NUMBER \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--with-build-jdk=$BUILD_JDK \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
|| do_exit $?
|
||||
}
|
||||
|
||||
function create_image_bundle {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
__modules_path=$3
|
||||
__modules=$4
|
||||
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Running jlink ...
|
||||
${BUILD_JDK}/bin/jlink \
|
||||
--module-path $__modules_path --no-man-pages --compress=2 \
|
||||
--add-modules $__modules --output $__root_dir || do_exit $?
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
|
||||
mv release $__root_dir/release
|
||||
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
|
||||
rsync -a --exclude demo --exclude sample $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
fi
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=windows-aarch64-server-release
|
||||
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
do_reset_changes=0
|
||||
do_maketest=1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
do_reset_changes=0
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=windows-aarch64-server-fastdebug
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JSDK_MODS_DIR=$IMAGES_DIR/jmods
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
|
||||
update_jsdk_mods "$BUILD_JDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
|
||||
cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
|
||||
modules+=",jdk.crypto.mscapi"
|
||||
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
# create sdk image bundle
|
||||
modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g) || do_exit $?
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
|
||||
|
||||
do_exit 0
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
@@ -35,6 +38,7 @@ function do_configure {
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
|| do_exit $?
|
||||
}
|
||||
@@ -45,19 +49,24 @@ function create_image_bundle {
|
||||
__modules_path=$3
|
||||
__modules=$4
|
||||
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Running jlink ...
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path $__modules_path --no-man-pages --compress=2 \
|
||||
--add-modules $__modules --output $__arch_name || do_exit $?
|
||||
--add-modules $__modules --output $__root_dir || do_exit $?
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__arch_name/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__arch_name/release > release
|
||||
mv release $__arch_name/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip $__arch_name/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$__arch_name"/jmods
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
|
||||
mv release $__root_dir/release
|
||||
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
|
||||
rsync -a --exclude demo --exclude sample $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -79,7 +88,7 @@ case "$bundle_type" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INC_BUILD" ]; then
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
@@ -105,9 +114,11 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
# create runtime image bundlef
|
||||
# create runtime image bundle
|
||||
modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
|
||||
modules+=",jdk.crypto.mscapi"
|
||||
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -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
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built;possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
@@ -14,50 +16,112 @@
|
||||
# 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/scripts/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WORK_DIR=$(pwd)
|
||||
|
||||
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
|
||||
function do_configure {
|
||||
sh ./configure \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
|
||||
--with-jvm-features=shenandoahgc \
|
||||
--with-version-pre= \
|
||||
--with-version-build=$JDK_BUILD_NUMBER \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
|| do_exit $?
|
||||
}
|
||||
|
||||
PATH="/usr/local/bin:/usr/bin:${PATH}"
|
||||
./configure \
|
||||
--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
|
||||
function create_image_bundle {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
__modules_path=$3
|
||||
__modules=$4
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x86-b${build_number}
|
||||
BASE_DIR=build/windows-x86-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Running jlink ...
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path $__modules_path --no-man-pages --compress=2 \
|
||||
--add-modules $__modules --output $__root_dir || do_exit $?
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
|
||||
mv release $__root_dir/release
|
||||
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
|
||||
rsync -a --exclude demo --exclude sample $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
fi
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=windows-x86_64-server-release
|
||||
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
echo "not implemented" && do_exit 1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
do_reset_changes=0
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=windows-x86_64-server-fastdebug
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JSDK_MODS_DIR=$IMAGES_DIR/jmods
|
||||
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
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
|
||||
cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
rm -rf ${JBR_BUNDLE}
|
||||
grep -v javafx jb/project/tools/common/modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
echo ",jdk.crypto.mscapi" >> modules.list.x86
|
||||
${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 $?
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
echo Modifying release info ...
|
||||
#grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release
|
||||
# create runtime image bundle
|
||||
modules=$(grep -v "jdk.internal.vm" jb/project/tools/common/modules.list | xargs | sed s/" "//g) || do_exit $?
|
||||
modules+=",jdk.crypto.mscapi"
|
||||
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
# create sdk image bundle
|
||||
modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g)
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
|
||||
|
||||
do_exit 0
|
||||
|
||||
56
jb/project/tools/windows/scripts/pack_aarch64.sh
Normal file
56
jb/project/tools/windows/scripts/pack_aarch64.sh
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built;possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# This script packs test-image along with JDK images when bundle_type is set to "jcef".
|
||||
# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
|
||||
#
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
[ "$bundle_type" == "jcef" ] && do_maketest=1
|
||||
|
||||
function pack_jbr {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
|
||||
}
|
||||
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
RELEASE_NAME=windows-aarch64-server-release
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
BASE_DIR=.
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
pack_jbr jbr${jbr_name_postfix} jbr
|
||||
pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-aarch64-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
@@ -19,12 +22,15 @@ function pack_jbr {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__arch_name || do_exit $?
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
|
||||
}
|
||||
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
@@ -36,6 +42,8 @@ BASE_DIR=.
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
pack_jbr jbr${jbr_name_postfix} jbr
|
||||
|
||||
@@ -1,42 +1,50 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -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)
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built;possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
[ "$bundle_type" == "jcef" ] && echo "not implemented" && do_exit 1
|
||||
|
||||
IMAGES_DIR=build/windows-x86-server-release/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JBSDK=$JBRSDK_BASE_NAME-windows-x86-b$build_number
|
||||
BASE_DIR=.
|
||||
function pack_jbr {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
|
||||
}
|
||||
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
|
||||
BASE_DIR=.
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
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
|
||||
pack_jbr jbr${jbr_name_postfix} jbr
|
||||
pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
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
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x86-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $BASE_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -229,15 +229,19 @@ else
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_REPRODUCIBLE_BUILD), true)
|
||||
ifeq ($(MODULE), java.base)
|
||||
JAR_FILE_TO_FIX := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar
|
||||
$(eval $(call SetupExecute, fixup_jrtfs_jar, \
|
||||
WARN := Fixing timestamps in modules_libs/java.base/jrt-fs.jar, \
|
||||
DEPS := $(JAR_FILE_TO_FIX) $(JDK_OUTPUTDIR)/bin/jar, \
|
||||
OUTPUT_DIR := $(JMODS_SUPPORT_DIR), \
|
||||
COMMAND := $(FIXPATH) $(JDK_OUTPUTDIR)/bin/jar --date $(SOURCE_DATE_ISO_8601) --update --file $(JAR_FILE_TO_FIX) @$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/_the.jrt-fs.jar_contents, \
|
||||
))
|
||||
DEPS += $(fixup_jrtfs_jar_TARGET)
|
||||
# If boot JDK's jar supported --date, jrt-fs.jar would've been built with
|
||||
# that option already.
|
||||
ifneq ($(BOOT_JDK_JAR_SUPPORTS_DATE), true)
|
||||
ifeq ($(MODULE), java.base)
|
||||
JAR_FILE_TO_FIX := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar
|
||||
$(eval $(call SetupExecute, fixup_jrtfs_jar, \
|
||||
WARN := Fixing timestamps in modules_libs/java.base/jrt-fs.jar, \
|
||||
DEPS := $(JAR_FILE_TO_FIX) $(JDK_OUTPUTDIR)/bin/jar, \
|
||||
OUTPUT_DIR := $(JMODS_SUPPORT_DIR), \
|
||||
COMMAND := $(BUILD_JAR) --date $(SOURCE_DATE_ISO_8601) --update --file $(JAR_FILE_TO_FIX) @$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/_the.jrt-fs.jar_contents, \
|
||||
))
|
||||
DEPS += $(fixup_jrtfs_jar_TARGET)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ BUILD_INFO_PROPERTIES := $(TEST_IMAGE_DIR)/build-info.properties
|
||||
$(BUILD_INFO_PROPERTIES):
|
||||
$(call MakeTargetDir)
|
||||
$(ECHO) "# Build info properties for JDK tests" > $@
|
||||
$(ECHO) "build.workspace.root=$(call FixPath, $(WORKSPACE_ROOT))" >> $@
|
||||
$(ECHO) "build.output.root=$(call FixPath, $(OUTPUTDIR))" >> $@
|
||||
$(ECHO) 'build.workspace.root=$(call FixPath, $(WORKSPACE_ROOT))' >> $@
|
||||
$(ECHO) 'build.output.root=$(call FixPath, $(OUTPUTDIR))' >> $@
|
||||
|
||||
README := $(TEST_IMAGE_DIR)/Readme.txt
|
||||
|
||||
|
||||
@@ -270,6 +270,8 @@ AC_DEFUN([BASIC_CHECK_TAR],
|
||||
TAR_TYPE="bsd"
|
||||
elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
|
||||
TAR_TYPE="bsd"
|
||||
elif test "x$($TAR --version | $GREP "busybox")" != "x"; then
|
||||
TAR_TYPE="busybox"
|
||||
elif test "x$OPENJDK_BUILD_OS" = "xaix"; then
|
||||
TAR_TYPE="aix"
|
||||
fi
|
||||
@@ -281,9 +283,12 @@ AC_DEFUN([BASIC_CHECK_TAR],
|
||||
TAR_SUPPORTS_TRANSFORM="true"
|
||||
elif test "x$TAR_TYPE" = "aix"; then
|
||||
# -L InputList of aix tar: name of file listing the files and directories
|
||||
# that need to be archived or extracted
|
||||
# that need to be archived or extracted
|
||||
TAR_INCLUDE_PARAM="L"
|
||||
TAR_SUPPORTS_TRANSFORM="false"
|
||||
elif test "x$TAR_TYPE" = "xbusybox"; then
|
||||
TAR_INCLUDE_PARAM="T"
|
||||
TAR_SUPPORTS_TRANSFORM="false"
|
||||
else
|
||||
TAR_INCLUDE_PARAM="I"
|
||||
TAR_SUPPORTS_TRANSFORM="false"
|
||||
|
||||
11
make/autoconf/build-aux/config.guess
vendored
11
make/autoconf/build-aux/config.guess
vendored
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
@@ -111,15 +111,6 @@ if [ "x$OUT" = x ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix RISC-V.
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
if [ `uname -m` = riscv64 ]; then
|
||||
OUT=riscv64-unknown-linux-gnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix cpu on macos-aarch64, uname -p reports arm, buildsys expects aarch64
|
||||
echo $OUT | grep arm-apple-darwin > /dev/null 2> /dev/null
|
||||
if test $? != 0; then
|
||||
|
||||
@@ -116,6 +116,18 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
CFLAGS_DEBUG_SYMBOLS="-g"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
||||
# Check if compiler supports -fdebug-prefix-map. If so, use that to make
|
||||
# the debug symbol paths resolve to paths relative to the workspace root.
|
||||
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
|
||||
DEBUG_PREFIX_CFLAGS="-fdebug-prefix-map=${workspace_root_trailing_slash}="
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_PREFIX_CFLAGS}],
|
||||
IF_FALSE: [
|
||||
DEBUG_PREFIX_CFLAGS=
|
||||
]
|
||||
)
|
||||
fi
|
||||
|
||||
CFLAGS_DEBUG_SYMBOLS="-g"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
@@ -180,6 +192,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
|
||||
clang)
|
||||
DISABLE_WARNING_PREFIX="-Wno-"
|
||||
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
|
||||
# Additional warnings that are not activated by -Wall and -Wextra
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
|
||||
[
|
||||
UTIL_LOOKUP_PROGS(PKGHANDLER, zypper apt-get yum brew port pkgutil pkgadd pacman)
|
||||
UTIL_LOOKUP_PROGS(PKGHANDLER, zypper apt-get yum brew port pkgutil pkgadd pacman apk)
|
||||
])
|
||||
|
||||
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
|
||||
@@ -58,6 +58,8 @@ AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
|
||||
zypper_help $MISSING_DEPENDENCY ;;
|
||||
*pacman)
|
||||
pacman_help $MISSING_DEPENDENCY ;;
|
||||
*apk)
|
||||
apk_help $MISSING_DEPENDENCY ;;
|
||||
esac
|
||||
|
||||
if test "x$PKGHANDLER_COMMAND" != x; then
|
||||
@@ -184,6 +186,27 @@ pkgadd_help() {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
apk_help() {
|
||||
case $1 in
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo apk add alpine-sdk linux-headers" ;;
|
||||
alsa)
|
||||
PKGHANDLER_COMMAND="sudo apk add alsa-lib-dev" ;;
|
||||
cups)
|
||||
PKGHANDLER_COMMAND="sudo apk add cups-dev" ;;
|
||||
fontconfig)
|
||||
PKGHANDLER_COMMAND="sudo apk add fontconfig-dev" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo apk add freetype-dev" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo apk add harfbuzz-dev" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo apk add libxtst-dev libxt-dev libxrender-dev libxrandr-dev" ;;
|
||||
ccache)
|
||||
PKGHANDLER_COMMAND="sudo apk add ccache" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# This function will check if we're called from the "configure" wrapper while
|
||||
# printing --help. If so, we will print out additional information that can
|
||||
# only be extracted within the autoconf script, and then exit. This must be
|
||||
|
||||
@@ -308,8 +308,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_SHENANDOAHGC],
|
||||
AC_MSG_CHECKING([if platform is supported by Shenandoah])
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xppc64le" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xriscv64"; then
|
||||
test "x$OPENJDK_TARGET_CPU" = "xppc64le"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
||||
@@ -359,8 +358,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_ZGC],
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xppc64le" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xriscv64"; then
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xppc64le"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -146,12 +146,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
fi
|
||||
fi
|
||||
|
||||
# Because RISC-V only has word-sized atomics, it requries libatomic where
|
||||
# other common architectures do not. So link libatomic by default.
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xriscv64; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -latomic"
|
||||
fi
|
||||
|
||||
# perfstat lib
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -561,8 +561,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
|
||||
HOTSPOT_$1_CPU_DEFINE=PPC64
|
||||
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
|
||||
HOTSPOT_$1_CPU_DEFINE=PPC64
|
||||
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
|
||||
HOTSPOT_$1_CPU_DEFINE=RISCV64
|
||||
|
||||
# The cpu defines below are for zero, we don't support them directly.
|
||||
elif test "x$OPENJDK_$1_CPU" = xsparc; then
|
||||
@@ -573,6 +571,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
|
||||
HOTSPOT_$1_CPU_DEFINE=S390
|
||||
elif test "x$OPENJDK_$1_CPU" = xs390x; then
|
||||
HOTSPOT_$1_CPU_DEFINE=S390
|
||||
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
|
||||
HOTSPOT_$1_CPU_DEFINE=RISCV
|
||||
elif test "x$OPENJDK_$1_CPU" != x; then
|
||||
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
|
||||
fi
|
||||
|
||||
@@ -359,9 +359,9 @@ define SetupCompileNativeFileBody
|
||||
$1_FLAGS := $(BASIC_ASFLAGS) $$($1_BASE_ASFLAGS)
|
||||
$1_COMPILER := $(AS)
|
||||
|
||||
# gcc assembly files must contain an appropriate relative .file
|
||||
# gcc or clang assembly files must contain an appropriate relative .file
|
||||
# path for reproducible builds.
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
# If no absolute paths allowed, work out relative source file path
|
||||
# for assembly .file substitution, otherwise use full file path
|
||||
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT), false)
|
||||
@@ -403,8 +403,9 @@ define SetupCompileNativeFileBody
|
||||
$1_OBJ_DEPS := $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
|
||||
$$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE)
|
||||
$1_COMPILE_OPTIONS := $$($1_FLAGS) $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)
|
||||
# For reproducible builds with gcc ensure random symbol generation is seeded deterministically
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
# For reproducible builds with gcc and clang ensure random symbol generation is
|
||||
# seeded deterministically
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
ifeq ($$(ENABLE_REPRODUCIBLE_BUILD), true)
|
||||
$1_COMPILE_OPTIONS += -frandom-seed="$$($1_FILENAME)"
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,19 +25,19 @@
|
||||
|
||||
# Versions and download locations for dependencies used by pre-submit testing.
|
||||
|
||||
BOOT_JDK_VERSION=16
|
||||
BOOT_JDK_VERSION=17
|
||||
JTREG_VERSION=6
|
||||
JTREG_BUILD=1
|
||||
GTEST_VERSION=1.8.1
|
||||
|
||||
LINUX_X64_BOOT_JDK_FILENAME=openjdk-17.0.1_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=1c0a73cbb863aad579b967316bf17673b8f98a9bb938602a140ba2e5c38f880a
|
||||
LINUX_X64_BOOT_JDK_FILENAME=openjdk-17.0.2_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.2_8.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=288f34e3ba8a4838605636485d0365ce23e57d5f2f68997ac4c2e4c01967cd48
|
||||
|
||||
WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-17.0.1_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=329900a6673b237b502bdcf77bc334da34bc91355c5fd2d457fc00f53fd71ef1
|
||||
WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-17.0.2_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_windows_hotspot_17.0.2_8.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=d083479ca927dce2f586f779373d895e8bf668c632505740279390384edf03fa
|
||||
|
||||
MACOS_X64_BOOT_JDK_FILENAME=openjdk-17.0.1_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=6ccb35800e723cabe15af60e67099d1a07c111d2d3208aa75523614dde68bee1
|
||||
MACOS_X64_BOOT_JDK_FILENAME=openjdk-17.0.2_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_mac_hotspot_17.0.2_8.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=3630e21a571b7180876bf08f85d0aac0bdbb3267b2ae9bd242f4933b21f9be32
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
|
||||
DEFAULT_VERSION_FEATURE=17
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=3
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_UPDATE=4
|
||||
DEFAULT_VERSION_PATCH=1
|
||||
DEFAULT_VERSION_EXTRA1=0
|
||||
DEFAULT_VERSION_EXTRA2=0
|
||||
DEFAULT_VERSION_EXTRA3=0
|
||||
DEFAULT_VERSION_DATE=2022-04-19
|
||||
DEFAULT_VERSION_DATE=2022-08-12
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=61 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_VERSION_DOCS_API_SINCE=11
|
||||
|
||||
@@ -52,6 +52,7 @@ allfonts.myanmar=Myanmar Text
|
||||
allfonts.dingbats=Wingdings
|
||||
allfonts.symbol=Symbol
|
||||
allfonts.symbols=Segoe UI Symbol
|
||||
allfonts.emoji=Segoe UI Emoji
|
||||
allfonts.thai=Tahoma
|
||||
allfonts.georgian=Sylfaen
|
||||
|
||||
@@ -197,58 +198,58 @@ dialoginput.bolditalic.korean=Malgun Gothic
|
||||
|
||||
# Search Sequences
|
||||
|
||||
sequence.allfonts=alphabetic/default,dingbats,symbol
|
||||
sequence.allfonts=alphabetic/default,dingbats,symbol,symbols
|
||||
|
||||
sequence.serif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
|
||||
sequence.sansserif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
|
||||
sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,chinese-ms936-extb
|
||||
sequence.dialog.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
|
||||
sequence.dialoginput.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
|
||||
sequence.serif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
|
||||
sequence.sansserif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
|
||||
sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,chinese-ms936-extb,symbols
|
||||
sequence.dialog.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
|
||||
sequence.dialoginput.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb,symbols
|
||||
|
||||
sequence.serif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb
|
||||
sequence.sansserif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb
|
||||
sequence.monospaced.GB18030=chinese-gb18030,alphabetic,dingbats,symbol,chinese-gb18030-extb
|
||||
sequence.dialog.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb
|
||||
sequence.dialoginput.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb
|
||||
sequence.serif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
|
||||
sequence.sansserif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
|
||||
sequence.monospaced.GB18030=chinese-gb18030,alphabetic,dingbats,symbol,chinese-gb18030-extb,symbols
|
||||
sequence.dialog.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
|
||||
sequence.dialoginput.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb,symbols
|
||||
|
||||
sequence.serif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.sansserif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.monospaced.x-windows-950=chinese-ms950,alphabetic,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.dialog.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.dialoginput.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.serif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.sansserif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.monospaced.x-windows-950=chinese-ms950,alphabetic,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.dialog.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.dialoginput.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
|
||||
sequence.serif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.sansserif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.monospaced.x-MS950-HKSCS=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.dialog.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.dialoginput.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.serif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.sansserif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.monospaced.x-MS950-HKSCS=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.dialog.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.dialoginput.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
|
||||
sequence.serif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.sansserif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.monospaced.x-MS950-HKSCS-XP=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
|
||||
sequence.serif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.sansserif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.monospaced.x-MS950-HKSCS-XP=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb,symbols
|
||||
|
||||
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,dingbats,symbol
|
||||
sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari,dingbats,symbol
|
||||
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,dingbats,symbol,symbols
|
||||
sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari,dingbats,symbol,symbols
|
||||
|
||||
sequence.allfonts.windows-1255=hebrew,alphabetic/1252,dingbats,symbol
|
||||
sequence.allfonts.windows-1255=hebrew,alphabetic/1252,dingbats,symbol,symbols
|
||||
|
||||
sequence.serif.windows-31j=alphabetic,japanese,dingbats,symbol
|
||||
sequence.sansserif.windows-31j=alphabetic,japanese,dingbats,symbol
|
||||
sequence.monospaced.windows-31j=japanese,alphabetic,dingbats,symbol
|
||||
sequence.dialog.windows-31j=alphabetic,japanese,dingbats,symbol
|
||||
sequence.dialoginput.windows-31j=alphabetic,japanese,dingbats,symbol
|
||||
sequence.serif.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
|
||||
sequence.sansserif.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
|
||||
sequence.monospaced.windows-31j=japanese,alphabetic,dingbats,symbol,symbols
|
||||
sequence.dialog.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
|
||||
sequence.dialoginput.windows-31j=alphabetic,japanese,dingbats,symbol,symbols
|
||||
|
||||
sequence.serif.x-windows-949=alphabetic,korean,dingbats,symbol
|
||||
sequence.sansserif.x-windows-949=alphabetic,korean,dingbats,symbol
|
||||
sequence.monospaced.x-windows-949=korean,alphabetic,dingbats,symbol
|
||||
sequence.dialog.x-windows-949=alphabetic,korean,dingbats,symbol
|
||||
sequence.dialoginput.x-windows-949=alphabetic,korean,dingbats,symbol
|
||||
sequence.serif.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
|
||||
sequence.sansserif.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
|
||||
sequence.monospaced.x-windows-949=korean,alphabetic,dingbats,symbol,symbols
|
||||
sequence.dialog.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
|
||||
sequence.dialoginput.x-windows-949=alphabetic,korean,dingbats,symbol,symbols
|
||||
|
||||
sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol
|
||||
sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol,symbols
|
||||
|
||||
sequence.fallback=symbols,\
|
||||
sequence.fallback=emoji,\
|
||||
chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
|
||||
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,\
|
||||
georgian,devanagari,bengali,gujarati,gurmukhi,kannada,\
|
||||
@@ -260,6 +261,25 @@ sequence.fallback=symbols,\
|
||||
exclusion.alphabetic=0700-1cff,1d80-1e9f,1f00-2017,2020-20ab,20ad-20b8,20bb-20bc,20be-24ff,2501-2501,2503-250b,250d-250f,2511-2513,2515-2517,2519-251b,251d-2523,2525-252b,252d-2533,2535-253b,253d-254f,256d-f8ff
|
||||
exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be
|
||||
exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac
|
||||
exclusion.symbols=000d-0022,0024-0029,002b-002f,003a-00a8,00aa-00ad,00af-02dc,2002-2003,\
|
||||
2005-2005,200d-200d,2013-2014,2018-201a,201c-201e,2020-2022,2026-2026,\
|
||||
2030-2030,2039-203a,2044-2044,20ac-20ac,20e3-20e3,2126-2126,2190-2193,\
|
||||
219a-21a8,21ab-21ff,2206-2206,220f-220f,2211-2212,2219-221a,221e-221e,\
|
||||
222b-222b,2248-2248,2260-2260,231a-231b,23e9-23ec,23f0-23f0,23f3-23f3,\
|
||||
24b6-24c1,24c3-24cf,25a0-25a9,25ac-25b5,25b7-25bf,25c1-25fa,25fd-25ff,\
|
||||
260f-2610,2612-2612,2614-2615,263b-263b,263f-263f,2641-2641,2643-2653,\
|
||||
2672-267a,267c-267d,267f-267f,2693-2693,26a1-26a6,26a8-26ab,26bd-26be,\
|
||||
26c4-26c5,26c7-26c7,26ce-26ce,26d4-26d4,26dd-26dd,26e3-26e3,26ea-26ea,\
|
||||
26f2-26f3,26f5-26f5,26fa-26fa,26fd-26fd,2701-2701,2703-2705,270a-270b,\
|
||||
270e-270e,2710-2710,2713-2713,2715-2715,2717-2718,2728-2728,2731-2732,\
|
||||
2735-2743,2745-2746,2748-274c,274e-274e,2753-2755,2757-2757,2795-2797,\
|
||||
27b0-27b0,27bf-27bf,2936-2937,2b12-2b1c,2b50-2b52,2b55-2b55,3244-3247,\
|
||||
01f000-01f02b,01f0cf-01f0cf,01f172-01f17d,01f180-01f1ff,01f201-01f201,\
|
||||
01f210-01f236,01f238-01f23a,01f250-01f320,01f32d-01f335,01f337-01f37c,\
|
||||
01f37e-01f393,01f3a0-01f3ca,01f3cf-01f3d3,01f3e0-01f3f0,01f3f4-01f3f4,\
|
||||
01f3f8-01f43e,01f440-01f440,01f442-01f4fc,01f4ff-01f53d,01f54b-01f567,\
|
||||
01f57a-01f57a,01f595-01f596,01f5a4-01f5a4,01f5fb-01f64f,01f680-01f6c5,\
|
||||
01f6cc-01f6cc,01f6d0-01f6d2,01f6eb-01f6ec,01f6f4-01f6f6,01f910-01f93a,01f93c-01f9c0
|
||||
|
||||
# Monospaced to Proportional width variant mapping
|
||||
# (Experimental private syntax)
|
||||
@@ -323,3 +343,4 @@ filename.Wingdings=WINGDING.TTF
|
||||
|
||||
filename.Sylfaen=sylfaen.ttf
|
||||
filename.Segoe_UI_Symbol=SEGUISYM.TTF
|
||||
filename.Segoe_UI_Emoji=seguiemj.ttf
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Github: https://raw.githubusercontent.com/publicsuffix/list/cbbba1d234670453df9c930dfbf510c0474d4301/public_suffix_list.dat
|
||||
Date: 2020-04-24
|
||||
Github: https://raw.githubusercontent.com/publicsuffix/list/3c213aab32b3c014f171b1673d4ce9b5cd72bf1c/public_suffix_list.dat
|
||||
Date: 2021-11-27
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,4 +21,4 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
tzdata2021e
|
||||
tzdata2022a
|
||||
|
||||
@@ -941,6 +941,10 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
|
||||
# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
|
||||
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
|
||||
# (setq islamic-year (+ 1 islamic-year))))
|
||||
#
|
||||
# From Milamber (2021-03-31, 2022-03-10), confirming these predictions:
|
||||
# https://www.mmsp.gov.ma/fr/actualites.aspx?id=2076
|
||||
# https://www.ecoactu.ma/horaires-administration-ramadan-gmtheure-gmt-a-partir-de-dimanche-27-mars/
|
||||
|
||||
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
|
||||
Rule Morocco 1939 only - Sep 12 0:00 1:00 -
|
||||
|
||||
@@ -3429,8 +3429,12 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
|
||||
# ... winter time will begin in Palestine from Friday 10-29, 01:00 AM
|
||||
# by 60 minutes backwards.
|
||||
#
|
||||
# From Paul Eggert (2021-10-20):
|
||||
# Guess future fall transitions on October's last Friday at 01:00.
|
||||
# From Tim Parenti (2021-10-25), per Paul Eggert (2021-10-24):
|
||||
# Guess future fall transitions at 01:00 on the Friday preceding October's
|
||||
# last Sunday (i.e., Fri>=23), as this is more consistent with recent practice.
|
||||
|
||||
# From Heba Hamad (2022-03-10):
|
||||
# summer time will begin in Palestine from Sunday 03-27-2022, 00:00 AM.
|
||||
|
||||
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
|
||||
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
|
||||
@@ -3466,9 +3470,10 @@ Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S
|
||||
Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 -
|
||||
Rule Palestine 2019 only - Mar 29 0:00 1:00 S
|
||||
Rule Palestine 2019 only - Oct Sat>=24 0:00 0 -
|
||||
Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S
|
||||
Rule Palestine 2020 2021 - Mar Sat>=24 0:00 1:00 S
|
||||
Rule Palestine 2020 only - Oct 24 1:00 0 -
|
||||
Rule Palestine 2021 max - Oct lastFri 1:00 0 -
|
||||
Rule Palestine 2021 max - Oct Fri>=23 1:00 0 -
|
||||
Rule Palestine 2022 max - Mar Sun>=25 0:00 1:00 S
|
||||
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
|
||||
|
||||
@@ -2808,8 +2808,26 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
|
||||
# says he remembers that Samara opted out of the 1992-01-19 exception
|
||||
# 2 days before the switch.
|
||||
#
|
||||
# From Alois Treindl (2022-02-15):
|
||||
# the Russian wikipedia page
|
||||
# https://ru.wikipedia.org/wiki/Московское_время#Перемещение_границы_применения_московского_времени_на_восток
|
||||
# contains the sentence (in Google translation) "In the autumn of
|
||||
# 1981, Arkhangelsk, Vologda, Yaroslavl, Ivanovo, Vladimir, Ryazan,
|
||||
# Lipetsk, Voronezh, Rostov-on-Don, Krasnodar and regions to the east
|
||||
# of those named (about 30 in total) parted ways with Moscow time.
|
||||
# However, the convenience of common time with Moscow turned out to be
|
||||
# decisive - in 1982, these regions again switched to Moscow time."
|
||||
# Shanks International atlas has similar information, and also the
|
||||
# Russian book Zaitsev A., Kutalev D. A new astrologer's reference
|
||||
# book. Coordinates of cities and time corrections, - The World of
|
||||
# Urania, 2012 (Russian: Зайцев А., Куталёв Д., Новый справочник
|
||||
# астролога. Координаты городов и временные поправки).
|
||||
# To me it seems that an extra zone is needed, which starts with LMT
|
||||
# util 1919, later follows Moscow since 1930, but deviates from it
|
||||
# between 1 October 1981 until 1 April 1982.
|
||||
#
|
||||
# From Paul Eggert (2016-03-18):
|
||||
#
|
||||
# From Paul Eggert (2022-02-15):
|
||||
# Given the above, we appear to be missing some Zone entries for the
|
||||
# chaotic early 1980s in Russia. It's not clear what these entries
|
||||
# should be. For now, sweep this under the rug and just document the
|
||||
@@ -2856,7 +2874,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
|
||||
1:00 C-Eur CE%sT 1944 Apr 13
|
||||
3:00 Russia MSK/MSD 1990
|
||||
3:00 - MSK 1990 Jul 1 2:00
|
||||
2:00 - EET 1992
|
||||
2:00 - EET 1992 Mar 20
|
||||
# Central Crimea used Moscow time 1994/1997.
|
||||
#
|
||||
# From Paul Eggert (2006-03-22):
|
||||
@@ -2866,7 +2884,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
|
||||
# sometime between the 1994 DST switches. Shanks & Pottenger simply say
|
||||
# 1994-09-25 03:00, but that can't be right. For now, guess it
|
||||
# changed in May.
|
||||
2:00 E-Eur EE%sT 1994 May
|
||||
2:00 C-Eur EE%sT 1994 May
|
||||
# From IATA SSIM (1994/1997), which also says that Kerch is still like Kiev.
|
||||
3:00 E-Eur MSK/MSD 1996 Mar 31 0:00s
|
||||
3:00 1:00 MSD 1996 Oct 27 3:00s
|
||||
@@ -4033,6 +4051,27 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
|
||||
|
||||
# Ukraine
|
||||
#
|
||||
# From Alois Triendl (2014-03-01):
|
||||
# REGULATION A N O V A on March 20, 1992 N 139 ... means that from
|
||||
# 1992 on, Ukraine had DST with begin time at 02:00 am, on last Sunday
|
||||
# in March, and end time 03:00 am, last Sunday in September....
|
||||
# CABINET OF MINISTERS OF UKRAINE RESOLUTION on May 13, 1996 N 509
|
||||
# "On the order of computation time on the territory of Ukraine" ....
|
||||
# As this cabinet decision is from May 1996, it seems likely that the
|
||||
# transition in March 1996, which predates it, was still at 2:00 am
|
||||
# and not at 3:00 as would have been under EU rules.
|
||||
# This is why I have set the change to EU rules into May 1996,
|
||||
# so that the change in March is stil covered by the Ukraine rule.
|
||||
# The next change in October 1996 happened under EU rules....
|
||||
# TZ database holds three other zones for Ukraine.... I have not yet
|
||||
# worked out the consequences for these three zones, as we (me and my
|
||||
# US colleague David Cochrane) are still trying to get more
|
||||
# information upon these local deviations from Kiev rules.
|
||||
#
|
||||
# From Paul Eggert (2022-02-08):
|
||||
# For now, assume that Ukraine's other three zones followed the same rules,
|
||||
# except that Crimea switched to Moscow time in 1994 as described elsewhere.
|
||||
|
||||
# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
|
||||
# via Garrett Wollman (2003-01-27):
|
||||
# BTW, I've found the official document on this matter. It's government
|
||||
@@ -4122,7 +4161,7 @@ Zone Europe/Kiev 2:02:04 - LMT 1880
|
||||
1:00 C-Eur CE%sT 1943 Nov 6
|
||||
3:00 Russia MSK/MSD 1990 Jul 1 2:00
|
||||
2:00 1:00 EEST 1991 Sep 29 3:00
|
||||
2:00 E-Eur EE%sT 1995
|
||||
2:00 C-Eur EE%sT 1996 May 13
|
||||
2:00 EU EE%sT
|
||||
# Transcarpathia used CET 1990/1991.
|
||||
# "Uzhhorod" is the transliteration of the Rusyn/Ukrainian pronunciation, but
|
||||
@@ -4135,8 +4174,8 @@ Zone Europe/Uzhgorod 1:29:12 - LMT 1890 Oct
|
||||
3:00 Russia MSK/MSD 1990
|
||||
3:00 - MSK 1990 Jul 1 2:00
|
||||
1:00 - CET 1991 Mar 31 3:00
|
||||
2:00 - EET 1992
|
||||
2:00 E-Eur EE%sT 1995
|
||||
2:00 - EET 1992 Mar 20
|
||||
2:00 C-Eur EE%sT 1996 May 13
|
||||
2:00 EU EE%sT
|
||||
# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991.
|
||||
# "Zaporizhia" is the transliteration of the Ukrainian name, but
|
||||
@@ -4149,7 +4188,8 @@ Zone Europe/Zaporozhye 2:20:40 - LMT 1880
|
||||
3:00 - MSK 1941 Aug 25
|
||||
1:00 C-Eur CE%sT 1943 Oct 25
|
||||
3:00 Russia MSK/MSD 1991 Mar 31 2:00
|
||||
2:00 E-Eur EE%sT 1995
|
||||
2:00 E-Eur EE%sT 1992 Mar 20
|
||||
2:00 C-Eur EE%sT 1996 May 13
|
||||
2:00 EU EE%sT
|
||||
|
||||
# Vatican City
|
||||
|
||||
@@ -95,11 +95,11 @@ Leap 2016 Dec 31 23:59:60 + S
|
||||
# Any additional leap seconds will come after this.
|
||||
# This Expires line is commented out for now,
|
||||
# so that pre-2020a zic implementations do not reject this file.
|
||||
#Expires 2022 Jun 28 00:00:00
|
||||
#Expires 2022 Dec 28 00:00:00
|
||||
|
||||
# POSIX timestamps for the data in this file:
|
||||
#updated 1467936000 (2016-07-08 00:00:00 UTC)
|
||||
#expires 1656374400 (2022-06-28 00:00:00 UTC)
|
||||
#expires 1672185600 (2022-12-28 00:00:00 UTC)
|
||||
|
||||
# Updated through IERS Bulletin C62
|
||||
# File expires on: 28 June 2022
|
||||
# Updated through IERS Bulletin C63
|
||||
# File expires on: 28 December 2022
|
||||
|
||||
@@ -1109,7 +1109,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
|
||||
|
||||
# Chile
|
||||
|
||||
# From Paul Eggert (2015-04-03):
|
||||
# From Paul Eggert (2022-03-15):
|
||||
# Shanks & Pottenger says America/Santiago introduced standard time in
|
||||
# 1890 and rounds its UT offset to 70W40; guess that in practice this
|
||||
# was the same offset as in 1916-1919. It also says Pacific/Easter
|
||||
@@ -1132,7 +1132,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
|
||||
# Historia de la hora oficial de Chile (retrieved 2012-10-24). See:
|
||||
# https://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
|
||||
# A fancier Spanish version (requiring mouse-clicking) is at:
|
||||
# http://www.horaoficial.cl/historia_hora.html
|
||||
# http://www.horaoficial.cl/historia_hora.php
|
||||
# Conflicts between [1] and [2] were resolved as follows:
|
||||
#
|
||||
# - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites
|
||||
@@ -1141,7 +1141,8 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
|
||||
# - [1] says SMT was -4:42:45, [2] says Chile's official time from
|
||||
# 1916 to 1919 was -4:42:46.3, the meridian of Chile's National
|
||||
# Astronomical Observatory (OAN), then located in what is now
|
||||
# Quinta Normal in Santiago. Go with [2], rounding it to -4:42:46.
|
||||
# Quinta Normal in Santiago. Go with [1], as this matches the meridian
|
||||
# referred to by the relevant Chilean laws to this day.
|
||||
#
|
||||
# - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites
|
||||
# Boletín No. 22, Aviso No. 129/1918 (1918-08-23). Go with [2].
|
||||
@@ -1163,6 +1164,32 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
|
||||
# this is known to work for DST transitions starting in 2008 and
|
||||
# may well be true for earlier transitions.
|
||||
|
||||
# From Tim Parenti (2022-03-15):
|
||||
# For a brief period of roughly six weeks in 1946, DST was only observed on an
|
||||
# emergency basis in specific regions of central Chile; namely, "the national
|
||||
# territory between the provinces of Coquimbo and Concepción, inclusive".
|
||||
# This was enacted by Decree 3,891, dated 1946-07-13, and took effect
|
||||
# 1946-07-14 24:00, advancing these central regions to -03.
|
||||
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460715/#page/1
|
||||
# The decree contemplated "[t]hat this advancement of the Official Time, even
|
||||
# though it has been proposed for the cities of Santiago and Valparaíso only,
|
||||
# must be agreed with that of other cities, due to the connection of various
|
||||
# activities that require it, such as, for example, the operation of rail
|
||||
# services". It was originally set to expire after 30 days but was extended
|
||||
# through 1946-08-31 by Decree 4,506, dated 1946-08-13.
|
||||
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460814/#page/1
|
||||
#
|
||||
# Law Number 8,522, promulgated 1946-08-27, reunified Chilean clocks at their
|
||||
# new "Summer Time" of -04, reckoned as that of "the meridian of the
|
||||
# Astronomical Observatory of Lo Espejo, advanced by 42 minutes and 45
|
||||
# seconds".
|
||||
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460828/#page/1
|
||||
# After a brief "Winter Time" stint at -05 beginning 1947-04-01, Law Number
|
||||
# 8,777, promulgated 1947-05-17, established year-round -04 "from 23:00 on the
|
||||
# second day after it is published in the 'Diario Oficial'." It was published
|
||||
# on Monday 1947-05-19 and so took effect from Wednesday 1947-05-21 23:00.
|
||||
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19470519/#page/1
|
||||
|
||||
# From Eduardo Krell (1995-10-19):
|
||||
# The law says to switch to DST at midnight [24:00] on the second SATURDAY
|
||||
# of October.... The law is the same for March and October.
|
||||
@@ -1321,12 +1348,12 @@ Rule Chile 2019 max - Sep Sun>=2 4:00u 1:00 -
|
||||
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
|
||||
# (1996-09) says 1998-03-08. Ignore these.
|
||||
# Zone NAME STDOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Santiago -4:42:46 - LMT 1890
|
||||
-4:42:46 - SMT 1910 Jan 10 # Santiago Mean Time
|
||||
Zone America/Santiago -4:42:45 - LMT 1890
|
||||
-4:42:45 - SMT 1910 Jan 10 # Santiago Mean Time
|
||||
-5:00 - -05 1916 Jul 1
|
||||
-4:42:46 - SMT 1918 Sep 10
|
||||
-4:42:45 - SMT 1918 Sep 10
|
||||
-4:00 - -04 1919 Jul 1
|
||||
-4:42:46 - SMT 1927 Sep 1
|
||||
-4:42:45 - SMT 1927 Sep 1
|
||||
-5:00 Chile -05/-04 1932 Sep 1
|
||||
-4:00 - -04 1942 Jun 1
|
||||
-5:00 - -05 1942 Aug 1
|
||||
@@ -1336,11 +1363,11 @@ Zone America/Santiago -4:42:46 - LMT 1890
|
||||
-5:00 - -05 1947 May 21 23:00
|
||||
-4:00 Chile -04/-03
|
||||
Zone America/Punta_Arenas -4:43:40 - LMT 1890
|
||||
-4:42:46 - SMT 1910 Jan 10
|
||||
-4:42:45 - SMT 1910 Jan 10
|
||||
-5:00 - -05 1916 Jul 1
|
||||
-4:42:46 - SMT 1918 Sep 10
|
||||
-4:42:45 - SMT 1918 Sep 10
|
||||
-4:00 - -04 1919 Jul 1
|
||||
-4:42:46 - SMT 1927 Sep 1
|
||||
-4:42:45 - SMT 1927 Sep 1
|
||||
-5:00 Chile -05/-04 1932 Sep 1
|
||||
-4:00 - -04 1942 Jun 1
|
||||
-5:00 - -05 1942 Aug 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -149,13 +149,6 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
)))
|
||||
endif
|
||||
|
||||
ifeq ($(HOTSPOT_TARGET_CPU_ARCH), riscv)
|
||||
AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
|
||||
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/$(HOTSPOT_TARGET_CPU_ARCH)_v.ad \
|
||||
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/$(HOTSPOT_TARGET_CPU_ARCH)_b.ad \
|
||||
)))
|
||||
endif
|
||||
|
||||
ifeq ($(call check-jvm-feature, shenandoahgc), true)
|
||||
AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
|
||||
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/shenandoah/shenandoah_$(HOTSPOT_TARGET_CPU).ad \
|
||||
|
||||
@@ -471,7 +471,6 @@ else
|
||||
|
||||
endif
|
||||
|
||||
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
|
||||
libharfbuzz \
|
||||
common/awt \
|
||||
@@ -486,6 +485,14 @@ BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
|
||||
|
||||
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
|
||||
|
||||
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
# gcc (and to an extent clang) is particularly bad at optimizing these files,
|
||||
# causing a massive spike in compile time. We don't care about these
|
||||
# particular files anyway, so lower optimization level.
|
||||
BUILD_LIBFONTMANAGER_hb-subset.cc_OPTIMIZATION := SIZE
|
||||
BUILD_LIBFONTMANAGER_hb-subset-plan.cc_OPTIMIZATION := SIZE
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
|
||||
X11TextRenderer.c
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, 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,10 +29,16 @@ include LibCommon.gmk
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
CFLAGS_LIBDT_SHMEM := $(CFLAGS_JDKLIB)
|
||||
|
||||
ifneq ($(HOTSPOT_BUILD_TIME), )
|
||||
CFLAGS_LIBDT_SHMEM += -DSHMEM_BUILD_TIME='"$(HOTSPOT_BUILD_TIME)"'
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
|
||||
NAME := dt_shmem, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
CFLAGS := $(CFLAGS_LIBDT_SHMEM), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
jdk.jdwp.agent:include \
|
||||
jdk.jdwp.agent:libjdwp/export, \
|
||||
|
||||
@@ -147,14 +147,13 @@ function import_path() {
|
||||
if [[ "$path" != "" ]]; then
|
||||
# Store current unix path
|
||||
unixpath="$path"
|
||||
# Now turn it into a windows path
|
||||
winpath="$($PATHTOOL -w "$path" 2>/dev/null)"
|
||||
# If it fails, try again with an added .exe (needed on WSL)
|
||||
if [[ $? -ne 0 ]]; then
|
||||
# If $unixpath does not exist, add .exe (needed on WSL)
|
||||
if [[ ! -e "$unixpath" ]]; then
|
||||
unixpath="$unixpath.exe"
|
||||
winpath="$($PATHTOOL -w "$unixpath" 2>/dev/null)"
|
||||
fi
|
||||
if [[ $? -eq 0 ]]; then
|
||||
# Now turn it into a windows path
|
||||
winpath="$($PATHTOOL -w "$unixpath" 2>/dev/null)"
|
||||
if [[ $? -eq 0 && -e "$unixpath" ]]; then
|
||||
if [[ ! "$winpath" =~ ^"$ENVROOT"\\.*$ ]] ; then
|
||||
# If it is not in envroot, it's a generic windows path
|
||||
if [[ ! $winpath =~ ^[-_.:\\a-zA-Z0-9]*$ ]] ; then
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -1590,9 +1590,7 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
|
||||
}
|
||||
|
||||
|
||||
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
|
||||
LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
|
||||
assert(cmp_opr1 == LIR_OprFact::illegalOpr && cmp_opr2 == LIR_OprFact::illegalOpr, "unnecessary cmp oprs on aarch64");
|
||||
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
|
||||
|
||||
Assembler::Condition acond, ncond;
|
||||
switch (condition) {
|
||||
|
||||
@@ -34,6 +34,14 @@
|
||||
return "";
|
||||
}
|
||||
|
||||
// Returns address of n-th instruction preceding addr,
|
||||
// NULL if no preceding instruction can be found.
|
||||
// On ARM(aarch64), we assume a constant instruction length.
|
||||
// It might be beneficial to check "is_readable" as we do on ppc and s390.
|
||||
static address find_prev_instr(address addr, int n_instr) {
|
||||
return addr - Assembler::instruction_size*n_instr;
|
||||
}
|
||||
|
||||
// special-case instruction decoding.
|
||||
// There may be cases where the binutils disassembler doesn't do
|
||||
// the perfect job. In those cases, decode_instruction0 may kick in
|
||||
|
||||
@@ -129,8 +129,17 @@ static inline uint32_t uimm(uint32_t val, int hi, int lo)
|
||||
|
||||
uint64_t replicate(uint64_t bits, int nbits, int count)
|
||||
{
|
||||
assert(count > 0, "must be");
|
||||
assert(nbits > 0, "must be");
|
||||
assert(count * nbits <= 64, "must be");
|
||||
|
||||
// Special case nbits == 64 since the shift below with that nbits value
|
||||
// would result in undefined behavior.
|
||||
if (nbits == 64) {
|
||||
return bits;
|
||||
}
|
||||
|
||||
uint64_t result = 0;
|
||||
// nbits may be 64 in which case we want mask to be -1
|
||||
uint64_t mask = ones(nbits);
|
||||
for (int i = 0; i < count ; i++) {
|
||||
result <<= nbits;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2022, Red Hat Inc. 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
|
||||
@@ -5103,18 +5103,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return entry;
|
||||
}
|
||||
|
||||
// code for comparing 16 bytes of strings with same encoding
|
||||
void compare_string_16_bytes_same(Label &DIFF1, Label &DIFF2) {
|
||||
Register result = r0, str1 = r1, cnt1 = r2, str2 = r3, tmp1 = r10, tmp2 = r11;
|
||||
__ ldr(rscratch1, Address(__ post(str1, 8)));
|
||||
__ eor(rscratch2, tmp1, tmp2);
|
||||
__ ldr(cnt1, Address(__ post(str2, 8)));
|
||||
__ cbnz(rscratch2, DIFF1);
|
||||
__ ldr(tmp1, Address(__ post(str1, 8)));
|
||||
__ eor(rscratch2, rscratch1, cnt1);
|
||||
__ ldr(tmp2, Address(__ post(str2, 8)));
|
||||
__ cbnz(rscratch2, DIFF2);
|
||||
}
|
||||
|
||||
// code for comparing 16 characters of strings with Latin1 and Utf16 encoding
|
||||
void compare_string_16_x_LU(Register tmpL, Register tmpU, Label &DIFF1,
|
||||
@@ -5321,97 +5309,108 @@ class StubGenerator: public StubCodeGenerator {
|
||||
: "compare_long_string_same_encoding UU");
|
||||
address entry = __ pc();
|
||||
Register result = r0, str1 = r1, cnt1 = r2, str2 = r3, cnt2 = r4,
|
||||
tmp1 = r10, tmp2 = r11;
|
||||
Label SMALL_LOOP, LARGE_LOOP_PREFETCH, CHECK_LAST, DIFF2, TAIL,
|
||||
LENGTH_DIFF, DIFF, LAST_CHECK_AND_LENGTH_DIFF,
|
||||
DIFF_LAST_POSITION, DIFF_LAST_POSITION2;
|
||||
tmp1 = r10, tmp2 = r11, tmp1h = rscratch1, tmp2h = rscratch2;
|
||||
|
||||
Label LARGE_LOOP_PREFETCH, LOOP_COMPARE16, DIFF, LESS16, LESS8, CAL_DIFFERENCE, LENGTH_DIFF;
|
||||
|
||||
// exit from large loop when less than 64 bytes left to read or we're about
|
||||
// to prefetch memory behind array border
|
||||
int largeLoopExitCondition = MAX2(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2);
|
||||
// cnt1/cnt2 contains amount of characters to compare. cnt1 can be re-used
|
||||
// update cnt2 counter with already loaded 8 bytes
|
||||
|
||||
// before jumping to stub, pre-load 8 bytes already, so do comparison directly
|
||||
__ eor(rscratch2, tmp1, tmp2);
|
||||
__ cbnz(rscratch2, CAL_DIFFERENCE);
|
||||
|
||||
__ sub(cnt2, cnt2, wordSize/(isLL ? 1 : 2));
|
||||
// update pointers, because of previous read
|
||||
__ add(str1, str1, wordSize);
|
||||
__ add(str2, str2, wordSize);
|
||||
if (SoftwarePrefetchHintDistance >= 0) {
|
||||
__ align(OptoLoopAlignment);
|
||||
__ bind(LARGE_LOOP_PREFETCH);
|
||||
__ prfm(Address(str1, SoftwarePrefetchHintDistance));
|
||||
__ prfm(Address(str2, SoftwarePrefetchHintDistance));
|
||||
compare_string_16_bytes_same(DIFF, DIFF2);
|
||||
compare_string_16_bytes_same(DIFF, DIFF2);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
__ ldp(tmp1, tmp1h, Address(str1, i * 16));
|
||||
__ ldp(tmp2, tmp2h, Address(str2, i * 16));
|
||||
__ cmp(tmp1, tmp2);
|
||||
__ ccmp(tmp1h, tmp2h, 0, Assembler::EQ);
|
||||
__ br(Assembler::NE, DIFF);
|
||||
}
|
||||
__ sub(cnt2, cnt2, isLL ? 64 : 32);
|
||||
compare_string_16_bytes_same(DIFF, DIFF2);
|
||||
__ add(str1, str1, 64);
|
||||
__ add(str2, str2, 64);
|
||||
__ subs(rscratch2, cnt2, largeLoopExitCondition);
|
||||
compare_string_16_bytes_same(DIFF, DIFF2);
|
||||
__ br(__ GT, LARGE_LOOP_PREFETCH);
|
||||
__ cbz(cnt2, LAST_CHECK_AND_LENGTH_DIFF); // no more chars left?
|
||||
__ br(Assembler::GE, LARGE_LOOP_PREFETCH);
|
||||
__ cbz(cnt2, LENGTH_DIFF); // no more chars left?
|
||||
}
|
||||
// less than 16 bytes left?
|
||||
__ subs(cnt2, cnt2, isLL ? 16 : 8);
|
||||
__ br(__ LT, TAIL);
|
||||
|
||||
__ subs(rscratch1, cnt2, isLL ? 16 : 8);
|
||||
__ br(Assembler::LE, LESS16);
|
||||
__ align(OptoLoopAlignment);
|
||||
__ bind(SMALL_LOOP);
|
||||
compare_string_16_bytes_same(DIFF, DIFF2);
|
||||
__ subs(cnt2, cnt2, isLL ? 16 : 8);
|
||||
__ br(__ GE, SMALL_LOOP);
|
||||
__ bind(TAIL);
|
||||
__ adds(cnt2, cnt2, isLL ? 16 : 8);
|
||||
__ br(__ EQ, LAST_CHECK_AND_LENGTH_DIFF);
|
||||
__ bind(LOOP_COMPARE16);
|
||||
__ ldp(tmp1, tmp1h, Address(__ post(str1, 16)));
|
||||
__ ldp(tmp2, tmp2h, Address(__ post(str2, 16)));
|
||||
__ cmp(tmp1, tmp2);
|
||||
__ ccmp(tmp1h, tmp2h, 0, Assembler::EQ);
|
||||
__ br(Assembler::NE, DIFF);
|
||||
__ sub(cnt2, cnt2, isLL ? 16 : 8);
|
||||
__ subs(rscratch2, cnt2, isLL ? 16 : 8);
|
||||
__ br(Assembler::LT, LESS16);
|
||||
|
||||
__ ldp(tmp1, tmp1h, Address(__ post(str1, 16)));
|
||||
__ ldp(tmp2, tmp2h, Address(__ post(str2, 16)));
|
||||
__ cmp(tmp1, tmp2);
|
||||
__ ccmp(tmp1h, tmp2h, 0, Assembler::EQ);
|
||||
__ br(Assembler::NE, DIFF);
|
||||
__ sub(cnt2, cnt2, isLL ? 16 : 8);
|
||||
__ subs(rscratch2, cnt2, isLL ? 16 : 8);
|
||||
__ br(Assembler::GE, LOOP_COMPARE16);
|
||||
__ cbz(cnt2, LENGTH_DIFF);
|
||||
|
||||
__ bind(LESS16);
|
||||
// each 8 compare
|
||||
__ subs(cnt2, cnt2, isLL ? 8 : 4);
|
||||
__ br(__ LE, CHECK_LAST);
|
||||
__ eor(rscratch2, tmp1, tmp2);
|
||||
__ cbnz(rscratch2, DIFF);
|
||||
__ br(Assembler::LE, LESS8);
|
||||
__ ldr(tmp1, Address(__ post(str1, 8)));
|
||||
__ ldr(tmp2, Address(__ post(str2, 8)));
|
||||
__ sub(cnt2, cnt2, isLL ? 8 : 4);
|
||||
__ bind(CHECK_LAST);
|
||||
if (!isLL) {
|
||||
__ add(cnt2, cnt2, cnt2); // now in bytes
|
||||
}
|
||||
__ eor(rscratch2, tmp1, tmp2);
|
||||
__ cbnz(rscratch2, DIFF);
|
||||
__ ldr(rscratch1, Address(str1, cnt2));
|
||||
__ ldr(cnt1, Address(str2, cnt2));
|
||||
__ eor(rscratch2, rscratch1, cnt1);
|
||||
__ cbz(rscratch2, LENGTH_DIFF);
|
||||
// Find the first different characters in the longwords and
|
||||
// compute their difference.
|
||||
__ bind(DIFF2);
|
||||
__ rev(rscratch2, rscratch2);
|
||||
__ clz(rscratch2, rscratch2);
|
||||
__ andr(rscratch2, rscratch2, isLL ? -8 : -16);
|
||||
__ lsrv(rscratch1, rscratch1, rscratch2);
|
||||
if (isLL) {
|
||||
__ lsrv(cnt1, cnt1, rscratch2);
|
||||
__ uxtbw(rscratch1, rscratch1);
|
||||
__ uxtbw(cnt1, cnt1);
|
||||
} else {
|
||||
__ lsrv(cnt1, cnt1, rscratch2);
|
||||
__ uxthw(rscratch1, rscratch1);
|
||||
__ uxthw(cnt1, cnt1);
|
||||
__ cbnz(rscratch2, CAL_DIFFERENCE);
|
||||
__ sub(cnt2, cnt2, isLL ? 8 : 4);
|
||||
|
||||
__ bind(LESS8); // directly load last 8 bytes
|
||||
if (!isLL) {
|
||||
__ add(cnt2, cnt2, cnt2);
|
||||
}
|
||||
__ subw(result, rscratch1, cnt1);
|
||||
__ b(LENGTH_DIFF);
|
||||
__ ldr(tmp1, Address(str1, cnt2));
|
||||
__ ldr(tmp2, Address(str2, cnt2));
|
||||
__ eor(rscratch2, tmp1, tmp2);
|
||||
__ cbz(rscratch2, LENGTH_DIFF);
|
||||
__ b(CAL_DIFFERENCE);
|
||||
|
||||
__ bind(DIFF);
|
||||
__ cmp(tmp1, tmp2);
|
||||
__ csel(tmp1, tmp1, tmp1h, Assembler::NE);
|
||||
__ csel(tmp2, tmp2, tmp2h, Assembler::NE);
|
||||
// reuse rscratch2 register for the result of eor instruction
|
||||
__ eor(rscratch2, tmp1, tmp2);
|
||||
|
||||
__ bind(CAL_DIFFERENCE);
|
||||
__ rev(rscratch2, rscratch2);
|
||||
__ clz(rscratch2, rscratch2);
|
||||
__ andr(rscratch2, rscratch2, isLL ? -8 : -16);
|
||||
__ lsrv(tmp1, tmp1, rscratch2);
|
||||
__ lsrv(tmp2, tmp2, rscratch2);
|
||||
if (isLL) {
|
||||
__ lsrv(tmp2, tmp2, rscratch2);
|
||||
__ uxtbw(tmp1, tmp1);
|
||||
__ uxtbw(tmp2, tmp2);
|
||||
} else {
|
||||
__ lsrv(tmp2, tmp2, rscratch2);
|
||||
__ uxthw(tmp1, tmp1);
|
||||
__ uxthw(tmp2, tmp2);
|
||||
}
|
||||
__ subw(result, tmp1, tmp2);
|
||||
__ b(LENGTH_DIFF);
|
||||
__ bind(LAST_CHECK_AND_LENGTH_DIFF);
|
||||
__ eor(rscratch2, tmp1, tmp2);
|
||||
__ cbnz(rscratch2, DIFF);
|
||||
|
||||
__ bind(LENGTH_DIFF);
|
||||
__ ret(lr);
|
||||
return entry;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -1417,10 +1417,7 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
|
||||
}
|
||||
|
||||
|
||||
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
|
||||
LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
|
||||
assert(cmp_opr1 == LIR_OprFact::illegalOpr && cmp_opr2 == LIR_OprFact::illegalOpr, "unnecessary cmp oprs on arm");
|
||||
|
||||
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
|
||||
AsmCondition acond = al;
|
||||
AsmCondition ncond = nv;
|
||||
if (opr1 != opr2) {
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
return "";
|
||||
}
|
||||
|
||||
// Returns address of n-th instruction preceding addr,
|
||||
// NULL if no preceding instruction can be found.
|
||||
// On ARM, we assume a constant instruction length.
|
||||
// It might be beneficial to check "is_readable" as we do on ppc and s390.
|
||||
static address find_prev_instr(address addr, int n_instr) {
|
||||
return addr - Assembler::InstructionSize*n_instr;
|
||||
}
|
||||
|
||||
// special-case instruction decoding.
|
||||
// There may be cases where the binutils disassembler doesn't do
|
||||
// the perfect job. In those cases, decode_instruction0 may kick in
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -1554,10 +1554,8 @@ inline void load_to_reg(LIR_Assembler *lasm, LIR_Opr src, LIR_Opr dst) {
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
|
||||
LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
|
||||
assert(cmp_opr1 == LIR_OprFact::illegalOpr && cmp_opr2 == LIR_OprFact::illegalOpr, "unnecessary cmp oprs on ppc");
|
||||
|
||||
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
|
||||
if (opr1->is_equal(opr2) || opr1->is_same_register(opr2)) {
|
||||
load_to_reg(this, opr1, result); // Condition doesn't matter.
|
||||
return;
|
||||
|
||||
@@ -87,6 +87,22 @@
|
||||
} \
|
||||
}
|
||||
|
||||
address Disassembler::find_prev_instr(address here, int n_instr) {
|
||||
if (!os::is_readable_pointer(here)) return NULL; // obviously a bad location to decode
|
||||
|
||||
// Find most distant possible starting point.
|
||||
// Narrow down because we don't want to SEGV while printing.
|
||||
address start = here - n_instr*Assembler::instr_maxlen(); // starting point can't be further away.
|
||||
while ((start < here) && !os::is_readable_range(start, here)) {
|
||||
start = align_down(start, os::min_page_size()) + os::min_page_size();
|
||||
}
|
||||
if (start >= here) {
|
||||
// Strange. Can only happen with here on page boundary.
|
||||
return NULL;
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
address Disassembler::decode_instruction0(address here, outputStream * st, address virtual_begin ) {
|
||||
if (is_abstract()) {
|
||||
// The disassembler library was not loaded (yet),
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
return "ppc64";
|
||||
}
|
||||
|
||||
// Find preceding instruction.
|
||||
//
|
||||
// Starting at the passed location, the n-th preceding (towards lower addresses)
|
||||
// location is searched, the contents of which - if interpreted as
|
||||
// instructions - has the passed location as n-th successor.
|
||||
// - If no such location exists, NULL is returned. The caller should then
|
||||
// terminate its search and react properly.
|
||||
static address find_prev_instr(address here, int n_instr);
|
||||
|
||||
// special-case instruction decoding.
|
||||
// There may be cases where the binutils disassembler doesn't do
|
||||
// the perfect job. In those cases, decode_instruction0 may kick in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2022 SAP SE. 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
|
||||
@@ -2942,16 +2942,17 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register
|
||||
|
||||
// Store a non-null value into the box.
|
||||
std(box, BasicLock::displaced_header_offset_in_bytes(), box);
|
||||
beq(flag, cont);
|
||||
|
||||
# ifdef ASSERT
|
||||
// Check for recursive locking.
|
||||
cmpd(flag, current_header, R16_thread);
|
||||
bne(flag, cont);
|
||||
// We have acquired the monitor, check some invariants.
|
||||
addi(/*monitor=*/temp, temp, -ObjectMonitor::owner_offset_in_bytes());
|
||||
// Invariant 1: _recursions should be 0.
|
||||
//assert(ObjectMonitor::recursions_size_in_bytes() == 8, "unexpected size");
|
||||
asm_assert_mem8_is_zero(ObjectMonitor::recursions_offset_in_bytes(), temp,
|
||||
"monitor->_recursions should be 0");
|
||||
# endif
|
||||
|
||||
// Current thread already owns the lock. Just increment recursions.
|
||||
Register recursions = displaced_header;
|
||||
ld(recursions, ObjectMonitor::recursions_offset_in_bytes()-ObjectMonitor::owner_offset_in_bytes(), temp);
|
||||
addi(recursions, recursions, 1);
|
||||
std(recursions, ObjectMonitor::recursions_offset_in_bytes()-ObjectMonitor::owner_offset_in_bytes(), temp);
|
||||
|
||||
#if INCLUDE_RTM_OPT
|
||||
} // use_rtm()
|
||||
@@ -2967,8 +2968,7 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe
|
||||
bool try_bias, bool use_rtm) {
|
||||
assert_different_registers(oop, box, temp, displaced_header, current_header);
|
||||
assert(flag != CCR0, "bad condition register");
|
||||
Label cont;
|
||||
Label object_has_monitor;
|
||||
Label cont, object_has_monitor, notRecursive;
|
||||
|
||||
if (try_bias) {
|
||||
biased_locking_exit(flag, oop, current_header, cont);
|
||||
@@ -3039,11 +3039,16 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe
|
||||
#endif
|
||||
|
||||
ld(displaced_header, ObjectMonitor::recursions_offset_in_bytes(), current_header);
|
||||
xorr(temp, R16_thread, temp); // Will be 0 if we are the owner.
|
||||
orr(temp, temp, displaced_header); // Will be 0 if there are 0 recursions.
|
||||
cmpdi(flag, temp, 0);
|
||||
|
||||
cmpd(flag, temp, R16_thread);
|
||||
bne(flag, cont);
|
||||
|
||||
addic_(displaced_header, displaced_header, -1);
|
||||
blt(CCR0, notRecursive); // Not recursive if negative after decrement.
|
||||
std(displaced_header, ObjectMonitor::recursions_offset_in_bytes(), current_header);
|
||||
b(cont); // flag is already EQ here.
|
||||
|
||||
bind(notRecursive);
|
||||
ld(temp, ObjectMonitor::EntryList_offset_in_bytes(), current_header);
|
||||
ld(displaced_header, ObjectMonitor::cxq_offset_in_bytes(), current_header);
|
||||
orr(temp, temp, displaced_header); // Will be 0 if both are 0.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2022 SAP SE. 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
|
||||
@@ -4616,8 +4616,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
public:
|
||||
StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) {
|
||||
// replace the standard masm with a special one:
|
||||
_masm = new MacroAssembler(code);
|
||||
if (all) {
|
||||
generate_all();
|
||||
} else {
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "oops/constMethod.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
int AbstractInterpreter::BasicType_as_index(BasicType type) {
|
||||
int i = 0;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: i = 0; break;
|
||||
case T_CHAR : i = 1; break;
|
||||
case T_BYTE : i = 2; break;
|
||||
case T_SHORT : i = 3; break;
|
||||
case T_INT : i = 4; break;
|
||||
case T_LONG : i = 5; break;
|
||||
case T_VOID : i = 6; break;
|
||||
case T_FLOAT : i = 7; break;
|
||||
case T_DOUBLE : i = 8; break;
|
||||
case T_OBJECT : i = 9; break;
|
||||
case T_ARRAY : i = 9; break;
|
||||
default : ShouldNotReachHere();
|
||||
}
|
||||
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
|
||||
"index out of bounds");
|
||||
return i;
|
||||
}
|
||||
|
||||
// How much stack a method activation needs in words.
|
||||
int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
|
||||
const int entry_size = frame::interpreter_frame_monitor_size();
|
||||
|
||||
// total overhead size: entry_size + (saved fp thru expr stack
|
||||
// bottom). be sure to change this if you add/subtract anything
|
||||
// to/from the overhead area
|
||||
const int overhead_size =
|
||||
-(frame::interpreter_frame_initial_sp_offset) + entry_size;
|
||||
|
||||
const int stub_code = frame::entry_frame_after_call_words;
|
||||
assert_cond(method != NULL);
|
||||
const int method_stack = (method->max_locals() + method->max_stack()) *
|
||||
Interpreter::stackElementWords;
|
||||
return (overhead_size + method_stack + stub_code);
|
||||
}
|
||||
|
||||
// asm based interpreter deoptimization helpers
|
||||
int AbstractInterpreter::size_activation(int max_stack,
|
||||
int temps,
|
||||
int extra_args,
|
||||
int monitors,
|
||||
int callee_params,
|
||||
int callee_locals,
|
||||
bool is_top_frame) {
|
||||
// Note: This calculation must exactly parallel the frame setup
|
||||
// in TemplateInterpreterGenerator::generate_method_entry.
|
||||
|
||||
// fixed size of an interpreter frame:
|
||||
int overhead = frame::sender_sp_offset -
|
||||
frame::interpreter_frame_initial_sp_offset;
|
||||
// Our locals were accounted for by the caller (or last_frame_adjust
|
||||
// on the transistion) Since the callee parameters already account
|
||||
// for the callee's params we only need to account for the extra
|
||||
// locals.
|
||||
int size = overhead +
|
||||
(callee_locals - callee_params) +
|
||||
monitors * frame::interpreter_frame_monitor_size() +
|
||||
// On the top frame, at all times SP <= ESP, and SP is
|
||||
// 16-aligned. We ensure this by adjusting SP on method
|
||||
// entry and re-entry to allow room for the maximum size of
|
||||
// the expression stack. When we call another method we bump
|
||||
// SP so that no stack space is wasted. So, only on the top
|
||||
// frame do we need to allow max_stack words.
|
||||
(is_top_frame ? max_stack : temps + extra_args);
|
||||
|
||||
// On riscv we always keep the stack pointer 16-aligned, so we
|
||||
// must round up here.
|
||||
size = align_up(size, 2);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
void AbstractInterpreter::layout_activation(Method* method,
|
||||
int tempcount,
|
||||
int popframe_extra_args,
|
||||
int moncount,
|
||||
int caller_actual_parameters,
|
||||
int callee_param_count,
|
||||
int callee_locals,
|
||||
frame* caller,
|
||||
frame* interpreter_frame,
|
||||
bool is_top_frame,
|
||||
bool is_bottom_frame) {
|
||||
// The frame interpreter_frame is guaranteed to be the right size,
|
||||
// as determined by a previous call to the size_activation() method.
|
||||
// It is also guaranteed to be walkable even though it is in a
|
||||
// skeletal state
|
||||
assert_cond(method != NULL && caller != NULL && interpreter_frame != NULL);
|
||||
int max_locals = method->max_locals() * Interpreter::stackElementWords;
|
||||
int extra_locals = (method->max_locals() - method->size_of_parameters()) *
|
||||
Interpreter::stackElementWords;
|
||||
|
||||
#ifdef ASSERT
|
||||
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");
|
||||
#endif
|
||||
|
||||
interpreter_frame->interpreter_frame_set_method(method);
|
||||
// NOTE the difference in using sender_sp and interpreter_frame_sender_sp
|
||||
// interpreter_frame_sender_sp is the original sp of the caller (the unextended_sp)
|
||||
// and sender_sp is fp
|
||||
intptr_t* locals = NULL;
|
||||
if (caller->is_interpreted_frame()) {
|
||||
locals = caller->interpreter_frame_last_sp() + caller_actual_parameters - 1;
|
||||
} else {
|
||||
locals = interpreter_frame->sender_sp() + max_locals - 1;
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
if (caller->is_interpreted_frame()) {
|
||||
assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
|
||||
}
|
||||
#endif
|
||||
|
||||
interpreter_frame->interpreter_frame_set_locals(locals);
|
||||
BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
|
||||
BasicObjectLock* monbot = montop - moncount;
|
||||
interpreter_frame->interpreter_frame_set_monitor_end(monbot);
|
||||
|
||||
// Set last_sp
|
||||
intptr_t* last_sp = (intptr_t*) monbot -
|
||||
tempcount*Interpreter::stackElementWords -
|
||||
popframe_extra_args;
|
||||
interpreter_frame->interpreter_frame_set_last_sp(last_sp);
|
||||
|
||||
// All frames but the initial (oldest) interpreter frame we fill in have
|
||||
// a value for sender_sp that allows walking the stack but isn't
|
||||
// truly correct. Correct the value here.
|
||||
if (extra_locals != 0 &&
|
||||
interpreter_frame->sender_sp() ==
|
||||
interpreter_frame->interpreter_frame_sender_sp()) {
|
||||
interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() +
|
||||
extra_locals);
|
||||
}
|
||||
|
||||
*interpreter_frame->interpreter_frame_cache_addr() =
|
||||
method->constants()->cache();
|
||||
*interpreter_frame->interpreter_frame_mirror_addr() =
|
||||
method->method_holder()->java_mirror();
|
||||
}
|
||||
@@ -1,372 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/assembler.hpp"
|
||||
#include "asm/assembler.inline.hpp"
|
||||
#include "compiler/disassembler.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
|
||||
int AbstractAssembler::code_fill_byte() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Assembler::add(Register Rd, Register Rn, int64_t increment, Register temp) {
|
||||
if (is_imm_in_range(increment, 12, 0)) {
|
||||
addi(Rd, Rn, increment);
|
||||
} else {
|
||||
assert_different_registers(Rn, temp);
|
||||
li(temp, increment);
|
||||
add(Rd, Rn, temp);
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::addw(Register Rd, Register Rn, int64_t increment, Register temp) {
|
||||
if (is_imm_in_range(increment, 12, 0)) {
|
||||
addiw(Rd, Rn, increment);
|
||||
} else {
|
||||
assert_different_registers(Rn, temp);
|
||||
li(temp, increment);
|
||||
addw(Rd, Rn, temp);
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::sub(Register Rd, Register Rn, int64_t decrement, Register temp) {
|
||||
if (is_imm_in_range(-decrement, 12, 0)) {
|
||||
addi(Rd, Rn, -decrement);
|
||||
} else {
|
||||
assert_different_registers(Rn, temp);
|
||||
li(temp, decrement);
|
||||
sub(Rd, Rn, temp);
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::subw(Register Rd, Register Rn, int64_t decrement, Register temp) {
|
||||
if (is_imm_in_range(-decrement, 12, 0)) {
|
||||
addiw(Rd, Rn, -decrement);
|
||||
} else {
|
||||
assert_different_registers(Rn, temp);
|
||||
li(temp, decrement);
|
||||
subw(Rd, Rn, temp);
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::zext_w(Register Rd, Register Rs) {
|
||||
add_uw(Rd, Rs, zr);
|
||||
}
|
||||
|
||||
void Assembler::_li(Register Rd, int64_t imm) {
|
||||
// int64_t is in range 0x8000 0000 0000 0000 ~ 0x7fff ffff ffff ffff
|
||||
int shift = 12;
|
||||
int64_t upper = imm, lower = imm;
|
||||
// Split imm to a lower 12-bit sign-extended part and the remainder,
|
||||
// because addi will sign-extend the lower imm.
|
||||
lower = ((int32_t)imm << 20) >> 20;
|
||||
upper -= lower;
|
||||
|
||||
// Test whether imm is a 32-bit integer.
|
||||
if (!(((imm) & ~(int64_t)0x7fffffff) == 0 ||
|
||||
(((imm) & ~(int64_t)0x7fffffff) == ~(int64_t)0x7fffffff))) {
|
||||
while (((upper >> shift) & 1) == 0) { shift++; }
|
||||
upper >>= shift;
|
||||
li(Rd, upper);
|
||||
slli(Rd, Rd, shift);
|
||||
if (lower != 0) {
|
||||
addi(Rd, Rd, lower);
|
||||
}
|
||||
} else {
|
||||
// 32-bit integer
|
||||
Register hi_Rd = zr;
|
||||
if (upper != 0) {
|
||||
lui(Rd, (int32_t)upper);
|
||||
hi_Rd = Rd;
|
||||
}
|
||||
if (lower != 0 || hi_Rd == zr) {
|
||||
addiw(Rd, hi_Rd, lower);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::li64(Register Rd, int64_t imm) {
|
||||
// Load upper 32 bits. upper = imm[63:32], but if imm[31] == 1 or
|
||||
// (imm[31:28] == 0x7ff && imm[19] == 1), upper = imm[63:32] + 1.
|
||||
int64_t lower = imm & 0xffffffff;
|
||||
lower -= ((lower << 44) >> 44);
|
||||
int64_t tmp_imm = ((uint64_t)(imm & 0xffffffff00000000)) + (uint64_t)lower;
|
||||
int32_t upper = (tmp_imm - (int32_t)lower) >> 32;
|
||||
|
||||
// Load upper 32 bits
|
||||
int64_t up = upper, lo = upper;
|
||||
lo = (lo << 52) >> 52;
|
||||
up -= lo;
|
||||
up = (int32_t)up;
|
||||
lui(Rd, up);
|
||||
addi(Rd, Rd, lo);
|
||||
|
||||
// Load the rest 32 bits.
|
||||
slli(Rd, Rd, 12);
|
||||
addi(Rd, Rd, (int32_t)lower >> 20);
|
||||
slli(Rd, Rd, 12);
|
||||
lower = ((int32_t)imm << 12) >> 20;
|
||||
addi(Rd, Rd, lower);
|
||||
slli(Rd, Rd, 8);
|
||||
lower = imm & 0xff;
|
||||
addi(Rd, Rd, lower);
|
||||
}
|
||||
|
||||
void Assembler::li32(Register Rd, int32_t imm) {
|
||||
// int32_t is in range 0x8000 0000 ~ 0x7fff ffff, and imm[31] is the sign bit
|
||||
int64_t upper = imm, lower = imm;
|
||||
lower = (imm << 20) >> 20;
|
||||
upper -= lower;
|
||||
upper = (int32_t)upper;
|
||||
// lui Rd, imm[31:12] + imm[11]
|
||||
lui(Rd, upper);
|
||||
// use addiw to distinguish li32 to li64
|
||||
addiw(Rd, Rd, lower);
|
||||
}
|
||||
|
||||
#define INSN(NAME, REGISTER) \
|
||||
void Assembler::NAME(const address &dest, Register temp) { \
|
||||
assert_cond(dest != NULL); \
|
||||
int64_t distance = dest - pc(); \
|
||||
if (is_imm_in_range(distance, 20, 1)) { \
|
||||
jal(REGISTER, distance); \
|
||||
} else { \
|
||||
assert(temp != noreg, "temp must not be empty register!"); \
|
||||
int32_t offset = 0; \
|
||||
movptr_with_offset(temp, dest, offset); \
|
||||
jalr(REGISTER, temp, offset); \
|
||||
} \
|
||||
} \
|
||||
void Assembler::NAME(Label &l, Register temp) { \
|
||||
jal(REGISTER, l, temp); \
|
||||
} \
|
||||
|
||||
INSN(j, x0);
|
||||
INSN(jal, x1);
|
||||
|
||||
#undef INSN
|
||||
|
||||
#define INSN(NAME, REGISTER) \
|
||||
void Assembler::NAME(Register Rs) { \
|
||||
jalr(REGISTER, Rs, 0); \
|
||||
}
|
||||
|
||||
INSN(jr, x0);
|
||||
INSN(jalr, x1);
|
||||
|
||||
#undef INSN
|
||||
|
||||
void Assembler::ret() {
|
||||
jalr(x0, x1, 0);
|
||||
}
|
||||
|
||||
#define INSN(NAME, REGISTER) \
|
||||
void Assembler::NAME(const address &dest, Register temp) { \
|
||||
assert_cond(dest != NULL); \
|
||||
assert(temp != noreg, "temp must not be empty register!"); \
|
||||
int64_t distance = dest - pc(); \
|
||||
if (is_offset_in_range(distance, 32)) { \
|
||||
auipc(temp, distance + 0x800); \
|
||||
jalr(REGISTER, temp, ((int32_t)distance << 20) >> 20); \
|
||||
} else { \
|
||||
int32_t offset = 0; \
|
||||
movptr_with_offset(temp, dest, offset); \
|
||||
jalr(REGISTER, temp, offset); \
|
||||
} \
|
||||
}
|
||||
|
||||
INSN(call, x1);
|
||||
INSN(tail, x0);
|
||||
|
||||
#undef INSN
|
||||
|
||||
#define INSN(NAME, REGISTER) \
|
||||
void Assembler::NAME(const Address &adr, Register temp) { \
|
||||
switch (adr.getMode()) { \
|
||||
case Address::literal: { \
|
||||
code_section()->relocate(pc(), adr.rspec()); \
|
||||
NAME(adr.target(), temp); \
|
||||
break; \
|
||||
} \
|
||||
case Address::base_plus_offset: { \
|
||||
int32_t offset = 0; \
|
||||
baseOffset(temp, adr, offset); \
|
||||
jalr(REGISTER, temp, offset); \
|
||||
break; \
|
||||
} \
|
||||
default: \
|
||||
ShouldNotReachHere(); \
|
||||
} \
|
||||
}
|
||||
|
||||
INSN(j, x0);
|
||||
INSN(jal, x1);
|
||||
INSN(call, x1);
|
||||
INSN(tail, x0);
|
||||
|
||||
#undef INSN
|
||||
|
||||
void Assembler::wrap_label(Register r1, Register r2, Label &L, compare_and_branch_insn insn,
|
||||
compare_and_branch_label_insn neg_insn, bool is_far) {
|
||||
if (is_far) {
|
||||
Label done;
|
||||
(this->*neg_insn)(r1, r2, done, /* is_far */ false);
|
||||
j(L);
|
||||
bind(done);
|
||||
} else {
|
||||
if (L.is_bound()) {
|
||||
(this->*insn)(r1, r2, target(L));
|
||||
} else {
|
||||
L.add_patch_at(code(), locator());
|
||||
(this->*insn)(r1, r2, pc());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::wrap_label(Register Rt, Label &L, Register tmp, load_insn_by_temp insn) {
|
||||
if (L.is_bound()) {
|
||||
(this->*insn)(Rt, target(L), tmp);
|
||||
} else {
|
||||
L.add_patch_at(code(), locator());
|
||||
(this->*insn)(Rt, pc(), tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::wrap_label(Register Rt, Label &L, jal_jalr_insn insn) {
|
||||
if (L.is_bound()) {
|
||||
(this->*insn)(Rt, target(L));
|
||||
} else {
|
||||
L.add_patch_at(code(), locator());
|
||||
(this->*insn)(Rt, pc());
|
||||
}
|
||||
}
|
||||
|
||||
void Assembler::movptr_with_offset(Register Rd, address addr, int32_t &offset) {
|
||||
uintptr_t imm64 = (uintptr_t)addr;
|
||||
#ifndef PRODUCT
|
||||
{
|
||||
char buffer[64];
|
||||
snprintf(buffer, sizeof(buffer), "0x%" PRIx64, imm64);
|
||||
block_comment(buffer);
|
||||
}
|
||||
#endif
|
||||
assert(is_unsigned_imm_in_range(imm64, 47, 0) || (imm64 == (uintptr_t)-1),
|
||||
"48-bit overflow in address constant");
|
||||
// Load upper 32 bits
|
||||
int32_t imm = imm64 >> 16;
|
||||
int64_t upper = imm, lower = imm;
|
||||
lower = (lower << 52) >> 52;
|
||||
upper -= lower;
|
||||
upper = (int32_t)upper;
|
||||
lui(Rd, upper);
|
||||
addi(Rd, Rd, lower);
|
||||
|
||||
// Load the rest 16 bits.
|
||||
slli(Rd, Rd, 11);
|
||||
addi(Rd, Rd, (imm64 >> 5) & 0x7ff);
|
||||
slli(Rd, Rd, 5);
|
||||
|
||||
// This offset will be used by following jalr/ld.
|
||||
offset = imm64 & 0x1f;
|
||||
}
|
||||
|
||||
void Assembler::movptr(Register Rd, uintptr_t imm64) {
|
||||
movptr(Rd, (address)imm64);
|
||||
}
|
||||
|
||||
void Assembler::movptr(Register Rd, address addr) {
|
||||
int offset = 0;
|
||||
movptr_with_offset(Rd, addr, offset);
|
||||
addi(Rd, Rd, offset);
|
||||
}
|
||||
|
||||
void Assembler::ifence() {
|
||||
fence_i();
|
||||
if (UseConservativeFence) {
|
||||
fence(ir, ir);
|
||||
}
|
||||
}
|
||||
|
||||
#define INSN(NAME, NEG_INSN) \
|
||||
void Assembler::NAME(Register Rs, Register Rt, const address &dest) { \
|
||||
NEG_INSN(Rt, Rs, dest); \
|
||||
} \
|
||||
void Assembler::NAME(Register Rs, Register Rt, Label &l, bool is_far) { \
|
||||
NEG_INSN(Rt, Rs, l, is_far); \
|
||||
}
|
||||
|
||||
INSN(bgt, blt);
|
||||
INSN(ble, bge);
|
||||
INSN(bgtu, bltu);
|
||||
INSN(bleu, bgeu);
|
||||
#undef INSN
|
||||
|
||||
#undef __
|
||||
|
||||
Address::Address(address target, relocInfo::relocType rtype) : _base(noreg), _offset(0), _mode(literal) {
|
||||
_target = target;
|
||||
switch (rtype) {
|
||||
case relocInfo::oop_type:
|
||||
case relocInfo::metadata_type:
|
||||
// Oops are a special case. Normally they would be their own section
|
||||
// but in cases like icBuffer they are literals in the code stream that
|
||||
// we don't have a section for. We use none so that we get a literal address
|
||||
// which is always patchable.
|
||||
break;
|
||||
case relocInfo::external_word_type:
|
||||
_rspec = external_word_Relocation::spec(target);
|
||||
break;
|
||||
case relocInfo::internal_word_type:
|
||||
_rspec = internal_word_Relocation::spec(target);
|
||||
break;
|
||||
case relocInfo::opt_virtual_call_type:
|
||||
_rspec = opt_virtual_call_Relocation::spec();
|
||||
break;
|
||||
case relocInfo::static_call_type:
|
||||
_rspec = static_call_Relocation::spec();
|
||||
break;
|
||||
case relocInfo::runtime_call_type:
|
||||
_rspec = runtime_call_Relocation::spec();
|
||||
break;
|
||||
case relocInfo::poll_type:
|
||||
case relocInfo::poll_return_type:
|
||||
_rspec = Relocation::spec_simple(rtype);
|
||||
break;
|
||||
case relocInfo::none:
|
||||
_rspec = RelocationHolder::none;
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_ASSEMBLER_RISCV_INLINE_HPP
|
||||
#define CPU_RISCV_ASSEMBLER_RISCV_INLINE_HPP
|
||||
|
||||
#include "asm/assembler.inline.hpp"
|
||||
#include "asm/codeBuffer.hpp"
|
||||
#include "code/codeCache.hpp"
|
||||
|
||||
inline bool is_imm_in_range(long value, unsigned bits, unsigned align_bits) {
|
||||
intx sign_bits = (value >> (bits + align_bits - 1));
|
||||
return ((value & right_n_bits(align_bits)) == 0) && ((sign_bits == 0) || (sign_bits == -1));
|
||||
}
|
||||
|
||||
inline bool is_unsigned_imm_in_range(intx value, unsigned bits, unsigned align_bits) {
|
||||
return (value >= 0) && ((value & right_n_bits(align_bits)) == 0) && ((value >> (align_bits + bits)) == 0);
|
||||
}
|
||||
|
||||
inline bool is_offset_in_range(intx offset, unsigned bits) {
|
||||
return is_imm_in_range(offset, bits, 0);
|
||||
}
|
||||
|
||||
#endif // CPU_RISCV_ASSEMBLER_RISCV_INLINE_HPP
|
||||
@@ -1,167 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2016 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_BYTES_RISCV_HPP
|
||||
#define CPU_RISCV_BYTES_RISCV_HPP
|
||||
|
||||
#include "memory/allStatic.hpp"
|
||||
|
||||
class Bytes: AllStatic {
|
||||
public:
|
||||
// Efficient reading and writing of unaligned unsigned data in platform-specific byte ordering
|
||||
// RISCV needs to check for alignment.
|
||||
|
||||
// Forward declarations of the compiler-dependent implementation
|
||||
static inline u2 swap_u2(u2 x);
|
||||
static inline u4 swap_u4(u4 x);
|
||||
static inline u8 swap_u8(u8 x);
|
||||
|
||||
static inline u2 get_native_u2(address p) {
|
||||
if ((intptr_t(p) & 1) == 0) {
|
||||
return *(u2*)p;
|
||||
} else {
|
||||
return ((u2)(p[1]) << 8) |
|
||||
((u2)(p[0]));
|
||||
}
|
||||
}
|
||||
|
||||
static inline u4 get_native_u4(address p) {
|
||||
switch (intptr_t(p) & 3) {
|
||||
case 0:
|
||||
return *(u4*)p;
|
||||
|
||||
case 2:
|
||||
return ((u4)(((u2*)p)[1]) << 16) |
|
||||
((u4)(((u2*)p)[0]));
|
||||
|
||||
default:
|
||||
return ((u4)(p[3]) << 24) |
|
||||
((u4)(p[2]) << 16) |
|
||||
((u4)(p[1]) << 8) |
|
||||
((u4)(p[0]));
|
||||
}
|
||||
}
|
||||
|
||||
static inline u8 get_native_u8(address p) {
|
||||
switch (intptr_t(p) & 7) {
|
||||
case 0:
|
||||
return *(u8*)p;
|
||||
|
||||
case 4:
|
||||
return ((u8)(((u4*)p)[1]) << 32) |
|
||||
((u8)(((u4*)p)[0]));
|
||||
|
||||
case 2:
|
||||
return ((u8)(((u2*)p)[3]) << 48) |
|
||||
((u8)(((u2*)p)[2]) << 32) |
|
||||
((u8)(((u2*)p)[1]) << 16) |
|
||||
((u8)(((u2*)p)[0]));
|
||||
|
||||
default:
|
||||
return ((u8)(p[7]) << 56) |
|
||||
((u8)(p[6]) << 48) |
|
||||
((u8)(p[5]) << 40) |
|
||||
((u8)(p[4]) << 32) |
|
||||
((u8)(p[3]) << 24) |
|
||||
((u8)(p[2]) << 16) |
|
||||
((u8)(p[1]) << 8) |
|
||||
((u8)(p[0]));
|
||||
}
|
||||
}
|
||||
|
||||
static inline void put_native_u2(address p, u2 x) {
|
||||
if ((intptr_t(p) & 1) == 0) {
|
||||
*(u2*)p = x;
|
||||
} else {
|
||||
p[1] = x >> 8;
|
||||
p[0] = x;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void put_native_u4(address p, u4 x) {
|
||||
switch (intptr_t(p) & 3) {
|
||||
case 0:
|
||||
*(u4*)p = x;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
((u2*)p)[1] = x >> 16;
|
||||
((u2*)p)[0] = x;
|
||||
break;
|
||||
|
||||
default:
|
||||
((u1*)p)[3] = x >> 24;
|
||||
((u1*)p)[2] = x >> 16;
|
||||
((u1*)p)[1] = x >> 8;
|
||||
((u1*)p)[0] = x;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void put_native_u8(address p, u8 x) {
|
||||
switch (intptr_t(p) & 7) {
|
||||
case 0:
|
||||
*(u8*)p = x;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
((u4*)p)[1] = x >> 32;
|
||||
((u4*)p)[0] = x;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
((u2*)p)[3] = x >> 48;
|
||||
((u2*)p)[2] = x >> 32;
|
||||
((u2*)p)[1] = x >> 16;
|
||||
((u2*)p)[0] = x;
|
||||
break;
|
||||
|
||||
default:
|
||||
((u1*)p)[7] = x >> 56;
|
||||
((u1*)p)[6] = x >> 48;
|
||||
((u1*)p)[5] = x >> 40;
|
||||
((u1*)p)[4] = x >> 32;
|
||||
((u1*)p)[3] = x >> 24;
|
||||
((u1*)p)[2] = x >> 16;
|
||||
((u1*)p)[1] = x >> 8;
|
||||
((u1*)p)[0] = x;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Efficient reading and writing of unaligned unsigned data in Java byte ordering (i.e. big-endian ordering)
|
||||
static inline u2 get_Java_u2(address p) { return swap_u2(get_native_u2(p)); }
|
||||
static inline u4 get_Java_u4(address p) { return swap_u4(get_native_u4(p)); }
|
||||
static inline u8 get_Java_u8(address p) { return swap_u8(get_native_u8(p)); }
|
||||
|
||||
static inline void put_Java_u2(address p, u2 x) { put_native_u2(p, swap_u2(x)); }
|
||||
static inline void put_Java_u4(address p, u4 x) { put_native_u4(p, swap_u4(x)); }
|
||||
static inline void put_Java_u8(address p, u8 x) { put_native_u8(p, swap_u8(x)); }
|
||||
};
|
||||
|
||||
#include OS_CPU_HEADER(bytes)
|
||||
|
||||
#endif // CPU_RISCV_BYTES_RISCV_HPP
|
||||
@@ -1,353 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/macroAssembler.inline.hpp"
|
||||
#include "c1/c1_CodeStubs.hpp"
|
||||
#include "c1/c1_FrameMap.hpp"
|
||||
#include "c1/c1_LIRAssembler.hpp"
|
||||
#include "c1/c1_MacroAssembler.hpp"
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "nativeInst_riscv.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "vmreg_riscv.inline.hpp"
|
||||
|
||||
|
||||
#define __ ce->masm()->
|
||||
|
||||
void C1SafepointPollStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
InternalAddress safepoint_pc(__ pc() - __ offset() + safepoint_offset());
|
||||
__ code_section()->relocate(__ pc(), safepoint_pc.rspec());
|
||||
__ la(t0, safepoint_pc.target());
|
||||
__ sd(t0, Address(xthread, JavaThread::saved_exception_pc_offset()));
|
||||
|
||||
assert(SharedRuntime::polling_page_return_handler_blob() != NULL,
|
||||
"polling page return stub not created yet");
|
||||
address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();
|
||||
|
||||
__ far_jump(RuntimeAddress(stub));
|
||||
}
|
||||
|
||||
void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
Metadata *m = _method->as_constant_ptr()->as_metadata();
|
||||
__ mov_metadata(t0, m);
|
||||
ce->store_parameter(t0, 1);
|
||||
ce->store_parameter(_bci, 0);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
__ j(_continuation);
|
||||
}
|
||||
|
||||
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
|
||||
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
|
||||
assert(info != NULL, "must have info");
|
||||
_info = new CodeEmitInfo(info);
|
||||
}
|
||||
|
||||
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
|
||||
: _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
|
||||
assert(info != NULL, "must have info");
|
||||
_info = new CodeEmitInfo(info);
|
||||
}
|
||||
|
||||
void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
|
||||
__ far_call(RuntimeAddress(a));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
debug_only(__ should_not_reach_here());
|
||||
return;
|
||||
}
|
||||
|
||||
if (_index->is_cpu_register()) {
|
||||
__ mv(t0, _index->as_register());
|
||||
} else {
|
||||
__ mv(t0, _index->as_jint());
|
||||
}
|
||||
Runtime1::StubID stub_id;
|
||||
if (_throw_index_out_of_bounds_exception) {
|
||||
stub_id = Runtime1::throw_index_exception_id;
|
||||
} else {
|
||||
assert(_array != NULL, "sanity");
|
||||
__ mv(t1, _array->as_pointer_register());
|
||||
stub_id = Runtime1::throw_range_check_failed_id;
|
||||
}
|
||||
int32_t off = 0;
|
||||
__ la_patchable(ra, RuntimeAddress(Runtime1::entry_for(stub_id)), off);
|
||||
__ jalr(ra, ra, off);
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
debug_only(__ should_not_reach_here());
|
||||
}
|
||||
|
||||
PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
|
||||
_info = new CodeEmitInfo(info);
|
||||
}
|
||||
|
||||
void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
|
||||
__ far_call(RuntimeAddress(a));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
debug_only(__ should_not_reach_here());
|
||||
}
|
||||
|
||||
void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
if (_offset != -1) {
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
}
|
||||
__ bind(_entry);
|
||||
__ far_call(Address(Runtime1::entry_for(Runtime1::throw_div0_exception_id), relocInfo::runtime_call_type));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
#ifdef ASSERT
|
||||
__ should_not_reach_here();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Implementation of NewInstanceStub
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
|
||||
_result = result;
|
||||
_klass = klass;
|
||||
_klass_reg = klass_reg;
|
||||
_info = new CodeEmitInfo(info);
|
||||
assert(stub_id == Runtime1::new_instance_id ||
|
||||
stub_id == Runtime1::fast_new_instance_id ||
|
||||
stub_id == Runtime1::fast_new_instance_init_check_id,
|
||||
"need new_instance id");
|
||||
_stub_id = stub_id;
|
||||
}
|
||||
|
||||
void NewInstanceStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(__ rsp_offset() == 0, "frame size should be fixed");
|
||||
__ bind(_entry);
|
||||
__ mv(x13, _klass_reg->as_register());
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
assert(_result->as_register() == x10, "result must in x10");
|
||||
__ j(_continuation);
|
||||
}
|
||||
|
||||
// Implementation of NewTypeArrayStub
|
||||
NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
|
||||
_klass_reg = klass_reg;
|
||||
_length = length;
|
||||
_result = result;
|
||||
_info = new CodeEmitInfo(info);
|
||||
}
|
||||
|
||||
void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(__ rsp_offset() == 0, "frame size should be fixed");
|
||||
__ bind(_entry);
|
||||
assert(_length->as_register() == x9, "length must in x9");
|
||||
assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
assert(_result->as_register() == x10, "result must in x10");
|
||||
__ j(_continuation);
|
||||
}
|
||||
|
||||
// Implementation of NewObjectArrayStub
|
||||
NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
|
||||
_klass_reg = klass_reg;
|
||||
_result = result;
|
||||
_length = length;
|
||||
_info = new CodeEmitInfo(info);
|
||||
}
|
||||
|
||||
void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(__ rsp_offset() == 0, "frame size should be fixed");
|
||||
__ bind(_entry);
|
||||
assert(_length->as_register() == x9, "length must in x9");
|
||||
assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
assert(_result->as_register() == x10, "result must in x10");
|
||||
__ j(_continuation);
|
||||
}
|
||||
|
||||
// Implementation of MonitorAccessStubs
|
||||
MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
|
||||
: MonitorAccessStub(obj_reg, lock_reg) {
|
||||
_info = new CodeEmitInfo(info);
|
||||
}
|
||||
|
||||
void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(__ rsp_offset() == 0, "frame size should be fixed");
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_obj_reg->as_register(), 1);
|
||||
ce->store_parameter(_lock_reg->as_register(), 0);
|
||||
Runtime1::StubID enter_id;
|
||||
if (ce->compilation()->has_fpu_code()) {
|
||||
enter_id = Runtime1::monitorenter_id;
|
||||
} else {
|
||||
enter_id = Runtime1::monitorenter_nofpu_id;
|
||||
}
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
__ j(_continuation);
|
||||
}
|
||||
|
||||
void MonitorExitStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
if (_compute_lock) {
|
||||
// lock_reg was destroyed by fast unlocking attempt => recompute it
|
||||
ce->monitor_address(_monitor_ix, _lock_reg);
|
||||
}
|
||||
ce->store_parameter(_lock_reg->as_register(), 0);
|
||||
// note: non-blocking leaf routine => no call info needed
|
||||
Runtime1::StubID exit_id;
|
||||
if (ce->compilation()->has_fpu_code()) {
|
||||
exit_id = Runtime1::monitorexit_id;
|
||||
} else {
|
||||
exit_id = Runtime1::monitorexit_nofpu_id;
|
||||
}
|
||||
__ la(ra, _continuation);
|
||||
__ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id)));
|
||||
}
|
||||
|
||||
// Implementation of patching:
|
||||
// - Copy the code at given offset to an inlined buffer (first the bytes, then the number of bytes)
|
||||
// - Replace original code with a call to the stub
|
||||
// At Runtime:
|
||||
// - call to stub, jump to runtime
|
||||
// - in runtime: preserve all registers (rspecially objects, i.e., source and destination object)
|
||||
// - in runtime: after initializing class, restore original code, reexecute instruction
|
||||
|
||||
int PatchingStub::_patch_info_offset = -NativeGeneralJump::instruction_size;
|
||||
|
||||
void PatchingStub::align_patch_site(MacroAssembler* masm) {}
|
||||
|
||||
void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(false, "RISCV should not use C1 runtime patching");
|
||||
}
|
||||
|
||||
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_trap_request, 0);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
DEBUG_ONLY(__ should_not_reach_here());
|
||||
}
|
||||
|
||||
void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
address a = NULL;
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
// Deoptimize, do not throw the exception, because it is probably wrong to do it here.
|
||||
a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
|
||||
} else {
|
||||
a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id);
|
||||
}
|
||||
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
__ bind(_entry);
|
||||
__ far_call(RuntimeAddress(a));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
debug_only(__ should_not_reach_here());
|
||||
}
|
||||
|
||||
void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(__ rsp_offset() == 0, "frame size should be fixed");
|
||||
|
||||
__ bind(_entry);
|
||||
// pass the object in a tmp register because all other registers
|
||||
// must be preserved
|
||||
if (_obj->is_cpu_register()) {
|
||||
__ mv(t0, _obj->as_register());
|
||||
}
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(_stub)), NULL, t1);
|
||||
ce->add_call_info_here(_info);
|
||||
debug_only(__ should_not_reach_here());
|
||||
}
|
||||
|
||||
void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
|
||||
// ---------------slow case: call to native-----------------
|
||||
__ bind(_entry);
|
||||
// Figure out where the args should go
|
||||
// This should really convert the IntrinsicID to the Method* and signature
|
||||
// but I don't know how to do that.
|
||||
const int args_num = 5;
|
||||
VMRegPair args[args_num];
|
||||
BasicType signature[args_num] = { T_OBJECT, T_INT, T_OBJECT, T_INT, T_INT };
|
||||
SharedRuntime::java_calling_convention(signature, args, args_num);
|
||||
|
||||
// push parameters
|
||||
Register r[args_num];
|
||||
r[0] = src()->as_register();
|
||||
r[1] = src_pos()->as_register();
|
||||
r[2] = dst()->as_register();
|
||||
r[3] = dst_pos()->as_register();
|
||||
r[4] = length()->as_register();
|
||||
|
||||
// next registers will get stored on the stack
|
||||
for (int j = 0; j < args_num; j++) {
|
||||
VMReg r_1 = args[j].first();
|
||||
if (r_1->is_stack()) {
|
||||
int st_off = r_1->reg2stack() * wordSize;
|
||||
__ sd(r[j], Address(sp, st_off));
|
||||
} else {
|
||||
assert(r[j] == args[j].first()->as_Register(), "Wrong register for arg");
|
||||
}
|
||||
}
|
||||
|
||||
ce->align_call(lir_static_call);
|
||||
|
||||
ce->emit_static_call_stub();
|
||||
if (ce->compilation()->bailed_out()) {
|
||||
return; // CodeCache is full
|
||||
}
|
||||
Address resolve(SharedRuntime::get_resolve_static_call_stub(),
|
||||
relocInfo::static_call_type);
|
||||
address call = __ trampoline_call(resolve);
|
||||
if (call == NULL) {
|
||||
ce->bailout("trampoline stub overflow");
|
||||
return;
|
||||
}
|
||||
ce->add_call_info_here(info());
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintC1Statistics) {
|
||||
__ la(t1, ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
|
||||
__ add_memory_int32(Address(t1), 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
__ j(_continuation);
|
||||
}
|
||||
|
||||
#undef __
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_DEFS_RISCV_HPP
|
||||
#define CPU_RISCV_C1_DEFS_RISCV_HPP
|
||||
|
||||
// native word offsets from memory address (little endian)
|
||||
enum {
|
||||
pd_lo_word_offset_in_bytes = 0,
|
||||
pd_hi_word_offset_in_bytes = BytesPerWord
|
||||
};
|
||||
|
||||
// explicit rounding operations are required to implement the strictFP mode
|
||||
enum {
|
||||
pd_strict_fp_requires_explicit_rounding = false
|
||||
};
|
||||
|
||||
// registers
|
||||
enum {
|
||||
pd_nof_cpu_regs_frame_map = RegisterImpl::number_of_registers, // number of registers used during code emission
|
||||
pd_nof_fpu_regs_frame_map = FloatRegisterImpl::number_of_registers, // number of float registers used during code emission
|
||||
|
||||
// caller saved
|
||||
pd_nof_caller_save_cpu_regs_frame_map = 13, // number of registers killed by calls
|
||||
pd_nof_caller_save_fpu_regs_frame_map = 32, // number of float registers killed by calls
|
||||
|
||||
pd_first_callee_saved_reg = pd_nof_caller_save_cpu_regs_frame_map,
|
||||
pd_last_callee_saved_reg = 21,
|
||||
|
||||
pd_last_allocatable_cpu_reg = pd_nof_caller_save_cpu_regs_frame_map - 1,
|
||||
|
||||
pd_nof_cpu_regs_reg_alloc
|
||||
= pd_nof_caller_save_cpu_regs_frame_map, // number of registers that are visible to register allocator
|
||||
pd_nof_fpu_regs_reg_alloc = 32, // number of float registers that are visible to register allocator
|
||||
|
||||
pd_nof_cpu_regs_linearscan = 32, // number of registers visible to linear scan
|
||||
pd_nof_fpu_regs_linearscan = pd_nof_fpu_regs_frame_map, // number of float registers visible to linear scan
|
||||
pd_nof_xmm_regs_linearscan = 0, // don't have vector registers
|
||||
|
||||
pd_first_cpu_reg = 0,
|
||||
pd_last_cpu_reg = pd_nof_cpu_regs_reg_alloc - 1,
|
||||
pd_first_byte_reg = 0,
|
||||
pd_last_byte_reg = pd_nof_cpu_regs_reg_alloc - 1,
|
||||
|
||||
pd_first_fpu_reg = pd_nof_cpu_regs_frame_map,
|
||||
pd_last_fpu_reg = pd_first_fpu_reg + 31,
|
||||
|
||||
pd_first_callee_saved_fpu_reg_1 = 8 + pd_first_fpu_reg,
|
||||
pd_last_callee_saved_fpu_reg_1 = 9 + pd_first_fpu_reg,
|
||||
pd_first_callee_saved_fpu_reg_2 = 18 + pd_first_fpu_reg,
|
||||
pd_last_callee_saved_fpu_reg_2 = 27 + pd_first_fpu_reg
|
||||
};
|
||||
|
||||
|
||||
// Encoding of float value in debug info. This is true on x86 where
|
||||
// floats are extended to doubles when stored in the stack, false for
|
||||
// RISCV where floats and doubles are stored in their native form.
|
||||
enum {
|
||||
pd_float_saved_as_double = false
|
||||
};
|
||||
|
||||
#endif // CPU_RISCV_C1_DEFS_RISCV_HPP
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------
|
||||
// FpuStackSim
|
||||
//--------------------------------------------------------
|
||||
|
||||
// No FPU stack on RISCV
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_FPUSTACKSIM_RISCV_HPP
|
||||
#define CPU_RISCV_C1_FPUSTACKSIM_RISCV_HPP
|
||||
|
||||
// No FPU stack on RISCV
|
||||
class FpuStackSim;
|
||||
|
||||
#endif // CPU_RISCV_C1_FPUSTACKSIM_RISCV_HPP
|
||||
@@ -1,388 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "c1/c1_FrameMap.hpp"
|
||||
#include "c1/c1_LIR.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "vmreg_riscv.inline.hpp"
|
||||
|
||||
LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
|
||||
LIR_Opr opr = LIR_OprFact::illegalOpr;
|
||||
VMReg r_1 = reg->first();
|
||||
VMReg r_2 = reg->second();
|
||||
if (r_1->is_stack()) {
|
||||
// Convert stack slot to an SP offset
|
||||
// The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value
|
||||
// so we must add it in here.
|
||||
int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
|
||||
opr = LIR_OprFact::address(new LIR_Address(sp_opr, st_off, type));
|
||||
} else if (r_1->is_Register()) {
|
||||
Register reg1 = r_1->as_Register();
|
||||
if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
|
||||
Register reg2 = r_2->as_Register();
|
||||
assert(reg2 == reg1, "must be same register");
|
||||
opr = as_long_opr(reg1);
|
||||
} else if (is_reference_type(type)) {
|
||||
opr = as_oop_opr(reg1);
|
||||
} else if (type == T_METADATA) {
|
||||
opr = as_metadata_opr(reg1);
|
||||
} else if (type == T_ADDRESS) {
|
||||
opr = as_address_opr(reg1);
|
||||
} else {
|
||||
opr = as_opr(reg1);
|
||||
}
|
||||
} else if (r_1->is_FloatRegister()) {
|
||||
assert(type == T_DOUBLE || type == T_FLOAT, "wrong type");
|
||||
int num = r_1->as_FloatRegister()->encoding();
|
||||
if (type == T_FLOAT) {
|
||||
opr = LIR_OprFact::single_fpu(num);
|
||||
} else {
|
||||
opr = LIR_OprFact::double_fpu(num);
|
||||
}
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
return opr;
|
||||
}
|
||||
|
||||
LIR_Opr FrameMap::zr_opr;
|
||||
LIR_Opr FrameMap::r1_opr;
|
||||
LIR_Opr FrameMap::r2_opr;
|
||||
LIR_Opr FrameMap::r3_opr;
|
||||
LIR_Opr FrameMap::r4_opr;
|
||||
LIR_Opr FrameMap::r5_opr;
|
||||
LIR_Opr FrameMap::r6_opr;
|
||||
LIR_Opr FrameMap::r7_opr;
|
||||
LIR_Opr FrameMap::r8_opr;
|
||||
LIR_Opr FrameMap::r9_opr;
|
||||
LIR_Opr FrameMap::r10_opr;
|
||||
LIR_Opr FrameMap::r11_opr;
|
||||
LIR_Opr FrameMap::r12_opr;
|
||||
LIR_Opr FrameMap::r13_opr;
|
||||
LIR_Opr FrameMap::r14_opr;
|
||||
LIR_Opr FrameMap::r15_opr;
|
||||
LIR_Opr FrameMap::r16_opr;
|
||||
LIR_Opr FrameMap::r17_opr;
|
||||
LIR_Opr FrameMap::r18_opr;
|
||||
LIR_Opr FrameMap::r19_opr;
|
||||
LIR_Opr FrameMap::r20_opr;
|
||||
LIR_Opr FrameMap::r21_opr;
|
||||
LIR_Opr FrameMap::r22_opr;
|
||||
LIR_Opr FrameMap::r23_opr;
|
||||
LIR_Opr FrameMap::r24_opr;
|
||||
LIR_Opr FrameMap::r25_opr;
|
||||
LIR_Opr FrameMap::r26_opr;
|
||||
LIR_Opr FrameMap::r27_opr;
|
||||
LIR_Opr FrameMap::r28_opr;
|
||||
LIR_Opr FrameMap::r29_opr;
|
||||
LIR_Opr FrameMap::r30_opr;
|
||||
LIR_Opr FrameMap::r31_opr;
|
||||
|
||||
LIR_Opr FrameMap::fp_opr;
|
||||
LIR_Opr FrameMap::sp_opr;
|
||||
|
||||
LIR_Opr FrameMap::receiver_opr;
|
||||
|
||||
LIR_Opr FrameMap::zr_oop_opr;
|
||||
LIR_Opr FrameMap::r1_oop_opr;
|
||||
LIR_Opr FrameMap::r2_oop_opr;
|
||||
LIR_Opr FrameMap::r3_oop_opr;
|
||||
LIR_Opr FrameMap::r4_oop_opr;
|
||||
LIR_Opr FrameMap::r5_oop_opr;
|
||||
LIR_Opr FrameMap::r6_oop_opr;
|
||||
LIR_Opr FrameMap::r7_oop_opr;
|
||||
LIR_Opr FrameMap::r8_oop_opr;
|
||||
LIR_Opr FrameMap::r9_oop_opr;
|
||||
LIR_Opr FrameMap::r10_oop_opr;
|
||||
LIR_Opr FrameMap::r11_oop_opr;
|
||||
LIR_Opr FrameMap::r12_oop_opr;
|
||||
LIR_Opr FrameMap::r13_oop_opr;
|
||||
LIR_Opr FrameMap::r14_oop_opr;
|
||||
LIR_Opr FrameMap::r15_oop_opr;
|
||||
LIR_Opr FrameMap::r16_oop_opr;
|
||||
LIR_Opr FrameMap::r17_oop_opr;
|
||||
LIR_Opr FrameMap::r18_oop_opr;
|
||||
LIR_Opr FrameMap::r19_oop_opr;
|
||||
LIR_Opr FrameMap::r20_oop_opr;
|
||||
LIR_Opr FrameMap::r21_oop_opr;
|
||||
LIR_Opr FrameMap::r22_oop_opr;
|
||||
LIR_Opr FrameMap::r23_oop_opr;
|
||||
LIR_Opr FrameMap::r24_oop_opr;
|
||||
LIR_Opr FrameMap::r25_oop_opr;
|
||||
LIR_Opr FrameMap::r26_oop_opr;
|
||||
LIR_Opr FrameMap::r27_oop_opr;
|
||||
LIR_Opr FrameMap::r28_oop_opr;
|
||||
LIR_Opr FrameMap::r29_oop_opr;
|
||||
LIR_Opr FrameMap::r30_oop_opr;
|
||||
LIR_Opr FrameMap::r31_oop_opr;
|
||||
|
||||
LIR_Opr FrameMap::t0_opr;
|
||||
LIR_Opr FrameMap::t1_opr;
|
||||
LIR_Opr FrameMap::t0_long_opr;
|
||||
LIR_Opr FrameMap::t1_long_opr;
|
||||
|
||||
LIR_Opr FrameMap::r10_metadata_opr;
|
||||
LIR_Opr FrameMap::r11_metadata_opr;
|
||||
LIR_Opr FrameMap::r12_metadata_opr;
|
||||
LIR_Opr FrameMap::r13_metadata_opr;
|
||||
LIR_Opr FrameMap::r14_metadata_opr;
|
||||
LIR_Opr FrameMap::r15_metadata_opr;
|
||||
|
||||
LIR_Opr FrameMap::long10_opr;
|
||||
LIR_Opr FrameMap::long11_opr;
|
||||
LIR_Opr FrameMap::fpu10_float_opr;
|
||||
LIR_Opr FrameMap::fpu10_double_opr;
|
||||
|
||||
LIR_Opr FrameMap::_caller_save_cpu_regs[] = { 0, };
|
||||
LIR_Opr FrameMap::_caller_save_fpu_regs[] = { 0, };
|
||||
|
||||
//--------------------------------------------------------
|
||||
// FrameMap
|
||||
//--------------------------------------------------------
|
||||
// |---f31--|
|
||||
// |---..---|
|
||||
// |---f28--|
|
||||
// |---f27--|<---pd_last_callee_saved_fpu_reg_2
|
||||
// |---..---|
|
||||
// |---f18--|<---pd_first_callee_saved_fpu_reg_2
|
||||
// |---f17--|
|
||||
// |---..---|
|
||||
// |---f10--|
|
||||
// |---f9---|<---pd_last_callee_saved_fpu_reg_1
|
||||
// |---f8---|<---pd_first_callee_saved_fpu_reg_1
|
||||
// |---f7---|
|
||||
// |---..---|
|
||||
// |---f0---|
|
||||
// |---x27--|
|
||||
// |---x23--|
|
||||
// |---x8---|
|
||||
// |---x4---|
|
||||
// |---x3---|
|
||||
// |---x2---|
|
||||
// |---x1---|
|
||||
// |---x0---|
|
||||
// |---x26--|<---pd_last_callee_saved_reg
|
||||
// |---..---|
|
||||
// |---x18--|
|
||||
// |---x9---|<---pd_first_callee_saved_reg
|
||||
// |---x31--|
|
||||
// |---..---|
|
||||
// |---x28--|
|
||||
// |---x17--|
|
||||
// |---..---|
|
||||
// |---x10--|
|
||||
// |---x7---|
|
||||
|
||||
void FrameMap::initialize() {
|
||||
assert(!_init_done, "once");
|
||||
|
||||
int i = 0;
|
||||
|
||||
// caller save register
|
||||
map_register(i, x7); r7_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x10); r10_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x11); r11_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x12); r12_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x13); r13_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x14); r14_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x15); r15_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x16); r16_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x17); r17_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x28); r28_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x29); r29_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x30); r30_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x31); r31_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
|
||||
// callee save register
|
||||
map_register(i, x9); r9_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x18); r18_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x19); r19_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x20); r20_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x21); r21_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x22); r22_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x24); r24_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x25); r25_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
map_register(i, x26); r26_opr = LIR_OprFact::single_cpu(i); i++;
|
||||
|
||||
// special register
|
||||
map_register(i, x0); zr_opr = LIR_OprFact::single_cpu(i); i++; // zr
|
||||
map_register(i, x1); r1_opr = LIR_OprFact::single_cpu(i); i++; // ra
|
||||
map_register(i, x2); r2_opr = LIR_OprFact::single_cpu(i); i++; // sp
|
||||
map_register(i, x3); r3_opr = LIR_OprFact::single_cpu(i); i++; // gp
|
||||
map_register(i, x4); r4_opr = LIR_OprFact::single_cpu(i); i++; // thread
|
||||
map_register(i, x8); r8_opr = LIR_OprFact::single_cpu(i); i++; // fp
|
||||
map_register(i, x23); r23_opr = LIR_OprFact::single_cpu(i); i++; // java thread
|
||||
map_register(i, x27); r27_opr = LIR_OprFact::single_cpu(i); i++; // heapbase
|
||||
|
||||
// tmp register
|
||||
map_register(i, x5); r5_opr = LIR_OprFact::single_cpu(i); i++; // t0
|
||||
map_register(i, x6); r6_opr = LIR_OprFact::single_cpu(i); i++; // t1
|
||||
|
||||
t0_opr = r5_opr;
|
||||
t1_opr = r6_opr;
|
||||
t0_long_opr = LIR_OprFact::double_cpu(r5_opr->cpu_regnr(), r5_opr->cpu_regnr());
|
||||
t1_long_opr = LIR_OprFact::double_cpu(r6_opr->cpu_regnr(), r6_opr->cpu_regnr());
|
||||
|
||||
long10_opr = LIR_OprFact::double_cpu(r10_opr->cpu_regnr(), r10_opr->cpu_regnr());
|
||||
long11_opr = LIR_OprFact::double_cpu(r11_opr->cpu_regnr(), r11_opr->cpu_regnr());
|
||||
|
||||
fpu10_float_opr = LIR_OprFact::single_fpu(10);
|
||||
fpu10_double_opr = LIR_OprFact::double_fpu(10);
|
||||
|
||||
i = 0;
|
||||
_caller_save_cpu_regs[i++] = r7_opr;
|
||||
_caller_save_cpu_regs[i++] = r10_opr;
|
||||
_caller_save_cpu_regs[i++] = r11_opr;
|
||||
_caller_save_cpu_regs[i++] = r12_opr;
|
||||
_caller_save_cpu_regs[i++] = r13_opr;
|
||||
_caller_save_cpu_regs[i++] = r14_opr;
|
||||
_caller_save_cpu_regs[i++] = r15_opr;
|
||||
_caller_save_cpu_regs[i++] = r16_opr;
|
||||
_caller_save_cpu_regs[i++] = r17_opr;
|
||||
_caller_save_cpu_regs[i++] = r28_opr;
|
||||
_caller_save_cpu_regs[i++] = r29_opr;
|
||||
_caller_save_cpu_regs[i++] = r30_opr;
|
||||
_caller_save_cpu_regs[i++] = r31_opr;
|
||||
|
||||
_init_done = true;
|
||||
|
||||
zr_oop_opr = as_oop_opr(x0);
|
||||
r1_oop_opr = as_oop_opr(x1);
|
||||
r2_oop_opr = as_oop_opr(x2);
|
||||
r3_oop_opr = as_oop_opr(x3);
|
||||
r4_oop_opr = as_oop_opr(x4);
|
||||
r5_oop_opr = as_oop_opr(x5);
|
||||
r6_oop_opr = as_oop_opr(x6);
|
||||
r7_oop_opr = as_oop_opr(x7);
|
||||
r8_oop_opr = as_oop_opr(x8);
|
||||
r9_oop_opr = as_oop_opr(x9);
|
||||
r10_oop_opr = as_oop_opr(x10);
|
||||
r11_oop_opr = as_oop_opr(x11);
|
||||
r12_oop_opr = as_oop_opr(x12);
|
||||
r13_oop_opr = as_oop_opr(x13);
|
||||
r14_oop_opr = as_oop_opr(x14);
|
||||
r15_oop_opr = as_oop_opr(x15);
|
||||
r16_oop_opr = as_oop_opr(x16);
|
||||
r17_oop_opr = as_oop_opr(x17);
|
||||
r18_oop_opr = as_oop_opr(x18);
|
||||
r19_oop_opr = as_oop_opr(x19);
|
||||
r20_oop_opr = as_oop_opr(x20);
|
||||
r21_oop_opr = as_oop_opr(x21);
|
||||
r22_oop_opr = as_oop_opr(x22);
|
||||
r23_oop_opr = as_oop_opr(x23);
|
||||
r24_oop_opr = as_oop_opr(x24);
|
||||
r25_oop_opr = as_oop_opr(x25);
|
||||
r26_oop_opr = as_oop_opr(x26);
|
||||
r27_oop_opr = as_oop_opr(x27);
|
||||
r28_oop_opr = as_oop_opr(x28);
|
||||
r29_oop_opr = as_oop_opr(x29);
|
||||
r30_oop_opr = as_oop_opr(x30);
|
||||
r31_oop_opr = as_oop_opr(x31);
|
||||
|
||||
r10_metadata_opr = as_metadata_opr(x10);
|
||||
r11_metadata_opr = as_metadata_opr(x11);
|
||||
r12_metadata_opr = as_metadata_opr(x12);
|
||||
r13_metadata_opr = as_metadata_opr(x13);
|
||||
r14_metadata_opr = as_metadata_opr(x14);
|
||||
r15_metadata_opr = as_metadata_opr(x15);
|
||||
|
||||
sp_opr = as_pointer_opr(sp);
|
||||
fp_opr = as_pointer_opr(fp);
|
||||
|
||||
VMRegPair regs;
|
||||
BasicType sig_bt = T_OBJECT;
|
||||
SharedRuntime::java_calling_convention(&sig_bt, ®s, 1);
|
||||
receiver_opr = as_oop_opr(regs.first()->as_Register());
|
||||
|
||||
for (i = 0; i < nof_caller_save_fpu_regs; i++) {
|
||||
_caller_save_fpu_regs[i] = LIR_OprFact::single_fpu(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Address FrameMap::make_new_address(ByteSize sp_offset) const {
|
||||
return Address(sp, in_bytes(sp_offset));
|
||||
}
|
||||
|
||||
|
||||
// ----------------mapping-----------------------
|
||||
// all mapping is based on fp addressing, except for simple leaf methods where we access
|
||||
// the locals sp based (and no frame is built)
|
||||
|
||||
|
||||
// Frame for simple leaf methods (quick entries)
|
||||
//
|
||||
// +----------+
|
||||
// | ret addr | <- TOS
|
||||
// +----------+
|
||||
// | args |
|
||||
// | ...... |
|
||||
|
||||
// Frame for standard methods
|
||||
//
|
||||
// | .........| <- TOS
|
||||
// | locals |
|
||||
// +----------+
|
||||
// | old fp, |
|
||||
// +----------+
|
||||
// | ret addr |
|
||||
// +----------+
|
||||
// | args | <- FP
|
||||
// | .........|
|
||||
|
||||
|
||||
// For OopMaps, map a local variable or spill index to an VMRegImpl name.
|
||||
// This is the offset from sp() in the frame of the slot for the index,
|
||||
// skewed by VMRegImpl::stack0 to indicate a stack location (vs.a register.)
|
||||
//
|
||||
// framesize +
|
||||
// stack0 stack0 0 <- VMReg
|
||||
// | | <registers> |
|
||||
// ...........|..............|.............|
|
||||
// 0 1 2 3 x x 4 5 6 ... | <- local indices
|
||||
// ^ ^ sp() ( x x indicate link
|
||||
// | | and return addr)
|
||||
// arguments non-argument locals
|
||||
|
||||
|
||||
VMReg FrameMap::fpu_regname (int n) {
|
||||
// Return the OptoReg name for the fpu stack slot "n"
|
||||
// A spilled fpu stack slot comprises to two single-word OptoReg's.
|
||||
return as_FloatRegister(n)->as_VMReg();
|
||||
}
|
||||
|
||||
LIR_Opr FrameMap::stack_pointer() {
|
||||
return FrameMap::sp_opr;
|
||||
}
|
||||
|
||||
// JSR 292
|
||||
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
|
||||
return LIR_OprFact::illegalOpr; // Not needed on riscv
|
||||
}
|
||||
|
||||
bool FrameMap::validate_frame() {
|
||||
return true;
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_FRAMEMAP_RISCV_HPP
|
||||
#define CPU_RISCV_C1_FRAMEMAP_RISCV_HPP
|
||||
|
||||
// On RISCV the frame looks as follows:
|
||||
//
|
||||
// +-----------------------------+---------+----------------------------------------+----------------+-----------
|
||||
// | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling .
|
||||
// +-----------------------------+---------+----------------------------------------+----------------+-----------
|
||||
|
||||
public:
|
||||
static const int pd_c_runtime_reserved_arg_size;
|
||||
|
||||
enum {
|
||||
first_available_sp_in_frame = 0,
|
||||
frame_pad_in_bytes = 16,
|
||||
nof_reg_args = 8
|
||||
};
|
||||
|
||||
public:
|
||||
static LIR_Opr receiver_opr;
|
||||
|
||||
static LIR_Opr zr_opr;
|
||||
static LIR_Opr r1_opr;
|
||||
static LIR_Opr r2_opr;
|
||||
static LIR_Opr r3_opr;
|
||||
static LIR_Opr r4_opr;
|
||||
static LIR_Opr r5_opr;
|
||||
static LIR_Opr r6_opr;
|
||||
static LIR_Opr r7_opr;
|
||||
static LIR_Opr r8_opr;
|
||||
static LIR_Opr r9_opr;
|
||||
static LIR_Opr r10_opr;
|
||||
static LIR_Opr r11_opr;
|
||||
static LIR_Opr r12_opr;
|
||||
static LIR_Opr r13_opr;
|
||||
static LIR_Opr r14_opr;
|
||||
static LIR_Opr r15_opr;
|
||||
static LIR_Opr r16_opr;
|
||||
static LIR_Opr r17_opr;
|
||||
static LIR_Opr r18_opr;
|
||||
static LIR_Opr r19_opr;
|
||||
static LIR_Opr r20_opr;
|
||||
static LIR_Opr r21_opr;
|
||||
static LIR_Opr r22_opr;
|
||||
static LIR_Opr r23_opr;
|
||||
static LIR_Opr r24_opr;
|
||||
static LIR_Opr r25_opr;
|
||||
static LIR_Opr r26_opr;
|
||||
static LIR_Opr r27_opr;
|
||||
static LIR_Opr r28_opr;
|
||||
static LIR_Opr r29_opr;
|
||||
static LIR_Opr r30_opr;
|
||||
static LIR_Opr r31_opr;
|
||||
static LIR_Opr fp_opr;
|
||||
static LIR_Opr sp_opr;
|
||||
|
||||
static LIR_Opr zr_oop_opr;
|
||||
static LIR_Opr r1_oop_opr;
|
||||
static LIR_Opr r2_oop_opr;
|
||||
static LIR_Opr r3_oop_opr;
|
||||
static LIR_Opr r4_oop_opr;
|
||||
static LIR_Opr r5_oop_opr;
|
||||
static LIR_Opr r6_oop_opr;
|
||||
static LIR_Opr r7_oop_opr;
|
||||
static LIR_Opr r8_oop_opr;
|
||||
static LIR_Opr r9_oop_opr;
|
||||
static LIR_Opr r10_oop_opr;
|
||||
static LIR_Opr r11_oop_opr;
|
||||
static LIR_Opr r12_oop_opr;
|
||||
static LIR_Opr r13_oop_opr;
|
||||
static LIR_Opr r14_oop_opr;
|
||||
static LIR_Opr r15_oop_opr;
|
||||
static LIR_Opr r16_oop_opr;
|
||||
static LIR_Opr r17_oop_opr;
|
||||
static LIR_Opr r18_oop_opr;
|
||||
static LIR_Opr r19_oop_opr;
|
||||
static LIR_Opr r20_oop_opr;
|
||||
static LIR_Opr r21_oop_opr;
|
||||
static LIR_Opr r22_oop_opr;
|
||||
static LIR_Opr r23_oop_opr;
|
||||
static LIR_Opr r24_oop_opr;
|
||||
static LIR_Opr r25_oop_opr;
|
||||
static LIR_Opr r26_oop_opr;
|
||||
static LIR_Opr r27_oop_opr;
|
||||
static LIR_Opr r28_oop_opr;
|
||||
static LIR_Opr r29_oop_opr;
|
||||
static LIR_Opr r30_oop_opr;
|
||||
static LIR_Opr r31_oop_opr;
|
||||
|
||||
static LIR_Opr t0_opr;
|
||||
static LIR_Opr t1_opr;
|
||||
static LIR_Opr t0_long_opr;
|
||||
static LIR_Opr t1_long_opr;
|
||||
|
||||
static LIR_Opr r10_metadata_opr;
|
||||
static LIR_Opr r11_metadata_opr;
|
||||
static LIR_Opr r12_metadata_opr;
|
||||
static LIR_Opr r13_metadata_opr;
|
||||
static LIR_Opr r14_metadata_opr;
|
||||
static LIR_Opr r15_metadata_opr;
|
||||
|
||||
static LIR_Opr long10_opr;
|
||||
static LIR_Opr long11_opr;
|
||||
static LIR_Opr fpu10_float_opr;
|
||||
static LIR_Opr fpu10_double_opr;
|
||||
|
||||
static LIR_Opr as_long_opr(Register r) {
|
||||
return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
|
||||
}
|
||||
static LIR_Opr as_pointer_opr(Register r) {
|
||||
return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
|
||||
}
|
||||
|
||||
// VMReg name for spilled physical FPU stack slot n
|
||||
static VMReg fpu_regname(int n);
|
||||
|
||||
static bool is_caller_save_register(LIR_Opr opr) { return true; }
|
||||
static bool is_caller_save_register(Register r) { return true; }
|
||||
|
||||
static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; }
|
||||
static int last_cpu_reg() { return pd_last_cpu_reg; }
|
||||
|
||||
#endif // CPU_RISCV_C1_FRAMEMAP_RISCV_HPP
|
||||
@@ -1,281 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/assembler.hpp"
|
||||
#include "c1/c1_LIRAssembler.hpp"
|
||||
#include "c1/c1_MacroAssembler.hpp"
|
||||
|
||||
#ifndef PRODUCT
|
||||
#define COMMENT(x) do { __ block_comment(x); } while (0)
|
||||
#else
|
||||
#define COMMENT(x)
|
||||
#endif
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
void LIR_Assembler::arithmetic_idiv(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr illegal,
|
||||
LIR_Opr result, CodeEmitInfo* info) {
|
||||
// opcode check
|
||||
assert((code == lir_idiv) || (code == lir_irem), "opcode must be idiv or irem");
|
||||
bool is_irem = (code == lir_irem);
|
||||
// opreand check
|
||||
assert(left->is_single_cpu(), "left must be a register");
|
||||
assert(right->is_single_cpu() || right->is_constant(), "right must be a register or constant");
|
||||
assert(result->is_single_cpu(), "result must be a register");
|
||||
Register lreg = left->as_register();
|
||||
Register dreg = result->as_register();
|
||||
|
||||
// power-of-2 constant check and codegen
|
||||
if (right->is_constant()) {
|
||||
int c = right->as_constant_ptr()->as_jint();
|
||||
assert(c > 0 && is_power_of_2(c), "divisor must be power-of-2 constant");
|
||||
if (is_irem) {
|
||||
if (c == 1) {
|
||||
// move 0 to dreg if divisor is 1
|
||||
__ mv(dreg, zr);
|
||||
} else {
|
||||
unsigned int shift = exact_log2(c);
|
||||
__ sraiw(t0, lreg, 0x1f);
|
||||
__ srliw(t0, t0, BitsPerInt - shift);
|
||||
__ addw(t1, lreg, t0);
|
||||
if (is_imm_in_range(c - 1, 12, 0)) {
|
||||
__ andi(t1, t1, c - 1);
|
||||
} else {
|
||||
__ zero_extend(t1, t1, shift);
|
||||
}
|
||||
__ subw(dreg, t1, t0);
|
||||
}
|
||||
} else {
|
||||
if (c == 1) {
|
||||
// move lreg to dreg if divisor is 1
|
||||
__ mv(dreg, lreg);
|
||||
} else {
|
||||
unsigned int shift = exact_log2(c);
|
||||
__ sraiw(t0, lreg, 0x1f);
|
||||
if (is_imm_in_range(c - 1, 12, 0)) {
|
||||
__ andi(t0, t0, c - 1);
|
||||
} else {
|
||||
__ zero_extend(t0, t0, shift);
|
||||
}
|
||||
__ addw(dreg, t0, lreg);
|
||||
__ sraiw(dreg, dreg, shift);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Register rreg = right->as_register();
|
||||
__ corrected_idivl(dreg, lreg, rreg, is_irem);
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arith_op_single_cpu_right_constant(LIR_Code code, LIR_Opr left, LIR_Opr right,
|
||||
Register lreg, Register dreg) {
|
||||
// cpu register - constant
|
||||
jlong c;
|
||||
|
||||
switch (right->type()) {
|
||||
case T_LONG:
|
||||
c = right->as_constant_ptr()->as_jlong(); break;
|
||||
case T_INT: // fall through
|
||||
case T_ADDRESS:
|
||||
c = right->as_constant_ptr()->as_jint(); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
c = 0; // unreachable
|
||||
}
|
||||
|
||||
assert(code == lir_add || code == lir_sub, "mismatched arithmetic op");
|
||||
if (c == 0 && dreg == lreg) {
|
||||
COMMENT("effective nop elided");
|
||||
return;
|
||||
}
|
||||
switch (left->type()) {
|
||||
case T_INT:
|
||||
switch (code) {
|
||||
case lir_add: __ addw(dreg, lreg, c); break;
|
||||
case lir_sub: __ subw(dreg, lreg, c); break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
break;
|
||||
case T_OBJECT: // fall through
|
||||
case T_ADDRESS:
|
||||
switch (code) {
|
||||
case lir_add: __ add(dreg, lreg, c); break;
|
||||
case lir_sub: __ sub(dreg, lreg, c); break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arith_op_single_cpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest) {
|
||||
Register lreg = left->as_register();
|
||||
Register dreg = as_reg(dest);
|
||||
|
||||
if (right->is_single_cpu()) {
|
||||
// cpu register - cpu register
|
||||
assert(left->type() == T_INT && right->type() == T_INT && dest->type() == T_INT, "should be");
|
||||
Register rreg = right->as_register();
|
||||
switch (code) {
|
||||
case lir_add: __ addw(dest->as_register(), lreg, rreg); break;
|
||||
case lir_sub: __ subw(dest->as_register(), lreg, rreg); break;
|
||||
case lir_mul: __ mulw(dest->as_register(), lreg, rreg); break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
} else if (right->is_double_cpu()) {
|
||||
Register rreg = right->as_register_lo();
|
||||
// sigle_cpu + double_cpu; can happen with obj_long
|
||||
assert(code == lir_add || code == lir_sub, "mismatched arithmetic op");
|
||||
switch (code) {
|
||||
case lir_add: __ add(dreg, lreg, rreg); break;
|
||||
case lir_sub: __ sub(dreg, lreg, rreg); break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
} else if (right->is_constant()) {
|
||||
arith_op_single_cpu_right_constant(code, left, right, lreg, dreg);
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arith_op_double_cpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest) {
|
||||
Register lreg_lo = left->as_register_lo();
|
||||
|
||||
if (right->is_double_cpu()) {
|
||||
// cpu register - cpu register
|
||||
Register rreg_lo = right->as_register_lo();
|
||||
switch (code) {
|
||||
case lir_add: __ add(dest->as_register_lo(), lreg_lo, rreg_lo); break;
|
||||
case lir_sub: __ sub(dest->as_register_lo(), lreg_lo, rreg_lo); break;
|
||||
case lir_mul: __ mul(dest->as_register_lo(), lreg_lo, rreg_lo); break;
|
||||
case lir_div: __ corrected_idivq(dest->as_register_lo(), lreg_lo, rreg_lo, false); break;
|
||||
case lir_rem: __ corrected_idivq(dest->as_register_lo(), lreg_lo, rreg_lo, true); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
} else if (right->is_constant()) {
|
||||
jlong c = right->as_constant_ptr()->as_jlong();
|
||||
Register dreg = as_reg(dest);
|
||||
switch (code) {
|
||||
case lir_add: // fall through
|
||||
case lir_sub:
|
||||
if (c == 0 && dreg == lreg_lo) {
|
||||
COMMENT("effective nop elided");
|
||||
return;
|
||||
}
|
||||
code == lir_add ? __ add(dreg, lreg_lo, c) : __ sub(dreg, lreg_lo, c);
|
||||
break;
|
||||
case lir_div:
|
||||
assert(c > 0 && is_power_of_2(c), "divisor must be power-of-2 constant");
|
||||
if (c == 1) {
|
||||
// move lreg_lo to dreg if divisor is 1
|
||||
__ mv(dreg, lreg_lo);
|
||||
} else {
|
||||
unsigned int shift = exact_log2_long(c);
|
||||
// use t0 as intermediate result register
|
||||
__ srai(t0, lreg_lo, 0x3f);
|
||||
if (is_imm_in_range(c - 1, 12, 0)) {
|
||||
__ andi(t0, t0, c - 1);
|
||||
} else {
|
||||
__ zero_extend(t0, t0, shift);
|
||||
}
|
||||
__ add(dreg, t0, lreg_lo);
|
||||
__ srai(dreg, dreg, shift);
|
||||
}
|
||||
break;
|
||||
case lir_rem:
|
||||
assert(c > 0 && is_power_of_2(c), "divisor must be power-of-2 constant");
|
||||
if (c == 1) {
|
||||
// move 0 to dreg if divisor is 1
|
||||
__ mv(dreg, zr);
|
||||
} else {
|
||||
unsigned int shift = exact_log2_long(c);
|
||||
__ srai(t0, lreg_lo, 0x3f);
|
||||
__ srli(t0, t0, BitsPerLong - shift);
|
||||
__ add(t1, lreg_lo, t0);
|
||||
if (is_imm_in_range(c - 1, 12, 0)) {
|
||||
__ andi(t1, t1, c - 1);
|
||||
} else {
|
||||
__ zero_extend(t1, t1, shift);
|
||||
}
|
||||
__ sub(dreg, t1, t0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arith_op_single_fpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest) {
|
||||
assert(right->is_single_fpu(), "right hand side of float arithmetics needs to be float register");
|
||||
switch (code) {
|
||||
case lir_add: __ fadd_s(dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break;
|
||||
case lir_sub: __ fsub_s(dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break;
|
||||
case lir_mul: __ fmul_s(dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break;
|
||||
case lir_div: __ fdiv_s(dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arith_op_double_fpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest) {
|
||||
if (right->is_double_fpu()) {
|
||||
// fpu register - fpu register
|
||||
switch (code) {
|
||||
case lir_add: __ fadd_d(dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break;
|
||||
case lir_sub: __ fsub_d(dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break;
|
||||
case lir_mul: __ fmul_d(dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break;
|
||||
case lir_div: __ fdiv_d(dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest,
|
||||
CodeEmitInfo* info, bool pop_fpu_stack) {
|
||||
assert(info == NULL, "should never be used, idiv/irem and ldiv/lrem not handled by this method");
|
||||
|
||||
if (left->is_single_cpu()) {
|
||||
arith_op_single_cpu(code, left, right, dest);
|
||||
} else if (left->is_double_cpu()) {
|
||||
arith_op_double_cpu(code, left, right, dest);
|
||||
} else if (left->is_single_fpu()) {
|
||||
arith_op_single_fpu(code, left, right, dest);
|
||||
} else if (left->is_double_fpu()) {
|
||||
arith_op_double_fpu(code, left, right, dest);
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
#undef __
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_LIRASSEMBLER_ARITH_RISCV_HPP
|
||||
#define CPU_RISCV_C1_LIRASSEMBLER_ARITH_RISCV_HPP
|
||||
|
||||
// arith_op sub functions
|
||||
void arith_op_single_cpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest);
|
||||
void arith_op_double_cpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest);
|
||||
void arith_op_single_fpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest);
|
||||
void arith_op_double_fpu(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest);
|
||||
void arith_op_single_cpu_right_constant(LIR_Code code, LIR_Opr left, LIR_Opr right, Register lreg, Register dreg);
|
||||
void arithmetic_idiv(LIR_Op3* op, bool is_irem);
|
||||
|
||||
#endif // CPU_RISCV_C1_LIRASSEMBLER_ARITH_RISCV_HPP
|
||||
@@ -1,388 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/assembler.hpp"
|
||||
#include "c1/c1_LIRAssembler.hpp"
|
||||
#include "c1/c1_MacroAssembler.hpp"
|
||||
#include "ci/ciArrayKlass.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
|
||||
void LIR_Assembler::generic_arraycopy(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, CodeStub *stub) {
|
||||
assert(src == x11 && src_pos == x12, "mismatch in calling convention");
|
||||
// Save the arguments in case the generic arraycopy fails and we
|
||||
// have to fall back to the JNI stub
|
||||
arraycopy_store_args(src, src_pos, length, dst, dst_pos);
|
||||
|
||||
address copyfunc_addr = StubRoutines::generic_arraycopy();
|
||||
assert(copyfunc_addr != NULL, "generic arraycopy stub required");
|
||||
|
||||
// The arguments are in java calling convention so we shift them
|
||||
// to C convention
|
||||
assert_different_registers(c_rarg0, j_rarg1, j_rarg2, j_rarg3, j_rarg4);
|
||||
__ mv(c_rarg0, j_rarg0);
|
||||
assert_different_registers(c_rarg1, j_rarg2, j_rarg3, j_rarg4);
|
||||
__ mv(c_rarg1, j_rarg1);
|
||||
assert_different_registers(c_rarg2, j_rarg3, j_rarg4);
|
||||
__ mv(c_rarg2, j_rarg2);
|
||||
assert_different_registers(c_rarg3, j_rarg4);
|
||||
__ mv(c_rarg3, j_rarg3);
|
||||
__ mv(c_rarg4, j_rarg4);
|
||||
#ifndef PRODUCT
|
||||
if (PrintC1Statistics) {
|
||||
__ add_memory_int32(ExternalAddress((address)&Runtime1::_generic_arraycopystub_cnt), 1);
|
||||
}
|
||||
#endif
|
||||
__ far_call(RuntimeAddress(copyfunc_addr));
|
||||
__ beqz(x10, *stub->continuation());
|
||||
// Reload values from the stack so they are where the stub
|
||||
// expects them.
|
||||
arraycopy_load_args(src, src_pos, length, dst, dst_pos);
|
||||
|
||||
// x10 is -1^K where K == partial copied count
|
||||
__ xori(t0, x10, -1);
|
||||
// adjust length down and src/end pos up by partial copied count
|
||||
__ subw(length, length, t0);
|
||||
__ addw(src_pos, src_pos, t0);
|
||||
__ addw(dst_pos, dst_pos, t0);
|
||||
__ j(*stub->entry());
|
||||
|
||||
__ bind(*stub->continuation());
|
||||
}
|
||||
|
||||
void LIR_Assembler::arraycopy_simple_check(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, Register tmp,
|
||||
CodeStub *stub, int flags) {
|
||||
// test for NULL
|
||||
if (flags & LIR_OpArrayCopy::src_null_check) {
|
||||
__ beqz(src, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
if (flags & LIR_OpArrayCopy::dst_null_check) {
|
||||
__ beqz(dst, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
|
||||
// If the compiler was not able to prove that exact type of the source or the destination
|
||||
// of the arraycopy is an array type, check at runtime if the source or the destination is
|
||||
// an instance type.
|
||||
if (flags & LIR_OpArrayCopy::type_check) {
|
||||
if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::dst_objarray)) {
|
||||
__ load_klass(tmp, dst);
|
||||
__ lw(t0, Address(tmp, in_bytes(Klass::layout_helper_offset())));
|
||||
__ li(t1, Klass::_lh_neutral_value);
|
||||
__ bge(t0, t1, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
|
||||
if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::src_objarray)) {
|
||||
__ load_klass(tmp, src);
|
||||
__ lw(t0, Address(tmp, in_bytes(Klass::layout_helper_offset())));
|
||||
__ li(t1, Klass::_lh_neutral_value);
|
||||
__ bge(t0, t1, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
}
|
||||
|
||||
// check if negative
|
||||
if (flags & LIR_OpArrayCopy::src_pos_positive_check) {
|
||||
__ bltz(src_pos, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
if (flags & LIR_OpArrayCopy::dst_pos_positive_check) {
|
||||
__ bltz(dst_pos, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
if (flags & LIR_OpArrayCopy::length_positive_check) {
|
||||
__ bltz(length, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
|
||||
if (flags & LIR_OpArrayCopy::src_range_check) {
|
||||
__ addw(tmp, src_pos, length);
|
||||
__ lwu(t0, Address(src, arrayOopDesc::length_offset_in_bytes()));
|
||||
__ bgtu(tmp, t0, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
if (flags & LIR_OpArrayCopy::dst_range_check) {
|
||||
__ addw(tmp, dst_pos, length);
|
||||
__ lwu(t0, Address(dst, arrayOopDesc::length_offset_in_bytes()));
|
||||
__ bgtu(tmp, t0, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arraycopy_checkcast(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, Register tmp,
|
||||
CodeStub *stub, BasicType basic_type,
|
||||
address copyfunc_addr, int flags) {
|
||||
// src is not a sub class of dst so we have to do a
|
||||
// per-element check.
|
||||
int mask = LIR_OpArrayCopy::src_objarray | LIR_OpArrayCopy::dst_objarray;
|
||||
if ((flags & mask) != mask) {
|
||||
// Check that at least both of them object arrays.
|
||||
assert(flags & mask, "one of the two should be known to be an object array");
|
||||
|
||||
if (!(flags & LIR_OpArrayCopy::src_objarray)) {
|
||||
__ load_klass(tmp, src);
|
||||
} else if (!(flags & LIR_OpArrayCopy::dst_objarray)) {
|
||||
__ load_klass(tmp, dst);
|
||||
}
|
||||
int lh_offset = in_bytes(Klass::layout_helper_offset());
|
||||
Address klass_lh_addr(tmp, lh_offset);
|
||||
jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
|
||||
__ lw(t0, klass_lh_addr);
|
||||
__ mvw(t1, objArray_lh);
|
||||
__ bne(t0, t1, *stub->entry(), /* is_far */ true);
|
||||
}
|
||||
|
||||
// Spill because stubs can use any register they like and it's
|
||||
// easier to restore just those that we care about.
|
||||
arraycopy_store_args(src, src_pos, length, dst, dst_pos);
|
||||
arraycopy_checkcast_prepare_params(src, src_pos, length, dst, dst_pos, basic_type);
|
||||
__ far_call(RuntimeAddress(copyfunc_addr));
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintC1Statistics) {
|
||||
Label failed;
|
||||
__ bnez(x10, failed);
|
||||
__ add_memory_int32(ExternalAddress((address)&Runtime1::_arraycopy_checkcast_cnt), 1);
|
||||
__ bind(failed);
|
||||
}
|
||||
#endif
|
||||
|
||||
__ beqz(x10, *stub->continuation());
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintC1Statistics) {
|
||||
__ add_memory_int32(ExternalAddress((address)&Runtime1::_arraycopy_checkcast_attempt_cnt), 1);
|
||||
}
|
||||
#endif
|
||||
assert_different_registers(dst, dst_pos, length, src_pos, src, x10, t0);
|
||||
|
||||
// Restore previously spilled arguments
|
||||
arraycopy_load_args(src, src_pos, length, dst, dst_pos);
|
||||
|
||||
// return value is -1^K where K is partial copied count
|
||||
__ xori(t0, x10, -1);
|
||||
// adjust length down and src/end pos up by partial copied count
|
||||
__ subw(length, length, t0);
|
||||
__ addw(src_pos, src_pos, t0);
|
||||
__ addw(dst_pos, dst_pos, t0);
|
||||
}
|
||||
|
||||
void LIR_Assembler::arraycopy_type_check(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, Register tmp,
|
||||
CodeStub *stub, BasicType basic_type, int flags) {
|
||||
// We don't know the array types are compatible
|
||||
if (basic_type != T_OBJECT) {
|
||||
// Simple test for basic type arrays
|
||||
if (UseCompressedClassPointers) {
|
||||
__ lwu(tmp, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
__ lwu(t0, Address(dst, oopDesc::klass_offset_in_bytes()));
|
||||
} else {
|
||||
__ ld(tmp, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
__ ld(t0, Address(dst, oopDesc::klass_offset_in_bytes()));
|
||||
}
|
||||
__ bne(tmp, t0, *stub->entry(), /* is_far */ true);
|
||||
} else {
|
||||
// For object arrays, if src is a sub class of dst then we can
|
||||
// safely do the copy.
|
||||
Label cont, slow;
|
||||
|
||||
#define PUSH(r1, r2) \
|
||||
__ addi(sp, sp, -2 * wordSize); \
|
||||
__ sd(r1, Address(sp, 1 * wordSize)); \
|
||||
__ sd(r2, Address(sp, 0));
|
||||
|
||||
#define POP(r1, r2) \
|
||||
__ ld(r1, Address(sp, 1 * wordSize)); \
|
||||
__ ld(r2, Address(sp, 0)); \
|
||||
__ addi(sp, sp, 2 * wordSize);
|
||||
|
||||
PUSH(src, dst);
|
||||
__ load_klass(src, src);
|
||||
__ load_klass(dst, dst);
|
||||
__ check_klass_subtype_fast_path(src, dst, tmp, &cont, &slow, NULL);
|
||||
|
||||
PUSH(src, dst);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));
|
||||
POP(src, dst);
|
||||
__ bnez(dst, cont);
|
||||
|
||||
__ bind(slow);
|
||||
POP(src, dst);
|
||||
|
||||
address copyfunc_addr = StubRoutines::checkcast_arraycopy();
|
||||
if (copyfunc_addr != NULL) { // use stub if available
|
||||
arraycopy_checkcast(src, src_pos, length, dst, dst_pos, tmp, stub, basic_type, copyfunc_addr, flags);
|
||||
}
|
||||
|
||||
__ j(*stub->entry());
|
||||
__ bind(cont);
|
||||
POP(src, dst);
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::arraycopy_assert(Register src, Register dst, Register tmp, ciArrayKlass *default_type, int flags) {
|
||||
assert(default_type != NULL, "NULL default_type!");
|
||||
BasicType basic_type = default_type->element_type()->basic_type();
|
||||
|
||||
if (basic_type == T_ARRAY) { basic_type = T_OBJECT; }
|
||||
if (basic_type != T_OBJECT || !(flags & LIR_OpArrayCopy::type_check)) {
|
||||
// Sanity check the known type with the incoming class. For the
|
||||
// primitive case the types must match exactly with src.klass and
|
||||
// dst.klass each exactly matching the default type. For the
|
||||
// object array case, if no type check is needed then either the
|
||||
// dst type is exactly the expected type and the src type is a
|
||||
// subtype which we can't check or src is the same array as dst
|
||||
// but not necessarily exactly of type default_type.
|
||||
Label known_ok, halt;
|
||||
__ mov_metadata(tmp, default_type->constant_encoding());
|
||||
if (UseCompressedClassPointers) {
|
||||
__ encode_klass_not_null(tmp);
|
||||
}
|
||||
|
||||
if (basic_type != T_OBJECT) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ lwu(t0, Address(dst, oopDesc::klass_offset_in_bytes()));
|
||||
} else {
|
||||
__ ld(t0, Address(dst, oopDesc::klass_offset_in_bytes()));
|
||||
}
|
||||
__ bne(tmp, t0, halt);
|
||||
if (UseCompressedClassPointers) {
|
||||
__ lwu(t0, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
} else {
|
||||
__ ld(t0, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
}
|
||||
__ beq(tmp, t0, known_ok);
|
||||
} else {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ lwu(t0, Address(dst, oopDesc::klass_offset_in_bytes()));
|
||||
} else {
|
||||
__ ld(t0, Address(dst, oopDesc::klass_offset_in_bytes()));
|
||||
}
|
||||
__ beq(tmp, t0, known_ok);
|
||||
__ beq(src, dst, known_ok);
|
||||
}
|
||||
__ bind(halt);
|
||||
__ stop("incorrect type information in arraycopy");
|
||||
__ bind(known_ok);
|
||||
}
|
||||
}
|
||||
|
||||
void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
ciArrayKlass *default_type = op->expected_type();
|
||||
Register src = op->src()->as_register();
|
||||
Register dst = op->dst()->as_register();
|
||||
Register src_pos = op->src_pos()->as_register();
|
||||
Register dst_pos = op->dst_pos()->as_register();
|
||||
Register length = op->length()->as_register();
|
||||
Register tmp = op->tmp()->as_register();
|
||||
|
||||
CodeStub* stub = op->stub();
|
||||
int flags = op->flags();
|
||||
BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL;
|
||||
if (is_reference_type(basic_type)) { basic_type = T_OBJECT; }
|
||||
|
||||
// if we don't know anything, just go through the generic arraycopy
|
||||
if (default_type == NULL) {
|
||||
generic_arraycopy(src, src_pos, length, dst, dst_pos, stub);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(default_type != NULL && default_type->is_array_klass() && default_type->is_loaded(),
|
||||
"must be true at this point");
|
||||
|
||||
arraycopy_simple_check(src, src_pos, length, dst, dst_pos, tmp, stub, flags);
|
||||
|
||||
if (flags & LIR_OpArrayCopy::type_check) {
|
||||
arraycopy_type_check(src, src_pos, length, dst, dst_pos, tmp, stub, basic_type, flags);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
arraycopy_assert(src, dst, tmp, default_type, flags);
|
||||
#endif
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintC1Statistics) {
|
||||
__ add_memory_int32(ExternalAddress(Runtime1::arraycopy_count_address(basic_type)), 1);
|
||||
}
|
||||
#endif
|
||||
arraycopy_prepare_params(src, src_pos, length, dst, dst_pos, basic_type);
|
||||
|
||||
bool disjoint = (flags & LIR_OpArrayCopy::overlapping) == 0;
|
||||
bool aligned = (flags & LIR_OpArrayCopy::unaligned) == 0;
|
||||
const char *name = NULL;
|
||||
address entry = StubRoutines::select_arraycopy_function(basic_type, aligned, disjoint, name, false);
|
||||
|
||||
CodeBlob *cb = CodeCache::find_blob(entry);
|
||||
if (cb != NULL) {
|
||||
__ far_call(RuntimeAddress(entry));
|
||||
} else {
|
||||
const int args_num = 3;
|
||||
__ call_VM_leaf(entry, args_num);
|
||||
}
|
||||
|
||||
__ bind(*stub->continuation());
|
||||
}
|
||||
|
||||
|
||||
void LIR_Assembler::arraycopy_prepare_params(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, BasicType basic_type) {
|
||||
int scale = array_element_size(basic_type);
|
||||
__ shadd(c_rarg0, src_pos, src, t0, scale);
|
||||
__ add(c_rarg0, c_rarg0, arrayOopDesc::base_offset_in_bytes(basic_type));
|
||||
assert_different_registers(c_rarg0, dst, dst_pos, length);
|
||||
__ shadd(c_rarg1, dst_pos, dst, t0, scale);
|
||||
__ add(c_rarg1, c_rarg1, arrayOopDesc::base_offset_in_bytes(basic_type));
|
||||
assert_different_registers(c_rarg1, dst, length);
|
||||
__ mv(c_rarg2, length);
|
||||
assert_different_registers(c_rarg2, dst);
|
||||
}
|
||||
|
||||
void LIR_Assembler::arraycopy_checkcast_prepare_params(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, BasicType basic_type) {
|
||||
arraycopy_prepare_params(src, src_pos, length, dst, dst_pos, basic_type);
|
||||
__ load_klass(c_rarg4, dst);
|
||||
__ ld(c_rarg4, Address(c_rarg4, ObjArrayKlass::element_klass_offset()));
|
||||
__ lwu(c_rarg3, Address(c_rarg4, Klass::super_check_offset_offset()));
|
||||
}
|
||||
|
||||
void LIR_Assembler::arraycopy_store_args(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos) {
|
||||
__ sd(dst_pos, Address(sp, 0)); // 0: dst_pos sp offset
|
||||
__ sd(dst, Address(sp, 1 * BytesPerWord)); // 1: dst sp offset
|
||||
__ sd(length, Address(sp, 2 * BytesPerWord)); // 2: length sp offset
|
||||
__ sd(src_pos, Address(sp, 3 * BytesPerWord)); // 3: src_pos sp offset
|
||||
__ sd(src, Address(sp, 4 * BytesPerWord)); // 4: src sp offset
|
||||
}
|
||||
|
||||
void LIR_Assembler::arraycopy_load_args(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos) {
|
||||
__ ld(dst_pos, Address(sp, 0)); // 0: dst_pos sp offset
|
||||
__ ld(dst, Address(sp, 1 * BytesPerWord)); // 1: dst sp offset
|
||||
__ ld(length, Address(sp, 2 * BytesPerWord)); // 2: length sp offset
|
||||
__ ld(src_pos, Address(sp, 3 * BytesPerWord)); // 3: src_pos sp offset
|
||||
__ ld(src, Address(sp, 4 * BytesPerWord)); // 4: src sp offset
|
||||
}
|
||||
|
||||
#undef __
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_LIRASSEMBLER_ARRAYCOPY_RISCV_HPP
|
||||
#define CPU_RISCV_C1_LIRASSEMBLER_ARRAYCOPY_RISCV_HPP
|
||||
|
||||
// arraycopy sub functions
|
||||
void generic_arraycopy(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, CodeStub *stub);
|
||||
void arraycopy_simple_check(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, Register tmp,
|
||||
CodeStub *stub, int flags);
|
||||
void arraycopy_checkcast(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, Register tmp,
|
||||
CodeStub *stub, BasicType basic_type,
|
||||
address copyfunc_addr, int flags);
|
||||
void arraycopy_type_check(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, Register tmp,
|
||||
CodeStub *stub, BasicType basic_type, int flags);
|
||||
void arraycopy_assert(Register src, Register dst, Register tmp, ciArrayKlass *default_type, int flags);
|
||||
void arraycopy_prepare_params(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, BasicType basic_type);
|
||||
void arraycopy_checkcast_prepare_params(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos, BasicType basic_type);
|
||||
void arraycopy_store_args(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos);
|
||||
void arraycopy_load_args(Register src, Register src_pos, Register length,
|
||||
Register dst, Register dst_pos);
|
||||
|
||||
#endif // CPU_RISCV_C1_LIRASSEMBLER_ARRAYCOPY_RISCV_HPP
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_LIRASSEMBLER_RISCV_HPP
|
||||
#define CPU_RISCV_C1_LIRASSEMBLER_RISCV_HPP
|
||||
|
||||
// ArrayCopyStub needs access to bailout
|
||||
friend class ArrayCopyStub;
|
||||
|
||||
private:
|
||||
|
||||
#include "c1_LIRAssembler_arith_riscv.hpp"
|
||||
#include "c1_LIRAssembler_arraycopy_riscv.hpp"
|
||||
|
||||
int array_element_size(BasicType type) const;
|
||||
|
||||
static Register as_reg(LIR_Opr op) {
|
||||
return op->is_double_cpu() ? op->as_register_lo() : op->as_register();
|
||||
}
|
||||
|
||||
Address as_Address(LIR_Address* addr, Register tmp);
|
||||
|
||||
// helper functions which checks for overflow and sets bailout if it
|
||||
// occurs. Always returns a valid embeddable pointer but in the
|
||||
// bailout case the pointer won't be to unique storage.
|
||||
address float_constant(float f);
|
||||
address double_constant(double d);
|
||||
address int_constant(jlong n);
|
||||
|
||||
// Ensure we have a valid Address (base + offset) to a stack-slot.
|
||||
Address stack_slot_address(int index, uint shift, int adjust = 0);
|
||||
|
||||
// Record the type of the receiver in ReceiverTypeData
|
||||
void type_profile_helper(Register mdo,
|
||||
ciMethodData *md, ciProfileData *data,
|
||||
Register recv, Label* update_done);
|
||||
|
||||
void add_debug_info_for_branch(address adr, CodeEmitInfo* info);
|
||||
|
||||
void casw(Register addr, Register newval, Register cmpval);
|
||||
void caswu(Register addr, Register newval, Register cmpval);
|
||||
void casl(Register addr, Register newval, Register cmpval);
|
||||
|
||||
void poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info = NULL);
|
||||
|
||||
void deoptimize_trap(CodeEmitInfo *info);
|
||||
|
||||
enum {
|
||||
// See emit_static_call_stub for detail
|
||||
// CompiledStaticCall::to_interp_stub_size() (14) + CompiledStaticCall::to_trampoline_stub_size() (1 + 3 + address)
|
||||
_call_stub_size = 14 * NativeInstruction::instruction_size +
|
||||
(NativeInstruction::instruction_size + NativeCallTrampolineStub::instruction_size),
|
||||
// See emit_exception_handler for detail
|
||||
// verify_not_null_oop + far_call + should_not_reach_here + invalidate_registers(DEBUG_ONLY)
|
||||
_exception_handler_size = DEBUG_ONLY(584) NOT_DEBUG(548), // or smaller
|
||||
// See emit_deopt_handler for detail
|
||||
// auipc (1) + far_jump (6 or 2)
|
||||
_deopt_handler_size = 1 * NativeInstruction::instruction_size +
|
||||
6 * NativeInstruction::instruction_size // or smaller
|
||||
};
|
||||
|
||||
void check_conflict(ciKlass* exact_klass, intptr_t current_klass, Register tmp,
|
||||
Label &next, Label &none, Address mdo_addr);
|
||||
void check_no_conflict(ciKlass* exact_klass, intptr_t current_klass, Register tmp, Address mdo_addr, Label &next);
|
||||
|
||||
void check_exact_klass(Register tmp, ciKlass* exact_klass);
|
||||
|
||||
void check_null(Register tmp, Label &update, intptr_t current_klass, Address mdo_addr, bool do_update, Label &next);
|
||||
|
||||
void (MacroAssembler::*add)(Register prev, RegisterOrConstant incr, Register addr);
|
||||
void (MacroAssembler::*xchg)(Register prev, Register newv, Register addr);
|
||||
|
||||
void get_op(BasicType type);
|
||||
|
||||
// emit_typecheck_helper sub functions
|
||||
void data_check(LIR_OpTypeCheck *op, ciMethodData **md, ciProfileData **data);
|
||||
void typecheck_helper_slowcheck(ciKlass* k, Register obj, Register Rtmp1,
|
||||
Register k_RInfo, Register klass_RInfo,
|
||||
Label* failure_target, Label* success_target);
|
||||
void profile_object(ciMethodData* md, ciProfileData* data, Register obj,
|
||||
Register klass_RInfo, Label* obj_is_null);
|
||||
void typecheck_loaded(LIR_OpTypeCheck* op, ciKlass* k, Register k_RInfo);
|
||||
|
||||
// emit_opTypeCheck sub functions
|
||||
void typecheck_lir_store(LIR_OpTypeCheck* op, bool should_profile);
|
||||
|
||||
void type_profile(Register obj, ciMethodData* md, Register klass_RInfo, Register k_RInfo,
|
||||
ciProfileData* data, Label* success, Label* failure,
|
||||
Label& profile_cast_success, Label& profile_cast_failure);
|
||||
|
||||
void lir_store_slowcheck(Register k_RInfo, Register klass_RInfo, Register Rtmp1,
|
||||
Label* success_target, Label* failure_target);
|
||||
|
||||
void const2reg_helper(LIR_Opr src);
|
||||
|
||||
void emit_branch(LIR_Condition cmp_flag, LIR_Opr cmp1, LIR_Opr cmp2, Label& label, bool is_far, bool is_unordered);
|
||||
|
||||
void logic_op_reg32(Register dst, Register left, Register right, LIR_Code code);
|
||||
void logic_op_reg(Register dst, Register left, Register right, LIR_Code code);
|
||||
void logic_op_imm(Register dst, Register left, int right, LIR_Code code);
|
||||
|
||||
public:
|
||||
|
||||
void emit_cmove(LIR_Op4* op);
|
||||
|
||||
void store_parameter(Register r, int offset_from_rsp_in_words);
|
||||
void store_parameter(jint c, int offset_from_rsp_in_words);
|
||||
|
||||
#endif // CPU_RISCV_C1_LIRASSEMBLER_RISCV_HPP
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/register.hpp"
|
||||
#include "c1/c1_LIR.hpp"
|
||||
|
||||
FloatRegister LIR_OprDesc::as_float_reg() const {
|
||||
return as_FloatRegister(fpu_regnr());
|
||||
}
|
||||
|
||||
FloatRegister LIR_OprDesc::as_double_reg() const {
|
||||
return as_FloatRegister(fpu_regnrLo());
|
||||
}
|
||||
|
||||
// Reg2 unused.
|
||||
LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) {
|
||||
assert(as_FloatRegister(reg2) == fnoreg, "Not used on this platform");
|
||||
return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
|
||||
(reg1 << LIR_OprDesc::reg2_shift) |
|
||||
LIR_OprDesc::double_type |
|
||||
LIR_OprDesc::fpu_register |
|
||||
LIR_OprDesc::double_size);
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void LIR_Address::verify() const {
|
||||
assert(base()->is_cpu_register(), "wrong base operand");
|
||||
assert(index()->is_illegal() || index()->is_double_cpu() || index()->is_single_cpu(), "wrong index operand");
|
||||
assert(base()->type() == T_ADDRESS || base()->type() == T_OBJECT || base()->type() == T_LONG ||
|
||||
base()->type() == T_METADATA, "wrong type for addresses");
|
||||
}
|
||||
#endif // PRODUCT
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_LINEARSCAN_RISCV_HPP
|
||||
#define CPU_RISCV_C1_LINEARSCAN_RISCV_HPP
|
||||
|
||||
inline bool LinearScan::is_processed_reg_num(int reg_num)
|
||||
{
|
||||
return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map;
|
||||
}
|
||||
|
||||
inline int LinearScan::num_physical_regs(BasicType type) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline bool LinearScan::requires_adjacent_regs(BasicType type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool LinearScan::is_caller_save(int assigned_reg) {
|
||||
assert(assigned_reg >= 0 && assigned_reg < nof_regs, "should call this only for registers");
|
||||
if (assigned_reg < pd_first_callee_saved_reg) {
|
||||
return true;
|
||||
}
|
||||
if (assigned_reg > pd_last_callee_saved_reg && assigned_reg < pd_first_callee_saved_fpu_reg_1) {
|
||||
return true;
|
||||
}
|
||||
if (assigned_reg > pd_last_callee_saved_fpu_reg_1 && assigned_reg < pd_first_callee_saved_fpu_reg_2) {
|
||||
return true;
|
||||
}
|
||||
if (assigned_reg > pd_last_callee_saved_fpu_reg_2 && assigned_reg < pd_last_fpu_reg) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline void LinearScan::pd_add_temps(LIR_Op* op) {
|
||||
// No special case behaviours yet
|
||||
}
|
||||
|
||||
|
||||
// Implementation of LinearScanWalker
|
||||
|
||||
inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur)
|
||||
{
|
||||
if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) {
|
||||
assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
|
||||
_first_reg = pd_first_callee_saved_reg;
|
||||
_last_reg = pd_last_callee_saved_reg;
|
||||
return true;
|
||||
} else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT ||
|
||||
cur->type() == T_ADDRESS || cur->type() == T_METADATA) {
|
||||
_first_reg = pd_first_cpu_reg;
|
||||
_last_reg = pd_last_allocatable_cpu_reg;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // CPU_RISCV_C1_LINEARSCAN_RISCV_HPP
|
||||
@@ -1,450 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "c1/c1_LIR.hpp"
|
||||
#include "c1/c1_MacroAssembler.hpp"
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "gc/shared/barrierSetAssembler.hpp"
|
||||
#include "gc/shared/collectedHeap.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/markWord.hpp"
|
||||
#include "runtime/basicLock.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
|
||||
void C1_MacroAssembler::float_cmp(bool is_float, int unordered_result,
|
||||
FloatRegister freg0, FloatRegister freg1,
|
||||
Register result)
|
||||
{
|
||||
if (is_float) {
|
||||
float_compare(result, freg0, freg1, unordered_result);
|
||||
} else {
|
||||
double_compare(result, freg0, freg1, unordered_result);
|
||||
}
|
||||
}
|
||||
|
||||
int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register tmp, Label& slow_case) {
|
||||
const int aligned_mask = BytesPerWord - 1;
|
||||
const int hdr_offset = oopDesc::mark_offset_in_bytes();
|
||||
assert(hdr != obj && hdr != disp_hdr && obj != disp_hdr, "registers must be different");
|
||||
Label done;
|
||||
int null_check_offset = -1;
|
||||
|
||||
verify_oop(obj);
|
||||
|
||||
// save object being locked into the BasicObjectLock
|
||||
sd(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
|
||||
|
||||
null_check_offset = offset();
|
||||
|
||||
if (DiagnoseSyncOnValueBasedClasses != 0) {
|
||||
load_klass(hdr, obj);
|
||||
lwu(hdr, Address(hdr, Klass::access_flags_offset()));
|
||||
andi(t0, hdr, JVM_ACC_IS_VALUE_BASED_CLASS);
|
||||
bnez(t0, slow_case, true /* is_far */);
|
||||
}
|
||||
|
||||
if (UseBiasedLocking) {
|
||||
assert(tmp != noreg, "should have tmp register at this point");
|
||||
biased_locking_enter(disp_hdr, obj, hdr, tmp, false, done, &slow_case);
|
||||
}
|
||||
|
||||
// Load object header
|
||||
ld(hdr, Address(obj, hdr_offset));
|
||||
// and mark it as unlocked
|
||||
ori(hdr, hdr, markWord::unlocked_value);
|
||||
// save unlocked object header into the displaced header location on the stack
|
||||
sd(hdr, Address(disp_hdr, 0));
|
||||
// test if object header is still the same (i.e. unlocked), and if so, store the
|
||||
// displaced header address in the object header - if it is not the same, get the
|
||||
// object header instead
|
||||
la(t1, Address(obj, hdr_offset));
|
||||
cmpxchgptr(hdr, disp_hdr, t1, t0, done, /*fallthough*/NULL);
|
||||
// if the object header was the same, we're done
|
||||
// if the object header was not the same, it is now in the hdr register
|
||||
// => test if it is a stack pointer into the same stack (recursive locking), i.e.:
|
||||
//
|
||||
// 1) (hdr & aligned_mask) == 0
|
||||
// 2) sp <= hdr
|
||||
// 3) hdr <= sp + page_size
|
||||
//
|
||||
// these 3 tests can be done by evaluating the following expression:
|
||||
//
|
||||
// (hdr -sp) & (aligned_mask - page_size)
|
||||
//
|
||||
// assuming both the stack pointer and page_size have their least
|
||||
// significant 2 bits cleared and page_size is a power of 2
|
||||
sub(hdr, hdr, sp);
|
||||
li(t0, aligned_mask - os::vm_page_size());
|
||||
andr(hdr, hdr, t0);
|
||||
// for recursive locking, the result is zero => save it in the displaced header
|
||||
// location (NULL in the displaced hdr location indicates recursive locking)
|
||||
sd(hdr, Address(disp_hdr, 0));
|
||||
// otherwise we don't care about the result and handle locking via runtime call
|
||||
bnez(hdr, slow_case, /* is_far */ true);
|
||||
bind(done);
|
||||
return null_check_offset;
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case) {
|
||||
const int aligned_mask = BytesPerWord - 1;
|
||||
const int hdr_offset = oopDesc::mark_offset_in_bytes();
|
||||
assert(hdr != obj && hdr != disp_hdr && obj != disp_hdr, "registers must be different");
|
||||
Label done;
|
||||
|
||||
if (UseBiasedLocking) {
|
||||
// load object
|
||||
ld(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
|
||||
biased_locking_exit(obj, hdr, done);
|
||||
}
|
||||
|
||||
// load displaced header
|
||||
ld(hdr, Address(disp_hdr, 0));
|
||||
// if the loaded hdr is NULL we had recursive locking
|
||||
// if we had recursive locking, we are done
|
||||
beqz(hdr, done);
|
||||
if (!UseBiasedLocking) {
|
||||
// load object
|
||||
ld(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
|
||||
}
|
||||
verify_oop(obj);
|
||||
// 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
|
||||
// if the object header was not pointing to the displaced header,
|
||||
// we do unlocking via runtime call
|
||||
if (hdr_offset) {
|
||||
la(t0, Address(obj, hdr_offset));
|
||||
cmpxchgptr(disp_hdr, hdr, t0, t1, done, &slow_case);
|
||||
} else {
|
||||
cmpxchgptr(disp_hdr, hdr, obj, t1, done, &slow_case);
|
||||
}
|
||||
bind(done);
|
||||
}
|
||||
|
||||
// Defines obj, preserves var_size_in_bytes
|
||||
void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register tmp1, Register tmp2, Label& slow_case) {
|
||||
if (UseTLAB) {
|
||||
tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, tmp1, tmp2, slow_case, /* is_far */ true);
|
||||
} else {
|
||||
eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, tmp1, slow_case, /* is_far */ true);
|
||||
}
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register tmp1, Register tmp2) {
|
||||
assert_different_registers(obj, klass, len);
|
||||
if (UseBiasedLocking & !len->is_valid()) {
|
||||
assert_different_registers(obj, klass, len, tmp1, tmp2);
|
||||
ld(tmp1, Address(klass, Klass::prototype_header_offset()));
|
||||
} else {
|
||||
// This assumes that all prototype bits fitr in an int32_t
|
||||
mv(tmp1, (int32_t)(intptr_t)markWord::prototype().value());
|
||||
}
|
||||
sd(tmp1, Address(obj, oopDesc::mark_offset_in_bytes()));
|
||||
|
||||
if (UseCompressedClassPointers) { // Take care not to kill klass
|
||||
encode_klass_not_null(tmp1, klass);
|
||||
sw(tmp1, Address(obj, oopDesc::klass_offset_in_bytes()));
|
||||
} else {
|
||||
sd(klass, Address(obj, oopDesc::klass_offset_in_bytes()));
|
||||
}
|
||||
|
||||
if (len->is_valid()) {
|
||||
sw(len, Address(obj, arrayOopDesc::length_offset_in_bytes()));
|
||||
} else if (UseCompressedClassPointers) {
|
||||
store_klass_gap(obj, zr);
|
||||
}
|
||||
}
|
||||
|
||||
// preserves obj, destroys len_in_bytes
|
||||
void C1_MacroAssembler::initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register tmp) {
|
||||
assert(hdr_size_in_bytes >= 0, "header size must be positive or 0");
|
||||
Label done;
|
||||
|
||||
// len_in_bytes is positive and ptr sized
|
||||
sub(len_in_bytes, len_in_bytes, hdr_size_in_bytes);
|
||||
beqz(len_in_bytes, done);
|
||||
|
||||
// Preserve obj
|
||||
if (hdr_size_in_bytes) {
|
||||
add(obj, obj, hdr_size_in_bytes);
|
||||
}
|
||||
zero_memory(obj, len_in_bytes, tmp);
|
||||
if (hdr_size_in_bytes) {
|
||||
sub(obj, obj, hdr_size_in_bytes);
|
||||
}
|
||||
|
||||
bind(done);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::allocate_object(Register obj, Register tmp1, Register tmp2, int header_size, int object_size, Register klass, Label& slow_case) {
|
||||
assert_different_registers(obj, tmp1, tmp2);
|
||||
assert(header_size >= 0 && object_size >= header_size, "illegal sizes");
|
||||
|
||||
try_allocate(obj, noreg, object_size * BytesPerWord, tmp1, tmp2, slow_case);
|
||||
|
||||
initialize_object(obj, klass, noreg, object_size * HeapWordSize, tmp1, tmp2, UseTLAB);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register tmp1, Register tmp2, bool is_tlab_allocated) {
|
||||
assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0,
|
||||
"con_size_in_bytes is not multiple of alignment");
|
||||
const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize;
|
||||
|
||||
initialize_header(obj, klass, noreg, tmp1, tmp2);
|
||||
|
||||
if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) {
|
||||
// clear rest of allocated space
|
||||
const Register index = tmp2;
|
||||
// 16: multipler for threshold
|
||||
const int threshold = 16 * BytesPerWord; // approximate break even point for code size (see comments below)
|
||||
if (var_size_in_bytes != noreg) {
|
||||
mv(index, var_size_in_bytes);
|
||||
initialize_body(obj, index, hdr_size_in_bytes, tmp1);
|
||||
} else if (con_size_in_bytes <= threshold) {
|
||||
// use explicit null stores
|
||||
int i = hdr_size_in_bytes;
|
||||
if (i < con_size_in_bytes && (con_size_in_bytes % (2 * BytesPerWord))) { // 2: multipler for BytesPerWord
|
||||
sd(zr, Address(obj, i));
|
||||
i += BytesPerWord;
|
||||
}
|
||||
for (; i < con_size_in_bytes; i += BytesPerWord) {
|
||||
sd(zr, Address(obj, i));
|
||||
}
|
||||
} else if (con_size_in_bytes > hdr_size_in_bytes) {
|
||||
block_comment("zero memory");
|
||||
// use loop to null out the fields
|
||||
int words = (con_size_in_bytes - hdr_size_in_bytes) / BytesPerWord;
|
||||
mv(index, words / 8); // 8: byte size
|
||||
|
||||
const int unroll = 8; // Number of sd(zr) instructions we'll unroll
|
||||
int remainder = words % unroll;
|
||||
la(t0, Address(obj, hdr_size_in_bytes + remainder * BytesPerWord));
|
||||
|
||||
Label entry_point, loop;
|
||||
j(entry_point);
|
||||
|
||||
bind(loop);
|
||||
sub(index, index, 1);
|
||||
for (int i = -unroll; i < 0; i++) {
|
||||
if (-i == remainder) {
|
||||
bind(entry_point);
|
||||
}
|
||||
sd(zr, Address(t0, i * wordSize));
|
||||
}
|
||||
if (remainder == 0) {
|
||||
bind(entry_point);
|
||||
}
|
||||
add(t0, t0, unroll * wordSize);
|
||||
bnez(index, loop);
|
||||
}
|
||||
}
|
||||
|
||||
membar(MacroAssembler::StoreStore);
|
||||
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
assert(obj == x10, "must be");
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)));
|
||||
}
|
||||
|
||||
verify_oop(obj);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1, Register tmp2, int header_size, int f, Register klass, Label& slow_case) {
|
||||
assert_different_registers(obj, len, tmp1, tmp2, klass);
|
||||
|
||||
// determine alignment mask
|
||||
assert(!(BytesPerWord & 1), "must be multiple of 2 for masking code to work");
|
||||
|
||||
// check for negative or excessive length
|
||||
mv(t0, (int32_t)max_array_allocation_length);
|
||||
bgeu(len, t0, slow_case, /* is_far */ true);
|
||||
|
||||
const Register arr_size = tmp2; // okay to be the same
|
||||
// align object end
|
||||
mv(arr_size, (int32_t)header_size * BytesPerWord + MinObjAlignmentInBytesMask);
|
||||
shadd(arr_size, len, arr_size, t0, f);
|
||||
andi(arr_size, arr_size, ~(uint)MinObjAlignmentInBytesMask);
|
||||
|
||||
try_allocate(obj, arr_size, 0, tmp1, tmp2, slow_case);
|
||||
|
||||
initialize_header(obj, klass, len, tmp1, tmp2);
|
||||
|
||||
// clear rest of allocated space
|
||||
const Register len_zero = len;
|
||||
initialize_body(obj, arr_size, header_size * BytesPerWord, len_zero);
|
||||
|
||||
membar(MacroAssembler::StoreStore);
|
||||
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
assert(obj == x10, "must be");
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)));
|
||||
}
|
||||
|
||||
verify_oop(obj);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache, Label &L) {
|
||||
verify_oop(receiver);
|
||||
// explicit NULL check not needed since load from [klass_offset] causes a trap
|
||||
// check against inline cache
|
||||
assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check");
|
||||
cmp_klass(receiver, iCache, t0, L);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) {
|
||||
assert(bang_size_in_bytes >= framesize, "stack bang size incorrect");
|
||||
// Make sure there is enough stack space for this method's activation.
|
||||
// Note that we do this before creating a frame.
|
||||
generate_stack_overflow_check(bang_size_in_bytes);
|
||||
MacroAssembler::build_frame(framesize);
|
||||
|
||||
// Insert nmethod entry barrier into frame.
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->nmethod_entry_barrier(this);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::remove_frame(int framesize) {
|
||||
MacroAssembler::remove_frame(framesize);
|
||||
}
|
||||
|
||||
|
||||
void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
|
||||
// If we have to make this method not-entrant we'll overwrite its
|
||||
// first instruction with a jump. For this action to be legal we
|
||||
// must ensure that this first instruction is a J, JAL or NOP.
|
||||
// Make it a NOP.
|
||||
|
||||
nop();
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
|
||||
// fp + -2: link
|
||||
// + -1: return address
|
||||
// + 0: argument with offset 0
|
||||
// + 1: argument with offset 1
|
||||
// + 2: ...
|
||||
ld(reg, Address(fp, offset_in_words * BytesPerWord));
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
|
||||
if (!VerifyOops) {
|
||||
return;
|
||||
}
|
||||
verify_oop_addr(Address(sp, stack_offset), "oop");
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::verify_not_null_oop(Register r) {
|
||||
if (!VerifyOops) return;
|
||||
Label not_null;
|
||||
bnez(r, not_null);
|
||||
stop("non-null oop required");
|
||||
bind(not_null);
|
||||
verify_oop(r);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::invalidate_registers(bool inv_x10, bool inv_x9, bool inv_x12, bool inv_x13, bool inv_x14, bool inv_x15) {
|
||||
#ifdef ASSERT
|
||||
static int nn;
|
||||
if (inv_x10) { mv(x10, 0xDEAD); }
|
||||
if (inv_x9) { mv(x9, 0xDEAD); }
|
||||
if (inv_x12) { mv(x12, nn++); }
|
||||
if (inv_x13) { mv(x13, 0xDEAD); }
|
||||
if (inv_x14) { mv(x14, 0xDEAD); }
|
||||
if (inv_x15) { mv(x15, 0xDEAD); }
|
||||
#endif // ASSERT
|
||||
}
|
||||
#endif // ifndef PRODUCT
|
||||
|
||||
typedef void (C1_MacroAssembler::*c1_cond_branch_insn)(Register op1, Register op2, Label& label, bool is_far);
|
||||
typedef void (C1_MacroAssembler::*c1_float_cond_branch_insn)(FloatRegister op1, FloatRegister op2,
|
||||
Label& label, bool is_far, bool is_unordered);
|
||||
|
||||
static c1_cond_branch_insn c1_cond_branch[] =
|
||||
{
|
||||
/* SHORT branches */
|
||||
(c1_cond_branch_insn)&Assembler::beq,
|
||||
(c1_cond_branch_insn)&Assembler::bne,
|
||||
(c1_cond_branch_insn)&Assembler::blt,
|
||||
(c1_cond_branch_insn)&Assembler::ble,
|
||||
(c1_cond_branch_insn)&Assembler::bge,
|
||||
(c1_cond_branch_insn)&Assembler::bgt,
|
||||
(c1_cond_branch_insn)&Assembler::bleu, // lir_cond_belowEqual
|
||||
(c1_cond_branch_insn)&Assembler::bgeu // lir_cond_aboveEqual
|
||||
};
|
||||
|
||||
static c1_float_cond_branch_insn c1_float_cond_branch[] =
|
||||
{
|
||||
/* FLOAT branches */
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::float_beq,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::float_bne,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::float_blt,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::float_ble,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::float_bge,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::float_bgt,
|
||||
NULL, // lir_cond_belowEqual
|
||||
NULL, // lir_cond_aboveEqual
|
||||
|
||||
/* DOUBLE branches */
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::double_beq,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::double_bne,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::double_blt,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::double_ble,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::double_bge,
|
||||
(c1_float_cond_branch_insn)&MacroAssembler::double_bgt,
|
||||
NULL, // lir_cond_belowEqual
|
||||
NULL // lir_cond_aboveEqual
|
||||
};
|
||||
|
||||
void C1_MacroAssembler::c1_cmp_branch(int cmpFlag, Register op1, Register op2, Label& label,
|
||||
BasicType type, bool is_far) {
|
||||
if (type == T_OBJECT || type == T_ARRAY) {
|
||||
assert(cmpFlag == lir_cond_equal || cmpFlag == lir_cond_notEqual, "Should be equal or notEqual");
|
||||
if (cmpFlag == lir_cond_equal) {
|
||||
beq(op1, op2, label, is_far);
|
||||
} else {
|
||||
bne(op1, op2, label, is_far);
|
||||
}
|
||||
} else {
|
||||
assert(cmpFlag >= 0 && cmpFlag < (int)(sizeof(c1_cond_branch) / sizeof(c1_cond_branch[0])),
|
||||
"invalid c1 conditional branch index");
|
||||
(this->*c1_cond_branch[cmpFlag])(op1, op2, label, is_far);
|
||||
}
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::c1_float_cmp_branch(int cmpFlag, FloatRegister op1, FloatRegister op2, Label& label,
|
||||
bool is_far, bool is_unordered) {
|
||||
assert(cmpFlag >= 0 &&
|
||||
cmpFlag < (int)(sizeof(c1_float_cond_branch) / sizeof(c1_float_cond_branch[0])),
|
||||
"invalid c1 float conditional branch index");
|
||||
(this->*c1_float_cond_branch[cmpFlag])(op1, op2, label, is_far, is_unordered);
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_MACROASSEMBLER_RISCV_HPP
|
||||
#define CPU_RISCV_C1_MACROASSEMBLER_RISCV_HPP
|
||||
|
||||
using MacroAssembler::build_frame;
|
||||
using MacroAssembler::null_check;
|
||||
|
||||
// C1_MacroAssembler contains high-level macros for C1
|
||||
|
||||
private:
|
||||
int _rsp_offset; // track rsp changes
|
||||
// initialization
|
||||
void pd_init() { _rsp_offset = 0; }
|
||||
|
||||
|
||||
public:
|
||||
void try_allocate(
|
||||
Register obj, // result: pointer to object after successful allocation
|
||||
Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
|
||||
int con_size_in_bytes, // object size in bytes if known at compile time
|
||||
Register tmp1, // temp register
|
||||
Register tmp2, // temp register
|
||||
Label& slow_case // continuation point if fast allocation fails
|
||||
);
|
||||
|
||||
void initialize_header(Register obj, Register klass, Register len, Register tmp1, Register tmp2);
|
||||
void initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register tmp);
|
||||
|
||||
void float_cmp(bool is_float, int unordered_result,
|
||||
FloatRegister f0, FloatRegister f1,
|
||||
Register result);
|
||||
|
||||
// locking
|
||||
// hdr : must be x10, contents destroyed
|
||||
// obj : must point to the object to lock, contents preserved
|
||||
// disp_hdr: must point to the displaced header location, contents preserved
|
||||
// tmp : temporary register, contents destroyed
|
||||
// returns code offset at which to add null check debug information
|
||||
int lock_object (Register swap, Register obj, Register disp_hdr, Register tmp, Label& slow_case);
|
||||
|
||||
// unlocking
|
||||
// hdr : contents destroyed
|
||||
// obj : must point to the object to lock, contents preserved
|
||||
// disp_hdr: must be x10 & must point to the displaced header location, contents destroyed
|
||||
void unlock_object(Register swap, Register obj, Register lock, Label& slow_case);
|
||||
|
||||
void initialize_object(
|
||||
Register obj, // result: pointer to object after successful allocation
|
||||
Register klass, // object klass
|
||||
Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
|
||||
int con_size_in_bytes, // object size in bytes if known at compile time
|
||||
Register tmp1, // temp register
|
||||
Register tmp2, // temp register
|
||||
bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB
|
||||
);
|
||||
|
||||
// allocation of fixed-size objects
|
||||
// (can also be used to allocate fixed-size arrays, by setting
|
||||
// hdr_size correctly and storing the array length afterwards)
|
||||
// obj : will contain pointer to allocated object
|
||||
// t1, t2 : temp registers - contents destroyed
|
||||
// header_size: size of object header in words
|
||||
// object_size: total size of object in words
|
||||
// slow_case : exit to slow case implementation if fast allocation fails
|
||||
void allocate_object(Register obj, Register tmp1, Register tmp2, int header_size, int object_size, Register klass, Label& slow_case);
|
||||
|
||||
enum {
|
||||
max_array_allocation_length = 0x00FFFFFF
|
||||
};
|
||||
|
||||
// allocation of arrays
|
||||
// obj : will contain pointer to allocated object
|
||||
// len : array length in number of elements
|
||||
// t : temp register - contents destroyed
|
||||
// header_size: size of object header in words
|
||||
// f : element scale factor
|
||||
// slow_case : exit to slow case implementation if fast allocation fails
|
||||
void allocate_array(Register obj, Register len, Register tmp1, Register tmp2, int header_size, int f, Register klass, Label& slow_case);
|
||||
|
||||
int rsp_offset() const { return _rsp_offset; }
|
||||
|
||||
void invalidate_registers(bool inv_r0, bool inv_r19, bool inv_r2, bool inv_r3, bool inv_r4, bool inv_r5) PRODUCT_RETURN;
|
||||
|
||||
// This platform only uses signal-based null checks. The Label is not needed.
|
||||
void null_check(Register r, Label *Lnull = NULL) { MacroAssembler::null_check(r); }
|
||||
|
||||
void load_parameter(int offset_in_words, Register reg);
|
||||
|
||||
void inline_cache_check(Register receiver, Register iCache, Label &L);
|
||||
|
||||
static const int c1_double_branch_mask = 1 << 3; // depend on c1_float_cond_branch
|
||||
void c1_cmp_branch(int cmpFlag, Register op1, Register op2, Label& label, BasicType type, bool is_far);
|
||||
void c1_float_cmp_branch(int cmpFlag, FloatRegister op1, FloatRegister op2, Label& label,
|
||||
bool is_far, bool is_unordered = false);
|
||||
|
||||
#endif // CPU_RISCV_C1_MACROASSEMBLER_RISCV_HPP
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C1_GLOBALS_RISCV_HPP
|
||||
#define CPU_RISCV_C1_GLOBALS_RISCV_HPP
|
||||
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
// Sets the default values for platform dependent flags used by the client compiler.
|
||||
// (see c1_globals.hpp)
|
||||
|
||||
#ifndef COMPILER2
|
||||
define_pd_global(bool, BackgroundCompilation, true );
|
||||
define_pd_global(bool, InlineIntrinsics, true );
|
||||
define_pd_global(bool, PreferInterpreterNativeStubs, false);
|
||||
define_pd_global(bool, ProfileTraps, false);
|
||||
define_pd_global(bool, UseOnStackReplacement, true );
|
||||
define_pd_global(bool, TieredCompilation, false);
|
||||
define_pd_global(intx, CompileThreshold, 1500 );
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 933 );
|
||||
define_pd_global(intx, NewSizeThreadIncrease, 4*K );
|
||||
define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
||||
define_pd_global(intx, ReservedCodeCacheSize, 32*M );
|
||||
define_pd_global(intx, NonProfiledCodeHeapSize, 13*M );
|
||||
define_pd_global(intx, ProfiledCodeHeapSize, 14*M );
|
||||
define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
||||
define_pd_global(bool, ProfileInterpreter, false);
|
||||
define_pd_global(intx, CodeCacheExpansionSize, 32*K );
|
||||
define_pd_global(uintx, CodeCacheMinBlockLength, 1);
|
||||
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
||||
define_pd_global(bool, NeverActAsServerClassMachine, true );
|
||||
define_pd_global(uint64_t, MaxRAM, 1ULL*G);
|
||||
define_pd_global(bool, CICompileOSR, true );
|
||||
#endif // !COMPILER2
|
||||
define_pd_global(bool, UseTypeProfile, false);
|
||||
|
||||
define_pd_global(bool, OptimizeSinglePrecision, true );
|
||||
define_pd_global(bool, CSEArrayLength, false);
|
||||
define_pd_global(bool, TwoOperandLIRForm, false);
|
||||
|
||||
#endif // CPU_RISCV_C1_GLOBALS_RISCV_HPP
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,193 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C2_MACROASSEMBLER_RISCV_HPP
|
||||
#define CPU_RISCV_C2_MACROASSEMBLER_RISCV_HPP
|
||||
|
||||
// C2_MacroAssembler contains high-level macros for C2
|
||||
|
||||
private:
|
||||
void element_compare(Register r1, Register r2,
|
||||
Register result, Register cnt,
|
||||
Register tmp1, Register tmp2,
|
||||
VectorRegister vr1, VectorRegister vr2,
|
||||
VectorRegister vrs,
|
||||
bool is_latin, Label& DONE);
|
||||
public:
|
||||
|
||||
void string_compare(Register str1, Register str2,
|
||||
Register cnt1, Register cnt2, Register result,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
int ae);
|
||||
|
||||
void string_indexof_char_short(Register str1, Register cnt1,
|
||||
Register ch, Register result,
|
||||
bool isL);
|
||||
|
||||
void string_indexof_char(Register str1, Register cnt1,
|
||||
Register ch, Register result,
|
||||
Register tmp1, Register tmp2,
|
||||
Register tmp3, Register tmp4,
|
||||
bool isL);
|
||||
|
||||
void string_indexof(Register str1, Register str2,
|
||||
Register cnt1, Register cnt2,
|
||||
Register tmp1, Register tmp2,
|
||||
Register tmp3, Register tmp4,
|
||||
Register tmp5, Register tmp6,
|
||||
Register result, int ae);
|
||||
|
||||
void string_indexof_linearscan(Register haystack, Register needle,
|
||||
Register haystack_len, Register needle_len,
|
||||
Register tmp1, Register tmp2,
|
||||
Register tmp3, Register tmp4,
|
||||
int needle_con_cnt, Register result, int ae);
|
||||
|
||||
void arrays_equals(Register r1, Register r2,
|
||||
Register tmp3, Register tmp4,
|
||||
Register tmp5, Register tmp6,
|
||||
Register result, Register cnt1,
|
||||
int elem_size);
|
||||
|
||||
void string_equals(Register r1, Register r2,
|
||||
Register result, Register cnt1,
|
||||
int elem_size);
|
||||
|
||||
// refer to conditional_branches and float_conditional_branches
|
||||
static const int bool_test_bits = 3;
|
||||
static const int neg_cond_bits = 2;
|
||||
static const int unsigned_branch_mask = 1 << bool_test_bits;
|
||||
static const int double_branch_mask = 1 << bool_test_bits;
|
||||
|
||||
// cmp
|
||||
void cmp_branch(int cmpFlag,
|
||||
Register op1, Register op2,
|
||||
Label& label, bool is_far = false);
|
||||
|
||||
void float_cmp_branch(int cmpFlag,
|
||||
FloatRegister op1, FloatRegister op2,
|
||||
Label& label, bool is_far = false);
|
||||
|
||||
void enc_cmpUEqNeLeGt_imm0_branch(int cmpFlag, Register op,
|
||||
Label& L, bool is_far = false);
|
||||
|
||||
void enc_cmpEqNe_imm0_branch(int cmpFlag, Register op,
|
||||
Label& L, bool is_far = false);
|
||||
|
||||
void enc_cmove(int cmpFlag,
|
||||
Register op1, Register op2,
|
||||
Register dst, Register src);
|
||||
|
||||
void spill(Register r, bool is64, int offset) {
|
||||
is64 ? sd(r, Address(sp, offset))
|
||||
: sw(r, Address(sp, offset));
|
||||
}
|
||||
|
||||
void spill(FloatRegister f, bool is64, int offset) {
|
||||
is64 ? fsd(f, Address(sp, offset))
|
||||
: fsw(f, Address(sp, offset));
|
||||
}
|
||||
|
||||
void spill(VectorRegister v, int offset) {
|
||||
add(t0, sp, offset);
|
||||
vs1r_v(v, t0);
|
||||
}
|
||||
|
||||
void unspill(Register r, bool is64, int offset) {
|
||||
is64 ? ld(r, Address(sp, offset))
|
||||
: lw(r, Address(sp, offset));
|
||||
}
|
||||
|
||||
void unspillu(Register r, bool is64, int offset) {
|
||||
is64 ? ld(r, Address(sp, offset))
|
||||
: lwu(r, Address(sp, offset));
|
||||
}
|
||||
|
||||
void unspill(FloatRegister f, bool is64, int offset) {
|
||||
is64 ? fld(f, Address(sp, offset))
|
||||
: flw(f, Address(sp, offset));
|
||||
}
|
||||
|
||||
void unspill(VectorRegister v, int offset) {
|
||||
add(t0, sp, offset);
|
||||
vl1r_v(v, t0);
|
||||
}
|
||||
|
||||
void spill_copy_vector_stack_to_stack(int src_offset, int dst_offset, int vec_reg_size_in_bytes) {
|
||||
assert(vec_reg_size_in_bytes % 16 == 0, "unexpected vector reg size");
|
||||
unspill(v0, src_offset);
|
||||
spill(v0, dst_offset);
|
||||
}
|
||||
|
||||
void minmax_FD(FloatRegister dst,
|
||||
FloatRegister src1, FloatRegister src2,
|
||||
bool is_double, bool is_min);
|
||||
|
||||
// intrinsic methods implemented by rvv instructions
|
||||
void string_equals_v(Register r1, Register r2,
|
||||
Register result, Register cnt1,
|
||||
int elem_size);
|
||||
|
||||
void arrays_equals_v(Register r1, Register r2,
|
||||
Register result, Register cnt1,
|
||||
int elem_size);
|
||||
|
||||
void string_compare_v(Register str1, Register str2,
|
||||
Register cnt1, Register cnt2,
|
||||
Register result,
|
||||
Register tmp1, Register tmp2,
|
||||
int encForm);
|
||||
|
||||
void clear_array_v(Register base, Register cnt);
|
||||
|
||||
void byte_array_inflate_v(Register src, Register dst,
|
||||
Register len, Register tmp);
|
||||
|
||||
void char_array_compress_v(Register src, Register dst,
|
||||
Register len, Register result,
|
||||
Register tmp);
|
||||
|
||||
void encode_iso_array_v(Register src, Register dst,
|
||||
Register len, Register result,
|
||||
Register tmp);
|
||||
|
||||
void has_negatives_v(Register ary, Register len,
|
||||
Register result, Register tmp);
|
||||
|
||||
void string_indexof_char_v(Register str1, Register cnt1,
|
||||
Register ch, Register result,
|
||||
Register tmp1, Register tmp2,
|
||||
bool isL);
|
||||
|
||||
void minmax_FD_v(VectorRegister dst,
|
||||
VectorRegister src1, VectorRegister src2,
|
||||
bool is_double, bool is_min);
|
||||
|
||||
void reduce_minmax_FD_v(FloatRegister dst,
|
||||
FloatRegister src1, VectorRegister src2,
|
||||
VectorRegister tmp1, VectorRegister tmp2,
|
||||
bool is_double, bool is_min);
|
||||
|
||||
#endif // CPU_RISCV_C2_MACROASSEMBLER_RISCV_HPP
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_C2_GLOBALS_RISCV_HPP
|
||||
#define CPU_RISCV_C2_GLOBALS_RISCV_HPP
|
||||
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
// Sets the default values for platform dependent flags used by the server compiler.
|
||||
// (see c2_globals.hpp). Alpha-sorted.
|
||||
|
||||
define_pd_global(bool, BackgroundCompilation, true);
|
||||
define_pd_global(bool, CICompileOSR, true);
|
||||
define_pd_global(bool, InlineIntrinsics, true);
|
||||
define_pd_global(bool, PreferInterpreterNativeStubs, false);
|
||||
define_pd_global(bool, ProfileTraps, true);
|
||||
define_pd_global(bool, UseOnStackReplacement, true);
|
||||
define_pd_global(bool, ProfileInterpreter, true);
|
||||
define_pd_global(bool, TieredCompilation, COMPILER1_PRESENT(true) NOT_COMPILER1(false));
|
||||
define_pd_global(intx, CompileThreshold, 10000);
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 140);
|
||||
define_pd_global(intx, ConditionalMoveLimit, 0);
|
||||
define_pd_global(intx, FLOATPRESSURE, 32);
|
||||
define_pd_global(intx, FreqInlineSize, 325);
|
||||
define_pd_global(intx, MinJumpTableSize, 10);
|
||||
define_pd_global(intx, INTPRESSURE, 24);
|
||||
define_pd_global(intx, InteriorEntryAlignment, 16);
|
||||
define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
|
||||
define_pd_global(intx, LoopUnrollLimit, 60);
|
||||
define_pd_global(intx, LoopPercentProfileLimit, 10);
|
||||
// InitialCodeCacheSize derived from specjbb2000 run.
|
||||
define_pd_global(intx, InitialCodeCacheSize, 2496*K); // Integral multiple of CodeCacheExpansionSize
|
||||
define_pd_global(intx, CodeCacheExpansionSize, 64*K);
|
||||
|
||||
// Ergonomics related flags
|
||||
define_pd_global(uint64_t,MaxRAM, 128ULL*G);
|
||||
define_pd_global(intx, RegisterCostAreaRatio, 16000);
|
||||
|
||||
// Peephole and CISC spilling both break the graph, and so makes the
|
||||
// scheduler sick.
|
||||
define_pd_global(bool, OptoPeephole, false);
|
||||
define_pd_global(bool, UseCISCSpill, false);
|
||||
define_pd_global(bool, OptoScheduling, true);
|
||||
define_pd_global(bool, OptoBundling, false);
|
||||
define_pd_global(bool, OptoRegScheduling, false);
|
||||
define_pd_global(bool, SuperWordLoopUnrollAnalysis, true);
|
||||
define_pd_global(bool, IdealizeClearArrayNode, true);
|
||||
|
||||
define_pd_global(intx, ReservedCodeCacheSize, 48*M);
|
||||
define_pd_global(intx, NonProfiledCodeHeapSize, 21*M);
|
||||
define_pd_global(intx, ProfiledCodeHeapSize, 22*M);
|
||||
define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
||||
define_pd_global(uintx, CodeCacheMinBlockLength, 6);
|
||||
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
||||
|
||||
// Ergonomics related flags
|
||||
define_pd_global(bool, NeverActAsServerClassMachine, false);
|
||||
|
||||
define_pd_global(bool, TrapBasedRangeChecks, false); // Not needed.
|
||||
|
||||
#endif // CPU_RISCV_C2_GLOBALS_RISCV_HPP
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "opto/compile.hpp"
|
||||
#include "opto/node.hpp"
|
||||
#include "opto/output.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
|
||||
#define __ masm.
|
||||
void C2SafepointPollStubTable::emit_stub_impl(MacroAssembler& masm, C2SafepointPollStub* entry) const {
|
||||
assert(SharedRuntime::polling_page_return_handler_blob() != NULL,
|
||||
"polling page return stub not created yet");
|
||||
address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();
|
||||
RuntimeAddress callback_addr(stub);
|
||||
|
||||
__ bind(entry->_stub_label);
|
||||
InternalAddress safepoint_pc(masm.pc() - masm.offset() + entry->_safepoint_offset);
|
||||
masm.code_section()->relocate(masm.pc(), safepoint_pc.rspec());
|
||||
__ la(t0, safepoint_pc.target());
|
||||
__ sd(t0, Address(xthread, JavaThread::saved_exception_pc_offset()));
|
||||
__ far_jump(callback_addr);
|
||||
}
|
||||
#undef __
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_CODEBUFFER_RISCV_HPP
|
||||
#define CPU_RISCV_CODEBUFFER_RISCV_HPP
|
||||
|
||||
private:
|
||||
void pd_initialize() {}
|
||||
|
||||
public:
|
||||
void flush_bundle(bool start_new_bundle) {}
|
||||
|
||||
#endif // CPU_RISCV_CODEBUFFER_RISCV_HPP
|
||||
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/macroAssembler.inline.hpp"
|
||||
#include "code/compiledIC.hpp"
|
||||
#include "code/icBuffer.hpp"
|
||||
#include "code/nmethod.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define __ _masm.
|
||||
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) {
|
||||
precond(cbuf.stubs()->start() != badAddress);
|
||||
precond(cbuf.stubs()->end() != badAddress);
|
||||
// Stub is fixed up when the corresponding call is converted from
|
||||
// calling compiled code to calling interpreted code.
|
||||
// mv xmethod, 0
|
||||
// jalr -4 # to self
|
||||
|
||||
if (mark == NULL) {
|
||||
mark = cbuf.insts_mark(); // Get mark within main instrs section.
|
||||
}
|
||||
|
||||
// Note that the code buffer's insts_mark is always relative to insts.
|
||||
// That's why we must use the macroassembler to generate a stub.
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
address base = __ start_a_stub(to_interp_stub_size());
|
||||
int offset = __ offset();
|
||||
if (base == NULL) {
|
||||
return NULL; // CodeBuffer::expand failed
|
||||
}
|
||||
// static stub relocation stores the instruction address of the call
|
||||
__ relocate(static_stub_Relocation::spec(mark));
|
||||
|
||||
__ emit_static_call_stub();
|
||||
|
||||
assert((__ offset() - offset) <= (int)to_interp_stub_size(), "stub too big");
|
||||
__ end_a_stub();
|
||||
return base;
|
||||
}
|
||||
#undef __
|
||||
|
||||
int CompiledStaticCall::to_interp_stub_size() {
|
||||
// fence_i + fence* + (lui, addi, slli, addi, slli, addi) + (lui, addi, slli, addi, slli) + jalr
|
||||
return NativeFenceI::instruction_size() + 12 * NativeInstruction::instruction_size;
|
||||
}
|
||||
|
||||
int CompiledStaticCall::to_trampoline_stub_size() {
|
||||
// Somewhat pessimistically, we count 4 instructions here (although
|
||||
// there are only 3) because we sometimes emit an alignment nop.
|
||||
// Trampoline stubs are always word aligned.
|
||||
return NativeInstruction::instruction_size + NativeCallTrampolineStub::instruction_size;
|
||||
}
|
||||
|
||||
// Relocation entries for call stub, compiled java to interpreter.
|
||||
int CompiledStaticCall::reloc_to_interp_stub() {
|
||||
return 4; // 3 in emit_to_interp_stub + 1 in emit_call
|
||||
}
|
||||
|
||||
void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) {
|
||||
address stub = find_stub();
|
||||
guarantee(stub != NULL, "stub not found");
|
||||
|
||||
if (TraceICs) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
|
||||
p2i(instruction_address()),
|
||||
callee->name_and_sig_as_C_string());
|
||||
}
|
||||
|
||||
// Creation also verifies the object.
|
||||
NativeMovConstReg* method_holder
|
||||
= nativeMovConstReg_at(stub + NativeFenceI::instruction_size());
|
||||
#ifdef ASSERT
|
||||
NativeGeneralJump* jump = nativeGeneralJump_at(method_holder->next_instruction_address());
|
||||
|
||||
verify_mt_safe(callee, entry, method_holder, jump);
|
||||
#endif
|
||||
// Update stub.
|
||||
method_holder->set_data((intptr_t)callee());
|
||||
NativeGeneralJump::insert_unconditional(method_holder->next_instruction_address(), entry);
|
||||
ICache::invalidate_range(stub, to_interp_stub_size());
|
||||
// Update jump to call.
|
||||
set_destination_mt_safe(stub);
|
||||
}
|
||||
|
||||
void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
|
||||
// Reset stub.
|
||||
address stub = static_stub->addr();
|
||||
assert(stub != NULL, "stub not found");
|
||||
assert(CompiledICLocker::is_safe(stub), "mt unsafe call");
|
||||
// Creation also verifies the object.
|
||||
NativeMovConstReg* method_holder
|
||||
= nativeMovConstReg_at(stub + NativeFenceI::instruction_size());
|
||||
method_holder->set_data(0);
|
||||
NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
|
||||
jump->set_jump_destination((address)-1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Non-product mode code
|
||||
#ifndef PRODUCT
|
||||
|
||||
void CompiledDirectStaticCall::verify() {
|
||||
// Verify call.
|
||||
_call->verify();
|
||||
_call->verify_alignment();
|
||||
|
||||
// Verify stub.
|
||||
address stub = find_stub();
|
||||
assert(stub != NULL, "no stub found for static call");
|
||||
// Creation also verifies the object.
|
||||
NativeMovConstReg* method_holder
|
||||
= nativeMovConstReg_at(stub + NativeFenceI::instruction_size());
|
||||
NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
|
||||
|
||||
// Verify state.
|
||||
assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted(), "sanity check");
|
||||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_COPY_RISCV_HPP
|
||||
#define CPU_RISCV_COPY_RISCV_HPP
|
||||
|
||||
#include OS_CPU_HEADER(copy)
|
||||
|
||||
static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
|
||||
julong* to = (julong*) tohw;
|
||||
julong v = ((julong) value << 32) | value;
|
||||
while (count-- > 0) {
|
||||
*to++ = v;
|
||||
}
|
||||
}
|
||||
|
||||
static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {
|
||||
pd_fill_to_words(tohw, count, value);
|
||||
}
|
||||
|
||||
static void pd_fill_to_bytes(void* to, size_t count, jubyte value) {
|
||||
(void)memset(to, value, count);
|
||||
}
|
||||
|
||||
static void pd_zero_to_words(HeapWord* tohw, size_t count) {
|
||||
pd_fill_to_words(tohw, count, 0);
|
||||
}
|
||||
|
||||
static void pd_zero_to_bytes(void* to, size_t count) {
|
||||
(void)memset(to, 0, count);
|
||||
}
|
||||
|
||||
static void pd_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
(void)memmove(to, from, count * HeapWordSize);
|
||||
}
|
||||
|
||||
static inline void pd_disjoint_words_helper(const HeapWord* from, HeapWord* to, size_t count, bool is_atomic) {
|
||||
switch (count) {
|
||||
case 8: to[7] = from[7]; // fall through
|
||||
case 7: to[6] = from[6]; // fall through
|
||||
case 6: to[5] = from[5]; // fall through
|
||||
case 5: to[4] = from[4]; // fall through
|
||||
case 4: to[3] = from[3]; // fall through
|
||||
case 3: to[2] = from[2]; // fall through
|
||||
case 2: to[1] = from[1]; // fall through
|
||||
case 1: to[0] = from[0]; // fall through
|
||||
case 0: break;
|
||||
default:
|
||||
if (is_atomic) {
|
||||
while (count-- > 0) { *to++ = *from++; }
|
||||
} else {
|
||||
memcpy(to, from, count * HeapWordSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void pd_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
pd_disjoint_words_helper(from, to, count, false);
|
||||
}
|
||||
|
||||
static void pd_disjoint_words_atomic(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
pd_disjoint_words_helper(from, to, count, true);
|
||||
}
|
||||
|
||||
static void pd_aligned_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
pd_conjoint_words(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_aligned_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
pd_disjoint_words(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_conjoint_bytes(const void* from, void* to, size_t count) {
|
||||
(void)memmove(to, from, count);
|
||||
}
|
||||
|
||||
static void pd_conjoint_bytes_atomic(const void* from, void* to, size_t count) {
|
||||
pd_conjoint_bytes(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) {
|
||||
_Copy_conjoint_jshorts_atomic(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_conjoint_jints_atomic(const jint* from, jint* to, size_t count) {
|
||||
_Copy_conjoint_jints_atomic(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) {
|
||||
_Copy_conjoint_jlongs_atomic(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_conjoint_oops_atomic(const oop* from, oop* to, size_t count) {
|
||||
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size.");
|
||||
_Copy_conjoint_jlongs_atomic((const jlong*)from, (jlong*)to, count);
|
||||
}
|
||||
|
||||
static void pd_arrayof_conjoint_bytes(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
_Copy_arrayof_conjoint_bytes(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_arrayof_conjoint_jshorts(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
_Copy_arrayof_conjoint_jshorts(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_arrayof_conjoint_jints(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
_Copy_arrayof_conjoint_jints(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_arrayof_conjoint_jlongs(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
_Copy_arrayof_conjoint_jlongs(from, to, count);
|
||||
}
|
||||
|
||||
static void pd_arrayof_conjoint_oops(const HeapWord* from, HeapWord* to, size_t count) {
|
||||
assert(!UseCompressedOops, "foo!");
|
||||
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
|
||||
_Copy_arrayof_conjoint_jlongs(from, to, count);
|
||||
}
|
||||
|
||||
#endif // CPU_RISCV_COPY_RISCV_HPP
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_DISASSEMBLER_RISCV_HPP
|
||||
#define CPU_RISCV_DISASSEMBLER_RISCV_HPP
|
||||
|
||||
static int pd_instruction_alignment() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const char* pd_cpu_opts() {
|
||||
return "";
|
||||
}
|
||||
|
||||
// special-case instruction decoding.
|
||||
// There may be cases where the binutils disassembler doesn't do
|
||||
// the perfect job. In those cases, decode_instruction0 may kick in
|
||||
// and do it right.
|
||||
// If nothing had to be done, just return "here", otherwise return "here + instr_len(here)"
|
||||
static address decode_instruction0(address here, outputStream* st, address virtual_begin = NULL) {
|
||||
return here;
|
||||
}
|
||||
|
||||
// platform-specific instruction annotations (like value of loaded constants)
|
||||
static void annotate(address pc, outputStream* st) {}
|
||||
|
||||
#endif // CPU_RISCV_DISASSEMBLER_RISCV_HPP
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "prims/foreign_globals.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
// Stubbed out, implement later
|
||||
const ABIDescriptor ForeignGlobals::parse_abi_descriptor_impl(jobject jabi) const {
|
||||
Unimplemented();
|
||||
return {};
|
||||
}
|
||||
|
||||
const BufferLayout ForeignGlobals::parse_buffer_layout_impl(jobject jlayout) const {
|
||||
Unimplemented();
|
||||
return {};
|
||||
}
|
||||
|
||||
const CallRegs ForeignGlobals::parse_call_regs_impl(jobject jconv) const {
|
||||
ShouldNotCallThis();
|
||||
return {};
|
||||
}
|
||||
@@ -1,698 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "compiler/oopMap.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/markWord.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/monitorChunk.hpp"
|
||||
#include "runtime/os.inline.hpp"
|
||||
#include "runtime/signature.hpp"
|
||||
#include "runtime/stackWatermarkSet.hpp"
|
||||
#include "runtime/stubCodeGenerator.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "vmreg_riscv.inline.hpp"
|
||||
#ifdef COMPILER1
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#include "runtime/vframeArray.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef ASSERT
|
||||
void RegisterMap::check_location_valid() {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Profiling/safepoint support
|
||||
|
||||
bool frame::safe_for_sender(JavaThread *thread) {
|
||||
address addr_sp = (address)_sp;
|
||||
address addr_fp = (address)_fp;
|
||||
address unextended_sp = (address)_unextended_sp;
|
||||
|
||||
// consider stack guards when trying to determine "safe" stack pointers
|
||||
// sp must be within the usable part of the stack (not in guards)
|
||||
if (!thread->is_in_usable_stack(addr_sp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// When we are running interpreted code the machine stack pointer, SP, is
|
||||
// set low enough so that the Java expression stack can grow and shrink
|
||||
// without ever exceeding the machine stack bounds. So, ESP >= SP.
|
||||
|
||||
// When we call out of an interpreted method, SP is incremented so that
|
||||
// the space between SP and ESP is removed. The SP saved in the callee's
|
||||
// frame is the SP *before* this increment. So, when we walk a stack of
|
||||
// interpreter frames the sender's SP saved in a frame might be less than
|
||||
// the SP at the point of call.
|
||||
|
||||
// So unextended sp must be within the stack but we need not to check
|
||||
// that unextended sp >= sp
|
||||
|
||||
if (!thread->is_in_full_stack_checked(unextended_sp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// an fp must be within the stack and above (but not equal) sp
|
||||
// second evaluation on fp+ is added to handle situation where fp is -1
|
||||
bool fp_safe = thread->is_in_stack_range_excl(addr_fp, addr_sp) &&
|
||||
thread->is_in_full_stack_checked(addr_fp + (return_addr_offset * sizeof(void*)));
|
||||
|
||||
// We know sp/unextended_sp are safe only fp is questionable here
|
||||
|
||||
// If the current frame is known to the code cache then we can attempt to
|
||||
// to construct the sender and do some validation of it. This goes a long way
|
||||
// toward eliminating issues when we get in frame construction code
|
||||
|
||||
if (_cb != NULL) {
|
||||
|
||||
// First check if frame is complete and tester is reliable
|
||||
// Unfortunately we can only check frame complete for runtime stubs and nmethod
|
||||
// other generic buffer blobs are more problematic so we just assume they are
|
||||
// ok. adapter blobs never have a frame complete and are never ok.
|
||||
|
||||
if (!_cb->is_frame_complete_at(_pc)) {
|
||||
if (_cb->is_nmethod() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Could just be some random pointer within the codeBlob
|
||||
if (!_cb->code_contains(_pc)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Entry frame checks
|
||||
if (is_entry_frame()) {
|
||||
// an entry frame must have a valid fp.
|
||||
return fp_safe && is_entry_frame_valid(thread);
|
||||
}
|
||||
|
||||
intptr_t* sender_sp = NULL;
|
||||
intptr_t* sender_unextended_sp = NULL;
|
||||
address sender_pc = NULL;
|
||||
intptr_t* saved_fp = NULL;
|
||||
|
||||
if (is_interpreted_frame()) {
|
||||
// fp must be safe
|
||||
if (!fp_safe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sender_pc = (address)this->fp()[return_addr_offset];
|
||||
// for interpreted frames, the value below is the sender "raw" sp,
|
||||
// which can be different from the sender unextended sp (the sp seen
|
||||
// by the sender) because of current frame local variables
|
||||
sender_sp = (intptr_t*) addr_at(sender_sp_offset);
|
||||
sender_unextended_sp = (intptr_t*) this->fp()[interpreter_frame_sender_sp_offset];
|
||||
saved_fp = (intptr_t*) this->fp()[link_offset];
|
||||
} else {
|
||||
// must be some sort of compiled/runtime frame
|
||||
// fp does not have to be safe (although it could be check for c1?)
|
||||
|
||||
// check for a valid frame_size, otherwise we are unlikely to get a valid sender_pc
|
||||
if (_cb->frame_size() <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sender_sp = _unextended_sp + _cb->frame_size();
|
||||
// Is sender_sp safe?
|
||||
if (!thread->is_in_full_stack_checked((address)sender_sp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sender_unextended_sp = sender_sp;
|
||||
sender_pc = (address) *(sender_sp - 1);
|
||||
saved_fp = (intptr_t*) *(sender_sp - 2);
|
||||
}
|
||||
|
||||
|
||||
// If the potential sender is the interpreter then we can do some more checking
|
||||
if (Interpreter::contains(sender_pc)) {
|
||||
|
||||
// fp is always saved in a recognizable place in any code we generate. However
|
||||
// only if the sender is interpreted/call_stub (c1 too?) are we certain that the saved fp
|
||||
// is really a frame pointer.
|
||||
if (!thread->is_in_stack_range_excl((address)saved_fp, (address)sender_sp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// construct the potential sender
|
||||
frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
|
||||
|
||||
return sender.is_interpreted_frame_valid(thread);
|
||||
}
|
||||
|
||||
// We must always be able to find a recognizable pc
|
||||
CodeBlob* sender_blob = CodeCache::find_blob_unsafe(sender_pc);
|
||||
if (sender_pc == NULL || sender_blob == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Could be a zombie method
|
||||
if (sender_blob->is_zombie() || sender_blob->is_unloaded()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Could just be some random pointer within the codeBlob
|
||||
if (!sender_blob->code_contains(sender_pc)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We should never be able to see an adapter if the current frame is something from code cache
|
||||
if (sender_blob->is_adapter_blob()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Could be the call_stub
|
||||
if (StubRoutines::returns_to_call_stub(sender_pc)) {
|
||||
if (!thread->is_in_stack_range_excl((address)saved_fp, (address)sender_sp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// construct the potential sender
|
||||
frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
|
||||
|
||||
// Validate the JavaCallWrapper an entry frame must have
|
||||
address jcw = (address)sender.entry_frame_call_wrapper();
|
||||
|
||||
bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)sender.fp());
|
||||
|
||||
return jcw_safe;
|
||||
}
|
||||
|
||||
CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
|
||||
if (nm != NULL) {
|
||||
if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||
|
||||
nm->method()->is_method_handle_intrinsic()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
|
||||
// because the return address counts against the callee's frame.
|
||||
if (sender_blob->frame_size() <= 0) {
|
||||
assert(!sender_blob->is_compiled(), "should count return address at least");
|
||||
return false;
|
||||
}
|
||||
|
||||
// We should never be able to see anything here except an nmethod. If something in the
|
||||
// code cache (current frame) is called by an entity within the code cache that entity
|
||||
// should not be anything but the call stub (already covered), the interpreter (already covered)
|
||||
// or an nmethod.
|
||||
if (!sender_blob->is_compiled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Could put some more validation for the potential non-interpreted sender
|
||||
// frame we'd create by calling sender if I could think of any. Wait for next crash in forte...
|
||||
|
||||
// One idea is seeing if the sender_pc we have is one that we'd expect to call to current cb
|
||||
|
||||
// We've validated the potential sender that would be created
|
||||
return true;
|
||||
}
|
||||
|
||||
// Must be native-compiled frame. Since sender will try and use fp to find
|
||||
// linkages it must be safe
|
||||
if (!fp_safe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Will the pc we fetch be non-zero (which we'll find at the oldest frame)
|
||||
if ((address)this->fp()[return_addr_offset] == NULL) { return false; }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void frame::patch_pc(Thread* thread, address pc) {
|
||||
assert(_cb == CodeCache::find_blob(pc), "unexpected pc");
|
||||
address* pc_addr = &(((address*) sp())[-1]);
|
||||
if (TracePcPatching) {
|
||||
tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]",
|
||||
p2i(pc_addr), p2i(*pc_addr), p2i(pc));
|
||||
}
|
||||
// Either the return address is the original one or we are going to
|
||||
// patch in the same address that's already there.
|
||||
assert(_pc == *pc_addr || pc == *pc_addr, "must be");
|
||||
*pc_addr = pc;
|
||||
address original_pc = CompiledMethod::get_deopt_original_pc(this);
|
||||
if (original_pc != NULL) {
|
||||
assert(original_pc == _pc, "expected original PC to be stored before patching");
|
||||
_deopt_state = is_deoptimized;
|
||||
// leave _pc as is
|
||||
} else {
|
||||
_deopt_state = not_deoptimized;
|
||||
_pc = pc;
|
||||
}
|
||||
}
|
||||
|
||||
bool frame::is_interpreted_frame() const {
|
||||
return Interpreter::contains(pc());
|
||||
}
|
||||
|
||||
int frame::frame_size(RegisterMap* map) const {
|
||||
frame sender = this->sender(map);
|
||||
return sender.sp() - sp();
|
||||
}
|
||||
|
||||
intptr_t* frame::entry_frame_argument_at(int offset) const {
|
||||
// convert offset to index to deal with tsi
|
||||
int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);
|
||||
// Entry frame's arguments are always in relation to unextended_sp()
|
||||
return &unextended_sp()[index];
|
||||
}
|
||||
|
||||
// sender_sp
|
||||
intptr_t* frame::interpreter_frame_sender_sp() const {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
return (intptr_t*) at(interpreter_frame_sender_sp_offset);
|
||||
}
|
||||
|
||||
void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
ptr_at_put(interpreter_frame_sender_sp_offset, (intptr_t) sender_sp);
|
||||
}
|
||||
|
||||
|
||||
// monitor elements
|
||||
|
||||
BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
|
||||
return (BasicObjectLock*) addr_at(interpreter_frame_monitor_block_bottom_offset);
|
||||
}
|
||||
|
||||
BasicObjectLock* frame::interpreter_frame_monitor_end() const {
|
||||
BasicObjectLock* result = (BasicObjectLock*) *addr_at(interpreter_frame_monitor_block_top_offset);
|
||||
// make sure the pointer points inside the frame
|
||||
assert(sp() <= (intptr_t*) result, "monitor end should be above the stack pointer");
|
||||
assert((intptr_t*) result < fp(), "monitor end should be strictly below the frame pointer");
|
||||
return result;
|
||||
}
|
||||
|
||||
void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) {
|
||||
*((BasicObjectLock**)addr_at(interpreter_frame_monitor_block_top_offset)) = value;
|
||||
}
|
||||
|
||||
// Used by template based interpreter deoptimization
|
||||
void frame::interpreter_frame_set_last_sp(intptr_t* last_sp) {
|
||||
*((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = last_sp;
|
||||
}
|
||||
|
||||
frame frame::sender_for_entry_frame(RegisterMap* map) const {
|
||||
assert(map != NULL, "map must be set");
|
||||
// Java frame called from C; skip all C frames and return top C
|
||||
// frame of that chunk as the sender
|
||||
JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();
|
||||
assert(!entry_frame_is_first(), "next Java fp must be non zero");
|
||||
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
|
||||
// Since we are walking the stack now this nested anchor is obviously walkable
|
||||
// even if it wasn't when it was stacked.
|
||||
if (!jfa->walkable()) {
|
||||
// Capture _last_Java_pc (if needed) and mark anchor walkable.
|
||||
jfa->capture_last_Java_pc();
|
||||
}
|
||||
map->clear();
|
||||
assert(map->include_argument_oops(), "should be set by clear");
|
||||
vmassert(jfa->last_Java_pc() != NULL, "not walkable");
|
||||
frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
|
||||
return fr;
|
||||
}
|
||||
|
||||
OptimizedEntryBlob::FrameData* OptimizedEntryBlob::frame_data_for_frame(const frame& frame) const {
|
||||
ShouldNotCallThis();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool frame::optimized_entry_frame_is_first() const {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
|
||||
frame frame::sender_for_optimized_entry_frame(RegisterMap* map) const {
|
||||
ShouldNotCallThis();
|
||||
return {};
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::verify_deopt_original_pc
|
||||
//
|
||||
// Verifies the calculated original PC of a deoptimization PC for the
|
||||
// given unextended SP.
|
||||
#ifdef ASSERT
|
||||
void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp) {
|
||||
frame fr;
|
||||
|
||||
// This is ugly but it's better than to change {get,set}_original_pc
|
||||
// to take an SP value as argument. And it's only a debugging
|
||||
// method anyway.
|
||||
fr._unextended_sp = unextended_sp;
|
||||
|
||||
assert_cond(nm != NULL);
|
||||
address original_pc = nm->get_original_pc(&fr);
|
||||
assert(nm->insts_contains_inclusive(original_pc),
|
||||
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::adjust_unextended_sp
|
||||
void frame::adjust_unextended_sp() {
|
||||
// On riscv, sites calling method handle intrinsics and lambda forms are treated
|
||||
// as any other call site. Therefore, no special action is needed when we are
|
||||
// returning to any of these call sites.
|
||||
|
||||
if (_cb != NULL) {
|
||||
CompiledMethod* sender_cm = _cb->as_compiled_method_or_null();
|
||||
if (sender_cm != NULL) {
|
||||
// If the sender PC is a deoptimization point, get the original PC.
|
||||
if (sender_cm->is_deopt_entry(_pc) ||
|
||||
sender_cm->is_deopt_mh_entry(_pc)) {
|
||||
DEBUG_ONLY(verify_deopt_original_pc(sender_cm, _unextended_sp));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::update_map_with_saved_link
|
||||
void frame::update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr) {
|
||||
// The interpreter and compiler(s) always save fp in a known
|
||||
// location on entry. We must record where that location is
|
||||
// so that if fp was live on callout from c2 we can find
|
||||
// the saved copy no matter what it called.
|
||||
|
||||
// Since the interpreter always saves fp if we record where it is then
|
||||
// we don't have to always save fp on entry and exit to c2 compiled
|
||||
// code, on entry will be enough.
|
||||
assert(map != NULL, "map must be set");
|
||||
map->set_location(::fp->as_VMReg(), (address) link_addr);
|
||||
// this is weird "H" ought to be at a higher address however the
|
||||
// oopMaps seems to have the "H" regs at the same address and the
|
||||
// vanilla register.
|
||||
map->set_location(::fp->as_VMReg()->next(), (address) link_addr);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::sender_for_interpreter_frame
|
||||
frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
|
||||
// SP is the raw SP from the sender after adapter or interpreter
|
||||
// extension.
|
||||
intptr_t* sender_sp = this->sender_sp();
|
||||
|
||||
// This is the sp before any possible extension (adapter/locals).
|
||||
intptr_t* unextended_sp = interpreter_frame_sender_sp();
|
||||
|
||||
#ifdef COMPILER2
|
||||
assert(map != NULL, "map must be set");
|
||||
if (map->update_map()) {
|
||||
update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset));
|
||||
}
|
||||
#endif // COMPILER2
|
||||
|
||||
return frame(sender_sp, unextended_sp, link(), sender_pc());
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::sender_for_compiled_frame
|
||||
frame frame::sender_for_compiled_frame(RegisterMap* map) const {
|
||||
// we cannot rely upon the last fp having been saved to the thread
|
||||
// in C2 code but it will have been pushed onto the stack. so we
|
||||
// have to find it relative to the unextended sp
|
||||
|
||||
assert(_cb->frame_size() >= 0, "must have non-zero frame size");
|
||||
intptr_t* l_sender_sp = unextended_sp() + _cb->frame_size();
|
||||
intptr_t* unextended_sp = l_sender_sp;
|
||||
|
||||
// the return_address is always the word on the stack
|
||||
address sender_pc = (address) *(l_sender_sp + frame::return_addr_offset);
|
||||
|
||||
intptr_t** saved_fp_addr = (intptr_t**) (l_sender_sp + frame::link_offset);
|
||||
|
||||
assert(map != NULL, "map must be set");
|
||||
if (map->update_map()) {
|
||||
// Tell GC to use argument oopmaps for some runtime stubs that need it.
|
||||
// For C1, the runtime stub might not have oop maps, so set this flag
|
||||
// outside of update_register_map.
|
||||
map->set_include_argument_oops(_cb->caller_must_gc_arguments(map->thread()));
|
||||
if (_cb->oop_maps() != NULL) {
|
||||
OopMapSet::update_register_map(this, map);
|
||||
}
|
||||
|
||||
// Since the prolog does the save and restore of FP there is no
|
||||
// oopmap for it so we must fill in its location as if there was
|
||||
// an oopmap entry since if our caller was compiled code there
|
||||
// could be live jvm state in it.
|
||||
update_map_with_saved_link(map, saved_fp_addr);
|
||||
}
|
||||
|
||||
return frame(l_sender_sp, unextended_sp, *saved_fp_addr, sender_pc);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::sender_raw
|
||||
frame frame::sender_raw(RegisterMap* map) const {
|
||||
// Default is we done have to follow them. The sender_for_xxx will
|
||||
// update it accordingly
|
||||
assert(map != NULL, "map must be set");
|
||||
map->set_include_argument_oops(false);
|
||||
|
||||
if (is_entry_frame()) {
|
||||
return sender_for_entry_frame(map);
|
||||
}
|
||||
if (is_interpreted_frame()) {
|
||||
return sender_for_interpreter_frame(map);
|
||||
}
|
||||
assert(_cb == CodeCache::find_blob(pc()),"Must be the same");
|
||||
|
||||
// This test looks odd: why is it not is_compiled_frame() ? That's
|
||||
// because stubs also have OOP maps.
|
||||
if (_cb != NULL) {
|
||||
return sender_for_compiled_frame(map);
|
||||
}
|
||||
|
||||
// Must be native-compiled frame, i.e. the marshaling code for native
|
||||
// methods that exists in the core system.
|
||||
return frame(sender_sp(), link(), sender_pc());
|
||||
}
|
||||
|
||||
frame frame::sender(RegisterMap* map) const {
|
||||
frame result = sender_raw(map);
|
||||
|
||||
if (map->process_frames()) {
|
||||
StackWatermarkSet::on_iteration(map->thread(), result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
assert(is_interpreted_frame(), "Not an interpreted frame");
|
||||
// These are reasonable sanity checks
|
||||
if (fp() == NULL || (intptr_t(fp()) & (wordSize-1)) != 0) {
|
||||
return false;
|
||||
}
|
||||
if (sp() == NULL || (intptr_t(sp()) & (wordSize-1)) != 0) {
|
||||
return false;
|
||||
}
|
||||
if (fp() + interpreter_frame_initial_sp_offset < sp()) {
|
||||
return false;
|
||||
}
|
||||
// These are hacks to keep us out of trouble.
|
||||
// The problem with these is that they mask other problems
|
||||
if (fp() <= sp()) { // this attempts to deal with unsigned comparison above
|
||||
return false;
|
||||
}
|
||||
|
||||
// do some validation of frame elements
|
||||
|
||||
// first the method
|
||||
Method* m = *interpreter_frame_method_addr();
|
||||
// validate the method we'd find in this potential sender
|
||||
if (!Method::is_valid_method(m)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// stack frames shouldn't be much larger than max_stack elements
|
||||
// this test requires the use of unextended_sp which is the sp as seen by
|
||||
// the current frame, and not sp which is the "raw" pc which could point
|
||||
// further because of local variables of the callee method inserted after
|
||||
// method arguments
|
||||
if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// validate bci/bcx
|
||||
address bcp = interpreter_frame_bcp();
|
||||
if (m->validate_bci_from_bcp(bcp) < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// validate constantPoolCache*
|
||||
ConstantPoolCache* cp = *interpreter_frame_cache_addr();
|
||||
if (MetaspaceObj::is_valid(cp) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// validate locals
|
||||
address locals = (address) *interpreter_frame_locals_addr();
|
||||
if (locals > thread->stack_base() || locals < (address) fp()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We'd have to be pretty unlucky to be mislead at this point
|
||||
return true;
|
||||
}
|
||||
|
||||
BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
Method* method = interpreter_frame_method();
|
||||
BasicType type = method->result_type();
|
||||
|
||||
intptr_t* tos_addr = NULL;
|
||||
if (method->is_native()) {
|
||||
tos_addr = (intptr_t*)sp();
|
||||
if (type == T_FLOAT || type == T_DOUBLE) {
|
||||
// This is because we do a push(ltos) after push(dtos) in generate_native_entry.
|
||||
tos_addr += 2 * Interpreter::stackElementWords;
|
||||
}
|
||||
} else {
|
||||
tos_addr = (intptr_t*)interpreter_frame_tos_address();
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case T_OBJECT :
|
||||
case T_ARRAY : {
|
||||
oop obj;
|
||||
if (method->is_native()) {
|
||||
obj = cast_to_oop(at(interpreter_frame_oop_temp_offset));
|
||||
} else {
|
||||
oop* obj_p = (oop*)tos_addr;
|
||||
obj = (obj_p == NULL) ? (oop)NULL : *obj_p;
|
||||
}
|
||||
assert(Universe::is_in_heap_or_null(obj), "sanity check");
|
||||
*oop_result = obj;
|
||||
break;
|
||||
}
|
||||
case T_BOOLEAN : value_result->z = *(jboolean*)tos_addr; break;
|
||||
case T_BYTE : value_result->b = *(jbyte*)tos_addr; break;
|
||||
case T_CHAR : value_result->c = *(jchar*)tos_addr; break;
|
||||
case T_SHORT : value_result->s = *(jshort*)tos_addr; break;
|
||||
case T_INT : value_result->i = *(jint*)tos_addr; break;
|
||||
case T_LONG : value_result->j = *(jlong*)tos_addr; break;
|
||||
case T_FLOAT : {
|
||||
value_result->f = *(jfloat*)tos_addr;
|
||||
break;
|
||||
}
|
||||
case T_DOUBLE : value_result->d = *(jdouble*)tos_addr; break;
|
||||
case T_VOID : /* Nothing to do */ break;
|
||||
default : ShouldNotReachHere();
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
|
||||
int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);
|
||||
return &interpreter_frame_tos_address()[index];
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
#define DESCRIBE_FP_OFFSET(name) \
|
||||
values.describe(frame_no, fp() + frame::name##_offset, #name)
|
||||
|
||||
void frame::describe_pd(FrameValues& values, int frame_no) {
|
||||
if (is_interpreted_frame()) {
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_last_sp);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_method);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_mdp);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_mirror);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_cache);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_locals);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_bcp);
|
||||
DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
intptr_t *frame::initial_deoptimization_info() {
|
||||
// Not used on riscv, but we must return something.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
intptr_t* frame::real_fp() const {
|
||||
if (_cb != NULL) {
|
||||
// use the frame size if valid
|
||||
int size = _cb->frame_size();
|
||||
if (size > 0) {
|
||||
return unextended_sp() + size;
|
||||
}
|
||||
}
|
||||
// else rely on fp()
|
||||
assert(!is_compiled_frame(), "unknown compiled frame size");
|
||||
return fp();
|
||||
}
|
||||
|
||||
#undef DESCRIBE_FP_OFFSET
|
||||
|
||||
#ifndef PRODUCT
|
||||
// This is a generic constructor which is only used by pns() in debug.cpp.
|
||||
frame::frame(void* ptr_sp, void* ptr_fp, void* pc) {
|
||||
init((intptr_t*)ptr_sp, (intptr_t*)ptr_fp, (address)pc);
|
||||
}
|
||||
|
||||
void frame::pd_ps() {}
|
||||
#endif
|
||||
|
||||
void JavaFrameAnchor::make_walkable(JavaThread* thread) {
|
||||
// last frame set?
|
||||
if (last_Java_sp() == NULL) { return; }
|
||||
// already walkable?
|
||||
if (walkable()) { return; }
|
||||
vmassert(Thread::current() == (Thread*)thread, "not current thread");
|
||||
vmassert(last_Java_sp() != NULL, "not called from Java code?");
|
||||
vmassert(last_Java_pc() == NULL, "already walkable");
|
||||
capture_last_Java_pc();
|
||||
vmassert(walkable(), "something went wrong");
|
||||
}
|
||||
|
||||
void JavaFrameAnchor::capture_last_Java_pc() {
|
||||
vmassert(_last_Java_sp != NULL, "no last frame set");
|
||||
vmassert(_last_Java_pc == NULL, "already walkable");
|
||||
_last_Java_pc = (address)_last_Java_sp[-1];
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_RISCV_FRAME_RISCV_HPP
|
||||
#define CPU_RISCV_FRAME_RISCV_HPP
|
||||
|
||||
#include "runtime/synchronizer.hpp"
|
||||
|
||||
// A frame represents a physical stack frame (an activation). Frames can be
|
||||
// C or Java frames, and the Java frames can be interpreted or compiled.
|
||||
// In contrast, vframes represent source-level activations, so that one physical frame
|
||||
// can correspond to multiple source level frames because of inlining.
|
||||
// A frame is comprised of {pc, fp, sp}
|
||||
// ------------------------------ Asm interpreter ----------------------------------------
|
||||
// Layout of asm interpreter frame:
|
||||
// [expression stack ] * <- sp
|
||||
|
||||
// [monitors[0] ] \
|
||||
// ... | monitor block size = k
|
||||
// [monitors[k-1] ] /
|
||||
// [frame initial esp ] ( == &monitors[0], initially here) initial_sp_offset
|
||||
// [byte code index/pointr] = bcx() bcx_offset
|
||||
|
||||
// [pointer to locals ] = locals() locals_offset
|
||||
// [constant pool cache ] = cache() cache_offset
|
||||
|
||||
// [klass of method ] = mirror() mirror_offset
|
||||
// [padding ]
|
||||
|
||||
// [methodData ] = mdp() mdx_offset
|
||||
// [Method ] = method() method_offset
|
||||
|
||||
// [last esp ] = last_sp() last_sp_offset
|
||||
// [old stack pointer ] (sender_sp) sender_sp_offset
|
||||
|
||||
// [old frame pointer ]
|
||||
// [return pc ]
|
||||
|
||||
// [last sp ] <- fp = link()
|
||||
// [oop temp ] (only for native calls)
|
||||
|
||||
// [padding ] (to preserve machine SP alignment)
|
||||
// [locals and parameters ]
|
||||
// <- sender sp
|
||||
// ------------------------------ Asm interpreter ----------------------------------------
|
||||
|
||||
// ------------------------------ C Frame ------------------------------------------------
|
||||
// Stack: gcc with -fno-omit-frame-pointer
|
||||
// .
|
||||
// .
|
||||
// +-> .
|
||||
// | +-----------------+ |
|
||||
// | | return address | |
|
||||
// | | previous fp ------+
|
||||
// | | saved registers |
|
||||
// | | local variables |
|
||||
// | | ... | <-+
|
||||
// | +-----------------+ |
|
||||
// | | return address | |
|
||||
// +------ previous fp | |
|
||||
// | saved registers | |
|
||||
// | local variables | |
|
||||
// +-> | ... | |
|
||||
// | +-----------------+ |
|
||||
// | | return address | |
|
||||
// | | previous fp ------+
|
||||
// | | saved registers |
|
||||
// | | local variables |
|
||||
// | | ... | <-+
|
||||
// | +-----------------+ |
|
||||
// | | return address | |
|
||||
// +------ previous fp | |
|
||||
// | saved registers | |
|
||||
// | local variables | |
|
||||
// $fp --> | ... | |
|
||||
// +-----------------+ |
|
||||
// | return address | |
|
||||
// | previous fp ------+
|
||||
// | saved registers |
|
||||
// $sp --> | local variables |
|
||||
// +-----------------+
|
||||
// ------------------------------ C Frame ------------------------------------------------
|
||||
|
||||
public:
|
||||
enum {
|
||||
pc_return_offset = 0,
|
||||
// All frames
|
||||
link_offset = -2,
|
||||
return_addr_offset = -1,
|
||||
sender_sp_offset = 0,
|
||||
// Interpreter frames
|
||||
interpreter_frame_oop_temp_offset = 1, // for native calls only
|
||||
|
||||
interpreter_frame_sender_sp_offset = -3,
|
||||
// outgoing sp before a call to an invoked method
|
||||
interpreter_frame_last_sp_offset = interpreter_frame_sender_sp_offset - 1,
|
||||
interpreter_frame_method_offset = interpreter_frame_last_sp_offset - 1,
|
||||
interpreter_frame_mdp_offset = interpreter_frame_method_offset - 1,
|
||||
interpreter_frame_padding_offset = interpreter_frame_mdp_offset - 1,
|
||||
interpreter_frame_mirror_offset = interpreter_frame_padding_offset - 1,
|
||||
interpreter_frame_cache_offset = interpreter_frame_mirror_offset - 1,
|
||||
interpreter_frame_locals_offset = interpreter_frame_cache_offset - 1,
|
||||
interpreter_frame_bcp_offset = interpreter_frame_locals_offset - 1,
|
||||
interpreter_frame_initial_sp_offset = interpreter_frame_bcp_offset - 1,
|
||||
|
||||
interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset,
|
||||
interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset,
|
||||
|
||||
// Entry frames
|
||||
// n.b. these values are determined by the layout defined in
|
||||
// stubGenerator for the Java call stub
|
||||
entry_frame_after_call_words = 22,
|
||||
entry_frame_call_wrapper_offset = -10,
|
||||
|
||||
// we don't need a save area
|
||||
arg_reg_save_area_bytes = 0
|
||||
};
|
||||
|
||||
intptr_t ptr_at(int offset) const {
|
||||
return *ptr_at_addr(offset);
|
||||
}
|
||||
|
||||
void ptr_at_put(int offset, intptr_t value) {
|
||||
*ptr_at_addr(offset) = value;
|
||||
}
|
||||
|
||||
private:
|
||||
// an additional field beyond _sp and _pc:
|
||||
intptr_t* _fp; // frame pointer
|
||||
// The interpreter and adapters will extend the frame of the caller.
|
||||
// Since oopMaps are based on the sp of the caller before extension
|
||||
// we need to know that value. However in order to compute the address
|
||||
// of the return address we need the real "raw" sp. Since sparc already
|
||||
// uses sp() to mean "raw" sp and unextended_sp() to mean the caller's
|
||||
// original sp we use that convention.
|
||||
|
||||
intptr_t* _unextended_sp;
|
||||
void adjust_unextended_sp();
|
||||
|
||||
intptr_t* ptr_at_addr(int offset) const {
|
||||
return (intptr_t*) addr_at(offset);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// Used in frame::sender_for_{interpreter,compiled}_frame
|
||||
static void verify_deopt_original_pc( CompiledMethod* nm, intptr_t* unextended_sp);
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
frame(intptr_t* ptr_sp, intptr_t* ptr_fp, address pc);
|
||||
|
||||
frame(intptr_t* ptr_sp, intptr_t* unextended_sp, intptr_t* ptr_fp, address pc);
|
||||
|
||||
frame(intptr_t* ptr_sp, intptr_t* ptr_fp);
|
||||
|
||||
void init(intptr_t* ptr_sp, intptr_t* ptr_fp, address pc);
|
||||
|
||||
// accessors for the instance variables
|
||||
// Note: not necessarily the real 'frame pointer' (see real_fp)
|
||||
intptr_t* fp() const { return _fp; }
|
||||
|
||||
inline address* sender_pc_addr() const;
|
||||
|
||||
// expression stack tos if we are nested in a java call
|
||||
intptr_t* interpreter_frame_last_sp() const;
|
||||
|
||||
// helper to update a map with callee-saved RBP
|
||||
static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr);
|
||||
|
||||
// deoptimization support
|
||||
void interpreter_frame_set_last_sp(intptr_t* last_sp);
|
||||
|
||||
static jint interpreter_frame_expression_stack_direction() { return -1; }
|
||||
|
||||
// returns the sending frame, without applying any barriers
|
||||
frame sender_raw(RegisterMap* map) const;
|
||||
|
||||
#endif // CPU_RISCV_FRAME_RISCV_HPP
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user