mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-25 09:50:48 +01:00
Compare commits
484 Commits
lbourges/t
...
jdk-23+12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
998d0baab0 | ||
|
|
0735c8ab26 | ||
|
|
5fa2bdc6c7 | ||
|
|
be2b92bd8b | ||
|
|
38ad514589 | ||
|
|
b938a5c9ed | ||
|
|
a93605f7fb | ||
|
|
41242cbe5d | ||
|
|
5db50aca69 | ||
|
|
eb4b6fa621 | ||
|
|
e7e8083139 | ||
|
|
e6b3bda2c3 | ||
|
|
1ab6bd434f | ||
|
|
3b90ddfefe | ||
|
|
9b1f1e5294 | ||
|
|
6cad07c23b | ||
|
|
4dd6c44cbd | ||
|
|
33f2382767 | ||
|
|
419191c653 | ||
|
|
349df0a0e5 | ||
|
|
552411f832 | ||
|
|
9f0e7da64e | ||
|
|
81b065a95d | ||
|
|
4fcae1aef5 | ||
|
|
c5c866aafe | ||
|
|
ac3ce2aa15 | ||
|
|
bceaed6d4d | ||
|
|
16d917a85f | ||
|
|
60cbf29250 | ||
|
|
da14aa463b | ||
|
|
d482c1af28 | ||
|
|
e85355ada4 | ||
|
|
5d3d40d962 | ||
|
|
7583419d88 | ||
|
|
c5f1dcccfc | ||
|
|
4d82ea102a | ||
|
|
a48f5966be | ||
|
|
5daf63b717 | ||
|
|
97aca09e58 | ||
|
|
ec9437dbcc | ||
|
|
0901dedefe | ||
|
|
d22d890cac | ||
|
|
93feda3d9a | ||
|
|
fc67c2b4f1 | ||
|
|
b87d9cf2c9 | ||
|
|
0963a4e9a1 | ||
|
|
bf13a4e281 | ||
|
|
f62b5789ad | ||
|
|
9a9cfbe0ba | ||
|
|
3780ad3133 | ||
|
|
2d3c9c5e67 | ||
|
|
20c71ceacd | ||
|
|
c042f08632 | ||
|
|
bb6b04897b | ||
|
|
490825fb91 | ||
|
|
3a00fc732a | ||
|
|
f32f574004 | ||
|
|
09f755a64d | ||
|
|
1799ffeaa9 | ||
|
|
d10f277bd3 | ||
|
|
63f6a563a3 | ||
|
|
27574b384c | ||
|
|
c26c5833cc | ||
|
|
09a78b5da9 | ||
|
|
ef2d5c40c0 | ||
|
|
11fdca0634 | ||
|
|
5d414da504 | ||
|
|
93a2e773a5 | ||
|
|
336bbbe389 | ||
|
|
cb809f8e04 | ||
|
|
c4409eafc4 | ||
|
|
54f09d7345 | ||
|
|
00ffc42cef | ||
|
|
d695af89f6 | ||
|
|
9f9a732c38 | ||
|
|
864cf22241 | ||
|
|
8e5c0ee402 | ||
|
|
724a2a2c4a | ||
|
|
f365d807e5 | ||
|
|
4406915ebc | ||
|
|
cc1e216eb9 | ||
|
|
10eafdc62e | ||
|
|
0f4cd8f1c0 | ||
|
|
8b30503387 | ||
|
|
8e5f6ddb68 | ||
|
|
0bcece9958 | ||
|
|
64f7972a3d | ||
|
|
f0f4d63fa9 | ||
|
|
51e2dde018 | ||
|
|
c022431a00 | ||
|
|
33834b7d14 | ||
|
|
23522682d4 | ||
|
|
492e8bf563 | ||
|
|
5f16f342d9 | ||
|
|
921507c510 | ||
|
|
68eb5a1df5 | ||
|
|
04d43c435d | ||
|
|
d5f3d5c8cc | ||
|
|
d31fd78d96 | ||
|
|
27003b53bb | ||
|
|
36246c975b | ||
|
|
14f9aba921 | ||
|
|
1bd91cdebe | ||
|
|
4d50ee63d6 | ||
|
|
221fbfb436 | ||
|
|
d2590c69b4 | ||
|
|
aa792eabab | ||
|
|
a2d027eaa0 | ||
|
|
b419e95173 | ||
|
|
9538f5d317 | ||
|
|
4957d6a61e | ||
|
|
d60331a21c | ||
|
|
beed4145ec | ||
|
|
56073cd1ea | ||
|
|
bb675afae6 | ||
|
|
5bf859c8e9 | ||
|
|
0d285312a9 | ||
|
|
69a11c7f7e | ||
|
|
9fbcc008cb | ||
|
|
7d32a1a829 | ||
|
|
a3d7f9f242 | ||
|
|
20a25f60ea | ||
|
|
5c5a282f91 | ||
|
|
8668198c26 | ||
|
|
a19314b087 | ||
|
|
f6d7e30b84 | ||
|
|
82609b1ebc | ||
|
|
a776104e21 | ||
|
|
56c50841ee | ||
|
|
aeb6d8c459 | ||
|
|
dc17c268e8 | ||
|
|
b366492761 | ||
|
|
9451677daa | ||
|
|
d422811bb7 | ||
|
|
3742bc626e | ||
|
|
099b744235 | ||
|
|
39627bc429 | ||
|
|
7004c2724d | ||
|
|
c2d9fa26ce | ||
|
|
f50df10591 | ||
|
|
cf13086efe | ||
|
|
3b76372254 | ||
|
|
b5df2f4314 | ||
|
|
267780bf0a | ||
|
|
f3073db42a | ||
|
|
4c7b313e0d | ||
|
|
53102502c3 | ||
|
|
7a76252007 | ||
|
|
00b5c70750 | ||
|
|
4388095cde | ||
|
|
244573e719 | ||
|
|
80b63b6729 | ||
|
|
9f4ec21f47 | ||
|
|
0aaec97527 | ||
|
|
4018b2b196 | ||
|
|
2705ed0a71 | ||
|
|
3d851033e9 | ||
|
|
ba8db1f6d7 | ||
|
|
18cea823a1 | ||
|
|
9029bf644e | ||
|
|
99c9ae127c | ||
|
|
0fdfdf71f2 | ||
|
|
3b1062d45d | ||
|
|
5a988a5087 | ||
|
|
a231706a06 | ||
|
|
2564f0f998 | ||
|
|
9a1b843ff6 | ||
|
|
a0e5e16afb | ||
|
|
0d51b76947 | ||
|
|
2b1a840002 | ||
|
|
b718ae35a8 | ||
|
|
0e2fdc95ae | ||
|
|
8cb9b479c5 | ||
|
|
1aae980c54 | ||
|
|
810daf8206 | ||
|
|
22e81810dd | ||
|
|
b823fa4450 | ||
|
|
09d4936657 | ||
|
|
f6e285103a | ||
|
|
53878eef13 | ||
|
|
130f429c6f | ||
|
|
9c852df6aa | ||
|
|
737b4c515e | ||
|
|
61f249335d | ||
|
|
8dc59763eb | ||
|
|
84965ea1a8 | ||
|
|
0c2def0e3e | ||
|
|
d0039960c4 | ||
|
|
ea98de63f7 | ||
|
|
7f6bb71eb3 | ||
|
|
ea4193222f | ||
|
|
8765b176f9 | ||
|
|
628cd8a489 | ||
|
|
842b895f09 | ||
|
|
243fb46157 | ||
|
|
74b90aa87e | ||
|
|
6dfa7f3941 | ||
|
|
6b7c9718d6 | ||
|
|
13d9e8ff38 | ||
|
|
57b04e1b5d | ||
|
|
7cd25ed605 | ||
|
|
7ec2badd21 | ||
|
|
71ff2d7177 | ||
|
|
c3c1cdd1b0 | ||
|
|
f8d8eecf80 | ||
|
|
088e54f560 | ||
|
|
c266800a3a | ||
|
|
ec20b0aa2e | ||
|
|
618af397b4 | ||
|
|
5dbf13730e | ||
|
|
4513da9496 | ||
|
|
62a4be03cf | ||
|
|
b356fee5d8 | ||
|
|
2ed889b7f2 | ||
|
|
7c6971239d | ||
|
|
482c100646 | ||
|
|
b3e0587ea0 | ||
|
|
d70156d2e2 | ||
|
|
4628763001 | ||
|
|
1e4b701749 | ||
|
|
16b3be0a76 | ||
|
|
1358850aa6 | ||
|
|
6a12362660 | ||
|
|
e5cb78cc88 | ||
|
|
efa071dd06 | ||
|
|
2546afe2aa | ||
|
|
af7eeffddb | ||
|
|
232d136885 | ||
|
|
71d2dbd0b6 | ||
|
|
6c7029ffd4 | ||
|
|
e33d8a2198 | ||
|
|
6303c0e713 | ||
|
|
3ebe6c192a | ||
|
|
d39b7bab27 | ||
|
|
ac4607ed81 | ||
|
|
b42b8886aa | ||
|
|
6944537c3e | ||
|
|
4368437475 | ||
|
|
4a3a38d1b7 | ||
|
|
40708baf7a | ||
|
|
29d89d48cb | ||
|
|
8ef918d667 | ||
|
|
69b2674c68 | ||
|
|
52d497619e | ||
|
|
8b70b8d85a | ||
|
|
5daf622aea | ||
|
|
d165d124b1 | ||
|
|
71b46c38a8 | ||
|
|
e3dc6a7a28 | ||
|
|
cc276ff0df | ||
|
|
8d9ad97c29 | ||
|
|
b797652209 | ||
|
|
9936aeea32 | ||
|
|
d91fb17a80 | ||
|
|
10beb3184e | ||
|
|
0ea75b28d4 | ||
|
|
ab5e94777c | ||
|
|
3c91b59ef9 | ||
|
|
e8ceb7189b | ||
|
|
3d3a8f0ebf | ||
|
|
b58d73b915 | ||
|
|
917838e0a5 | ||
|
|
43089bf006 | ||
|
|
d1099033ac | ||
|
|
1fb9e3d674 | ||
|
|
9cccf0515e | ||
|
|
be7cc1c2b0 | ||
|
|
fbd15b2087 | ||
|
|
299a8ee68d | ||
|
|
3a1f4d0f48 | ||
|
|
18e24d0619 | ||
|
|
a3a2b1fbbf | ||
|
|
a9c6e87c6a | ||
|
|
1ecf74c296 | ||
|
|
c3a632dca7 | ||
|
|
77ee7f0e24 | ||
|
|
4abb10eb0b | ||
|
|
3bffe223a3 | ||
|
|
e0d98dd301 | ||
|
|
f2f634448e | ||
|
|
1797efd68d | ||
|
|
0f5f3c9b97 | ||
|
|
4b1e367eda | ||
|
|
96eb0390d6 | ||
|
|
2d252ee06e | ||
|
|
b814c3184e | ||
|
|
50b17d9846 | ||
|
|
51d7169bd9 | ||
|
|
fd89b334c4 | ||
|
|
d1c82156ba | ||
|
|
f356970b89 | ||
|
|
b75c134fac | ||
|
|
4cd318756d | ||
|
|
b02599d22e | ||
|
|
6d911f68a3 | ||
|
|
542b0b6656 | ||
|
|
9ee9f28849 | ||
|
|
729ae1d787 | ||
|
|
e0fd3f4dab | ||
|
|
f1f93988fb | ||
|
|
ab3b941783 | ||
|
|
f31957e6a1 | ||
|
|
fd3042a04b | ||
|
|
209d87a856 | ||
|
|
7777eb5e15 | ||
|
|
51853f7488 | ||
|
|
c3adc61e6e | ||
|
|
1993652653 | ||
|
|
55c1446b68 | ||
|
|
19e92201b4 | ||
|
|
89e6a02e3b | ||
|
|
d395ac2879 | ||
|
|
51671c0b92 | ||
|
|
cdf918b1d0 | ||
|
|
4da28b40f0 | ||
|
|
0377f1abe1 | ||
|
|
df35462a4e | ||
|
|
af32262c28 | ||
|
|
85e320121e | ||
|
|
8796f43c6c | ||
|
|
80642dd7af | ||
|
|
692c9f8821 | ||
|
|
ed068469f3 | ||
|
|
a18b03b86f | ||
|
|
7476e29053 | ||
|
|
63cb1f8818 | ||
|
|
f613e13397 | ||
|
|
adc3604027 | ||
|
|
1ae851387f | ||
|
|
38c01971ff | ||
|
|
6787c4c3dd | ||
|
|
91d8dac9cf | ||
|
|
783ae56634 | ||
|
|
d3c3194ac3 | ||
|
|
144a08ee50 | ||
|
|
b3ecd55601 | ||
|
|
192349eee4 | ||
|
|
6b09a79d64 | ||
|
|
70e7cdcb9e | ||
|
|
ac1cd31949 | ||
|
|
8e45182357 | ||
|
|
cab74b075e | ||
|
|
6b84f9bb3e | ||
|
|
cd11059f10 | ||
|
|
d9331bfd49 | ||
|
|
68206b533b | ||
|
|
1aba78f272 | ||
|
|
a663248786 | ||
|
|
a2229b18bf | ||
|
|
432756b6e5 | ||
|
|
fe78c0f191 | ||
|
|
5b9b176c67 | ||
|
|
0cc8e5beed | ||
|
|
f2920533e9 | ||
|
|
62c9530c05 | ||
|
|
1f2922ad85 | ||
|
|
2cd1ba6a52 | ||
|
|
1733d2ea24 | ||
|
|
66971600f7 | ||
|
|
725314fb73 | ||
|
|
ec6c35c4ac | ||
|
|
b5c267fc8a | ||
|
|
ec56c72b51 | ||
|
|
f7121de4a0 | ||
|
|
577de17d24 | ||
|
|
83b3c9b3ee | ||
|
|
7d1a48807a | ||
|
|
c3c1d5bd12 | ||
|
|
8892d45b9f | ||
|
|
11e28bd619 | ||
|
|
d51aaf6304 | ||
|
|
f57c7223cf | ||
|
|
f0024f585d | ||
|
|
fd8adf3083 | ||
|
|
a1d65eb6d8 | ||
|
|
b6d364ad88 | ||
|
|
64c3642c57 | ||
|
|
e999dfcb40 | ||
|
|
84deeb6cd5 | ||
|
|
fb07bbe7b2 | ||
|
|
d1e676360d | ||
|
|
c1281e6b45 | ||
|
|
a6bdee48f3 | ||
|
|
951b5f8ecb | ||
|
|
fe0eec7e20 | ||
|
|
4df04f0ec9 | ||
|
|
3066d49cc1 | ||
|
|
7a300b63b5 | ||
|
|
628348d3e9 | ||
|
|
72ba8178a8 | ||
|
|
b39b876493 | ||
|
|
69586e7bdf | ||
|
|
f0bae7939a | ||
|
|
6ad78ca8a5 | ||
|
|
422020c4d6 | ||
|
|
0d5f5e15d4 | ||
|
|
af9cd975ce | ||
|
|
8950d68ddb | ||
|
|
65d6bc1d4c | ||
|
|
525c0cd09f | ||
|
|
2e748c998e | ||
|
|
70f4a4e18e | ||
|
|
ed3272cc44 | ||
|
|
6d1856234f | ||
|
|
91d8ea79d9 | ||
|
|
a65a89522d | ||
|
|
62b3293df0 | ||
|
|
885e9b76d6 | ||
|
|
32ddcf504c | ||
|
|
c313d451a5 | ||
|
|
781f368d42 | ||
|
|
33324a59cc | ||
|
|
10066cd4ef | ||
|
|
bde87895c8 | ||
|
|
b5995a76f7 | ||
|
|
95310eab6c | ||
|
|
39b756a0d1 | ||
|
|
12b89cd2ee | ||
|
|
746a08686b | ||
|
|
ffe3bb6763 | ||
|
|
e709842eae | ||
|
|
7a798d3ceb | ||
|
|
6d36eb78ad | ||
|
|
9d1a6d1484 | ||
|
|
3059c3b69e | ||
|
|
929af9ed03 | ||
|
|
e7fdac9d5c | ||
|
|
3d32c460eb | ||
|
|
2d5cb97288 | ||
|
|
6212264cc6 | ||
|
|
32eb5290c2 | ||
|
|
c702dcabf8 | ||
|
|
c432dc008b | ||
|
|
fb822e49f2 | ||
|
|
00bb6bf509 | ||
|
|
bccd823c8e | ||
|
|
8c003d83c4 | ||
|
|
67f29b16ef | ||
|
|
1c1cb048cd | ||
|
|
b65e5eb14e | ||
|
|
6d2f6408e4 | ||
|
|
c17059dee7 | ||
|
|
96607df7f0 | ||
|
|
edfee7f348 | ||
|
|
8b9bf75880 | ||
|
|
3d8236367d | ||
|
|
2a01c798d3 | ||
|
|
fbaaac63d4 | ||
|
|
791b427f44 | ||
|
|
bcaad515fd | ||
|
|
5acd37fa96 | ||
|
|
f5e6d111b1 | ||
|
|
bcb340da09 | ||
|
|
3696765b7d | ||
|
|
5a74c2a67e | ||
|
|
52523d33dd | ||
|
|
df370d725e | ||
|
|
0d8543d677 | ||
|
|
c9cacfb25d | ||
|
|
bde650f21e | ||
|
|
be943a9fd6 | ||
|
|
d3b2ac1507 | ||
|
|
72f199024d | ||
|
|
c84af49386 | ||
|
|
fd372629f7 | ||
|
|
76afa02dab | ||
|
|
2003610b3b | ||
|
|
a474b37212 | ||
|
|
68b5aab020 | ||
|
|
f54a336cb7 | ||
|
|
f4d08ccf80 | ||
|
|
9049402a1b | ||
|
|
f1b73350c2 | ||
|
|
8700de66e4 | ||
|
|
6c0bebccb0 | ||
|
|
437342b93e | ||
|
|
39005e27d6 | ||
|
|
2865afe759 | ||
|
|
6997bfc68d | ||
|
|
16be38887f | ||
|
|
0081d8c07f | ||
|
|
5f7141982c | ||
|
|
05330227be | ||
|
|
05dad67cc2 |
4
.github/actions/do-build/action.yml
vendored
4
.github/actions/do-build/action.yml
vendored
@@ -66,7 +66,7 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: 'Upload build logs'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: failure-logs-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: failure-logs
|
||||
@@ -74,7 +74,7 @@ runs:
|
||||
|
||||
# This is the best way I found to abort the job with an error message
|
||||
- name: 'Notify about build failures'
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: core.setFailed('Build failed. See summary for details.')
|
||||
if: steps.check.outputs.failure == 'true'
|
||||
|
||||
2
.github/actions/get-bootjdk/action.yml
vendored
2
.github/actions/get-bootjdk/action.yml
vendored
@@ -65,7 +65,7 @@ runs:
|
||||
|
||||
- name: 'Check cache for BootJDK'
|
||||
id: get-cached-bootjdk
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: bootjdk/jdk
|
||||
key: boot-jdk-${{ inputs.platform }}-${{ steps.sha256.outputs.value }}
|
||||
|
||||
4
.github/actions/get-bundles/action.yml
vendored
4
.github/actions/get-bundles/action.yml
vendored
@@ -48,14 +48,14 @@ runs:
|
||||
steps:
|
||||
- name: 'Download bundles artifact'
|
||||
id: download-bundles
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: bundles
|
||||
continue-on-error: true
|
||||
|
||||
- name: 'Download bundles artifact (retry)'
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: bundles
|
||||
|
||||
12
.github/actions/get-jtreg/action.yml
vendored
12
.github/actions/get-jtreg/action.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2023, 2024, 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
|
||||
@@ -41,7 +41,7 @@ runs:
|
||||
|
||||
- name: 'Check cache for JTReg'
|
||||
id: get-cached-jtreg
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: jtreg/installed
|
||||
key: jtreg-${{ steps.version.outputs.value }}
|
||||
@@ -56,8 +56,14 @@ runs:
|
||||
|
||||
- name: 'Build JTReg'
|
||||
run: |
|
||||
# If runner architecture is x64 set JAVA_HOME_17_X64 otherwise set to JAVA_HOME_17_arm64
|
||||
if [[ '${{ runner.arch }}' == 'X64' ]]; then
|
||||
JDK="$JAVA_HOME_17_X64"
|
||||
else
|
||||
JDK="$JAVA_HOME_17_arm64"
|
||||
fi
|
||||
# Build JTReg and move files to the proper locations
|
||||
bash make/build.sh --jdk "$JAVA_HOME_17_X64"
|
||||
bash make/build.sh --jdk "$JDK"
|
||||
mkdir ../installed
|
||||
mv build/images/jtreg/* ../installed
|
||||
working-directory: jtreg/src
|
||||
|
||||
3
.github/actions/get-msys2/action.yml
vendored
3
.github/actions/get-msys2/action.yml
vendored
@@ -30,8 +30,7 @@ runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: 'Install MSYS2'
|
||||
# use a specific release of msys2/setup-msys2 to prevent jtreg build failures on newer release
|
||||
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff
|
||||
uses: msys2/setup-msys2@v2.22.0
|
||||
with:
|
||||
install: 'autoconf tar unzip zip make'
|
||||
path-type: minimal
|
||||
|
||||
2
.github/actions/upload-bundles/action.yml
vendored
2
.github/actions/upload-bundles/action.yml
vendored
@@ -69,7 +69,7 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: 'Upload bundles artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: bundles
|
||||
|
||||
1
.github/scripts/gen-test-summary.sh
vendored
1
.github/scripts/gen-test-summary.sh
vendored
@@ -42,6 +42,7 @@ error_count=$(echo $errors | wc -w || true)
|
||||
|
||||
if [[ "$failures" = "" && "$errors" = "" ]]; then
|
||||
# We know something went wrong, but not what
|
||||
echo 'failure=true' >> $GITHUB_OUTPUT
|
||||
echo 'error-message=Unspecified test suite failure. Please see log for job for details.' >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
2
.github/workflows/build-cross-compile.yml
vendored
2
.github/workflows/build-cross-compile.yml
vendored
@@ -120,7 +120,7 @@ jobs:
|
||||
|
||||
- name: 'Check cache for sysroot'
|
||||
id: get-cached-sysroot
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: sysroot
|
||||
key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
|
||||
|
||||
11
.github/workflows/build-macos.yml
vendored
11
.github/workflows/build-macos.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
@@ -31,6 +31,9 @@ on:
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
runs-on:
|
||||
required: true
|
||||
type: string
|
||||
extra-conf-options:
|
||||
required: false
|
||||
type: string
|
||||
@@ -55,7 +58,7 @@ on:
|
||||
jobs:
|
||||
build-macos:
|
||||
name: build
|
||||
runs-on: macos-13
|
||||
runs-on: ${{ inputs.runs-on }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -74,7 +77,7 @@ jobs:
|
||||
id: bootjdk
|
||||
uses: ./.github/actions/get-bootjdk
|
||||
with:
|
||||
platform: macos-x64
|
||||
platform: ${{ inputs.platform }}
|
||||
|
||||
- name: 'Get JTReg'
|
||||
id: jtreg
|
||||
@@ -87,7 +90,7 @@ jobs:
|
||||
- name: 'Install toolchain and dependencies'
|
||||
run: |
|
||||
# Run Homebrew installation and xcode-select
|
||||
brew install make
|
||||
brew install autoconf make
|
||||
sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-toolset-version }}.app/Contents/Developer
|
||||
# This will make GNU make available as 'make' and not only as 'gmake'
|
||||
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
|
||||
|
||||
17
.github/workflows/main.yml
vendored
17
.github/workflows/main.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
@@ -228,6 +228,7 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
runs-on: 'macos-13'
|
||||
xcode-toolset-version: '14.3.1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
@@ -239,8 +240,8 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
runs-on: 'macos-14'
|
||||
xcode-toolset-version: '14.3.1'
|
||||
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-aarch64 == 'true'
|
||||
@@ -321,6 +322,16 @@ jobs:
|
||||
bootjdk-platform: macos-x64
|
||||
runs-on: macos-13
|
||||
|
||||
test-macos-aarch64:
|
||||
name: macos-aarch64
|
||||
needs:
|
||||
- build-macos-aarch64
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
bootjdk-platform: macos-aarch64
|
||||
runs-on: macos-14
|
||||
|
||||
test-windows-x64:
|
||||
name: windows-x64
|
||||
needs:
|
||||
@@ -357,7 +368,7 @@ jobs:
|
||||
# Hack to get hold of the api environment variables that are only defined for actions
|
||||
- name: 'Get API configuration'
|
||||
id: api
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
|
||||
|
||||
|
||||
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@@ -63,6 +63,7 @@ jobs:
|
||||
- 'hs/tier1 compiler part 1'
|
||||
- 'hs/tier1 compiler part 2'
|
||||
- 'hs/tier1 compiler part 3'
|
||||
- 'hs/tier1 compiler not-xcomp'
|
||||
- 'hs/tier1 gc'
|
||||
- 'hs/tier1 runtime'
|
||||
- 'hs/tier1 serviceability'
|
||||
@@ -90,13 +91,17 @@ jobs:
|
||||
debug-suffix: -debug
|
||||
|
||||
- test-name: 'hs/tier1 compiler part 2'
|
||||
test-suite: 'test/hotspot/jtreg/:tier1_compiler_2 test/hotspot/jtreg/:tier1_compiler_not_xcomp'
|
||||
test-suite: 'test/hotspot/jtreg/:tier1_compiler_2'
|
||||
debug-suffix: -debug
|
||||
|
||||
- test-name: 'hs/tier1 compiler part 3'
|
||||
test-suite: 'test/hotspot/jtreg/:tier1_compiler_3'
|
||||
debug-suffix: -debug
|
||||
|
||||
- test-name: 'hs/tier1 compiler not-xcomp'
|
||||
test-suite: 'test/hotspot/jtreg/:tier1_compiler_not_xcomp'
|
||||
debug-suffix: -debug
|
||||
|
||||
- test-name: 'hs/tier1 gc'
|
||||
test-suite: 'test/hotspot/jtreg/:tier1_gc'
|
||||
debug-suffix: -debug
|
||||
@@ -206,7 +211,7 @@ jobs:
|
||||
if: always()
|
||||
|
||||
- name: 'Upload test results'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: results
|
||||
name: ${{ steps.package.outputs.artifact-name }}
|
||||
@@ -214,7 +219,7 @@ jobs:
|
||||
|
||||
# This is the best way I found to abort the job with an error message
|
||||
- name: 'Notify about test failures'
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: core.setFailed('${{ steps.run-tests.outputs.error-message }}')
|
||||
if: steps.run-tests.outputs.failure == 'true'
|
||||
|
||||
@@ -15,7 +15,7 @@ version=0
|
||||
domain=openjdk.org
|
||||
|
||||
[checks "whitespace"]
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.gmk|.*\.m4|.*\.ac|Makefile
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.properties|.*\.gmk|.*\.m4|.*\.ac|Makefile
|
||||
ignore-tabs=.*\.gmk|Makefile
|
||||
|
||||
[checks "merge"]
|
||||
|
||||
@@ -92,6 +92,8 @@ id="toc-build-tools-requirements">Build Tools Requirements</a>
|
||||
<li><a href="#autoconf" id="toc-autoconf">Autoconf</a></li>
|
||||
<li><a href="#gnu-make" id="toc-gnu-make">GNU Make</a></li>
|
||||
<li><a href="#gnu-bash" id="toc-gnu-bash">GNU Bash</a></li>
|
||||
<li><a href="#graphviz-and-pandoc" id="toc-graphviz-and-pandoc">Graphviz
|
||||
and Pandoc</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#running-configure" id="toc-running-configure">Running
|
||||
Configure</a>
|
||||
@@ -524,7 +526,7 @@ header files as provided by your distribution.</p>
|
||||
<p>The basic tooling is provided as part of the core operating system,
|
||||
but you will most likely need to install developer packages.</p>
|
||||
<p>For apt-based distributions (Debian, Ubuntu, etc), try this:</p>
|
||||
<pre><code>sudo apt-get install build-essential</code></pre>
|
||||
<pre><code>sudo apt-get install build-essential autoconf</code></pre>
|
||||
<p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p>
|
||||
<pre><code>sudo yum groupinstall "Development Tools"</code></pre>
|
||||
<p>For Alpine Linux, aside from basic tooling, install the GNU versions
|
||||
@@ -862,6 +864,13 @@ e.g. <code>configure MAKE=/opt/gnu/make</code>.</p>
|
||||
href="https://www.gnu.org/software/bash">GNU Bash</a>. No other shells
|
||||
are supported.</p>
|
||||
<p>At least version 3.2 of GNU Bash must be used.</p>
|
||||
<h3 id="graphviz-and-pandoc">Graphviz and Pandoc</h3>
|
||||
<p>In order to build the full docs (see the
|
||||
<code>--enable-full-docs</code> configure option) <a
|
||||
href="https://www.graphviz.org">Graphviz</a> and <a
|
||||
href="https://pandoc.org">Pandoc</a> are required. Any recent versions
|
||||
should work. For reference, and subject to change, Oracle builds use
|
||||
Graphviz 9.0.0 and Pandoc 2.19.2.</p>
|
||||
<h2 id="running-configure">Running Configure</h2>
|
||||
<p>To build the JDK, you need a "configuration", which consists of a
|
||||
directory where to store the build output, coupled with information
|
||||
@@ -2157,15 +2166,26 @@ you can create a directory under <code>build</code> and run
|
||||
<code>configure</code> from there, e.g.
|
||||
<code>mkdir build/<name> && cd build/<name> && bash ../../configure</code>.</p>
|
||||
<p>Then you can build that configuration using
|
||||
<code>make CONF_NAME=<name></code> or
|
||||
<code>make CONF=<pattern></code>, where
|
||||
<code><pattern></code> is a substring matching one or several
|
||||
configurations, e.g. <code>CONF=debug</code>. The special empty pattern
|
||||
(<code>CONF=</code>) will match <em>all</em> available configuration, so
|
||||
<code>make CONF= hotspot</code> will build the <code>hotspot</code>
|
||||
target for all configurations. Alternatively, you can execute
|
||||
<code>make</code> in the configuration directory, e.g.
|
||||
<code>cd build/<name> && make</code>.</p>
|
||||
<code>make CONF=<selector></code>, where
|
||||
<code><selector></code> is interpreted as follows:</p>
|
||||
<ul>
|
||||
<li>If <code><selector></code> exacly matches the name of a
|
||||
configuration, this and only this configuration will be selected.</li>
|
||||
<li>If <code><selector></code> matches (i.e. is a substring of)
|
||||
the names of several configurations, then all these configurations will
|
||||
be selected.</li>
|
||||
<li>If <code><selector></code> is empty (i.e. <code>CONF=</code>),
|
||||
then all configurations will be selected.</li>
|
||||
<li>If <code><selector></code> begins with <code>!</code>, then
|
||||
all configurations <strong>not</strong> matching the string following
|
||||
<code>!</code> will be selected.</li>
|
||||
</ul>
|
||||
<p>A more specialized version, <code>CONF_NAME=<name></code> also
|
||||
exists, which will only match if the given <code><name></code>
|
||||
exactly matches a single configuration.</p>
|
||||
<p>Alternatively, you can execute <code>make</code> in the configuration
|
||||
directory, e.g. <code>cd build/<name> && make</code>.</p>
|
||||
<p><code>make CONF_NAME=<name></code> or</p>
|
||||
<h3 id="handling-reconfigurations">Handling Reconfigurations</h3>
|
||||
<p>If you update the repository and part of the configure script has
|
||||
changed, the build system will force you to re-run
|
||||
|
||||
@@ -349,7 +349,7 @@ will most likely need to install developer packages.
|
||||
For apt-based distributions (Debian, Ubuntu, etc), try this:
|
||||
|
||||
```
|
||||
sudo apt-get install build-essential
|
||||
sudo apt-get install build-essential autoconf
|
||||
```
|
||||
|
||||
For rpm-based distributions (Fedora, Red Hat, etc), try this:
|
||||
@@ -685,6 +685,14 @@ shells are supported.
|
||||
|
||||
At least version 3.2 of GNU Bash must be used.
|
||||
|
||||
### Graphviz and Pandoc
|
||||
|
||||
In order to build the full docs (see the `--enable-full-docs`
|
||||
configure option) [Graphviz](https://www.graphviz.org) and
|
||||
[Pandoc](https://pandoc.org) are required. Any recent versions should
|
||||
work. For reference, and subject to change, Oracle builds use Graphviz
|
||||
9.0.0 and Pandoc 2.19.2.
|
||||
|
||||
## Running Configure
|
||||
|
||||
To build the JDK, you need a "configuration", which consists of a directory
|
||||
@@ -1944,12 +1952,25 @@ configuration with the name `<name>`. Alternatively, you can create a directory
|
||||
under `build` and run `configure` from there, e.g. `mkdir build/<name> && cd
|
||||
build/<name> && bash ../../configure`.
|
||||
|
||||
Then you can build that configuration using `make CONF_NAME=<name>` or `make
|
||||
CONF=<pattern>`, where `<pattern>` is a substring matching one or several
|
||||
configurations, e.g. `CONF=debug`. The special empty pattern (`CONF=`) will
|
||||
match *all* available configuration, so `make CONF= hotspot` will build the
|
||||
`hotspot` target for all configurations. Alternatively, you can execute `make`
|
||||
in the configuration directory, e.g. `cd build/<name> && make`.
|
||||
Then you can build that configuration using `make CONF=<selector>`, where
|
||||
`<selector>` is interpreted as follows:
|
||||
|
||||
* If `<selector>` exacly matches the name of a configuration, this and only
|
||||
this configuration will be selected.
|
||||
* If `<selector>` matches (i.e. is a substring of) the names of several
|
||||
configurations, then all these configurations will be selected.
|
||||
* If `<selector>` is empty (i.e. `CONF=`), then all configurations will be
|
||||
selected.
|
||||
* If `<selector>` begins with `!`, then all configurations **not** matching the
|
||||
string following `!` will be selected.
|
||||
|
||||
A more specialized version, `CONF_NAME=<name>` also exists, which will only
|
||||
match if the given `<name>` exactly matches a single configuration.
|
||||
|
||||
Alternatively, you can execute `make` in the configuration directory, e.g. `cd
|
||||
build/<name> && make`.
|
||||
|
||||
`make CONF_NAME=<name>` or
|
||||
|
||||
### Handling Reconfigurations
|
||||
|
||||
|
||||
@@ -642,7 +642,7 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
|
||||
# Unset the following to suppress the link to the tool guides
|
||||
NAV_LINK_GUIDES := --nav-link-guides
|
||||
HEADER_RIGHT_SIDE_INFO := <strong>$(subst &,&,$(JDK_SHORT_NAME))$(DRAFT_MARKER_STR)</strong>
|
||||
HEADER_RIGHT_SIDE_INFO := <strong>$(subst &,&,$(JDK_SHORT_NAME))</strong>$(DRAFT_MARKER_STR)
|
||||
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
|
||||
|
||||
@@ -87,10 +87,9 @@ help:
|
||||
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata))
|
||||
$(info )
|
||||
$(info Make control variables)
|
||||
$(info $(_) CONF= # Build all configurations (note, assignment is empty))
|
||||
$(info $(_) CONF=<substring> # Build the configuration(s) with a name matching)
|
||||
$(info $(_) # <substring>)
|
||||
$(info $(_) CONF_NAME=<string> # Build the configuration with exactly the <string>)
|
||||
$(info $(_) CONF=<selector> # Select which configuration(s) to build)
|
||||
$(info $(_) CONF= # Select all configurations (note, assignment is empty))
|
||||
$(info $(_) CONF_NAME=<string> # Select the configuration with the name <string>)
|
||||
$(info $(_) SPEC=<spec file> # Build the configuration given by the spec file)
|
||||
$(info $(_) LOG=<loglevel> # Change the log level from warn to <loglevel>)
|
||||
$(info $(_) # Available log levels are:)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2024, 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
|
||||
@@ -38,7 +38,7 @@ HSDIS_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/hsdis
|
||||
REAL_HSDIS_NAME := hsdis-$(OPENJDK_TARGET_CPU_LEGACY_LIB)$(SHARED_LIBRARY_SUFFIX)
|
||||
BUILT_HSDIS_LIB := $(HSDIS_OUTPUT_DIR)/$(REAL_HSDIS_NAME)
|
||||
|
||||
HSDIS_TOOLCHAIN := TOOLCHAIN_DEFAULT
|
||||
HSDIS_LINK_TYPE := C
|
||||
HSDIS_TOOLCHAIN_CFLAGS := $(CFLAGS_JDKLIB)
|
||||
HSDIS_TOOLCHAIN_LDFLAGS := $(LDFLAGS_JDKLIB)
|
||||
|
||||
@@ -59,8 +59,8 @@ endif
|
||||
|
||||
ifeq ($(HSDIS_BACKEND), llvm)
|
||||
# Use C++ instead of C
|
||||
HSDIS_LINK_TYPE := C++
|
||||
HSDIS_TOOLCHAIN_CFLAGS := $(CXXFLAGS_JDKLIB)
|
||||
HSDIS_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
LLVM_OS := pc-linux-gnu
|
||||
@@ -91,14 +91,11 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
endif
|
||||
endif
|
||||
|
||||
$(eval $(call DefineNativeToolchain, TOOLCHAIN_MINGW, \
|
||||
CC := $(MINGW_BASE)-gcc, \
|
||||
LD := $(MINGW_BASE)-ld, \
|
||||
OBJCOPY := $(MINGW_BASE)-objcopy, \
|
||||
RC := $(RC), \
|
||||
SYSROOT_CFLAGS := --sysroot=$(MINGW_SYSROOT), \
|
||||
SYSROOT_LDFLAGS := --sysroot=$(MINGW_SYSROOT), \
|
||||
))
|
||||
BUILD_HSDIS_CC := $(MINGW_BASE)-gcc
|
||||
BUILD_HSDIS_LD := $(MINGW_BASE)-ld
|
||||
BUILD_HSDIS_OBJCOPY := $(MINGW_BASE)-objcopy
|
||||
BUILD_HSDIS_SYSROOT_CFLAGS := --sysroot=$(MINGW_SYSROOT)
|
||||
BUILD_HSDIS_SYSROOT_LDFLAGS := --sysroot=$(MINGW_SYSROOT)
|
||||
|
||||
MINGW_SYSROOT_LIB_PATH := $(MINGW_SYSROOT)/mingw/lib
|
||||
ifeq ($(wildcard $(MINGW_SYSROOT_LIB_PATH)), )
|
||||
@@ -122,8 +119,8 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
|
||||
TOOLCHAIN_TYPE := gcc
|
||||
OPENJDK_TARGET_OS := linux
|
||||
OPENJDK_TARGET_OS_TYPE := unix
|
||||
CC_OUT_OPTION := -o$(SPACE)
|
||||
LD_OUT_OPTION := -o$(SPACE)
|
||||
GENDEPS_FLAGS := -MMD -MF
|
||||
CFLAGS_DEBUG_SYMBOLS := -g
|
||||
DISABLED_WARNINGS :=
|
||||
@@ -131,7 +128,6 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
CFLAGS_WARNINGS_ARE_ERRORS := -Werror
|
||||
SHARED_LIBRARY_FLAGS := -shared
|
||||
|
||||
HSDIS_TOOLCHAIN := TOOLCHAIN_MINGW
|
||||
HSDIS_TOOLCHAIN_CFLAGS :=
|
||||
HSDIS_TOOLCHAIN_LDFLAGS := -L$(MINGW_GCC_LIB_PATH) -L$(MINGW_SYSROOT_LIB_PATH)
|
||||
MINGW_DLLCRT := $(MINGW_SYSROOT_LIB_PATH)/dllcrt2.o
|
||||
@@ -144,9 +140,9 @@ endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_HSDIS, \
|
||||
NAME := hsdis, \
|
||||
LINK_TYPE := $(HSDIS_LINK_TYPE), \
|
||||
SRC := $(TOPDIR)/src/utils/hsdis/$(HSDIS_BACKEND), \
|
||||
EXTRA_HEADER_DIRS := $(TOPDIR)/src/utils/hsdis, \
|
||||
TOOLCHAIN := $(HSDIS_TOOLCHAIN), \
|
||||
OUTPUT_DIR := $(HSDIS_OUTPUT_DIR), \
|
||||
OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \
|
||||
DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -202,8 +202,14 @@ ifeq ($(HAS_SPEC),)
|
||||
matching_confs := $$(strip $$(all_confs))
|
||||
else
|
||||
# Otherwise select those that contain the given CONF string
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
|
||||
ifeq ($$(patsubst !%,,$$(CONF)),)
|
||||
# A CONF starting with ! means we should negate the search term
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
|
||||
else
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
|
||||
endif
|
||||
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
|
||||
# If we found an exact match, use that
|
||||
matching_confs := $$(CONF)
|
||||
@@ -421,8 +427,9 @@ else # $(HAS_SPEC)=true
|
||||
|
||||
# Cleanup after a compare build
|
||||
define CleanupCompareBuild
|
||||
# If running with a COMPARE_BUILD patch, reverse-apply it
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
|
||||
# If running with a COMPARE_BUILD patch, reverse-apply it, but continue
|
||||
# even if that fails (can happen with removed files).
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
|
||||
# Move this build away and restore the original build
|
||||
$(MKDIR) -p $(topdir)/build/compare-build
|
||||
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)
|
||||
|
||||
@@ -969,20 +969,28 @@ else
|
||||
|
||||
jdk.jdeps-gendata: java
|
||||
|
||||
# The ct.sym generation uses all the moduleinfos as input
|
||||
jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS) $(JAVA_TARGETS)
|
||||
# jdk.compiler-gendata needs the BUILD_JDK. If the BUILD_JDK was supplied
|
||||
# externally, no extra prerequisites are needed.
|
||||
# jdk.compiler gendata generates ct.sym, which requires all generated
|
||||
# java source and compiled classes present.
|
||||
jdk.compiler-gendata: $(JAVA_TARGETS)
|
||||
|
||||
# jdk.javadoc gendata generates element-list, which requires all java sources
|
||||
# but not compiled classes.
|
||||
jdk.javadoc-gendata: $(GENSRC_TARGETS)
|
||||
|
||||
# ct.sym and element-list generation also needs the BUILD_JDK. If the
|
||||
# BUILD_JDK was supplied externally, no extra prerequisites are needed.
|
||||
ifeq ($(CREATE_BUILDJDK), true)
|
||||
ifneq ($(CREATING_BUILDJDK), true)
|
||||
# When cross compiling and an external BUILD_JDK wasn't supplied, it's
|
||||
# produced by the create-buildjdk target.
|
||||
jdk.compiler-gendata: create-buildjdk
|
||||
jdk.javadoc-gendata: create-buildjdk
|
||||
endif
|
||||
else ifeq ($(EXTERNAL_BUILDJDK), false)
|
||||
# When not cross compiling, the BUILD_JDK is the interim jdk image, and
|
||||
# the javac launcher is needed.
|
||||
jdk.compiler-gendata: jdk.compiler-launchers
|
||||
jdk.javadoc-gendata: jdk.compiler-launchers
|
||||
endif
|
||||
|
||||
# Declare dependencies between jmod targets.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -123,6 +123,22 @@ AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
|
||||
]
|
||||
)
|
||||
AC_SUBST(BUILD_ENV)
|
||||
|
||||
if test "x$LOCALE" != x; then
|
||||
# Check if we actually have C.UTF-8; if so, use it
|
||||
if $LOCALE -a | $GREP -q -E "^C\.(utf8|UTF-8)$"; then
|
||||
LOCALE_USED=C.UTF-8
|
||||
else
|
||||
AC_MSG_WARN([C.UTF-8 locale not found, using C locale])
|
||||
LOCALE_USED=C
|
||||
fi
|
||||
else
|
||||
AC_MSG_WARN([locale command not not found, using C locale])
|
||||
LOCALE_USED=C
|
||||
fi
|
||||
|
||||
export LC_ALL=$LOCALE_USED
|
||||
AC_SUBST(LOCALE_USED)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -54,6 +54,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
|
||||
|
||||
# Tools only needed on some platforms
|
||||
UTIL_LOOKUP_PROGS(LOCALE, locale)
|
||||
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
|
||||
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
|
||||
])
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -54,18 +54,18 @@ AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
fi[]dnl
|
||||
])# PKG_PROG_PKG_CONFIG
|
||||
|
||||
@@ -97,7 +97,7 @@ m4_define([_PKG_CONFIG],
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
[pkg_failed=yes])
|
||||
[pkg_failed=yes])
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
@@ -143,14 +143,14 @@ See the pkg-config man page for more details.])
|
||||
if test $pkg_failed = yes; then
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
@@ -160,10 +160,10 @@ installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT
|
||||
])],
|
||||
[AC_MSG_RESULT([no])
|
||||
[AC_MSG_RESULT([no])
|
||||
$4])
|
||||
elif test $pkg_failed = untried; then
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
@@ -171,11 +171,11 @@ path to pkg-config.
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
|
||||
[$4])
|
||||
[$4])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
ifelse([$3], , :, [$3])
|
||||
ifelse([$3], , :, [$3])
|
||||
fi[]dnl
|
||||
])# PKG_CHECK_MODULES
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2024, 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
|
||||
@@ -40,6 +40,7 @@ LDCXX := @BUILD_LDCXX@
|
||||
AS := @BUILD_AS@
|
||||
NM := @BUILD_NM@
|
||||
AR := @BUILD_AR@
|
||||
LIB := @BUILD_LIB@
|
||||
OBJCOPY := @BUILD_OBJCOPY@
|
||||
STRIP := @BUILD_STRIP@
|
||||
SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@
|
||||
|
||||
@@ -40,7 +40,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
@@ -49,7 +48,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)'
|
||||
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
|
||||
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# Linking is different on aix
|
||||
@@ -57,14 +55,12 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_EXECUTABLE_ORIGIN=""
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
|
||||
else
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
|
||||
# arm specific settings
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xarm"; then
|
||||
@@ -80,20 +76,17 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_EXECUTABLE_ORIGIN=""
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
SHARED_LIBRARY_FLAGS="-dll"
|
||||
SET_EXECUTABLE_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'
|
||||
fi
|
||||
|
||||
AC_SUBST(SET_EXECUTABLE_ORIGIN)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_NAME)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
|
||||
AC_SUBST(SHARED_LIBRARY_FLAGS)
|
||||
])
|
||||
|
||||
@@ -122,6 +115,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
# Add debug prefix map gcc system include paths, as they cause
|
||||
# non-deterministic debug paths depending on gcc path location.
|
||||
DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS
|
||||
|
||||
# Add debug prefix map for OUTPUTDIR to handle the scenario when
|
||||
# it is not located within WORKSPACE_ROOT
|
||||
outputdir_slash="${OUTPUTDIR%/}/"
|
||||
DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS -fdebug-prefix-map=${outputdir_slash}="
|
||||
]
|
||||
)
|
||||
fi
|
||||
@@ -479,13 +477,14 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
[
|
||||
#### OS DEFINES, these should be independent on toolchain
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
CFLAGS_OS_DEF_JVM="-DLINUX"
|
||||
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
||||
CFLAGS_OS_DEF_JVM="-DLINUX -D_FILE_OFFSET_BITS=64"
|
||||
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
CFLAGS_OS_DEF_JVM="-DAIX"
|
||||
CFLAGS_OS_DEF_JVM="-DAIX -D_LARGE_FILES"
|
||||
CFLAGS_OS_DEF_JDK="-D_LARGE_FILES"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
@@ -543,7 +542,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
ALWAYS_DEFINES_JVM="-D_REENTRANT"
|
||||
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
|
||||
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -DSTDC"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# Access APIs for Windows 8 and above
|
||||
# see https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -93,7 +93,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
BASIC_LDFLAGS="-nologo -opt:ref"
|
||||
BASIC_LDFLAGS="-opt:ref"
|
||||
BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
|
||||
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -33,9 +33,6 @@ AC_DEFUN([FLAGS_SETUP_ARFLAGS],
|
||||
# FIXME: figure out if we should select AR flags depending on OS or toolchain.
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
ARFLAGS="-X64"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
# lib.exe is used as AR to create static libraries.
|
||||
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
|
||||
else
|
||||
ARFLAGS=""
|
||||
fi
|
||||
@@ -43,6 +40,18 @@ AC_DEFUN([FLAGS_SETUP_ARFLAGS],
|
||||
AC_SUBST(ARFLAGS)
|
||||
])
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_LIBFLAGS],
|
||||
[
|
||||
# LIB is used to create static libraries on Windows
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
LIBFLAGS="-nodefaultlib:msvcrt"
|
||||
else
|
||||
LIBFLAGS=""
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBFLAGS)
|
||||
])
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_STRIPFLAGS],
|
||||
[
|
||||
## Setup strip.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -364,24 +364,12 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
CC_OUT_OPTION=-Fo
|
||||
LD_OUT_OPTION=-out:
|
||||
AR_OUT_OPTION=-out:
|
||||
else
|
||||
# The option used to specify the target .o,.a or .so file.
|
||||
# When compiling, how to specify the to be created object file.
|
||||
CC_OUT_OPTION='-o$(SPACE)'
|
||||
# When linking, how to specify the output
|
||||
LD_OUT_OPTION='-o$(SPACE)'
|
||||
# When archiving, how to specify the destination static archive.
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
AR_OUT_OPTION='-r -cs$(SPACE)'
|
||||
else
|
||||
AR_OUT_OPTION='-rcs$(SPACE)'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(CC_OUT_OPTION)
|
||||
AC_SUBST(LD_OUT_OPTION)
|
||||
AC_SUBST(AR_OUT_OPTION)
|
||||
|
||||
# Generate make dependency files
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
@@ -423,6 +411,7 @@ AC_DEFUN([FLAGS_SETUP_FLAGS],
|
||||
FLAGS_SETUP_LDFLAGS
|
||||
|
||||
FLAGS_SETUP_ARFLAGS
|
||||
FLAGS_SETUP_LIBFLAGS
|
||||
FLAGS_SETUP_STRIPFLAGS
|
||||
FLAGS_SETUP_RCFLAGS
|
||||
FLAGS_SETUP_NMFLAGS
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -56,8 +56,8 @@ COMMA := ,
|
||||
# What make to use for main processing, after bootstrapping top-level Makefile.
|
||||
MAKE := @MAKE@
|
||||
|
||||
# Make sure all shell commands are executed with the C locale
|
||||
export LC_ALL := C
|
||||
# Make sure all shell commands are executed with a proper locale
|
||||
export LC_ALL := @LOCALE_USED@
|
||||
|
||||
# Make sure we override any local CLASSPATH variable
|
||||
export CLASSPATH := @CLASSPATH@
|
||||
@@ -498,8 +498,6 @@ COMPILER_COMMAND_FILE_FLAG := @COMPILER_COMMAND_FILE_FLAG@
|
||||
COMPILER_BINDCMD_FILE_FLAG := @COMPILER_BINDCMD_FILE_FLAG@
|
||||
|
||||
CC_OUT_OPTION := @CC_OUT_OPTION@
|
||||
LD_OUT_OPTION := @LD_OUT_OPTION@
|
||||
AR_OUT_OPTION := @AR_OUT_OPTION@
|
||||
|
||||
# Flags used for overriding the default opt setting for a C/C++ source file.
|
||||
C_O_FLAG_HIGHEST_JVM := @C_O_FLAG_HIGHEST_JVM@
|
||||
@@ -604,10 +602,10 @@ BUILD_SYSROOT_LDFLAGS := @BUILD_SYSROOT_LDFLAGS@
|
||||
|
||||
AS := @AS@
|
||||
|
||||
# AR is used to create a static library (is ar in unix, lib.exe in windows)
|
||||
AR := @AR@
|
||||
ARFLAGS := @ARFLAGS@
|
||||
|
||||
LIB := @LIB@
|
||||
LIBFLAGS := @LIBFLAGS@
|
||||
NM := @NM@
|
||||
NMFLAGS := @NMFLAGS@
|
||||
STRIP := @STRIP@
|
||||
@@ -619,10 +617,6 @@ INSTALL_NAME_TOOL := @INSTALL_NAME_TOOL@
|
||||
METAL := @METAL@
|
||||
METALLIB := @METALLIB@
|
||||
|
||||
# Options to linker to specify a mapfile.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_MAPFILE = @SET_SHARED_LIBRARY_MAPFILE@
|
||||
|
||||
#
|
||||
# Options for generating debug symbols
|
||||
COMPILE_WITH_DEBUG_SYMBOLS := @COMPILE_WITH_DEBUG_SYMBOLS@
|
||||
|
||||
@@ -732,11 +732,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
|
||||
AC_SUBST(AS)
|
||||
|
||||
#
|
||||
# Setup the archiver (AR)
|
||||
# Setup tools for creating static libraries (AR/LIB)
|
||||
#
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# The corresponding ar tool is lib.exe (used to create static libraries)
|
||||
UTIL_LOOKUP_TOOLCHAIN_PROGS(AR, lib)
|
||||
UTIL_LOOKUP_TOOLCHAIN_PROGS(LIB, lib)
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
UTIL_LOOKUP_TOOLCHAIN_PROGS(AR, ar gcc-ar)
|
||||
else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -152,6 +152,10 @@ define SetupLogging
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
|
||||
SHELL := $$(SHELL) -x
|
||||
endif
|
||||
|
||||
ifeq ($$(LOG_LEVEL), trace)
|
||||
SHELL_NO_RECURSE := $$(SHELL)
|
||||
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2024, 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
|
||||
@@ -103,6 +103,7 @@ define SetupTestFilesCompilationBody
|
||||
$$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
|
||||
NAME := $$(unprefixed_name), \
|
||||
TYPE := $$($1_COMPILATION_TYPE), \
|
||||
LINK_TYPE := $(if $$(filter %.cpp, $$(file)), C++, C), \
|
||||
EXTRA_FILES := $$(file) $$($1_EXTRA_FILES), \
|
||||
OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \
|
||||
OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
|
||||
@@ -113,7 +114,6 @@ define SetupTestFilesCompilationBody
|
||||
DISABLED_WARNINGS_clang := undef format-nonliteral \
|
||||
missing-field-initializers sometimes-uninitialized, \
|
||||
LIBS := $$($1_LIBS_$$(name)), \
|
||||
TOOLCHAIN := $(if $$(filter %.cpp, $$(file)), TOOLCHAIN_LINK_CXX, TOOLCHAIN_DEFAULT), \
|
||||
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \
|
||||
COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \
|
||||
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \
|
||||
|
||||
351
make/common/native/CompileFile.gmk
Normal file
351
make/common/native/CompileFile.gmk
Normal file
@@ -0,0 +1,351 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to compiling a single native source
|
||||
# file (C, C++ or Objective-C) into an object file. It also harbours related
|
||||
# functionality for generating PCH (precompiled headers) and Windows resource
|
||||
# files.
|
||||
|
||||
################################################################################
|
||||
# Creates a recipe that creates a compile_commands.json fragment. Remove any
|
||||
# occurrences of FIXPATH programs from the command to show the actual invocation.
|
||||
#
|
||||
# Param 1: Name of file to create
|
||||
# Param 2: Working directory
|
||||
# Param 3: Source file
|
||||
# Param 4: Compile command
|
||||
################################################################################
|
||||
define WriteCompileCommandsFragment
|
||||
$(call LogInfo, Creating compile commands fragment for $(notdir $3))
|
||||
$(call MakeDir, $(dir $1))
|
||||
$(call WriteFile,{ \
|
||||
"directory": "$(strip $(call FixPath, $2))"$(COMMA) \
|
||||
"file": "$(strip $(call FixPath, $3))"$(COMMA) \
|
||||
"command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\,\
|
||||
$(subst $(FIXPATH),,$(call FixPath, $4)))))" \
|
||||
}$(COMMA), \
|
||||
$1)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Extensions of files handled by this macro.
|
||||
NATIVE_SOURCE_EXTENSIONS := %.S %.c %.cpp %.cc %.m %.mm
|
||||
|
||||
# Replaces native source extensions with the object file extension in a string.
|
||||
# Param 1: the string containing source file names with extensions
|
||||
# The surrounding strip is needed to keep additional whitespace out
|
||||
define replace_with_obj_extension
|
||||
$(strip \
|
||||
$(foreach extension, $(NATIVE_SOURCE_EXTENSIONS), \
|
||||
$(patsubst $(extension),%$(OBJ_SUFFIX), $(filter $(extension), $1))) \
|
||||
)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# This pattern is used to transform the output of the microsoft CL compiler
|
||||
# into a make syntax dependency file (.d)
|
||||
WINDOWS_SHOWINCLUDE_SED_PATTERN := \
|
||||
-e '/^Note: including file:/!d' \
|
||||
-e 's|Note: including file: *||' \
|
||||
-e 's|\r||g' \
|
||||
-e 's|\\|/|g' \
|
||||
-e 's|^\([a-zA-Z]\):|$(WINENV_PREFIX)/\1|g' \
|
||||
-e '\|$(TOPDIR)|I !d' \
|
||||
-e 's|$$$$| \\|g' \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This pattern is used to transform a dependency file (.d) to a list
|
||||
# of make targets for dependent files (.d.targets)
|
||||
DEPENDENCY_TARGET_SED_PATTERN := \
|
||||
-e 's/\#.*//' \
|
||||
-e 's/^[^:]*: *//' \
|
||||
-e 's/ *\\$$$$//' \
|
||||
-e 's/^[ ]*//' \
|
||||
-e '/^$$$$/ d' \
|
||||
-e 's/$$$$/ :/' \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Create the recipe needed to compile a single native source file.
|
||||
#
|
||||
# Parameter 1 is the name of the rule, based on the name of the library/
|
||||
# program being build and the name of the source code file, e.g.
|
||||
# BUILD_LIBFOO_fooMain.cpp.
|
||||
#
|
||||
# Remaining parameters are named arguments:
|
||||
# FILE - The full path of the source file to compiler
|
||||
# BASE - The name of the rule for the entire binary to build ($1)
|
||||
#
|
||||
CreateCompiledNativeFile = $(NamedParamsMacroTemplate)
|
||||
define CreateCompiledNativeFileBody
|
||||
$1_FILENAME := $$(notdir $$($1_FILE))
|
||||
|
||||
# The target file to be generated.
|
||||
$1_OBJ := $$($$($1_BASE)_OBJECT_DIR)/$$(call replace_with_obj_extension, \
|
||||
$$($1_FILENAME))
|
||||
|
||||
# Generate the corresponding compile_commands.json fragment.
|
||||
$1_OBJ_JSON = $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \
|
||||
$$(OUTPUTDIR)/,,$$($1_OBJ))).json
|
||||
$$($1_BASE)_ALL_OBJS_JSON += $$($1_OBJ_JSON)
|
||||
|
||||
# Only continue if this object file hasn't been processed already. This lets
|
||||
# the first found source file override any other with the same name.
|
||||
ifeq ($$($1_OBJ_PROCESSED), )
|
||||
$1_OBJ_PROCESSED := true
|
||||
# This is the definite source file to use for $1_FILENAME.
|
||||
$1_SRC_FILE := $$($1_FILE)
|
||||
|
||||
$$(eval $$(call SetupCompileFileFlags,$1,$$($1_BASE)))
|
||||
|
||||
ifneq ($$(filter %.c, $$($1_FILENAME)), )
|
||||
# Compile as a C file
|
||||
$1_CFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CFLAGS) \
|
||||
$$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CC)
|
||||
else ifneq ($$(filter %.m, $$($1_FILENAME)), )
|
||||
# Compile as an Objective-C file
|
||||
$1_CFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := -x objective-c $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) \
|
||||
$$($1_BASE_CFLAGS) $$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CC)
|
||||
else ifneq ($$(filter %.S, $$($1_FILENAME)), )
|
||||
# Compile as preprocessed assembler file
|
||||
$1_FLAGS := $(BASIC_ASFLAGS) $$($1_BASE_ASFLAGS)
|
||||
$1_COMPILER := $(AS)
|
||||
|
||||
# gcc or clang assembly files must contain an appropriate relative .file
|
||||
# path for reproducible builds.
|
||||
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)
|
||||
$1_REL_ASM_SRC := $$(call RelativePath, $$($1_FILE), $(WORKSPACE_ROOT))
|
||||
else
|
||||
$1_REL_ASM_SRC := $$($1_FILE)
|
||||
endif
|
||||
$1_FLAGS := $$($1_FLAGS) -DASSEMBLY_SRC_FILE='"$$($1_REL_ASM_SRC)"' \
|
||||
-include $(TOPDIR)/make/data/autoheaders/assemblyprefix.h
|
||||
endif
|
||||
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
|
||||
# Compile as a C++ or Objective-C++ file
|
||||
$1_CXXFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CXXFLAGS) \
|
||||
$$($1_OPT_CXXFLAGS) $$($1_CXXFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CXX)
|
||||
else
|
||||
$$(error Internal error in NativeCompilation.gmk: no compiler for file $$($1_FILENAME))
|
||||
endif
|
||||
|
||||
# And this is the dependency file for this obj file.
|
||||
$1_DEPS_FILE := $$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_OBJ))
|
||||
# The dependency target file lists all dependencies as empty targets to
|
||||
# avoid make error "No rule to make target" for removed files
|
||||
$1_DEPS_TARGETS_FILE := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_OBJ))
|
||||
|
||||
# Only try to load individual dependency information files if the global
|
||||
# file hasn't been loaded (could happen if make was interrupted).
|
||||
ifneq ($$($$($1_BASE)_DEPS_FILE_LOADED), true)
|
||||
# Include previously generated dependency information. (if it exists)
|
||||
-include $$($1_DEPS_FILE)
|
||||
-include $$($1_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
|
||||
ifneq ($$(strip $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)), )
|
||||
$1_VARDEPS := $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_OBJ).vardeps)
|
||||
endif
|
||||
|
||||
$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 and clang ensure random symbol generation is
|
||||
# seeded deterministically
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
$1_COMPILE_OPTIONS += -frandom-seed="$$($1_FILENAME)"
|
||||
endif
|
||||
|
||||
$$($1_OBJ_JSON): $$($1_OBJ_DEPS)
|
||||
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$($1_SRC_FILE), \
|
||||
$$($1_COMPILER) $$($1_COMPILE_OPTIONS))
|
||||
|
||||
$$($1_OBJ): $$($1_OBJ_DEPS) | $$($$($1_BASE)_BUILD_INFO)
|
||||
$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
|
||||
$$(call MakeDir, $$(@D))
|
||||
ifneq ($(TOOLCHAIN_TYPE), microsoft)
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_COMPILER) $$(GENDEPS_FLAGS) \
|
||||
$$(addsuffix .tmp, $$($1_DEPS_FILE)) \
|
||||
$$($1_COMPILE_OPTIONS)))
|
||||
ifneq ($$($1_DEPS_FILE), )
|
||||
$$(call fix-deps-file, $$($1_DEPS_FILE))
|
||||
# Create a dependency target file from the dependency file.
|
||||
# Solution suggested by:
|
||||
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) \
|
||||
> $$($1_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
else
|
||||
# The Visual Studio compiler lacks a feature for generating make
|
||||
# dependencies, but by setting -showIncludes, all included files are
|
||||
# printed. These are filtered out and parsed into make dependences.
|
||||
#
|
||||
# Keep as much as possible on one execution line for best performance
|
||||
# on Windows. No need to save exit code from compilation since
|
||||
# pipefail is always active on Windows.
|
||||
ifeq ($$(filter %.S, $$($1_FILENAME)), )
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS))) \
|
||||
| $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
|
||||
-e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \
|
||||
$(ECHO) $$@: \\ > $$($1_DEPS_FILE) ; \
|
||||
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_OBJ).log \
|
||||
| $(SORT) -u >> $$($1_DEPS_FILE) ; \
|
||||
$(ECHO) >> $$($1_DEPS_FILE) ; \
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) > $$($1_DEPS_TARGETS_FILE)
|
||||
else
|
||||
# For assembler calls just create empty dependency lists
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_COMPILER) $$($1_FLAGS) \
|
||||
$(CC_OUT_OPTION)$$($1_OBJ) -Ta $$($1_SRC_FILE))) \
|
||||
| $(TR) -d '\r' | $(GREP) -v -e "Assembling:" || test "$$$$?" = "1" ; \
|
||||
$(ECHO) > $$($1_DEPS_FILE) ; \
|
||||
$(ECHO) > $$($1_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreatePrecompiledHeader
|
||||
ifneq ($$($1_PRECOMPILED_HEADER), )
|
||||
ifeq ($(USE_PRECOMPILED_HEADER), true)
|
||||
ifeq ($(TOOLCHAIN_TYPE), microsoft)
|
||||
$1_PCH_FILE := $$($1_OBJECT_DIR)/$1.pch
|
||||
$1_GENERATED_PCH_SRC := $$($1_OBJECT_DIR)/$1_pch.cpp
|
||||
$1_GENERATED_PCH_OBJ := $$($1_OBJECT_DIR)/$1_pch$(OBJ_SUFFIX)
|
||||
|
||||
$$(eval $$(call CreateCompiledNativeFile, $1_$$(notdir $$($1_GENERATED_PCH_SRC)), \
|
||||
FILE := $$($1_GENERATED_PCH_SRC), \
|
||||
BASE := $1, \
|
||||
EXTRA_CXXFLAGS := -Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \
|
||||
))
|
||||
|
||||
$1_USE_PCH_FLAGS := \
|
||||
-Fp$$($1_PCH_FILE) -Yu$$(notdir $$($1_PRECOMPILED_HEADER))
|
||||
|
||||
$$($1_ALL_OBJS): $$($1_GENERATED_PCH_OBJ)
|
||||
|
||||
# Explicitly add the pch obj file first to ease comparing to old
|
||||
# hotspot build.
|
||||
$1_ALL_OBJS := $$($1_GENERATED_PCH_OBJ) $$($1_ALL_OBJS)
|
||||
|
||||
$$($1_GENERATED_PCH_SRC):
|
||||
$(ECHO) "#include \"$$(notdir $$($1_PRECOMPILED_HEADER))\"" > $$@
|
||||
|
||||
else ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
$1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).gch
|
||||
$1_USE_PCH_FLAGS := -I$$($1_OBJECT_DIR)/precompiled
|
||||
else ifeq ($(TOOLCHAIN_TYPE), clang)
|
||||
$1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).pch
|
||||
$1_USE_PCH_FLAGS := -include-pch $$($1_PCH_FILE)
|
||||
endif
|
||||
$1_PCH_DEPS_FILE := $$($1_PCH_FILE).d
|
||||
$1_PCH_DEPS_TARGETS_FILE := $$($1_PCH_FILE).d.targets
|
||||
|
||||
-include $$($1_PCH_DEPS_FILE)
|
||||
-include $$($1_PCH_DEPS_TARGETS_FILE)
|
||||
|
||||
$1_PCH_COMMAND := $$($1_CC) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS) \
|
||||
$$($1_OPT_CFLAGS) -x c++-header -c $(GENDEPS_FLAGS) \
|
||||
$$(addsuffix .tmp, $$($1_PCH_DEPS_FILE))
|
||||
|
||||
$$($1_PCH_FILE): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
|
||||
$$(call LogInfo, Generating precompiled header)
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_PCH_COMMAND) $$< -o $$@))
|
||||
$$(call fix-deps-file, $$($1_PCH_DEPS_FILE))
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_PCH_DEPS_FILE) \
|
||||
> $$($1_PCH_DEPS_TARGETS_FILE)
|
||||
|
||||
$$($1_ALL_OBJS): $$($1_PCH_FILE)
|
||||
|
||||
# Generate the corresponding compile_commands.json fragment.
|
||||
$1_PCH_FILE_JSON := $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \
|
||||
$$(OUTPUTDIR)/,,$$($1_PCH_FILE))).json
|
||||
$1_ALL_OBJS_JSON += $$($1_PCH_FILE_JSON)
|
||||
|
||||
$$($1_PCH_FILE_JSON): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
|
||||
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$<, \
|
||||
$$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateWindowsResourceFile
|
||||
ifneq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res
|
||||
$1_RES_DEPS_FILE := $$($1_RES).d
|
||||
$1_RES_DEPS_TARGETS_FILE := $$($1_RES).d.targets
|
||||
-include $$($1_RES_DEPS_FILE)
|
||||
-include $$($1_RES_DEPS_TARGETS_FILE)
|
||||
|
||||
$1_RES_VARDEPS := $$($1_RC) $$($1_RCFLAGS)
|
||||
$1_RES_VARDEPS_FILE := $$(call DependOnVariable, $1_RES_VARDEPS, \
|
||||
$$($1_RES).vardeps)
|
||||
|
||||
$$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
|
||||
$$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$($1_BASENAME)))
|
||||
$$(call MakeDir, $$(@D) $$($1_OBJECT_DIR))
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_RC) $$($1_RCFLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
|
||||
$$($1_VERSIONINFO_RESOURCE) 2>&1 ))
|
||||
# Windows RC compiler does not support -showIncludes, so we mis-use CL
|
||||
# for this. Filter out RC specific arguments that are unknown to CL.
|
||||
# For some unknown reason, in this case CL actually outputs the show
|
||||
# includes to stderr so need to redirect it to hide the output from the
|
||||
# main log.
|
||||
$$(call ExecuteWithLog, $$($1_RES_DEPS_FILE)$(OBJ_SUFFIX), \
|
||||
$$($1_CC) $$(filter-out -l%, $$($1_RCFLAGS)) \
|
||||
$$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \
|
||||
$(CC_OUT_OPTION)$$($1_RES_DEPS_FILE)$(OBJ_SUFFIX) -P -Fi$$($1_RES_DEPS_FILE).pp \
|
||||
$$($1_VERSIONINFO_RESOURCE)) 2>&1 \
|
||||
| $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
|
||||
-e "^$$(notdir $$($1_VERSIONINFO_RESOURCE))$$$$" || test "$$$$?" = "1" ; \
|
||||
$(ECHO) $$($1_RES): \\ > $$($1_RES_DEPS_FILE) ; \
|
||||
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEPS_FILE)$(OBJ_SUFFIX).log \
|
||||
>> $$($1_RES_DEPS_FILE) ; \
|
||||
$(ECHO) >> $$($1_RES_DEPS_FILE) ;\
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEPS_FILE) \
|
||||
> $$($1_RES_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
endef
|
||||
118
make/common/native/DebugSymbols.gmk
Normal file
118
make/common/native/DebugSymbols.gmk
Normal file
@@ -0,0 +1,118 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to native debug symbol handling.
|
||||
|
||||
################################################################################
|
||||
define CreateDebugSymbols
|
||||
ifneq ($$($1_COPY_DEBUG_SYMBOLS), false)
|
||||
$1_COPY_DEBUG_SYMBOLS := $(COPY_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
|
||||
$1_ZIP_EXTERNAL_DEBUG_SYMBOLS := $(ZIP_EXTERNAL_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_COPY_DEBUG_SYMBOLS), true)
|
||||
ifneq ($$($1_DEBUG_SYMBOLS), false)
|
||||
$$(call SetIfEmpty, $1_SYMBOLS_DIR, $$($1_OUTPUT_DIR))
|
||||
# Only copy debug symbols for dynamic libraries and programs.
|
||||
ifneq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
# Generate debuginfo files.
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb" \
|
||||
"-map:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map"
|
||||
ifeq ($(SHIP_DEBUG_SYMBOLS), public)
|
||||
$1_EXTRA_LDFLAGS += "-pdbstripped:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).stripped.pdb"
|
||||
endif
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map
|
||||
|
||||
else ifeq ($(call isTargetOs, linux), true)
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
# Setup the command line creating debuginfo files, to be run after linking.
|
||||
# It cannot be run separately since it updates the original target file
|
||||
# Creating the debuglink is done in another command rather than all at once
|
||||
# so we can run it after strip is called, since strip can sometimes mangle the
|
||||
# embedded debuglink, which we want to avoid.
|
||||
$1_CREATE_DEBUGINFO_CMDS := \
|
||||
$$($1_OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) && \
|
||||
$$(CHMOD) -x $$($1_DEBUGINFO_FILES)
|
||||
$1_CREATE_DEBUGLINK_CMDS := $(CD) $$($1_SYMBOLS_DIR) && \
|
||||
$$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# AIX does not provide the equivalent of OBJCOPY to extract debug symbols,
|
||||
# so we copy the compiled object with symbols to the .debuginfo file, which
|
||||
# happens prior to the STRIP_CMD on the original target object file.
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
$1_CREATE_DEBUGINFO_CMDS := $(CP) $$($1_TARGET) $$($1_DEBUGINFO_FILES)
|
||||
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
$1_DEBUGINFO_FILES := \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME)
|
||||
$1_CREATE_DEBUGINFO_CMDS := \
|
||||
$(DSYMUTIL) --out $$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET)
|
||||
endif
|
||||
|
||||
# Since the link rule creates more than one file that we want to track,
|
||||
# we have to use some tricks to get make to cooperate. To properly
|
||||
# trigger downstream dependants of $$($1_DEBUGINFO_FILES), we must have
|
||||
# a recipe in the rule below. To avoid rerunning the recipe every time
|
||||
# have it touch the target. If a debuginfo file is deleted by something
|
||||
# external, explicitly delete the TARGET to trigger a rebuild of both.
|
||||
ifneq ($$(wildcard $$($1_DEBUGINFO_FILES)), $$($1_DEBUGINFO_FILES))
|
||||
$$(call LogDebug, Deleting $$($1_BASENAME) because debuginfo files are missing)
|
||||
$$(shell $(RM) $$($1_TARGET))
|
||||
endif
|
||||
$$($1_DEBUGINFO_FILES): $$($1_TARGET)
|
||||
$$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \
|
||||
$$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \
|
||||
)
|
||||
$(TOUCH) $$@
|
||||
|
||||
$1 += $$($1_DEBUGINFO_FILES)
|
||||
|
||||
ifeq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).diz
|
||||
else
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).diz
|
||||
endif
|
||||
$1 += $$($1_DEBUGINFO_ZIP)
|
||||
|
||||
# The dependency on TARGET is needed for debuginfo files
|
||||
# to be rebuilt properly.
|
||||
$$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
$(CD) $$($1_SYMBOLS_DIR) && \
|
||||
$(ZIPEXE) -q -r $$@ $$(subst $$($1_SYMBOLS_DIR)/,, $$($1_DEBUGINFO_FILES))
|
||||
|
||||
endif
|
||||
endif # !STATIC_LIBRARY
|
||||
endif # $1_DEBUG_SYMBOLS != false
|
||||
endif # COPY_DEBUG_SYMBOLS
|
||||
endef
|
||||
225
make/common/native/Flags.gmk
Normal file
225
make/common/native/Flags.gmk
Normal file
@@ -0,0 +1,225 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to setting up compiler and linker
|
||||
# flags, based on various more abstract sources of compilation description,
|
||||
# like optimization level.
|
||||
|
||||
################################################################################
|
||||
# $1 is the prefix of the file to be compiled
|
||||
# $2 is the prefix of the library, i.e. $$($1_BASE)
|
||||
define SetupCompileFileFlags
|
||||
ifeq ($$($1_OPTIMIZATION), )
|
||||
$1_OPT_CFLAGS := $$($2_OPT_CFLAGS)
|
||||
$1_OPT_CXXFLAGS := $$($2_OPT_CXXFLAGS)
|
||||
else
|
||||
ifeq ($$($1_OPTIMIZATION), NONE)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NONE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
|
||||
else ifeq ($$($1_OPTIMIZATION), LOW)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NORM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NORM)
|
||||
else ifeq ($$($1_OPTIMIZATION), HIGH)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HI)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HI)
|
||||
else ifeq ($$($1_OPTIMIZATION), HIGHEST)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST)
|
||||
else ifeq ($$($1_OPTIMIZATION), HIGHEST_JVM)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST_JVM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST_JVM)
|
||||
else ifeq ($$($1_OPTIMIZATION), SIZE)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_SIZE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_SIZE)
|
||||
else
|
||||
$$(error Unknown value for file OPTIMIZATION: $$($1_OPTIMIZATION))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$($2_PRECOMPILED_HEADER), )
|
||||
ifeq ($$(filter $$($1_FILENAME), $$($2_PRECOMPILED_HEADER_EXCLUDE)), )
|
||||
$1_USE_PCH_FLAGS := $$($2_USE_PCH_FLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(DISABLE_WARNING_PREFIX), )
|
||||
$1_WARNINGS_FLAGS := $$(addprefix $(DISABLE_WARNING_PREFIX), \
|
||||
$$($2_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$$($1_FILENAME)) \
|
||||
$$($2_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)_$$($1_FILENAME)))
|
||||
endif
|
||||
|
||||
$1_BASE_CFLAGS := $$($2_CFLAGS) $$($2_EXTRA_CFLAGS) \
|
||||
$$($2_SYSROOT_CFLAGS)
|
||||
$1_BASE_CXXFLAGS := $$($2_CXXFLAGS) $$($2_EXTRA_CXXFLAGS) \
|
||||
$$($2_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS)
|
||||
$1_BASE_ASFLAGS := $$($2_ASFLAGS) $$($2_EXTRA_ASFLAGS)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupCompilerFlags
|
||||
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS, TOOLCHAIN_TYPE and
|
||||
# OPENJDK_TARGET_OS plus OPENJDK_TARGET_CPU pair dependent variables for CFLAGS.
|
||||
$1_EXTRA_CFLAGS := $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_CFLAGS_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU))
|
||||
|
||||
ifneq ($(DEBUG_LEVEL), release)
|
||||
# Pickup extra debug dependent variables for CFLAGS
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_debug)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_debug)
|
||||
else
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_release)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
|
||||
endif
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_EXTRA_CFLAGS += $$(STATIC_LIBS_CFLAGS)
|
||||
endif
|
||||
|
||||
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and/or TOOLCHAIN_TYPE
|
||||
# dependent variables for CXXFLAGS.
|
||||
$1_EXTRA_CXXFLAGS := $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_CXXFLAGS_$(TOOLCHAIN_TYPE))
|
||||
|
||||
ifneq ($(DEBUG_LEVEL), release)
|
||||
# Pickup extra debug dependent variables for CXXFLAGS
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_debug)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
else
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_release)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
endif
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_EXTRA_CXXFLAGS += $$(STATIC_LIB_CFLAGS)
|
||||
endif
|
||||
|
||||
# If no C++ flags are explicitly set, default to using the C flags.
|
||||
# After that, we can set additional C++ flags that should not interfere
|
||||
# with the mechanism for copying the C flags by default.
|
||||
ifeq ($$($1_CXXFLAGS), )
|
||||
$1_CXXFLAGS := $$($1_CFLAGS)
|
||||
endif
|
||||
ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)), )
|
||||
$1_EXTRA_CXXFLAGS := $$($1_EXTRA_CFLAGS)
|
||||
endif
|
||||
|
||||
$$(call SetIfEmpty, $1_COMPILE_WITH_DEBUG_SYMBOLS, $$(COMPILE_WITH_DEBUG_SYMBOLS))
|
||||
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
# For release builds where debug symbols are configured to be moved to
|
||||
# separate debuginfo files, disable debug symbols for static libs instead.
|
||||
# We don't currently support this configuration and we don't want symbol
|
||||
# information in release builds unless explicitly asked to provide it.
|
||||
ifeq ($(DEBUG_LEVEL), release)
|
||||
ifeq ($(COPY_DEBUG_SYMBOLS), true)
|
||||
$1_COMPILE_WITH_DEBUG_SYMBOLS := false
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_COMPILE_WITH_DEBUG_SYMBOLS), true)
|
||||
$1_EXTRA_CFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
|
||||
$1_EXTRA_CXXFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
|
||||
$1_EXTRA_ASFLAGS += $$(ASFLAGS_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
# Pass the library name for static JNI library naming
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$1_EXTRA_CFLAGS += -DLIBRARY_NAME=$$($1_NAME)
|
||||
$1_EXTRA_CXXFLAGS += -DLIBRARY_NAME=$$($1_NAME)
|
||||
endif
|
||||
|
||||
# Pick up disabled warnings, if possible on this platform.
|
||||
ifneq ($(DISABLE_WARNING_PREFIX), )
|
||||
$1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
|
||||
$$(DISABLED_WARNINGS) \
|
||||
$$(DISABLED_WARNINGS_C) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)))
|
||||
$1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
|
||||
$$(DISABLED_WARNINGS) \
|
||||
$$(DISABLED_WARNINGS_CXX) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_CXX_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_DISABLED_WARNINGS_CXX_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)))
|
||||
endif
|
||||
|
||||
# Check if warnings should be considered errors.
|
||||
# Pick first binary and toolchain specific, then binary specific, then general setting.
|
||||
ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)), )
|
||||
ifeq ($$($1_WARNINGS_AS_ERRORS), )
|
||||
$1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$(WARNINGS_AS_ERRORS)
|
||||
else
|
||||
$1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$($1_WARNINGS_AS_ERRORS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)), true)
|
||||
$1_EXTRA_CFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
|
||||
$1_EXTRA_CXXFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
|
||||
endif
|
||||
|
||||
ifeq (NONE, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NONE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
|
||||
else ifeq (LOW, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NORM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NORM)
|
||||
else ifeq (HIGH, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HI)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HI)
|
||||
else ifeq (HIGHEST, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST)
|
||||
else ifeq (HIGHEST_JVM, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST_JVM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST_JVM)
|
||||
else ifeq (SIZE, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_SIZE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_SIZE)
|
||||
else ifneq (, $$($1_OPTIMIZATION))
|
||||
$$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupLinkerFlags
|
||||
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and TOOLCHAIN_TYPE
|
||||
# dependent variables for LDFLAGS and LIBS, and additionally the pair dependent
|
||||
# TOOLCHAIN_TYPE plus OPENJDK_TARGET_OS
|
||||
$1_EXTRA_LDFLAGS += $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_LDFLAGS_$(TOOLCHAIN_TYPE)) $$($1_LDFLAGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS))
|
||||
$1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_LIBS_$(TOOLCHAIN_TYPE)) $$($1_LIBS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS))
|
||||
endef
|
||||
182
make/common/native/Link.gmk
Normal file
182
make/common/native/Link.gmk
Normal file
@@ -0,0 +1,182 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to linking a native binary;
|
||||
# creating either a dynamic library, a static library or an executable.
|
||||
|
||||
################################################################################
|
||||
# GetEntitlementsFile
|
||||
# Find entitlements file for executable when signing on macosx. If no
|
||||
# specialized file is found, returns the default file.
|
||||
# This macro might be called from custom makefiles.
|
||||
# $1 Executable to find entitlements file for.
|
||||
ENTITLEMENTS_DIR := $(TOPDIR)/make/data/macosxsigning
|
||||
ifeq ($(MACOSX_CODESIGN_MODE), debug)
|
||||
CODESIGN_PLIST_SUFFIX := -debug
|
||||
else
|
||||
CODESIGN_PLIST_SUFFIX :=
|
||||
endif
|
||||
DEFAULT_ENTITLEMENTS_FILE := $(ENTITLEMENTS_DIR)/default$(CODESIGN_PLIST_SUFFIX).plist
|
||||
|
||||
GetEntitlementsFile = \
|
||||
$(foreach f, $(ENTITLEMENTS_DIR)/$(strip $(notdir $1))$(CODESIGN_PLIST_SUFFIX).plist, \
|
||||
$(if $(wildcard $f), $f, $(DEFAULT_ENTITLEMENTS_FILE)) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
define SetupLinking
|
||||
# Unless specifically set, stripping should only happen if symbols are also
|
||||
# being copied.
|
||||
$$(call SetIfEmpty, $1_STRIP_SYMBOLS, $$($1_COPY_DEBUG_SYMBOLS))
|
||||
|
||||
ifneq ($$($1_STRIP_SYMBOLS), false)
|
||||
# Default to using the global STRIPFLAGS. Allow for overriding with an
|
||||
# empty value
|
||||
$1_STRIPFLAGS ?= $(STRIPFLAGS)
|
||||
$1_STRIP_CMD := $$($1_STRIP) $$($1_STRIPFLAGS) $$($1_TARGET)
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateLinkedResult
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$$(eval $$(call CreateStaticLibrary,$1))
|
||||
else
|
||||
$$(eval $$(call CreateDynamicLibraryOrExecutable,$1))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateStaticLibrary
|
||||
# Include partial linking when building the static library with clang on linux
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), clang), )
|
||||
$1_ENABLE_PARTIAL_LINKING := true
|
||||
endif
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_AR) $$(ARFLAGS) $$($1_ARFLAGS) $$($1_LIBS) \
|
||||
$$($1_EXTRA_LIBS)
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$1_VARDEPS += $$($1_LD) $$($1_SYSROOT_LDFLAGS)
|
||||
endif
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$1_AR_OBJ_ARG := $$($1_LD_OBJ_ARG)
|
||||
# With clang on linux, partial linking is enabled and 'AR' takes the output
|
||||
# object from the partial linking step.
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$1_TARGET_RELOCATABLE := $$($1_OBJECT_DIR)/$$($1_PREFIX)$$($1_NAME)_relocatable$(OBJ_SUFFIX)
|
||||
$1_AR_OBJ_ARG := $$($1_TARGET_RELOCATABLE)
|
||||
endif
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
ifeq ($$($1_LINK_OBJS_RELATIVE), true)
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS_RELATIVE, $$($1_OBJ_FILE_LIST)))
|
||||
else
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
endif
|
||||
$$(call LogInfo, Building static library $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
# Do partial linking.
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_partial_link, \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
|
||||
-o $$($1_TARGET_RELOCATABLE) \
|
||||
$$($1_LD_OBJ_ARG))
|
||||
endif
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_AR) $$(ARFLAGS) $$($1_ARFLAGS) -r -cs $$($1_TARGET) \
|
||||
$$($1_AR_OBJ_ARG) $$($1_RES))
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$(RM) $$(@D)/$$(basename $$(@F)).symbols; \
|
||||
$(ECHO) "Getting symbols from nm"; \
|
||||
$(NM) $(NMFLAGS) -m $$($1_TARGET) | $(GREP) "__TEXT" | \
|
||||
$(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \
|
||||
$(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateDynamicLibraryOrExecutable
|
||||
# A shared dynamic library or an executable binary has been specified
|
||||
ifeq ($$($1_TYPE), LIBRARY)
|
||||
# Generating a dynamic library.
|
||||
$1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
|
||||
|
||||
# Create loadmap on AIX. Helps in diagnosing some problems.
|
||||
ifneq ($(COMPILER_BINDCMD_FILE_FLAG), )
|
||||
$1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap
|
||||
endif
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) \
|
||||
$$($1_EXTRA_LDFLAGS) $$($1_LIBS) $$($1_EXTRA_LIBS) \
|
||||
$$($1_CREATE_DEBUGINFO_CMDS) $$($1_STRIP_CMD) $$($1_CREATE_DEBUGLINK_CMDS)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
ifeq ($$($1_LINK_OBJS_RELATIVE), true)
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS_RELATIVE, $$($1_OBJ_FILE_LIST)))
|
||||
else
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
endif
|
||||
$$(call LogInfo, Linking $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
||||
$$($1_SYSROOT_LDFLAGS) -o $$($1_TARGET) $$($1_LD_OBJ_ARG) \
|
||||
$$($1_LIBS) $$($1_EXTRA_LIBS))
|
||||
$$($1_CREATE_DEBUGINFO_CMDS)
|
||||
$$($1_STRIP_CMD)
|
||||
$$($1_CREATE_DEBUGLINK_CMDS)
|
||||
# On macosx, optionally run codesign on every binary.
|
||||
# Remove signature explicitly first to avoid warnings if the linker
|
||||
# added a default adhoc signature.
|
||||
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
|
||||
$(CODESIGN) --remove-signature $$@
|
||||
$(CODESIGN) -f -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp \
|
||||
--options runtime --entitlements \
|
||||
$$(call GetEntitlementsFile, $$@) $$@
|
||||
else ifeq ($(MACOSX_CODESIGN_MODE), debug)
|
||||
$(CODESIGN) --remove-signature $$@
|
||||
$(CODESIGN) -f -s - --entitlements \
|
||||
$$(call GetEntitlementsFile, $$@) $$@
|
||||
endif
|
||||
endef
|
||||
112
make/common/native/LinkMicrosoft.gmk
Normal file
112
make/common/native/LinkMicrosoft.gmk
Normal file
@@ -0,0 +1,112 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to linking a native binary;
|
||||
# creating either a dynamic library, a static library or an executable.
|
||||
|
||||
################################################################################
|
||||
define CreateLinkedResultMicrosoft
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$$(eval $$(call CreateStaticLibraryMicrosoft,$1))
|
||||
else
|
||||
$$(eval $$(call CreateDynamicLibraryOrExecutableMicrosoft,$1))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateStaticLibraryMicrosoft
|
||||
$1_VARDEPS := $$($1_LIB) $$(LIBFLAGS) $$($1_LIBFLAGS) $$($1_LIBS) \
|
||||
$$($1_EXTRA_LIBS)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
$$(call LogInfo, Building static library $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$$($1_LIB) -nologo $$(LIBFLAGS) $$($1_LIBFLAGS) -out:$$($1_TARGET) \
|
||||
$$($1_LD_OBJ_ARG) $$($1_RES))
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateDynamicLibraryOrExecutableMicrosoft
|
||||
ifeq ($$($1_EMBED_MANIFEST), true)
|
||||
$1_EXTRA_LDFLAGS += -manifest:embed
|
||||
endif
|
||||
|
||||
$1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib
|
||||
$1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)"
|
||||
|
||||
ifeq ($$($1_TYPE), LIBRARY)
|
||||
# To properly trigger downstream dependants of the import library, just as
|
||||
# for debug files, we must have a recipe in the rule. To avoid rerunning
|
||||
# the recipe every time have it touch the target. If an import library
|
||||
# file is deleted by something external, explicitly delete the target to
|
||||
# trigger a rebuild of both.
|
||||
ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
|
||||
$$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
|
||||
$$(shell $(RM) $$($1_TARGET))
|
||||
endif
|
||||
$$($1_IMPORT_LIBRARY): $$($1_TARGET)
|
||||
$(TOUCH) $$@
|
||||
|
||||
$1 += $$($1_IMPORT_LIBRARY)
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) \
|
||||
$$($1_EXTRA_LDFLAGS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
|
||||
$$($1_MANIFEST_VERSION)
|
||||
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
|
||||
$$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
$$(call LogInfo, Linking $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$$($1_LD) -nologo $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
||||
$$($1_SYSROOT_LDFLAGS) -out:$$($1_TARGET) $$($1_LD_OBJ_ARG) \
|
||||
$$($1_RES) $$($1_LIBS) $$($1_EXTRA_LIBS)) \
|
||||
| $(GREP) -v "^ Creating library .*\.lib and object .*\.exp" || \
|
||||
test "$$$$?" = "1"
|
||||
ifeq ($(call isBuildOsEnv, windows.wsl2), true)
|
||||
$$(CHMOD) +x $$($1_TARGET)
|
||||
endif
|
||||
ifneq ($$($1_MANIFEST), )
|
||||
$$($1_MT) -nologo -manifest $$($1_MANIFEST) \
|
||||
-identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" \
|
||||
-outputresource:$$@;#1
|
||||
endif
|
||||
endef
|
||||
247
make/common/native/Paths.gmk
Normal file
247
make/common/native/Paths.gmk
Normal file
@@ -0,0 +1,247 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to handling paths for source files
|
||||
# and object files. This is complicated by the fact that we usually, but not
|
||||
# always, use absolute instead of relative paths. It is further complicated
|
||||
# by the fact that not all tools allow inputting large lists of files as
|
||||
# "@-files", which we normally use to avoid hitting command line length limits.
|
||||
# Finally this file contains functionality for locating all source code files
|
||||
# that should be included in the compilation.
|
||||
|
||||
################################################################################
|
||||
# When absolute paths are not allowed in the output, and the compiler does not
|
||||
# support any options to avoid it, we need to rewrite compile commands to use
|
||||
# relative paths. By doing this, the __FILE__ macro will resolve to relative
|
||||
# paths. The relevant input paths on the command line are the -I flags and the
|
||||
# path to the source file itself.
|
||||
#
|
||||
# The macro MakeCommandRelative is used to rewrite the command line like this:
|
||||
# 'CD $(WORKSPACE_ROOT) && <cmd>'
|
||||
# and changes all paths in cmd to be relative to the workspace root. This only
|
||||
# works properly if the build dir is inside the workspace root. If it's not,
|
||||
# relative paths are still calculated, but depending on the distance between the
|
||||
# dirs, paths in the build dir may end up as essentially absolute anyway.
|
||||
#
|
||||
# The fix-deps-file macro is used to adjust the contents of the generated make
|
||||
# dependency files to contain paths compatible with make.
|
||||
#
|
||||
REWRITE_PATHS_RELATIVE = false
|
||||
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
|
||||
REWRITE_PATHS_RELATIVE = true
|
||||
endif
|
||||
|
||||
# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for
|
||||
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
|
||||
# its compiler. The compiler then produces relative dependency files.
|
||||
# make does not know a relative and absolute filename is the same so it will
|
||||
# ignore such dependencies. This only applies when the OUTPUTDIR is inside
|
||||
# the WORKSPACE_ROOT.
|
||||
ifneq ($(CCACHE), )
|
||||
ifneq ($(filter $(WORKSPACE_ROOT)/%, $(OUTPUTDIR)), )
|
||||
REWRITE_PATHS_RELATIVE = true
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(REWRITE_PATHS_RELATIVE), true)
|
||||
# Need to handle -I flags as both '-Ifoo' and '-I foo'.
|
||||
MakeCommandRelative = \
|
||||
$(CD) $(WORKSPACE_ROOT) && \
|
||||
$(foreach o, $1, \
|
||||
$(if $(filter $(WORKSPACE_ROOT)/% $(OUTPUTDIR)/%, $o), \
|
||||
$(call RelativePath, $o, $(WORKSPACE_ROOT)) \
|
||||
, \
|
||||
$(if $(filter -I$(WORKSPACE_ROOT)/%, $o), \
|
||||
-I$(call RelativePath, $(patsubst -I%, %, $o), $(WORKSPACE_ROOT)) \
|
||||
, \
|
||||
$o \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# When compiling with relative paths, the deps file may come out with relative
|
||||
# paths, and that path may start with './'. First remove any leading ./, then
|
||||
# add WORKSPACE_ROOT to any line not starting with /, while allowing for
|
||||
# leading spaces. There may also be multiple entries on the same line, so start
|
||||
# with splitting such lines.
|
||||
# Non GNU sed (BSD on macosx) cannot substitute in literal \n using regex.
|
||||
# Instead use a bash escaped literal newline. To avoid having unmatched quotes
|
||||
# ruin the ability for an editor to properly syntax highlight this file, define
|
||||
# that newline sequence as a separate variable and add the closing quote behind
|
||||
# a comment.
|
||||
sed_newline := \'$$'\n''#'
|
||||
define fix-deps-file
|
||||
$(SED) \
|
||||
-e 's|\([^ ]\) \{1,\}\([^\\:]\)|\1 \\$(sed_newline) \2|g' \
|
||||
$1.tmp \
|
||||
| $(SED) \
|
||||
-e 's|^\([ ]*\)\./|\1|' \
|
||||
-e '/^[ ]*[^/ ]/s|^\([ ]*\)|\1$(WORKSPACE_ROOT)/|' \
|
||||
> $1
|
||||
endef
|
||||
else
|
||||
# By default the MakeCommandRelative macro does nothing.
|
||||
MakeCommandRelative = $1
|
||||
|
||||
# No adjustment is needed.
|
||||
define fix-deps-file
|
||||
$(MV) $1.tmp $1
|
||||
endef
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
define SetupSourceFiles
|
||||
$$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
|
||||
$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
|
||||
|
||||
$1_SRCS_RAW := $$(call FindFiles, $$($1_SRC))
|
||||
# Order src files according to the order of the src dirs
|
||||
$1_SRCS := $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_SRCS_RAW)))
|
||||
$1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
|
||||
# Extract the C/C++ files.
|
||||
ifneq ($$($1_EXCLUDE_PATTERNS), )
|
||||
# We must not match the exclude pattern against the src root(s).
|
||||
$1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
|
||||
$$(foreach i, $$($1_SRC), $$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
|
||||
$$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
|
||||
$1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
|
||||
$$($1_SRCS_WITHOUT_ROOTS))
|
||||
endif
|
||||
ifneq ($$($1_EXCLUDE_FILES), )
|
||||
$1_ALL_EXCLUDE_FILES += $$($1_EXCLUDE_FILES)
|
||||
endif
|
||||
ifneq ($$($1_ALL_EXCLUDE_FILES), )
|
||||
$1_EXCLUDE_FILES_PAT := $$($1_ALL_EXCLUDE_FILES) \
|
||||
$$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_ALL_EXCLUDE_FILES)))
|
||||
$1_EXCLUDE_FILES_PAT := $$(addprefix %, $$($1_EXCLUDE_FILES_PAT))
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT), $$($1_SRCS))
|
||||
endif
|
||||
ifneq ($$($1_INCLUDE_FILES), )
|
||||
$1_INCLUDE_FILES_PAT := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_INCLUDE_FILES)))
|
||||
$1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT), $$($1_SRCS))
|
||||
endif
|
||||
# Now we have a list of all c/c++ files to compile: $$($1_SRCS)
|
||||
|
||||
# Prepend the source/bin path to the filter expressions. Then do the filtering.
|
||||
ifneq ($$($1_INCLUDES), )
|
||||
$1_SRC_INCLUDES := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
|
||||
$1_SRCS := $$(filter $$($1_SRC_INCLUDES), $$($1_SRCS))
|
||||
endif
|
||||
ifneq ($$($1_EXCLUDES), )
|
||||
$1_SRC_EXCLUDES := $$(addsuffix /%, $$($1_EXCLUDES))
|
||||
$1_SRC_EXCLUDES += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_EXCLUDES))))
|
||||
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES), $$($1_SRCS))
|
||||
endif
|
||||
|
||||
$1_SRCS += $$($1_EXTRA_FILES)
|
||||
|
||||
ifeq ($$($1_SRCS), )
|
||||
$$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
ifeq ($(UBSAN_ENABLED), true)
|
||||
# We need to set the default options for UBSan. This needs to be included in every executable.
|
||||
# Rather than copy and paste code to everything with a main function, we add an additional
|
||||
# source file to every executable that exports __ubsan_default_options.
|
||||
ifneq ($$(filter %.cpp %.cc, $$($1_SRCS)), )
|
||||
$1_SRCS += $(TOPDIR)/make/data/ubsan/ubsan_default_options.cpp
|
||||
else
|
||||
$1_SRCS += $(TOPDIR)/make/data/ubsan/ubsan_default_options.c
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupOutputFiles
|
||||
# Calculate the expected output from compiling the sources
|
||||
$1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS)))
|
||||
$1_EXPECTED_OBJS := $$(addprefix $$($1_OBJECT_DIR)/, $$($1_EXPECTED_OBJS_FILENAMES))
|
||||
# Sort to remove duplicates and provide a reproducible order on the input files to the linker.
|
||||
$1_ALL_OBJS := $$(sort $$($1_EXPECTED_OBJS) $$($1_EXTRA_OBJECT_FILES))
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
# Exclude the object files that match with $1_STATIC_LIB_EXCLUDE_OBJS.
|
||||
ifneq ($$($1_STATIC_LIB_EXCLUDE_OBJS), )
|
||||
$1_ALL_OBJS := $$(call not-containing, $$($1_STATIC_LIB_EXCLUDE_OBJS), $$($1_ALL_OBJS))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define RemoveSuperfluousOutputFiles
|
||||
# Are there too many object files on disk? Perhaps because some source file was removed?
|
||||
$1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
|
||||
$1_SUPERFLOUS_OBJS := $$(sort $$(filter-out $$($1_EXPECTED_OBJS), $$($1_BINS)))
|
||||
# Clean out the superfluous object files.
|
||||
ifneq ($$($1_SUPERFLUOUS_OBJS), )
|
||||
$$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupObjectFileList
|
||||
$1_LD_OBJ_ARG := $$($1_ALL_OBJS)
|
||||
|
||||
# If there are many object files, use an @-file...
|
||||
ifneq ($$(word 17, $$($1_ALL_OBJS)), )
|
||||
$1_OBJ_FILE_LIST := $$($1_OBJECT_DIR)/_$1_objectfilenames.txt
|
||||
ifneq ($(COMPILER_COMMAND_FILE_FLAG), )
|
||||
$1_LD_OBJ_ARG := $(COMPILER_COMMAND_FILE_FLAG)$$($1_OBJ_FILE_LIST)
|
||||
else
|
||||
# ...except for toolchains which don't support them.
|
||||
$1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)`
|
||||
endif
|
||||
|
||||
# If we are building static library, 'AR' on macosx/aix may not support @-file.
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
ifeq ($(call isTargetOs, macosx aix), true)
|
||||
$1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)`
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Unfortunately the @-file trick does not work reliably when using clang.
|
||||
# Clang does not propagate the @-file parameter to the ld sub process, but
|
||||
# instead puts the full content on the command line. At least the llvm ld
|
||||
# does not even support an @-file.
|
||||
#
|
||||
# When linking a large amount of object files, we risk hitting the limit
|
||||
# of the command line length even on posix systems if the path length of
|
||||
# the output dir is very long due to our use of absolute paths. To
|
||||
# mitigate this, use paths relative to the output dir when linking over
|
||||
# 500 files with clang and the output dir path is deep.
|
||||
ifneq ($$(word 500, $$($1_ALL_OBJS)), )
|
||||
ifeq ($$(TOOLCHAIN_TYPE), clang)
|
||||
# There is no strlen function in make, but checking path depth is a
|
||||
# reasonable approximation.
|
||||
ifneq ($$(word 10, $$(subst /, ,$$(OUTPUTDIR))), )
|
||||
$1_LINK_OBJS_RELATIVE := true
|
||||
$1_ALL_OBJS_RELATIVE := $$(patsubst $$(OUTPUTDIR)/%, %, $$($1_ALL_OBJS))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2024, 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
|
||||
@@ -36,6 +36,10 @@ MACOS_X64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=af32e84c11009f72f783fdcdc9917efc277893988f097e198e2576875d1e88c1
|
||||
|
||||
MACOS_AARCH64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_macos-aarch64_bin.tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_SHA256=f12e1e0a2dffc847951598f597c8ee60fb0913932f24b2b09c62cfd2f0f4dfb9
|
||||
|
||||
WINDOWS_X64_BOOT_JDK_EXT=zip
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=5434faaf029e66e7ce6e75770ca384de476750984a7d2881ef7686894c4b4944
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2024, 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
|
||||
@@ -441,7 +441,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
"macosx-x64": {
|
||||
target_os: "macosx",
|
||||
target_cpu: "x64",
|
||||
dependencies: ["devkit", "gtest", "pandoc"],
|
||||
dependencies: ["devkit", "gtest", "graphviz", "pandoc"],
|
||||
configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
|
||||
"--with-macosx-version-max=11.00.00",
|
||||
"--enable-compatible-cds-alignment",
|
||||
@@ -453,7 +453,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
"macosx-aarch64": {
|
||||
target_os: "macosx",
|
||||
target_cpu: "aarch64",
|
||||
dependencies: ["devkit", "gtest", "pandoc"],
|
||||
dependencies: ["devkit", "gtest", "graphviz", "pandoc"],
|
||||
configure_args: concat(common.configure_args_64bit,
|
||||
"--with-macosx-version-max=11.00.00"),
|
||||
},
|
||||
@@ -486,7 +486,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
"linux-aarch64": {
|
||||
target_os: "linux",
|
||||
target_cpu: "aarch64",
|
||||
dependencies: ["devkit", "gtest", "build_devkit", "pandoc"],
|
||||
dependencies: ["devkit", "gtest", "build_devkit", "graphviz", "pandoc"],
|
||||
configure_args: [
|
||||
"--with-zlib=system",
|
||||
"--disable-dtrace",
|
||||
@@ -1181,12 +1181,6 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
revision: (input.build_cpu == "x64" ? "Xcode11.3.1-MacOSX10.15+1.2" : devkit_platform_revisions[devkit_platform])
|
||||
},
|
||||
|
||||
cups: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
revision: "1.0118+1.0"
|
||||
},
|
||||
|
||||
jtreg: {
|
||||
server: "jpg",
|
||||
product: "jtreg",
|
||||
@@ -1237,7 +1231,7 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
graphviz: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
revision: "2.38.0-1+1.1",
|
||||
revision: "9.0.0+1.0",
|
||||
module: "graphviz-" + input.target_platform,
|
||||
configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot",
|
||||
environment_path: input.get("graphviz", "install_path")
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 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
|
||||
# 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.
|
||||
#
|
||||
|
||||
JVM_handle_aix_signal
|
||||
numa_error
|
||||
numa_warn
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
JVM_AccessVMBooleanFlag
|
||||
JVM_AccessVMIntFlag
|
||||
JVM_VMBreakPoint
|
||||
@@ -1,27 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 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
|
||||
# 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.
|
||||
#
|
||||
|
||||
JVM_handle_linux_signal
|
||||
JVM_IsUseContainerSupport
|
||||
numa_error
|
||||
numa_warn
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
JVM_handle_bsd_signal
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AsyncGetCallTrace
|
||||
jio_fprintf
|
||||
jio_printf
|
||||
jio_snprintf
|
||||
jio_vfprintf
|
||||
jio_vsnprintf
|
||||
JNI_CreateJavaVM
|
||||
JNI_GetCreatedJavaVMs
|
||||
JNI_GetDefaultJavaVMInitArgs
|
||||
JVM_IsForeignLinkerSupported
|
||||
JVM_FindClassFromBootLoader
|
||||
JVM_InitAgentProperties
|
||||
@@ -1,233 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
JVM_ActiveProcessorCount
|
||||
JVM_AreNestMates
|
||||
JVM_ArrayCopy
|
||||
JVM_AssertionStatusDirectives
|
||||
JVM_BeforeHalt
|
||||
JVM_CallStackWalk
|
||||
JVM_Clone
|
||||
JVM_ConstantPoolGetClassAt
|
||||
JVM_ConstantPoolGetClassAtIfLoaded
|
||||
JVM_ConstantPoolGetClassRefIndexAt
|
||||
JVM_ConstantPoolGetDoubleAt
|
||||
JVM_ConstantPoolGetFieldAt
|
||||
JVM_ConstantPoolGetFieldAtIfLoaded
|
||||
JVM_ConstantPoolGetFloatAt
|
||||
JVM_ConstantPoolGetIntAt
|
||||
JVM_ConstantPoolGetLongAt
|
||||
JVM_ConstantPoolGetMemberRefInfoAt
|
||||
JVM_ConstantPoolGetMethodAt
|
||||
JVM_ConstantPoolGetMethodAtIfLoaded
|
||||
JVM_ConstantPoolGetNameAndTypeRefIndexAt
|
||||
JVM_ConstantPoolGetNameAndTypeRefInfoAt
|
||||
JVM_ConstantPoolGetSize
|
||||
JVM_ConstantPoolGetStringAt
|
||||
JVM_ConstantPoolGetTagAt
|
||||
JVM_ConstantPoolGetUTF8At
|
||||
JVM_CurrentCarrierThread
|
||||
JVM_CurrentThread
|
||||
JVM_SetCurrentThread
|
||||
JVM_CurrentTimeMillis
|
||||
JVM_DefineClass
|
||||
JVM_DefineClassWithSource
|
||||
JVM_DesiredAssertionStatus
|
||||
JVM_DumpAllStacks
|
||||
JVM_DumpClassListToFile
|
||||
JVM_DumpDynamicArchive
|
||||
JVM_DumpThreads
|
||||
JVM_ExpandStackFrameInfo
|
||||
JVM_FillInStackTrace
|
||||
JVM_FindClassFromCaller
|
||||
JVM_FindClassFromClass
|
||||
JVM_FindLibraryEntry
|
||||
JVM_FindLoadedClass
|
||||
JVM_FindPrimitiveClass
|
||||
JVM_FindSignal
|
||||
JVM_FreeMemory
|
||||
JVM_GC
|
||||
JVM_GetAllThreads
|
||||
JVM_GetAndClearReferencePendingList
|
||||
JVM_GetArrayElement
|
||||
JVM_GetArrayLength
|
||||
JVM_GetCallerClass
|
||||
JVM_GetClassAccessFlags
|
||||
JVM_GetClassAnnotations
|
||||
JVM_GetClassConstantPool
|
||||
JVM_GetClassContext
|
||||
JVM_GetClassCPEntriesCount
|
||||
JVM_GetClassCPTypes
|
||||
JVM_GetClassDeclaredConstructors
|
||||
JVM_GetClassDeclaredFields
|
||||
JVM_GetClassDeclaredMethods
|
||||
JVM_GetClassFieldsCount
|
||||
JVM_GetClassFileVersion
|
||||
JVM_GetClassInterfaces
|
||||
JVM_GetClassMethodsCount
|
||||
JVM_GetClassModifiers
|
||||
JVM_GetClassNameUTF
|
||||
JVM_GetClassSignature
|
||||
JVM_GetClassSigners
|
||||
JVM_GetClassTypeAnnotations
|
||||
JVM_GetCPClassNameUTF
|
||||
JVM_GetCPFieldClassNameUTF
|
||||
JVM_GetCPFieldModifiers
|
||||
JVM_GetCPFieldNameUTF
|
||||
JVM_GetCPFieldSignatureUTF
|
||||
JVM_GetCPMethodClassNameUTF
|
||||
JVM_GetCPMethodModifiers
|
||||
JVM_GetCPMethodNameUTF
|
||||
JVM_GetCPMethodSignatureUTF
|
||||
JVM_GetDeclaredClasses
|
||||
JVM_GetDeclaringClass
|
||||
JVM_GetEnclosingMethodInfo
|
||||
JVM_GetExtendedNPEMessage
|
||||
JVM_GetFieldIxModifiers
|
||||
JVM_GetFieldTypeAnnotations
|
||||
JVM_GetInheritedAccessControlContext
|
||||
JVM_GetManagement
|
||||
JVM_GetMethodIxArgsSize
|
||||
JVM_GetMethodIxByteCode
|
||||
JVM_GetMethodIxByteCodeLength
|
||||
JVM_GetMethodIxExceptionIndexes
|
||||
JVM_GetMethodIxExceptionsCount
|
||||
JVM_GetMethodIxExceptionTableEntry
|
||||
JVM_GetMethodIxExceptionTableLength
|
||||
JVM_GetMethodIxLocalsCount
|
||||
JVM_GetMethodIxMaxStack
|
||||
JVM_GetMethodIxModifiers
|
||||
JVM_GetMethodIxNameUTF
|
||||
JVM_GetMethodIxSignatureUTF
|
||||
JVM_GetMethodParameters
|
||||
JVM_GetMethodTypeAnnotations
|
||||
JVM_GetNanoTimeAdjustment
|
||||
JVM_GetNestHost
|
||||
JVM_GetNestMembers
|
||||
JVM_GetNextThreadIdOffset
|
||||
JVM_GetPermittedSubclasses
|
||||
JVM_GetPrimitiveArrayElement
|
||||
JVM_GetProperties
|
||||
JVM_GetProtectionDomain
|
||||
JVM_GetRandomSeedForDumping
|
||||
JVM_GetRecordComponents
|
||||
JVM_GetSimpleBinaryName
|
||||
JVM_GetStackAccessControlContext
|
||||
JVM_GetSystemPackage
|
||||
JVM_GetSystemPackages
|
||||
JVM_GetTemporaryDirectory
|
||||
JVM_GetVmArguments
|
||||
JVM_Halt
|
||||
JVM_HasReferencePendingList
|
||||
JVM_HoldsLock
|
||||
JVM_GetStackTrace
|
||||
JVM_IHashCode
|
||||
JVM_InitClassName
|
||||
JVM_InitStackTraceElement
|
||||
JVM_InitStackTraceElementArray
|
||||
JVM_InitializeFromArchive
|
||||
JVM_InternString
|
||||
JVM_Interrupt
|
||||
JVM_InvokeMethod
|
||||
JVM_IsArrayClass
|
||||
JVM_IsCDSDumpingEnabled
|
||||
JVM_IsConstructorIx
|
||||
JVM_IsDumpingClassList
|
||||
JVM_IsFinalizationEnabled
|
||||
JVM_IsHiddenClass
|
||||
JVM_IsInterface
|
||||
JVM_IsPreviewEnabled
|
||||
JVM_IsContinuationsSupported
|
||||
JVM_IsPrimitiveClass
|
||||
JVM_IsRecord
|
||||
JVM_IsSameClassPackage
|
||||
JVM_IsSharingEnabled
|
||||
JVM_IsSupportedJNIVersion
|
||||
JVM_IsVMGeneratedMethodIx
|
||||
JVM_LatestUserDefinedLoader
|
||||
JVM_LoadZipLibrary
|
||||
JVM_LoadLibrary
|
||||
JVM_LookupDefineClass
|
||||
JVM_LookupLambdaProxyClassFromArchive
|
||||
JVM_LogLambdaFormInvoker
|
||||
JVM_MaxMemory
|
||||
JVM_MaxObjectInspectionAge
|
||||
JVM_MonitorNotify
|
||||
JVM_MonitorNotifyAll
|
||||
JVM_MonitorWait
|
||||
JVM_MoreStackWalk
|
||||
JVM_NanoTime
|
||||
JVM_NativePath
|
||||
JVM_NewArray
|
||||
JVM_NewInstanceFromConstructor
|
||||
JVM_NewMultiArray
|
||||
JVM_PhantomReferenceRefersTo
|
||||
JVM_PrintWarningAtDynamicAgentLoad
|
||||
JVM_RaiseSignal
|
||||
JVM_RawMonitorCreate
|
||||
JVM_RawMonitorDestroy
|
||||
JVM_RawMonitorEnter
|
||||
JVM_RawMonitorExit
|
||||
JVM_ReferenceClear
|
||||
JVM_ReferenceRefersTo
|
||||
JVM_RegisterContinuationMethods
|
||||
JVM_RegisterLambdaProxyClassForArchiving
|
||||
JVM_RegisterSignal
|
||||
JVM_ReleaseUTF
|
||||
JVM_ReportFinalizationComplete
|
||||
JVM_SetArrayElement
|
||||
JVM_SetClassSigners
|
||||
JVM_SetNativeThreadName
|
||||
JVM_SetPrimitiveArrayElement
|
||||
JVM_SetStackWalkContinuation
|
||||
JVM_SetThreadPriority
|
||||
JVM_SleepNanos
|
||||
JVM_StartThread
|
||||
JVM_TotalMemory
|
||||
JVM_UnloadLibrary
|
||||
JVM_WaitForReferencePendingList
|
||||
JVM_Yield
|
||||
|
||||
# Module related API's
|
||||
JVM_AddModuleExports
|
||||
JVM_AddModuleExportsToAll
|
||||
JVM_AddModuleExportsToAllUnnamed
|
||||
JVM_AddReadsModule
|
||||
JVM_DefineArchivedModules
|
||||
JVM_DefineModule
|
||||
JVM_SetBootLoaderUnnamedModule
|
||||
|
||||
# Virtual thread notifications for JVMTI
|
||||
JVM_VirtualThreadStart
|
||||
JVM_VirtualThreadEnd
|
||||
JVM_VirtualThreadMount
|
||||
JVM_VirtualThreadUnmount
|
||||
JVM_VirtualThreadHideFrames
|
||||
JVM_VirtualThreadDisableSuspend
|
||||
|
||||
# Scoped values
|
||||
JVM_EnsureMaterializedForStackWalk_func
|
||||
JVM_FindScopedValueBindings
|
||||
JVM_ScopedValueCache
|
||||
JVM_SetScopedValueCache
|
||||
#
|
||||
11
make/data/hotspot-symbols/version-script.txt
Normal file
11
make/data/hotspot-symbols/version-script.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
SUNWprivate_1.1 {
|
||||
global:
|
||||
*;
|
||||
|
||||
local:
|
||||
__bss_start;
|
||||
_edata;
|
||||
_end;
|
||||
_fini;
|
||||
_init;
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -26,38 +26,106 @@
|
||||
# Create a bundle in the current directory, containing what's needed to run
|
||||
# the 'dot' program from the graphviz suite by the OpenJDK build.
|
||||
|
||||
TMPDIR=`mktemp -d -t graphvizbundle-XXXX`
|
||||
trap "rm -rf \"$TMPDIR\"" EXIT
|
||||
set -eux
|
||||
|
||||
ORIG_DIR=`pwd`
|
||||
cd "$TMPDIR"
|
||||
GRAPHVIZ_VERSION=2.38.0-1
|
||||
PACKAGE_VERSION=1.1
|
||||
TARGET_PLATFORM=linux_x64
|
||||
BUNDLE_NAME=graphviz-$TARGET_PLATFORM-$GRAPHVIZ_VERSION+$PACKAGE_VERSION.tar.gz
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-libs-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-core-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-x-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm
|
||||
mydir="$(cd -- $(dirname ${BASH_SOURCE[0]}) && pwd)"
|
||||
me="${mydir}/$(basename ${BASH_SOURCE[0]})"
|
||||
|
||||
mkdir graphviz
|
||||
cd graphviz
|
||||
for rpm in ../*.rpm; do
|
||||
rpm2cpio $rpm | cpio --extract --make-directories
|
||||
done
|
||||
EXPAT_VERSION="2.6.0"
|
||||
EXPAT_URL="https://github.com/libexpat/libexpat/releases/download/R_${EXPAT_VERSION//./_}/expat-${EXPAT_VERSION}.tar.gz"
|
||||
EXPAT_SHA256="a13447b9aa67d7c860783fdf6820f33ebdea996900d6d8bbc50a628f55f099f7"
|
||||
|
||||
cat > dot << EOF
|
||||
GRAPHVIZ_VERSION="9.0.0"
|
||||
GRAPHVIZ_URL="https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/${GRAPHVIZ_VERSION}/graphviz-${GRAPHVIZ_VERSION}.tar.xz"
|
||||
GRAPHVIZ_SHA256="6c9afda06a732af7658c2619ee713d2545818c3ff19b7b8fd48effcd06d57bf6"
|
||||
|
||||
uname_s="$(uname -s)"
|
||||
case ${uname_s} in
|
||||
Linux)
|
||||
bundle_os="linux"
|
||||
shacmd="sha256sum --strict --check -"
|
||||
lib_path_var="LD_LIBRARY_PATH"
|
||||
;;
|
||||
Darwin)
|
||||
bundle_os="macosx"
|
||||
shacmd="shasum -a 256 --strict --check -"
|
||||
lib_path_var="DYLD_LIBRARY_PATH"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown OS: ${uname_s}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
uname_m="$(uname -m)"
|
||||
case ${uname_m} in
|
||||
aarch64|arm64)
|
||||
bundle_cpu="aarch64"
|
||||
;;
|
||||
x86_64)
|
||||
bundle_cpu="x64"
|
||||
;;
|
||||
esac
|
||||
bundle_platform="${bundle_os}_${bundle_cpu}"
|
||||
|
||||
build_dir="${mydir}/../../build/graphviz"
|
||||
download_dir="${build_dir}/download"
|
||||
install_dir="${build_dir}/result/graphviz-${bundle_platform}-${GRAPHVIZ_VERSION}"
|
||||
bundle_file="${install_dir}.tar.gz"
|
||||
|
||||
expat_dir="${build_dir}/expat"
|
||||
expat_src_dir="${expat_dir}/src"
|
||||
|
||||
graphviz_dir="${build_dir}/graphviz"
|
||||
graphviz_src_dir="${graphviz_dir}/src"
|
||||
graphviz_doc_dir="${install_dir}/doc"
|
||||
|
||||
mkdir -p "${build_dir}"
|
||||
cd "${build_dir}"
|
||||
|
||||
download_and_unpack() {
|
||||
local url="$1"
|
||||
local sha256="$2"
|
||||
local file="$3"
|
||||
local dir="$4"
|
||||
|
||||
mkdir -p "$(dirname "${file}")"
|
||||
if [ ! -f "${file}" ]; then
|
||||
curl -L -o "${file}" "${url}"
|
||||
fi
|
||||
echo "${sha256} ${file}" | ${shacmd}
|
||||
if [ ! -d "${dir}" ]; then
|
||||
mkdir -p "${dir}"
|
||||
tar --extract --file "${file}" --directory "${dir}" --strip-components 1
|
||||
fi
|
||||
}
|
||||
|
||||
download_and_unpack "${EXPAT_URL}" "${EXPAT_SHA256}" "${download_dir}/expat.tar.gz" "${expat_src_dir}"
|
||||
download_and_unpack "${GRAPHVIZ_URL}" "${GRAPHVIZ_SHA256}" "${download_dir}/graphviz.tar.gz" "${graphviz_src_dir}"
|
||||
|
||||
(
|
||||
cd "${expat_src_dir}"
|
||||
./configure --prefix="${install_dir}"
|
||||
make -j install
|
||||
)
|
||||
|
||||
(
|
||||
cd "${graphviz_src_dir}"
|
||||
./configure --prefix="${install_dir}" EXPAT_CFLAGS="-I${install_dir}/include" EXPAT_LIBS="-L${install_dir}/lib -lexpat"
|
||||
make -j install
|
||||
)
|
||||
|
||||
cat > "${install_dir}/dot" << EOF
|
||||
#!/bin/bash
|
||||
# Get an absolute path to this script
|
||||
this_script_dir=\`dirname \$0\`
|
||||
this_script_dir=\`cd \$this_script_dir > /dev/null && pwd\`
|
||||
export LD_LIBRARY_PATH="\$this_script_dir/usr/lib64:\$LD_LIBRARY_PATH"
|
||||
exec \$this_script_dir/usr/bin/dot "\$@"
|
||||
this_script_dir="\$(dirname \$0)"
|
||||
this_script_dir="\$(cd \${this_script_dir} > /dev/null && pwd)"
|
||||
export ${lib_path_var}="\${this_script_dir}/lib:\${this_script_dir}/lib/graphviz"
|
||||
exec "\${this_script_dir}/bin/dot" "\$@"
|
||||
EOF
|
||||
chmod +x dot
|
||||
export LD_LIBRARY_PATH="$TMPDIR/graphviz/usr/lib64:$LD_LIBRARY_PATH"
|
||||
chmod +x "${install_dir}/dot"
|
||||
# create config file
|
||||
./dot -c
|
||||
tar -cvzf ../$BUNDLE_NAME *
|
||||
cp ../$BUNDLE_NAME "$ORIG_DIR"
|
||||
"${install_dir}/dot" -c
|
||||
|
||||
cp "${me}" "${install_dir}"
|
||||
|
||||
tar --create --gzip --file "${bundle_file}" -C "${install_dir}" .
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, 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
|
||||
@@ -45,13 +45,12 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
|
||||
endif
|
||||
else ifeq ($(call isBuildOs, windows), true)
|
||||
ADLC_LDFLAGS += -nologo
|
||||
ADLC_CFLAGS := -nologo -EHsc
|
||||
ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
|
||||
endif
|
||||
|
||||
# Set the C++ standard
|
||||
ADLC_CFLAGS += $(ADLC_LANGSTD_CXXFLAG)
|
||||
ADLC_CFLAGS += $(ADLC_LANGSTD_CXXFLAGS)
|
||||
|
||||
# NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
|
||||
# hurt.
|
||||
@@ -72,7 +71,8 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
$(eval $(call SetupNativeCompilation, BUILD_ADLC, \
|
||||
NAME := adlc, \
|
||||
TYPE := EXECUTABLE, \
|
||||
TOOLCHAIN := TOOLCHAIN_BUILD_LINK_CXX, \
|
||||
TARGET_TYPE := BUILD, \
|
||||
LINK_TYPE := C++, \
|
||||
SRC := $(TOPDIR)/src/hotspot/share/adlc, \
|
||||
EXTRA_FILES := $(TOPDIR)/src/hotspot/share/opto/opcodes.cpp, \
|
||||
CFLAGS := $(ADLC_CFLAGS) $(ADLC_CFLAGS_WARNINGS), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, 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
|
||||
@@ -50,7 +50,7 @@ endif
|
||||
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
NAME := gtest, \
|
||||
TYPE := STATIC_LIBRARY, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_OUTPUTDIR)/libgtest, \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/libgtest/objs, \
|
||||
SRC := \
|
||||
@@ -75,25 +75,11 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
TARGETS += $(BUILD_GTEST_LIBGTEST)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
GTEST_JVM_MAPFILE := $(JVM_MAPFILE)
|
||||
else
|
||||
GTEST_JVM_MAPFILE := $(JVM_OUTPUTDIR)/gtest/mapfile
|
||||
|
||||
$(JVM_OUTPUTDIR)/gtest/symbols: $(JVM_OUTPUTDIR)/symbols
|
||||
$(call MakeDir, $(@D))
|
||||
( $(CAT) $< ; echo "runUnitTests" ) > $@
|
||||
|
||||
$(GTEST_JVM_MAPFILE): $(JVM_OUTPUTDIR)/gtest/symbols
|
||||
$(call create-mapfile)
|
||||
endif
|
||||
|
||||
# Additional disabled warnings are due to code in the test source.
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
NAME := jvm, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
|
||||
SRC := $(GTEST_TEST_SRC), \
|
||||
@@ -123,8 +109,6 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
LIBS_unix := -lgtest, \
|
||||
LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
|
||||
OPTIMIZATION := $(JVM_OPTIMIZATION), \
|
||||
MAPFILE := $(GTEST_JVM_MAPFILE), \
|
||||
USE_MAPFILE_FOR_SYMBOLS := true, \
|
||||
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
|
||||
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
|
||||
STRIP_SYMBOLS := false, \
|
||||
@@ -134,14 +118,19 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
|
||||
$(BUILD_GTEST_LIBJVM) : $(BUILD_GTEST_LIBGTEST)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(BUILD_GTEST_LIBJVM_TARGET): $(WIN_EXPORT_FILE)
|
||||
endif
|
||||
|
||||
|
||||
TARGETS += $(BUILD_GTEST_LIBJVM)
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
NAME := gtestLauncher, \
|
||||
TYPE := EXECUTABLE, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
|
||||
EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, 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
|
||||
@@ -33,7 +33,6 @@ include lib/JvmFlags.gmk
|
||||
# Setup compilation of the main Hotspot native library (libjvm).
|
||||
|
||||
JVM_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm
|
||||
JVM_MAPFILE := $(JVM_OUTPUTDIR)/mapfile
|
||||
|
||||
################################################################################
|
||||
# Platform independent setup
|
||||
@@ -146,12 +145,28 @@ $(call FillFindCache, $(JVM_SRC_DIRS))
|
||||
# operator new.
|
||||
LIBJVM_STATIC_EXCLUDE_OBJS := operator_new.o
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
WIN_EXPORT_FILE := $(JVM_OUTPUTDIR)/static-win-exports.def
|
||||
else
|
||||
WIN_EXPORT_FILE := $(JVM_OUTPUTDIR)/win-exports.def
|
||||
endif
|
||||
|
||||
JVM_LDFLAGS += -def:$(WIN_EXPORT_FILE)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
HOTSPOT_VERSION_SCRIPT := $(TOPDIR)/make/data/hotspot-symbols/version-script.txt
|
||||
|
||||
JVM_LDFLAGS += -Wl,--exclude-libs,ALL -Wl,-version-script=$(HOTSPOT_VERSION_SCRIPT)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Now set up the actual compilation of the main hotspot native library
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
NAME := jvm, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
|
||||
SRC := $(JVM_SRC_DIRS), \
|
||||
EXCLUDES := $(JVM_EXCLUDES), \
|
||||
@@ -169,6 +184,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
DISABLED_WARNINGS_gcc_jvmciCodeInstaller.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahLock.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_synchronizer.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
|
||||
@@ -194,8 +210,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
LIBS := $(JVM_LIBS), \
|
||||
OPTIMIZATION := $(JVM_OPTIMIZATION), \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \
|
||||
MAPFILE := $(JVM_MAPFILE), \
|
||||
USE_MAPFILE_FOR_SYMBOLS := true, \
|
||||
STRIPFLAGS := $(JVM_STRIPFLAGS), \
|
||||
EMBED_MANIFEST := true, \
|
||||
RC_FILEDESC := $(HOTSPOT_VM_DISTRO) $(OPENJDK_TARGET_CPU_BITS)-Bit $(JVM_VARIANT) VM, \
|
||||
@@ -204,11 +218,47 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBJVM_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
# The following lines create a list of vftable symbols to be filtered out of
|
||||
# the symbol file. Removing this line causes the linker to complain about too
|
||||
# many (> 64K) symbols, so the _guess_ is that this line is here to keep down
|
||||
# the number of exported symbols below that limit.
|
||||
#
|
||||
# Some usages of C++ lambdas require the vftable symbol of classes that use
|
||||
# the lambda type as a template parameter. The usage of those classes won't
|
||||
# link if their vftable symbols are removed. That's why there's an exception
|
||||
# for vftable symbols containing the string 'lambda'.
|
||||
#
|
||||
# A very simple example of a lambda usage that fails if the lambda vftable
|
||||
# symbols are missing in the symbol file:
|
||||
#
|
||||
# #include <functional>
|
||||
# std::function<void()> f = [](){}
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print " " $$7; \
|
||||
}'
|
||||
|
||||
# A more correct solution would be to send BUILD_LIBJVM_ALL_OBJS instead of
|
||||
# cd && *.obj, but this will result in very long command lines, which could be
|
||||
# problematic.
|
||||
$(WIN_EXPORT_FILE): $(BUILD_LIBJVM_ALL_OBJS)
|
||||
$(call LogInfo, Generating list of symbols to export from object files)
|
||||
$(call MakeDir, $(@D))
|
||||
$(ECHO) "EXPORTS" > $@.tmp
|
||||
$(CD) $(BUILD_LIBJVM_OBJECT_DIR) && \
|
||||
$(DUMPBIN) -symbols *$(OBJ_SUFFIX) | $(AWK) $(FILTER_SYMBOLS_AWK_SCRIPT) | $(SORT) -u >> $@.tmp
|
||||
$(RM) $@
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
$(BUILD_LIBJVM_TARGET): $(WIN_EXPORT_FILE)
|
||||
endif
|
||||
|
||||
# Always recompile abstract_vm_version.cpp if libjvm needs to be relinked. This ensures
|
||||
# that the internal vm version is updated as it relies on __DATE__ and __TIME__
|
||||
# macros.
|
||||
ABSTRACT_VM_VERSION_OBJ := $(JVM_OUTPUTDIR)/objs/abstract_vm_version$(OBJ_SUFFIX)
|
||||
$(ABSTRACT_VM_VERSION_OBJ): $(filter-out $(ABSTRACT_VM_VERSION_OBJ) $(JVM_MAPFILE), \
|
||||
$(ABSTRACT_VM_VERSION_OBJ): $(filter-out $(ABSTRACT_VM_VERSION_OBJ), \
|
||||
$(BUILD_LIBJVM_TARGET_DEPS))
|
||||
|
||||
ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
|
||||
@@ -236,11 +286,6 @@ endif
|
||||
# 1540-1090 : (I) The destructor of "..." might not be called.
|
||||
# 1540-1639 : (I) The behavior of long type bit fields has changed ...
|
||||
|
||||
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only
|
||||
# defined after the above call to BUILD_LIBJVM. Mapfile will be generated
|
||||
# after all object files are built, but before the jvm library is linked.
|
||||
include lib/JvmMapfile.gmk
|
||||
|
||||
TARGETS += $(BUILD_LIBJVM)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmMapfile.gmk))
|
||||
|
||||
################################################################################
|
||||
# Combine a list of static symbols
|
||||
|
||||
ifeq ($(call And, $(call isTargetOs, windows) $(call isTargetCpu, x86_64)), false)
|
||||
# On Windows x86_64, we should not have any symbols at all, since that
|
||||
# results in duplicate warnings from the linker (JDK-8043491).
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-shared
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOsType, unix), true)
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-unix
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)), )
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring debug, $(DEBUG_LEVEL)), )
|
||||
ifneq ($(wildcard $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)-debug), )
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)-debug
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Create a dynamic list of symbols from the built object files. This is highly
|
||||
# platform dependent.
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) --defined-only *$(OBJ_SUFFIX)
|
||||
ifneq ($(FILTER_SYMBOLS_PATTERN), )
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
|
||||
endif
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)^_ZTV|^gHotSpotVM|^UseSharedSpaces$$
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|^_ZN9Arguments17SharedArchivePathE$$
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \
|
||||
}'
|
||||
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
# nm on macosx prints out "warning: nm: no name list" to stderr for
|
||||
# files without symbols. Hide this, even at the expense of hiding real errors.
|
||||
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -Uj *$(OBJ_SUFFIX) 2> /dev/null
|
||||
ifneq ($(FILTER_SYMBOLS_PATTERN), )
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
|
||||
endif
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)^_ZTV|^gHotSpotVM
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \
|
||||
}'
|
||||
|
||||
# NOTE: The script is from the old build. It is broken and finds no symbols.
|
||||
# The script below might be what was intended, but it fails to link with tons
|
||||
# of 'cannot export hidden symbol vtable for X'.
|
||||
# '{ if ($$1 ~ /^__ZTV/ || $$1 ~ /^_gHotSpotVM/) print substr($$1, 2) }'
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# NOTE: The old build had the solution below. This should to be fixed in
|
||||
# configure instead.
|
||||
|
||||
# On AIX we have to prevent that we pick up the 'nm' version from the GNU binutils
|
||||
# which may be installed under /opt/freeware/bin. So better use an absolute path here!
|
||||
# NM=/usr/bin/nm
|
||||
|
||||
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -B -C *$(OBJ_SUFFIX)
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if (($$2="d" || $$2="D") && ($$3 ~ /^__vft/ || $$3 ~ /^gHotSpotVM/)) print $$3; \
|
||||
if ($$3 ~ /^UseSharedSpaces$$/) print $$3; \
|
||||
if ($$3 ~ /^SharedArchivePath__9Arguments$$/) print $$3; \
|
||||
}'
|
||||
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *$(OBJ_SUFFIX)
|
||||
|
||||
# The following lines create a list of vftable symbols to be filtered out of
|
||||
# the mapfile. Removing this line causes the linker to complain about too many
|
||||
# (> 64K) symbols, so the _guess_ is that this line is here to keep down the
|
||||
# number of exported symbols below that limit.
|
||||
#
|
||||
# Some usages of C++ lambdas require the vftable symbol of classes that use
|
||||
# the lambda type as a template parameter. The usage of those classes won't
|
||||
# link if their vftable symbols are removed. That's why there's an exception
|
||||
# for vftable symbols containing the string 'lambda'.
|
||||
#
|
||||
# A very simple example of a lambda usage that fails if the lambda vftable
|
||||
# symbols are missing in the mapfile:
|
||||
#
|
||||
# #include <functional>
|
||||
# std::function<void()> f = [](){}
|
||||
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
|
||||
}'
|
||||
|
||||
else
|
||||
$(error Unknown target OS $(OPENJDK_TARGET_OS) in JvmMapfile.gmk)
|
||||
endif
|
||||
|
||||
# A more correct solution would be to send BUILD_LIBJVM_ALL_OBJS instead of
|
||||
# cd && *.o, but this will result in very long command lines, which is
|
||||
# problematic on some platforms.
|
||||
$(JVM_OUTPUTDIR)/symbols-objects: $(BUILD_LIBJVM_ALL_OBJS)
|
||||
$(call LogInfo, Generating symbol list from object files)
|
||||
$(CD) $(JVM_OUTPUTDIR)/objs && \
|
||||
$(DUMP_SYMBOLS_CMD) | $(AWK) $(FILTER_SYMBOLS_AWK_SCRIPT) | $(SORT) -u > $@
|
||||
|
||||
SYMBOLS_SRC += $(JVM_OUTPUTDIR)/symbols-objects
|
||||
|
||||
################################################################################
|
||||
# Now concatenate all symbol lists into a single file and remove comments.
|
||||
|
||||
$(JVM_OUTPUTDIR)/symbols: $(SYMBOLS_SRC)
|
||||
$(SED) -e '/^#/d' $^ > $@
|
||||
|
||||
################################################################################
|
||||
# Finally convert the symbol list into a platform-specific mapfile
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# On macosx, we need to add a leading underscore
|
||||
define create-mapfile-work
|
||||
$(AWK) '{ if ($$0 ~ ".") { print " _" $$0 } }' < $^ > $@.tmp
|
||||
endef
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
# On windows, add an 'EXPORTS' header
|
||||
define create-mapfile-work
|
||||
$(ECHO) "EXPORTS" > $@.tmp
|
||||
$(AWK) '{ if ($$0 ~ ".") { print " " $$0 } }' < $^ >> $@.tmp
|
||||
endef
|
||||
else
|
||||
# Assume standard linker script
|
||||
define create-mapfile-work
|
||||
$(PRINTF) "SUNWprivate_1.1 { \n global: \n" > $@.tmp
|
||||
$(AWK) '{ if ($$0 ~ ".") { print " " $$0 ";" } }' < $^ >> $@.tmp
|
||||
$(PRINTF) " local: \n *; \n }; \n" >> $@.tmp
|
||||
endef
|
||||
endif
|
||||
|
||||
define create-mapfile
|
||||
$(call LogInfo, Creating mapfile)
|
||||
$(call MakeDir, $(@D))
|
||||
$(call create-mapfile-work)
|
||||
$(RM) $@
|
||||
$(MV) $@.tmp $@
|
||||
endef
|
||||
|
||||
$(JVM_MAPFILE): $(JVM_OUTPUTDIR)/symbols
|
||||
$(call create-mapfile)
|
||||
@@ -48,9 +48,6 @@ ifneq ($(FDLIBM_CFLAGS), )
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
BUILD_LIBJVM_ostream.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64
|
||||
BUILD_LIBJVM_logFileOutput.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64
|
||||
|
||||
BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
|
||||
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -35,6 +35,7 @@ import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.net.InetAddress;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
@@ -132,6 +133,8 @@ public class HelloClasslist {
|
||||
String oldDate = String.format("%s%n",
|
||||
DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ROOT)
|
||||
.format(new Date()));
|
||||
StandardCharsets.US_ASCII.encode("");
|
||||
StandardCharsets.UTF_8.encode("");
|
||||
|
||||
// A selection of trivial and common reflection operations
|
||||
var instance = HelloClasslist.class.getConstructor().newInstance();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -23,7 +23,11 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
DISABLED_WARNINGS_java += this-escape restricted
|
||||
# The base module should be built with all warnings enabled. When a
|
||||
# new warning is added to javac, it can be temporarily added to the
|
||||
# disabled warnings list.
|
||||
#
|
||||
# DISABLED_WARNINGS_java +=
|
||||
|
||||
DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
@@ -37,7 +41,8 @@ EXCLUDE_FILES += \
|
||||
|
||||
EXCLUDES += java/lang/doc-files \
|
||||
java/lang/classfile/snippet-files \
|
||||
java/lang/classfile/components/snippet-files
|
||||
java/lang/classfile/components/snippet-files \
|
||||
java/lang/foreign/snippet-files
|
||||
|
||||
# Exclude BreakIterator classes that are just used in compile process to generate
|
||||
# data files and shouldn't go in the product
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -242,7 +242,7 @@ endif
|
||||
ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)+$(filter $(TOOLCHAIN_TYPE), gcc), true+true+true+gcc)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIB_SIMD_SORT, \
|
||||
NAME := simdsort, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) -std=c++17, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -115,7 +115,7 @@ TARGETS += $(BUILD_LIBZIP)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
|
||||
NAME := jimage, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -23,6 +23,10 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# To the extent technically possible, this module should be built with
|
||||
# -Werror and all lint warnings enabled. In particular,
|
||||
# DISABLED_WARNINGS_java should not be augmented.
|
||||
|
||||
DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -51,13 +51,14 @@ ifeq ($(call isTargetOs, aix), false)
|
||||
-DUSE_PLATFORM_MIDI_IN=TRUE \
|
||||
#
|
||||
|
||||
LIBJSOUND_LINK_TYPE := C
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
||||
LIBJSOUND_LINK_TYPE := C++
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
|
||||
NAME := jsound, \
|
||||
TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
|
||||
LINK_TYPE := $(LIBJSOUND_LINK_TYPE), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBJSOUND_CFLAGS), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -449,7 +449,6 @@ else
|
||||
LIBFREETYPE_LIBS := -lfreetype
|
||||
endif
|
||||
|
||||
# gcc_ftobjs.c := maybe-uninitialized required for GCC 7 builds.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
|
||||
NAME := freetype, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
@@ -458,7 +457,6 @@ else
|
||||
EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_microsoft := 4267 4244 4996, \
|
||||
DISABLED_WARNINGS_gcc := dangling-pointer stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_ftobjs.c := maybe-uninitialized, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
))
|
||||
@@ -508,8 +506,10 @@ else
|
||||
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
|
||||
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
|
||||
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
|
||||
# calloc-transposed-args required for GCC 14 builds. (fixed upstream in Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92)
|
||||
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type \
|
||||
expansion-to-defined dangling-reference maybe-uninitialized
|
||||
expansion-to-defined dangling-reference maybe-uninitialized \
|
||||
calloc-transposed-args
|
||||
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers range-loop-analysis
|
||||
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244
|
||||
|
||||
@@ -562,9 +562,9 @@ LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
|
||||
# libawt_xawt). See JDK-8196516 for details.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
NAME := fontmanager, \
|
||||
LINK_TYPE := C++, \
|
||||
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
|
||||
AccelGlyphCache.c, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
|
||||
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -23,6 +23,10 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# To the extent technically possible, this module should be built with
|
||||
# -Werror and all lint warnings enabled. In particular,
|
||||
# DISABLED_WARNINGS_java should not be augmented.
|
||||
|
||||
DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*'
|
||||
JAVAC_FLAGS += -XDstringConcat=inline
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2024, 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
|
||||
@@ -27,10 +27,7 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
SA_CFLAGS := -D_FILE_OFFSET_BITS=64
|
||||
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
SA_CFLAGS := -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
|
||||
-mstack-alignment=16 -fPIC
|
||||
LIBSA_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
|
||||
@@ -48,16 +45,16 @@ else ifeq ($(call isTargetOs, windows), true)
|
||||
endif
|
||||
endif
|
||||
|
||||
SA_TOOLCHAIN := $(TOOLCHAIN_DEFAULT)
|
||||
SA_LINK_TYPE := C
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
||||
SA_LINK_TYPE := C++
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
|
||||
NAME := saproc, \
|
||||
TOOLCHAIN := $(SA_TOOLCHAIN), \
|
||||
LINK_TYPE := $(SA_LINK_TYPE), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
DISABLED_WARNINGS_gcc := sign-compare, \
|
||||
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2024, 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
|
||||
@@ -31,7 +31,7 @@ ifeq ($(call isTargetOs, linux macosx windows), true)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBLE, \
|
||||
NAME := le, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CXXFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
DISABLED_WARNINGS_java += this-escape
|
||||
# To the extent technically possible, this module should be built with
|
||||
# -Werror and all lint warnings enabled. In particular,
|
||||
# DISABLED_WARNINGS_java should not be augmented.
|
||||
|
||||
COPY += .xml .css .svg .js .js.template .png .txt
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2024, 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
|
||||
@@ -32,13 +32,13 @@ include LauncherCommon.gmk
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
JPACKAGE_APPLAUNCHER_SRC := \
|
||||
$(call FindSrcDirsForComponent, jdk.jpackage, applauncher)
|
||||
JPACKAGE_APPLAUNCHER_TOOLCHAIN := TOOLCHAIN_DEFAULT
|
||||
JPACKAGE_APPLAUNCHER_LINK_TYPE := C
|
||||
JPACKAGE_APPLAUNCHER_INCLUDE_FILES := %.c
|
||||
else
|
||||
JPACKAGE_APPLAUNCHER_SRC := \
|
||||
$(call FindSrcDirsForComponent, jdk.jpackage, applauncher) \
|
||||
$(call FindSrcDirsForComponent, jdk.jpackage, common)
|
||||
JPACKAGE_APPLAUNCHER_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
||||
JPACKAGE_APPLAUNCHER_LINK_TYPE := C++
|
||||
endif
|
||||
|
||||
|
||||
@@ -59,11 +59,11 @@ JPACKAGE_APPLAUNCHER_INCLUDES := $(addprefix -I, $(JPACKAGE_APPLAUNCHER_SRC))
|
||||
# Output app launcher executable in resources dir, and symbols in the object dir
|
||||
$(eval $(call SetupJdkExecutable, BUILD_JPACKAGE_APPLAUNCHEREXE, \
|
||||
NAME := jpackageapplauncher, \
|
||||
LINK_TYPE := $(JPACKAGE_APPLAUNCHER_LINK_TYPE), \
|
||||
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
|
||||
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncher, \
|
||||
SRC := $(JPACKAGE_APPLAUNCHER_SRC), \
|
||||
INCLUDE_FILES := $(JPACKAGE_APPLAUNCHER_INCLUDE_FILES), \
|
||||
TOOLCHAIN := $(JPACKAGE_APPLAUNCHER_TOOLCHAIN), \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_LinuxPackage.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
|
||||
@@ -103,7 +103,7 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncheraux, \
|
||||
SRC := $(JPACKAGE_LIBAPPLAUNCHER_SRC), \
|
||||
EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_tstrings.cpp := format-nonliteral, \
|
||||
@@ -177,10 +177,10 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
# Build non-console version of launcher
|
||||
$(eval $(call SetupJdkExecutable, BUILD_JPACKAGE_APPLAUNCHERWEXE, \
|
||||
NAME := jpackageapplauncherw, \
|
||||
LINK_TYPE := $(BUILD_JPACKAGE_APPLAUNCHEREXE_LINK_TYPE), \
|
||||
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
|
||||
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncherw, \
|
||||
SRC := $(BUILD_JPACKAGE_APPLAUNCHEREXE_SRC), \
|
||||
TOOLCHAIN := $(BUILD_JPACKAGE_APPLAUNCHEREXE_TOOLCHAIN), \
|
||||
OPTIMIZATION := $(BUILD_JPACKAGE_APPLAUNCHEREXE_OPTIMIZATION), \
|
||||
CXXFLAGS := $(BUILD_JPACKAGE_APPLAUNCHEREXE_CXXFLAGS), \
|
||||
CXXFLAGS_windows := $(BUILD_JPACKAGE_APPLAUNCHEREXE_CXXFLAGS_windows) -DJP_LAUNCHERW, \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, 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
|
||||
@@ -60,13 +60,15 @@ else
|
||||
STAT_PRINT_SIZE="-c %s"
|
||||
fi
|
||||
|
||||
COMPARE_EXCEPTIONS_INCLUDE="$TOPDIR/make/scripts/compare_exceptions.sh.incl"
|
||||
if [ ! -e "$COMPARE_EXCEPTIONS_INCLUDE" ]; then
|
||||
echo "Error: Cannot locate the exceptions file, it should have been here: $COMPARE_EXCEPTIONS_INCLUDE"
|
||||
exit 1
|
||||
|
||||
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
# We ship a pdb file inside a published zip. Such files can never be built
|
||||
# reproducibly, so ignore it.
|
||||
ACCEPTED_JARZIP_CONTENTS="/modules_libs/java.security.jgss/w2k_lsa_auth.dll.pdb"
|
||||
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
||||
# Due to signing, we can never get a byte-by-byte identical build on macOS
|
||||
STRIP_TESTS_BEFORE_COMPARE="true"
|
||||
fi
|
||||
# Include exception definitions
|
||||
. "$COMPARE_EXCEPTIONS_INCLUDE"
|
||||
|
||||
################################################################################
|
||||
#
|
||||
@@ -117,35 +119,6 @@ diff_text() {
|
||||
|
||||
TMP=$($DIFF $THIS_FILE $OTHER_FILE)
|
||||
|
||||
if test "x$SUFFIX" = "xclass"; then
|
||||
if [ "$NAME" = "SystemModules\$all.class" ] \
|
||||
|| [ "$NAME" = "SystemModules\$default.class" ]; then
|
||||
# The SystemModules\$*.classes are not comparable as they contain the
|
||||
# module hashes which would require a whole other level of
|
||||
# reproducible builds to get reproducible. There is also random
|
||||
# order of map initialization.
|
||||
TMP=""
|
||||
elif [ "$NAME" = "module-info.class" ]; then
|
||||
# The module-info.class have several issues with random ordering of
|
||||
# elements in HashSets.
|
||||
MODULES_CLASS_FILTER="$SED \
|
||||
-e 's/,$//' \
|
||||
-e 's/;$//' \
|
||||
-e 's/^ *[0-9]*://' \
|
||||
-e 's/#[0-9]* */#/' \
|
||||
-e 's/ *\/\// \/\//' \
|
||||
-e 's/aload *[0-9]*/aload X/' \
|
||||
-e 's/ldc_w/ldc /' \
|
||||
| $SORT \
|
||||
"
|
||||
$JAVAP -c -constants -l -p "${OTHER_FILE}" \
|
||||
| eval "$MODULES_CLASS_FILTER" > ${OTHER_FILE}.javap &
|
||||
$JAVAP -c -constants -l -p "${THIS_FILE}" \
|
||||
| eval "$MODULES_CLASS_FILTER" > ${THIS_FILE}.javap &
|
||||
wait
|
||||
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$TMP"; then
|
||||
echo Files $OTHER_FILE and $THIS_FILE differ
|
||||
@@ -312,75 +285,60 @@ compare_file_types() {
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Compare the rest of the files
|
||||
# Find all files to compare and separate them into different categories
|
||||
|
||||
compare_general_files() {
|
||||
locate_files() {
|
||||
THIS_DIR=$1
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
TEMP_DIR=$COMPARE_ROOT/support
|
||||
$MKDIR -p $TEMP_DIR
|
||||
|
||||
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \
|
||||
! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
|
||||
! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
|
||||
! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
|
||||
! -name "*.lib" ! -name "*.jmod" ! -name "*.exe" \
|
||||
! -name "*.obj" ! -name "*.o" ! -name "jspawnhelper" ! -name "*.a" \
|
||||
! -name "*.tar.gz" ! -name "gtestLauncher" \
|
||||
! -name "*.map" \
|
||||
| $GREP -v "./bin/" | $SORT | $FILTER)
|
||||
ALL_FILES_PATH=$TEMP_DIR/all_files.txt
|
||||
cd $THIS_DIR && $FIND . -type f | $SORT | $FILTER > $ALL_FILES_PATH
|
||||
|
||||
echo Other files with binary differences...
|
||||
for f in $GENERAL_FILES
|
||||
do
|
||||
# Skip all files in test/*/native
|
||||
if [[ "$f" == */native/* ]]; then
|
||||
continue
|
||||
fi
|
||||
if [ -e $OTHER_DIR/$f ]; then
|
||||
SUFFIX="${f##*.}"
|
||||
if [ "$(basename $f)" = "release" ]; then
|
||||
# In release file, ignore differences in source rev numbers
|
||||
OTHER_FILE=$WORK_DIR/$f.other
|
||||
THIS_FILE=$WORK_DIR/$f.this
|
||||
$MKDIR -p $(dirname $OTHER_FILE)
|
||||
$MKDIR -p $(dirname $THIS_FILE)
|
||||
RELEASE_FILTER="$SED -e 's/SOURCE=".*"/SOURCE=<src-rev>/g'"
|
||||
$CAT $OTHER_DIR/$f | eval "$RELEASE_FILTER" > $OTHER_FILE
|
||||
$CAT $THIS_DIR/$f | eval "$RELEASE_FILTER" > $THIS_FILE
|
||||
elif [ "$SUFFIX" = "svg" ]; then
|
||||
# GraphViz has non-determinism when generating svg files
|
||||
OTHER_FILE=$WORK_DIR/$f.other
|
||||
THIS_FILE=$WORK_DIR/$f.this
|
||||
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
|
||||
SVG_FILTER="$SED \
|
||||
-e 's/edge[0-9][0-9]*/edgeX/g'
|
||||
"
|
||||
$CAT $OTHER_DIR/$f | eval "$SVG_FILTER" > $OTHER_FILE
|
||||
$CAT $THIS_DIR/$f | eval "$SVG_FILTER" > $THIS_FILE
|
||||
elif [ "$SUFFIX" = "jar_contents" ]; then
|
||||
# The jar_contents files may have some lines in random order
|
||||
OTHER_FILE=$WORK_DIR/$f.other
|
||||
THIS_FILE=$WORK_DIR/$f.this
|
||||
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
|
||||
$RM $OTHER_FILE $THIS_FILE
|
||||
$CAT $OTHER_DIR/$f | $SORT > $OTHER_FILE
|
||||
$CAT $THIS_DIR/$f | $SORT > $THIS_FILE
|
||||
else
|
||||
OTHER_FILE=$OTHER_DIR/$f
|
||||
THIS_FILE=$THIS_DIR/$f
|
||||
fi
|
||||
DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1)
|
||||
if [ -n "$DIFF_OUT" ]; then
|
||||
echo $f
|
||||
REGRESSIONS=true
|
||||
if [ "$SHOW_DIFFS" = "true" ]; then
|
||||
echo "$DIFF_OUT"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
ZIP_FILES_PATH=$TEMP_DIR/zip_files.txt
|
||||
ZIP_FILTER="-e '\.zip$' -e '\.tar.gz$'"
|
||||
$CAT "$ALL_FILES_PATH" | eval $GREP $ZIP_FILTER > $ZIP_FILES_PATH
|
||||
|
||||
JMOD_FILES_PATH=$TEMP_DIR/jmod_files.txt
|
||||
JMOD_FILTER="-e '\.jmod$'"
|
||||
$CAT "$ALL_FILES_PATH" | eval $GREP $JMOD_FILTER > $JMOD_FILES_PATH
|
||||
|
||||
JAR_FILES_PATH=$TEMP_DIR/jar_files.txt
|
||||
JAR_FILTER="-e '\.jar$' -e '\.war$' -e '/module$'"
|
||||
$CAT "$ALL_FILES_PATH" | eval $GREP $JAR_FILTER > $JAR_FILES_PATH
|
||||
|
||||
LIB_FILES_PATH=$TEMP_DIR/lib_files.txt
|
||||
LIB_FILTER="-e '\.dylib$' -e '/lib.*\.so$' -e '\.dll$' -e '\.obj$' -e '\.o$' -e '\.a$' -e '\.cpl$'"
|
||||
# On macos, filter out the dSYM debug symbols files. They are identically named .dylib files that reside
|
||||
# under a *.dSYM directory
|
||||
LIB_EXCLUDE="-e '/lib.*\.dSYM/'"
|
||||
$CAT "$ALL_FILES_PATH" | eval $GREP $LIB_FILTER | eval $GREP -v $LIB_EXCLUDE > $LIB_FILES_PATH
|
||||
|
||||
DEBUG_FILES_PATH=$TEMP_DIR/debug_files.txt
|
||||
DEBUG_FILTER="-e '\.dSYM/' -e '\.debuginfo$' -e '\.diz$' -e '\.pdb$' -e '\.map$'"
|
||||
$CAT "$ALL_FILES_PATH" | eval $GREP $DEBUG_FILTER > $DEBUG_FILES_PATH
|
||||
|
||||
EXEC_FILES_PATH=$TEMP_DIR/exec_files.txt
|
||||
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
EXEC_FILTER="-e '\.exe$'"
|
||||
$CAT "$ALL_FILES_PATH" | eval $GREP $EXEC_FILTER > $EXEC_FILES_PATH
|
||||
else
|
||||
# Find all files with the executable bit set
|
||||
cd $THIS_DIR && $FIND . -type f -perm -100 | $SORT | $FILTER > $EXEC_FILES_PATH
|
||||
fi
|
||||
|
||||
OTHER_FILES_PATH=$TEMP_DIR/other_files.txt
|
||||
ACCOUNTED_FILES_PATH=$TEMP_DIR/accounted_files.txt
|
||||
$CAT $ZIP_FILES_PATH $JMOD_FILES_PATH $JAR_FILES_PATH $LIB_FILES_PATH $DEBUG_FILES_PATH $EXEC_FILES_PATH > $ACCOUNTED_FILES_PATH
|
||||
$CAT $ACCOUNTED_FILES_PATH $ALL_FILES_PATH | $SORT | $UNIQ -u > $OTHER_FILES_PATH
|
||||
|
||||
ALL_ZIP_FILES=$($CAT $ZIP_FILES_PATH)
|
||||
ALL_JMOD_FILES=$($CAT $JMOD_FILES_PATH)
|
||||
ALL_JAR_FILES=$($CAT $JAR_FILES_PATH)
|
||||
ALL_LIB_FILES=$($CAT $LIB_FILES_PATH)
|
||||
ALL_DEBUG_FILES=$($CAT $DEBUG_FILES_PATH)
|
||||
ALL_EXEC_FILES=$($CAT $EXEC_FILES_PATH)
|
||||
ALL_OTHER_FILES=$($CAT $OTHER_FILES_PATH)
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@@ -450,12 +408,14 @@ compare_zip_file() {
|
||||
if [ -n "$ONLY_OTHER" ]; then
|
||||
echo " Only OTHER $ZIP_FILE contains:"
|
||||
echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g'
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
|
||||
if [ -n "$ONLY_THIS" ]; then
|
||||
echo " Only THIS $ZIP_FILE contains:"
|
||||
echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g'
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
|
||||
@@ -484,6 +444,7 @@ compare_zip_file() {
|
||||
done
|
||||
|
||||
if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
echo " Differing files in $ZIP_FILE"
|
||||
$CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP 'differ$' | cut -f 2 -d ' ' | \
|
||||
@@ -508,6 +469,7 @@ compare_zip_file() {
|
||||
compare_bin_file $THIS_UNZIPDIR $OTHER_UNZIPDIR $WORK_DIR/$ZIP_FILE.bin \
|
||||
$file
|
||||
if [ "$?" != "0" ]; then
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
done
|
||||
@@ -547,12 +509,14 @@ compare_jmod_file() {
|
||||
if [ -n "$ONLY_OTHER" ]; then
|
||||
echo " Only OTHER $JMOD_FILE contains:"
|
||||
echo "$ONLY_OTHER" | sed "s|^>| |"g | sed 's|: |/|g'
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
|
||||
if [ -n "$ONLY_THIS" ]; then
|
||||
echo " Only THIS $JMOD_FILE contains:"
|
||||
echo "$ONLY_THIS" | sed "s|^<| |"g | sed 's|: |/|g'
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
|
||||
@@ -567,19 +531,18 @@ compare_all_zip_files() {
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
|
||||
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" -o -name "*.tar.gz" \
|
||||
| $SORT | $FILTER )
|
||||
locate_files $THIS_DIR
|
||||
|
||||
if [ -n "$ZIPS" ]; then
|
||||
if [ -n "$ALL_ZIP_FILES" ]; then
|
||||
echo Zip/tar.gz files...
|
||||
|
||||
return_value=0
|
||||
for f in $ZIPS; do
|
||||
for f in $ALL_ZIP_FILES; do
|
||||
if [ -f "$OTHER_DIR/$f" ]; then
|
||||
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
|
||||
if [ "$?" != "0" ]; then
|
||||
return_value=1
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -596,18 +559,18 @@ compare_all_jmod_files() {
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
|
||||
JMODS=$(cd $THIS_DIR && $FIND . -type f -name "*.jmod" | $SORT | $FILTER )
|
||||
locate_files $THIS_DIR
|
||||
|
||||
if [ -n "$JMODS" ]; then
|
||||
if [ -n "$ALL_JMOD_FILES" ]; then
|
||||
echo Jmod files...
|
||||
|
||||
return_value=0
|
||||
for f in $JMODS; do
|
||||
for f in $ALL_JMOD_FILES; do
|
||||
if [ -f "$OTHER_DIR/$f" ]; then
|
||||
compare_jmod_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
|
||||
if [ "$?" != "0" ]; then
|
||||
return_value=1
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -624,20 +587,18 @@ compare_all_jar_files() {
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
|
||||
# TODO filter?
|
||||
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \
|
||||
-o -name "modules" | $SORT | $FILTER)
|
||||
locate_files $THIS_DIR
|
||||
|
||||
if [ -n "$ZIPS" ]; then
|
||||
if [ -n "$ALL_JAR_FILES" ]; then
|
||||
echo Jar files...
|
||||
|
||||
return_value=0
|
||||
for f in $ZIPS; do
|
||||
for f in $ALL_JAR_FILES; do
|
||||
if [ -f "$OTHER_DIR/$f" ]; then
|
||||
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
|
||||
if [ "$?" != "0" ]; then
|
||||
return_value=1
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -699,14 +660,16 @@ compare_bin_file() {
|
||||
unset _NT_SYMBOL_PATH
|
||||
if [ "$(uname -o)" = "Cygwin" ]; then
|
||||
THIS=$(cygpath -msa $THIS)
|
||||
OTHER=$(cygpath -msa $OTHER)
|
||||
if [ -n "$OTHER" ]; then
|
||||
OTHER=$(cygpath -msa $OTHER)
|
||||
fi
|
||||
fi
|
||||
# Build an _NT_SYMBOL_PATH that contains all known locations for
|
||||
# pdb files.
|
||||
PDB_DIRS="$(ls -d \
|
||||
{$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \
|
||||
{$OTHER,$THIS}/support/native/jdk.jpackage/* \
|
||||
)"
|
||||
2> /dev/null )"
|
||||
export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')"
|
||||
fi
|
||||
|
||||
@@ -1047,23 +1010,16 @@ compare_all_libs() {
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
|
||||
LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' \
|
||||
-o -name '*.dll' -o -name '*.obj' -o -name '*.o' -o -name '*.a' \
|
||||
-o -name '*.cpl' \) | $SORT | $FILTER)
|
||||
locate_files $THIS_DIR
|
||||
|
||||
# On macos, filter out the dSYM debug symbols files as they are also
|
||||
# named *.dylib.
|
||||
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
||||
LIBS=$(echo "$LIBS" | $GREP -v '\.dSYM/')
|
||||
fi
|
||||
|
||||
if [ -n "$LIBS" ]; then
|
||||
if [ -n "$ALL_LIB_FILES" ]; then
|
||||
echo Libraries...
|
||||
print_binary_diff_header
|
||||
for l in $LIBS; do
|
||||
for l in $ALL_LIB_FILES; do
|
||||
if [ -f "$OTHER_DIR/$l" ]; then
|
||||
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l
|
||||
if [ "$?" != "0" ]; then
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
fi
|
||||
@@ -1081,33 +1037,16 @@ compare_all_execs() {
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
|
||||
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER)
|
||||
else
|
||||
EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \
|
||||
\( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \
|
||||
-o -name '*.jar' -o -name '*.diz' -o -name 'jcontrol' -o -name '*.properties' \
|
||||
-o -name '*.data' -o -name '*.bfc' -o -name '*.src' -o -name '*.txt' \
|
||||
-o -name '*.cfg' -o -name 'meta-index' -o -name '*.properties.ja' \
|
||||
-o -name '*.xml' -o -name '*.html' -o -name '*.png' -o -name 'README' \
|
||||
-o -name '*.zip' -o -name '*.jimage' -o -name '*.java' -o -name '*.mf' \
|
||||
-o -name '*.jpg' -o -name '*.wsdl' -o -name '*.js' -o -name '*.sh' \
|
||||
-o -name '*.bat' -o -name '*LICENSE' -o -name '*.d' -o -name '*store' \
|
||||
-o -name 'blocked' -o -name '*certs' -o -name '*.ttf' \
|
||||
-o -name '*.jfc' -o -name '*.dat' -o -name 'release' -o -name '*.dir'\
|
||||
-o -name '*.sym' -o -name '*.idl' -o -name '*.h' -o -name '*.access' \
|
||||
-o -name '*.template' -o -name '*.policy' -o -name '*.security' \
|
||||
-o -name 'COPYRIGHT' -o -name '*.1' -o -name '*.debuginfo' \
|
||||
-o -name 'classlist' \) | $SORT | $FILTER)
|
||||
fi
|
||||
locate_files $THIS_DIR
|
||||
|
||||
if [ -n "$EXECS" ]; then
|
||||
if [ -n "$ALL_EXEC_FILES" ]; then
|
||||
echo Executables...
|
||||
print_binary_diff_header
|
||||
for e in $EXECS; do
|
||||
for e in $ALL_EXEC_FILES; do
|
||||
if [ -f "$OTHER_DIR/$e" ]; then
|
||||
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e
|
||||
if [ "$?" != "0" ]; then
|
||||
REGRESSIONS=true
|
||||
return_value=1
|
||||
fi
|
||||
fi
|
||||
@@ -1117,6 +1056,95 @@ compare_all_execs() {
|
||||
return $return_value
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Compare native debug symbol files
|
||||
|
||||
compare_all_debug_files() {
|
||||
THIS_DIR=$1
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
|
||||
locate_files $THIS_DIR
|
||||
|
||||
echo Debug symbol files with binary differences...
|
||||
for f in $ALL_DEBUG_FILES
|
||||
do
|
||||
if [ -e $OTHER_DIR/$f ]; then
|
||||
SUFFIX="${f##*.}"
|
||||
if [ "$SUFFIX" = "pdb" ]; then
|
||||
# pdb files are never reproducible
|
||||
DIFF_OUT=""
|
||||
else
|
||||
OTHER_FILE=$OTHER_DIR/$f
|
||||
THIS_FILE=$THIS_DIR/$f
|
||||
DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1)
|
||||
fi
|
||||
|
||||
if [ -n "$DIFF_OUT" ]; then
|
||||
echo $f
|
||||
REGRESSIONS=true
|
||||
if [ "$SHOW_DIFFS" = "true" ]; then
|
||||
echo "$DIFF_OUT"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Compare the rest of the files
|
||||
|
||||
compare_all_other_files() {
|
||||
THIS_DIR=$1
|
||||
OTHER_DIR=$2
|
||||
WORK_DIR=$3
|
||||
|
||||
locate_files $THIS_DIR
|
||||
|
||||
echo Other files with binary differences...
|
||||
for f in $ALL_OTHER_FILES
|
||||
do
|
||||
# Skip all files in test/*/native
|
||||
if [[ "$f" == */native/* ]]; then
|
||||
continue
|
||||
fi
|
||||
if [ -e $OTHER_DIR/$f ]; then
|
||||
SUFFIX="${f##*.}"
|
||||
if [ "$(basename $f)" = "release" ]; then
|
||||
# In release file, ignore differences in source rev numbers
|
||||
OTHER_FILE=$WORK_DIR/$f.other
|
||||
THIS_FILE=$WORK_DIR/$f.this
|
||||
$MKDIR -p $(dirname $OTHER_FILE)
|
||||
$MKDIR -p $(dirname $THIS_FILE)
|
||||
RELEASE_FILTER="$SED -e 's/SOURCE=".*"/SOURCE=<src-rev>/g'"
|
||||
$CAT $OTHER_DIR/$f | eval "$RELEASE_FILTER" > $OTHER_FILE
|
||||
$CAT $THIS_DIR/$f | eval "$RELEASE_FILTER" > $THIS_FILE
|
||||
elif [ "$SUFFIX" = "jar_contents" ]; then
|
||||
# The jar_contents files are generated by the build and may have
|
||||
# some lines in random order. They are only included for demos,
|
||||
# which they shouldn't really...
|
||||
OTHER_FILE=$WORK_DIR/$f.other
|
||||
THIS_FILE=$WORK_DIR/$f.this
|
||||
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
|
||||
$RM $OTHER_FILE $THIS_FILE
|
||||
$CAT $OTHER_DIR/$f | $SORT > $OTHER_FILE
|
||||
$CAT $THIS_DIR/$f | $SORT > $THIS_FILE
|
||||
else
|
||||
OTHER_FILE=$OTHER_DIR/$f
|
||||
THIS_FILE=$THIS_DIR/$f
|
||||
fi
|
||||
DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1)
|
||||
if [ -n "$DIFF_OUT" ]; then
|
||||
echo $f
|
||||
REGRESSIONS=true
|
||||
if [ "$SHOW_DIFFS" = "true" ]; then
|
||||
echo "$DIFF_OUT"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Initiate configuration
|
||||
|
||||
@@ -1515,22 +1543,31 @@ fi
|
||||
if [ "$CMP_GENERAL" = "true" ]; then
|
||||
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
||||
echo -n "JDK "
|
||||
compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
||||
compare_all_other_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
||||
echo -n "JDK "
|
||||
compare_all_debug_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
||||
fi
|
||||
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
|
||||
echo -n "JDK Bundle "
|
||||
compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
||||
compare_all_other_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
||||
echo -n "JDK Bundle "
|
||||
compare_all_debug_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
||||
fi
|
||||
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
|
||||
echo -n "Docs "
|
||||
compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
|
||||
compare_all_other_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
|
||||
echo -n "Docs "
|
||||
compare_all_debug_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
|
||||
fi
|
||||
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
|
||||
echo -n "Test "
|
||||
compare_general_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
|
||||
compare_all_other_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
|
||||
echo -n "Test "
|
||||
compare_all_debug_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
|
||||
fi
|
||||
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
||||
compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
||||
compare_all_other_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
||||
compare_all_debug_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This script is not to be run as stand-alone, it should be included from
|
||||
# compare.sh.
|
||||
|
||||
##########################################################################################
|
||||
# Check that we are run via inclusion from compare.sh and not as stand-alone.
|
||||
if [ -z "$COMPARE_EXCEPTIONS_INCLUDE" ]; then
|
||||
echo "Error: This script should not be run as stand-alone. It is included by compare.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Diff exceptions
|
||||
|
||||
if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
|
||||
if [ "$USE_PRECOMPILED_HEADER" = "true" ]; then
|
||||
ACCEPTED_BIN_DIFF="
|
||||
./lib/server/libjvm.so
|
||||
./hotspot/gtest/server/libjvm.so
|
||||
"
|
||||
STRIP_BEFORE_COMPARE="
|
||||
./hotspot/gtest/server/libjvm.so
|
||||
"
|
||||
fi
|
||||
elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
SKIP_BIN_DIFF="true"
|
||||
SKIP_FULLDUMP_DIFF="true"
|
||||
ACCEPTED_JARZIP_CONTENTS="
|
||||
/modules_libs/java.security.jgss/w2k_lsa_auth.dll.pdb
|
||||
/modules_libs/java.security.jgss/w2k_lsa_auth.dll.map
|
||||
/modules_libs/java.security.jgss/w2k_lsa_auth.dll
|
||||
"
|
||||
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
||||
ACCEPTED_BIN_DIFF="
|
||||
./lib/libawt_lwawt.dylib
|
||||
./lib/libosxapp.dylib
|
||||
./lib/libosxui.dylib
|
||||
./lib/server/libjvm.dylib
|
||||
./hotspot/gtest/server/libjvm.dylib
|
||||
"
|
||||
STRIP_TESTS_BEFORE_COMPARE="true"
|
||||
fi
|
||||
|
||||
@@ -29,6 +29,23 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
|
||||
ifndef SOURCE
|
||||
export SOURCE := 7
|
||||
endif
|
||||
ifndef TARGET
|
||||
export TARGET := 7
|
||||
endif
|
||||
ifndef JAVAC
|
||||
export JAVAC := javac
|
||||
endif
|
||||
ifndef JAVA
|
||||
export JAVA := java
|
||||
endif
|
||||
ifndef JAR
|
||||
export JAR := jar
|
||||
endif
|
||||
|
||||
SOURCEPATH=src
|
||||
CLASSES=build
|
||||
DIST=dist
|
||||
@@ -80,18 +97,18 @@ SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files
|
||||
all: mkdirs J2DBench.jar J2DAnalyzer.jar
|
||||
|
||||
run: mkdirs J2DBench.jar
|
||||
java -jar $(DIST)/J2DBench.jar
|
||||
$(JAVA) -jar $(DIST)/J2DBench.jar
|
||||
|
||||
analyze: mkdirs J2DAnalyzer.jar
|
||||
java -jar $(DIST)/J2DAnalyzer.jar
|
||||
$(JAVA) -jar $(DIST)/J2DAnalyzer.jar
|
||||
|
||||
J2DBench.jar: \
|
||||
$(J2DBENCH_CLASSES) $(J2DBENCH_RESOURCES) \
|
||||
$(CLASSES)/j2dbench.manifest
|
||||
jar cvmf $(CLASSES)/j2dbench.manifest $(DIST)/J2DBench.jar -C $(CLASSES) j2dbench
|
||||
$(JAR) cvmf $(CLASSES)/j2dbench.manifest $(DIST)/J2DBench.jar -C $(CLASSES) j2dbench
|
||||
|
||||
J2DAnalyzer.jar: $(J2DANALYZER_CLASSES) $(CLASSES)/j2danalyzer.manifest
|
||||
jar cvmf $(CLASSES)/j2danalyzer.manifest \
|
||||
$(JAR) cvmf $(CLASSES)/j2danalyzer.manifest \
|
||||
$(DIST)/J2DAnalyzer.jar -C $(CLASSES) j2dbench/report
|
||||
|
||||
$(CLASSES)/j2dbench/tests/iio/images: $(RESOURCES)/images
|
||||
@@ -120,7 +137,7 @@ $(CLASSES):
|
||||
mkdirs: $(DIST) $(CLASSES)
|
||||
|
||||
$(CLASSES)/j2dbench/%.class: $(SOURCEPATH)/j2dbench/%.java
|
||||
javac -g:none -source 1.7 -target 1.7 -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
|
||||
$(JAVAC) -g:none -source $(SOURCE) -target $(TARGET) -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
|
||||
|
||||
clean:
|
||||
rm -rf $(CLASSES)
|
||||
|
||||
@@ -23,6 +23,9 @@ The benchmark requires at least jdk1.4 to compile and run. Note that
|
||||
source/target is set to 1.7 in the makefile and build.xml, because of
|
||||
support in jdk 14 compiler. To check compatibility with jdk1.4 you can
|
||||
use "-source 1.4 -target 1.4" options and jdk1.7.
|
||||
Yo can use TARGET/SOURCE of makefile and -Dtarget/surce to set them up for your convinience.
|
||||
Similarly you can set JAVA/JAVAC/JAR and -Djava/javac to select diffferent java/javac then is on yoru PATH
|
||||
Unluckily in ant, you can not set jar, but ant should honor JAVA_HOME
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
How To Compile
|
||||
|
||||
@@ -39,6 +39,27 @@
|
||||
<property name="dist" location="dist"/>
|
||||
<property name="resources" location="resources"/>
|
||||
|
||||
<condition property="source" value="7">
|
||||
<not>
|
||||
<isset property="source"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="target" value="7">
|
||||
<not>
|
||||
<isset property="target"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="java" value="java">
|
||||
<not>
|
||||
<isset property="java"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="javac" value="javac">
|
||||
<not>
|
||||
<isset property="javac"/>
|
||||
</not>
|
||||
</condition>
|
||||
|
||||
<target name="init">
|
||||
<!-- Create the time stamp -->
|
||||
<tstamp/>
|
||||
@@ -49,13 +70,14 @@
|
||||
<target name="compile" depends="init"
|
||||
description="compile the source " >
|
||||
<!-- Compile the java code from ${src} into ${build} -->
|
||||
<javac debug="off" source="1.7" target="1.7" srcdir="${src}" destdir="${build}"/>
|
||||
<javac debug="off" source="${source}" target="${target}" srcdir="${src}" destdir="${build}" fork="true" executable="${javac}"/>
|
||||
</target>
|
||||
|
||||
<target name="run" depends="dist"
|
||||
description="run J2DBench" >
|
||||
<java jar="${dist}/J2DBench.jar"
|
||||
fork="true"
|
||||
jvm="${java}"
|
||||
>
|
||||
</java>
|
||||
</target>
|
||||
@@ -64,6 +86,7 @@
|
||||
description="run J2DAnalyzer" >
|
||||
<java jar="${dist}/J2DAnalyzer.jar"
|
||||
fork="true"
|
||||
jvm="${java}"
|
||||
>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
@@ -1237,7 +1237,7 @@ source %{
|
||||
|
||||
// r27 is not allocatable when compressed oops is on and heapbase is not
|
||||
// zero, compressed klass pointers doesn't use r27 after JDK-8234794
|
||||
if (UseCompressedOops && (CompressedOops::ptrs_base() != NULL)) {
|
||||
if (UseCompressedOops && (CompressedOops::ptrs_base() != nullptr)) {
|
||||
_NO_SPECIAL_REG32_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg()));
|
||||
_NO_SPECIAL_REG_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg()));
|
||||
_NO_SPECIAL_PTR_REG_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg()));
|
||||
@@ -1581,7 +1581,7 @@ bool needs_releasing_store(const Node *n)
|
||||
{
|
||||
// assert n->is_Store();
|
||||
StoreNode *st = n->as_Store();
|
||||
return st->trailing_membar() != NULL;
|
||||
return st->trailing_membar() != nullptr;
|
||||
}
|
||||
|
||||
// predicate controlling translation of CAS
|
||||
@@ -1593,9 +1593,9 @@ bool needs_acquiring_load_exclusive(const Node *n)
|
||||
assert(is_CAS(n->Opcode(), true), "expecting a compare and swap");
|
||||
LoadStoreNode* ldst = n->as_LoadStore();
|
||||
if (is_CAS(n->Opcode(), false)) {
|
||||
assert(ldst->trailing_membar() != NULL, "expected trailing membar");
|
||||
assert(ldst->trailing_membar() != nullptr, "expected trailing membar");
|
||||
} else {
|
||||
return ldst->trailing_membar() != NULL;
|
||||
return ldst->trailing_membar() != nullptr;
|
||||
}
|
||||
|
||||
// so we can just return true here
|
||||
@@ -1734,7 +1734,7 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
st->print("mov rscratch1, #%d\n\t", framesize - 2 * wordSize);
|
||||
st->print("sub sp, sp, rscratch1");
|
||||
}
|
||||
if (C->stub_function() == NULL && BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
|
||||
if (C->stub_function() == nullptr && BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
|
||||
st->print("\n\t");
|
||||
st->print("ldr rscratch1, [guard]\n\t");
|
||||
st->print("dmb ishld\n\t");
|
||||
@@ -1783,9 +1783,9 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
|
||||
__ build_frame(framesize);
|
||||
|
||||
if (C->stub_function() == NULL) {
|
||||
if (C->stub_function() == nullptr) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
if (BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
|
||||
if (BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
|
||||
// Dummy labels for just measuring the code size
|
||||
Label dummy_slow_path;
|
||||
Label dummy_continuation;
|
||||
@@ -2153,12 +2153,12 @@ void MachSpillCopyNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
if (!ra_)
|
||||
st->print("N%d = SpillCopy(N%d)", _idx, in(1)->_idx);
|
||||
else
|
||||
implementation(NULL, ra_, false, st);
|
||||
implementation(nullptr, ra_, false, st);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MachSpillCopyNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
implementation(&cbuf, ra_, false, NULL);
|
||||
implementation(&cbuf, ra_, false, nullptr);
|
||||
}
|
||||
|
||||
uint MachSpillCopyNode::size(PhaseRegAlloc *ra_) const {
|
||||
@@ -2205,14 +2205,14 @@ void MachUEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
|
||||
{
|
||||
st->print_cr("# MachUEPNode");
|
||||
if (UseCompressedClassPointers) {
|
||||
st->print_cr("\tldrw rscratch1, j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
|
||||
if (CompressedKlassPointers::shift() != 0) {
|
||||
st->print_cr("\tdecode_klass_not_null rscratch1, rscratch1");
|
||||
}
|
||||
st->print_cr("\tldrw rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
|
||||
st->print_cr("\tldrw r10, [rscratch2 + CompiledICData::speculated_klass_offset()]\t# compressed klass");
|
||||
st->print_cr("\tcmpw rscratch1, r10");
|
||||
} else {
|
||||
st->print_cr("\tldr rscratch1, j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
|
||||
st->print_cr("\tldr rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
|
||||
st->print_cr("\tldr r10, [rscratch2 + CompiledICData::speculated_klass_offset()]\t# compressed klass");
|
||||
st->print_cr("\tcmp rscratch1, r10");
|
||||
}
|
||||
st->print_cr("\tcmp r0, rscratch1\t # Inline cache check");
|
||||
st->print_cr("\tbne, SharedRuntime::_ic_miss_stub");
|
||||
}
|
||||
#endif
|
||||
@@ -2221,14 +2221,7 @@ void MachUEPNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
||||
{
|
||||
// This is the unverified entry point.
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
|
||||
__ cmp_klass(j_rarg0, rscratch2, rscratch1);
|
||||
Label skip;
|
||||
// TODO
|
||||
// can we avoid this skip and still use a reloc?
|
||||
__ br(Assembler::EQ, skip);
|
||||
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
|
||||
__ bind(skip);
|
||||
__ ic_check(InteriorEntryAlignment);
|
||||
}
|
||||
|
||||
uint MachUEPNode::size(PhaseRegAlloc* ra_) const
|
||||
@@ -2249,7 +2242,7 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf)
|
||||
// That's why we must use the macroassembler to generate a handler.
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
address base = __ start_a_stub(size_exception_handler());
|
||||
if (base == NULL) {
|
||||
if (base == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return 0; // CodeBuffer::expand failed
|
||||
}
|
||||
@@ -2267,7 +2260,7 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf)
|
||||
// That's why we must use the macroassembler to generate a handler.
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
address base = __ start_a_stub(size_deopt_handler());
|
||||
if (base == NULL) {
|
||||
if (base == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return 0; // CodeBuffer::expand failed
|
||||
}
|
||||
@@ -2377,7 +2370,7 @@ int Matcher::min_vector_size(const BasicType bt) {
|
||||
return MIN2(size, max_size);
|
||||
}
|
||||
|
||||
int Matcher::superword_max_vector_size(const BasicType bt) {
|
||||
int Matcher::max_vector_size_auto_vectorization(const BasicType bt) {
|
||||
return Matcher::max_vector_size(bt);
|
||||
}
|
||||
|
||||
@@ -2410,7 +2403,7 @@ MachOper* Matcher::pd_specialize_generic_vector_operand(MachOper* generic_opnd,
|
||||
case Op_VecX: return new vecXOper();
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Matcher::is_reg2reg_move(MachNode* m) {
|
||||
@@ -2582,8 +2575,8 @@ Assembler::Condition to_assembler_cond(BoolTest::mask cond) {
|
||||
}
|
||||
|
||||
// Binary src (Replicate con)
|
||||
bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
|
||||
if (n == NULL || m == NULL) {
|
||||
static bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
|
||||
if (n == nullptr || m == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2623,8 +2616,8 @@ bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
|
||||
|
||||
// (XorV src (Replicate m1))
|
||||
// (XorVMask src (MaskAll m1))
|
||||
bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
|
||||
if (n != NULL && m != NULL) {
|
||||
static bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
|
||||
if (n != nullptr && m != nullptr) {
|
||||
return (n->Opcode() == Op_XorV || n->Opcode() == Op_XorVMask) &&
|
||||
VectorNode::is_all_ones_vector(m);
|
||||
}
|
||||
@@ -3430,7 +3423,7 @@ encode %{
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
Register dst_reg = as_Register($dst$$reg);
|
||||
address con = (address)$src$$constant;
|
||||
if (con == NULL || con == (address)1) {
|
||||
if (con == nullptr || con == (address)1) {
|
||||
ShouldNotReachHere();
|
||||
} else {
|
||||
relocInfo::relocType rtype = $src->constant_reloc();
|
||||
@@ -3473,7 +3466,7 @@ encode %{
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
Register dst_reg = as_Register($dst$$reg);
|
||||
address con = (address)$src$$constant;
|
||||
if (con == NULL) {
|
||||
if (con == nullptr) {
|
||||
ShouldNotReachHere();
|
||||
} else {
|
||||
relocInfo::relocType rtype = $src->constant_reloc();
|
||||
@@ -3492,7 +3485,7 @@ encode %{
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
Register dst_reg = as_Register($dst$$reg);
|
||||
address con = (address)$src$$constant;
|
||||
if (con == NULL) {
|
||||
if (con == nullptr) {
|
||||
ShouldNotReachHere();
|
||||
} else {
|
||||
relocInfo::relocType rtype = $src->constant_reloc();
|
||||
@@ -3675,7 +3668,7 @@ encode %{
|
||||
Label miss;
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
__ check_klass_subtype_slow_path(sub_reg, super_reg, temp_reg, result_reg,
|
||||
NULL, &miss,
|
||||
nullptr, &miss,
|
||||
/*set_cond_codes:*/ true);
|
||||
if ($primary) {
|
||||
__ mov(result_reg, zr);
|
||||
@@ -3691,7 +3684,7 @@ encode %{
|
||||
if (!_method) {
|
||||
// A call to a runtime wrapper, e.g. new, new_typeArray_Java, uncommon_trap.
|
||||
call = __ trampoline_call(Address(addr, relocInfo::runtime_call_type));
|
||||
if (call == NULL) {
|
||||
if (call == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -3705,7 +3698,7 @@ encode %{
|
||||
RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
|
||||
: static_call_Relocation::spec(method_index);
|
||||
call = __ trampoline_call(Address(addr, rspec));
|
||||
if (call == NULL) {
|
||||
if (call == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -3715,8 +3708,8 @@ encode %{
|
||||
cbuf.shared_stub_to_interp_for(_method, call - cbuf.insts_begin());
|
||||
} else {
|
||||
// Emit stub for static call
|
||||
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf, call);
|
||||
if (stub == NULL) {
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(cbuf, call);
|
||||
if (stub == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -3735,7 +3728,7 @@ encode %{
|
||||
C2_MacroAssembler _masm(&cbuf);
|
||||
int method_index = resolved_method_index(cbuf);
|
||||
address call = __ ic_call((address)$meth$$method, method_index);
|
||||
if (call == NULL) {
|
||||
if (call == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -3764,7 +3757,7 @@ encode %{
|
||||
CodeBlob *cb = CodeCache::find_blob(entry);
|
||||
if (cb) {
|
||||
address call = __ trampoline_call(Address(entry, relocInfo::runtime_call_type));
|
||||
if (call == NULL) {
|
||||
if (call == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -4663,7 +4656,7 @@ operand immP()
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
// NULL Pointer Immediate
|
||||
// Null Pointer Immediate
|
||||
operand immP0()
|
||||
%{
|
||||
predicate(n->get_ptr() == 0);
|
||||
@@ -4795,7 +4788,7 @@ operand immN()
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
// Narrow NULL Pointer Immediate
|
||||
// Narrow Null Pointer Immediate
|
||||
operand immN0()
|
||||
%{
|
||||
predicate(n->get_narrowcon() == 0);
|
||||
@@ -7219,7 +7212,7 @@ instruct loadConP0(iRegPNoSp dst, immP0 con)
|
||||
match(Set dst con);
|
||||
|
||||
ins_cost(INSN_COST);
|
||||
format %{ "mov $dst, $con\t# NULL ptr" %}
|
||||
format %{ "mov $dst, $con\t# null pointer" %}
|
||||
|
||||
ins_encode(aarch64_enc_mov_p0(dst, con));
|
||||
|
||||
@@ -7233,7 +7226,7 @@ instruct loadConP1(iRegPNoSp dst, immP_1 con)
|
||||
match(Set dst con);
|
||||
|
||||
ins_cost(INSN_COST);
|
||||
format %{ "mov $dst, $con\t# NULL ptr" %}
|
||||
format %{ "mov $dst, $con\t# null pointer" %}
|
||||
|
||||
ins_encode(aarch64_enc_mov_p1(dst, con));
|
||||
|
||||
@@ -7275,7 +7268,7 @@ instruct loadConN0(iRegNNoSp dst, immN0 con)
|
||||
match(Set dst con);
|
||||
|
||||
ins_cost(INSN_COST);
|
||||
format %{ "mov $dst, $con\t# compressed NULL ptr" %}
|
||||
format %{ "mov $dst, $con\t# compressed null pointer" %}
|
||||
|
||||
ins_encode(aarch64_enc_mov_n0(dst, con));
|
||||
|
||||
@@ -15256,7 +15249,7 @@ instruct clearArray_reg_reg(iRegL_R11 cnt, iRegP_R10 base, Universe dummy, rFlag
|
||||
|
||||
ins_encode %{
|
||||
address tpc = __ zero_words($base$$Register, $cnt$$Register);
|
||||
if (tpc == NULL) {
|
||||
if (tpc == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -15277,7 +15270,7 @@ instruct clearArray_imm_reg(immL cnt, iRegP_R10 base, iRegL_R11 temp, Universe d
|
||||
|
||||
ins_encode %{
|
||||
address tpc = __ zero_words($base$$Register, (uint64_t)$cnt$$constant);
|
||||
if (tpc == NULL) {
|
||||
if (tpc == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -16440,13 +16433,12 @@ instruct branchLoopEnd(cmpOp cmp, rFlagsReg cr, label lbl)
|
||||
|
||||
instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2, iRegPNoSp tmp3)
|
||||
%{
|
||||
predicate(LockingMode != LM_LIGHTWEIGHT);
|
||||
match(Set cr (FastLock object box));
|
||||
effect(TEMP tmp, TEMP tmp2, TEMP tmp3);
|
||||
|
||||
// TODO
|
||||
// identify correct cost
|
||||
ins_cost(5 * INSN_COST);
|
||||
format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
|
||||
format %{ "fastlock $object,$box\t! kills $tmp,$tmp2,$tmp3" %}
|
||||
|
||||
ins_encode %{
|
||||
__ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register, $tmp3$$Register);
|
||||
@@ -16457,6 +16449,7 @@ instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegP
|
||||
|
||||
instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
|
||||
%{
|
||||
predicate(LockingMode != LM_LIGHTWEIGHT);
|
||||
match(Set cr (FastUnlock object box));
|
||||
effect(TEMP tmp, TEMP tmp2);
|
||||
|
||||
@@ -16470,6 +16463,37 @@ instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRe
|
||||
ins_pipe(pipe_serial);
|
||||
%}
|
||||
|
||||
instruct cmpFastLockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
|
||||
%{
|
||||
predicate(LockingMode == LM_LIGHTWEIGHT);
|
||||
match(Set cr (FastLock object box));
|
||||
effect(TEMP tmp, TEMP tmp2);
|
||||
|
||||
ins_cost(5 * INSN_COST);
|
||||
format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
|
||||
|
||||
ins_encode %{
|
||||
__ fast_lock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
|
||||
%}
|
||||
|
||||
ins_pipe(pipe_serial);
|
||||
%}
|
||||
|
||||
instruct cmpFastUnlockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
|
||||
%{
|
||||
predicate(LockingMode == LM_LIGHTWEIGHT);
|
||||
match(Set cr (FastUnlock object box));
|
||||
effect(TEMP tmp, TEMP tmp2);
|
||||
|
||||
ins_cost(5 * INSN_COST);
|
||||
format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
|
||||
|
||||
ins_encode %{
|
||||
__ fast_unlock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
|
||||
%}
|
||||
|
||||
ins_pipe(pipe_serial);
|
||||
%}
|
||||
|
||||
// ============================================================================
|
||||
// Safepoint Instructions
|
||||
@@ -17104,23 +17128,7 @@ instruct string_equalsL(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt,
|
||||
ins_encode %{
|
||||
// Count is in 8-bit bytes; non-Compact chars are 16 bits.
|
||||
__ string_equals($str1$$Register, $str2$$Register,
|
||||
$result$$Register, $cnt$$Register, 1);
|
||||
%}
|
||||
ins_pipe(pipe_class_memory);
|
||||
%}
|
||||
|
||||
instruct string_equalsU(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt,
|
||||
iRegI_R0 result, rFlagsReg cr)
|
||||
%{
|
||||
predicate(((StrEqualsNode*)n)->encoding() == StrIntrinsicNode::UU);
|
||||
match(Set result (StrEquals (Binary str1 str2) cnt));
|
||||
effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr);
|
||||
|
||||
format %{ "String Equals $str1,$str2,$cnt -> $result" %}
|
||||
ins_encode %{
|
||||
// Count is in 8-bit bytes; non-Compact chars are 16 bits.
|
||||
__ string_equals($str1$$Register, $str2$$Register,
|
||||
$result$$Register, $cnt$$Register, 2);
|
||||
$result$$Register, $cnt$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_class_memory);
|
||||
%}
|
||||
@@ -17142,7 +17150,7 @@ instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
|
||||
address tpc = __ arrays_equals($ary1$$Register, $ary2$$Register,
|
||||
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
|
||||
$result$$Register, $tmp$$Register, 1);
|
||||
if (tpc == NULL) {
|
||||
if (tpc == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -17167,7 +17175,7 @@ instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
|
||||
address tpc = __ arrays_equals($ary1$$Register, $ary2$$Register,
|
||||
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
|
||||
$result$$Register, $tmp$$Register, 2);
|
||||
if (tpc == NULL) {
|
||||
if (tpc == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -17182,7 +17190,7 @@ instruct count_positives(iRegP_R1 ary1, iRegI_R2 len, iRegI_R0 result, rFlagsReg
|
||||
format %{ "count positives byte[] $ary1,$len -> $result" %}
|
||||
ins_encode %{
|
||||
address tpc = __ count_positives($ary1$$Register, $len$$Register, $result$$Register);
|
||||
if (tpc == NULL) {
|
||||
if (tpc == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
@@ -17225,7 +17233,7 @@ instruct string_inflate(Universe dummy, iRegP_R0 src, iRegP_R1 dst, iRegI_R2 len
|
||||
address tpc = __ byte_array_inflate($src$$Register, $dst$$Register, $len$$Register,
|
||||
$vtmp0$$FloatRegister, $vtmp1$$FloatRegister,
|
||||
$vtmp2$$FloatRegister, $tmp$$Register);
|
||||
if (tpc == NULL) {
|
||||
if (tpc == nullptr) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2023, Arm Limited. All rights reserved.
|
||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
//
|
||||
@@ -126,7 +126,7 @@ source %{
|
||||
}
|
||||
}
|
||||
|
||||
bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) {
|
||||
bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) {
|
||||
if (UseSVE == 0) {
|
||||
// These operations are not profitable to be vectorized on NEON, because no direct
|
||||
// NEON instructions support them. But the match rule support for them is profitable for
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2023, Arm Limited. All rights reserved.
|
||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
//
|
||||
@@ -116,7 +116,7 @@ source %{
|
||||
}
|
||||
}
|
||||
|
||||
bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) {
|
||||
bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) {
|
||||
if (UseSVE == 0) {
|
||||
// These operations are not profitable to be vectorized on NEON, because no direct
|
||||
// NEON instructions support them. But the match rule support for them is profitable for
|
||||
|
||||
@@ -19,7 +19,7 @@ dnl Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
dnl or visit www.oracle.com if you need additional information or have any
|
||||
dnl questions.
|
||||
dnl
|
||||
dnl
|
||||
dnl
|
||||
dnl Process this file with m4 ad_encode.m4 to generate the load/store
|
||||
dnl patterns used in aarch64.ad.
|
||||
dnl
|
||||
@@ -90,4 +90,3 @@ STORE(vRegD,strd,Float,,8)
|
||||
loadStore(_masm, &MacroAssembler::strb, zr, $mem->opcode(),
|
||||
as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp, 1);
|
||||
%}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, 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.
|
||||
*
|
||||
@@ -118,10 +118,6 @@ extern "C" {
|
||||
else
|
||||
Disassembler::decode((address)start, (address)start + len);
|
||||
}
|
||||
|
||||
JNIEXPORT void das1(uintptr_t insn) {
|
||||
das(insn, 1);
|
||||
}
|
||||
}
|
||||
|
||||
#define __ as->
|
||||
@@ -187,6 +183,26 @@ void Address::lea(MacroAssembler *as, Register r) const {
|
||||
zrf(Rd, 0);
|
||||
}
|
||||
|
||||
// This encoding is similar (but not quite identical) to the encoding used
|
||||
// by literal ld/st. see JDK-8324123.
|
||||
// PRFM does not support writeback or pre/post index.
|
||||
void Assembler::prfm(const Address &adr, prfop pfop) {
|
||||
Address::mode mode = adr.getMode();
|
||||
// PRFM does not support pre/post index
|
||||
guarantee((mode != Address::pre) && (mode != Address::post), "prfm does not support pre/post indexing");
|
||||
if (mode == Address::literal) {
|
||||
starti;
|
||||
f(0b11, 31, 30), f(0b011, 29, 27), f(0b000, 26, 24);
|
||||
f(pfop, 4, 0);
|
||||
int64_t offset = (adr.target() - pc()) >> 2;
|
||||
sf(offset, 23, 5);
|
||||
} else {
|
||||
assert((mode == Address::base_plus_offset)
|
||||
|| (mode == Address::base_plus_offset_reg), "must be base_plus_offset/base_plus_offset_reg");
|
||||
ld_st2(as_Register(pfop), adr, 0b11, 0b10);
|
||||
}
|
||||
}
|
||||
|
||||
// An "all-purpose" add/subtract immediate, per ARM documentation:
|
||||
// A "programmer-friendly" assembler may accept a negative immediate
|
||||
// between -(2^24 -1) and -1 inclusive, causing it to convert a
|
||||
|
||||
@@ -797,6 +797,8 @@ public:
|
||||
|
||||
void adrp(Register Rd, const Address &dest, uint64_t &offset) = delete;
|
||||
|
||||
void prfm(const Address &adr, prfop pfop = PLDL1KEEP);
|
||||
|
||||
#undef INSN
|
||||
|
||||
void add_sub_immediate(Instruction_aarch64 ¤t_insn, Register Rd, Register Rn,
|
||||
@@ -1574,17 +1576,6 @@ public:
|
||||
|
||||
#undef INSN
|
||||
|
||||
#define INSN(NAME, size, op) \
|
||||
void NAME(const Address &adr, prfop pfop = PLDL1KEEP) { \
|
||||
ld_st2(as_Register(pfop), adr, size, op); \
|
||||
}
|
||||
|
||||
INSN(prfm, 0b11, 0b10); // FIXME: PRFM should not be used with
|
||||
// writeback modes, but the assembler
|
||||
// doesn't enfore that.
|
||||
|
||||
#undef INSN
|
||||
|
||||
#define INSN(NAME, size, op) \
|
||||
void NAME(FloatRegister Rt, const Address &adr) { \
|
||||
ld_st2(as_Register(Rt), adr, size, op, 1); \
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
#endif
|
||||
|
||||
NEEDS_CLEANUP // remove this definitions ?
|
||||
const Register IC_Klass = rscratch2; // where the IC klass is cached
|
||||
const Register SYNC_header = r0; // synchronization header
|
||||
const Register SHIFT_count = r0; // where count for shift operations must be
|
||||
|
||||
@@ -293,27 +292,7 @@ void LIR_Assembler::osr_entry() {
|
||||
|
||||
// inline cache check; done before the frame is built.
|
||||
int LIR_Assembler::check_icache() {
|
||||
Register receiver = FrameMap::receiver_opr->as_register();
|
||||
Register ic_klass = IC_Klass;
|
||||
int start_offset = __ offset();
|
||||
__ inline_cache_check(receiver, ic_klass);
|
||||
|
||||
// if icache check fails, then jump to runtime routine
|
||||
// Note: RECEIVER must still contain the receiver!
|
||||
Label dont;
|
||||
__ br(Assembler::EQ, dont);
|
||||
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
|
||||
|
||||
// We align the verified entry point unless the method body
|
||||
// (including its inline cache check) will fit in a single 64-byte
|
||||
// icache line.
|
||||
if (! method()->is_accessor() || __ offset() - start_offset > 4 * 4) {
|
||||
// force alignment after the cache check.
|
||||
__ align(CodeEntryAlignment);
|
||||
}
|
||||
|
||||
__ bind(dont);
|
||||
return start_offset;
|
||||
return __ ic_check(CodeEntryAlignment);
|
||||
}
|
||||
|
||||
void LIR_Assembler::clinit_barrier(ciMethod* method) {
|
||||
@@ -1230,7 +1209,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
|
||||
len,
|
||||
tmp1,
|
||||
tmp2,
|
||||
arrayOopDesc::header_size(op->type()),
|
||||
arrayOopDesc::base_offset_in_bytes(op->type()),
|
||||
array_element_size(op->type()),
|
||||
op->klass()->as_register(),
|
||||
*op->stub()->entry());
|
||||
@@ -2042,7 +2021,7 @@ void LIR_Assembler::emit_static_call_stub() {
|
||||
__ relocate(static_stub_Relocation::spec(call_pc));
|
||||
__ emit_static_call_stub();
|
||||
|
||||
assert(__ offset() - start + CompiledStaticCall::to_trampoline_stub_size()
|
||||
assert(__ offset() - start + CompiledDirectCall::to_trampoline_stub_size()
|
||||
<= call_stub_size(), "stub too big");
|
||||
__ end_a_stub();
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ friend class ArrayCopyStub;
|
||||
void deoptimize_trap(CodeEmitInfo *info);
|
||||
|
||||
enum {
|
||||
// call stub: CompiledStaticCall::to_interp_stub_size() +
|
||||
// CompiledStaticCall::to_trampoline_stub_size()
|
||||
// call stub: CompiledDirectCall::to_interp_stub_size() +
|
||||
// CompiledDirectCall::to_trampoline_stub_size()
|
||||
_call_stub_size = 13 * NativeInstruction::instruction_size,
|
||||
_exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175),
|
||||
_deopt_handler_size = 7 * NativeInstruction::instruction_size
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -831,18 +831,12 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) {
|
||||
}
|
||||
break;
|
||||
case vmIntrinsics::_dlog:
|
||||
if (StubRoutines::dlog() != nullptr) {
|
||||
__ call_runtime_leaf(StubRoutines::dlog(), getThreadTemp(), result_reg, cc->args());
|
||||
} else {
|
||||
__ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog), getThreadTemp(), result_reg, cc->args());
|
||||
}
|
||||
// Math.log intrinsic is not implemented on AArch64 (see JDK-8210858),
|
||||
// but we can still call the shared runtime.
|
||||
__ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog), getThreadTemp(), result_reg, cc->args());
|
||||
break;
|
||||
case vmIntrinsics::_dlog10:
|
||||
if (StubRoutines::dlog10() != nullptr) {
|
||||
__ call_runtime_leaf(StubRoutines::dlog10(), getThreadTemp(), result_reg, cc->args());
|
||||
} else {
|
||||
__ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog10), getThreadTemp(), result_reg, cc->args());
|
||||
}
|
||||
__ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog10), getThreadTemp(), result_reg, cc->args());
|
||||
break;
|
||||
case vmIntrinsics::_dpow:
|
||||
if (StubRoutines::dpow() != nullptr) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -80,12 +80,12 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
|
||||
br(Assembler::NE, slow_case);
|
||||
}
|
||||
|
||||
// Load object header
|
||||
ldr(hdr, Address(obj, hdr_offset));
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
lightweight_lock(obj, hdr, temp, rscratch2, slow_case);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
Label done;
|
||||
// Load object header
|
||||
ldr(hdr, Address(obj, hdr_offset));
|
||||
// and mark it as unlocked
|
||||
orr(hdr, hdr, markWord::unlocked_value);
|
||||
// save unlocked object header into the displaced header location on the stack
|
||||
@@ -144,11 +144,6 @@ void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_
|
||||
verify_oop(obj);
|
||||
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
ldr(hdr, Address(obj, oopDesc::mark_offset_in_bytes()));
|
||||
// We cannot use tbnz here, the target might be too far away and cannot
|
||||
// be encoded.
|
||||
tst(hdr, markWord::monitor_value);
|
||||
br(Assembler::NE, slow_case);
|
||||
lightweight_unlock(obj, hdr, temp, rscratch2, slow_case);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
// test if object header is pointing to the displaced header, and if so, restore
|
||||
@@ -193,6 +188,12 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
|
||||
|
||||
if (len->is_valid()) {
|
||||
strw(len, Address(obj, arrayOopDesc::length_offset_in_bytes()));
|
||||
int base_offset = arrayOopDesc::length_offset_in_bytes() + BytesPerInt;
|
||||
if (!is_aligned(base_offset, BytesPerWord)) {
|
||||
assert(is_aligned(base_offset, BytesPerInt), "must be 4-byte aligned");
|
||||
// Clear gap/first 4 bytes following the length field.
|
||||
strw(zr, Address(obj, base_offset));
|
||||
}
|
||||
} else if (UseCompressedClassPointers) {
|
||||
store_klass_gap(obj, zr);
|
||||
}
|
||||
@@ -271,7 +272,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
|
||||
|
||||
verify_oop(obj);
|
||||
}
|
||||
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, Register t2, int header_size, int f, Register klass, Label& slow_case) {
|
||||
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, Register t2, int base_offset_in_bytes, int f, Register klass, Label& slow_case) {
|
||||
assert_different_registers(obj, len, t1, t2, klass);
|
||||
|
||||
// determine alignment mask
|
||||
@@ -284,7 +285,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
|
||||
|
||||
const Register arr_size = t2; // okay to be the same
|
||||
// align object end
|
||||
mov(arr_size, (int32_t)header_size * BytesPerWord + MinObjAlignmentInBytesMask);
|
||||
mov(arr_size, (int32_t)base_offset_in_bytes + MinObjAlignmentInBytesMask);
|
||||
add(arr_size, arr_size, len, ext::uxtw, f);
|
||||
andr(arr_size, arr_size, ~MinObjAlignmentInBytesMask);
|
||||
|
||||
@@ -292,8 +293,11 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
|
||||
|
||||
initialize_header(obj, klass, len, t1, t2);
|
||||
|
||||
// Align-up to word boundary, because we clear the 4 bytes potentially
|
||||
// following the length field in initialize_header().
|
||||
int base_offset = align_up(base_offset_in_bytes, BytesPerWord);
|
||||
// clear rest of allocated space
|
||||
initialize_body(obj, arr_size, header_size * BytesPerWord, t1, t2);
|
||||
initialize_body(obj, arr_size, base_offset, t1, t2);
|
||||
if (Compilation::current()->bailed_out()) {
|
||||
return;
|
||||
}
|
||||
@@ -308,17 +312,6 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
|
||||
verify_oop(obj);
|
||||
}
|
||||
|
||||
|
||||
void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
|
||||
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, rscratch1);
|
||||
}
|
||||
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -100,7 +100,7 @@ using MacroAssembler::null_check;
|
||||
// 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 t, Register t2, int header_size, int f, Register klass, Label& slow_case);
|
||||
void allocate_array(Register obj, Register len, Register t, Register t2, int base_offset_in_bytes, int f, Register klass, Label& slow_case);
|
||||
|
||||
int rsp_offset() const { return _rsp_offset; }
|
||||
void set_rsp_offset(int n) { _rsp_offset = n; }
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "nativeInst_aarch64.hpp"
|
||||
#include "oops/compiledICHolder.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
#include "register_aarch64.hpp"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2024, 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
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "opto/output.hpp"
|
||||
#include "opto/subnode.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
#ifdef PRODUCT
|
||||
#define BLOCK_COMMENT(str) /* nothing */
|
||||
@@ -55,6 +56,7 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
|
||||
Label object_has_monitor;
|
||||
Label count, no_count;
|
||||
|
||||
assert(LockingMode != LM_LIGHTWEIGHT, "lightweight locking should use fast_lock_lightweight");
|
||||
assert_different_registers(oop, box, tmp, disp_hdr);
|
||||
|
||||
// Load markWord from object into displaced_header.
|
||||
@@ -73,7 +75,8 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
|
||||
if (LockingMode == LM_MONITOR) {
|
||||
tst(oop, oop); // Set NE to indicate 'failure' -> take slow-path. We know that oop != 0.
|
||||
b(cont);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
} else {
|
||||
assert(LockingMode == LM_LEGACY, "must be");
|
||||
// Set tmp to be (markWord of object | UNLOCK_VALUE).
|
||||
orr(tmp, disp_hdr, markWord::unlocked_value);
|
||||
|
||||
@@ -102,31 +105,26 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
|
||||
ands(tmp/*==0?*/, disp_hdr, tmp); // Sets flags for result
|
||||
str(tmp/*==0, perhaps*/, Address(box, BasicLock::displaced_header_offset_in_bytes()));
|
||||
b(cont);
|
||||
} else {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "must be");
|
||||
lightweight_lock(oop, disp_hdr, tmp, tmp3Reg, no_count);
|
||||
b(count);
|
||||
}
|
||||
|
||||
// Handle existing monitor.
|
||||
bind(object_has_monitor);
|
||||
|
||||
// The object's monitor m is unlocked iff m->owner == NULL,
|
||||
// The object's monitor m is unlocked iff m->owner == nullptr,
|
||||
// otherwise m->owner may contain a thread or a stack address.
|
||||
//
|
||||
// Try to CAS m->owner from NULL to current thread.
|
||||
// Try to CAS m->owner from null to current thread.
|
||||
add(tmp, disp_hdr, (in_bytes(ObjectMonitor::owner_offset())-markWord::monitor_value));
|
||||
cmpxchg(tmp, zr, rthread, Assembler::xword, /*acquire*/ true,
|
||||
/*release*/ true, /*weak*/ false, tmp3Reg); // Sets flags for result
|
||||
|
||||
if (LockingMode != LM_LIGHTWEIGHT) {
|
||||
// Store a non-null value into the box to avoid looking like a re-entrant
|
||||
// lock. The fast-path monitor unlock code checks for
|
||||
// markWord::monitor_value so use markWord::unused_mark which has the
|
||||
// relevant bit set, and also matches ObjectSynchronizer::enter.
|
||||
mov(tmp, (address)markWord::unused_mark().value());
|
||||
str(tmp, Address(box, BasicLock::displaced_header_offset_in_bytes()));
|
||||
}
|
||||
// Store a non-null value into the box to avoid looking like a re-entrant
|
||||
// lock. The fast-path monitor unlock code checks for
|
||||
// markWord::monitor_value so use markWord::unused_mark which has the
|
||||
// relevant bit set, and also matches ObjectSynchronizer::enter.
|
||||
mov(tmp, (address)markWord::unused_mark().value());
|
||||
str(tmp, Address(box, BasicLock::displaced_header_offset_in_bytes()));
|
||||
|
||||
br(Assembler::EQ, cont); // CAS success means locking succeeded
|
||||
|
||||
cmp(tmp3Reg, rthread);
|
||||
@@ -157,6 +155,7 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Registe
|
||||
Label object_has_monitor;
|
||||
Label count, no_count;
|
||||
|
||||
assert(LockingMode != LM_LIGHTWEIGHT, "lightweight locking should use fast_unlock_lightweight");
|
||||
assert_different_registers(oop, box, tmp, disp_hdr);
|
||||
|
||||
if (LockingMode == LM_LEGACY) {
|
||||
@@ -175,7 +174,8 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Registe
|
||||
if (LockingMode == LM_MONITOR) {
|
||||
tst(oop, oop); // Set NE to indicate 'failure' -> take slow-path. We know that oop != 0.
|
||||
b(cont);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
} else {
|
||||
assert(LockingMode == LM_LEGACY, "must be");
|
||||
// Check if it is still a light weight lock, this is is true if we
|
||||
// see the stack address of the basicLock in the markWord of the
|
||||
// object.
|
||||
@@ -183,10 +183,6 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Registe
|
||||
cmpxchg(oop, box, disp_hdr, Assembler::xword, /*acquire*/ false,
|
||||
/*release*/ true, /*weak*/ false, tmp);
|
||||
b(cont);
|
||||
} else {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "must be");
|
||||
lightweight_unlock(oop, tmp, box, disp_hdr, no_count);
|
||||
b(count);
|
||||
}
|
||||
|
||||
assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0");
|
||||
@@ -196,19 +192,6 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Registe
|
||||
STATIC_ASSERT(markWord::monitor_value <= INT_MAX);
|
||||
add(tmp, tmp, -(int)markWord::monitor_value); // monitor
|
||||
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
// If the owner is anonymous, we need to fix it -- in an outline stub.
|
||||
Register tmp2 = disp_hdr;
|
||||
ldr(tmp2, Address(tmp, ObjectMonitor::owner_offset()));
|
||||
// We cannot use tbnz here, the target might be too far away and cannot
|
||||
// be encoded.
|
||||
tst(tmp2, (uint64_t)ObjectMonitor::ANONYMOUS_OWNER);
|
||||
C2HandleAnonOMOwnerStub* stub = new (Compile::current()->comp_arena()) C2HandleAnonOMOwnerStub(tmp, tmp2);
|
||||
Compile::current()->output()->add_stub(stub);
|
||||
br(Assembler::NE, stub->entry());
|
||||
bind(stub->continuation());
|
||||
}
|
||||
|
||||
ldr(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset()));
|
||||
|
||||
Label notRecursive;
|
||||
@@ -241,6 +224,262 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Registe
|
||||
bind(no_count);
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register t1,
|
||||
Register t2, Register t3) {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "must be");
|
||||
assert_different_registers(obj, t1, t2, t3);
|
||||
|
||||
// Handle inflated monitor.
|
||||
Label inflated;
|
||||
// Finish fast lock successfully. MUST branch to with flag == EQ
|
||||
Label locked;
|
||||
// Finish fast lock unsuccessfully. MUST branch to with flag == NE
|
||||
Label slow_path;
|
||||
|
||||
if (DiagnoseSyncOnValueBasedClasses != 0) {
|
||||
load_klass(t1, obj);
|
||||
ldrw(t1, Address(t1, Klass::access_flags_offset()));
|
||||
tstw(t1, JVM_ACC_IS_VALUE_BASED_CLASS);
|
||||
br(Assembler::NE, slow_path);
|
||||
}
|
||||
|
||||
const Register t1_mark = t1;
|
||||
|
||||
{ // Lightweight locking
|
||||
|
||||
// Push lock to the lock stack and finish successfully. MUST branch to with flag == EQ
|
||||
Label push;
|
||||
|
||||
const Register t2_top = t2;
|
||||
const Register t3_t = t3;
|
||||
|
||||
// Check if lock-stack is full.
|
||||
ldrw(t2_top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
cmpw(t2_top, (unsigned)LockStack::end_offset() - 1);
|
||||
br(Assembler::GT, slow_path);
|
||||
|
||||
// Check if recursive.
|
||||
subw(t3_t, t2_top, oopSize);
|
||||
ldr(t3_t, Address(rthread, t3_t));
|
||||
cmp(obj, t3_t);
|
||||
br(Assembler::EQ, push);
|
||||
|
||||
// Relaxed normal load to check for monitor. Optimization for monitor case.
|
||||
ldr(t1_mark, Address(obj, oopDesc::mark_offset_in_bytes()));
|
||||
tbnz(t1_mark, exact_log2(markWord::monitor_value), inflated);
|
||||
|
||||
// Not inflated
|
||||
assert(oopDesc::mark_offset_in_bytes() == 0, "required to avoid a lea");
|
||||
|
||||
// Try to lock. Transition lock-bits 0b01 => 0b00
|
||||
orr(t1_mark, t1_mark, markWord::unlocked_value);
|
||||
eor(t3_t, t1_mark, markWord::unlocked_value);
|
||||
cmpxchg(/*addr*/ obj, /*expected*/ t1_mark, /*new*/ t3_t, Assembler::xword,
|
||||
/*acquire*/ true, /*release*/ false, /*weak*/ false, noreg);
|
||||
br(Assembler::NE, slow_path);
|
||||
|
||||
bind(push);
|
||||
// After successful lock, push object on lock-stack.
|
||||
str(obj, Address(rthread, t2_top));
|
||||
addw(t2_top, t2_top, oopSize);
|
||||
strw(t2_top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
b(locked);
|
||||
}
|
||||
|
||||
{ // Handle inflated monitor.
|
||||
bind(inflated);
|
||||
|
||||
// mark contains the tagged ObjectMonitor*.
|
||||
const Register t1_tagged_monitor = t1_mark;
|
||||
const uintptr_t monitor_tag = markWord::monitor_value;
|
||||
const Register t2_owner_addr = t2;
|
||||
const Register t3_owner = t3;
|
||||
|
||||
// Compute owner address.
|
||||
lea(t2_owner_addr, Address(t1_tagged_monitor, (in_bytes(ObjectMonitor::owner_offset()) - monitor_tag)));
|
||||
|
||||
// CAS owner (null => current thread).
|
||||
cmpxchg(t2_owner_addr, zr, rthread, Assembler::xword, /*acquire*/ true,
|
||||
/*release*/ false, /*weak*/ false, t3_owner);
|
||||
br(Assembler::EQ, locked);
|
||||
|
||||
// Check if recursive.
|
||||
cmp(t3_owner, rthread);
|
||||
br(Assembler::NE, slow_path);
|
||||
|
||||
// Recursive.
|
||||
increment(Address(t1_tagged_monitor, in_bytes(ObjectMonitor::recursions_offset()) - monitor_tag), 1);
|
||||
}
|
||||
|
||||
bind(locked);
|
||||
increment(Address(rthread, JavaThread::held_monitor_count_offset()));
|
||||
|
||||
#ifdef ASSERT
|
||||
// Check that locked label is reached with Flags == EQ.
|
||||
Label flag_correct;
|
||||
br(Assembler::EQ, flag_correct);
|
||||
stop("Fast Lock Flag != EQ");
|
||||
#endif
|
||||
|
||||
bind(slow_path);
|
||||
#ifdef ASSERT
|
||||
// Check that slow_path label is reached with Flags == NE.
|
||||
br(Assembler::NE, flag_correct);
|
||||
stop("Fast Lock Flag != NE");
|
||||
bind(flag_correct);
|
||||
#endif
|
||||
// C2 uses the value of Flags (NE vs EQ) to determine the continuation.
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register t1, Register t2,
|
||||
Register t3) {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "must be");
|
||||
assert_different_registers(obj, t1, t2, t3);
|
||||
|
||||
// Handle inflated monitor.
|
||||
Label inflated, inflated_load_monitor;
|
||||
// Finish fast unlock successfully. MUST branch to with flag == EQ
|
||||
Label unlocked;
|
||||
// Finish fast unlock unsuccessfully. MUST branch to with flag == NE
|
||||
Label slow_path;
|
||||
|
||||
const Register t1_mark = t1;
|
||||
const Register t2_top = t2;
|
||||
const Register t3_t = t3;
|
||||
|
||||
{ // Lightweight unlock
|
||||
|
||||
// Check if obj is top of lock-stack.
|
||||
ldrw(t2_top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
subw(t2_top, t2_top, oopSize);
|
||||
ldr(t3_t, Address(rthread, t2_top));
|
||||
cmp(obj, t3_t);
|
||||
// Top of lock stack was not obj. Must be monitor.
|
||||
br(Assembler::NE, inflated_load_monitor);
|
||||
|
||||
// Pop lock-stack.
|
||||
DEBUG_ONLY(str(zr, Address(rthread, t2_top));)
|
||||
strw(t2_top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
|
||||
// Check if recursive.
|
||||
subw(t3_t, t2_top, oopSize);
|
||||
ldr(t3_t, Address(rthread, t3_t));
|
||||
cmp(obj, t3_t);
|
||||
br(Assembler::EQ, unlocked);
|
||||
|
||||
// Not recursive.
|
||||
// Load Mark.
|
||||
ldr(t1_mark, Address(obj, oopDesc::mark_offset_in_bytes()));
|
||||
|
||||
// Check header for monitor (0b10).
|
||||
tbnz(t1_mark, exact_log2(markWord::monitor_value), inflated);
|
||||
|
||||
// Try to unlock. Transition lock bits 0b00 => 0b01
|
||||
assert(oopDesc::mark_offset_in_bytes() == 0, "required to avoid lea");
|
||||
orr(t3_t, t1_mark, markWord::unlocked_value);
|
||||
cmpxchg(/*addr*/ obj, /*expected*/ t1_mark, /*new*/ t3_t, Assembler::xword,
|
||||
/*acquire*/ false, /*release*/ true, /*weak*/ false, noreg);
|
||||
br(Assembler::EQ, unlocked);
|
||||
|
||||
// Compare and exchange failed.
|
||||
// Restore lock-stack and handle the unlock in runtime.
|
||||
DEBUG_ONLY(str(obj, Address(rthread, t2_top));)
|
||||
addw(t2_top, t2_top, oopSize);
|
||||
str(t2_top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
b(slow_path);
|
||||
}
|
||||
|
||||
|
||||
{ // Handle inflated monitor.
|
||||
bind(inflated_load_monitor);
|
||||
ldr(t1_mark, Address(obj, oopDesc::mark_offset_in_bytes()));
|
||||
#ifdef ASSERT
|
||||
tbnz(t1_mark, exact_log2(markWord::monitor_value), inflated);
|
||||
stop("Fast Unlock not monitor");
|
||||
#endif
|
||||
|
||||
bind(inflated);
|
||||
|
||||
#ifdef ASSERT
|
||||
Label check_done;
|
||||
subw(t2_top, t2_top, oopSize);
|
||||
cmpw(t2_top, in_bytes(JavaThread::lock_stack_base_offset()));
|
||||
br(Assembler::LT, check_done);
|
||||
ldr(t3_t, Address(rthread, t2_top));
|
||||
cmp(obj, t3_t);
|
||||
br(Assembler::NE, inflated);
|
||||
stop("Fast Unlock lock on stack");
|
||||
bind(check_done);
|
||||
#endif
|
||||
|
||||
// mark contains the tagged ObjectMonitor*.
|
||||
const Register t1_monitor = t1_mark;
|
||||
const uintptr_t monitor_tag = markWord::monitor_value;
|
||||
|
||||
// Untag the monitor.
|
||||
sub(t1_monitor, t1_mark, monitor_tag);
|
||||
|
||||
const Register t2_recursions = t2;
|
||||
Label not_recursive;
|
||||
|
||||
// Check if recursive.
|
||||
ldr(t2_recursions, Address(t1_monitor, ObjectMonitor::recursions_offset()));
|
||||
cbz(t2_recursions, not_recursive);
|
||||
|
||||
// Recursive unlock.
|
||||
sub(t2_recursions, t2_recursions, 1u);
|
||||
str(t2_recursions, Address(t1_monitor, ObjectMonitor::recursions_offset()));
|
||||
// Set flag == EQ
|
||||
cmp(t2_recursions, t2_recursions);
|
||||
b(unlocked);
|
||||
|
||||
bind(not_recursive);
|
||||
|
||||
Label release;
|
||||
const Register t2_owner_addr = t2;
|
||||
|
||||
// Compute owner address.
|
||||
lea(t2_owner_addr, Address(t1_monitor, ObjectMonitor::owner_offset()));
|
||||
|
||||
// Check if the entry lists are empty.
|
||||
ldr(rscratch1, Address(t1_monitor, ObjectMonitor::EntryList_offset()));
|
||||
ldr(t3_t, Address(t1_monitor, ObjectMonitor::cxq_offset()));
|
||||
orr(rscratch1, rscratch1, t3_t);
|
||||
cmp(rscratch1, zr);
|
||||
br(Assembler::EQ, release);
|
||||
|
||||
// The owner may be anonymous and we removed the last obj entry in
|
||||
// the lock-stack. This loses the information about the owner.
|
||||
// Write the thread to the owner field so the runtime knows the owner.
|
||||
str(rthread, Address(t2_owner_addr));
|
||||
b(slow_path);
|
||||
|
||||
bind(release);
|
||||
// Set owner to null.
|
||||
// Release to satisfy the JMM
|
||||
stlr(zr, t2_owner_addr);
|
||||
}
|
||||
|
||||
bind(unlocked);
|
||||
decrement(Address(rthread, JavaThread::held_monitor_count_offset()));
|
||||
|
||||
#ifdef ASSERT
|
||||
// Check that unlocked label is reached with Flags == EQ.
|
||||
Label flag_correct;
|
||||
br(Assembler::EQ, flag_correct);
|
||||
stop("Fast Unlock Flag != EQ");
|
||||
#endif
|
||||
|
||||
bind(slow_path);
|
||||
#ifdef ASSERT
|
||||
// Check that slow_path label is reached with Flags == NE.
|
||||
br(Assembler::NE, flag_correct);
|
||||
stop("Fast Unlock Flag != NE");
|
||||
bind(flag_correct);
|
||||
#endif
|
||||
// C2 uses the value of Flags (NE vs EQ) to determine the continuation.
|
||||
}
|
||||
|
||||
// Search for str1 in str2 and return index or -1
|
||||
// Clobbers: rscratch1, rscratch2, rflags. May also clobber v0-v1, when icnt1==-1.
|
||||
void C2_MacroAssembler::string_indexof(Register str2, Register str1,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2024, 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
|
||||
@@ -36,9 +36,11 @@
|
||||
|
||||
public:
|
||||
// Code used by cmpFastLock and cmpFastUnlock mach instructions in .ad file.
|
||||
// See full description in macroAssembler_aarch64.cpp.
|
||||
void fast_lock(Register object, Register box, Register tmp, Register tmp2, Register tmp3);
|
||||
void fast_unlock(Register object, Register box, Register tmp, Register tmp2);
|
||||
// Code used by cmpFastLockLightweight and cmpFastUnlockLightweight mach instructions in .ad file.
|
||||
void fast_lock_lightweight(Register object, Register t1, Register t2, Register t3);
|
||||
void fast_unlock_lightweight(Register object, Register t1, Register t2, Register t3);
|
||||
|
||||
void string_compare(Register str1, Register str2,
|
||||
Register cnt1, Register cnt2, Register result,
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/macroAssembler.inline.hpp"
|
||||
#include "code/compiledIC.hpp"
|
||||
#include "code/icBuffer.hpp"
|
||||
#include "code/nmethod.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
@@ -36,7 +35,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define __ _masm.
|
||||
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) {
|
||||
address CompiledDirectCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) {
|
||||
precond(cbuf.stubs()->start() != badAddress);
|
||||
precond(cbuf.stubs()->end() != badAddress);
|
||||
|
||||
@@ -71,11 +70,11 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark)
|
||||
}
|
||||
#undef __
|
||||
|
||||
int CompiledStaticCall::to_interp_stub_size() {
|
||||
int CompiledDirectCall::to_interp_stub_size() {
|
||||
return MacroAssembler::static_call_stub_size();
|
||||
}
|
||||
|
||||
int CompiledStaticCall::to_trampoline_stub_size() {
|
||||
int CompiledDirectCall::to_trampoline_stub_size() {
|
||||
// Somewhat pessimistically, we count 3 instructions here (although
|
||||
// there are only two) because we sometimes emit an alignment nop.
|
||||
// Trampoline stubs are always word aligned.
|
||||
@@ -83,21 +82,14 @@ int CompiledStaticCall::to_trampoline_stub_size() {
|
||||
}
|
||||
|
||||
// Relocation entries for call stub, compiled java to interpreter.
|
||||
int CompiledStaticCall::reloc_to_interp_stub() {
|
||||
int CompiledDirectCall::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) {
|
||||
void CompiledDirectCall::set_to_interpreted(const methodHandle& callee, address entry) {
|
||||
address stub = find_stub();
|
||||
guarantee(stub != nullptr, "stub not found");
|
||||
|
||||
{
|
||||
ResourceMark rm;
|
||||
log_trace(inlinecache)("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 + NativeInstruction::instruction_size);
|
||||
@@ -115,7 +107,7 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad
|
||||
set_destination_mt_safe(stub);
|
||||
}
|
||||
|
||||
void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
|
||||
void CompiledDirectCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
|
||||
// Reset stub.
|
||||
address stub = static_stub->addr();
|
||||
assert(stub != nullptr, "stub not found");
|
||||
@@ -132,7 +124,7 @@ void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_
|
||||
// Non-product mode code
|
||||
#ifndef PRODUCT
|
||||
|
||||
void CompiledDirectStaticCall::verify() {
|
||||
void CompiledDirectCall::verify() {
|
||||
// Verify call.
|
||||
_call->verify();
|
||||
_call->verify_alignment();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2024, 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
|
||||
@@ -58,7 +58,7 @@ static char* reserve_at_eor_compatible_address(size_t size, bool aslr) {
|
||||
0x7ffc, 0x7ffe, 0x7fff
|
||||
};
|
||||
static constexpr int num_immediates = sizeof(immediates) / sizeof(immediates[0]);
|
||||
const int start_index = aslr ? os::random() : 0;
|
||||
const int start_index = aslr ? os::next_random((int)os::javaTimeNanos()) : 0;
|
||||
constexpr int max_tries = 64;
|
||||
for (int ntry = 0; result == nullptr && ntry < max_tries; ntry ++) {
|
||||
// As in os::attempt_reserve_memory_between, we alternate between higher and lower
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, 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.
|
||||
*
|
||||
@@ -678,7 +678,7 @@ static void printbc(Method *m, intptr_t bcx) {
|
||||
printf("%s : %s ==> %s\n", m->name_and_sig_as_C_string(), buf, name);
|
||||
}
|
||||
|
||||
void internal_pf(uintptr_t sp, uintptr_t fp, uintptr_t pc, uintptr_t bcx) {
|
||||
static void internal_pf(uintptr_t sp, uintptr_t fp, uintptr_t pc, uintptr_t bcx) {
|
||||
if (! fp)
|
||||
return;
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include "gc/g1/g1BarrierSetAssembler.hpp"
|
||||
#include "gc/g1/g1BarrierSetRuntime.hpp"
|
||||
#include "gc/g1/g1CardTable.hpp"
|
||||
#include "gc/g1/g1HeapRegion.hpp"
|
||||
#include "gc/g1/g1ThreadLocalData.hpp"
|
||||
#include "gc/g1/heapRegion.hpp"
|
||||
#include "gc/shared/collectedHeap.hpp"
|
||||
#include "interpreter/interp_masm.hpp"
|
||||
#include "runtime/javaThread.hpp"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -117,7 +117,7 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
||||
"Use prfm hint with specified distance in compiled code." \
|
||||
"Value -1 means off.") \
|
||||
range(-1, 4096) \
|
||||
product(ccstr, OnSpinWaitInst, "none", DIAGNOSTIC, \
|
||||
product(ccstr, OnSpinWaitInst, "yield", DIAGNOSTIC, \
|
||||
"The instruction to use to implement " \
|
||||
"java.lang.Thread.onSpinWait()." \
|
||||
"Options: none, nop, isb, yield.") \
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
* 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 "asm/macroAssembler.inline.hpp"
|
||||
#include "code/icBuffer.hpp"
|
||||
#include "gc/shared/collectedHeap.inline.hpp"
|
||||
#include "interpreter/bytecodes.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "nativeInst_aarch64.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
int InlineCacheBuffer::ic_stub_code_size() {
|
||||
return (MacroAssembler::far_branches() ? 6 : 4) * NativeInstruction::instruction_size;
|
||||
}
|
||||
|
||||
#define __ masm->
|
||||
|
||||
void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin, void* cached_value, address entry_point) {
|
||||
ResourceMark rm;
|
||||
CodeBuffer code(code_begin, ic_stub_code_size());
|
||||
MacroAssembler* masm = new MacroAssembler(&code);
|
||||
// note: even though the code contains an embedded value, we do not need reloc info
|
||||
// because
|
||||
// (1) the value is old (i.e., doesn't matter for scavenges)
|
||||
// (2) these ICStubs are removed *before* a GC happens, so the roots disappear
|
||||
// assert(cached_value == nullptr || cached_oop->is_perm(), "must be perm oop");
|
||||
|
||||
address start = __ pc();
|
||||
Label l;
|
||||
__ ldr(rscratch2, l);
|
||||
int jump_code_size = __ far_jump(ExternalAddress(entry_point));
|
||||
// IC stub code size is not expected to vary depending on target address.
|
||||
// We use NOPs to make the [ldr + far_jump + nops + int64] stub size equal to ic_stub_code_size.
|
||||
for (int size = NativeInstruction::instruction_size + jump_code_size + 8;
|
||||
size < ic_stub_code_size(); size += NativeInstruction::instruction_size) {
|
||||
__ nop();
|
||||
}
|
||||
__ bind(l);
|
||||
assert((uintptr_t)__ pc() % wordSize == 0, "");
|
||||
__ emit_int64((int64_t)cached_value);
|
||||
// Only need to invalidate the 1st two instructions - not the whole ic stub
|
||||
ICache::invalidate_range(code_begin, InlineCacheBuffer::ic_stub_code_size());
|
||||
assert(__ pc() - start == ic_stub_code_size(), "must be");
|
||||
}
|
||||
|
||||
address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
|
||||
NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // creation also verifies the object
|
||||
NativeJump* jump = nativeJump_at(code_begin + 4);
|
||||
return jump->jump_destination();
|
||||
}
|
||||
|
||||
|
||||
void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
|
||||
// The word containing the cached value is at the end of this IC buffer
|
||||
uintptr_t *p = (uintptr_t *)(code_begin + ic_stub_code_size() - wordSize);
|
||||
void* o = (void*)*p;
|
||||
return o;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2024, 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.
|
||||
*
|
||||
@@ -53,7 +53,7 @@ struct li_pair {
|
||||
static struct li_pair InverseLITable[LI_TABLE_SIZE];
|
||||
|
||||
// comparator to sort entries in the inverse table
|
||||
int compare_immediate_pair(const void *i1, const void *i2)
|
||||
static int compare_immediate_pair(const void *i1, const void *i2)
|
||||
{
|
||||
struct li_pair *li1 = (struct li_pair *)i1;
|
||||
struct li_pair *li2 = (struct li_pair *)i2;
|
||||
@@ -142,7 +142,7 @@ static inline uint32_t uimm(uint32_t val, int hi, int lo)
|
||||
// result
|
||||
// a bit string containing count copies of input bit string
|
||||
//
|
||||
uint64_t replicate(uint64_t bits, int nbits, int count)
|
||||
static uint64_t replicate(uint64_t bits, int nbits, int count)
|
||||
{
|
||||
assert(count > 0, "must be");
|
||||
assert(nbits > 0, "must be");
|
||||
@@ -231,8 +231,8 @@ uint64_t replicate(uint64_t bits, int nbits, int count)
|
||||
// For historical reasons the implementation of this function is much
|
||||
// more convoluted than is really necessary.
|
||||
|
||||
int expandLogicalImmediate(uint32_t immN, uint32_t immr,
|
||||
uint32_t imms, uint64_t &bimm)
|
||||
static int expandLogicalImmediate(uint32_t immN, uint32_t immr,
|
||||
uint32_t imms, uint64_t &bimm)
|
||||
{
|
||||
int len; // ought to be <= 6
|
||||
uint32_t levels; // 6 bits
|
||||
@@ -446,4 +446,3 @@ uint32_t encoding_for_fp_immediate(float immediate)
|
||||
res = (s << 7) | (r << 4) | f;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2024, 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.
|
||||
*
|
||||
@@ -701,7 +701,6 @@ void InterpreterMacroAssembler::lock_object(Register lock_reg)
|
||||
}
|
||||
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
ldr(tmp, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
|
||||
lightweight_lock(obj_reg, tmp, tmp2, tmp3, slow_case);
|
||||
b(count);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
@@ -818,22 +817,6 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg)
|
||||
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
Label slow_case;
|
||||
|
||||
// Check for non-symmetric locking. This is allowed by the spec and the interpreter
|
||||
// must handle it.
|
||||
Register tmp = rscratch1;
|
||||
// First check for lock-stack underflow.
|
||||
ldrw(tmp, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
cmpw(tmp, (unsigned)LockStack::start_offset());
|
||||
br(Assembler::LE, slow_case);
|
||||
// Then check if the top of the lock-stack matches the unlocked object.
|
||||
subw(tmp, tmp, oopSize);
|
||||
ldr(tmp, Address(rthread, tmp));
|
||||
cmpoop(tmp, obj_reg);
|
||||
br(Assembler::NE, slow_case);
|
||||
|
||||
ldr(header_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
|
||||
tbnz(header_reg, exact_log2(markWord::monitor_value), slow_case);
|
||||
lightweight_unlock(obj_reg, header_reg, swap_reg, tmp_reg, slow_case);
|
||||
b(count);
|
||||
bind(slow_case);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -23,12 +23,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/assembler.hpp"
|
||||
#include "asm/assembler.inline.hpp"
|
||||
#include "ci/ciEnv.hpp"
|
||||
#include "code/compiledIC.hpp"
|
||||
#include "compiler/compileTask.hpp"
|
||||
#include "compiler/disassembler.hpp"
|
||||
#include "compiler/oopMap.hpp"
|
||||
@@ -55,6 +54,7 @@
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/powerOfTwo.hpp"
|
||||
#ifdef COMPILER1
|
||||
#include "c1/c1_LIRAssembler.hpp"
|
||||
@@ -66,6 +66,8 @@
|
||||
#include "opto/output.hpp"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef PRODUCT
|
||||
#define BLOCK_COMMENT(str) /* nothing */
|
||||
#else
|
||||
@@ -965,7 +967,7 @@ int MacroAssembler::max_trampoline_stub_size() {
|
||||
}
|
||||
|
||||
void MacroAssembler::emit_static_call_stub() {
|
||||
// CompiledDirectStaticCall::set_to_interpreted knows the
|
||||
// CompiledDirectCall::set_to_interpreted knows the
|
||||
// exact layout of this stub.
|
||||
|
||||
isb();
|
||||
@@ -995,10 +997,51 @@ address MacroAssembler::ic_call(address entry, jint method_index) {
|
||||
// address const_ptr = long_constant((jlong)Universe::non_oop_word());
|
||||
// uintptr_t offset;
|
||||
// ldr_constant(rscratch2, const_ptr);
|
||||
movptr(rscratch2, (uintptr_t)Universe::non_oop_word());
|
||||
movptr(rscratch2, (intptr_t)Universe::non_oop_word());
|
||||
return trampoline_call(Address(entry, rh));
|
||||
}
|
||||
|
||||
int MacroAssembler::ic_check_size() {
|
||||
if (target_needs_far_branch(CAST_FROM_FN_PTR(address, SharedRuntime::get_ic_miss_stub()))) {
|
||||
return NativeInstruction::instruction_size * 7;
|
||||
} else {
|
||||
return NativeInstruction::instruction_size * 5;
|
||||
}
|
||||
}
|
||||
|
||||
int MacroAssembler::ic_check(int end_alignment) {
|
||||
Register receiver = j_rarg0;
|
||||
Register data = rscratch2;
|
||||
Register tmp1 = rscratch1;
|
||||
Register tmp2 = r10;
|
||||
|
||||
// The UEP of a code blob ensures that the VEP is padded. However, the padding of the UEP is placed
|
||||
// before the inline cache check, so we don't have to execute any nop instructions when dispatching
|
||||
// through the UEP, yet we can ensure that the VEP is aligned appropriately. That's why we align
|
||||
// before the inline cache check here, and not after
|
||||
align(end_alignment, offset() + ic_check_size());
|
||||
|
||||
int uep_offset = offset();
|
||||
|
||||
if (UseCompressedClassPointers) {
|
||||
ldrw(tmp1, Address(receiver, oopDesc::klass_offset_in_bytes()));
|
||||
ldrw(tmp2, Address(data, CompiledICData::speculated_klass_offset()));
|
||||
cmpw(tmp1, tmp2);
|
||||
} else {
|
||||
ldr(tmp1, Address(receiver, oopDesc::klass_offset_in_bytes()));
|
||||
ldr(tmp2, Address(data, CompiledICData::speculated_klass_offset()));
|
||||
cmp(tmp1, tmp2);
|
||||
}
|
||||
|
||||
Label dont;
|
||||
br(Assembler::EQ, dont);
|
||||
far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
|
||||
bind(dont);
|
||||
assert((offset() % end_alignment) == 0, "Misaligned verified entry point");
|
||||
|
||||
return uep_offset;
|
||||
}
|
||||
|
||||
// Implementation of call_VM versions
|
||||
|
||||
void MacroAssembler::call_VM(Register oop_result,
|
||||
@@ -1100,7 +1143,14 @@ void MacroAssembler::get_vm_result_2(Register metadata_result, Register java_thr
|
||||
}
|
||||
|
||||
void MacroAssembler::align(int modulus) {
|
||||
while (offset() % modulus != 0) nop();
|
||||
align(modulus, offset());
|
||||
}
|
||||
|
||||
// Ensure that the code at target bytes offset from the current offset() is aligned
|
||||
// according to modulus.
|
||||
void MacroAssembler::align(int modulus, int target) {
|
||||
int delta = target - offset();
|
||||
while ((offset() + delta) % modulus != 0) nop();
|
||||
}
|
||||
|
||||
void MacroAssembler::post_call_nop() {
|
||||
@@ -1197,7 +1247,7 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
||||
}
|
||||
|
||||
// Look up the method for a megamorphic invokeinterface call in a single pass over itable:
|
||||
// - check recv_klass (actual object class) is a subtype of resolved_klass from CompiledICHolder
|
||||
// - check recv_klass (actual object class) is a subtype of resolved_klass from CompiledICData
|
||||
// - find a holder_klass (class that implements the method) vtable offset and get the method from vtable by index
|
||||
// The target method is determined by <holder_klass, itable_index>.
|
||||
// The receiver klass is in recv_klass.
|
||||
@@ -4258,108 +4308,117 @@ void MacroAssembler::kernel_crc32_common_fold_using_crypto_pmull(Register crc, R
|
||||
}
|
||||
add(table, table, table_offset);
|
||||
|
||||
// Registers v0..v7 are used as data registers.
|
||||
// Registers v16..v31 are used as tmp registers.
|
||||
sub(buf, buf, 0x10);
|
||||
ldrq(v1, Address(buf, 0x10));
|
||||
ldrq(v2, Address(buf, 0x20));
|
||||
ldrq(v3, Address(buf, 0x30));
|
||||
ldrq(v4, Address(buf, 0x40));
|
||||
ldrq(v5, Address(buf, 0x50));
|
||||
ldrq(v6, Address(buf, 0x60));
|
||||
ldrq(v7, Address(buf, 0x70));
|
||||
ldrq(v8, Address(pre(buf, 0x80)));
|
||||
ldrq(v0, Address(buf, 0x10));
|
||||
ldrq(v1, Address(buf, 0x20));
|
||||
ldrq(v2, Address(buf, 0x30));
|
||||
ldrq(v3, Address(buf, 0x40));
|
||||
ldrq(v4, Address(buf, 0x50));
|
||||
ldrq(v5, Address(buf, 0x60));
|
||||
ldrq(v6, Address(buf, 0x70));
|
||||
ldrq(v7, Address(pre(buf, 0x80)));
|
||||
|
||||
movi(v25, T4S, 0);
|
||||
mov(v25, S, 0, crc);
|
||||
eor(v1, T16B, v1, v25);
|
||||
movi(v31, T4S, 0);
|
||||
mov(v31, S, 0, crc);
|
||||
eor(v0, T16B, v0, v31);
|
||||
|
||||
ldrq(v0, Address(table));
|
||||
// Register v16 contains constants from the crc table.
|
||||
ldrq(v16, Address(table));
|
||||
b(CRC_by128_loop);
|
||||
|
||||
align(OptoLoopAlignment);
|
||||
BIND(CRC_by128_loop);
|
||||
pmull (v9, T1Q, v1, v0, T1D);
|
||||
pmull2(v10, T1Q, v1, v0, T2D);
|
||||
ldrq(v1, Address(buf, 0x10));
|
||||
eor3(v1, T16B, v9, v10, v1);
|
||||
pmull (v17, T1Q, v0, v16, T1D);
|
||||
pmull2(v18, T1Q, v0, v16, T2D);
|
||||
ldrq(v0, Address(buf, 0x10));
|
||||
eor3(v0, T16B, v17, v18, v0);
|
||||
|
||||
pmull (v11, T1Q, v2, v0, T1D);
|
||||
pmull2(v12, T1Q, v2, v0, T2D);
|
||||
ldrq(v2, Address(buf, 0x20));
|
||||
eor3(v2, T16B, v11, v12, v2);
|
||||
pmull (v19, T1Q, v1, v16, T1D);
|
||||
pmull2(v20, T1Q, v1, v16, T2D);
|
||||
ldrq(v1, Address(buf, 0x20));
|
||||
eor3(v1, T16B, v19, v20, v1);
|
||||
|
||||
pmull (v13, T1Q, v3, v0, T1D);
|
||||
pmull2(v14, T1Q, v3, v0, T2D);
|
||||
ldrq(v3, Address(buf, 0x30));
|
||||
eor3(v3, T16B, v13, v14, v3);
|
||||
pmull (v21, T1Q, v2, v16, T1D);
|
||||
pmull2(v22, T1Q, v2, v16, T2D);
|
||||
ldrq(v2, Address(buf, 0x30));
|
||||
eor3(v2, T16B, v21, v22, v2);
|
||||
|
||||
pmull (v15, T1Q, v4, v0, T1D);
|
||||
pmull2(v16, T1Q, v4, v0, T2D);
|
||||
ldrq(v4, Address(buf, 0x40));
|
||||
eor3(v4, T16B, v15, v16, v4);
|
||||
pmull (v23, T1Q, v3, v16, T1D);
|
||||
pmull2(v24, T1Q, v3, v16, T2D);
|
||||
ldrq(v3, Address(buf, 0x40));
|
||||
eor3(v3, T16B, v23, v24, v3);
|
||||
|
||||
pmull (v17, T1Q, v5, v0, T1D);
|
||||
pmull2(v18, T1Q, v5, v0, T2D);
|
||||
ldrq(v5, Address(buf, 0x50));
|
||||
eor3(v5, T16B, v17, v18, v5);
|
||||
pmull (v25, T1Q, v4, v16, T1D);
|
||||
pmull2(v26, T1Q, v4, v16, T2D);
|
||||
ldrq(v4, Address(buf, 0x50));
|
||||
eor3(v4, T16B, v25, v26, v4);
|
||||
|
||||
pmull (v19, T1Q, v6, v0, T1D);
|
||||
pmull2(v20, T1Q, v6, v0, T2D);
|
||||
ldrq(v6, Address(buf, 0x60));
|
||||
eor3(v6, T16B, v19, v20, v6);
|
||||
pmull (v27, T1Q, v5, v16, T1D);
|
||||
pmull2(v28, T1Q, v5, v16, T2D);
|
||||
ldrq(v5, Address(buf, 0x60));
|
||||
eor3(v5, T16B, v27, v28, v5);
|
||||
|
||||
pmull (v21, T1Q, v7, v0, T1D);
|
||||
pmull2(v22, T1Q, v7, v0, T2D);
|
||||
ldrq(v7, Address(buf, 0x70));
|
||||
eor3(v7, T16B, v21, v22, v7);
|
||||
pmull (v29, T1Q, v6, v16, T1D);
|
||||
pmull2(v30, T1Q, v6, v16, T2D);
|
||||
ldrq(v6, Address(buf, 0x70));
|
||||
eor3(v6, T16B, v29, v30, v6);
|
||||
|
||||
pmull (v23, T1Q, v8, v0, T1D);
|
||||
pmull2(v24, T1Q, v8, v0, T2D);
|
||||
ldrq(v8, Address(pre(buf, 0x80)));
|
||||
eor3(v8, T16B, v23, v24, v8);
|
||||
// Reuse registers v23, v24.
|
||||
// Using them won't block the first instruction of the next iteration.
|
||||
pmull (v23, T1Q, v7, v16, T1D);
|
||||
pmull2(v24, T1Q, v7, v16, T2D);
|
||||
ldrq(v7, Address(pre(buf, 0x80)));
|
||||
eor3(v7, T16B, v23, v24, v7);
|
||||
|
||||
subs(len, len, 0x80);
|
||||
br(Assembler::GE, CRC_by128_loop);
|
||||
|
||||
// fold into 512 bits
|
||||
ldrq(v0, Address(table, 0x10));
|
||||
// Use v31 for constants because v16 can be still in use.
|
||||
ldrq(v31, Address(table, 0x10));
|
||||
|
||||
pmull (v10, T1Q, v1, v0, T1D);
|
||||
pmull2(v11, T1Q, v1, v0, T2D);
|
||||
eor3(v1, T16B, v10, v11, v5);
|
||||
pmull (v17, T1Q, v0, v31, T1D);
|
||||
pmull2(v18, T1Q, v0, v31, T2D);
|
||||
eor3(v0, T16B, v17, v18, v4);
|
||||
|
||||
pmull (v12, T1Q, v2, v0, T1D);
|
||||
pmull2(v13, T1Q, v2, v0, T2D);
|
||||
eor3(v2, T16B, v12, v13, v6);
|
||||
pmull (v19, T1Q, v1, v31, T1D);
|
||||
pmull2(v20, T1Q, v1, v31, T2D);
|
||||
eor3(v1, T16B, v19, v20, v5);
|
||||
|
||||
pmull (v14, T1Q, v3, v0, T1D);
|
||||
pmull2(v15, T1Q, v3, v0, T2D);
|
||||
eor3(v3, T16B, v14, v15, v7);
|
||||
pmull (v21, T1Q, v2, v31, T1D);
|
||||
pmull2(v22, T1Q, v2, v31, T2D);
|
||||
eor3(v2, T16B, v21, v22, v6);
|
||||
|
||||
pmull (v16, T1Q, v4, v0, T1D);
|
||||
pmull2(v17, T1Q, v4, v0, T2D);
|
||||
eor3(v4, T16B, v16, v17, v8);
|
||||
pmull (v23, T1Q, v3, v31, T1D);
|
||||
pmull2(v24, T1Q, v3, v31, T2D);
|
||||
eor3(v3, T16B, v23, v24, v7);
|
||||
|
||||
// fold into 128 bits
|
||||
ldrq(v5, Address(table, 0x20));
|
||||
pmull (v10, T1Q, v1, v5, T1D);
|
||||
pmull2(v11, T1Q, v1, v5, T2D);
|
||||
eor3(v4, T16B, v4, v10, v11);
|
||||
// Use v17 for constants because v31 can be still in use.
|
||||
ldrq(v17, Address(table, 0x20));
|
||||
pmull (v25, T1Q, v0, v17, T1D);
|
||||
pmull2(v26, T1Q, v0, v17, T2D);
|
||||
eor3(v3, T16B, v3, v25, v26);
|
||||
|
||||
ldrq(v6, Address(table, 0x30));
|
||||
pmull (v12, T1Q, v2, v6, T1D);
|
||||
pmull2(v13, T1Q, v2, v6, T2D);
|
||||
eor3(v4, T16B, v4, v12, v13);
|
||||
// Use v18 for constants because v17 can be still in use.
|
||||
ldrq(v18, Address(table, 0x30));
|
||||
pmull (v27, T1Q, v1, v18, T1D);
|
||||
pmull2(v28, T1Q, v1, v18, T2D);
|
||||
eor3(v3, T16B, v3, v27, v28);
|
||||
|
||||
ldrq(v7, Address(table, 0x40));
|
||||
pmull (v14, T1Q, v3, v7, T1D);
|
||||
pmull2(v15, T1Q, v3, v7, T2D);
|
||||
eor3(v1, T16B, v4, v14, v15);
|
||||
// Use v19 for constants because v18 can be still in use.
|
||||
ldrq(v19, Address(table, 0x40));
|
||||
pmull (v29, T1Q, v2, v19, T1D);
|
||||
pmull2(v30, T1Q, v2, v19, T2D);
|
||||
eor3(v0, T16B, v3, v29, v30);
|
||||
|
||||
add(len, len, 0x80);
|
||||
add(buf, buf, 0x10);
|
||||
|
||||
mov(tmp0, v1, D, 0);
|
||||
mov(tmp1, v1, D, 1);
|
||||
mov(tmp0, v0, D, 0);
|
||||
mov(tmp1, v0, D, 1);
|
||||
}
|
||||
|
||||
SkipIfEqual::SkipIfEqual(
|
||||
@@ -5339,28 +5398,25 @@ address MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp3,
|
||||
|
||||
// For Strings we're passed the address of the first characters in a1
|
||||
// and a2 and the length in cnt1.
|
||||
// elem_size is the element size in bytes: either 1 or 2.
|
||||
// There are two implementations. For arrays >= 8 bytes, all
|
||||
// comparisons (including the final one, which may overlap) are
|
||||
// performed 8 bytes at a time. For strings < 8 bytes, we compare a
|
||||
// halfword, then a short, and then a byte.
|
||||
|
||||
void MacroAssembler::string_equals(Register a1, Register a2,
|
||||
Register result, Register cnt1, int elem_size)
|
||||
Register result, Register cnt1)
|
||||
{
|
||||
Label SAME, DONE, SHORT, NEXT_WORD;
|
||||
Register tmp1 = rscratch1;
|
||||
Register tmp2 = rscratch2;
|
||||
Register cnt2 = tmp2; // cnt2 only used in array length compare
|
||||
|
||||
assert(elem_size == 1 || elem_size == 2, "must be 2 or 1 byte");
|
||||
assert_different_registers(a1, a2, result, cnt1, rscratch1, rscratch2);
|
||||
|
||||
#ifndef PRODUCT
|
||||
{
|
||||
const char kind = (elem_size == 2) ? 'U' : 'L';
|
||||
char comment[64];
|
||||
snprintf(comment, sizeof comment, "{string_equals%c", kind);
|
||||
snprintf(comment, sizeof comment, "{string_equalsL");
|
||||
BLOCK_COMMENT(comment);
|
||||
}
|
||||
#endif
|
||||
@@ -5408,14 +5464,12 @@ void MacroAssembler::string_equals(Register a1, Register a2,
|
||||
cbnzw(tmp1, DONE);
|
||||
}
|
||||
bind(TAIL01);
|
||||
if (elem_size == 1) { // Only needed when comparing 1-byte elements
|
||||
tbz(cnt1, 0, SAME); // 0-1 bytes left.
|
||||
tbz(cnt1, 0, SAME); // 0-1 bytes left.
|
||||
{
|
||||
ldrb(tmp1, a1);
|
||||
ldrb(tmp2, a2);
|
||||
eorw(tmp1, tmp1, tmp2);
|
||||
cbnzw(tmp1, DONE);
|
||||
}
|
||||
ldrb(tmp1, a1);
|
||||
ldrb(tmp2, a2);
|
||||
eorw(tmp1, tmp1, tmp2);
|
||||
cbnzw(tmp1, DONE);
|
||||
}
|
||||
// Arrays are equal.
|
||||
bind(SAME);
|
||||
@@ -6328,97 +6382,122 @@ void MacroAssembler::double_move(VMRegPair src, VMRegPair dst, Register tmp) {
|
||||
}
|
||||
|
||||
// Implements lightweight-locking.
|
||||
// Branches to slow upon failure to lock the object, with ZF cleared.
|
||||
// Falls through upon success with ZF set.
|
||||
//
|
||||
// - obj: the object to be locked
|
||||
// - hdr: the header, already loaded from obj, will be destroyed
|
||||
// - t1, t2: temporary registers, will be destroyed
|
||||
void MacroAssembler::lightweight_lock(Register obj, Register hdr, Register t1, Register t2, Label& slow) {
|
||||
// - t1, t2, t3: temporary registers, will be destroyed
|
||||
// - slow: branched to if locking fails, absolute offset may larger than 32KB (imm14 encoding).
|
||||
void MacroAssembler::lightweight_lock(Register obj, Register t1, Register t2, Register t3, Label& slow) {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "only used with new lightweight locking");
|
||||
assert_different_registers(obj, hdr, t1, t2, rscratch1);
|
||||
assert_different_registers(obj, t1, t2, t3, rscratch1);
|
||||
|
||||
// Check if we would have space on lock-stack for the object.
|
||||
ldrw(t1, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
cmpw(t1, (unsigned)LockStack::end_offset() - 1);
|
||||
br(Assembler::GT, slow);
|
||||
Label push;
|
||||
const Register top = t1;
|
||||
const Register mark = t2;
|
||||
const Register t = t3;
|
||||
|
||||
// Load (object->mark() | 1) into hdr
|
||||
orr(hdr, hdr, markWord::unlocked_value);
|
||||
// Clear lock-bits, into t2
|
||||
eor(t2, hdr, markWord::unlocked_value);
|
||||
// Try to swing header from unlocked to locked
|
||||
// Clobbers rscratch1 when UseLSE is false
|
||||
cmpxchg(/*addr*/ obj, /*expected*/ hdr, /*new*/ t2, Assembler::xword,
|
||||
/*acquire*/ true, /*release*/ true, /*weak*/ false, t1);
|
||||
// Preload the markWord. It is important that this is the first
|
||||
// instruction emitted as it is part of C1's null check semantics.
|
||||
ldr(mark, Address(obj, oopDesc::mark_offset_in_bytes()));
|
||||
|
||||
// Check if the lock-stack is full.
|
||||
ldrw(top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
cmpw(top, (unsigned)LockStack::end_offset());
|
||||
br(Assembler::GE, slow);
|
||||
|
||||
// Check for recursion.
|
||||
subw(t, top, oopSize);
|
||||
ldr(t, Address(rthread, t));
|
||||
cmp(obj, t);
|
||||
br(Assembler::EQ, push);
|
||||
|
||||
// Check header for monitor (0b10).
|
||||
tst(mark, markWord::monitor_value);
|
||||
br(Assembler::NE, slow);
|
||||
|
||||
// After successful lock, push object on lock-stack
|
||||
ldrw(t1, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
str(obj, Address(rthread, t1));
|
||||
addw(t1, t1, oopSize);
|
||||
strw(t1, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
// Try to lock. Transition lock bits 0b01 => 0b00
|
||||
assert(oopDesc::mark_offset_in_bytes() == 0, "required to avoid lea");
|
||||
orr(mark, mark, markWord::unlocked_value);
|
||||
eor(t, mark, markWord::unlocked_value);
|
||||
cmpxchg(/*addr*/ obj, /*expected*/ mark, /*new*/ t, Assembler::xword,
|
||||
/*acquire*/ true, /*release*/ false, /*weak*/ false, noreg);
|
||||
br(Assembler::NE, slow);
|
||||
|
||||
bind(push);
|
||||
// After successful lock, push object on lock-stack.
|
||||
str(obj, Address(rthread, top));
|
||||
addw(top, top, oopSize);
|
||||
strw(top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
}
|
||||
|
||||
// Implements lightweight-unlocking.
|
||||
// Branches to slow upon failure, with ZF cleared.
|
||||
// Falls through upon success, with ZF set.
|
||||
//
|
||||
// - obj: the object to be unlocked
|
||||
// - hdr: the (pre-loaded) header of the object
|
||||
// - t1, t2: temporary registers
|
||||
void MacroAssembler::lightweight_unlock(Register obj, Register hdr, Register t1, Register t2, Label& slow) {
|
||||
// - t1, t2, t3: temporary registers
|
||||
// - slow: branched to if unlocking fails, absolute offset may larger than 32KB (imm14 encoding).
|
||||
void MacroAssembler::lightweight_unlock(Register obj, Register t1, Register t2, Register t3, Label& slow) {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "only used with new lightweight locking");
|
||||
assert_different_registers(obj, hdr, t1, t2, rscratch1);
|
||||
// cmpxchg clobbers rscratch1.
|
||||
assert_different_registers(obj, t1, t2, t3, rscratch1);
|
||||
|
||||
#ifdef ASSERT
|
||||
{
|
||||
// The following checks rely on the fact that LockStack is only ever modified by
|
||||
// its owning thread, even if the lock got inflated concurrently; removal of LockStack
|
||||
// entries after inflation will happen delayed in that case.
|
||||
|
||||
// Check for lock-stack underflow.
|
||||
Label stack_ok;
|
||||
ldrw(t1, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
cmpw(t1, (unsigned)LockStack::start_offset());
|
||||
br(Assembler::GT, stack_ok);
|
||||
br(Assembler::GE, stack_ok);
|
||||
STOP("Lock-stack underflow");
|
||||
bind(stack_ok);
|
||||
}
|
||||
{
|
||||
// Check if the top of the lock-stack matches the unlocked object.
|
||||
Label tos_ok;
|
||||
subw(t1, t1, oopSize);
|
||||
ldr(t1, Address(rthread, t1));
|
||||
cmpoop(t1, obj);
|
||||
br(Assembler::EQ, tos_ok);
|
||||
STOP("Top of lock-stack does not match the unlocked object");
|
||||
bind(tos_ok);
|
||||
}
|
||||
{
|
||||
// Check that hdr is fast-locked.
|
||||
Label hdr_ok;
|
||||
tst(hdr, markWord::lock_mask_in_place);
|
||||
br(Assembler::EQ, hdr_ok);
|
||||
STOP("Header is not fast-locked");
|
||||
bind(hdr_ok);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Load the new header (unlocked) into t1
|
||||
orr(t1, hdr, markWord::unlocked_value);
|
||||
Label unlocked, push_and_slow;
|
||||
const Register top = t1;
|
||||
const Register mark = t2;
|
||||
const Register t = t3;
|
||||
|
||||
// Try to swing header from locked to unlocked
|
||||
// Clobbers rscratch1 when UseLSE is false
|
||||
cmpxchg(obj, hdr, t1, Assembler::xword,
|
||||
/*acquire*/ true, /*release*/ true, /*weak*/ false, t2);
|
||||
// Check if obj is top of lock-stack.
|
||||
ldrw(top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
subw(top, top, oopSize);
|
||||
ldr(t, Address(rthread, top));
|
||||
cmp(obj, t);
|
||||
br(Assembler::NE, slow);
|
||||
|
||||
// After successful unlock, pop object from lock-stack
|
||||
ldrw(t1, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
subw(t1, t1, oopSize);
|
||||
// Pop lock-stack.
|
||||
DEBUG_ONLY(str(zr, Address(rthread, top));)
|
||||
strw(top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
|
||||
// Check if recursive.
|
||||
subw(t, top, oopSize);
|
||||
ldr(t, Address(rthread, t));
|
||||
cmp(obj, t);
|
||||
br(Assembler::EQ, unlocked);
|
||||
|
||||
// Not recursive. Check header for monitor (0b10).
|
||||
ldr(mark, Address(obj, oopDesc::mark_offset_in_bytes()));
|
||||
tbnz(mark, log2i_exact(markWord::monitor_value), push_and_slow);
|
||||
|
||||
#ifdef ASSERT
|
||||
str(zr, Address(rthread, t1));
|
||||
// Check header not unlocked (0b01).
|
||||
Label not_unlocked;
|
||||
tbz(mark, log2i_exact(markWord::unlocked_value), not_unlocked);
|
||||
stop("lightweight_unlock already unlocked");
|
||||
bind(not_unlocked);
|
||||
#endif
|
||||
strw(t1, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
|
||||
// Try to unlock. Transition lock bits 0b00 => 0b01
|
||||
assert(oopDesc::mark_offset_in_bytes() == 0, "required to avoid lea");
|
||||
orr(t, mark, markWord::unlocked_value);
|
||||
cmpxchg(obj, mark, t, Assembler::xword,
|
||||
/*acquire*/ false, /*release*/ true, /*weak*/ false, noreg);
|
||||
br(Assembler::EQ, unlocked);
|
||||
|
||||
bind(push_and_slow);
|
||||
// Restore lock-stack and handle the unlock in runtime.
|
||||
DEBUG_ONLY(str(obj, Address(rthread, top));)
|
||||
addw(top, top, oopSize);
|
||||
strw(top, Address(rthread, JavaThread::lock_stack_top_offset()));
|
||||
b(slow);
|
||||
|
||||
bind(unlocked);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -720,6 +720,7 @@ public:
|
||||
|
||||
// Alignment
|
||||
void align(int modulus);
|
||||
void align(int modulus, int target);
|
||||
|
||||
// nop
|
||||
void post_call_nop();
|
||||
@@ -1247,6 +1248,8 @@ public:
|
||||
|
||||
// Emit the CompiledIC call idiom
|
||||
address ic_call(address entry, jint method_index = 0);
|
||||
static int ic_check_size();
|
||||
int ic_check(int end_alignment);
|
||||
|
||||
public:
|
||||
|
||||
@@ -1399,8 +1402,7 @@ public:
|
||||
address arrays_equals(Register a1, Register a2, Register result, Register cnt1,
|
||||
Register tmp1, Register tmp2, Register tmp3, int elem_size);
|
||||
|
||||
void string_equals(Register a1, Register a2, Register result, Register cnt1,
|
||||
int elem_size);
|
||||
void string_equals(Register a1, Register a2, Register result, Register cnt1);
|
||||
|
||||
void fill_words(Register base, Register cnt, Register value);
|
||||
address zero_words(Register base, uint64_t cnt);
|
||||
@@ -1425,11 +1427,6 @@ public:
|
||||
FloatRegister vtmp2, FloatRegister vtmp3,
|
||||
FloatRegister vtmp4, FloatRegister vtmp5);
|
||||
|
||||
void fast_log(FloatRegister vtmp0, FloatRegister vtmp1, FloatRegister vtmp2,
|
||||
FloatRegister vtmp3, FloatRegister vtmp4, FloatRegister vtmp5,
|
||||
FloatRegister tmpC1, FloatRegister tmpC2, FloatRegister tmpC3,
|
||||
FloatRegister tmpC4, Register tmp1, Register tmp2,
|
||||
Register tmp3, Register tmp4, Register tmp5);
|
||||
void generate_dsin_dcos(bool isCos, address npio2_hw, address two_over_pi,
|
||||
address pio2, address dsin_coef, address dcos_coef);
|
||||
private:
|
||||
@@ -1605,8 +1602,8 @@ public:
|
||||
// Code for java.lang.Thread::onSpinWait() intrinsic.
|
||||
void spin_wait();
|
||||
|
||||
void lightweight_lock(Register obj, Register hdr, Register t1, Register t2, Label& slow);
|
||||
void lightweight_unlock(Register obj, Register hdr, Register t1, Register t2, Label& slow);
|
||||
void lightweight_lock(Register obj, Register t1, Register t2, Register t3, Label& slow);
|
||||
void lightweight_unlock(Register obj, Register t1, Register t2, Register t3, Label& slow);
|
||||
|
||||
private:
|
||||
// Check the current thread doesn't need a cross modify fence.
|
||||
|
||||
@@ -1,366 +0,0 @@
|
||||
/* Copyright (c) 2018, Cavium. All rights reserved. (By BELLSOFT)
|
||||
* Copyright (c) 2016, 2021, Intel Corporation. All rights reserved.
|
||||
* Intel Math Library (LIBM) Source Code
|
||||
*
|
||||
* 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 "asm/assembler.inline.hpp"
|
||||
#include "macroAssembler_aarch64.hpp"
|
||||
|
||||
// Algorithm idea is taken from x86 hotspot intrinsic and adapted for AARCH64.
|
||||
//
|
||||
// For mathematical background please refer to the following literature:
|
||||
//
|
||||
// Tang, Ping-Tak Peter.
|
||||
// Table-driven implementation of the logarithm function
|
||||
// in IEEE floating-point arithmetic.
|
||||
// ACM Transactions on Mathematical Software (TOMS) 16, no. 4, 1990: 378-400.
|
||||
|
||||
/******************************************************************************/
|
||||
// ALGORITHM DESCRIPTION - LOG()
|
||||
// ---------------------
|
||||
//
|
||||
// x=2^k * mx, mx in [1,2)
|
||||
//
|
||||
// Get B~1/mx based on the output of frecpe instruction (B0)
|
||||
// B = int((B0*2^7+0.5))/2^7
|
||||
//
|
||||
// Reduced argument: r=B*mx-1.0 (computed accurately in high and low parts)
|
||||
//
|
||||
// Result: k*log(2) - log(B) + p(r) if |x-1| >= small value (2^-6) and
|
||||
// p(r) is a degree 7 polynomial
|
||||
// -log(B) read from data table (high, low parts)
|
||||
// Result is formed from high and low parts
|
||||
//
|
||||
// Special cases:
|
||||
// 1. log(NaN) = quiet NaN
|
||||
// 2. log(+INF) = that INF
|
||||
// 3. log(0) = -INF
|
||||
// 4. log(1) = +0
|
||||
// 5. log(x) = NaN if x < -0, including -INF
|
||||
//
|
||||
/******************************************************************************/
|
||||
|
||||
// Table with p(r) polynomial coefficients
|
||||
// and table representation of logarithm values (hi and low parts)
|
||||
ATTRIBUTE_ALIGNED(64) juint _L_tbl[] =
|
||||
{
|
||||
// coefficients of p(r) polynomial:
|
||||
// _coeff[]
|
||||
0x00000000UL, 0xbfd00000UL, // C1_0 = -0.25
|
||||
0x92492492UL, 0x3fc24924UL, // C1_1 = 0.14285714285714285
|
||||
0x55555555UL, 0x3fd55555UL, // C2_0 = 0.3333333333333333
|
||||
0x3d6fb175UL, 0xbfc5555eUL, // C2_1 = -0.16666772842235003
|
||||
0x00000000UL, 0xbfe00000UL, // C3_0 = -0.5
|
||||
0x9999999aUL, 0x3fc99999UL, // C3_1 = 0.2
|
||||
// _log2[]
|
||||
0xfefa3800UL, 0x3fa62e42UL, // C4_0 = 0.043321698784993146
|
||||
0x93c76730UL, 0x3ceef357UL, // C4_1 = 3.436201886692732e-15
|
||||
// _L_tbl[] with logarithm values (hi and low parts)
|
||||
0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL,
|
||||
0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL,
|
||||
0xac10c9fbUL, 0x3d2dfa63UL, 0x26bb8c00UL, 0x3fe5707aUL, 0xff3303ddUL,
|
||||
0x3d09980bUL, 0x26867800UL, 0x3fe5322eUL, 0x5d257531UL, 0x3d05ccc4UL,
|
||||
0x835a5000UL, 0x3fe4f45aUL, 0x6d93b8fbUL, 0xbd2e6c51UL, 0x6f970c00UL,
|
||||
0x3fe4b6fdUL, 0xed4c541cUL, 0x3cef7115UL, 0x27e8a400UL, 0x3fe47a15UL,
|
||||
0xf94d60aaUL, 0xbd22cb6aUL, 0xf2f92400UL, 0x3fe43d9fUL, 0x481051f7UL,
|
||||
0xbcfd984fUL, 0x2125cc00UL, 0x3fe4019cUL, 0x30f0c74cUL, 0xbd26ce79UL,
|
||||
0x0c36c000UL, 0x3fe3c608UL, 0x7cfe13c2UL, 0xbd02b736UL, 0x17197800UL,
|
||||
0x3fe38ae2UL, 0xbb5569a4UL, 0xbd218b7aUL, 0xad9d8c00UL, 0x3fe35028UL,
|
||||
0x9527e6acUL, 0x3d10b83fUL, 0x44340800UL, 0x3fe315daUL, 0xc5a0ed9cUL,
|
||||
0xbd274e93UL, 0x57b0e000UL, 0x3fe2dbf5UL, 0x07b9dc11UL, 0xbd17a6e5UL,
|
||||
0x6d0ec000UL, 0x3fe2a278UL, 0xe797882dUL, 0x3d206d2bUL, 0x1134dc00UL,
|
||||
0x3fe26962UL, 0x05226250UL, 0xbd0b61f1UL, 0xd8bebc00UL, 0x3fe230b0UL,
|
||||
0x6e48667bUL, 0x3d12fc06UL, 0x5fc61800UL, 0x3fe1f863UL, 0xc9fe81d3UL,
|
||||
0xbd2a7242UL, 0x49ae6000UL, 0x3fe1c078UL, 0xed70e667UL, 0x3cccacdeUL,
|
||||
0x40f23c00UL, 0x3fe188eeUL, 0xf8ab4650UL, 0x3d14cc4eUL, 0xf6f29800UL,
|
||||
0x3fe151c3UL, 0xa293ae49UL, 0xbd2edd97UL, 0x23c75c00UL, 0x3fe11af8UL,
|
||||
0xbb9ddcb2UL, 0xbd258647UL, 0x8611cc00UL, 0x3fe0e489UL, 0x07801742UL,
|
||||
0x3d1c2998UL, 0xe2d05400UL, 0x3fe0ae76UL, 0x887e7e27UL, 0x3d1f486bUL,
|
||||
0x0533c400UL, 0x3fe078bfUL, 0x41edf5fdUL, 0x3d268122UL, 0xbe760400UL,
|
||||
0x3fe04360UL, 0xe79539e0UL, 0xbd04c45fUL, 0xe5b20800UL, 0x3fe00e5aUL,
|
||||
0xb1727b1cUL, 0xbd053ba3UL, 0xaf7a4800UL, 0x3fdfb358UL, 0x3c164935UL,
|
||||
0x3d0085faUL, 0xee031800UL, 0x3fdf4aa7UL, 0x6f014a8bUL, 0x3d12cde5UL,
|
||||
0x56b41000UL, 0x3fdee2a1UL, 0x5a470251UL, 0x3d2f27f4UL, 0xc3ddb000UL,
|
||||
0x3fde7b42UL, 0x5372bd08UL, 0xbd246550UL, 0x1a272800UL, 0x3fde148aUL,
|
||||
0x07322938UL, 0xbd1326b2UL, 0x484c9800UL, 0x3fddae75UL, 0x60dc616aUL,
|
||||
0xbd1ea42dUL, 0x46def800UL, 0x3fdd4902UL, 0xe9a767a8UL, 0x3d235bafUL,
|
||||
0x18064800UL, 0x3fdce42fUL, 0x3ec7a6b0UL, 0xbd0797c3UL, 0xc7455800UL,
|
||||
0x3fdc7ff9UL, 0xc15249aeUL, 0xbd29b6ddUL, 0x693fa000UL, 0x3fdc1c60UL,
|
||||
0x7fe8e180UL, 0x3d2cec80UL, 0x1b80e000UL, 0x3fdbb961UL, 0xf40a666dUL,
|
||||
0x3d27d85bUL, 0x04462800UL, 0x3fdb56faUL, 0x2d841995UL, 0x3d109525UL,
|
||||
0x5248d000UL, 0x3fdaf529UL, 0x52774458UL, 0xbd217cc5UL, 0x3c8ad800UL,
|
||||
0x3fda93edUL, 0xbea77a5dUL, 0x3d1e36f2UL, 0x0224f800UL, 0x3fda3344UL,
|
||||
0x7f9d79f5UL, 0x3d23c645UL, 0xea15f000UL, 0x3fd9d32bUL, 0x10d0c0b0UL,
|
||||
0xbd26279eUL, 0x43135800UL, 0x3fd973a3UL, 0xa502d9f0UL, 0xbd152313UL,
|
||||
0x635bf800UL, 0x3fd914a8UL, 0x2ee6307dUL, 0xbd1766b5UL, 0xa88b3000UL,
|
||||
0x3fd8b639UL, 0xe5e70470UL, 0xbd205ae1UL, 0x776dc800UL, 0x3fd85855UL,
|
||||
0x3333778aUL, 0x3d2fd56fUL, 0x3bd81800UL, 0x3fd7fafaUL, 0xc812566aUL,
|
||||
0xbd272090UL, 0x687cf800UL, 0x3fd79e26UL, 0x2efd1778UL, 0x3d29ec7dUL,
|
||||
0x76c67800UL, 0x3fd741d8UL, 0x49dc60b3UL, 0x3d2d8b09UL, 0xe6af1800UL,
|
||||
0x3fd6e60eUL, 0x7c222d87UL, 0x3d172165UL, 0x3e9c6800UL, 0x3fd68ac8UL,
|
||||
0x2756eba0UL, 0x3d20a0d3UL, 0x0b3ab000UL, 0x3fd63003UL, 0xe731ae00UL,
|
||||
0xbd2db623UL, 0xdf596000UL, 0x3fd5d5bdUL, 0x08a465dcUL, 0xbd0a0b2aUL,
|
||||
0x53c8d000UL, 0x3fd57bf7UL, 0xee5d40efUL, 0x3d1fadedUL, 0x0738a000UL,
|
||||
0x3fd522aeUL, 0x8164c759UL, 0x3d2ebe70UL, 0x9e173000UL, 0x3fd4c9e0UL,
|
||||
0x1b0ad8a4UL, 0xbd2e2089UL, 0xc271c800UL, 0x3fd4718dUL, 0x0967d675UL,
|
||||
0xbd2f27ceUL, 0x23d5e800UL, 0x3fd419b4UL, 0xec90e09dUL, 0x3d08e436UL,
|
||||
0x77333000UL, 0x3fd3c252UL, 0xb606bd5cUL, 0x3d183b54UL, 0x76be1000UL,
|
||||
0x3fd36b67UL, 0xb0f177c8UL, 0x3d116ecdUL, 0xe1d36000UL, 0x3fd314f1UL,
|
||||
0xd3213cb8UL, 0xbd28e27aUL, 0x7cdc9000UL, 0x3fd2bef0UL, 0x4a5004f4UL,
|
||||
0x3d2a9cfaUL, 0x1134d800UL, 0x3fd26962UL, 0xdf5bb3b6UL, 0x3d2c93c1UL,
|
||||
0x6d0eb800UL, 0x3fd21445UL, 0xba46baeaUL, 0x3d0a87deUL, 0x635a6800UL,
|
||||
0x3fd1bf99UL, 0x5147bdb7UL, 0x3d2ca6edUL, 0xcbacf800UL, 0x3fd16b5cUL,
|
||||
0xf7a51681UL, 0x3d2b9acdUL, 0x8227e800UL, 0x3fd1178eUL, 0x63a5f01cUL,
|
||||
0xbd2c210eUL, 0x67616000UL, 0x3fd0c42dUL, 0x163ceae9UL, 0x3d27188bUL,
|
||||
0x604d5800UL, 0x3fd07138UL, 0x16ed4e91UL, 0x3cf89cdbUL, 0x5626c800UL,
|
||||
0x3fd01eaeUL, 0x1485e94aUL, 0xbd16f08cUL, 0x6cb3b000UL, 0x3fcf991cUL,
|
||||
0xca0cdf30UL, 0x3d1bcbecUL, 0xe4dd0000UL, 0x3fcef5adUL, 0x65bb8e11UL,
|
||||
0xbcca2115UL, 0xffe71000UL, 0x3fce530eUL, 0x6041f430UL, 0x3cc21227UL,
|
||||
0xb0d49000UL, 0x3fcdb13dUL, 0xf715b035UL, 0xbd2aff2aUL, 0xf2656000UL,
|
||||
0x3fcd1037UL, 0x75b6f6e4UL, 0xbd084a7eUL, 0xc6f01000UL, 0x3fcc6ffbUL,
|
||||
0xc5962bd2UL, 0xbcf1ec72UL, 0x383be000UL, 0x3fcbd087UL, 0x595412b6UL,
|
||||
0xbd2d4bc4UL, 0x575bd000UL, 0x3fcb31d8UL, 0x4eace1aaUL, 0xbd0c358dUL,
|
||||
0x3c8ae000UL, 0x3fca93edUL, 0x50562169UL, 0xbd287243UL, 0x07089000UL,
|
||||
0x3fc9f6c4UL, 0x6865817aUL, 0x3d29904dUL, 0xdcf70000UL, 0x3fc95a5aUL,
|
||||
0x58a0ff6fUL, 0x3d07f228UL, 0xeb390000UL, 0x3fc8beafUL, 0xaae92cd1UL,
|
||||
0xbd073d54UL, 0x6551a000UL, 0x3fc823c1UL, 0x9a631e83UL, 0x3d1e0ddbUL,
|
||||
0x85445000UL, 0x3fc7898dUL, 0x70914305UL, 0xbd1c6610UL, 0x8b757000UL,
|
||||
0x3fc6f012UL, 0xe59c21e1UL, 0xbd25118dUL, 0xbe8c1000UL, 0x3fc6574eUL,
|
||||
0x2c3c2e78UL, 0x3d19cf8bUL, 0x6b544000UL, 0x3fc5bf40UL, 0xeb68981cUL,
|
||||
0xbd127023UL, 0xe4a1b000UL, 0x3fc527e5UL, 0xe5697dc7UL, 0x3d2633e8UL,
|
||||
0x8333b000UL, 0x3fc4913dUL, 0x54fdb678UL, 0x3d258379UL, 0xa5993000UL,
|
||||
0x3fc3fb45UL, 0x7e6a354dUL, 0xbd2cd1d8UL, 0xb0159000UL, 0x3fc365fcUL,
|
||||
0x234b7289UL, 0x3cc62fa8UL, 0x0c868000UL, 0x3fc2d161UL, 0xcb81b4a1UL,
|
||||
0x3d039d6cUL, 0x2a49c000UL, 0x3fc23d71UL, 0x8fd3df5cUL, 0x3d100d23UL,
|
||||
0x7e23f000UL, 0x3fc1aa2bUL, 0x44389934UL, 0x3d2ca78eUL, 0x8227e000UL,
|
||||
0x3fc1178eUL, 0xce2d07f2UL, 0x3d21ef78UL, 0xb59e4000UL, 0x3fc08598UL,
|
||||
0x7009902cUL, 0xbd27e5ddUL, 0x39dbe000UL, 0x3fbfe891UL, 0x4fa10afdUL,
|
||||
0xbd2534d6UL, 0x830a2000UL, 0x3fbec739UL, 0xafe645e0UL, 0xbd2dc068UL,
|
||||
0x63844000UL, 0x3fbda727UL, 0x1fa71733UL, 0x3d1a8940UL, 0x01bc4000UL,
|
||||
0x3fbc8858UL, 0xc65aacd3UL, 0x3d2646d1UL, 0x8dad6000UL, 0x3fbb6ac8UL,
|
||||
0x2bf768e5UL, 0xbd139080UL, 0x40b1c000UL, 0x3fba4e76UL, 0xb94407c8UL,
|
||||
0xbd0e42b6UL, 0x5d594000UL, 0x3fb9335eUL, 0x3abd47daUL, 0x3d23115cUL,
|
||||
0x2f40e000UL, 0x3fb8197eUL, 0xf96ffdf7UL, 0x3d0f80dcUL, 0x0aeac000UL,
|
||||
0x3fb700d3UL, 0xa99ded32UL, 0x3cec1e8dUL, 0x4d97a000UL, 0x3fb5e95aUL,
|
||||
0x3c5d1d1eUL, 0xbd2c6906UL, 0x5d208000UL, 0x3fb4d311UL, 0x82f4e1efUL,
|
||||
0xbcf53a25UL, 0xa7d1e000UL, 0x3fb3bdf5UL, 0xa5db4ed7UL, 0x3d2cc85eUL,
|
||||
0xa4472000UL, 0x3fb2aa04UL, 0xae9c697dUL, 0xbd20b6e8UL, 0xd1466000UL,
|
||||
0x3fb1973bUL, 0x560d9e9bUL, 0xbd25325dUL, 0xb59e4000UL, 0x3fb08598UL,
|
||||
0x7009902cUL, 0xbd17e5ddUL, 0xc006c000UL, 0x3faeea31UL, 0x4fc93b7bUL,
|
||||
0xbd0e113eUL, 0xcdddc000UL, 0x3faccb73UL, 0x47d82807UL, 0xbd1a68f2UL,
|
||||
0xd0fb0000UL, 0x3faaaef2UL, 0x353bb42eUL, 0x3d20fc1aUL, 0x149fc000UL,
|
||||
0x3fa894aaUL, 0xd05a267dUL, 0xbd197995UL, 0xf2d4c000UL, 0x3fa67c94UL,
|
||||
0xec19afa2UL, 0xbd029efbUL, 0xd42e0000UL, 0x3fa466aeUL, 0x75bdfd28UL,
|
||||
0xbd2c1673UL, 0x2f8d0000UL, 0x3fa252f3UL, 0xe021b67bUL, 0x3d283e9aUL,
|
||||
0x89e74000UL, 0x3fa0415dUL, 0x5cf1d753UL, 0x3d0111c0UL, 0xec148000UL,
|
||||
0x3f9c63d2UL, 0x3f9eb2f3UL, 0x3d2578c6UL, 0x28c90000UL, 0x3f984925UL,
|
||||
0x325a0c34UL, 0xbd2aa0baUL, 0x25980000UL, 0x3f9432a9UL, 0x928637feUL,
|
||||
0x3d098139UL, 0x58938000UL, 0x3f902056UL, 0x06e2f7d2UL, 0xbd23dc5bUL,
|
||||
0xa3890000UL, 0x3f882448UL, 0xda74f640UL, 0xbd275577UL, 0x75890000UL,
|
||||
0x3f801015UL, 0x999d2be8UL, 0xbd10c76bUL, 0x59580000UL, 0x3f700805UL,
|
||||
0xcb31c67bUL, 0x3d2166afUL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
|
||||
0x80000000UL
|
||||
};
|
||||
|
||||
// BEGIN dlog PSEUDO CODE:
|
||||
// double dlog(double X) {
|
||||
// // p(r) polynomial coefficients initialized from _L_tbl table
|
||||
// double C1_0 = _L_tbl[0];
|
||||
// double C1_1 = _L_tbl[1];
|
||||
// double C2_0 = _L_tbl[2];
|
||||
// double C2_1 = _L_tbl[3];
|
||||
// double C3_0 = _L_tbl[4];
|
||||
// double C3_1 = _L_tbl[5];
|
||||
// double C4_0 = _L_tbl[6];
|
||||
// double C4_1 = _L_tbl[7];
|
||||
// // NOTE: operations with coefficients above are mostly vectorized in assembly
|
||||
// // Check corner cases first
|
||||
// if (X == 1.0d || AS_LONG_BITS(X) + 0x0010000000000000 <= 0x0010000000000000) {
|
||||
// // NOTE: AS_LONG_BITS(X) + 0x0010000000000000 <= 0x0010000000000000 means
|
||||
// // that X < 0 or X >= 0x7FF0000000000000 (0x7FF* is NaN or INF)
|
||||
// if (X < 0 || X is NaN) return NaN;
|
||||
// if (X == 1.0d) return 0.0d;
|
||||
// if (X == 0.0d) return -INFINITY;
|
||||
// if (X is INFINITY) return INFINITY;
|
||||
// }
|
||||
// // double representation is 2^exponent * mantissa
|
||||
// // split X into two multipliers: 2^exponent and 1.0 * mantissa
|
||||
// // pseudo function: zeroExponent(X) return value of X with exponent == 0
|
||||
// float vtmp5 = 1/(float)(zeroExponent(X)); // reciprocal estimate
|
||||
// // pseudo function: HI16(X) returns high 16 bits of double value
|
||||
// int hiWord = HI16(X);
|
||||
// double vtmp1 = (double) 0x77F0 << 48 | mantissa(X);
|
||||
// hiWord -= 16;
|
||||
// if (AS_LONG_BITS(hiWord) > 0x8000) {
|
||||
// // SMALL_VALUE branch
|
||||
// vtmp0 = vtmp1 = vtmp0 * AS_DOUBLE_BITS(0x47F0000000000000);
|
||||
// hiWord = HI16(vtmp1);
|
||||
// vtmp0 = AS_DOUBLE_BITS(AS_LONG_BITS(vtmp0) |= 0x3FF0000000000000);
|
||||
// vtmp5 = (double) (1/(float)vtmp0);
|
||||
// vtmp1 <<= 12;
|
||||
// vtmp1 >>= 12;
|
||||
// }
|
||||
// // MAIN branch
|
||||
// double vtmp3 = AS_LONG_BITS(vtmp1) & 0xffffe00000000000; // hi part
|
||||
// int intB0 = AS_INT_BITS(vtmp5) + 0x8000;
|
||||
// double vtmp0 = AS_DOUBLE_BITS(0xffffe00000000000 & (intB0<<29));
|
||||
// int index = (intB0 >> 16) && 0xFF;
|
||||
// double hiTableValue = _L_tbl[8+index]; // vtmp2[0]
|
||||
// double lowTableValue = _L_tbl[16+index]; // vtmp2[1]
|
||||
// vtmp5 = AS_DOUBLE_BITS(hiWord & 0x7FF0 - 0x3FE0); // 0x3FE = 1023 << 4
|
||||
// vtmp1 -= vtmp3; // low part
|
||||
// vtmp3 = vtmp3*vtmp0 - 1.0;
|
||||
// hiTableValue += C4_0 * vtmp5;
|
||||
// lowTableValue += C4_1 * vtmp5;
|
||||
// double r = vtmp1 * vtmp0 + vtmp3; // r = B*mx-1.0, computed in hi and low parts
|
||||
// vtmp0 = hiTableValue + r;
|
||||
// hiTableValue -= vtmp0;
|
||||
// double r2 = r*r;
|
||||
// double r3 = r2*r;
|
||||
// double p7 = C3_0*r2 + C2_0*r3 + C1_0*r2*r2 + C3_1*r3*r2 + C2_1*r3*r3
|
||||
// + C1_1*r3*r2*r2; // degree 7 polynomial
|
||||
// return p7 + (vtmp0 + ((r + hiTableValue) + lowTableValue));
|
||||
// }
|
||||
//
|
||||
// END dlog PSEUDO CODE
|
||||
|
||||
|
||||
// Generate log(X). X passed in register v0. Return log(X) into v0.
|
||||
// Generator parameters: 10 temporary FPU registers and temporary general
|
||||
// purpose registers
|
||||
void MacroAssembler::fast_log(FloatRegister vtmp0, FloatRegister vtmp1,
|
||||
FloatRegister vtmp2, FloatRegister vtmp3,
|
||||
FloatRegister vtmp4, FloatRegister vtmp5,
|
||||
FloatRegister C1, FloatRegister C2,
|
||||
FloatRegister C3, FloatRegister C4,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
Register tmp4, Register tmp5) {
|
||||
Label DONE, CHECK_CORNER_CASES, SMALL_VALUE, MAIN,
|
||||
CHECKED_CORNER_CASES, RETURN_MINF_OR_NAN;
|
||||
const int64_t INF_OR_NAN_PREFIX = 0x7FF0;
|
||||
const int64_t MINF_OR_MNAN_PREFIX = 0xFFF0;
|
||||
const int64_t ONE_PREFIX = 0x3FF0;
|
||||
movz(tmp2, ONE_PREFIX, 48);
|
||||
movz(tmp4, 0x0010, 48);
|
||||
fmovd(rscratch1, v0); // rscratch1 = AS_LONG_BITS(X)
|
||||
lea(rscratch2, ExternalAddress((address)_L_tbl));
|
||||
movz(tmp5, 0x7F);
|
||||
add(tmp1, rscratch1, tmp4);
|
||||
cmp(tmp2, rscratch1);
|
||||
lsr(tmp3, rscratch1, 29);
|
||||
ccmp(tmp1, tmp4, 0b1101 /* LE */, NE);
|
||||
bfm(tmp3, tmp5, 41, 8);
|
||||
fmovs(vtmp5, tmp3);
|
||||
// Load coefficients from table. All coefficients are organized to be
|
||||
// in specific order, because load below will load it in vectors to be used
|
||||
// later in vector instructions. Load will be performed in parallel while
|
||||
// branches are taken. C1 will contain vector of {C1_0, C1_1}, C2 =
|
||||
// {C2_0, C2_1}, C3 = {C3_0, C3_1}, C4 = {C4_0, C4_1}
|
||||
ld1(C1, C2, C3, C4, T2D, post(rscratch2, 64));
|
||||
br(LE, CHECK_CORNER_CASES);
|
||||
bind(CHECKED_CORNER_CASES);
|
||||
// all corner cases are handled
|
||||
frecpe(vtmp5, vtmp5, S); // vtmp5 ~= 1/vtmp5
|
||||
lsr(tmp2, rscratch1, 48);
|
||||
movz(tmp4, 0x77f0, 48);
|
||||
fmovd(vtmp4, 1.0);
|
||||
movz(tmp1, INF_OR_NAN_PREFIX, 48);
|
||||
bfm(tmp4, rscratch1, 0, 51); // tmp4 = 0x77F0 << 48 | mantissa(X)
|
||||
// vtmp1 = AS_DOUBLE_BITS(0x77F0 << 48 | mantissa(X)) == mx
|
||||
fmovd(vtmp1, tmp4);
|
||||
subw(tmp2, tmp2, 16);
|
||||
subs(zr, tmp2, 0x8000);
|
||||
br(GE, SMALL_VALUE);
|
||||
bind(MAIN);
|
||||
fmovs(tmp3, vtmp5); // int intB0 = AS_INT_BITS(B);
|
||||
mov(tmp5, 0x3FE0);
|
||||
uint64_t mask = UCONST64(0xffffe00000000000);
|
||||
mov(rscratch1, mask);
|
||||
andr(tmp2, tmp2, tmp1, LSR, 48); // hiWord & 0x7FF0
|
||||
sub(tmp2, tmp2, tmp5); // tmp2 = hiWord & 0x7FF0 - 0x3FE0
|
||||
scvtfwd(vtmp5, tmp2); // vtmp5 = (double)tmp2;
|
||||
addw(tmp3, tmp3, 0x8000); // tmp3 = B
|
||||
andr(tmp4, tmp4, rscratch1); // tmp4 == hi_part(mx)
|
||||
andr(rscratch1, rscratch1, tmp3, LSL, 29); // rscratch1 = hi_part(B)
|
||||
ubfm(tmp3, tmp3, 16, 23); // int index = (intB0 >> 16) && 0xFF
|
||||
ldrq(vtmp2, Address(rscratch2, tmp3, Address::lsl(4))); // vtmp2 = _L_tbl[index]
|
||||
// AS_LONG_BITS(vtmp1) & 0xffffe00000000000 // hi_part(mx)
|
||||
fmovd(vtmp3, tmp4);
|
||||
fmovd(vtmp0, rscratch1); // vtmp0 = hi_part(B)
|
||||
fsubd(vtmp1, vtmp1, vtmp3); // vtmp1 -= vtmp3; // low_part(mx)
|
||||
fnmsub(vtmp3, vtmp3, vtmp0, vtmp4); // vtmp3 = vtmp3*vtmp0 - vtmp4
|
||||
fmlavs(vtmp2, T2D, C4, vtmp5, 0); // vtmp2 += {C4} * vtmp5
|
||||
// vtmp1 = r = vtmp1 * vtmp0 + vtmp3 == low_part(mx) * hi_part(B) + (hi_part(mx)*hi_part(B) - 1.0)
|
||||
fmaddd(vtmp1, vtmp1, vtmp0, vtmp3);
|
||||
ins(vtmp5, D, vtmp2, 0, 1); // vtmp5 = vtmp2[1];
|
||||
faddd(vtmp0, vtmp2, vtmp1); // vtmp0 = vtmp2 + vtmp1
|
||||
fmlavs(C3, T2D, C2, vtmp1, 0); // {C3} += {C2}*vtmp1
|
||||
fsubd(vtmp2, vtmp2, vtmp0); // vtmp2 -= vtmp0
|
||||
fmuld(vtmp3, vtmp1, vtmp1); // vtmp3 = vtmp1*vtmp1
|
||||
faddd(C4, vtmp1, vtmp2); // C4[0] = vtmp1 + vtmp2
|
||||
fmlavs(C3, T2D, C1, vtmp3, 0); // {C3} += {C1}*vtmp3
|
||||
faddd(C4, C4, vtmp5); // C4 += vtmp5
|
||||
fmuld(vtmp4, vtmp3, vtmp1); // vtmp4 = vtmp3*vtmp1
|
||||
faddd(vtmp0, vtmp0, C4); // vtmp0 += C4
|
||||
fmlavs(C3, T2D, vtmp4, C3, 1); // {C3} += {vtmp4}*C3[1]
|
||||
fmaddd(vtmp0, C3, vtmp3, vtmp0); // vtmp0 = C3 * vtmp3 + vtmp0
|
||||
ret(lr);
|
||||
|
||||
block_comment("if (AS_LONG_BITS(hiWord) > 0x8000)"); {
|
||||
bind(SMALL_VALUE);
|
||||
movz(tmp2, 0x47F0, 48);
|
||||
fmovd(vtmp1, tmp2);
|
||||
fmuld(vtmp0, vtmp1, v0);
|
||||
fmovd(vtmp1, vtmp0);
|
||||
umov(tmp2, vtmp1, S, 3);
|
||||
orr(vtmp0, T16B, vtmp0, vtmp4);
|
||||
ushr(vtmp5, T2D, vtmp0, 27);
|
||||
ushr(vtmp5, T4S, vtmp5, 2);
|
||||
frecpe(vtmp5, vtmp5, S);
|
||||
shl(vtmp1, T2D, vtmp1, 12);
|
||||
ushr(vtmp1, T2D, vtmp1, 12);
|
||||
b(MAIN);
|
||||
}
|
||||
|
||||
block_comment("Corner cases"); {
|
||||
bind(RETURN_MINF_OR_NAN);
|
||||
movz(tmp1, MINF_OR_MNAN_PREFIX, 48);
|
||||
orr(rscratch1, rscratch1, tmp1);
|
||||
fmovd(v0, rscratch1);
|
||||
ret(lr);
|
||||
bind(CHECK_CORNER_CASES);
|
||||
movz(tmp1, INF_OR_NAN_PREFIX, 48);
|
||||
cmp(rscratch1, zr);
|
||||
br(LE, RETURN_MINF_OR_NAN);
|
||||
cmp(rscratch1, tmp1);
|
||||
br(GE, DONE);
|
||||
cmp(rscratch1, tmp2);
|
||||
br(NE, CHECKED_CORNER_CASES);
|
||||
fmovd(v0, 0.0);
|
||||
}
|
||||
bind(DONE);
|
||||
ret(lr);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "code/codeCache.hpp"
|
||||
#include "code/compiledIC.hpp"
|
||||
#include "code/debugInfoRec.hpp"
|
||||
#include "code/icBuffer.hpp"
|
||||
#include "code/vtableStubs.hpp"
|
||||
#include "compiler/oopMap.hpp"
|
||||
#include "gc/shared/barrierSetAssembler.hpp"
|
||||
@@ -39,7 +38,6 @@
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "nativeInst_aarch64.hpp"
|
||||
#include "oops/compiledICHolder.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
@@ -740,9 +738,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
|
||||
address c2i_unverified_entry = __ pc();
|
||||
Label skip_fixup;
|
||||
|
||||
Label ok;
|
||||
|
||||
Register holder = rscratch2;
|
||||
Register data = rscratch2;
|
||||
Register receiver = j_rarg0;
|
||||
Register tmp = r10; // A call-clobbered register not used for arg passing
|
||||
|
||||
@@ -757,17 +753,12 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
|
||||
|
||||
{
|
||||
__ block_comment("c2i_unverified_entry {");
|
||||
__ load_klass(rscratch1, receiver);
|
||||
__ ldr(tmp, Address(holder, CompiledICHolder::holder_klass_offset()));
|
||||
__ cmp(rscratch1, tmp);
|
||||
__ ldr(rmethod, Address(holder, CompiledICHolder::holder_metadata_offset()));
|
||||
__ br(Assembler::EQ, ok);
|
||||
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
|
||||
|
||||
__ bind(ok);
|
||||
// Method might have been compiled since the call site was patched to
|
||||
// interpreted; if that is the case treat it as a miss so we can get
|
||||
// the call site corrected.
|
||||
__ ic_check(1 /* end_alignment */);
|
||||
__ ldr(rmethod, Address(data, CompiledICData::speculated_method_offset()));
|
||||
|
||||
__ ldr(rscratch1, Address(rmethod, in_bytes(Method::code_offset())));
|
||||
__ cbz(rscratch1, skip_fixup);
|
||||
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
|
||||
@@ -1118,7 +1109,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
__ b(exit);
|
||||
|
||||
CodeBuffer* cbuf = masm->code_section()->outer();
|
||||
address stub = CompiledStaticCall::emit_to_interp_stub(*cbuf, tr_call);
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(*cbuf, tr_call);
|
||||
if (stub == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
@@ -1183,7 +1174,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
CodeBuffer* cbuf = masm->code_section()->outer();
|
||||
address stub = CompiledStaticCall::emit_to_interp_stub(*cbuf, tr_call);
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(*cbuf, tr_call);
|
||||
if (stub == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
@@ -1391,6 +1382,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
in_ByteSize(-1),
|
||||
oop_maps,
|
||||
exception_offset);
|
||||
if (nm == nullptr) return nm;
|
||||
if (method->is_continuation_enter_intrinsic()) {
|
||||
ContinuationEntry::set_enter_code(nm, interpreted_entry_offset);
|
||||
} else if (method->is_continuation_yield_intrinsic()) {
|
||||
@@ -1538,25 +1530,15 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
// restoring them except rfp. rfp is the only callee save register
|
||||
// as far as the interpreter and the compiler(s) are concerned.
|
||||
|
||||
|
||||
const Register ic_reg = rscratch2;
|
||||
const Register receiver = j_rarg0;
|
||||
|
||||
Label hit;
|
||||
Label exception_pending;
|
||||
|
||||
assert_different_registers(ic_reg, receiver, rscratch1);
|
||||
assert_different_registers(receiver, rscratch1);
|
||||
__ verify_oop(receiver);
|
||||
__ cmp_klass(receiver, ic_reg, rscratch1);
|
||||
__ br(Assembler::EQ, hit);
|
||||
|
||||
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
|
||||
__ ic_check(8 /* end_alignment */);
|
||||
|
||||
// Verified entry point must be aligned
|
||||
__ align(8);
|
||||
|
||||
__ bind(hit);
|
||||
|
||||
int vep_offset = ((intptr_t)__ pc()) - start;
|
||||
|
||||
// If we have to make this method not-entrant we'll overwrite its
|
||||
@@ -1814,7 +1796,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
__ br(Assembler::NE, slow_path_lock);
|
||||
} else {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "must be");
|
||||
__ ldr(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
|
||||
__ lightweight_lock(obj_reg, swap_reg, tmp, lock_tmp, slow_path_lock);
|
||||
}
|
||||
__ bind(count);
|
||||
@@ -1957,8 +1938,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
__ decrement(Address(rthread, JavaThread::held_monitor_count_offset()));
|
||||
} else {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "");
|
||||
__ ldr(old_hdr, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
|
||||
__ tbnz(old_hdr, exact_log2(markWord::monitor_value), slow_path_unlock);
|
||||
__ lightweight_unlock(obj_reg, old_hdr, swap_reg, lock_tmp, slow_path_unlock);
|
||||
__ decrement(Address(rthread, JavaThread::held_monitor_count_offset()));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2024, 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.
|
||||
*
|
||||
@@ -5327,19 +5327,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_dlog() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "dlog");
|
||||
address entry = __ pc();
|
||||
FloatRegister vtmp0 = v0, vtmp1 = v1, vtmp2 = v2, vtmp3 = v3, vtmp4 = v4,
|
||||
vtmp5 = v5, tmpC1 = v16, tmpC2 = v17, tmpC3 = v18, tmpC4 = v19;
|
||||
Register tmp1 = r0, tmp2 = r1, tmp3 = r2, tmp4 = r3, tmp5 = r4;
|
||||
__ fast_log(vtmp0, vtmp1, vtmp2, vtmp3, vtmp4, vtmp5, tmpC1, tmpC2, tmpC3,
|
||||
tmpC4, tmp1, tmp2, tmp3, tmp4, tmp5);
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
// code for comparing 16 characters of strings with Latin1 and Utf16 encoding
|
||||
void compare_string_16_x_LU(Register tmpL, Register tmpU, Label &DIFF1,
|
||||
Label &DIFF2) {
|
||||
@@ -5487,6 +5474,32 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return entry;
|
||||
}
|
||||
|
||||
// r0 = input (float16)
|
||||
// v0 = result (float)
|
||||
// v1 = temporary float register
|
||||
address generate_float16ToFloat() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "float16ToFloat");
|
||||
address entry = __ pc();
|
||||
BLOCK_COMMENT("Entry:");
|
||||
__ flt16_to_flt(v0, r0, v1);
|
||||
__ ret(lr);
|
||||
return entry;
|
||||
}
|
||||
|
||||
// v0 = input (float)
|
||||
// r0 = result (float16)
|
||||
// v1 = temporary float register
|
||||
address generate_floatToFloat16() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "floatToFloat16");
|
||||
address entry = __ pc();
|
||||
BLOCK_COMMENT("Entry:");
|
||||
__ flt_to_flt16(r0, v0, v1);
|
||||
__ ret(lr);
|
||||
return entry;
|
||||
}
|
||||
|
||||
address generate_method_entry_barrier() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier");
|
||||
@@ -8333,11 +8346,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C();
|
||||
}
|
||||
|
||||
// Disabled until JDK-8210858 is fixed
|
||||
// if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dlog)) {
|
||||
// StubRoutines::_dlog = generate_dlog();
|
||||
// }
|
||||
|
||||
if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dsin)) {
|
||||
StubRoutines::_dsin = generate_dsin_dcos(/* isCos = */ false);
|
||||
}
|
||||
@@ -8345,6 +8353,12 @@ class StubGenerator: public StubCodeGenerator {
|
||||
if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dcos)) {
|
||||
StubRoutines::_dcos = generate_dsin_dcos(/* isCos = */ true);
|
||||
}
|
||||
|
||||
if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_float16ToFloat) &&
|
||||
vmIntrinsics::is_intrinsic_available(vmIntrinsics::_floatToFloat16)) {
|
||||
StubRoutines::_hf2f = generate_float16ToFloat();
|
||||
StubRoutines::_f2hf = generate_floatToFloat16();
|
||||
}
|
||||
}
|
||||
|
||||
void generate_continuation_stubs() {
|
||||
|
||||
@@ -245,9 +245,13 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,
|
||||
__ mov_metadata(rmethod, entry);
|
||||
__ str(rmethod, Address(rthread, JavaThread::callee_target_offset())); // just in case callee is deoptimized
|
||||
|
||||
__ push_cont_fastpath(rthread);
|
||||
|
||||
__ ldr(rscratch1, Address(rmethod, Method::from_compiled_offset()));
|
||||
__ blr(rscratch1);
|
||||
|
||||
__ pop_cont_fastpath(rthread);
|
||||
|
||||
// return value shuffle
|
||||
if (!needs_return_buffer) {
|
||||
#ifdef ASSERT
|
||||
|
||||
@@ -143,11 +143,19 @@ void VM_Version::initialize() {
|
||||
}
|
||||
}
|
||||
|
||||
// Ampere CPUs: Ampere-1 and Ampere-1A
|
||||
if (_cpu == CPU_AMPERE && ((_model == CPU_MODEL_AMPERE_1) || (_model == CPU_MODEL_AMPERE_1A))) {
|
||||
// Ampere CPUs
|
||||
if (_cpu == CPU_AMPERE && ((_model == CPU_MODEL_AMPERE_1) ||
|
||||
(_model == CPU_MODEL_AMPERE_1A) ||
|
||||
(_model == CPU_MODEL_AMPERE_1B))) {
|
||||
if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) {
|
||||
FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true);
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(OnSpinWaitInst)) {
|
||||
FLAG_SET_DEFAULT(OnSpinWaitInst, "isb");
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(OnSpinWaitInstCount)) {
|
||||
FLAG_SET_DEFAULT(OnSpinWaitInstCount, 2);
|
||||
}
|
||||
}
|
||||
|
||||
// ThunderX
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, 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.
|
||||
*
|
||||
@@ -110,7 +110,8 @@ enum Ampere_CPU_Model {
|
||||
CPU_MODEL_ALTRA = 0xd0c, /* CPU implementer is CPU_ARM, Neoverse N1 */
|
||||
CPU_MODEL_ALTRAMAX = 0xd0c, /* CPU implementer is CPU_ARM, Neoverse N1 */
|
||||
CPU_MODEL_AMPERE_1 = 0xac3, /* CPU implementer is CPU_AMPERE */
|
||||
CPU_MODEL_AMPERE_1A = 0xac4 /* CPU implementer is CPU_AMPERE */
|
||||
CPU_MODEL_AMPERE_1A = 0xac4, /* CPU implementer is CPU_AMPERE */
|
||||
CPU_MODEL_AMPERE_1B = 0xac5 /* AMPERE_1B core Implements ARMv8.7 with CSSC, MTE, SM3/SM4 extensions */
|
||||
};
|
||||
|
||||
#define CPU_FEATURE_FLAGS(decl) \
|
||||
@@ -168,6 +169,7 @@ enum Ampere_CPU_Model {
|
||||
// Aarch64 supports fast class initialization checks
|
||||
static bool supports_fast_class_init_checks() { return true; }
|
||||
constexpr static bool supports_stack_watermark_barrier() { return true; }
|
||||
constexpr static bool supports_recursive_lightweight_locking() { return true; }
|
||||
|
||||
static void get_compatible_board(char *buf, int buflen);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user