mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-30 12:20:53 +01:00
Compare commits
466 Commits
jbr25.98
...
vpr/update
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e4b9ab9fe | ||
|
|
118915d36a | ||
|
|
d2f6f04b1c | ||
|
|
639ad76841 | ||
|
|
70501a7163 | ||
|
|
530538ec6e | ||
|
|
3195df109f | ||
|
|
26e637f5e8 | ||
|
|
8de23b6208 | ||
|
|
d360ca79ed | ||
|
|
8d3bfa4fe0 | ||
|
|
9018865725 | ||
|
|
bcddf0fa77 | ||
|
|
c3ab7dfff8 | ||
|
|
7c50ced913 | ||
|
|
4bbbc89bff | ||
|
|
94203b85f9 | ||
|
|
2ea60ba454 | ||
|
|
3526c6957b | ||
|
|
7f47b088d8 | ||
|
|
7e424d49f6 | ||
|
|
f18d1fd2dd | ||
|
|
7d8cc48e1e | ||
|
|
fd7a9c35f3 | ||
|
|
17e0cbad03 | ||
|
|
1dd7512bbd | ||
|
|
d3e8ef53b7 | ||
|
|
f1b6a6b4cd | ||
|
|
31757a29da | ||
|
|
aece9e0b48 | ||
|
|
a2d2229ff4 | ||
|
|
d2050cecaf | ||
|
|
d2ffd294d8 | ||
|
|
e3e335e449 | ||
|
|
1b8418aad8 | ||
|
|
84c7e312b2 | ||
|
|
754e25e8e9 | ||
|
|
f5375d45d2 | ||
|
|
975659cbac | ||
|
|
561bca6b25 | ||
|
|
be88154727 | ||
|
|
d961fae855 | ||
|
|
15e7bc5997 | ||
|
|
88809673ff | ||
|
|
cd78fb00e3 | ||
|
|
6f55e6f965 | ||
|
|
4f53417379 | ||
|
|
f36e7808f5 | ||
|
|
021bdd427f | ||
|
|
c47029b756 | ||
|
|
109f16f7cd | ||
|
|
184a465e1b | ||
|
|
d158ba0a3d | ||
|
|
fe1aafd0e6 | ||
|
|
3f35cb9022 | ||
|
|
5157aef64d | ||
|
|
13176e057f | ||
|
|
a8deb6c6dd | ||
|
|
a1d77270b4 | ||
|
|
7b486e585a | ||
|
|
64fd28006a | ||
|
|
22334869b7 | ||
|
|
5a7a4824b4 | ||
|
|
d3fede2b54 | ||
|
|
641b2ca788 | ||
|
|
20cc191e4a | ||
|
|
89acfe5f73 | ||
|
|
80bc539570 | ||
|
|
5f302fa47a | ||
|
|
c8b6f5e737 | ||
|
|
2ce6d1b10f | ||
|
|
92a00c7161 | ||
|
|
85a8c54493 | ||
|
|
405d9bf3fe | ||
|
|
2ea868167c | ||
|
|
98a9b5b028 | ||
|
|
7aa681670e | ||
|
|
897257797e | ||
|
|
624df2cbc8 | ||
|
|
82ef604109 | ||
|
|
015a810254 | ||
|
|
b2d0dbc83c | ||
|
|
34aeacd74b | ||
|
|
58f3c6cd4b | ||
|
|
27d64be387 | ||
|
|
7f04038170 | ||
|
|
4c74718a5a | ||
|
|
3f3d589d0a | ||
|
|
6cf5dd0a35 | ||
|
|
c350a93050 | ||
|
|
d790b11b71 | ||
|
|
04607d8c64 | ||
|
|
2d8093d97b | ||
|
|
bc12ae254d | ||
|
|
6548a94119 | ||
|
|
cae0639937 | ||
|
|
eb39f11e23 | ||
|
|
2e905e946c | ||
|
|
56a04bf4bb | ||
|
|
1189a34e5c | ||
|
|
bf66cdd89d | ||
|
|
2632b7cd0c | ||
|
|
97755b0b5f | ||
|
|
810a167ecf | ||
|
|
cfae44b0d2 | ||
|
|
f7574d5ab7 | ||
|
|
3052ccbddd | ||
|
|
70755c1758 | ||
|
|
ccd676d3b6 | ||
|
|
48c47a83cf | ||
|
|
fd7291ddeb | ||
|
|
c16b63da53 | ||
|
|
73ca6fb2e7 | ||
|
|
81e893dac6 | ||
|
|
d7e6471e53 | ||
|
|
f87b4b039e | ||
|
|
0d0a5570ae | ||
|
|
95574775a7 | ||
|
|
1589cd5c5b | ||
|
|
60a0d6fa91 | ||
|
|
15902d647b | ||
|
|
0e47243065 | ||
|
|
d587e632e4 | ||
|
|
cca28e69ac | ||
|
|
f14e1ff84d | ||
|
|
8dbe5153ed | ||
|
|
9bfaad73a1 | ||
|
|
e2c04903a9 | ||
|
|
6abf323fa3 | ||
|
|
26f7077a1b | ||
|
|
11222fd787 | ||
|
|
463f5d609c | ||
|
|
aa31216d20 | ||
|
|
86010cca73 | ||
|
|
3da1b7eec8 | ||
|
|
c6c56bc5f5 | ||
|
|
83ed2a919c | ||
|
|
49f16101c9 | ||
|
|
da9779c58b | ||
|
|
e05391200f | ||
|
|
a0e9c79747 | ||
|
|
43d9ce5f08 | ||
|
|
5062dfe21e | ||
|
|
04294c19d9 | ||
|
|
43a2a0e4f5 | ||
|
|
3cba7bcf3f | ||
|
|
4a3b5b5ee1 | ||
|
|
77596c3ebf | ||
|
|
01fdc6ebbb | ||
|
|
864f6ff97b | ||
|
|
088bb7fce4 | ||
|
|
12b8fb0900 | ||
|
|
ca855d5e63 | ||
|
|
3a2e400923 | ||
|
|
56bf0e115b | ||
|
|
cb5df22159 | ||
|
|
60013f13de | ||
|
|
5377bf7b7e | ||
|
|
a7c40d1bb8 | ||
|
|
dc9524f67e | ||
|
|
c352cdf0eb | ||
|
|
4fb763f278 | ||
|
|
10c5585183 | ||
|
|
ac27e8a8e5 | ||
|
|
d0397590ab | ||
|
|
162dab8f17 | ||
|
|
1dfa6ecd61 | ||
|
|
c4f0168cf1 | ||
|
|
12acfeadcb | ||
|
|
646ae0e7da | ||
|
|
bf6d863e7e | ||
|
|
9386c1986a | ||
|
|
87b297a01c | ||
|
|
7efa4a27eb | ||
|
|
1fc59ee493 | ||
|
|
c968a428d2 | ||
|
|
1b845c4470 | ||
|
|
5d40abfa81 | ||
|
|
3a60f5fcda | ||
|
|
fe961b1a90 | ||
|
|
467459c562 | ||
|
|
d6a8b8b8b4 | ||
|
|
5e0e381b1d | ||
|
|
eb3b30eae7 | ||
|
|
98a4962a6a | ||
|
|
0e6ae6d5f6 | ||
|
|
ae7b9224a8 | ||
|
|
00e21e4fad | ||
|
|
cbaefac99d | ||
|
|
1d9115a49d | ||
|
|
47534b7782 | ||
|
|
d2dd010fec | ||
|
|
63c33d115e | ||
|
|
bb23245ab2 | ||
|
|
d16e066a1d | ||
|
|
13aaf6fcf1 | ||
|
|
41f3f7997c | ||
|
|
18d18c3e93 | ||
|
|
ff21db7b43 | ||
|
|
e3933114c2 | ||
|
|
2072cf5d23 | ||
|
|
0f50f0a825 | ||
|
|
78f56e11d2 | ||
|
|
a2176cda2a | ||
|
|
dbfd4cb223 | ||
|
|
a7763d752a | ||
|
|
f5a772cbe5 | ||
|
|
7df4fe508e | ||
|
|
7b7d8ab2c5 | ||
|
|
089609db6c | ||
|
|
b9639251fd | ||
|
|
9c7d58cfa4 | ||
|
|
b3d0b2e798 | ||
|
|
714dd7e73d | ||
|
|
8608882e0b | ||
|
|
490cf2a6ff | ||
|
|
8c29fcd4c5 | ||
|
|
65bddecd80 | ||
|
|
8056da45c4 | ||
|
|
83347b9bfd | ||
|
|
bf075b71f0 | ||
|
|
b47d25dea6 | ||
|
|
c3f246c4ef | ||
|
|
5a343a13a5 | ||
|
|
d9fd896973 | ||
|
|
4cc3992f89 | ||
|
|
256e0ed085 | ||
|
|
eb9cdd0735 | ||
|
|
a5e8b4583f | ||
|
|
a0268397e3 | ||
|
|
c1371f36d8 | ||
|
|
3a3f17b766 | ||
|
|
4e6528ad68 | ||
|
|
5ac9d09b08 | ||
|
|
5dbcc3b386 | ||
|
|
0b21225ae3 | ||
|
|
ffca1c86b2 | ||
|
|
2f5839bf8d | ||
|
|
5e8befaa6d | ||
|
|
6ae876e530 | ||
|
|
fbd9ec1fd9 | ||
|
|
9125902914 | ||
|
|
f55b4c20c4 | ||
|
|
dfa8e909fa | ||
|
|
a26d949ebe | ||
|
|
5d728a613c | ||
|
|
c8c020cfbe | ||
|
|
90e55b8948 | ||
|
|
15179063c5 | ||
|
|
25ae692796 | ||
|
|
ab59a8099a | ||
|
|
8d63a1e21f | ||
|
|
6902cba835 | ||
|
|
6c6eb0bf03 | ||
|
|
20618e5b9b | ||
|
|
ad7e6864a1 | ||
|
|
852b59630c | ||
|
|
bcb661fa9e | ||
|
|
33ba9f2b4e | ||
|
|
8e227418b7 | ||
|
|
2a7dde1c86 | ||
|
|
b59463ed08 | ||
|
|
598af2f3f6 | ||
|
|
fa047c1df5 | ||
|
|
c71ed6754c | ||
|
|
abc49874d5 | ||
|
|
d3c0fca7e2 | ||
|
|
5ee10c7b5e | ||
|
|
7219483217 | ||
|
|
dde2574c26 | ||
|
|
46aa5e4547 | ||
|
|
f0ccd4b67c | ||
|
|
77f95a523c | ||
|
|
0f619d8d87 | ||
|
|
e928b6d966 | ||
|
|
c20b2f2c7a | ||
|
|
36c573e053 | ||
|
|
cf3b9fc954 | ||
|
|
9103091dcd | ||
|
|
be75986980 | ||
|
|
26e1e27631 | ||
|
|
3f87607443 | ||
|
|
9a16d275a3 | ||
|
|
bcd7d72131 | ||
|
|
34ec576d71 | ||
|
|
b182c7e5ba | ||
|
|
2ea239d7d0 | ||
|
|
88406911c3 | ||
|
|
4af9871759 | ||
|
|
e6d3da71e0 | ||
|
|
704361ab8c | ||
|
|
4da38f76f4 | ||
|
|
b47b9d2838 | ||
|
|
921854a72c | ||
|
|
9dadec6d1a | ||
|
|
2a9cf17245 | ||
|
|
3272f2f7c4 | ||
|
|
f5dd1f773b | ||
|
|
f880f1eab2 | ||
|
|
6f3ba3716b | ||
|
|
98b25a39bb | ||
|
|
0fe8ef08ff | ||
|
|
051a468007 | ||
|
|
3b119a1e0c | ||
|
|
7c7127bf8c | ||
|
|
5515295b49 | ||
|
|
debacd66d2 | ||
|
|
4288251be9 | ||
|
|
9b5be66a0c | ||
|
|
3c6f850c51 | ||
|
|
eb618a76e5 | ||
|
|
9feb6888c4 | ||
|
|
e5c4d9b1ee | ||
|
|
2357d1aa2e | ||
|
|
c246c84e1a | ||
|
|
c70a979754 | ||
|
|
79aab1b368 | ||
|
|
ff979cccfc | ||
|
|
f3dcf6dd51 | ||
|
|
33b1fb1d10 | ||
|
|
1f3c13d214 | ||
|
|
79d45515f3 | ||
|
|
0578580ddf | ||
|
|
0bbd7a85f1 | ||
|
|
6892269bc7 | ||
|
|
0c3cf6deb1 | ||
|
|
e95e7e74c6 | ||
|
|
43e9e15a78 | ||
|
|
07f9c797a0 | ||
|
|
7dc3ddd974 | ||
|
|
a3fdce3eb8 | ||
|
|
c9ff46a1db | ||
|
|
f22792bf7e | ||
|
|
b86151562f | ||
|
|
00dfb2b2ce | ||
|
|
4c46c41847 | ||
|
|
16405f4f09 | ||
|
|
9f98448896 | ||
|
|
7abc1a541d | ||
|
|
de8ea2d81c | ||
|
|
bc737fb03a | ||
|
|
f8e0ee5a18 | ||
|
|
e956e04e37 | ||
|
|
9cae1177d6 | ||
|
|
50729485cf | ||
|
|
59055bc850 | ||
|
|
7666cf1882 | ||
|
|
21a1668c8f | ||
|
|
aa937adccf | ||
|
|
1434025d74 | ||
|
|
89b841701e | ||
|
|
352117baf3 | ||
|
|
79d925f6ae | ||
|
|
e37c54a24f | ||
|
|
d96581ebec | ||
|
|
f37e00d801 | ||
|
|
a49aa72e7b | ||
|
|
5af08d88d5 | ||
|
|
87a46979f3 | ||
|
|
e7a86af739 | ||
|
|
60bfa2b12e | ||
|
|
ae6360371c | ||
|
|
f8aee55ea6 | ||
|
|
ffc581146c | ||
|
|
75930f77d2 | ||
|
|
7b721d2610 | ||
|
|
fed9ce336e | ||
|
|
14be13239e | ||
|
|
c9aea14597 | ||
|
|
d619feefc6 | ||
|
|
b38204cb12 | ||
|
|
c7fe20689c | ||
|
|
bb52503876 | ||
|
|
a9554a0e4a | ||
|
|
cbae1a769b | ||
|
|
505522f2e2 | ||
|
|
9e729bf99d | ||
|
|
14eaa570d1 | ||
|
|
54b65e514f | ||
|
|
86e6947981 | ||
|
|
0f7c371233 | ||
|
|
e880107619 | ||
|
|
39743018bb | ||
|
|
ceb2dcb091 | ||
|
|
fe29694915 | ||
|
|
a336a88057 | ||
|
|
6c753b5d49 | ||
|
|
099394e43a | ||
|
|
71241ecc59 | ||
|
|
377b0902b1 | ||
|
|
04fdd306ab | ||
|
|
06b190878a | ||
|
|
b8cfdc28dc | ||
|
|
1e7ae9c8d5 | ||
|
|
0c7f8b1b00 | ||
|
|
3f53deeaf2 | ||
|
|
a2f4b57bb2 | ||
|
|
a471e942e4 | ||
|
|
d5ceea456c | ||
|
|
e6cb0a1b56 | ||
|
|
ab7a9f8f87 | ||
|
|
6b43d1a768 | ||
|
|
dfe78a31f5 | ||
|
|
e48181b9aa | ||
|
|
f0d54ab6e5 | ||
|
|
20b513f189 | ||
|
|
58f04296e7 | ||
|
|
7a2d71329d | ||
|
|
54276e869b | ||
|
|
75dcbe8f20 | ||
|
|
37b13e2f17 | ||
|
|
bde37c774a | ||
|
|
8dfd14f671 | ||
|
|
49bed44184 | ||
|
|
a270d9e6a3 | ||
|
|
11e3c06ba0 | ||
|
|
95c6f7c37f | ||
|
|
c4f2b64d19 | ||
|
|
9a6415585d | ||
|
|
51d7cd2afb | ||
|
|
3c66bdc1e9 | ||
|
|
e65cb43ba1 | ||
|
|
7c84fbe810 | ||
|
|
6c47534225 | ||
|
|
ffde0964ef | ||
|
|
d0299a4c6a | ||
|
|
1186447190 | ||
|
|
4eab05ccd9 | ||
|
|
74b4df4496 | ||
|
|
8f660e630c | ||
|
|
4bd1551dc4 | ||
|
|
4879508145 | ||
|
|
84473294fb | ||
|
|
57e694c1ae | ||
|
|
12e0466566 | ||
|
|
02ab184c01 | ||
|
|
bf7dea965a | ||
|
|
58b3c7ed57 | ||
|
|
631811837d | ||
|
|
3ff4b846da | ||
|
|
b175e32148 | ||
|
|
8e287c09a0 | ||
|
|
28f9408b29 | ||
|
|
338f1df777 | ||
|
|
690349f07c | ||
|
|
fe1d8d85ae | ||
|
|
a1d745006b | ||
|
|
2d345b9aab | ||
|
|
d720f1ee4a | ||
|
|
a2fa35786e | ||
|
|
e66f996829 | ||
|
|
8569475930 | ||
|
|
7433067506 | ||
|
|
2e517af41f | ||
|
|
a54096f118 | ||
|
|
d3f0367a19 | ||
|
|
14f93c154e | ||
|
|
07a1aee823 | ||
|
|
3345eb8e16 | ||
|
|
987f5f9561 | ||
|
|
bfa8e73dcf | ||
|
|
5493f14d30 | ||
|
|
09ecf47329 | ||
|
|
b3becb25a2 | ||
|
|
8bad559f91 | ||
|
|
43cbf9a7db |
5
.github/README.md
vendored
5
.github/README.md
vendored
@@ -161,7 +161,7 @@ Install the necessary tools, libraries, and headers with:
|
||||
```
|
||||
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev \
|
||||
libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev libspeechd-dev libwayland-dev \
|
||||
wayland-protocols libxkbcommon-x11-0
|
||||
wayland-protocols libxkbcommon-x11-0 libdbus-1-dev
|
||||
```
|
||||
Get Java 23 (for instance, [Azul Zulu Builds of OpenJDK 23](https://www.azul.com/downloads/?version=java-23&os=linux&package=jdk#zulu)).
|
||||
|
||||
@@ -254,8 +254,7 @@ configurations (for example, `release` and `fastdebug`), supply the `--conf <con
|
||||
Then open the git root directory as a project in IDEA.
|
||||
|
||||
## Contributing
|
||||
We are happy to receive your pull requests!
|
||||
Before you submit one, please sign our [Contributor License Agreement (CLA)](https://www.jetbrains.com/agreements/cla/).
|
||||
Please contribute your changes through [OpenJDK](https://dev.java/contribute/openjdk/).
|
||||
|
||||
## Resources
|
||||
* [JetBrains Runtime on GitHub](https://github.com/JetBrains/JetBrainsRuntime).
|
||||
|
||||
2
.github/actions/build-jtreg/action.yml
vendored
2
.github/actions/build-jtreg/action.yml
vendored
@@ -65,4 +65,4 @@ runs:
|
||||
with:
|
||||
name: bundles-jtreg-${{ steps.version.outputs.value }}
|
||||
path: jtreg/installed
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
8
.github/actions/get-msys2/action.yml
vendored
8
.github/actions/get-msys2/action.yml
vendored
@@ -30,15 +30,15 @@ runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: 'Install MSYS2'
|
||||
uses: msys2/setup-msys2@v2.22.0
|
||||
id: msys2
|
||||
uses: msys2/setup-msys2@v2.28.0
|
||||
with:
|
||||
install: 'autoconf tar unzip zip make'
|
||||
path-type: minimal
|
||||
location: ${{ runner.tool_cache }}/msys2
|
||||
release: false
|
||||
|
||||
# We can't run bash until this is completed, so stick with pwsh
|
||||
- name: 'Set MSYS2 path'
|
||||
run: |
|
||||
# Prepend msys2/msys64/usr/bin to the PATH
|
||||
echo "$env:RUNNER_TOOL_CACHE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH
|
||||
echo "${{ steps.msys2.outputs.msys2-location }}/usr/bin" >> $env:GITHUB_PATH
|
||||
shell: pwsh
|
||||
|
||||
2
.github/actions/upload-bundles/action.yml
vendored
2
.github/actions/upload-bundles/action.yml
vendored
@@ -91,5 +91,5 @@ runs:
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}${{ inputs.bundle-suffix }}
|
||||
path: bundles
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
if: steps.bundles.outputs.bundles-found == 'true'
|
||||
|
||||
6
.github/workflows/build-alpine-linux.yml
vendored
6
.github/workflows/build-alpine-linux.yml
vendored
@@ -51,6 +51,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@@ -104,9 +108,11 @@ jobs:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
18
.github/workflows/build-cross-compile.yml
vendored
18
.github/workflows/build-cross-compile.yml
vendored
@@ -40,6 +40,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build-cross-compile:
|
||||
@@ -60,33 +64,33 @@ jobs:
|
||||
gnu-arch: aarch64
|
||||
debian-arch: arm64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: arm
|
||||
gnu-arch: arm
|
||||
debian-arch: armhf
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
gnu-abi: eabihf
|
||||
- target-cpu: s390x
|
||||
gnu-arch: s390x
|
||||
debian-arch: s390x
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: ppc64le
|
||||
gnu-arch: powerpc64le
|
||||
debian-arch: ppc64el
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: riscv64
|
||||
gnu-arch: riscv64
|
||||
debian-arch: riscv64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: sid
|
||||
tolerate-sysroot-errors: true
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
@@ -189,4 +193,4 @@ jobs:
|
||||
with:
|
||||
make-target: 'hotspot ${{ inputs.make-arguments }}'
|
||||
platform: linux-${{ matrix.target-cpu }}
|
||||
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
|
||||
if: ((steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true') && inputs.dry-run == false)
|
||||
|
||||
6
.github/workflows/build-linux.yml
vendored
6
.github/workflows/build-linux.yml
vendored
@@ -61,6 +61,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
bundle-suffix:
|
||||
required: false
|
||||
type: string
|
||||
@@ -139,6 +143,7 @@ jobs:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
@@ -147,3 +152,4 @@ jobs:
|
||||
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
|
||||
bundle-suffix: ${{ inputs.bundle-suffix }}
|
||||
static-suffix: ${{ inputs.static-suffix }}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
6
.github/workflows/build-macos.yml
vendored
6
.github/workflows/build-macos.yml
vendored
@@ -54,6 +54,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
@@ -118,9 +122,11 @@ jobs:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
7
.github/workflows/build-windows.yml
vendored
7
.github/workflows/build-windows.yml
vendored
@@ -54,6 +54,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
env:
|
||||
# These are needed to make the MSYS2 bash work properly
|
||||
@@ -139,6 +143,7 @@ jobs:
|
||||
# Set PATH to "", so just GITHUB_PATH is included
|
||||
PATH: ''
|
||||
shell: env /usr/bin/bash --login -eo pipefail {0}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
@@ -147,9 +152,11 @@ jobs:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
70
.github/workflows/main.yml
vendored
70
.github/workflows/main.yml
vendored
@@ -28,9 +28,7 @@ name: 'OpenJDK GHA Sanity Checks'
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
- pr/*
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platforms:
|
||||
@@ -43,6 +41,9 @@ on:
|
||||
make-arguments:
|
||||
description: 'Additional make arguments'
|
||||
required: false
|
||||
dry-run:
|
||||
description: 'Dry run: skip actual builds and tests'
|
||||
required: false
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -70,6 +71,7 @@ jobs:
|
||||
windows-x64: ${{ steps.include.outputs.windows-x64 }}
|
||||
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
|
||||
docs: ${{ steps.include.outputs.docs }}
|
||||
dry-run: ${{ steps.include.outputs.dry-run }}
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the scripts'
|
||||
@@ -143,6 +145,35 @@ jobs:
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
function check_dry_run() {
|
||||
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
|
||||
# Take the user-specified one.
|
||||
echo '${{ github.event.inputs.dry-run }}'
|
||||
return
|
||||
elif [[ $GITHUB_EVENT_NAME == push ]]; then
|
||||
# Cut out the real branch name
|
||||
BRANCH=${GITHUB_REF##*/}
|
||||
|
||||
# Dry run rebuilds the caches in current branch, so they can be reused
|
||||
# for any child PR branches. Because of this, we want to trigger this
|
||||
# workflow in master branch, so that actual PR branches can use the cache.
|
||||
# This workflow would trigger every time contributors sync their master
|
||||
# branches in their personal forks.
|
||||
if [[ $BRANCH == "master" ]]; then
|
||||
echo 'true'
|
||||
return
|
||||
fi
|
||||
|
||||
# ...same for stabilization branches
|
||||
if [[ $BRANCH == "main" ]]; then
|
||||
echo 'true'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
|
||||
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
|
||||
@@ -152,6 +183,7 @@ jobs:
|
||||
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
|
||||
echo "dry-run=$(check_dry_run)" >> $GITHUB_OUTPUT
|
||||
|
||||
###
|
||||
### Build jobs
|
||||
@@ -166,6 +198,7 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64 == 'true'
|
||||
|
||||
build-linux-x64-hs-nopch:
|
||||
@@ -180,6 +213,7 @@ jobs:
|
||||
extra-conf-options: '--disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-zero:
|
||||
@@ -194,6 +228,7 @@ jobs:
|
||||
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-minimal:
|
||||
@@ -208,6 +243,7 @@ jobs:
|
||||
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-optimized:
|
||||
@@ -223,6 +259,7 @@ jobs:
|
||||
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-static:
|
||||
@@ -238,6 +275,7 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
static-suffix: "-static"
|
||||
if: needs.prepare.outputs.linux-x64 == 'true'
|
||||
|
||||
@@ -254,6 +292,7 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
# Upload static libs bundles separately to avoid interference with normal linux-x64 bundle.
|
||||
# This bundle is not used by testing jobs, but downstreams use it to check that
|
||||
# dependent projects, e.g. libgraal, builds fine.
|
||||
@@ -268,6 +307,7 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-alpine-linux-x64:
|
||||
@@ -278,6 +318,7 @@ jobs:
|
||||
platform: alpine-linux-x64
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.alpine-linux-x64 == 'true'
|
||||
|
||||
build-macos-x64:
|
||||
@@ -286,10 +327,11 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
runs-on: 'macos-13'
|
||||
xcode-toolset-version: '14.3.1'
|
||||
runs-on: 'macos-15-intel'
|
||||
xcode-toolset-version: '16.4'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.macos-x64 == 'true'
|
||||
|
||||
build-macos-aarch64:
|
||||
@@ -298,10 +340,11 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
runs-on: 'macos-14'
|
||||
xcode-toolset-version: '15.4'
|
||||
runs-on: 'macos-15'
|
||||
xcode-toolset-version: '16.4'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.macos-aarch64 == 'true'
|
||||
|
||||
build-windows-x64:
|
||||
@@ -314,6 +357,7 @@ jobs:
|
||||
msvc-toolset-architecture: 'x86.x64'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.windows-x64 == 'true'
|
||||
|
||||
build-windows-aarch64:
|
||||
@@ -328,6 +372,7 @@ jobs:
|
||||
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.windows-aarch64 == 'true'
|
||||
|
||||
build-docs:
|
||||
@@ -344,6 +389,7 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.docs == 'true'
|
||||
|
||||
###
|
||||
@@ -353,17 +399,20 @@ jobs:
|
||||
test-linux-x64:
|
||||
name: linux-x64
|
||||
needs:
|
||||
- prepare
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
debug-suffix: -debug
|
||||
|
||||
test-linux-x64-static:
|
||||
name: linux-x64-static
|
||||
needs:
|
||||
- prepare
|
||||
- build-linux-x64
|
||||
- build-linux-x64-static
|
||||
uses: ./.github/workflows/test.yml
|
||||
@@ -371,27 +420,32 @@ jobs:
|
||||
platform: linux-x64
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
static-suffix: "-static"
|
||||
|
||||
test-macos-aarch64:
|
||||
name: macos-aarch64
|
||||
needs:
|
||||
- prepare
|
||||
- build-macos-aarch64
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
bootjdk-platform: macos-aarch64
|
||||
runs-on: macos-14
|
||||
xcode-toolset-version: '15.4'
|
||||
runs-on: macos-15
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
xcode-toolset-version: '16.4'
|
||||
debug-suffix: -debug
|
||||
|
||||
test-windows-x64:
|
||||
name: windows-x64
|
||||
needs:
|
||||
- prepare
|
||||
- build-windows-x64
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
bootjdk-platform: windows-x64
|
||||
runs-on: windows-2025
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
debug-suffix: -debug
|
||||
|
||||
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@@ -40,6 +40,10 @@ on:
|
||||
xcode-toolset-version:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
debug-suffix:
|
||||
required: false
|
||||
type: string
|
||||
@@ -147,6 +151,7 @@ jobs:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: ${{ matrix.debug-suffix }}
|
||||
static-suffix: ${{ inputs.static-suffix }}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Install dependencies'
|
||||
run: |
|
||||
@@ -199,6 +204,7 @@ jobs:
|
||||
&& bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY" "$GITHUB_OUTPUT"
|
||||
env:
|
||||
PATH: ${{ steps.path.outputs.value }}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
# This is a separate step, since if the markdown from a step gets bigger than
|
||||
# 1024 kB it is skipped, but then the short summary above is still generated
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[general]
|
||||
project=jdk
|
||||
project=jdk-updates
|
||||
jbs=JDK
|
||||
version=25
|
||||
version=25.0.2
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists,copyright
|
||||
|
||||
@@ -47,8 +47,8 @@ VERSION_PATCH=$(getVersionProp "DEFAULT_VERSION_PATCH")
|
||||
[[ $VERSION_UPDATE = 0 ]] && JBSDK_VERSION="$VERSION_FEATURE" || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}"
|
||||
[[ $VERSION_PATCH = 0 ]] || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}.${VERSION_PATCH}"
|
||||
echo "##teamcity[setParameter name='env.JBSDK_VERSION' value='${JBSDK_VERSION}']"
|
||||
tag_prefix="jdk-"
|
||||
OPENJDK_TAG=$(git tag -l | grep "$tag_prefix$JBSDK_VERSION" | grep -v ga | sort -t "-" -k 2 -V -f | tail -n 1)
|
||||
tag_prefix="jbr-"
|
||||
OPENJDK_TAG=$(git tag -l "${tag_prefix}${JBSDK_VERSION}*")
|
||||
JDK_BUILD_NUMBER=$(echo $OPENJDK_TAG | awk -F "-|[+]" '{print $3}')
|
||||
[ -z $JDK_BUILD_NUMBER ] && JDK_BUILD_NUMBER=1
|
||||
re='^[0-9]+$'
|
||||
@@ -109,6 +109,12 @@ else
|
||||
WITH_BUNDLED_FREETYPE=""
|
||||
fi
|
||||
|
||||
if [ "$bundle_type" == "lb" ]; then
|
||||
WITH_VULKAN=""
|
||||
else
|
||||
WITH_VULKAN="--with-vulkan"
|
||||
fi
|
||||
|
||||
REPRODUCIBLE_BUILD_OPTS="--with-source-date=$SOURCE_DATE_EPOCH
|
||||
--with-hotspot-build-time=$BUILD_TIME
|
||||
--with-copyright-year=$COPYRIGHT_YEAR
|
||||
@@ -132,6 +138,20 @@ function zip_native_debug_symbols() {
|
||||
tar --no-recursion --null -T - -czf ../"$jbr_diz_name".tar.gz) || do_exit $?
|
||||
}
|
||||
|
||||
function zip_native_debug_symbols_win() {
|
||||
image_bundle_path=$(echo $1 | cut -d"/" -f-4)
|
||||
jdk_name=$(echo $1 | cut -d"/" -f5)
|
||||
jbr_pdb_name=$2
|
||||
|
||||
[ -d "$jbr_pdb_name" ] && rm -rf $jbr_pdb_name
|
||||
mkdir $jbr_pdb_name
|
||||
|
||||
rsync_target="../../../../"$jbr_pdb_name
|
||||
(cd $image_bundle_path && find . -name '*' -exec rsync -R {} $rsync_target \;)
|
||||
|
||||
(/usr/bin/zip -r $jbr_pdb_name.zip $jbr_pdb_name) || do_exit $?
|
||||
}
|
||||
|
||||
function do_exit() {
|
||||
exit_code=$1
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
|
||||
@@ -27,6 +27,12 @@ JCEF_PATH=${JCEF_PATH:=./jcef_linux_aarch64}
|
||||
function do_configure {
|
||||
|
||||
GTK_SHELL_PATH=/gtk-shell.xml
|
||||
WAYLAND_PROTOCOLS_PATH=/opt/wayland-protocols
|
||||
WITH_WAYLAND_PROTOCOLS=
|
||||
|
||||
if [ -e "$WAYLAND_PROTOCOLS_PATH" ]; then
|
||||
WITH_WAYLAND_PROTOCOLS="--with-wayland-protocols=$WAYLAND_PROTOCOLS_PATH"
|
||||
fi
|
||||
|
||||
if [ ! -e $GTK_SHELL_PATH ]; then
|
||||
echo $GTK_SHELL_PATH" does not exist"
|
||||
@@ -48,12 +54,13 @@ function do_configure {
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--enable-cds=yes \
|
||||
--with-gtk-shell1-protocol=$GTK_SHELL_PATH \
|
||||
--with-vulkan \
|
||||
$WITH_VULKAN \
|
||||
$DISABLE_WARNINGS_AS_ERRORS \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
$WITH_BUNDLED_FREETYPE \
|
||||
$WITH_WAYLAND_PROTOCOLS \
|
||||
|| do_exit $?
|
||||
}
|
||||
|
||||
@@ -95,7 +102,7 @@ function create_image_bundle {
|
||||
mv release "$IMAGES_DIR"/"$__root_dir"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
|
||||
zip_native_debug_symbols $IMAGES_DIR/symbols "${JBR}_diz"
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
@@ -126,6 +133,11 @@ case "$bundle_type" in
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
do_maketest=1
|
||||
;;
|
||||
"lb")
|
||||
do_reset_changes=1
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
do_maketest=1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
|
||||
@@ -34,6 +34,12 @@ function do_configure {
|
||||
fi
|
||||
|
||||
GTK_SHELL_PATH=/gtk-shell.xml
|
||||
WAYLAND_PROTOCOLS_PATH=/opt/wayland-protocols
|
||||
WITH_WAYLAND_PROTOCOLS=
|
||||
|
||||
if [ -e "$WAYLAND_PROTOCOLS_PATH" ]; then
|
||||
WITH_WAYLAND_PROTOCOLS="--with-wayland-protocols=$WAYLAND_PROTOCOLS_PATH"
|
||||
fi
|
||||
|
||||
if [ ! -e $GTK_SHELL_PATH ]; then
|
||||
echo $GTK_SHELL_PATH" does not exist"
|
||||
@@ -44,12 +50,6 @@ function do_configure {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${JCEF_BUILD_LEGACY:-}" ]; then
|
||||
WITH_VULKAN=""
|
||||
else
|
||||
WITH_VULKAN="--with-vulkan"
|
||||
fi
|
||||
|
||||
sh configure \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
@@ -68,6 +68,7 @@ function do_configure {
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
$WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
|
||||
$WITH_BUNDLED_FREETYPE \
|
||||
$WITH_WAYLAND_PROTOCOLS \
|
||||
|| do_exit $?
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ function create_image_bundle {
|
||||
mv release "$IMAGES_DIR"/"$__root_dir"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
|
||||
zip_native_debug_symbols $IMAGES_DIR/symbols "${JBR}_diz"
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
@@ -149,6 +150,11 @@ case "$bundle_type" in
|
||||
jbrsdk_name_postfix="_${bundle_type}"
|
||||
do_maketest=1
|
||||
;;
|
||||
"lb")
|
||||
do_reset_changes=1
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
do_maketest=1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
jbrsdk_name_postfix="_${bundle_type}"
|
||||
@@ -179,7 +185,7 @@ JBRSDK_BUNDLE=jbrsdk
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
if [ "$bundle_type" == "jcef" ]; then
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "lb" ]; then
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
@@ -192,7 +198,7 @@ create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" ||
|
||||
|
||||
# create sdk image bundle
|
||||
modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
|
||||
if [ "$bundle_type" == "jcef" ]|| [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "lb" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
@@ -69,7 +69,7 @@ function create_image_bundle {
|
||||
mv release "$IMAGES_DIR"/"$__root_dir"/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
|
||||
zip_native_debug_symbols $IMAGES_DIR/symbols "${JBR}_diz"
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
|
||||
@@ -96,7 +96,7 @@ function create_image_bundle {
|
||||
mv release $JRE_CONTENTS/Home/release
|
||||
cp $IMAGES_DIR/jdk-bundle/jdk-$JBSDK_VERSION.jdk/Contents/Home/lib/src.zip $JRE_CONTENTS/Home/lib
|
||||
copy_jmods "$__modules" "$__modules_path" "$JRE_CONTENTS"/Home/jmods
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk-bundle/jdk-$JBSDK_VERSION.jdk "${JBR}_diz"
|
||||
zip_native_debug_symbols $IMAGES_DIR/symbols "${JBR}_diz"
|
||||
fi
|
||||
|
||||
if [ "$bundle_type" == "jcef" ]; then
|
||||
|
||||
@@ -80,6 +80,7 @@ function create_image_bundle {
|
||||
rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
zip_native_debug_symbols_win $IMAGES_DIR/symbols "${__root_dir}_pdb"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ function create_image_bundle {
|
||||
rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
zip_native_debug_symbols_win $IMAGES_DIR/symbols "${__root_dir}_pdb"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ function create_image_bundle {
|
||||
rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
zip_native_debug_symbols_win $IMAGES_DIR/symbols "${__root_dir}_pdb"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,13 @@ else ifeq ($(call isBuildOsEnv, windows.wsl1 windows.wsl2), true)
|
||||
else
|
||||
M2_REPO := $(HOME)/.m2/repository
|
||||
endif
|
||||
M2_ARTIFACT := $(M2_REPO)/com/jetbrains/jbr-api/SNAPSHOT
|
||||
M2_ARTIFACT := $(M2_REPO)/org/jetbrains/runtime/jbr-api/SNAPSHOT
|
||||
M2_POM_CONTENT := \
|
||||
<?xml version="1.0" encoding="UTF-8"?> \
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" \
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> \
|
||||
<modelVersion>4.0.0</modelVersion> \
|
||||
<groupId>com.jetbrains</groupId> \
|
||||
<groupId>org.jetbrains.runtime</groupId> \
|
||||
<artifactId>jbr-api</artifactId> \
|
||||
<version>SNAPSHOT</version> \
|
||||
</project> \
|
||||
@@ -65,7 +65,8 @@ jbr-api:
|
||||
$(MKDIR) -p $(M2_ARTIFACT); \
|
||||
$(ECHO) '$(M2_POM_CONTENT)' > $(M2_ARTIFACT)/$(ARTIFACT_NAME).pom; \
|
||||
$(CP) "$(JBR_API_DIR)/out/$(ARTIFACT_NAME).jar" "$(M2_ARTIFACT)"; \
|
||||
$(ECHO) "Installed into local Maven repository as com.jetbrains:jbr-api:SNAPSHOT"; \
|
||||
$(ECHO) "Installed into local Maven repository as org.jetbrains.runtime:jbr-api:SNAPSHOT"; \
|
||||
cd "$(M2_ARTIFACT)" && sha256sum --binary "$(ARTIFACT_NAME).jar"; \
|
||||
else \
|
||||
$(ECHO) "No Maven repository found at $(M2_REPO) - skipping local installation"; \
|
||||
fi
|
||||
|
||||
@@ -116,6 +116,9 @@ else ifeq ($(call isTargetOs, aix), true)
|
||||
$(eval STATIC_LIB_EXPORT_FILES += $(lib).exp) \
|
||||
)
|
||||
STATIC_LIBS := -Wl,-bexpfull $(STATIC_LIB_FILES) $(addprefix -Wl$(COMMA)-bE:, $(STATIC_LIB_EXPORT_FILES))
|
||||
ifeq ($(DEBUG_LEVEL), slowdebug)
|
||||
STATIC_LIBS += -Wl,-bbigtoc
|
||||
endif
|
||||
else
|
||||
$(error Unsupported platform)
|
||||
endif
|
||||
|
||||
@@ -378,7 +378,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
|
||||
# Check if it's a GNU date compatible version
|
||||
AC_MSG_CHECKING([if date is a GNU compatible version])
|
||||
check_date=`$DATE --version 2>&1 | $GREP "GNU\|BusyBox"`
|
||||
check_date=`$DATE --version 2>&1 | $GREP "GNU\|BusyBox\|uutils"`
|
||||
if test "x$check_date" != x; then
|
||||
AC_MSG_RESULT([yes])
|
||||
IS_GNU_DATE=yes
|
||||
|
||||
@@ -446,6 +446,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
# Force en-US environment
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA])
|
||||
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=off:stdout],boot_jdk_jvmargs,[$JAVA])
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=warning:stderr],boot_jdk_jvmargs,[$JAVA])
|
||||
|
||||
if test "x$BOOTJDK_USE_LOCAL_CDS" = xtrue; then
|
||||
# Use our own CDS archive
|
||||
UTIL_ADD_JVM_ARG_IF_OK([$boot_jdk_cds_args -Xshare:auto],boot_jdk_jvmargs,[$JAVA])
|
||||
|
||||
@@ -221,6 +221,9 @@ JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER
|
||||
# LeakSanitizer
|
||||
JDKOPT_SETUP_LEAK_SANITIZER
|
||||
|
||||
# Setup static analyzer
|
||||
JDKOPT_SETUP_STATIC_ANALYZER
|
||||
|
||||
# Fallback linker
|
||||
# This needs to go before 'LIB_DETERMINE_DEPENDENCIES'
|
||||
JDKOPT_SETUP_FALLBACK_LINKER
|
||||
|
||||
@@ -736,8 +736,15 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc"
|
||||
elif test "x$FLAGS_CPU" = xppc64le; then
|
||||
# Little endian machine uses ELFv2 ABI.
|
||||
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
|
||||
$1_CFLAGS_CPU="-mcpu=power8 -mtune=power10"
|
||||
# Use Power8 for target cpu, this is the first CPU to support PPC64 LE with ELFv2 ABI.
|
||||
# Use Power10 for tuning target, this is supported by gcc >= 10
|
||||
POWER_TUNE_VERSION="-mtune=power10"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${POWER_TUNE_VERSION}],
|
||||
IF_FALSE: [
|
||||
POWER_TUNE_VERSION="-mtune=power8"
|
||||
]
|
||||
)
|
||||
$1_CFLAGS_CPU="-mcpu=power8 ${POWER_TUNE_VERSION}"
|
||||
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2"
|
||||
fi
|
||||
elif test "x$FLAGS_CPU" = xs390x; then
|
||||
@@ -933,7 +940,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
# ACLE and this flag are required to build the aarch64 SVE related functions in
|
||||
# libvectormath. Apple Silicon does not support SVE; use macOS as a proxy for
|
||||
# that check.
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xaarch64" && test "x$OPENJDK_TARGET_CPU" = "xlinux"; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xaarch64" && test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
AC_LANG_PUSH(C)
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
@@ -947,6 +954,17 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
$2SVE_CFLAGS="-march=armv8-a+sve"
|
||||
# Switching the initialization mode with gcc from 'pattern' to 'zero'
|
||||
# avoids the use of unsupported `__builtin_clear_padding` for variable
|
||||
# length aggregates
|
||||
if test "x$DEBUG_LEVEL" != xrelease && test "x$TOOLCHAIN_TYPE" = xgcc ; then
|
||||
INIT_ZERO_FLAG="-ftrivial-auto-var-init=zero"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$INIT_ZERO_FLAG],
|
||||
IF_TRUE: [
|
||||
$2SVE_CFLAGS="${$2SVE_CFLAGS} $INIT_ZERO_FLAG"
|
||||
]
|
||||
)
|
||||
fi
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
@@ -504,6 +504,31 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
AC_SUBST(ASAN_ENABLED)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Static analyzer
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_ANALYZER],
|
||||
[
|
||||
UTIL_ARG_ENABLE(NAME: static-analyzer, DEFAULT: false, RESULT: STATIC_ANALYZER_ENABLED,
|
||||
DESC: [enable the GCC static analyzer],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if static analyzer is available])
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
],
|
||||
IF_ENABLED: [
|
||||
STATIC_ANALYZER_CFLAGS="-fanalyzer -Wno-analyzer-fd-leak"
|
||||
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $STATIC_ANALYZER_CFLAGS"
|
||||
CFLAGS_JDKEXE="$CFLAGS_JDKEXE $STATIC_ANALYZER_CFLAGS"
|
||||
])
|
||||
AC_SUBST(STATIC_ANALYZER_ENABLED)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# LeakSanitizer
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
################################################################################
|
||||
|
||||
# Minimum supported versions
|
||||
JTREG_MINIMUM_VERSION=7.5.1
|
||||
JTREG_MINIMUM_VERSION=8
|
||||
GTEST_MINIMUM_VERSION=1.14.0
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -89,7 +89,7 @@ AC_DEFUN_ONCE([LIB_SETUP_VULKAN],
|
||||
if (test "x${with_vulkan_shader_compiler}" = x || test "x${with_vulkan_shader_compiler}" = xglslc); then
|
||||
UTIL_LOOKUP_PROGS(GLSLC, glslc)
|
||||
SHADER_COMPILER="$GLSLC"
|
||||
VULKAN_SHADER_COMPILER="glslc --target-env=vulkan1.2 -mfmt=num -o"
|
||||
VULKAN_SHADER_COMPILER="glslc --target-env=vulkan1.2 -mfmt=num"
|
||||
fi
|
||||
|
||||
# Check glslangValidator
|
||||
@@ -97,7 +97,8 @@ AC_DEFUN_ONCE([LIB_SETUP_VULKAN],
|
||||
test "x$SHADER_COMPILER" = x; then
|
||||
UTIL_LOOKUP_PROGS(GLSLANG, glslangValidator)
|
||||
SHADER_COMPILER="$GLSLANG"
|
||||
VULKAN_SHADER_COMPILER="glslangValidator --target-env vulkan1.2 -x -o"
|
||||
# Newer glslangValidator could use -P\"\#extension GL_GOOGLE_include_directive: require\"
|
||||
VULKAN_SHADER_COMPILER="glslangValidator --target-env vulkan1.2 -x"
|
||||
fi
|
||||
|
||||
if test "x$SHADER_COMPILER" = x; then
|
||||
|
||||
@@ -40,12 +40,23 @@ AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
|
||||
[specify the root directory for the wayland protocols xml files])])
|
||||
AC_ARG_WITH(gtk-shell1-protocol, [AS_HELP_STRING([--with-gtk-shell1-protocol],
|
||||
[specify the path to the gtk-shell1 Wayland protocol xml file])])
|
||||
AC_ARG_WITH(xkbcommon, [AS_HELP_STRING([--with-xkbcommon],
|
||||
[specify prefix directory for the xkbcommon package
|
||||
(expecting the headers under PATH/include)])])
|
||||
AC_ARG_WITH(xkbcommon-include, [AS_HELP_STRING([--with-xkbcommon-include],
|
||||
[specify directory for the xkbcommon include files])])
|
||||
AC_ARG_WITH(xkbcommon-lib, [AS_HELP_STRING([--with-xkbcommon-lib],
|
||||
[specify directory for the xkbcommon library files])])
|
||||
|
||||
if test "x$NEEDS_LIB_WAYLAND" = xfalse; then
|
||||
if (test "x${with_wayland}" != x && test "x${with_wayland}" != xno) || \
|
||||
(test "x${with_wayland_include}" != x && test "x${with_wayland_include}" != xno); then
|
||||
AC_MSG_WARN([[wayland not used, so --with-wayland[-*] is ignored]])
|
||||
fi
|
||||
if (test "x${with_xkbcommon}" != x && test "x${with_xkbcommon}" != xno) || \
|
||||
(test "x${with_xkbcommon_include}" != x && test "x${with_xkbcommon_include}" != xno); then
|
||||
AC_MSG_WARN([[wayland not used, so --with-xkbcommon[-*] is ignored]])
|
||||
fi
|
||||
WAYLAND_CFLAGS=
|
||||
WAYLAND_LIBS=
|
||||
else
|
||||
@@ -55,6 +66,9 @@ AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
|
||||
if test "x${with_wayland}" = xno || test "x${with_wayland_include}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of wayland. Remove the --without-wayland option.])
|
||||
fi
|
||||
if test "x${with_xkbcommon}" = xno || test "x${with_xkbcommon_include}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of xkbcommon. Remove the --without-xkbcommon option.])
|
||||
fi
|
||||
|
||||
if test "x${with_wayland}" != x; then
|
||||
AC_MSG_CHECKING([for wayland headers])
|
||||
@@ -121,7 +135,52 @@ AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
|
||||
HELP_MSG_MISSING_DEPENDENCY([wayland])
|
||||
AC_MSG_ERROR([Could not find wayland! $HELP_MSG ])
|
||||
fi
|
||||
WAYLAND_CFLAGS="${WAYLAND_INCLUDES} ${WAYLAND_DEFINES}"
|
||||
|
||||
XKBCOMMON_FOUND=no
|
||||
XKBCOMMON_INCLUDES=
|
||||
XKBCOMMON_LIBS=-lxkbcommon
|
||||
if test "x${with_xkbcommon}" != x; then
|
||||
AC_MSG_CHECKING([for xkbcommon headers])
|
||||
if test -s "${with_xkbcommon}/include/xkbcommon/xkbcommon.h" &&
|
||||
test -s "${with_xkbcommon}/include/xkbcommon/xkbcommon-compose.h"; then
|
||||
XKBCOMMON_INCLUDES="-I${with_xkbcommon}/include"
|
||||
XKBCOMMON_LIBS="-L${with_xkbcommon}/lib ${XKBCOMMON_LIBS}"
|
||||
|
||||
XKBCOMMON_FOUND=yes
|
||||
AC_MSG_RESULT([$XKBCOMMON_FOUND])
|
||||
else
|
||||
AC_MSG_ERROR([Can't find 'include/xkbcommon/xkbcommon.h' and 'include/xkbcommon/xkbcommon-compose.h' under ${with_xkbcommon} given with the --with-xkbcommon option.])
|
||||
fi
|
||||
fi
|
||||
if test "x${with_xkbcommon_include}" != x; then
|
||||
AC_MSG_CHECKING([for xkbcommon headers])
|
||||
if test -s "${with_xkbcommon_include}/xkbcommon/xkbcommon.h" &&
|
||||
test -s "${with_xkbcommon_include}/xkbcommon/xkbcommon-compose.h"; then
|
||||
XKBCOMMON_INCLUDES="-I${with_xkbcommon_include}"
|
||||
XKBCOMMON_FOUND=yes
|
||||
AC_MSG_RESULT([$XKBCOMMON_FOUND])
|
||||
else
|
||||
AC_MSG_ERROR([Can't find 'include/xkbcommon/xkbcommon.h' and 'include/xkbcommon/xkbcommon-compose.h' under ${with_xkbcommon_include} given with the --with-xkbcommon-include option.])
|
||||
fi
|
||||
fi
|
||||
if test "x${with_xkbcommon_lib}" != x; then
|
||||
XKBCOMMON_LIBS="-L${with_xkbcommon_lib} ${XKBCOMMON_LIBS}"
|
||||
fi
|
||||
|
||||
if test "x${XKBCOMMON_FOUND}" != xyes; then
|
||||
AC_CHECK_HEADERS([xkbcommon/xkbcommon.h xkbcommon/xkbcommon-compose.h],
|
||||
[ XKBCOMMON_FOUND=yes ],
|
||||
[ XKBCOMMON_FOUND=no; break ]
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$XKBCOMMON_FOUND" != xyes; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([xkbcommon])
|
||||
AC_MSG_ERROR([Could not find xkbcommon! $HELP_MSG ])
|
||||
fi
|
||||
|
||||
WAYLAND_LIBS="${WAYLAND_LIBS} ${XKBCOMMON_LIBS}"
|
||||
WAYLAND_CFLAGS="${WAYLAND_INCLUDES} ${XKBCOMMON_INCLUDES} ${WAYLAND_DEFINES}"
|
||||
fi
|
||||
AC_SUBST(WAYLAND_CFLAGS)
|
||||
AC_SUBST(WAYLAND_LIBS)
|
||||
|
||||
@@ -166,12 +166,8 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBPTHREAD"
|
||||
fi
|
||||
|
||||
# librt for legacy clock_gettime
|
||||
# librt - for timers (timer_* functions)
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
# Hotspot needs to link librt to get the clock_* functions.
|
||||
# But once our supported minimum build and runtime platform
|
||||
# has glibc 2.17, this can be removed as the functions are
|
||||
# in libc.
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
|
||||
fi
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# Versions and download locations for dependencies used by GitHub Actions (GHA)
|
||||
|
||||
GTEST_VERSION=1.14.0
|
||||
JTREG_VERSION=7.5.1+1
|
||||
JTREG_VERSION=8+2
|
||||
|
||||
LINUX_X64_BOOT_JDK_EXT=tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk24/1f9ff9062db4449d8ca828c504ffae90/36/GPL/openjdk-24_linux-x64_bin.tar.gz
|
||||
|
||||
@@ -1174,9 +1174,9 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
jtreg: {
|
||||
server: "jpg",
|
||||
product: "jtreg",
|
||||
version: "7.5.1",
|
||||
build_number: "1",
|
||||
file: "bundles/jtreg-7.5.1+1.zip",
|
||||
version: "8",
|
||||
build_number: "2",
|
||||
file: "bundles/jtreg-8+2.zip",
|
||||
environment_name: "JT_HOME",
|
||||
environment_path: input.get("jtreg", "home_path") + "/bin",
|
||||
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
|
||||
DEFAULT_VERSION_FEATURE=25
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=0
|
||||
DEFAULT_VERSION_UPDATE=2
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_EXTRA1=0
|
||||
DEFAULT_VERSION_EXTRA2=0
|
||||
DEFAULT_VERSION_EXTRA3=0
|
||||
DEFAULT_VERSION_DATE=2025-09-16
|
||||
DEFAULT_VERSION_DATE=2026-01-20
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=69 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_VERSION_DOCS_API_SINCE=11
|
||||
|
||||
@@ -62,5 +62,8 @@
|
||||
// thread so it is easier to track down. You can override these options by setting the environment
|
||||
// variable UBSAN_OPTIONS.
|
||||
ATTRIBUTE_DEFAULT_VISIBILITY ATTRIBUTE_USED const char* __ubsan_default_options() {
|
||||
return "halt_on_error=1,print_stacktrace=1" _LLVM_SYMBOLIZER(LLVM_SYMBOLIZER);
|
||||
return "halt_on_error=1,"
|
||||
"handle_segv=0,"
|
||||
"handle_sigbus=0,"
|
||||
"print_stacktrace=1" _LLVM_SYMBOLIZER(LLVM_SYMBOLIZER);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ define CreateFromTemplate
|
||||
$(SED) -e 's!{{TOPDIR}}!$(call SedEscape,$(call FixPath,$(TOPDIR)))!g' \
|
||||
-e 's!{{TOPDIR_RELATIVE}}!$(call SedEscape,$(call FixPath,$(strip \
|
||||
$(call RelativePath,$(OUTPUTDIR),$(TOPDIR)))))!g' \
|
||||
-e 's!{{TOPDIR_BASE}}!$(notdir $(TOPDIR))!g' \
|
||||
-e 's!{{OUTPUT_BASE}}!$(notdir $(OUTPUTDIR))!g' \
|
||||
-e 's!{{WORKSPACE_ROOT}}!$(call SedEscape,$(call FixPath,$(WORKSPACE_ROOT)))!g' \
|
||||
-e 's!{{OUTPUTDIR}}!$(call SedEscape,$(call FixPath,$(OUTPUTDIR)))!g' \
|
||||
-e 's!{{CONF_NAME}}!$(CONF_NAME)!g' \
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"name": "Source root",
|
||||
"name": "Source root ({{TOPDIR_BASE}})",
|
||||
"path": "{{TOPDIR}}"
|
||||
},
|
||||
// {{EXTRA_WORKSPACE_ROOT}}
|
||||
{
|
||||
"name": "Build artifacts",
|
||||
"name": "Build artifacts ({{OUTPUT_BASE}})",
|
||||
"path": "{{OUTPUTDIR}}"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -542,10 +542,10 @@ class Bundle {
|
||||
if (pattern != null) {
|
||||
// Perform date-time format pattern conversion which is
|
||||
// applicable to both SimpleDateFormat and j.t.f.DateTimeFormatter.
|
||||
String transPattern = translateDateFormatLetters(calendarType, pattern, this::convertDateTimePatternLetter);
|
||||
String transPattern = translateDateFormatLetters(calendarType, key, pattern, this::convertDateTimePatternLetter);
|
||||
dateTimePatterns.add(i, transPattern);
|
||||
// Additionally, perform SDF specific date-time format pattern conversion
|
||||
sdfPatterns.add(i, translateDateFormatLetters(calendarType, transPattern, this::convertSDFLetter));
|
||||
sdfPatterns.add(i, translateDateFormatLetters(calendarType, key, transPattern, this::convertSDFLetter));
|
||||
} else {
|
||||
dateTimePatterns.add(i, null);
|
||||
sdfPatterns.add(i, null);
|
||||
@@ -568,7 +568,7 @@ class Bundle {
|
||||
}
|
||||
}
|
||||
|
||||
private String translateDateFormatLetters(CalendarType calendarType, String cldrFormat, ConvertDateTimeLetters converter) {
|
||||
private String translateDateFormatLetters(CalendarType calendarType, String patternKey, String cldrFormat, ConvertDateTimeLetters converter) {
|
||||
String pattern = cldrFormat;
|
||||
int length = pattern.length();
|
||||
boolean inQuote = false;
|
||||
@@ -587,7 +587,7 @@ class Bundle {
|
||||
if (nextc == '\'') {
|
||||
i++;
|
||||
if (count != 0) {
|
||||
converter.convert(calendarType, lastLetter, count, jrePattern);
|
||||
converter.convert(calendarType, patternKey, lastLetter, count, jrePattern);
|
||||
lastLetter = 0;
|
||||
count = 0;
|
||||
}
|
||||
@@ -597,7 +597,7 @@ class Bundle {
|
||||
}
|
||||
if (!inQuote) {
|
||||
if (count != 0) {
|
||||
converter.convert(calendarType, lastLetter, count, jrePattern);
|
||||
converter.convert(calendarType, patternKey, lastLetter, count, jrePattern);
|
||||
lastLetter = 0;
|
||||
count = 0;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ class Bundle {
|
||||
}
|
||||
if (!(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')) {
|
||||
if (count != 0) {
|
||||
converter.convert(calendarType, lastLetter, count, jrePattern);
|
||||
converter.convert(calendarType, patternKey, lastLetter, count, jrePattern);
|
||||
lastLetter = 0;
|
||||
count = 0;
|
||||
}
|
||||
@@ -627,7 +627,7 @@ class Bundle {
|
||||
count++;
|
||||
continue;
|
||||
}
|
||||
converter.convert(calendarType, lastLetter, count, jrePattern);
|
||||
converter.convert(calendarType, patternKey, lastLetter, count, jrePattern);
|
||||
lastLetter = c;
|
||||
count = 1;
|
||||
}
|
||||
@@ -637,7 +637,7 @@ class Bundle {
|
||||
}
|
||||
|
||||
if (count != 0) {
|
||||
converter.convert(calendarType, lastLetter, count, jrePattern);
|
||||
converter.convert(calendarType, patternKey, lastLetter, count, jrePattern);
|
||||
}
|
||||
if (cldrFormat.contentEquals(jrePattern)) {
|
||||
return cldrFormat;
|
||||
@@ -661,7 +661,7 @@ class Bundle {
|
||||
* on the support given by the SimpleDateFormat and the j.t.f.DateTimeFormatter
|
||||
* for date-time formatting.
|
||||
*/
|
||||
private void convertDateTimePatternLetter(CalendarType calendarType, char cldrLetter, int count, StringBuilder sb) {
|
||||
private void convertDateTimePatternLetter(CalendarType calendarType, String patternKey, char cldrLetter, int count, StringBuilder sb) {
|
||||
switch (cldrLetter) {
|
||||
case 'u':
|
||||
case 'U':
|
||||
@@ -683,7 +683,7 @@ class Bundle {
|
||||
* Perform a conversion of CLDR date-time format pattern letter which is
|
||||
* specific to the SimpleDateFormat.
|
||||
*/
|
||||
private void convertSDFLetter(CalendarType calendarType, char cldrLetter, int count, StringBuilder sb) {
|
||||
private void convertSDFLetter(CalendarType calendarType, String patternKey, char cldrLetter, int count, StringBuilder sb) {
|
||||
switch (cldrLetter) {
|
||||
case 'G':
|
||||
if (calendarType != CalendarType.GREGORIAN) {
|
||||
@@ -722,6 +722,17 @@ class Bundle {
|
||||
appendN('z', count, sb);
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
// If the style is FULL/LONG for a Japanese Calendar, make the
|
||||
// count == 4 for Gan-nen
|
||||
if (calendarType == CalendarType.JAPANESE &&
|
||||
(patternKey.contains("full-") ||
|
||||
patternKey.contains("long-"))) {
|
||||
count = 4;
|
||||
}
|
||||
appendN(cldrLetter, count, sb);
|
||||
break;
|
||||
|
||||
case 'Z':
|
||||
if (count == 4 || count == 5) {
|
||||
sb.append("XXX");
|
||||
@@ -767,6 +778,7 @@ class Bundle {
|
||||
.collect(Collectors.toMap(
|
||||
e -> calendarPrefix + e.getKey(),
|
||||
e -> translateDateFormatLetters(calendarType,
|
||||
e.getKey(),
|
||||
(String)e.getValue(),
|
||||
this::convertDateTimePatternLetter)
|
||||
))
|
||||
@@ -775,7 +787,7 @@ class Bundle {
|
||||
|
||||
@FunctionalInterface
|
||||
private interface ConvertDateTimeLetters {
|
||||
void convert(CalendarType calendarType, char cldrLetter, int count, StringBuilder sb);
|
||||
void convert(CalendarType calendarType, String patternKey, char cldrLetter, int count, StringBuilder sb);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,6 +65,7 @@ ifeq ($(call isTargetOs, aix), false)
|
||||
CXXFLAGS := $(LIBJSOUND_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := undef unused-variable, \
|
||||
DISABLED_WARNINGS_clang := undef unused-variable, \
|
||||
DISABLED_WARNINGS_clang_PLATFORM_API_MacOSX_Ports.cpp := vla-cxx-extension, \
|
||||
DISABLED_WARNINGS_clang_PLATFORM_API_MacOSX_MidiUtils.c := \
|
||||
unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_clang_DirectAudioDevice.c := unused-function, \
|
||||
|
||||
@@ -33,8 +33,12 @@ WAYLAND_BASIC_PROTOCOL_FILES := \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/stable/viewporter/viewporter.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/stable/xdg-shell/xdg-shell.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/staging/xdg-activation/xdg-activation-v1.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/unstable/primary-selection/primary-selection-unstable-v1.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/unstable/xdg-output/xdg-output-unstable-v1.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/unstable/relative-pointer/relative-pointer-unstable-v1.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/unstable/text-input/text-input-unstable-v3.xml \
|
||||
$(WAYLAND_PROTOCOLS_ROOT)/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml \
|
||||
$(GTK_SHELL1_PROTOCOL_PATH) \
|
||||
#
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/launcher \
|
||||
#
|
||||
endif
|
||||
|
||||
@@ -102,6 +101,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
LIBAWT_VERSIONINFO_RESOURCE := \
|
||||
$(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
|
||||
LIBAWT_EXTRA_HEADER_DIRS += $(TOPDIR)/src/java.base/windows/native/launcher
|
||||
endif
|
||||
|
||||
# This is the object file to provide the dladdr API, which is not
|
||||
@@ -199,7 +199,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
-framework OpenGL, \
|
||||
LIBS_windows := advapi32.lib comctl32.lib comdlg32.lib delayimp.lib \
|
||||
gdi32.lib gdiplus.lib imm32.lib kernel32.lib ole32.lib shell32.lib shlwapi.lib \
|
||||
user32.lib uuid.lib winmm.lib winspool.lib dwmapi.lib $(A11Y_NVDA_ANNOUNCING_LIBS), \
|
||||
user32.lib uuid.lib winmm.lib winspool.lib dwmapi.lib $(A11Y_NVDA_ANNOUNCING_LIBS) oleacc.lib, \
|
||||
VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $(LIBAWT_RCFLAGS), \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_STATIC_EXCLUDE_OBJS), \
|
||||
@@ -220,7 +220,7 @@ endif
|
||||
# Compile Vulkan shaders
|
||||
define compile-spirv
|
||||
$(call MakeTargetDir)
|
||||
$(VULKAN_SHADER_COMPILER) '$(call DecodeSpace, $@)' '$(call DecodeSpace, $<)'
|
||||
$(VULKAN_SHADER_COMPILER) -D$(call uppercase,$(patsubst .%,STAGE_%,$(suffix $<))) -o '$(call DecodeSpace, $@)' '$(call DecodeSpace, $<)'
|
||||
endef
|
||||
spirv-name = $(strip $1).h
|
||||
|
||||
|
||||
@@ -179,7 +179,8 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
|
||||
-DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0
|
||||
-DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0 \
|
||||
-DPNG_LOONGARCH_LSX_OPT=0
|
||||
|
||||
ifeq ($(call isTargetOs, linux)+$(call isTargetCpuArch, ppc), true+true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
|
||||
|
||||
@@ -68,7 +68,7 @@ $(eval $(call SetupJdkExecutable, BUILD_JPACKAGEAPPLAUNCHER, \
|
||||
-rpath @executable_path/../PlugIns/, \
|
||||
LIBS_macosx := -framework Cocoa, \
|
||||
LIBS_windows := msi.lib ole32.lib shell32.lib shlwapi.lib user32.lib, \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_linux := $(LIBDL) $(LIBPTHREAD), \
|
||||
MANIFEST := $(JAVA_MANIFEST), \
|
||||
MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS) \
|
||||
))
|
||||
@@ -97,7 +97,7 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_tstrings.cpp := format-nonliteral, \
|
||||
LD_SET_ORIGIN := false, \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_linux := $(LIBDL) $(LIBPTHREAD), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJPACKAGEAPPLAUNCHERAUX)
|
||||
|
||||
@@ -64,7 +64,8 @@ BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libLogEventTest := java.base:libjava
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c \
|
||||
libExplicitAttach.c libImplicitAttach.c \
|
||||
exelauncher.c
|
||||
exelauncher.c \
|
||||
libChangeSignalDisposition.c exePrintSignalDisposition.c
|
||||
|
||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeNullCallerTest := $(LIBCXX)
|
||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib
|
||||
@@ -153,6 +154,7 @@ ifneq ($(filter build-test-jdk-jtreg-native, $(MAKECMDGOALS)), )
|
||||
OUTPUT_DIR := $(BUILD_JDK_JTREG_OUTPUT_DIR), \
|
||||
EXCLUDE := $(BUILD_JDK_JTREG_EXCLUDE), \
|
||||
EXTRA_FILES := $(BUILD_JDK_JTREG_EXTRA_FILES), \
|
||||
LIBS := $(LIBPTHREAD), \
|
||||
))
|
||||
endif
|
||||
|
||||
|
||||
@@ -3454,10 +3454,6 @@ encode %{
|
||||
__ mov(dst_reg, (uint64_t)1);
|
||||
%}
|
||||
|
||||
enc_class aarch64_enc_mov_byte_map_base(iRegP dst, immByteMapBase src) %{
|
||||
__ load_byte_map_base($dst$$Register);
|
||||
%}
|
||||
|
||||
enc_class aarch64_enc_mov_n(iRegN dst, immN src) %{
|
||||
Register dst_reg = as_Register($dst$$reg);
|
||||
address con = (address)$src$$constant;
|
||||
@@ -4554,20 +4550,6 @@ operand immP_1()
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
// Card Table Byte Map Base
|
||||
operand immByteMapBase()
|
||||
%{
|
||||
// Get base of card map
|
||||
predicate(BarrierSet::barrier_set()->is_a(BarrierSet::CardTableBarrierSet) &&
|
||||
SHENANDOAHGC_ONLY(!BarrierSet::barrier_set()->is_a(BarrierSet::ShenandoahBarrierSet) &&)
|
||||
(CardTable::CardValue*)n->get_ptr() == ((CardTableBarrierSet*)(BarrierSet::barrier_set()))->card_table()->byte_map_base());
|
||||
match(ConP);
|
||||
|
||||
op_cost(0);
|
||||
format %{ %}
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
// Float and Double operands
|
||||
// Double Immediate
|
||||
operand immD()
|
||||
@@ -6854,20 +6836,6 @@ instruct loadConP1(iRegPNoSp dst, immP_1 con)
|
||||
ins_pipe(ialu_imm);
|
||||
%}
|
||||
|
||||
// Load Byte Map Base Constant
|
||||
|
||||
instruct loadByteMapBase(iRegPNoSp dst, immByteMapBase con)
|
||||
%{
|
||||
match(Set dst con);
|
||||
|
||||
ins_cost(INSN_COST);
|
||||
format %{ "adr $dst, $con\t# Byte Map Base" %}
|
||||
|
||||
ins_encode(aarch64_enc_mov_byte_map_base(dst, con));
|
||||
|
||||
ins_pipe(ialu_imm);
|
||||
%}
|
||||
|
||||
// Load Narrow Pointer Constant
|
||||
|
||||
instruct loadConN(iRegNNoSp dst, immN con)
|
||||
|
||||
@@ -1824,3 +1824,14 @@ void InterpreterMacroAssembler::load_method_entry(Register cache, Register index
|
||||
add(cache, cache, Array<ResolvedMethodEntry>::base_offset_in_bytes());
|
||||
lea(cache, Address(cache, index));
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
void InterpreterMacroAssembler::verify_field_offset(Register reg) {
|
||||
// Verify the field offset is not in the header, implicitly checks for 0
|
||||
Label L;
|
||||
subs(zr, reg, oopDesc::base_offset_in_bytes());
|
||||
br(Assembler::GE, L);
|
||||
stop("bad field offset");
|
||||
bind(L);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -319,6 +319,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
void load_resolved_indy_entry(Register cache, Register index);
|
||||
void load_field_entry(Register cache, Register index, int bcp_offset = 1);
|
||||
void load_method_entry(Register cache, Register index, int bcp_offset = 1);
|
||||
|
||||
void verify_field_offset(Register reg) NOT_DEBUG_RETURN;
|
||||
};
|
||||
|
||||
#endif // CPU_AARCH64_INTERP_MASM_AARCH64_HPP
|
||||
|
||||
@@ -39,24 +39,22 @@ public:
|
||||
// 3 - restoring an old state (javaCalls)
|
||||
|
||||
void clear(void) {
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and only observers the thread its running on.
|
||||
|
||||
// clearing _last_Java_sp must be first
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
_last_Java_fp = nullptr;
|
||||
_last_Java_pc = nullptr;
|
||||
}
|
||||
|
||||
void copy(JavaFrameAnchor* src) {
|
||||
// In order to make sure the transition state is valid for "this"
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and only observers the thread its running on.
|
||||
|
||||
// We must clear _last_Java_sp before copying the rest of the new data
|
||||
//
|
||||
// Hack Alert: Temporary bugfix for 4717480/4721647
|
||||
// To act like previous version (pd_cache_state) don't null _last_Java_sp
|
||||
// unless the value is changing
|
||||
//
|
||||
if (_last_Java_sp != src->_last_Java_sp) {
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
}
|
||||
_last_Java_fp = src->_last_Java_fp;
|
||||
_last_Java_pc = src->_last_Java_pc;
|
||||
|
||||
@@ -639,12 +639,13 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
last_java_sp = esp;
|
||||
}
|
||||
|
||||
str(last_java_sp, Address(rthread, JavaThread::last_Java_sp_offset()));
|
||||
|
||||
// last_java_fp is optional
|
||||
if (last_java_fp->is_valid()) {
|
||||
str(last_java_fp, Address(rthread, JavaThread::last_Java_fp_offset()));
|
||||
}
|
||||
|
||||
// We must set sp last.
|
||||
str(last_java_sp, Address(rthread, JavaThread::last_Java_sp_offset()));
|
||||
}
|
||||
|
||||
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
|
||||
@@ -168,6 +168,7 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
|
||||
Register temp_reg, bool load_bc_into_bc_reg/*=true*/,
|
||||
int byte_no)
|
||||
{
|
||||
assert_different_registers(bc_reg, temp_reg);
|
||||
if (!RewriteBytecodes) return;
|
||||
Label L_patch_done;
|
||||
|
||||
@@ -231,9 +232,12 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
|
||||
__ stop("patching the wrong bytecode");
|
||||
__ bind(L_okay);
|
||||
#endif
|
||||
|
||||
// patch bytecode
|
||||
__ strb(bc_reg, at_bcp(0));
|
||||
// Patch bytecode with release store to coordinate with ResolvedFieldEntry loads
|
||||
// in fast bytecode codelets. load_field_entry has a memory barrier that gains
|
||||
// the needed ordering, together with control dependency on entering the fast codelet
|
||||
// itself.
|
||||
__ lea(temp_reg, at_bcp(0));
|
||||
__ stlrb(bc_reg, temp_reg);
|
||||
__ bind(L_patch_done);
|
||||
}
|
||||
|
||||
@@ -3082,6 +3086,7 @@ void TemplateTable::fast_storefield(TosState state)
|
||||
|
||||
// R1: field offset, R2: field holder, R5: flags
|
||||
load_resolved_field_entry(r2, r2, noreg, r1, r5);
|
||||
__ verify_field_offset(r1);
|
||||
|
||||
{
|
||||
Label notVolatile;
|
||||
@@ -3171,6 +3176,8 @@ void TemplateTable::fast_accessfield(TosState state)
|
||||
__ load_field_entry(r2, r1);
|
||||
|
||||
__ load_sized_value(r1, Address(r2, in_bytes(ResolvedFieldEntry::field_offset_offset())), sizeof(int), true /*is_signed*/);
|
||||
__ verify_field_offset(r1);
|
||||
|
||||
__ load_unsigned_byte(r3, Address(r2, in_bytes(ResolvedFieldEntry::flags_offset())));
|
||||
|
||||
// r0: object
|
||||
@@ -3237,7 +3244,9 @@ void TemplateTable::fast_xaccess(TosState state)
|
||||
__ ldr(r0, aaddress(0));
|
||||
// access constant pool cache
|
||||
__ load_field_entry(r2, r3, 2);
|
||||
|
||||
__ load_sized_value(r1, Address(r2, in_bytes(ResolvedFieldEntry::field_offset_offset())), sizeof(int), true /*is_signed*/);
|
||||
__ verify_field_offset(r1);
|
||||
|
||||
// 8179954: We need to make sure that the code generated for
|
||||
// volatile accesses forms a sequentially-consistent set of
|
||||
|
||||
@@ -100,7 +100,7 @@ int AbstractInterpreter::size_activation(int max_stack,
|
||||
// It is also guaranteed to be walkable even though it is in a skeletal state
|
||||
//
|
||||
// is_top_frame == true:
|
||||
// We're processing the *oldest* interpreter frame!
|
||||
// We're processing the *youngest* interpreter frame on top of stack!
|
||||
//
|
||||
// pop_frame_extra_args:
|
||||
// If this is != 0 we are returning to a deoptimized frame by popping
|
||||
@@ -131,8 +131,9 @@ void AbstractInterpreter::layout_activation(Method* method,
|
||||
#ifdef ASSERT
|
||||
if (caller->is_interpreted_frame()) {
|
||||
assert(locals_base <= caller->interpreter_frame_expression_stack(), "bad placement");
|
||||
const int caller_abi_bytesize = (is_bottom_frame ? frame::top_ijava_frame_abi_size : frame::parent_ijava_frame_abi_size);
|
||||
intptr_t* l2 = caller->sp() + method->max_locals() - 1 + (caller_abi_bytesize / Interpreter::stackElementSize);
|
||||
// If the bottom frame's caller was thawed then it has frame::java_abi (aka parent_ijava_frame_abi).
|
||||
// With an ordinary i2c call it would keep the larger frame::top_ijava_frame_abi
|
||||
intptr_t* l2 = caller->sp() + method->max_locals() - 1 + (frame::parent_ijava_frame_abi_size / Interpreter::stackElementSize);
|
||||
assert(locals_base >= l2, "bad placement");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -133,8 +133,13 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
void get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size);
|
||||
|
||||
void load_resolved_indy_entry(Register cache, Register index);
|
||||
void load_field_entry(Register cache, Register index, int bcp_offset = 1);
|
||||
void load_method_entry(Register cache, Register index, int bcp_offset = 1);
|
||||
void load_field_or_method_entry(bool is_method, Register cache, Register index, int bcp_offset, bool for_fast_bytecode);
|
||||
void load_field_entry(Register cache, Register index, int bcp_offset = 1, bool for_fast_bytecode = false) {
|
||||
load_field_or_method_entry(false, cache, index, bcp_offset, for_fast_bytecode);
|
||||
}
|
||||
void load_method_entry(Register cache, Register index, int bcp_offset = 1, bool for_fast_bytecode = false) {
|
||||
load_field_or_method_entry(true, cache, index, bcp_offset, for_fast_bytecode);
|
||||
}
|
||||
|
||||
void get_u4(Register Rdst, Register Rsrc, int offset, signedOrNot is_signed);
|
||||
|
||||
|
||||
@@ -468,33 +468,33 @@ void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Registe
|
||||
add(cache, cache, index);
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::load_field_entry(Register cache, Register index, int bcp_offset) {
|
||||
void InterpreterMacroAssembler::load_field_or_method_entry(bool is_method, Register cache, Register index, int bcp_offset, bool for_fast_bytecode) {
|
||||
const int entry_size = is_method ? sizeof(ResolvedMethodEntry) : sizeof(ResolvedFieldEntry),
|
||||
base_offset = is_method ? Array<ResolvedMethodEntry>::base_offset_in_bytes() : Array<ResolvedFieldEntry>::base_offset_in_bytes(),
|
||||
entries_offset = is_method ? in_bytes(ConstantPoolCache::method_entries_offset()) : in_bytes(ConstantPoolCache::field_entries_offset());
|
||||
|
||||
// Get index out of bytecode pointer
|
||||
get_cache_index_at_bcp(index, bcp_offset, sizeof(u2));
|
||||
// Take shortcut if the size is a power of 2
|
||||
if (is_power_of_2(sizeof(ResolvedFieldEntry))) {
|
||||
if (is_power_of_2(entry_size)) {
|
||||
// Scale index by power of 2
|
||||
sldi(index, index, log2i_exact(sizeof(ResolvedFieldEntry)));
|
||||
sldi(index, index, log2i_exact(entry_size));
|
||||
} else {
|
||||
// Scale the index to be the entry index * sizeof(ResolvedFieldEntry)
|
||||
mulli(index, index, sizeof(ResolvedFieldEntry));
|
||||
mulli(index, index, entry_size);
|
||||
}
|
||||
// Get address of field entries array
|
||||
ld_ptr(cache, in_bytes(ConstantPoolCache::field_entries_offset()), R27_constPoolCache);
|
||||
addi(cache, cache, Array<ResolvedFieldEntry>::base_offset_in_bytes());
|
||||
ld_ptr(cache, entries_offset, R27_constPoolCache);
|
||||
addi(cache, cache, base_offset);
|
||||
add(cache, cache, index);
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::load_method_entry(Register cache, Register index, int bcp_offset) {
|
||||
// Get index out of bytecode pointer
|
||||
get_cache_index_at_bcp(index, bcp_offset, sizeof(u2));
|
||||
// Scale the index to be the entry index * sizeof(ResolvedMethodEntry)
|
||||
mulli(index, index, sizeof(ResolvedMethodEntry));
|
||||
|
||||
// Get address of field entries array
|
||||
ld_ptr(cache, ConstantPoolCache::method_entries_offset(), R27_constPoolCache);
|
||||
addi(cache, cache, Array<ResolvedMethodEntry>::base_offset_in_bytes());
|
||||
add(cache, cache, index); // method_entries + base_offset + scaled index
|
||||
if (for_fast_bytecode) {
|
||||
// Prevent speculative loading from ResolvedFieldEntry/ResolvedMethodEntry as it can miss the info written by another thread.
|
||||
// TemplateTable::patch_bytecode uses release-store.
|
||||
// We reached here via control dependency (Bytecode dispatch has used the rewritten Bytecode).
|
||||
// So, we can use control-isync based ordering.
|
||||
isync();
|
||||
}
|
||||
}
|
||||
|
||||
// Load object from cpool->resolved_references(index).
|
||||
|
||||
@@ -148,7 +148,9 @@ void TemplateTable::patch_bytecode(Bytecodes::Code new_bc, Register Rnew_bc, Reg
|
||||
__ bind(L_fast_patch);
|
||||
}
|
||||
|
||||
// Patch bytecode.
|
||||
// Patch bytecode with release store to coordinate with ResolvedFieldEntry
|
||||
// and ResolvedMethodEntry loads in fast bytecode codelets.
|
||||
__ release();
|
||||
__ stb(Rnew_bc, 0, R14_bcp);
|
||||
|
||||
__ bind(L_patch_done);
|
||||
@@ -312,6 +314,7 @@ void TemplateTable::fast_aldc(LdcType type) {
|
||||
// We are resolved if the resolved reference cache entry contains a
|
||||
// non-null object (CallSite, etc.)
|
||||
__ get_cache_index_at_bcp(R31, 1, index_size); // Load index.
|
||||
// Only rewritten during link time. So, no need for memory barriers for accessing resolved info.
|
||||
__ load_resolved_reference_at_index(R17_tos, R31, R11_scratch1, R12_scratch2, &is_null);
|
||||
|
||||
// Convert null sentinel to null
|
||||
@@ -3109,7 +3112,7 @@ void TemplateTable::fast_storefield(TosState state) {
|
||||
const ConditionRegister CR_is_vol = CR2; // Non-volatile condition register (survives runtime call in do_oop_store).
|
||||
|
||||
// Constant pool already resolved => Load flags and offset of field.
|
||||
__ load_field_entry(Rcache, Rscratch);
|
||||
__ load_field_entry(Rcache, Rscratch, 1, /* for_fast_bytecode */ true);
|
||||
jvmti_post_field_mod(Rcache, Rscratch, false /* not static */);
|
||||
load_resolved_field_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
|
||||
|
||||
@@ -3190,7 +3193,7 @@ void TemplateTable::fast_accessfield(TosState state) {
|
||||
// R12_scratch2 used by load_field_cp_cache_entry
|
||||
|
||||
// Constant pool already resolved. Get the field offset.
|
||||
__ load_field_entry(Rcache, Rscratch);
|
||||
__ load_field_entry(Rcache, Rscratch, 1, /* for_fast_bytecode */ true);
|
||||
load_resolved_field_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
|
||||
|
||||
// JVMTI support
|
||||
@@ -3329,7 +3332,7 @@ void TemplateTable::fast_xaccess(TosState state) {
|
||||
__ ld(Rclass_or_obj, 0, R18_locals);
|
||||
|
||||
// Constant pool already resolved. Get the field offset.
|
||||
__ load_field_entry(Rcache, Rscratch, 2);
|
||||
__ load_field_entry(Rcache, Rscratch, 2, /* for_fast_bytecode */ true);
|
||||
load_resolved_field_entry(noreg, Rcache, noreg, Roffset, Rflags, false); // Uses R11, R12
|
||||
|
||||
// JVMTI support not needed, since we switch back to single bytecode as soon as debugger attaches.
|
||||
@@ -3490,7 +3493,7 @@ void TemplateTable::fast_invokevfinal(int byte_no) {
|
||||
|
||||
assert(byte_no == f2_byte, "use this argument");
|
||||
Register Rcache = R31;
|
||||
__ load_method_entry(Rcache, R11_scratch1);
|
||||
__ load_method_entry(Rcache, R11_scratch1, 1, /* for_fast_bytecode */ true);
|
||||
invokevfinal_helper(Rcache, R11_scratch1, R12_scratch2, R22_tmp2, R23_tmp3);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,10 @@ void VM_Version::initialize() {
|
||||
FLAG_SET_ERGO(TrapBasedRangeChecks, false);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {
|
||||
FLAG_SET_ERGO(UsePopCountInstruction, true);
|
||||
}
|
||||
|
||||
if (PowerArchitecturePPC64 >= 9) {
|
||||
// Performance is good since Power9.
|
||||
if (FLAG_IS_DEFAULT(SuperwordUseVSX)) {
|
||||
|
||||
@@ -912,6 +912,43 @@ protected:
|
||||
emit(insn);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
static uint32_t encode_csrrw(Register Rd, const uint32_t csr, Register Rs1) {
|
||||
guarantee(is_uimm12(csr), "csr is invalid");
|
||||
uint32_t insn = 0;
|
||||
patch((address)&insn, 6, 0, 0b1110011);
|
||||
patch((address)&insn, 14, 12, 0b001);
|
||||
patch_reg((address)&insn, 7, Rd);
|
||||
patch_reg((address)&insn, 15, Rs1);
|
||||
patch((address)&insn, 31, 20, csr);
|
||||
return insn;
|
||||
}
|
||||
|
||||
static uint32_t encode_jal(Register Rd, const int32_t offset) {
|
||||
guarantee(is_simm21(offset) && ((offset % 2) == 0), "offset is invalid.");
|
||||
uint32_t insn = 0;
|
||||
patch((address)&insn, 6, 0, 0b1101111);
|
||||
patch_reg((address)&insn, 7, Rd);
|
||||
patch((address)&insn, 19, 12, (uint32_t)((offset >> 12) & 0xff));
|
||||
patch((address)&insn, 20, (uint32_t)((offset >> 11) & 0x1));
|
||||
patch((address)&insn, 30, 21, (uint32_t)((offset >> 1) & 0x3ff));
|
||||
patch((address)&insn, 31, (uint32_t)((offset >> 20) & 0x1));
|
||||
return insn;
|
||||
}
|
||||
|
||||
static uint32_t encode_jalr(Register Rd, Register Rs, const int32_t offset) {
|
||||
guarantee(is_simm12(offset), "offset is invalid.");
|
||||
uint32_t insn = 0;
|
||||
patch((address)&insn, 6, 0, 0b1100111);
|
||||
patch_reg((address)&insn, 7, Rd);
|
||||
patch((address)&insn, 14, 12, 0b000);
|
||||
patch_reg((address)&insn, 15, Rs);
|
||||
int32_t val = offset & 0xfff;
|
||||
patch((address)&insn, 31, 20, val);
|
||||
return insn;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
enum barrier {
|
||||
@@ -1988,6 +2025,7 @@ enum VectorMask {
|
||||
|
||||
// Vector Narrowing Integer Right Shift Instructions
|
||||
INSN(vnsra_wi, 0b1010111, 0b011, 0b101101);
|
||||
INSN(vnsrl_wi, 0b1010111, 0b011, 0b101100);
|
||||
|
||||
#undef INSN
|
||||
|
||||
@@ -3666,19 +3704,15 @@ public:
|
||||
// --------------------------
|
||||
// Upper Immediate Instruction
|
||||
// --------------------------
|
||||
#define INSN(NAME) \
|
||||
void NAME(Register Rd, int32_t imm) { \
|
||||
/* lui -> c.lui */ \
|
||||
if (do_compress() && (Rd != x0 && Rd != x2 && imm != 0 && is_simm18(imm))) { \
|
||||
c_lui(Rd, imm); \
|
||||
return; \
|
||||
} \
|
||||
_lui(Rd, imm); \
|
||||
void lui(Register Rd, int32_t imm) {
|
||||
/* lui -> c.lui */
|
||||
if (do_compress() && (Rd != x0 && Rd != x2 && imm != 0 && is_simm18(imm))) {
|
||||
c_lui(Rd, imm);
|
||||
return;
|
||||
}
|
||||
_lui(Rd, imm);
|
||||
}
|
||||
|
||||
INSN(lui);
|
||||
|
||||
#undef INSN
|
||||
|
||||
// Cache Management Operations
|
||||
// These instruction may be turned off for user space.
|
||||
|
||||
@@ -401,7 +401,7 @@ void LIR_Assembler::return_op(LIR_Opr result, C1SafepointPollStub* code_stub) {
|
||||
|
||||
code_stub->set_safepoint_offset(__ offset());
|
||||
__ relocate(relocInfo::poll_return_type);
|
||||
__ safepoint_poll(*code_stub->entry(), true /* at_return */, false /* acquire */, true /* in_nmethod */);
|
||||
__ safepoint_poll(*code_stub->entry(), true /* at_return */, true /* in_nmethod */);
|
||||
__ ret();
|
||||
}
|
||||
|
||||
@@ -1354,6 +1354,7 @@ void LIR_Assembler::align_call(LIR_Code code) {
|
||||
}
|
||||
|
||||
void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
|
||||
Assembler::IncompressibleScope scope(_masm);
|
||||
address call = __ reloc_call(Address(op->addr(), rtype));
|
||||
if (call == nullptr) {
|
||||
bailout("reloc call address stub overflow");
|
||||
@@ -1364,6 +1365,7 @@ void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
|
||||
}
|
||||
|
||||
void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
|
||||
Assembler::IncompressibleScope scope(_masm);
|
||||
address call = __ ic_call(op->addr());
|
||||
if (call == nullptr) {
|
||||
bailout("reloc call address stub overflow");
|
||||
@@ -1856,6 +1858,10 @@ void LIR_Assembler::leal(LIR_Opr addr, LIR_Opr dest, LIR_PatchCode patch_code, C
|
||||
void LIR_Assembler::rt_call(LIR_Opr result, address dest, const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {
|
||||
assert(!tmp->is_valid(), "don't need temporary");
|
||||
|
||||
Assembler::IncompressibleScope scope(_masm);
|
||||
// Post call nops must be natural aligned due to cmodx rules.
|
||||
align_call(lir_rtcall);
|
||||
|
||||
__ rt_call(dest);
|
||||
|
||||
if (info != nullptr) {
|
||||
|
||||
@@ -772,7 +772,7 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
|
||||
ciArrayKlass* expected_type = nullptr;
|
||||
arraycopy_helper(x, &flags, &expected_type);
|
||||
if (x->check_flag(Instruction::OmitChecksFlag)) {
|
||||
flags = 0;
|
||||
flags = (flags & LIR_OpArrayCopy::get_initial_copy_flags());
|
||||
}
|
||||
|
||||
__ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp,
|
||||
|
||||
@@ -1952,16 +1952,15 @@ void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register res
|
||||
mv(pow31_3, 29791); // [31^^3]
|
||||
mv(pow31_2, 961); // [31^^2]
|
||||
|
||||
slli(chunks_end, chunks, chunks_end_shift);
|
||||
add(chunks_end, ary, chunks_end);
|
||||
shadd(chunks_end, chunks, ary, t0, chunks_end_shift);
|
||||
andi(cnt, cnt, stride - 1); // don't forget about tail!
|
||||
|
||||
bind(WIDE_LOOP);
|
||||
mulw(result, result, pow31_4); // 31^^4 * h
|
||||
arrays_hashcode_elload(t0, Address(ary, 0 * elsize), eltype);
|
||||
arrays_hashcode_elload(t1, Address(ary, 1 * elsize), eltype);
|
||||
arrays_hashcode_elload(tmp5, Address(ary, 2 * elsize), eltype);
|
||||
arrays_hashcode_elload(tmp6, Address(ary, 3 * elsize), eltype);
|
||||
mulw(result, result, pow31_4); // 31^^4 * h
|
||||
mulw(t0, t0, pow31_3); // 31^^3 * ary[i+0]
|
||||
addw(result, result, t0);
|
||||
mulw(t1, t1, pow31_2); // 31^^2 * ary[i+1]
|
||||
@@ -1976,8 +1975,7 @@ void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register res
|
||||
beqz(cnt, DONE);
|
||||
|
||||
bind(TAIL);
|
||||
slli(chunks_end, cnt, chunks_end_shift);
|
||||
add(chunks_end, ary, chunks_end);
|
||||
shadd(chunks_end, cnt, ary, t0, chunks_end_shift);
|
||||
|
||||
bind(TAIL_LOOP);
|
||||
arrays_hashcode_elload(t0, Address(ary), eltype);
|
||||
@@ -2393,18 +2391,7 @@ static void float_to_float16_slow_path(C2_MacroAssembler& masm, C2GeneralStub<Re
|
||||
Register tmp = stub.data<2>();
|
||||
__ bind(stub.entry());
|
||||
|
||||
__ fmv_x_w(dst, src);
|
||||
|
||||
// preserve the payloads of non-canonical NaNs.
|
||||
__ srai(dst, dst, 13);
|
||||
// preserve the sign bit.
|
||||
__ srai(tmp, dst, 13);
|
||||
__ slli(tmp, tmp, 10);
|
||||
__ mv(t0, 0x3ff);
|
||||
__ orr(tmp, tmp, t0);
|
||||
|
||||
// get the result by merging sign bit and payloads of preserved non-canonical NaNs.
|
||||
__ andr(dst, dst, tmp);
|
||||
__ float_to_float16_NaN(dst, src, t0, tmp);
|
||||
|
||||
__ j(stub.continuation());
|
||||
#undef __
|
||||
@@ -2412,7 +2399,7 @@ static void float_to_float16_slow_path(C2_MacroAssembler& masm, C2GeneralStub<Re
|
||||
|
||||
// j.l.Float.floatToFloat16
|
||||
void C2_MacroAssembler::float_to_float16(Register dst, FloatRegister src, FloatRegister ftmp, Register xtmp) {
|
||||
auto stub = C2CodeStub::make<Register, FloatRegister, Register>(dst, src, xtmp, 130, float_to_float16_slow_path);
|
||||
auto stub = C2CodeStub::make<Register, FloatRegister, Register>(dst, src, xtmp, 64, float_to_float16_slow_path);
|
||||
|
||||
// On riscv, NaN needs a special process as fcvt does not work in that case.
|
||||
|
||||
@@ -2491,41 +2478,80 @@ static void float_to_float16_v_slow_path(C2_MacroAssembler& masm,
|
||||
#define __ masm.
|
||||
VectorRegister dst = stub.data<0>();
|
||||
VectorRegister src = stub.data<1>();
|
||||
VectorRegister tmp = stub.data<2>();
|
||||
VectorRegister vtmp = stub.data<2>();
|
||||
assert_different_registers(dst, src, vtmp);
|
||||
|
||||
__ bind(stub.entry());
|
||||
|
||||
// Active elements (NaNs) are marked in v0 mask register.
|
||||
// mul is already set to mf2 in float_to_float16_v.
|
||||
|
||||
// preserve the payloads of non-canonical NaNs.
|
||||
__ vnsra_wi(dst, src, 13, Assembler::v0_t);
|
||||
// Float (32 bits)
|
||||
// Bit: 31 30 to 23 22 to 0
|
||||
// +---+------------------+-----------------------------+
|
||||
// | S | Exponent | Mantissa (Fraction) |
|
||||
// +---+------------------+-----------------------------+
|
||||
// 1 bit 8 bits 23 bits
|
||||
//
|
||||
// Float (16 bits)
|
||||
// Bit: 15 14 to 10 9 to 0
|
||||
// +---+----------------+------------------+
|
||||
// | S | Exponent | Mantissa |
|
||||
// +---+----------------+------------------+
|
||||
// 1 bit 5 bits 10 bits
|
||||
const int fp_sign_bits = 1;
|
||||
const int fp32_bits = 32;
|
||||
const int fp32_mantissa_2nd_part_bits = 9;
|
||||
const int fp32_mantissa_3rd_part_bits = 4;
|
||||
const int fp16_exponent_bits = 5;
|
||||
const int fp16_mantissa_bits = 10;
|
||||
|
||||
// preserve the sign bit.
|
||||
__ vnsra_wi(tmp, src, 26, Assembler::v0_t);
|
||||
__ vsll_vi(tmp, tmp, 10, Assembler::v0_t);
|
||||
__ mv(t0, 0x3ff);
|
||||
__ vor_vx(tmp, tmp, t0, Assembler::v0_t);
|
||||
// preserve the sign bit and exponent, clear mantissa.
|
||||
__ vnsra_wi(dst, src, fp32_bits - fp_sign_bits - fp16_exponent_bits, Assembler::v0_t);
|
||||
__ vsll_vi(dst, dst, fp16_mantissa_bits, Assembler::v0_t);
|
||||
|
||||
// get the result by merging sign bit and payloads of preserved non-canonical NaNs.
|
||||
__ vand_vv(dst, dst, tmp, Assembler::v0_t);
|
||||
// Preserve high order bit of float NaN in the
|
||||
// binary16 result NaN (tenth bit); OR in remaining
|
||||
// bits into lower 9 bits of binary 16 significand.
|
||||
// | (doppel & 0x007f_e000) >> 13 // 10 bits
|
||||
// | (doppel & 0x0000_1ff0) >> 4 // 9 bits
|
||||
// | (doppel & 0x0000_000f)); // 4 bits
|
||||
//
|
||||
// Check j.l.Float.floatToFloat16 for more information.
|
||||
// 10 bits
|
||||
__ vnsrl_wi(vtmp, src, fp32_mantissa_2nd_part_bits + fp32_mantissa_3rd_part_bits, Assembler::v0_t);
|
||||
__ mv(t0, 0x3ff); // retain first part of mantissa in a float 32
|
||||
__ vand_vx(vtmp, vtmp, t0, Assembler::v0_t);
|
||||
__ vor_vv(dst, dst, vtmp, Assembler::v0_t);
|
||||
// 9 bits
|
||||
__ vnsrl_wi(vtmp, src, fp32_mantissa_3rd_part_bits, Assembler::v0_t);
|
||||
__ mv(t0, 0x1ff); // retain second part of mantissa in a float 32
|
||||
__ vand_vx(vtmp, vtmp, t0, Assembler::v0_t);
|
||||
__ vor_vv(dst, dst, vtmp, Assembler::v0_t);
|
||||
// 4 bits
|
||||
// Narrow shift is necessary to move data from 32 bits element to 16 bits element in vector register.
|
||||
__ vnsrl_wi(vtmp, src, 0, Assembler::v0_t);
|
||||
__ vand_vi(vtmp, vtmp, 0xf, Assembler::v0_t);
|
||||
__ vor_vv(dst, dst, vtmp, Assembler::v0_t);
|
||||
|
||||
__ j(stub.continuation());
|
||||
#undef __
|
||||
}
|
||||
|
||||
// j.l.Float.float16ToFloat
|
||||
void C2_MacroAssembler::float_to_float16_v(VectorRegister dst, VectorRegister src, VectorRegister vtmp,
|
||||
Register tmp, uint vector_length) {
|
||||
void C2_MacroAssembler::float_to_float16_v(VectorRegister dst, VectorRegister src,
|
||||
VectorRegister vtmp, Register tmp, uint vector_length) {
|
||||
assert_different_registers(dst, src, vtmp);
|
||||
|
||||
auto stub = C2CodeStub::make<VectorRegister, VectorRegister, VectorRegister>
|
||||
(dst, src, vtmp, 28, float_to_float16_v_slow_path);
|
||||
(dst, src, vtmp, 56, float_to_float16_v_slow_path);
|
||||
|
||||
// On riscv, NaN needs a special process as vfncvt_f_f_w does not work in that case.
|
||||
|
||||
vsetvli_helper(BasicType::T_FLOAT, vector_length, Assembler::m1);
|
||||
|
||||
// check whether there is a NaN.
|
||||
// replace v_fclass with vmseq_vv as performance optimization.
|
||||
// replace v_fclass with vmfne_vv as performance optimization.
|
||||
vmfne_vv(v0, src, src);
|
||||
vcpop_m(t0, v0);
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ void DowncallLinker::StubGenerator::generate() {
|
||||
__ membar(MacroAssembler::AnyAny);
|
||||
}
|
||||
|
||||
__ safepoint_poll(L_safepoint_poll_slow_path, true /* at_return */, true /* acquire */, false /* in_nmethod */);
|
||||
__ safepoint_poll(L_safepoint_poll_slow_path, true /* at_return */, false /* in_nmethod */);
|
||||
__ lwu(t0, Address(xthread, JavaThread::suspend_flags_offset()));
|
||||
__ bnez(t0, L_safepoint_poll_slow_path);
|
||||
|
||||
|
||||
@@ -645,7 +645,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
|
||||
// the stack, will call InterpreterRuntime::at_unwind.
|
||||
Label slow_path;
|
||||
Label fast_path;
|
||||
safepoint_poll(slow_path, true /* at_return */, false /* acquire */, false /* in_nmethod */);
|
||||
safepoint_poll(slow_path, true /* at_return */, false /* in_nmethod */);
|
||||
j(fast_path);
|
||||
|
||||
bind(slow_path);
|
||||
@@ -1937,6 +1937,15 @@ void InterpreterMacroAssembler::load_method_entry(Register cache, Register index
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
void InterpreterMacroAssembler::verify_field_offset(Register reg) {
|
||||
// Verify the field offset is not in the header, implicitly checks for 0
|
||||
Label L;
|
||||
mv(t0, oopDesc::base_offset_in_bytes());
|
||||
bge(reg, t0, L);
|
||||
stop("bad field offset");
|
||||
bind(L);
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::verify_access_flags(Register access_flags, uint32_t flag,
|
||||
const char* msg, bool stop_by_hit) {
|
||||
Label L;
|
||||
|
||||
@@ -300,6 +300,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
void load_field_entry(Register cache, Register index, int bcp_offset = 1);
|
||||
void load_method_entry(Register cache, Register index, int bcp_offset = 1);
|
||||
|
||||
void verify_field_offset(Register reg) NOT_DEBUG_RETURN;
|
||||
|
||||
#ifdef ASSERT
|
||||
void verify_access_flags(Register access_flags, uint32_t flag,
|
||||
const char* msg, bool stop_by_hit = true);
|
||||
|
||||
@@ -39,25 +39,23 @@ public:
|
||||
// 3 - restoring an old state (javaCalls)
|
||||
|
||||
void clear(void) {
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and the only observer is the thread its running on.
|
||||
|
||||
// clearing _last_Java_sp must be first
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
_last_Java_fp = nullptr;
|
||||
_last_Java_pc = nullptr;
|
||||
}
|
||||
|
||||
void copy(JavaFrameAnchor* src) {
|
||||
// In order to make sure the transition state is valid for "this"
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and the only observer is the thread its running on.
|
||||
|
||||
// We must clear _last_Java_sp before copying the rest of the new data
|
||||
//
|
||||
// Hack Alert: Temporary bugfix for 4717480/4721647
|
||||
// To act like previous version (pd_cache_state) don't null _last_Java_sp
|
||||
// unless the value is changing
|
||||
//
|
||||
assert(src != nullptr, "Src should not be null.");
|
||||
if (_last_Java_sp != src->_last_Java_sp) {
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
}
|
||||
_last_Java_fp = src->_last_Java_fp;
|
||||
_last_Java_pc = src->_last_Java_pc;
|
||||
|
||||
@@ -97,52 +97,52 @@ bool MacroAssembler::is_pc_relative_at(address instr) {
|
||||
// auipc + load
|
||||
// auipc + fload_load
|
||||
return (is_auipc_at(instr)) &&
|
||||
(is_addi_at(instr + instruction_size) ||
|
||||
is_jalr_at(instr + instruction_size) ||
|
||||
is_load_at(instr + instruction_size) ||
|
||||
is_float_load_at(instr + instruction_size)) &&
|
||||
(is_addi_at(instr + MacroAssembler::instruction_size) ||
|
||||
is_jalr_at(instr + MacroAssembler::instruction_size) ||
|
||||
is_load_at(instr + MacroAssembler::instruction_size) ||
|
||||
is_float_load_at(instr + MacroAssembler::instruction_size)) &&
|
||||
check_pc_relative_data_dependency(instr);
|
||||
}
|
||||
|
||||
// ie:ld(Rd, Label)
|
||||
bool MacroAssembler::is_load_pc_relative_at(address instr) {
|
||||
return is_auipc_at(instr) && // auipc
|
||||
is_ld_at(instr + instruction_size) && // ld
|
||||
is_ld_at(instr + MacroAssembler::instruction_size) && // ld
|
||||
check_load_pc_relative_data_dependency(instr);
|
||||
}
|
||||
|
||||
bool MacroAssembler::is_movptr1_at(address instr) {
|
||||
return is_lui_at(instr) && // Lui
|
||||
is_addi_at(instr + instruction_size) && // Addi
|
||||
is_slli_shift_at(instr + instruction_size * 2, 11) && // Slli Rd, Rs, 11
|
||||
is_addi_at(instr + instruction_size * 3) && // Addi
|
||||
is_slli_shift_at(instr + instruction_size * 4, 6) && // Slli Rd, Rs, 6
|
||||
(is_addi_at(instr + instruction_size * 5) ||
|
||||
is_jalr_at(instr + instruction_size * 5) ||
|
||||
is_load_at(instr + instruction_size * 5)) && // Addi/Jalr/Load
|
||||
is_addi_at(instr + MacroAssembler::instruction_size) && // Addi
|
||||
is_slli_shift_at(instr + MacroAssembler::instruction_size * 2, 11) && // Slli Rd, Rs, 11
|
||||
is_addi_at(instr + MacroAssembler::instruction_size * 3) && // Addi
|
||||
is_slli_shift_at(instr + MacroAssembler::instruction_size * 4, 6) && // Slli Rd, Rs, 6
|
||||
(is_addi_at(instr + MacroAssembler::instruction_size * 5) ||
|
||||
is_jalr_at(instr + MacroAssembler::instruction_size * 5) ||
|
||||
is_load_at(instr + MacroAssembler::instruction_size * 5)) && // Addi/Jalr/Load
|
||||
check_movptr1_data_dependency(instr);
|
||||
}
|
||||
|
||||
bool MacroAssembler::is_movptr2_at(address instr) {
|
||||
return is_lui_at(instr) && // lui
|
||||
is_lui_at(instr + instruction_size) && // lui
|
||||
is_slli_shift_at(instr + instruction_size * 2, 18) && // slli Rd, Rs, 18
|
||||
is_add_at(instr + instruction_size * 3) &&
|
||||
(is_addi_at(instr + instruction_size * 4) ||
|
||||
is_jalr_at(instr + instruction_size * 4) ||
|
||||
is_load_at(instr + instruction_size * 4)) && // Addi/Jalr/Load
|
||||
is_lui_at(instr + MacroAssembler::instruction_size) && // lui
|
||||
is_slli_shift_at(instr + MacroAssembler::instruction_size * 2, 18) && // slli Rd, Rs, 18
|
||||
is_add_at(instr + MacroAssembler::instruction_size * 3) &&
|
||||
(is_addi_at(instr + MacroAssembler::instruction_size * 4) ||
|
||||
is_jalr_at(instr + MacroAssembler::instruction_size * 4) ||
|
||||
is_load_at(instr + MacroAssembler::instruction_size * 4)) && // Addi/Jalr/Load
|
||||
check_movptr2_data_dependency(instr);
|
||||
}
|
||||
|
||||
bool MacroAssembler::is_li16u_at(address instr) {
|
||||
return is_lui_at(instr) && // lui
|
||||
is_srli_at(instr + instruction_size) && // srli
|
||||
is_srli_at(instr + MacroAssembler::instruction_size) && // srli
|
||||
check_li16u_data_dependency(instr);
|
||||
}
|
||||
|
||||
bool MacroAssembler::is_li32_at(address instr) {
|
||||
return is_lui_at(instr) && // lui
|
||||
is_addiw_at(instr + instruction_size) && // addiw
|
||||
is_addiw_at(instr + MacroAssembler::instruction_size) && // addiw
|
||||
check_li32_data_dependency(instr);
|
||||
}
|
||||
|
||||
@@ -355,14 +355,15 @@ void MacroAssembler::call_VM(Register oop_result,
|
||||
}
|
||||
|
||||
void MacroAssembler::post_call_nop() {
|
||||
assert(!in_compressible_scope(), "Must be");
|
||||
assert_alignment(pc());
|
||||
if (!Continuations::enabled()) {
|
||||
return;
|
||||
}
|
||||
relocate(post_call_nop_Relocation::spec(), [&] {
|
||||
InlineSkippedInstructionsCounter skipCounter(this);
|
||||
nop();
|
||||
li32(zr, 0);
|
||||
});
|
||||
relocate(post_call_nop_Relocation::spec());
|
||||
InlineSkippedInstructionsCounter skipCounter(this);
|
||||
nop();
|
||||
li32(zr, 0);
|
||||
}
|
||||
|
||||
// these are no-ops overridden by InterpreterMacroAssembler
|
||||
@@ -389,12 +390,14 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
last_java_sp = esp;
|
||||
}
|
||||
|
||||
sd(last_java_sp, Address(xthread, JavaThread::last_Java_sp_offset()));
|
||||
|
||||
// last_java_fp is optional
|
||||
if (last_java_fp->is_valid()) {
|
||||
sd(last_java_fp, Address(xthread, JavaThread::last_Java_fp_offset()));
|
||||
}
|
||||
|
||||
// We must set sp last.
|
||||
sd(last_java_sp, Address(xthread, JavaThread::last_Java_sp_offset()));
|
||||
|
||||
}
|
||||
|
||||
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
@@ -3402,6 +3405,8 @@ void MacroAssembler::decode_klass_not_null(Register r, Register tmp) {
|
||||
|
||||
void MacroAssembler::decode_klass_not_null(Register dst, Register src, Register tmp) {
|
||||
assert(UseCompressedClassPointers, "should only be used for compressed headers");
|
||||
assert_different_registers(dst, tmp);
|
||||
assert_different_registers(src, tmp);
|
||||
|
||||
if (CompressedKlassPointers::base() == nullptr) {
|
||||
if (CompressedKlassPointers::shift() != 0) {
|
||||
@@ -3412,18 +3417,13 @@ void MacroAssembler::decode_klass_not_null(Register dst, Register src, Register
|
||||
return;
|
||||
}
|
||||
|
||||
Register xbase = dst;
|
||||
if (dst == src) {
|
||||
xbase = tmp;
|
||||
}
|
||||
Register xbase = tmp;
|
||||
|
||||
assert_different_registers(src, xbase);
|
||||
mv(xbase, (uintptr_t)CompressedKlassPointers::base());
|
||||
|
||||
if (CompressedKlassPointers::shift() != 0) {
|
||||
Register t = src == dst ? dst : t0;
|
||||
assert_different_registers(t, xbase);
|
||||
shadd(dst, src, xbase, t, CompressedKlassPointers::shift());
|
||||
// dst = (src << shift) + xbase
|
||||
shadd(dst, src, xbase, dst /* temporary, dst != xbase */, CompressedKlassPointers::shift());
|
||||
} else {
|
||||
add(dst, xbase, src);
|
||||
}
|
||||
@@ -3773,11 +3773,8 @@ void MacroAssembler::check_klass_subtype(Register sub_klass,
|
||||
bind(L_failure);
|
||||
}
|
||||
|
||||
void MacroAssembler::safepoint_poll(Label& slow_path, bool at_return, bool acquire, bool in_nmethod, Register tmp_reg) {
|
||||
void MacroAssembler::safepoint_poll(Label& slow_path, bool at_return, bool in_nmethod, Register tmp_reg) {
|
||||
ld(tmp_reg, Address(xthread, JavaThread::polling_word_offset()));
|
||||
if (acquire) {
|
||||
membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore);
|
||||
}
|
||||
if (at_return) {
|
||||
bgtu(in_nmethod ? sp : fp, tmp_reg, slow_path, /* is_far */ true);
|
||||
} else {
|
||||
@@ -5019,7 +5016,7 @@ address MacroAssembler::reloc_call(Address entry, Register tmp) {
|
||||
|
||||
address MacroAssembler::ic_call(address entry, jint method_index) {
|
||||
RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index);
|
||||
IncompressibleScope scope(this); // relocations
|
||||
assert(!in_compressible_scope(), "Must be");
|
||||
movptr(t0, (address)Universe::non_oop_word(), t1);
|
||||
assert_cond(entry != nullptr);
|
||||
return reloc_call(Address(entry, rh));
|
||||
@@ -5113,7 +5110,7 @@ address MacroAssembler::emit_reloc_call_address_stub(int insts_call_instruction_
|
||||
|
||||
int MacroAssembler::max_reloc_call_address_stub_size() {
|
||||
// Max stub size: alignment nop, target address.
|
||||
return 1 * instruction_size + wordSize;
|
||||
return 1 * MacroAssembler::instruction_size + wordSize;
|
||||
}
|
||||
|
||||
int MacroAssembler::static_call_stub_size() {
|
||||
@@ -5344,42 +5341,6 @@ void MacroAssembler::add2_with_carry(Register final_dest_hi, Register dest_hi, R
|
||||
add(final_dest_hi, dest_hi, carry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply 32 bit by 32 bit first loop.
|
||||
*/
|
||||
void MacroAssembler::multiply_32_x_32_loop(Register x, Register xstart, Register x_xstart,
|
||||
Register y, Register y_idx, Register z,
|
||||
Register carry, Register product,
|
||||
Register idx, Register kdx) {
|
||||
// jlong carry, x[], y[], z[];
|
||||
// for (int idx=ystart, kdx=ystart+1+xstart; idx >= 0; idx--, kdx--) {
|
||||
// long product = y[idx] * x[xstart] + carry;
|
||||
// z[kdx] = (int)product;
|
||||
// carry = product >>> 32;
|
||||
// }
|
||||
// z[xstart] = (int)carry;
|
||||
|
||||
Label L_first_loop, L_first_loop_exit;
|
||||
blez(idx, L_first_loop_exit);
|
||||
|
||||
shadd(t0, xstart, x, t0, LogBytesPerInt);
|
||||
lwu(x_xstart, Address(t0, 0));
|
||||
|
||||
bind(L_first_loop);
|
||||
subiw(idx, idx, 1);
|
||||
shadd(t0, idx, y, t0, LogBytesPerInt);
|
||||
lwu(y_idx, Address(t0, 0));
|
||||
mul(product, x_xstart, y_idx);
|
||||
add(product, product, carry);
|
||||
srli(carry, product, 32);
|
||||
subiw(kdx, kdx, 1);
|
||||
shadd(t0, kdx, z, t0, LogBytesPerInt);
|
||||
sw(product, Address(t0, 0));
|
||||
bgtz(idx, L_first_loop);
|
||||
|
||||
bind(L_first_loop_exit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply 64 bit by 64 bit first loop.
|
||||
*/
|
||||
@@ -5596,77 +5557,16 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
|
||||
const Register carry = tmp5;
|
||||
const Register product = xlen;
|
||||
const Register x_xstart = tmp0;
|
||||
const Register jdx = tmp1;
|
||||
|
||||
mv(idx, ylen); // idx = ylen;
|
||||
addw(kdx, xlen, ylen); // kdx = xlen+ylen;
|
||||
mv(carry, zr); // carry = 0;
|
||||
|
||||
Label L_multiply_64_x_64_loop, L_done;
|
||||
|
||||
Label L_done;
|
||||
subiw(xstart, xlen, 1);
|
||||
bltz(xstart, L_done);
|
||||
|
||||
const Register jdx = tmp1;
|
||||
|
||||
if (AvoidUnalignedAccesses) {
|
||||
int base_offset = arrayOopDesc::base_offset_in_bytes(T_INT);
|
||||
assert((base_offset % (UseCompactObjectHeaders ? 4 :
|
||||
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
|
||||
|
||||
if ((base_offset % 8) == 0) {
|
||||
// multiply_64_x_64_loop emits 8-byte load/store to access two elements
|
||||
// at a time from int arrays x and y. When base_offset is 8 bytes, these
|
||||
// accesses are naturally aligned if both xlen and ylen are even numbers.
|
||||
orr(t0, xlen, ylen);
|
||||
test_bit(t0, t0, 0);
|
||||
beqz(t0, L_multiply_64_x_64_loop);
|
||||
}
|
||||
|
||||
Label L_second_loop_unaligned, L_third_loop, L_third_loop_exit;
|
||||
|
||||
multiply_32_x_32_loop(x, xstart, x_xstart, y, y_idx, z, carry, product, idx, kdx);
|
||||
shadd(t0, xstart, z, t0, LogBytesPerInt);
|
||||
sw(carry, Address(t0, 0));
|
||||
|
||||
bind(L_second_loop_unaligned);
|
||||
mv(carry, zr);
|
||||
mv(jdx, ylen);
|
||||
subiw(xstart, xstart, 1);
|
||||
bltz(xstart, L_done);
|
||||
|
||||
subi(sp, sp, 2 * wordSize);
|
||||
sd(z, Address(sp, 0));
|
||||
sd(zr, Address(sp, wordSize));
|
||||
shadd(t0, xstart, z, t0, LogBytesPerInt);
|
||||
addi(z, t0, 4);
|
||||
shadd(t0, xstart, x, t0, LogBytesPerInt);
|
||||
lwu(product, Address(t0, 0));
|
||||
|
||||
blez(jdx, L_third_loop_exit);
|
||||
|
||||
bind(L_third_loop);
|
||||
subiw(jdx, jdx, 1);
|
||||
shadd(t0, jdx, y, t0, LogBytesPerInt);
|
||||
lwu(t0, Address(t0, 0));
|
||||
mul(t1, t0, product);
|
||||
add(t0, t1, carry);
|
||||
shadd(tmp6, jdx, z, t1, LogBytesPerInt);
|
||||
lwu(t1, Address(tmp6, 0));
|
||||
add(t0, t0, t1);
|
||||
sw(t0, Address(tmp6, 0));
|
||||
srli(carry, t0, 32);
|
||||
bgtz(jdx, L_third_loop);
|
||||
|
||||
bind(L_third_loop_exit);
|
||||
ld(z, Address(sp, 0));
|
||||
addi(sp, sp, 2 * wordSize);
|
||||
shadd(t0, xstart, z, t0, LogBytesPerInt);
|
||||
sw(carry, Address(t0, 0));
|
||||
|
||||
j(L_second_loop_unaligned);
|
||||
}
|
||||
|
||||
bind(L_multiply_64_x_64_loop);
|
||||
multiply_64_x_64_loop(x, xstart, x_xstart, y, y_idx, z, carry, product, idx, kdx);
|
||||
|
||||
Label L_second_loop_aligned;
|
||||
@@ -5974,13 +5874,14 @@ void MacroAssembler::fill_words(Register base, Register cnt, Register value) {
|
||||
// in cnt.
|
||||
//
|
||||
// NOTE: This is intended to be used in the zero_blocks() stub. If
|
||||
// you want to use it elsewhere, note that cnt must be >= CacheLineSize.
|
||||
// you want to use it elsewhere, note that cnt must be >= zicboz_block_size.
|
||||
void MacroAssembler::zero_dcache_blocks(Register base, Register cnt, Register tmp1, Register tmp2) {
|
||||
int zicboz_block_size = VM_Version::zicboz_block_size.value();
|
||||
Label initial_table_end, loop;
|
||||
|
||||
// Align base with cache line size.
|
||||
neg(tmp1, base);
|
||||
andi(tmp1, tmp1, CacheLineSize - 1);
|
||||
andi(tmp1, tmp1, zicboz_block_size - 1);
|
||||
|
||||
// tmp1: the number of bytes to be filled to align the base with cache line size.
|
||||
add(base, base, tmp1);
|
||||
@@ -5990,16 +5891,16 @@ void MacroAssembler::zero_dcache_blocks(Register base, Register cnt, Register tm
|
||||
la(tmp1, initial_table_end);
|
||||
sub(tmp2, tmp1, tmp2);
|
||||
jr(tmp2);
|
||||
for (int i = -CacheLineSize + wordSize; i < 0; i += wordSize) {
|
||||
for (int i = -zicboz_block_size + wordSize; i < 0; i += wordSize) {
|
||||
sd(zr, Address(base, i));
|
||||
}
|
||||
bind(initial_table_end);
|
||||
|
||||
mv(tmp1, CacheLineSize / wordSize);
|
||||
mv(tmp1, zicboz_block_size / wordSize);
|
||||
bind(loop);
|
||||
cbo_zero(base);
|
||||
sub(cnt, cnt, tmp1);
|
||||
addi(base, base, CacheLineSize);
|
||||
addi(base, base, zicboz_block_size);
|
||||
bge(cnt, tmp1, loop);
|
||||
}
|
||||
|
||||
@@ -6054,6 +5955,62 @@ void MacroAssembler::java_round_double(Register dst, FloatRegister src, FloatReg
|
||||
bind(done);
|
||||
}
|
||||
|
||||
// Helper routine processing the slow path of NaN when converting float to float16
|
||||
void MacroAssembler::float_to_float16_NaN(Register dst, FloatRegister src,
|
||||
Register tmp1, Register tmp2) {
|
||||
fmv_x_w(dst, src);
|
||||
|
||||
// Float (32 bits)
|
||||
// Bit: 31 30 to 23 22 to 0
|
||||
// +---+------------------+-----------------------------+
|
||||
// | S | Exponent | Mantissa (Fraction) |
|
||||
// +---+------------------+-----------------------------+
|
||||
// 1 bit 8 bits 23 bits
|
||||
//
|
||||
// Float (16 bits)
|
||||
// Bit: 15 14 to 10 9 to 0
|
||||
// +---+----------------+------------------+
|
||||
// | S | Exponent | Mantissa |
|
||||
// +---+----------------+------------------+
|
||||
// 1 bit 5 bits 10 bits
|
||||
const int fp_sign_bits = 1;
|
||||
const int fp32_bits = 32;
|
||||
const int fp32_exponent_bits = 8;
|
||||
const int fp32_mantissa_1st_part_bits = 10;
|
||||
const int fp32_mantissa_2nd_part_bits = 9;
|
||||
const int fp32_mantissa_3rd_part_bits = 4;
|
||||
const int fp16_exponent_bits = 5;
|
||||
const int fp16_mantissa_bits = 10;
|
||||
|
||||
// preserve the sign bit and exponent, clear mantissa.
|
||||
srai(tmp2, dst, fp32_bits - fp_sign_bits - fp16_exponent_bits);
|
||||
slli(tmp2, tmp2, fp16_mantissa_bits);
|
||||
|
||||
// Preserve high order bit of float NaN in the
|
||||
// binary16 result NaN (tenth bit); OR in remaining
|
||||
// bits into lower 9 bits of binary 16 significand.
|
||||
// | (doppel & 0x007f_e000) >> 13 // 10 bits
|
||||
// | (doppel & 0x0000_1ff0) >> 4 // 9 bits
|
||||
// | (doppel & 0x0000_000f)); // 4 bits
|
||||
//
|
||||
// Check j.l.Float.floatToFloat16 for more information.
|
||||
// 10 bits
|
||||
int left_shift = fp_sign_bits + fp32_exponent_bits + 32;
|
||||
int right_shift = left_shift + fp32_mantissa_2nd_part_bits + fp32_mantissa_3rd_part_bits;
|
||||
slli(tmp1, dst, left_shift);
|
||||
srli(tmp1, tmp1, right_shift);
|
||||
orr(tmp2, tmp2, tmp1);
|
||||
// 9 bits
|
||||
left_shift += fp32_mantissa_1st_part_bits;
|
||||
right_shift = left_shift + fp32_mantissa_3rd_part_bits;
|
||||
slli(tmp1, dst, left_shift);
|
||||
srli(tmp1, tmp1, right_shift);
|
||||
orr(tmp2, tmp2, tmp1);
|
||||
// 4 bits
|
||||
andi(tmp1, dst, 0xf);
|
||||
orr(dst, tmp2, tmp1);
|
||||
}
|
||||
|
||||
#define FCVT_SAFE(FLOATCVT, FLOATSIG) \
|
||||
void MacroAssembler::FLOATCVT##_safe(Register dst, FloatRegister src, Register tmp) { \
|
||||
Label done; \
|
||||
|
||||
@@ -44,7 +44,7 @@ class MacroAssembler: public Assembler {
|
||||
|
||||
MacroAssembler(CodeBuffer* code) : Assembler(code) {}
|
||||
|
||||
void safepoint_poll(Label& slow_path, bool at_return, bool acquire, bool in_nmethod, Register tmp_reg = t0);
|
||||
void safepoint_poll(Label& slow_path, bool at_return, bool in_nmethod, Register tmp_reg = t0);
|
||||
|
||||
// Alignment
|
||||
int align(int modulus, int extra_offset = 0);
|
||||
@@ -1240,7 +1240,7 @@ public:
|
||||
void far_jump(const Address &entry, Register tmp = t1);
|
||||
|
||||
static int far_branch_size() {
|
||||
return 2 * 4; // auipc + jalr, see far_call() & far_jump()
|
||||
return 2 * MacroAssembler::instruction_size; // auipc + jalr, see far_call() & far_jump()
|
||||
}
|
||||
|
||||
void load_byte_map_base(Register reg);
|
||||
@@ -1384,10 +1384,6 @@ public:
|
||||
void adc(Register dst, Register src1, Register src2, Register carry);
|
||||
void add2_with_carry(Register final_dest_hi, Register dest_hi, Register dest_lo,
|
||||
Register src1, Register src2, Register carry);
|
||||
void multiply_32_x_32_loop(Register x, Register xstart, Register x_xstart,
|
||||
Register y, Register y_idx, Register z,
|
||||
Register carry, Register product,
|
||||
Register idx, Register kdx);
|
||||
void multiply_64_x_64_loop(Register x, Register xstart, Register x_xstart,
|
||||
Register y, Register y_idx, Register z,
|
||||
Register carry, Register product,
|
||||
@@ -1435,6 +1431,9 @@ public:
|
||||
void java_round_float(Register dst, FloatRegister src, FloatRegister ftmp);
|
||||
void java_round_double(Register dst, FloatRegister src, FloatRegister ftmp);
|
||||
|
||||
// Helper routine processing the slow path of NaN when converting float to float16
|
||||
void float_to_float16_NaN(Register dst, FloatRegister src, Register tmp1, Register tmp2);
|
||||
|
||||
// vector load/store unit-stride instructions
|
||||
void vlex_v(VectorRegister vd, Register base, Assembler::SEW sew, VectorMask vm = unmasked) {
|
||||
switch (sew) {
|
||||
@@ -1648,9 +1647,9 @@ public:
|
||||
public:
|
||||
enum {
|
||||
// movptr
|
||||
movptr1_instruction_size = 6 * instruction_size, // lui, addi, slli, addi, slli, addi. See movptr1().
|
||||
movptr2_instruction_size = 5 * instruction_size, // lui, lui, slli, add, addi. See movptr2().
|
||||
load_pc_relative_instruction_size = 2 * instruction_size // auipc, ld
|
||||
movptr1_instruction_size = 6 * MacroAssembler::instruction_size, // lui, addi, slli, addi, slli, addi. See movptr1().
|
||||
movptr2_instruction_size = 5 * MacroAssembler::instruction_size, // lui, lui, slli, add, addi. See movptr2().
|
||||
load_pc_relative_instruction_size = 2 * MacroAssembler::instruction_size // auipc, ld
|
||||
};
|
||||
|
||||
static bool is_load_pc_relative_at(address branch);
|
||||
@@ -1705,11 +1704,11 @@ public:
|
||||
// addi/jalr/load
|
||||
static bool check_movptr1_data_dependency(address instr) {
|
||||
address lui = instr;
|
||||
address addi1 = lui + instruction_size;
|
||||
address slli1 = addi1 + instruction_size;
|
||||
address addi2 = slli1 + instruction_size;
|
||||
address slli2 = addi2 + instruction_size;
|
||||
address last_instr = slli2 + instruction_size;
|
||||
address addi1 = lui + MacroAssembler::instruction_size;
|
||||
address slli1 = addi1 + MacroAssembler::instruction_size;
|
||||
address addi2 = slli1 + MacroAssembler::instruction_size;
|
||||
address slli2 = addi2 + MacroAssembler::instruction_size;
|
||||
address last_instr = slli2 + MacroAssembler::instruction_size;
|
||||
return extract_rs1(addi1) == extract_rd(lui) &&
|
||||
extract_rs1(addi1) == extract_rd(addi1) &&
|
||||
extract_rs1(slli1) == extract_rd(addi1) &&
|
||||
@@ -1729,10 +1728,10 @@ public:
|
||||
// addi/jalr/load
|
||||
static bool check_movptr2_data_dependency(address instr) {
|
||||
address lui1 = instr;
|
||||
address lui2 = lui1 + instruction_size;
|
||||
address slli = lui2 + instruction_size;
|
||||
address add = slli + instruction_size;
|
||||
address last_instr = add + instruction_size;
|
||||
address lui2 = lui1 + MacroAssembler::instruction_size;
|
||||
address slli = lui2 + MacroAssembler::instruction_size;
|
||||
address add = slli + MacroAssembler::instruction_size;
|
||||
address last_instr = add + MacroAssembler::instruction_size;
|
||||
return extract_rd(add) == extract_rd(lui2) &&
|
||||
extract_rs1(add) == extract_rd(lui2) &&
|
||||
extract_rs2(add) == extract_rd(slli) &&
|
||||
@@ -1746,7 +1745,7 @@ public:
|
||||
// srli
|
||||
static bool check_li16u_data_dependency(address instr) {
|
||||
address lui = instr;
|
||||
address srli = lui + instruction_size;
|
||||
address srli = lui + MacroAssembler::instruction_size;
|
||||
|
||||
return extract_rs1(srli) == extract_rd(lui) &&
|
||||
extract_rs1(srli) == extract_rd(srli);
|
||||
@@ -1757,7 +1756,7 @@ public:
|
||||
// addiw
|
||||
static bool check_li32_data_dependency(address instr) {
|
||||
address lui = instr;
|
||||
address addiw = lui + instruction_size;
|
||||
address addiw = lui + MacroAssembler::instruction_size;
|
||||
|
||||
return extract_rs1(addiw) == extract_rd(lui) &&
|
||||
extract_rs1(addiw) == extract_rd(addiw);
|
||||
@@ -1768,7 +1767,7 @@ public:
|
||||
// jalr/addi/load/float_load
|
||||
static bool check_pc_relative_data_dependency(address instr) {
|
||||
address auipc = instr;
|
||||
address last_instr = auipc + instruction_size;
|
||||
address last_instr = auipc + MacroAssembler::instruction_size;
|
||||
|
||||
return extract_rs1(last_instr) == extract_rd(auipc);
|
||||
}
|
||||
@@ -1778,7 +1777,7 @@ public:
|
||||
// load
|
||||
static bool check_load_pc_relative_data_dependency(address instr) {
|
||||
address auipc = instr;
|
||||
address load = auipc + instruction_size;
|
||||
address load = auipc + MacroAssembler::instruction_size;
|
||||
|
||||
return extract_rd(load) == extract_rd(auipc) &&
|
||||
extract_rs1(load) == extract_rd(load);
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "runtime/safepoint.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
#ifdef COMPILER1
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
@@ -46,128 +47,111 @@ bool NativeInstruction::is_call_at(address addr) {
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// NativeFarCall
|
||||
//
|
||||
// Implements direct far calling loading an address from the stub section version of reloc call.
|
||||
// NativeCall
|
||||
|
||||
class NativeFarCall: public NativeInstruction {
|
||||
public:
|
||||
enum RISCV_specific_constants {
|
||||
return_address_offset = 3 * NativeInstruction::instruction_size, // auipc + ld + jalr
|
||||
};
|
||||
|
||||
address instruction_address() const { return addr_at(0); }
|
||||
address next_instruction_address() const { return addr_at(return_address_offset); }
|
||||
address return_address() const { return addr_at(return_address_offset); }
|
||||
address destination() const;
|
||||
address reloc_destination(address orig_address);
|
||||
|
||||
void set_destination(address dest);
|
||||
void verify();
|
||||
void print();
|
||||
|
||||
bool set_destination_mt_safe(address dest, bool assert_lock = true);
|
||||
bool reloc_set_destination(address dest);
|
||||
|
||||
private:
|
||||
address stub_address();
|
||||
|
||||
static void set_stub_address_destination_at(address dest, address value);
|
||||
static address stub_address_destination_at(address src);
|
||||
public:
|
||||
|
||||
static NativeFarCall* at(address addr);
|
||||
static bool is_at(address addr);
|
||||
static bool is_call_before(address return_address);
|
||||
};
|
||||
|
||||
address NativeFarCall::destination() const {
|
||||
address NativeCall::destination() const {
|
||||
address addr = instruction_address();
|
||||
assert(NativeFarCall::is_at(addr), "unexpected code at call site");
|
||||
assert(NativeCall::is_at(addr), "unexpected code at call site");
|
||||
|
||||
address destination = MacroAssembler::target_addr_for_insn(addr);
|
||||
address stub_addr = MacroAssembler::target_addr_for_insn(addr);
|
||||
|
||||
CodeBlob* cb = CodeCache::find_blob(addr);
|
||||
assert(cb && cb->is_nmethod(), "sanity");
|
||||
assert(cb != nullptr && cb->is_nmethod(), "nmethod expected");
|
||||
nmethod *nm = (nmethod *)cb;
|
||||
assert(nm != nullptr, "Sanity");
|
||||
assert(nm->stub_contains(destination), "Sanity");
|
||||
assert(destination != nullptr, "Sanity");
|
||||
return stub_address_destination_at(destination);
|
||||
assert(nm->stub_contains(stub_addr), "Sanity");
|
||||
assert(stub_addr != nullptr, "Sanity");
|
||||
|
||||
return stub_address_destination_at(stub_addr);
|
||||
}
|
||||
|
||||
address NativeFarCall::reloc_destination(address orig_address) {
|
||||
address NativeCall::reloc_destination() {
|
||||
address call_addr = instruction_address();
|
||||
assert(NativeCall::is_at(call_addr), "unexpected code at call site");
|
||||
|
||||
CodeBlob *code = CodeCache::find_blob(call_addr);
|
||||
assert(code != nullptr, "Could not find the containing code blob");
|
||||
|
||||
address stub_addr = nullptr;
|
||||
if (code != nullptr && code->is_nmethod()) {
|
||||
stub_addr = trampoline_stub_Relocation::get_trampoline_for(call_addr, (nmethod*)code);
|
||||
if (code->is_nmethod()) {
|
||||
// TODO: Need to revisit this when porting the AOT features.
|
||||
stub_addr = trampoline_stub_Relocation::get_trampoline_for(call_addr, code->as_nmethod());
|
||||
assert(stub_addr != nullptr, "Sanity");
|
||||
}
|
||||
|
||||
if (stub_addr != nullptr) {
|
||||
stub_addr = MacroAssembler::target_addr_for_insn(call_addr);
|
||||
}
|
||||
return stub_addr;
|
||||
}
|
||||
|
||||
void NativeFarCall::set_destination(address dest) {
|
||||
address addr = instruction_address();
|
||||
assert(NativeFarCall::is_at(addr), "unexpected code at call site");
|
||||
Unimplemented();
|
||||
void NativeCall::verify() {
|
||||
assert(NativeCall::is_at(instruction_address()), "unexpected code at call site");
|
||||
}
|
||||
|
||||
void NativeFarCall::verify() {
|
||||
assert(NativeFarCall::is_at(instruction_address()), "unexpected code at call site");
|
||||
void NativeCall::print() {
|
||||
assert(NativeCall::is_at(instruction_address()), "unexpected code at call site");
|
||||
tty->print_cr(PTR_FORMAT ": auipc,ld,jalr x1, offset/reg, ", p2i(instruction_address()));
|
||||
}
|
||||
|
||||
void NativeFarCall::print() {
|
||||
assert(NativeFarCall::is_at(instruction_address()), "unexpected code at call site");
|
||||
tty->print_cr(PTR_FORMAT ": auipc,ld,jalr x1, offset/reg, ", p2i(addr_at(0)));
|
||||
void NativeCall::optimize_call(address dest, bool mt_safe) {
|
||||
// Skip over auipc + ld
|
||||
address jmp_ins_pc = instruction_address() + 2 * NativeInstruction::instruction_size;
|
||||
// Rutime calls may be unaligned, but they are never changed after relocation.
|
||||
assert(!mt_safe || is_aligned(jmp_ins_pc, NativeInstruction::instruction_size), "Must be naturally aligned: %p", jmp_ins_pc);
|
||||
// If reachable use JAL
|
||||
if (Assembler::reachable_from_branch_at(jmp_ins_pc, dest)) {
|
||||
int64_t distance = dest - jmp_ins_pc;
|
||||
uint32_t new_jal = Assembler::encode_jal(ra, distance);
|
||||
Atomic::store((uint32_t *)jmp_ins_pc, new_jal);
|
||||
} else if (!MacroAssembler::is_jalr_at(jmp_ins_pc)) { // The jalr is always identical: jalr ra, 0(t1)
|
||||
uint32_t new_jalr = Assembler::encode_jalr(ra, t1, 0);
|
||||
Atomic::store((uint32_t *)jmp_ins_pc, new_jalr);
|
||||
} else {
|
||||
// No change to instruction stream
|
||||
return;
|
||||
}
|
||||
// We changed instruction stream
|
||||
if (mt_safe) {
|
||||
// IC invalidate provides a leading full fence, it thus happens after we changed the instruction stream.
|
||||
ICache::invalidate_range(jmp_ins_pc, NativeInstruction::instruction_size);
|
||||
}
|
||||
}
|
||||
|
||||
bool NativeFarCall::set_destination_mt_safe(address dest, bool assert_lock) {
|
||||
assert(NativeFarCall::is_at(addr_at(0)), "unexpected code at call site");
|
||||
assert(!assert_lock ||
|
||||
(CodeCache_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
|
||||
CompiledICLocker::is_safe(addr_at(0)),
|
||||
bool NativeCall::set_destination_mt_safe(address dest) {
|
||||
assert(NativeCall::is_at(instruction_address()), "unexpected code at call site");
|
||||
assert((CodeCache_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
|
||||
CompiledICLocker::is_safe(instruction_address()),
|
||||
"concurrent code patching");
|
||||
|
||||
address call_addr = addr_at(0);
|
||||
assert(NativeFarCall::is_at(call_addr), "unexpected code at call site");
|
||||
|
||||
address stub_addr = stub_address();
|
||||
assert(stub_addr != nullptr, "No stub?");
|
||||
set_stub_address_destination_at(stub_addr, dest); // release
|
||||
// optimize_call happens after we stored new address in addr stub.
|
||||
// patches jalr -> jal/jal -> jalr depending on dest
|
||||
optimize_call(dest, true);
|
||||
|
||||
if (stub_addr != nullptr) {
|
||||
set_stub_address_destination_at(stub_addr, dest);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NativeFarCall::reloc_set_destination(address dest) {
|
||||
address call_addr = addr_at(0);
|
||||
assert(NativeFarCall::is_at(call_addr), "unexpected code at call site");
|
||||
// The argument passed in is the address to the stub containing the destination
|
||||
bool NativeCall::reloc_set_destination(address stub_addr) {
|
||||
address call_addr = instruction_address();
|
||||
assert(NativeCall::is_at(call_addr), "unexpected code at call site");
|
||||
|
||||
CodeBlob *code = CodeCache::find_blob(call_addr);
|
||||
assert(code != nullptr, "Could not find the containing code blob");
|
||||
|
||||
address stub_addr = nullptr;
|
||||
if (code != nullptr && code->is_nmethod()) {
|
||||
stub_addr = trampoline_stub_Relocation::get_trampoline_for(call_addr, (nmethod*)code);
|
||||
}
|
||||
if (code->is_nmethod()) {
|
||||
// TODO: Need to revisit this when porting the AOT features.
|
||||
assert(stub_addr != nullptr, "Sanity");
|
||||
assert(stub_addr == trampoline_stub_Relocation::get_trampoline_for(call_addr, code->as_nmethod()), "Sanity");
|
||||
MacroAssembler::pd_patch_instruction_size(call_addr, stub_addr); // patches auipc + ld to stub_addr
|
||||
|
||||
if (stub_addr != nullptr) {
|
||||
MacroAssembler::pd_patch_instruction_size(call_addr, stub_addr);
|
||||
address dest = stub_address_destination_at(stub_addr);
|
||||
optimize_call(dest, false); // patches jalr -> jal/jal -> jalr depending on dest
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void NativeFarCall::set_stub_address_destination_at(address dest, address value) {
|
||||
void NativeCall::set_stub_address_destination_at(address dest, address value) {
|
||||
assert_cond(dest != nullptr);
|
||||
assert_cond(value != nullptr);
|
||||
|
||||
@@ -175,31 +159,24 @@ void NativeFarCall::set_stub_address_destination_at(address dest, address value)
|
||||
OrderAccess::release();
|
||||
}
|
||||
|
||||
address NativeFarCall::stub_address_destination_at(address src) {
|
||||
address NativeCall::stub_address_destination_at(address src) {
|
||||
assert_cond(src != nullptr);
|
||||
address dest = (address)get_data64_at(src);
|
||||
return dest;
|
||||
}
|
||||
|
||||
address NativeFarCall::stub_address() {
|
||||
address call_addr = addr_at(0);
|
||||
address NativeCall::stub_address() {
|
||||
address call_addr = instruction_address();
|
||||
|
||||
CodeBlob *code = CodeCache::find_blob(call_addr);
|
||||
assert(code != nullptr, "Could not find the containing code blob");
|
||||
|
||||
address dest = MacroAssembler::pd_call_destination(call_addr);
|
||||
assert(code->contains(dest), "Sanity");
|
||||
return dest;
|
||||
address stub_addr = MacroAssembler::target_addr_for_insn(call_addr);
|
||||
assert(code->contains(stub_addr), "Sanity");
|
||||
return stub_addr;
|
||||
}
|
||||
|
||||
NativeFarCall* NativeFarCall::at(address addr) {
|
||||
assert_cond(addr != nullptr);
|
||||
assert(NativeFarCall::is_at(addr), "unexpected code at call site: %p", addr);
|
||||
NativeFarCall* call = (NativeFarCall*)(addr);
|
||||
return call;
|
||||
}
|
||||
|
||||
bool NativeFarCall::is_at(address addr) {
|
||||
bool NativeCall::is_at(address addr) {
|
||||
assert_cond(addr != nullptr);
|
||||
const int instr_size = NativeInstruction::instruction_size;
|
||||
if (MacroAssembler::is_auipc_at(addr) &&
|
||||
@@ -209,65 +186,23 @@ bool NativeFarCall::is_at(address addr) {
|
||||
(MacroAssembler::extract_rd(addr + instr_size) == x6) &&
|
||||
(MacroAssembler::extract_rs1(addr + instr_size) == x6) &&
|
||||
(MacroAssembler::extract_rs1(addr + 2 * instr_size) == x6) &&
|
||||
(MacroAssembler::extract_rd(addr + 2 * instr_size) == x1)) {
|
||||
(MacroAssembler::extract_rd(addr + 2 * instr_size) == x1)) {
|
||||
return true;
|
||||
}
|
||||
if (MacroAssembler::is_auipc_at(addr) &&
|
||||
MacroAssembler::is_ld_at(addr + instr_size) &&
|
||||
MacroAssembler::is_jal_at(addr + 2 * instr_size) &&
|
||||
(MacroAssembler::extract_rd(addr) == x6) &&
|
||||
(MacroAssembler::extract_rd(addr + instr_size) == x6) &&
|
||||
(MacroAssembler::extract_rs1(addr + instr_size) == x6) &&
|
||||
(MacroAssembler::extract_rd(addr + 2 * instr_size) == x1)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NativeFarCall::is_call_before(address return_address) {
|
||||
return NativeFarCall::is_at(return_address - return_address_offset);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// NativeCall
|
||||
|
||||
address NativeCall::instruction_address() const {
|
||||
return NativeFarCall::at(addr_at(0))->instruction_address();
|
||||
}
|
||||
|
||||
address NativeCall::next_instruction_address() const {
|
||||
return NativeFarCall::at(addr_at(0))->next_instruction_address();
|
||||
}
|
||||
|
||||
address NativeCall::return_address() const {
|
||||
return NativeFarCall::at(addr_at(0))->return_address();
|
||||
}
|
||||
|
||||
address NativeCall::destination() const {
|
||||
return NativeFarCall::at(addr_at(0))->destination();
|
||||
}
|
||||
|
||||
address NativeCall::reloc_destination(address orig_address) {
|
||||
return NativeFarCall::at(addr_at(0))->reloc_destination(orig_address);
|
||||
}
|
||||
|
||||
void NativeCall::set_destination(address dest) {
|
||||
NativeFarCall::at(addr_at(0))->set_destination(dest);
|
||||
}
|
||||
|
||||
void NativeCall::verify() {
|
||||
NativeFarCall::at(addr_at(0))->verify();;
|
||||
}
|
||||
|
||||
void NativeCall::print() {
|
||||
NativeFarCall::at(addr_at(0))->print();;
|
||||
}
|
||||
|
||||
bool NativeCall::set_destination_mt_safe(address dest, bool assert_lock) {
|
||||
return NativeFarCall::at(addr_at(0))->set_destination_mt_safe(dest, assert_lock);
|
||||
}
|
||||
|
||||
bool NativeCall::reloc_set_destination(address dest) {
|
||||
return NativeFarCall::at(addr_at(0))->reloc_set_destination(dest);
|
||||
}
|
||||
|
||||
bool NativeCall::is_at(address addr) {
|
||||
return NativeFarCall::is_at(addr);
|
||||
}
|
||||
|
||||
bool NativeCall::is_call_before(address return_address) {
|
||||
return NativeFarCall::is_call_before(return_address);
|
||||
return NativeCall::is_at(return_address - NativeCall::instruction_size);
|
||||
}
|
||||
|
||||
NativeCall* nativeCall_at(address addr) {
|
||||
@@ -280,7 +215,7 @@ NativeCall* nativeCall_at(address addr) {
|
||||
NativeCall* nativeCall_before(address return_address) {
|
||||
assert_cond(return_address != nullptr);
|
||||
NativeCall* call = nullptr;
|
||||
call = (NativeCall*)(return_address - NativeFarCall::return_address_offset);
|
||||
call = (NativeCall*)(return_address - NativeCall::instruction_size);
|
||||
DEBUG_ONLY(call->verify());
|
||||
return call;
|
||||
}
|
||||
@@ -432,7 +367,9 @@ void NativeIllegalInstruction::insert(address code_pos) {
|
||||
}
|
||||
|
||||
bool NativeInstruction::is_stop() {
|
||||
return uint_at(0) == 0xc0101073; // an illegal instruction, 'csrrw x0, time, x0'
|
||||
// an illegal instruction, 'csrrw x0, time, x0'
|
||||
uint32_t encoded = Assembler::encode_csrrw(x0, Assembler::time, x0);
|
||||
return uint_at(0) == encoded;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -481,6 +418,8 @@ void NativeGeneralJump::insert_unconditional(address code_pos, address entry) {
|
||||
MacroAssembler a(&cb);
|
||||
Assembler::IncompressibleScope scope(&a); // Fixed length: see NativeGeneralJump::get_instruction_size()
|
||||
|
||||
MacroAssembler::assert_alignment(code_pos);
|
||||
|
||||
int32_t offset = 0;
|
||||
a.movptr(t1, entry, offset, t0); // lui, lui, slli, add
|
||||
a.jr(t1, offset); // jalr
|
||||
@@ -512,6 +451,7 @@ bool NativePostCallNop::decode(int32_t& oopmap_slot, int32_t& cb_offset) const {
|
||||
}
|
||||
|
||||
bool NativePostCallNop::patch(int32_t oopmap_slot, int32_t cb_offset) {
|
||||
MacroAssembler::assert_alignment(addr_at(4));
|
||||
if (((oopmap_slot & 0xff) != oopmap_slot) || ((cb_offset & 0xffffff) != cb_offset)) {
|
||||
return false; // cannot encode
|
||||
}
|
||||
@@ -523,14 +463,17 @@ bool NativePostCallNop::patch(int32_t oopmap_slot, int32_t cb_offset) {
|
||||
return true; // successfully encoded
|
||||
}
|
||||
|
||||
void NativeDeoptInstruction::verify() {
|
||||
bool NativeDeoptInstruction::is_deopt_at(address instr) {
|
||||
assert(instr != nullptr, "Must be");
|
||||
uint32_t value = Assembler::ld_instr(instr);
|
||||
uint32_t encoded = Assembler::encode_csrrw(x0, Assembler::instret, x0);
|
||||
return value == encoded;
|
||||
}
|
||||
|
||||
// Inserts an undefined instruction at a given pc
|
||||
void NativeDeoptInstruction::insert(address code_pos) {
|
||||
// 0xc0201073 encodes CSRRW x0, instret, x0
|
||||
uint32_t insn = 0xc0201073;
|
||||
uint32_t *pos = (uint32_t *) code_pos;
|
||||
*pos = insn;
|
||||
MacroAssembler::assert_alignment(code_pos);
|
||||
uint32_t encoded = Assembler::encode_csrrw(x0, Assembler::instret, x0);
|
||||
Assembler::sd_instr(code_pos, encoded);
|
||||
ICache::invalidate_range(code_pos, 4);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ class NativeInstruction {
|
||||
static uint64_t get_data64_at(address src) { return Bytes::get_native_u8(src); }
|
||||
|
||||
public:
|
||||
|
||||
inline friend NativeInstruction* nativeInstruction_at(address addr);
|
||||
|
||||
static bool maybe_cpool_ref(address instr) {
|
||||
@@ -112,6 +111,7 @@ NativeCall* nativeCall_before(address return_address);
|
||||
// The NativeCall is an abstraction for accessing/manipulating native
|
||||
// call instructions (used to manipulate inline caches, primitive &
|
||||
// DSO calls, etc.).
|
||||
// NativeCall is reloc call on RISC-V. See MacroAssembler::reloc_call.
|
||||
class NativeCall: private NativeInstruction {
|
||||
// private: when common code is using byte_size()
|
||||
private:
|
||||
@@ -119,34 +119,48 @@ class NativeCall: private NativeInstruction {
|
||||
// Use byte_size() as it can be changed in runtime
|
||||
// Since instruction_size exists on NativeInstruction we need
|
||||
// to overload and hide it.
|
||||
instruction_size = 3 * Assembler::instruction_size // auipc + ld + jalr
|
||||
instruction_size = 3 * NativeInstruction::instruction_size // auipc + ld + jalr
|
||||
};
|
||||
public:
|
||||
|
||||
public:
|
||||
static int byte_size() {
|
||||
return 3 * NativeInstruction::instruction_size; // auipc + ld + jalr
|
||||
return NativeCall::instruction_size; // auipc + ld + jalr
|
||||
}
|
||||
|
||||
// Creation
|
||||
friend NativeCall* nativeCall_at(address addr);
|
||||
friend NativeCall* nativeCall_before(address return_address);
|
||||
|
||||
address instruction_address() const;
|
||||
address next_instruction_address() const;
|
||||
address return_address() const;
|
||||
address instruction_address() const { return addr_at(0); }
|
||||
address next_instruction_address() const { return addr_at(NativeCall::instruction_size); }
|
||||
address return_address() const { return addr_at(NativeCall::instruction_size); }
|
||||
address destination() const;
|
||||
address reloc_destination(address orig_address);
|
||||
address reloc_destination();
|
||||
|
||||
void verify_alignment() {} // do nothing on riscv
|
||||
void verify();
|
||||
void print();
|
||||
|
||||
void set_destination(address dest);
|
||||
bool set_destination_mt_safe(address dest, bool assert_lock = true);
|
||||
void set_destination(address dest) { Unimplemented(); }
|
||||
// patch stub to target address of the reloc call
|
||||
bool set_destination_mt_safe(address dest);
|
||||
// patch reloc call to stub address
|
||||
bool reloc_set_destination(address dest);
|
||||
|
||||
static bool is_at(address addr);
|
||||
static bool is_call_before(address return_address);
|
||||
|
||||
private:
|
||||
// return stub address, without checking stub address in locs
|
||||
address stub_address();
|
||||
// set target address at stub
|
||||
static void set_stub_address_destination_at(address dest, address value);
|
||||
// return target address at stub
|
||||
static address stub_address_destination_at(address src);
|
||||
// We either have a jalr or jal depending on distance to old destination.
|
||||
// This method emits a new jal if new destination is within jal reach.
|
||||
// Otherwise restores the jalr which can reach any destination.
|
||||
void optimize_call(address dest, bool mt_safe = true);
|
||||
};
|
||||
|
||||
// An interface for accessing/manipulating native mov reg, imm instructions.
|
||||
@@ -363,14 +377,7 @@ class NativeDeoptInstruction: public NativeInstruction {
|
||||
address instruction_address() const { return addr_at(instruction_offset); }
|
||||
address next_instruction_address() const { return addr_at(instruction_size); }
|
||||
|
||||
void verify();
|
||||
|
||||
static bool is_deopt_at(address instr) {
|
||||
assert(instr != nullptr, "");
|
||||
uint32_t value = Assembler::ld_instr(instr);
|
||||
// 0xc0201073 encodes CSRRW x0, instret, x0
|
||||
return value == 0xc0201073;
|
||||
}
|
||||
static bool is_deopt_at(address instr);
|
||||
|
||||
// MT-safe patching
|
||||
static void insert(address code_pos);
|
||||
|
||||
@@ -72,13 +72,12 @@ void Relocation::pd_set_data_value(address x, bool verify_only) {
|
||||
}
|
||||
|
||||
address Relocation::pd_call_destination(address orig_addr) {
|
||||
assert(is_call(), "should be an address instruction here");
|
||||
assert(is_call(), "should be a call here");
|
||||
if (NativeCall::is_at(addr())) {
|
||||
return nativeCall_at(addr())->reloc_destination(orig_addr);
|
||||
return nativeCall_at(addr())->reloc_destination();
|
||||
}
|
||||
// Non call reloc
|
||||
|
||||
if (orig_addr != nullptr) {
|
||||
// the extracted address from the instructions in address orig_addr
|
||||
address new_addr = MacroAssembler::pd_call_destination(orig_addr);
|
||||
// If call is branch to self, don't try to relocate it, just leave it
|
||||
// as branch to self. This happens during code generation if the code
|
||||
@@ -87,20 +86,19 @@ address Relocation::pd_call_destination(address orig_addr) {
|
||||
new_addr = (new_addr == orig_addr) ? addr() : new_addr;
|
||||
return new_addr;
|
||||
}
|
||||
|
||||
return MacroAssembler::pd_call_destination(addr());
|
||||
}
|
||||
|
||||
void Relocation::pd_set_call_destination(address x) {
|
||||
assert(is_call(), "should be an address instruction here");
|
||||
assert(is_call(), "should be a call here");
|
||||
if (NativeCall::is_at(addr())) {
|
||||
NativeCall* nc = nativeCall_at(addr());
|
||||
if (nc->reloc_set_destination(x)) {
|
||||
return;
|
||||
}
|
||||
NativeCall* call = nativeCall_at(addr());
|
||||
call->reloc_set_destination(x);
|
||||
} else {
|
||||
MacroAssembler::pd_patch_instruction_size(addr(), x);
|
||||
assert(pd_call_destination(addr()) == x, "fail in reloc");
|
||||
}
|
||||
MacroAssembler::pd_patch_instruction_size(addr(), x);
|
||||
address pd_call = pd_call_destination(addr());
|
||||
assert(pd_call == x, "fail in reloc");
|
||||
}
|
||||
|
||||
address* Relocation::pd_address_in_code() {
|
||||
|
||||
@@ -1269,6 +1269,26 @@ int CallDynamicJavaDirectNode::compute_padding(int current_offset) const
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallRuntimeDirectNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallLeafDirectNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallLeafDirectVectorNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallLeafNoFPDirectNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PRODUCT
|
||||
@@ -1493,7 +1513,7 @@ void MachEpilogNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
|
||||
code_stub = &stub->entry();
|
||||
}
|
||||
__ relocate(relocInfo::poll_return_type);
|
||||
__ safepoint_poll(*code_stub, true /* at_return */, false /* acquire */, true /* in_nmethod */);
|
||||
__ safepoint_poll(*code_stub, true /* at_return */, true /* in_nmethod */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2271,10 +2291,6 @@ encode %{
|
||||
__ mv(dst_reg, 1);
|
||||
%}
|
||||
|
||||
enc_class riscv_enc_mov_byte_map_base(iRegP dst) %{
|
||||
__ load_byte_map_base($dst$$Register);
|
||||
%}
|
||||
|
||||
enc_class riscv_enc_mov_n(iRegN dst, immN src) %{
|
||||
Register dst_reg = as_Register($dst$$reg);
|
||||
address con = (address)$src$$constant;
|
||||
@@ -2825,21 +2841,6 @@ operand immP_1()
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
// Card Table Byte Map Base
|
||||
operand immByteMapBase()
|
||||
%{
|
||||
// Get base of card map
|
||||
predicate(BarrierSet::barrier_set()->is_a(BarrierSet::CardTableBarrierSet) &&
|
||||
SHENANDOAHGC_ONLY(!BarrierSet::barrier_set()->is_a(BarrierSet::ShenandoahBarrierSet) &&)
|
||||
(CardTable::CardValue*)n->get_ptr() ==
|
||||
((CardTableBarrierSet*)(BarrierSet::barrier_set()))->card_table()->byte_map_base());
|
||||
match(ConP);
|
||||
|
||||
op_cost(0);
|
||||
format %{ %}
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
// Int Immediate: low 16-bit mask
|
||||
operand immI_16bits()
|
||||
%{
|
||||
@@ -3843,13 +3844,18 @@ opclass immIorL(immI, immL);
|
||||
pipeline %{
|
||||
|
||||
attributes %{
|
||||
// RISC-V instructions are of fixed length
|
||||
fixed_size_instructions; // Fixed size instructions TODO does
|
||||
max_instructions_per_bundle = 2; // Generic RISC-V 1, Sifive Series 7 2
|
||||
// RISC-V instructions come in 32-bit word units
|
||||
instruction_unit_size = 4; // An instruction is 4 bytes long
|
||||
instruction_fetch_unit_size = 64; // The processor fetches one line
|
||||
instruction_fetch_units = 1; // of 64 bytes
|
||||
// RISC-V instructions are of length 2 or 4 bytes.
|
||||
variable_size_instructions;
|
||||
instruction_unit_size = 2;
|
||||
|
||||
// Up to 4 instructions per bundle
|
||||
max_instructions_per_bundle = 4;
|
||||
|
||||
// The RISC-V processor fetches 64 bytes...
|
||||
instruction_fetch_unit_size = 64;
|
||||
|
||||
// ...in one line.
|
||||
instruction_fetch_units = 1;
|
||||
|
||||
// List of nop instructions
|
||||
nops( MachNop );
|
||||
@@ -4799,18 +4805,6 @@ instruct loadConP1(iRegPNoSp dst, immP_1 con)
|
||||
ins_pipe(ialu_imm);
|
||||
%}
|
||||
|
||||
// Load Byte Map Base Constant
|
||||
instruct loadByteMapBase(iRegPNoSp dst, immByteMapBase con)
|
||||
%{
|
||||
match(Set dst con);
|
||||
ins_cost(ALU_COST);
|
||||
format %{ "mv $dst, $con\t# Byte Map Base, #@loadByteMapBase" %}
|
||||
|
||||
ins_encode(riscv_enc_mov_byte_map_base(dst));
|
||||
|
||||
ins_pipe(ialu_imm);
|
||||
%}
|
||||
|
||||
// Load Narrow Pointer Constant
|
||||
instruct loadConN(iRegNNoSp dst, immN con)
|
||||
%{
|
||||
@@ -8195,7 +8189,7 @@ instruct unnecessary_membar_volatile_rvtso() %{
|
||||
ins_cost(0);
|
||||
|
||||
size(0);
|
||||
|
||||
|
||||
format %{ "#@unnecessary_membar_volatile_rvtso (unnecessary so empty encoding)" %}
|
||||
ins_encode %{
|
||||
__ block_comment("unnecessary_membar_volatile_rvtso");
|
||||
@@ -8431,6 +8425,17 @@ instruct castVV(vReg dst)
|
||||
ins_pipe(pipe_class_empty);
|
||||
%}
|
||||
|
||||
instruct castVVMask(vRegMask dst)
|
||||
%{
|
||||
match(Set dst (CastVV dst));
|
||||
|
||||
size(0);
|
||||
format %{ "# castVV of $dst" %}
|
||||
ins_encode(/* empty encoding */);
|
||||
ins_cost(0);
|
||||
ins_pipe(pipe_class_empty);
|
||||
%}
|
||||
|
||||
// ============================================================================
|
||||
// Convert Instructions
|
||||
|
||||
@@ -8565,7 +8570,7 @@ instruct convF2HF_reg_reg(iRegINoSp dst, fRegF src, fRegF ftmp, iRegINoSp xtmp)
|
||||
instruct reinterpretS2HF(fRegF dst, iRegI src)
|
||||
%{
|
||||
match(Set dst (ReinterpretS2HF src));
|
||||
format %{ "fmv.h.x $dst, $src" %}
|
||||
format %{ "fmv.h.x $dst, $src\t# reinterpretS2HF" %}
|
||||
ins_encode %{
|
||||
__ fmv_h_x($dst$$FloatRegister, $src$$Register);
|
||||
%}
|
||||
@@ -8585,7 +8590,7 @@ instruct convF2HFAndS2HF(fRegF dst, fRegF src)
|
||||
instruct reinterpretHF2S(iRegINoSp dst, fRegF src)
|
||||
%{
|
||||
match(Set dst (ReinterpretHF2S src));
|
||||
format %{ "fmv.x.h $dst, $src" %}
|
||||
format %{ "fmv.x.h $dst, $src\t# reinterpretHF2S" %}
|
||||
ins_encode %{
|
||||
__ fmv_x_h($dst$$Register, $src$$FloatRegister);
|
||||
%}
|
||||
@@ -8947,7 +8952,7 @@ instruct encodeKlass_not_null(iRegNNoSp dst, iRegP src) %{
|
||||
instruct decodeKlass_not_null(iRegPNoSp dst, iRegN src, iRegPNoSp tmp) %{
|
||||
match(Set dst (DecodeNKlass src));
|
||||
|
||||
effect(TEMP tmp);
|
||||
effect(TEMP_DEF dst, TEMP tmp);
|
||||
|
||||
ins_cost(ALU_COST);
|
||||
format %{ "decode_klass_not_null $dst, $src\t#@decodeKlass_not_null" %}
|
||||
@@ -10518,6 +10523,7 @@ instruct CallRuntimeDirect(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// Call Runtime Instruction
|
||||
@@ -10535,6 +10541,7 @@ instruct CallLeafDirect(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// Call Runtime Instruction without safepoint and with vector arguments
|
||||
@@ -10552,6 +10559,7 @@ instruct CallLeafDirectVector(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// Call Runtime Instruction
|
||||
@@ -10569,6 +10577,7 @@ instruct CallLeafNoFPDirect(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -110,6 +110,7 @@ source %{
|
||||
if (vlen < 4) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_VectorCastHF2F:
|
||||
case Op_VectorCastF2HF:
|
||||
case Op_AddVHF:
|
||||
|
||||
@@ -1004,20 +1004,23 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
|
||||
__ bnez(c_rarg2, call_thaw);
|
||||
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
address call_pc;
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
const address tr_call = __ reloc_call(resolve);
|
||||
if (tr_call == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
call_pc = __ reloc_call(resolve);
|
||||
if (call_pc == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
|
||||
__ j(exit);
|
||||
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, tr_call);
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, call_pc);
|
||||
if (stub == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
@@ -1036,26 +1039,36 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
|
||||
__ bnez(c_rarg2, call_thaw);
|
||||
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
address call_pc;
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
const address tr_call = __ reloc_call(resolve);
|
||||
if (tr_call == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
call_pc = __ reloc_call(resolve);
|
||||
if (call_pc == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
|
||||
__ j(exit);
|
||||
|
||||
__ bind(call_thaw);
|
||||
|
||||
ContinuationEntry::_thaw_call_pc_offset = __ pc() - start;
|
||||
__ rt_call(CAST_FROM_FN_PTR(address, StubRoutines::cont_thaw()));
|
||||
oop_maps->add_gc_map(__ pc() - start, map->deep_copy());
|
||||
ContinuationEntry::_return_pc_offset = __ pc() - start;
|
||||
__ post_call_nop();
|
||||
// Post call nops must be natural aligned due to cmodx rules.
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
ContinuationEntry::_thaw_call_pc_offset = __ pc() - start;
|
||||
__ rt_call(CAST_FROM_FN_PTR(address, StubRoutines::cont_thaw()));
|
||||
oop_maps->add_gc_map(__ pc() - start, map->deep_copy());
|
||||
ContinuationEntry::_return_pc_offset = __ pc() - start;
|
||||
__ post_call_nop();
|
||||
}
|
||||
|
||||
__ bind(exit);
|
||||
ContinuationEntry::_cleanup_offset = __ pc() - start;
|
||||
@@ -1084,7 +1097,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
__ jr(x11); // the exception handler
|
||||
}
|
||||
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, tr_call);
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, call_pc);
|
||||
if (stub == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
@@ -1117,10 +1130,16 @@ static void gen_continuation_yield(MacroAssembler* masm,
|
||||
|
||||
__ mv(c_rarg1, sp);
|
||||
|
||||
// Post call nops must be natural aligned due to cmodx rules.
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
frame_complete = __ pc() - start;
|
||||
address the_pc = __ pc();
|
||||
|
||||
__ post_call_nop(); // this must be exactly after the pc value that is pushed into the frame info, we use this nop for fast CodeBlob lookup
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
__ post_call_nop(); // this must be exactly after the pc value that is pushed into the frame info, we use this nop for fast CodeBlob lookup
|
||||
}
|
||||
|
||||
__ mv(c_rarg0, xthread);
|
||||
__ set_last_Java_frame(sp, fp, the_pc, t0);
|
||||
@@ -1777,15 +1796,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
|
||||
// check for safepoint operation in progress and/or pending suspend requests
|
||||
{
|
||||
// We need an acquire here to ensure that any subsequent load of the
|
||||
// global SafepointSynchronize::_state flag is ordered after this load
|
||||
// of the thread-local polling word. We don't want this poll to
|
||||
// return false (i.e. not safepointing) and a later poll of the global
|
||||
// SafepointSynchronize::_state spuriously to return true.
|
||||
// This is to avoid a race when we're in a native->Java transition
|
||||
// racing the code which wakes up from a safepoint.
|
||||
|
||||
__ safepoint_poll(safepoint_in_progress, true /* at_return */, true /* acquire */, false /* in_nmethod */);
|
||||
__ safepoint_poll(safepoint_in_progress, true /* at_return */, false /* in_nmethod */);
|
||||
__ lwu(t0, Address(xthread, JavaThread::suspend_flags_offset()));
|
||||
__ bnez(t0, safepoint_in_progress);
|
||||
__ bind(safepoint_in_progress_done);
|
||||
|
||||
@@ -683,10 +683,11 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address start = __ pc();
|
||||
|
||||
if (UseBlockZeroing) {
|
||||
// Ensure count >= 2*CacheLineSize so that it still deserves a cbo.zero
|
||||
// after alignment.
|
||||
int zicboz_block_size = VM_Version::zicboz_block_size.value();
|
||||
// Ensure count >= 2 * zicboz_block_size so that it still deserves
|
||||
// a cbo.zero after alignment.
|
||||
Label small;
|
||||
int low_limit = MAX2(2 * CacheLineSize, BlockZeroingLowLimit) / wordSize;
|
||||
int low_limit = MAX2(2 * zicboz_block_size, (int)BlockZeroingLowLimit) / wordSize;
|
||||
__ mv(tmp1, low_limit);
|
||||
__ blt(cnt, tmp1, small);
|
||||
__ zero_dcache_blocks(base, cnt, tmp1, tmp2);
|
||||
@@ -6354,18 +6355,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ ret();
|
||||
|
||||
__ bind(NaN_SLOW);
|
||||
__ fmv_x_w(dst, src);
|
||||
|
||||
// preserve the payloads of non-canonical NaNs.
|
||||
__ srai(dst, dst, 13);
|
||||
// preserve the sign bit.
|
||||
__ srai(t1, dst, 13);
|
||||
__ slli(t1, t1, 10);
|
||||
__ mv(t0, 0x3ff);
|
||||
__ orr(t1, t1, t0);
|
||||
|
||||
// get the result by merging sign bit and payloads of preserved non-canonical NaNs.
|
||||
__ andr(dst, dst, t1);
|
||||
__ float_to_float16_NaN(dst, src, t0, t1);
|
||||
|
||||
__ ret();
|
||||
return entry;
|
||||
|
||||
@@ -1229,15 +1229,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
{
|
||||
Label L, Continue;
|
||||
|
||||
// We need an acquire here to ensure that any subsequent load of the
|
||||
// global SafepointSynchronize::_state flag is ordered after this load
|
||||
// of the thread-local polling word. We don't want this poll to
|
||||
// return false (i.e. not safepointing) and a later poll of the global
|
||||
// SafepointSynchronize::_state spuriously to return true.
|
||||
//
|
||||
// This is to avoid a race when we're in a native->Java transition
|
||||
// racing the code which wakes up from a safepoint.
|
||||
__ safepoint_poll(L, true /* at_return */, true /* acquire */, false /* in_nmethod */);
|
||||
__ safepoint_poll(L, true /* at_return */, false /* in_nmethod */);
|
||||
__ lwu(t1, Address(xthread, JavaThread::suspend_flags_offset()));
|
||||
__ beqz(t1, Continue);
|
||||
__ bind(L);
|
||||
@@ -1388,7 +1380,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
|
||||
Label slow_path;
|
||||
Label fast_path;
|
||||
__ safepoint_poll(slow_path, true /* at_return */, false /* acquire */, false /* in_nmethod */);
|
||||
__ safepoint_poll(slow_path, true /* at_return */, false /* in_nmethod */);
|
||||
__ j(fast_path);
|
||||
|
||||
__ bind(slow_path);
|
||||
|
||||
@@ -133,6 +133,7 @@ Address TemplateTable::at_bcp(int offset) {
|
||||
void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
|
||||
Register temp_reg, bool load_bc_into_bc_reg /*=true*/,
|
||||
int byte_no) {
|
||||
assert_different_registers(bc_reg, temp_reg);
|
||||
if (!RewriteBytecodes) { return; }
|
||||
Label L_patch_done;
|
||||
|
||||
@@ -196,7 +197,11 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
|
||||
__ bind(L_okay);
|
||||
#endif
|
||||
|
||||
// patch bytecode
|
||||
// Patch bytecode with release store to coordinate with ResolvedFieldEntry loads
|
||||
// in fast bytecode codelets. load_field_entry has a memory barrier that gains
|
||||
// the needed ordering, together with control dependency on entering the fast codelet
|
||||
// itself.
|
||||
__ membar(MacroAssembler::LoadStore | MacroAssembler::StoreStore);
|
||||
__ sb(bc_reg, at_bcp(0));
|
||||
__ bind(L_patch_done);
|
||||
}
|
||||
@@ -3017,6 +3022,7 @@ void TemplateTable::fast_storefield(TosState state) {
|
||||
|
||||
// X11: field offset, X12: field holder, X13: flags
|
||||
load_resolved_field_entry(x12, x12, noreg, x11, x13);
|
||||
__ verify_field_offset(x11);
|
||||
|
||||
{
|
||||
Label notVolatile;
|
||||
@@ -3104,6 +3110,8 @@ void TemplateTable::fast_accessfield(TosState state) {
|
||||
__ load_field_entry(x12, x11);
|
||||
|
||||
__ load_sized_value(x11, Address(x12, in_bytes(ResolvedFieldEntry::field_offset_offset())), sizeof(int), true /*is_signed*/);
|
||||
__ verify_field_offset(x11);
|
||||
|
||||
__ load_unsigned_byte(x13, Address(x12, in_bytes(ResolvedFieldEntry::flags_offset())));
|
||||
|
||||
// x10: object
|
||||
@@ -3159,7 +3167,9 @@ void TemplateTable::fast_xaccess(TosState state) {
|
||||
__ ld(x10, aaddress(0));
|
||||
// access constant pool cache
|
||||
__ load_field_entry(x12, x13, 2);
|
||||
|
||||
__ load_sized_value(x11, Address(x12, in_bytes(ResolvedFieldEntry::field_offset_offset())), sizeof(int), true /*is_signed*/);
|
||||
__ verify_field_offset(x11);
|
||||
|
||||
// make sure exception is reported in correct bcp range (getfield is
|
||||
// next instruction)
|
||||
|
||||
@@ -147,7 +147,7 @@ void VM_Version::common_initialize() {
|
||||
|
||||
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) {
|
||||
FLAG_SET_DEFAULT(AvoidUnalignedAccesses,
|
||||
unaligned_access.value() != MISALIGNED_FAST);
|
||||
unaligned_scalar.value() != MISALIGNED_SCALAR_FAST);
|
||||
}
|
||||
|
||||
if (!AvoidUnalignedAccesses) {
|
||||
@@ -162,7 +162,12 @@ void VM_Version::common_initialize() {
|
||||
// This machine has fast unaligned memory accesses
|
||||
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
|
||||
FLAG_SET_DEFAULT(UseUnalignedAccesses,
|
||||
unaligned_access.value() == MISALIGNED_FAST);
|
||||
(unaligned_scalar.value() == MISALIGNED_SCALAR_FAST));
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(AlignVector)) {
|
||||
FLAG_SET_DEFAULT(AlignVector,
|
||||
unaligned_vector.value() != MISALIGNED_VECTOR_FAST);
|
||||
}
|
||||
|
||||
#ifdef __riscv_ztso
|
||||
@@ -181,12 +186,13 @@ void VM_Version::common_initialize() {
|
||||
FLAG_SET_DEFAULT(UsePopCountInstruction, false);
|
||||
}
|
||||
|
||||
if (UseZicboz) {
|
||||
if (UseZicboz && zicboz_block_size.enabled() && zicboz_block_size.value() > 0) {
|
||||
assert(is_power_of_2(zicboz_block_size.value()), "Sanity");
|
||||
if (FLAG_IS_DEFAULT(UseBlockZeroing)) {
|
||||
FLAG_SET_DEFAULT(UseBlockZeroing, true);
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(BlockZeroingLowLimit)) {
|
||||
FLAG_SET_DEFAULT(BlockZeroingLowLimit, 2 * CacheLineSize);
|
||||
FLAG_SET_DEFAULT(BlockZeroingLowLimit, 4 * zicboz_block_size.value());
|
||||
}
|
||||
} else if (UseBlockZeroing) {
|
||||
warning("Block zeroing is not available");
|
||||
@@ -194,24 +200,19 @@ void VM_Version::common_initialize() {
|
||||
}
|
||||
|
||||
if (UseRVV) {
|
||||
if (!ext_V.enabled() && FLAG_IS_DEFAULT(UseRVV)) {
|
||||
warning("RVV is not supported on this CPU");
|
||||
FLAG_SET_DEFAULT(UseRVV, false);
|
||||
} else {
|
||||
// read vector length from vector CSR vlenb
|
||||
_initial_vector_length = cpu_vector_length();
|
||||
}
|
||||
// read vector length from vector CSR vlenb
|
||||
_initial_vector_length = cpu_vector_length();
|
||||
}
|
||||
|
||||
// Misc Intrinsics could depend on RVV
|
||||
// Misc Intrinsics that could depend on RVV.
|
||||
|
||||
if (UseZba || UseRVV) {
|
||||
if (!AvoidUnalignedAccesses && (UseZba || UseRVV)) {
|
||||
if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) {
|
||||
FLAG_SET_DEFAULT(UseCRC32Intrinsics, true);
|
||||
}
|
||||
} else {
|
||||
if (!FLAG_IS_DEFAULT(UseCRC32Intrinsics)) {
|
||||
warning("CRC32 intrinsic requires Zba or RVV instructions (not available on this CPU)");
|
||||
warning("CRC32 intrinsic are not available on this CPU.");
|
||||
}
|
||||
FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
|
||||
}
|
||||
@@ -325,20 +326,40 @@ void VM_Version::c2_initialize() {
|
||||
FLAG_SET_DEFAULT(UseMulAddIntrinsic, true);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseMultiplyToLenIntrinsic, true);
|
||||
if (!AvoidUnalignedAccesses) {
|
||||
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseMultiplyToLenIntrinsic, true);
|
||||
}
|
||||
} else if (UseMultiplyToLenIntrinsic) {
|
||||
warning("Intrinsics for BigInteger.multiplyToLen() not available on this CPU.");
|
||||
FLAG_SET_DEFAULT(UseMultiplyToLenIntrinsic, false);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(UseSquareToLenIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseSquareToLenIntrinsic, true);
|
||||
if (!AvoidUnalignedAccesses) {
|
||||
if (FLAG_IS_DEFAULT(UseSquareToLenIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseSquareToLenIntrinsic, true);
|
||||
}
|
||||
} else if (UseSquareToLenIntrinsic) {
|
||||
warning("Intrinsics for BigInteger.squareToLen() not available on this CPU.");
|
||||
FLAG_SET_DEFAULT(UseSquareToLenIntrinsic, false);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseMontgomeryMultiplyIntrinsic, true);
|
||||
if (!AvoidUnalignedAccesses) {
|
||||
if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseMontgomeryMultiplyIntrinsic, true);
|
||||
}
|
||||
} else if (UseMontgomeryMultiplyIntrinsic) {
|
||||
warning("Intrinsics for BigInteger.montgomeryMultiply() not available on this CPU.");
|
||||
FLAG_SET_DEFAULT(UseMontgomeryMultiplyIntrinsic, false);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseMontgomerySquareIntrinsic, true);
|
||||
if (!AvoidUnalignedAccesses) {
|
||||
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseMontgomerySquareIntrinsic, true);
|
||||
}
|
||||
} else if (UseMontgomerySquareIntrinsic) {
|
||||
warning("Intrinsics for BigInteger.montgomerySquare() not available on this CPU.");
|
||||
FLAG_SET_DEFAULT(UseMontgomerySquareIntrinsic, false);
|
||||
}
|
||||
|
||||
// Adler32
|
||||
@@ -456,10 +477,6 @@ void VM_Version::c2_initialize() {
|
||||
warning("AES/CTR intrinsics are not available on this CPU");
|
||||
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(AlignVector)) {
|
||||
FLAG_SET_DEFAULT(AlignVector, AvoidUnalignedAccesses);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // COMPILER2
|
||||
|
||||
@@ -86,25 +86,27 @@ class VM_Version : public Abstract_VM_Version {
|
||||
} \
|
||||
} \
|
||||
|
||||
#define UPDATE_DEFAULT_DEP(flag, dep) \
|
||||
void update_flag() { \
|
||||
assert(enabled(), "Must be."); \
|
||||
/* dep must be declared before */ \
|
||||
assert((uintptr_t)(this) > \
|
||||
(uintptr_t)(&dep), "Invalid");\
|
||||
if (FLAG_IS_DEFAULT(flag)) { \
|
||||
if (dep.enabled()) { \
|
||||
FLAG_SET_DEFAULT(flag, true); \
|
||||
} else { \
|
||||
FLAG_SET_DEFAULT(flag, false); \
|
||||
} \
|
||||
} else { \
|
||||
/* Sync CPU features with flags */ \
|
||||
if (!flag) { \
|
||||
disable_feature(); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
#define UPDATE_DEFAULT_DEP(flag, dep) \
|
||||
void update_flag() { \
|
||||
assert(enabled(), "Must be."); \
|
||||
/* dep must be declared before */ \
|
||||
assert((uintptr_t)(this) > \
|
||||
(uintptr_t)(&dep), "Invalid"); \
|
||||
if (FLAG_IS_DEFAULT(flag)) { \
|
||||
if (dep.enabled()) { \
|
||||
FLAG_SET_DEFAULT(flag, true); \
|
||||
} else { \
|
||||
FLAG_SET_DEFAULT(flag, false); \
|
||||
/* Sync CPU features with flags */ \
|
||||
disable_feature(); \
|
||||
} \
|
||||
} else { \
|
||||
/* Sync CPU features with flags */ \
|
||||
if (!flag) { \
|
||||
disable_feature(); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
|
||||
#define NO_UPDATE_DEFAULT \
|
||||
void update_flag() {} \
|
||||
@@ -151,7 +153,8 @@ class VM_Version : public Abstract_VM_Version {
|
||||
// mvendorid Manufactory JEDEC id encoded, ISA vol 2 3.1.2..
|
||||
// marchid Id for microarch. Mvendorid plus marchid uniquely identify the microarch.
|
||||
// mimpid A unique encoding of the version of the processor implementation.
|
||||
// unaligned_access Unaligned memory accesses (unknown, unspported, emulated, slow, firmware, fast)
|
||||
// unaligned_scalar Performance of misaligned scalar accesses (unknown, emulated, slow, fast, unsupported)
|
||||
// unaligned_vector Performance of misaligned vector accesses (unknown, unspported, slow, fast)
|
||||
// satp mode SATP bits (number of virtual addr bits) mbare, sv39, sv48, sv57, sv64
|
||||
|
||||
public:
|
||||
@@ -160,45 +163,47 @@ class VM_Version : public Abstract_VM_Version {
|
||||
|
||||
// Note: the order matters, depender should be after their dependee. E.g. ext_V before ext_Zvbb.
|
||||
// declaration name , extension name, bit pos ,in str, mapped flag)
|
||||
#define RV_FEATURE_FLAGS(decl) \
|
||||
decl(ext_I , "i" , ('I' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_M , "m" , ('M' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_A , "a" , ('A' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_F , "f" , ('F' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_D , "d" , ('D' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_C , "c" , ('C' - 'A'), true , UPDATE_DEFAULT(UseRVC)) \
|
||||
decl(ext_Q , "q" , ('Q' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_H , "h" , ('H' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_V , "v" , ('V' - 'A'), true , UPDATE_DEFAULT(UseRVV)) \
|
||||
decl(ext_Zicbom , "Zicbom" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbom)) \
|
||||
decl(ext_Zicboz , "Zicboz" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicboz)) \
|
||||
decl(ext_Zicbop , "Zicbop" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbop)) \
|
||||
decl(ext_Zba , "Zba" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZba)) \
|
||||
decl(ext_Zbb , "Zbb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbb)) \
|
||||
decl(ext_Zbc , "Zbc" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zbs , "Zbs" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \
|
||||
decl(ext_Zbkb , "Zbkb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbkb)) \
|
||||
decl(ext_Zcb , "Zcb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZcb)) \
|
||||
decl(ext_Zfa , "Zfa" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfa)) \
|
||||
decl(ext_Zfh , "Zfh" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfh)) \
|
||||
decl(ext_Zfhmin , "Zfhmin" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfhmin)) \
|
||||
decl(ext_Zicsr , "Zicsr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zicntr , "Zicntr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zifencei , "Zifencei" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zic64b , "Zic64b" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZic64b)) \
|
||||
decl(ext_Ztso , "Ztso" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZtso)) \
|
||||
decl(ext_Zihintpause , "Zihintpause" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZihintpause)) \
|
||||
decl(ext_Zacas , "Zacas" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZacas)) \
|
||||
decl(ext_Zvbb , "Zvbb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbb, ext_V)) \
|
||||
decl(ext_Zvbc , "Zvbc" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbc, ext_V)) \
|
||||
decl(ext_Zvfh , "Zvfh" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvfh, ext_V)) \
|
||||
decl(ext_Zvkn , "Zvkn" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvkn, ext_V)) \
|
||||
decl(ext_Zicond , "Zicond" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicond)) \
|
||||
decl(mvendorid , "VendorId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(marchid , "ArchId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(mimpid , "ImpId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(unaligned_access, "Unaligned" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(satp_mode , "SATP" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
#define RV_FEATURE_FLAGS(decl) \
|
||||
decl(ext_I , "i" , ('I' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_M , "m" , ('M' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_A , "a" , ('A' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_F , "f" , ('F' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_D , "d" , ('D' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_C , "c" , ('C' - 'A'), true , UPDATE_DEFAULT(UseRVC)) \
|
||||
decl(ext_Q , "q" , ('Q' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_H , "h" , ('H' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_V , "v" , ('V' - 'A'), true , UPDATE_DEFAULT(UseRVV)) \
|
||||
decl(ext_Zicbom , "Zicbom" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbom)) \
|
||||
decl(ext_Zicboz , "Zicboz" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicboz)) \
|
||||
decl(ext_Zicbop , "Zicbop" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbop)) \
|
||||
decl(ext_Zba , "Zba" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZba)) \
|
||||
decl(ext_Zbb , "Zbb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbb)) \
|
||||
decl(ext_Zbc , "Zbc" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zbs , "Zbs" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \
|
||||
decl(ext_Zbkb , "Zbkb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbkb)) \
|
||||
decl(ext_Zcb , "Zcb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZcb)) \
|
||||
decl(ext_Zfa , "Zfa" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfa)) \
|
||||
decl(ext_Zfh , "Zfh" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfh)) \
|
||||
decl(ext_Zfhmin , "Zfhmin" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfhmin)) \
|
||||
decl(ext_Zicsr , "Zicsr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zicntr , "Zicntr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zifencei , "Zifencei" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zic64b , "Zic64b" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZic64b)) \
|
||||
decl(ext_Ztso , "Ztso" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZtso)) \
|
||||
decl(ext_Zihintpause , "Zihintpause" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZihintpause)) \
|
||||
decl(ext_Zacas , "Zacas" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZacas)) \
|
||||
decl(ext_Zvbb , "Zvbb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbb, ext_V)) \
|
||||
decl(ext_Zvbc , "Zvbc" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbc, ext_V)) \
|
||||
decl(ext_Zvfh , "Zvfh" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvfh, ext_V)) \
|
||||
decl(ext_Zvkn , "Zvkn" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvkn, ext_V)) \
|
||||
decl(ext_Zicond , "Zicond" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicond)) \
|
||||
decl(mvendorid , "VendorId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(marchid , "ArchId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(mimpid , "ImpId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(satp_mode , "SATP" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(unaligned_scalar , "UnalignedScalar", RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(unaligned_vector , "UnalignedVector", RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(zicboz_block_size, "ZicbozBlockSize", RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
|
||||
#define DECLARE_RV_FEATURE(NAME, PRETTY, BIT, FSTRING, FLAGF) \
|
||||
struct NAME##RVFeatureValue : public RVFeatureValue { \
|
||||
@@ -273,12 +278,19 @@ class VM_Version : public Abstract_VM_Version {
|
||||
static VM_MODE parse_satp_mode(const char* vm_mode);
|
||||
|
||||
// Values from riscv_hwprobe()
|
||||
enum UNALIGNED_ACCESS : int {
|
||||
MISALIGNED_UNKNOWN = 0,
|
||||
MISALIGNED_EMULATED = 1,
|
||||
MISALIGNED_SLOW = 2,
|
||||
MISALIGNED_FAST = 3,
|
||||
MISALIGNED_UNSUPPORTED = 4
|
||||
enum UNALIGNED_SCALAR_ACCESS : int {
|
||||
MISALIGNED_SCALAR_UNKNOWN = 0,
|
||||
MISALIGNED_SCALAR_EMULATED = 1,
|
||||
MISALIGNED_SCALAR_SLOW = 2,
|
||||
MISALIGNED_SCALAR_FAST = 3,
|
||||
MISALIGNED_SCALAR_UNSUPPORTED = 4
|
||||
};
|
||||
|
||||
enum UNALIGNED_VECTOR_ACCESS : int {
|
||||
MISALIGNED_VECTOR_UNKNOWN = 0,
|
||||
MISALIGNED_VECTOR_SLOW = 2,
|
||||
MISALIGNED_VECTOR_FAST = 3,
|
||||
MISALIGNED_VECTOR_UNSUPPORTED = 4
|
||||
};
|
||||
|
||||
// Null terminated list
|
||||
|
||||
@@ -356,7 +356,7 @@ instruct g1CompareAndExchangeP(iRegP mem_ptr, rarg5RegP oldval, iRegP_N2P newval
|
||||
|
||||
__ z_lgr($res$$Register, $oldval$$Register); // previous content
|
||||
|
||||
__ z_csg($oldval$$Register, $newval$$Register, 0, $mem_ptr$$reg);
|
||||
__ z_csg($res$$Register, $newval$$Register, 0, $mem_ptr$$reg);
|
||||
|
||||
write_barrier_post(masm, this,
|
||||
$mem_ptr$$Register /* store_addr */,
|
||||
|
||||
@@ -1398,11 +1398,7 @@ void Assembler::addl(Address dst, Register src) {
|
||||
|
||||
void Assembler::eaddl(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x01);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x01, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::addl(Register dst, int32_t imm32) {
|
||||
@@ -1432,11 +1428,7 @@ void Assembler::addl(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::eaddl(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void)emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_arith(0x03, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x03, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::addr_nop_4() {
|
||||
@@ -1657,17 +1649,18 @@ void Assembler::eandl(Register dst, Register src1, Address src2, bool no_flags)
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x23, no_flags);
|
||||
}
|
||||
|
||||
void Assembler::eandl(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x21, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::andl(Register dst, Register src) {
|
||||
(void) prefix_and_encode(dst->encoding(), src->encoding());
|
||||
emit_arith(0x23, 0xC0, dst, src);
|
||||
}
|
||||
|
||||
void Assembler::eandl(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_arith(0x23, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x23, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::andnl(Register dst, Register src1, Register src2) {
|
||||
@@ -2519,7 +2512,7 @@ void Assembler::imull(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::eimull(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
emit_eevex_or_demote(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0xAF, no_flags, true /* is_map1 */, true /* swap */);
|
||||
emit_eevex_or_demote(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0xAF, no_flags, true /* is_map1 */, true /* swap */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::imull(Register dst, Address src, int32_t value) {
|
||||
@@ -4419,11 +4412,7 @@ void Assembler::enotl(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::eorw(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_arith(0x0B, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_66, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_16bit, 0x0B, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::orl(Address dst, int32_t imm32) {
|
||||
@@ -4467,11 +4456,7 @@ void Assembler::orl(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::eorl(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_arith(0x0B, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x0B, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::orl(Address dst, Register src) {
|
||||
@@ -4483,11 +4468,7 @@ void Assembler::orl(Address dst, Register src) {
|
||||
|
||||
void Assembler::eorl(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x09);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x09, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::orb(Address dst, int imm8) {
|
||||
@@ -4517,11 +4498,7 @@ void Assembler::orb(Address dst, Register src) {
|
||||
|
||||
void Assembler::eorb(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_8bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x08);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_8bit, 0x08, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::packsswb(XMMRegister dst, XMMRegister src) {
|
||||
@@ -7323,11 +7300,7 @@ void Assembler::xorl(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::exorl(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_arith(0x33, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x33, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::xorl(Address dst, Register src) {
|
||||
@@ -7339,11 +7312,7 @@ void Assembler::xorl(Address dst, Register src) {
|
||||
|
||||
void Assembler::exorl(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x31);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_32bit, 0x31, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::xorb(Register dst, Address src) {
|
||||
@@ -7367,11 +7336,7 @@ void Assembler::xorb(Address dst, Register src) {
|
||||
|
||||
void Assembler::exorb(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_8bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x30);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_8bit, 0x30, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::xorw(Register dst, Address src) {
|
||||
@@ -12891,6 +12856,31 @@ void Assembler::eevex_prefix_ndd(Address adr, int ndd_enc, int xreg_enc, VexSimd
|
||||
vex_prefix(adr, ndd_enc, xreg_enc, pre, opc, attributes, /* nds_is_ndd */ true, no_flags);
|
||||
}
|
||||
|
||||
void Assembler::emit_eevex_or_demote(Register dst, Address src1, Register src2, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int opcode_byte, bool no_flags, bool is_map1, bool is_commutative) {
|
||||
if (is_commutative && is_demotable(no_flags, dst->encoding(), src2->encoding())) {
|
||||
// Opcode byte adjustment due to mismatch between NDD and equivalent demotable variant
|
||||
opcode_byte += 2;
|
||||
if (size == EVEX_64bit) {
|
||||
emit_prefix_and_int8(get_prefixq(src1, dst, is_map1), opcode_byte);
|
||||
} else {
|
||||
// For 32-bit, 16-bit and 8-bit
|
||||
if (size == EVEX_16bit) {
|
||||
emit_int8(0x66);
|
||||
}
|
||||
prefix(src1, dst, false, is_map1);
|
||||
emit_int8(opcode_byte);
|
||||
}
|
||||
} else {
|
||||
bool vex_w = (size == EVEX_64bit) ? true : false;
|
||||
InstructionAttr attributes(AVX_128bit, vex_w, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, size);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), pre, opc, &attributes, no_flags);
|
||||
emit_int8(opcode_byte);
|
||||
}
|
||||
emit_operand(src2, src1, 0);
|
||||
}
|
||||
|
||||
void Assembler::emit_eevex_or_demote(Register dst, Register src1, Address src2, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int opcode_byte, bool no_flags, bool is_map1) {
|
||||
if (is_demotable(no_flags, dst->encoding(), src1->encoding())) {
|
||||
@@ -12991,18 +12981,20 @@ void Assembler::emit_eevex_or_demote(int dst_enc, int nds_enc, int src_enc, int8
|
||||
}
|
||||
|
||||
void Assembler::emit_eevex_or_demote(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int opcode_byte, bool no_flags, bool is_map1, bool swap) {
|
||||
int size, int opcode_byte, bool no_flags, bool is_map1, bool swap, bool is_commutative) {
|
||||
int encode;
|
||||
bool is_prefixq = (size == EVEX_64bit) ? true : false;
|
||||
if (is_demotable(no_flags, dst_enc, nds_enc)) {
|
||||
bool first_operand_demotable = is_demotable(no_flags, dst_enc, nds_enc);
|
||||
bool second_operand_demotable = is_commutative && is_demotable(no_flags, dst_enc, src_enc);
|
||||
if (first_operand_demotable || second_operand_demotable) {
|
||||
if (size == EVEX_16bit) {
|
||||
emit_int8(0x66);
|
||||
}
|
||||
|
||||
int src = first_operand_demotable ? src_enc : nds_enc;
|
||||
if (swap) {
|
||||
encode = is_prefixq ? prefixq_and_encode(dst_enc, src_enc, is_map1) : prefix_and_encode(dst_enc, src_enc, is_map1);
|
||||
encode = is_prefixq ? prefixq_and_encode(dst_enc, src, is_map1) : prefix_and_encode(dst_enc, src, is_map1);
|
||||
} else {
|
||||
encode = is_prefixq ? prefixq_and_encode(src_enc, dst_enc, is_map1) : prefix_and_encode(src_enc, dst_enc, is_map1);
|
||||
encode = is_prefixq ? prefixq_and_encode(src, dst_enc, is_map1) : prefix_and_encode(src, dst_enc, is_map1);
|
||||
}
|
||||
emit_opcode_prefix_and_encoding((unsigned char)opcode_byte, 0xC0, encode);
|
||||
} else {
|
||||
@@ -13050,6 +13042,26 @@ int Assembler::eevex_prefix_and_encode_nf(int dst_enc, int nds_enc, int src_enc,
|
||||
return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, attributes, /* src_is_gpr */ true, /* nds_is_ndd */ false, no_flags);
|
||||
}
|
||||
|
||||
void Assembler::emit_eevex_prefix_or_demote_arith_ndd(Register dst, Register src1, Register src2, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int op1, int op2, bool no_flags, bool is_commutative) {
|
||||
bool demotable = is_demotable(no_flags, dst->encoding(), src1->encoding());
|
||||
if (!demotable && is_commutative) {
|
||||
if (is_demotable(no_flags, dst->encoding(), src2->encoding())) {
|
||||
// swap src1 and src2
|
||||
Register tmp = src1;
|
||||
src1 = src2;
|
||||
src2 = tmp;
|
||||
}
|
||||
}
|
||||
bool vex_w = (size == EVEX_64bit) ? true : false;
|
||||
bool use_prefixq = vex_w;
|
||||
InstructionAttr attributes(AVX_128bit, vex_w, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void)emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), pre, opc, &attributes, no_flags, use_prefixq);
|
||||
emit_arith(op1, op2, src1, src2);
|
||||
}
|
||||
|
||||
void Assembler::emit_eevex_prefix_or_demote_arith_ndd(Register dst, Register nds, int32_t imm32, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int op1, int op2, bool no_flags) {
|
||||
int dst_enc = dst->encoding();
|
||||
@@ -13060,7 +13072,6 @@ void Assembler::emit_eevex_prefix_or_demote_arith_ndd(Register dst, Register nds
|
||||
} else {
|
||||
bool vex_w = (size == EVEX_64bit) ? true : false;
|
||||
InstructionAttr attributes(AVX_128bit, vex_w, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
//attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, size);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix_and_encode(0, dst_enc, nds_enc, pre, opc, &attributes, /* src_is_gpr */ true, /* nds_is_ndd */ true, no_flags);
|
||||
|
||||
@@ -13689,7 +13700,7 @@ void Assembler::pdepq(Register dst, Register src1, Address src2) {
|
||||
|
||||
void Assembler::sarxl(Register dst, Register src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes, true);
|
||||
emit_int16((unsigned char)0xF7, (0xC0 | encode));
|
||||
}
|
||||
@@ -13697,7 +13708,7 @@ void Assembler::sarxl(Register dst, Register src1, Register src2) {
|
||||
void Assembler::sarxl(Register dst, Address src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit);
|
||||
vex_prefix(src1, src2->encoding(), dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes);
|
||||
emit_int8((unsigned char)0xF7);
|
||||
@@ -13706,7 +13717,7 @@ void Assembler::sarxl(Register dst, Address src1, Register src2) {
|
||||
|
||||
void Assembler::sarxq(Register dst, Register src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes, true);
|
||||
emit_int16((unsigned char)0xF7, (0xC0 | encode));
|
||||
}
|
||||
@@ -13714,7 +13725,7 @@ void Assembler::sarxq(Register dst, Register src1, Register src2) {
|
||||
void Assembler::sarxq(Register dst, Address src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit);
|
||||
vex_prefix(src1, src2->encoding(), dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes);
|
||||
emit_int8((unsigned char)0xF7);
|
||||
@@ -13723,7 +13734,7 @@ void Assembler::sarxq(Register dst, Address src1, Register src2) {
|
||||
|
||||
void Assembler::shlxl(Register dst, Register src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes, true);
|
||||
emit_int16((unsigned char)0xF7, (0xC0 | encode));
|
||||
}
|
||||
@@ -13731,7 +13742,7 @@ void Assembler::shlxl(Register dst, Register src1, Register src2) {
|
||||
void Assembler::shlxl(Register dst, Address src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit);
|
||||
vex_prefix(src1, src2->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
|
||||
emit_int8((unsigned char)0xF7);
|
||||
@@ -13740,7 +13751,7 @@ void Assembler::shlxl(Register dst, Address src1, Register src2) {
|
||||
|
||||
void Assembler::shlxq(Register dst, Register src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes, true);
|
||||
emit_int16((unsigned char)0xF7, (0xC0 | encode));
|
||||
}
|
||||
@@ -13748,7 +13759,7 @@ void Assembler::shlxq(Register dst, Register src1, Register src2) {
|
||||
void Assembler::shlxq(Register dst, Address src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit);
|
||||
vex_prefix(src1, src2->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
|
||||
emit_int8((unsigned char)0xF7);
|
||||
@@ -13757,7 +13768,7 @@ void Assembler::shlxq(Register dst, Address src1, Register src2) {
|
||||
|
||||
void Assembler::shrxl(Register dst, Register src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_38, &attributes, true);
|
||||
emit_int16((unsigned char)0xF7, (0xC0 | encode));
|
||||
}
|
||||
@@ -13765,7 +13776,7 @@ void Assembler::shrxl(Register dst, Register src1, Register src2) {
|
||||
void Assembler::shrxl(Register dst, Address src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit);
|
||||
vex_prefix(src1, src2->encoding(), dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_38, &attributes);
|
||||
emit_int8((unsigned char)0xF7);
|
||||
@@ -13774,7 +13785,7 @@ void Assembler::shrxl(Register dst, Address src1, Register src2) {
|
||||
|
||||
void Assembler::shrxq(Register dst, Register src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_38, &attributes, true);
|
||||
emit_int16((unsigned char)0xF7, (0xC0 | encode));
|
||||
}
|
||||
@@ -13782,7 +13793,7 @@ void Assembler::shrxq(Register dst, Register src1, Register src2) {
|
||||
void Assembler::shrxq(Register dst, Address src1, Register src2) {
|
||||
assert(VM_Version::supports_bmi2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit);
|
||||
vex_prefix(src1, src2->encoding(), dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_38, &attributes);
|
||||
emit_int8((unsigned char)0xF7);
|
||||
@@ -14543,11 +14554,7 @@ void Assembler::addq(Address dst, Register src) {
|
||||
|
||||
void Assembler::eaddq(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x01);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x01, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::addq(Register dst, int32_t imm32) {
|
||||
@@ -14576,11 +14583,7 @@ void Assembler::addq(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::eaddq(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags, true /* use_prefixq */);
|
||||
emit_arith(0x03, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x03, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::adcxq(Register dst, Register src) {
|
||||
@@ -14673,11 +14676,7 @@ void Assembler::andq(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::eandq(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags, true /* use_prefixq */);
|
||||
emit_arith(0x23, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x23, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::andq(Address dst, Register src) {
|
||||
@@ -14688,11 +14687,7 @@ void Assembler::andq(Address dst, Register src) {
|
||||
|
||||
void Assembler::eandq(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x21);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x21, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::andnq(Register dst, Register src1, Register src2) {
|
||||
@@ -15038,7 +15033,7 @@ void Assembler::eimulq(Register dst, Register src, bool no_flags) {
|
||||
}
|
||||
|
||||
void Assembler::eimulq(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
emit_eevex_or_demote(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0xAF, no_flags, true /* is_map1 */, true /* swap */);
|
||||
emit_eevex_or_demote(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0xAF, no_flags, true /* is_map1 */, true /* swap */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::imulq(Register src) {
|
||||
@@ -15500,11 +15495,7 @@ void Assembler::orq(Address dst, Register src) {
|
||||
|
||||
void Assembler::eorq(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x09);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x09, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::orq(Register dst, int32_t imm32) {
|
||||
@@ -15544,13 +15535,8 @@ void Assembler::orq(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::eorq(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags, true /* use_prefixq */);
|
||||
emit_arith(0x0B, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x0B, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::popcntq(Register dst, Address src) {
|
||||
assert(VM_Version::supports_popcnt(), "must support");
|
||||
InstructionMark im(this);
|
||||
@@ -16292,11 +16278,7 @@ void Assembler::xorq(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void Assembler::exorq(Register dst, Register src1, Register src2, bool no_flags) {
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
// NDD shares its encoding bits with NDS bits for regular EVEX instruction.
|
||||
// Therefore, DST is passed as the second argument to minimize changes in the leaf level routine.
|
||||
(void) emit_eevex_prefix_or_demote_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags, true /* use_prefixq */);
|
||||
emit_arith(0x33, 0xC0, src1, src2);
|
||||
emit_eevex_prefix_or_demote_arith_ndd(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x33, 0xC0, no_flags, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void Assembler::xorq(Register dst, Address src) {
|
||||
@@ -16350,11 +16332,7 @@ void Assembler::esetzucc(Condition cc, Register dst) {
|
||||
|
||||
void Assembler::exorq(Register dst, Address src1, Register src2, bool no_flags) {
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit);
|
||||
eevex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, &attributes, no_flags);
|
||||
emit_int8(0x31);
|
||||
emit_operand(src2, src1, 0);
|
||||
emit_eevex_or_demote(dst, src1, src2, VEX_SIMD_NONE, VEX_OPCODE_0F_3C /* MAP4 */, EVEX_64bit, 0x31, no_flags, false /* is_map1 */, true /* is_commutative */);
|
||||
}
|
||||
|
||||
void InstructionAttr::set_address_attributes(int tuple_type, int input_size_in_bits) {
|
||||
|
||||
@@ -796,14 +796,20 @@ private:
|
||||
int emit_eevex_prefix_or_demote_ndd(int dst_enc, int nds_enc, VexSimdPrefix pre, VexOpcode opc,
|
||||
InstructionAttr *attributes, bool no_flags = false, bool use_prefixq = false);
|
||||
|
||||
void emit_eevex_prefix_or_demote_arith_ndd(Register dst, Register src1, Register src2, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int op1, int op2, bool no_flags = false, bool is_commutative = false);
|
||||
|
||||
void emit_eevex_prefix_or_demote_arith_ndd(Register dst, Register nds, int32_t imm32, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int op1, int op2, bool no_flags);
|
||||
|
||||
void emit_eevex_or_demote(Register dst, Register src1, Address src2, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int opcode_byte, bool no_flags = false, bool is_map1 = false);
|
||||
|
||||
void emit_eevex_or_demote(Register dst, Address src1, Register src2, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int opcode_byte, bool no_flags = false, bool is_map1 = false, bool is_commutative = false);
|
||||
|
||||
void emit_eevex_or_demote(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int opcode_byte, bool no_flags, bool is_map1 = false, bool swap = false);
|
||||
int size, int opcode_byte, bool no_flags, bool is_map1 = false, bool swap = false, bool is_commutative = false);
|
||||
|
||||
void emit_eevex_or_demote(int dst_enc, int nds_enc, int src_enc, int8_t imm8, VexSimdPrefix pre, VexOpcode opc,
|
||||
int size, int opcode_byte, bool no_flags, bool is_map1 = false);
|
||||
@@ -1138,6 +1144,7 @@ private:
|
||||
void eandl(Register dst, Register src, int32_t imm32, bool no_flags);
|
||||
void andl(Register dst, Address src);
|
||||
void eandl(Register dst, Register src1, Address src2, bool no_flags);
|
||||
void eandl(Register dst, Address src1, Register src2, bool no_flags);
|
||||
void andl(Register dst, Register src);
|
||||
void eandl(Register dst, Register src1, Register src2, bool no_flags);
|
||||
void andl(Address dst, Register src);
|
||||
|
||||
@@ -137,7 +137,7 @@ void MethodHandles::verify_method(MacroAssembler* _masm, Register method, Regist
|
||||
case vmIntrinsicID::_invokeBasic:
|
||||
// Require compiled LambdaForm class to be fully initialized.
|
||||
__ cmpb(Address(method_holder, InstanceKlass::init_state_offset()), InstanceKlass::fully_initialized);
|
||||
__ jccb(Assembler::equal, L_ok);
|
||||
__ jcc(Assembler::equal, L_ok);
|
||||
break;
|
||||
|
||||
case vmIntrinsicID::_linkToStatic:
|
||||
@@ -154,7 +154,7 @@ void MethodHandles::verify_method(MacroAssembler* _masm, Register method, Regist
|
||||
// init_state check failed, but it may be an abstract interface method
|
||||
__ load_unsigned_short(temp, Address(method, Method::access_flags_offset()));
|
||||
__ testl(temp, JVM_ACC_ABSTRACT);
|
||||
__ jccb(Assembler::notZero, L_ok);
|
||||
__ jcc(Assembler::notZero, L_ok);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -393,6 +393,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, XMMRegister xmm8);
|
||||
void ghash_last_8_avx2(Register subkeyHtbl);
|
||||
|
||||
void check_key_offset(Register key, int offset, int load_size);
|
||||
|
||||
// Load key and shuffle operation
|
||||
void ev_load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask);
|
||||
void ev_load_key(XMMRegister xmmdst, Register key, int offset, Register rscratch);
|
||||
|
||||
@@ -1759,25 +1759,43 @@ void StubGenerator::roundDeclast(XMMRegister xmm_reg) {
|
||||
__ vaesdeclast(xmm8, xmm8, xmm_reg, Assembler::AVX_512bit);
|
||||
}
|
||||
|
||||
// Check incoming byte offset against the int[] len. key is the pointer to the int[0].
|
||||
// This check happens often, so it is important for it to be very compact.
|
||||
void StubGenerator::check_key_offset(Register key, int offset, int load_size) {
|
||||
#ifdef ASSERT
|
||||
Address key_length(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT));
|
||||
assert((offset + load_size) % 4 == 0, "Alignment is good: %d + %d", offset, load_size);
|
||||
int end_offset = (offset + load_size) / 4;
|
||||
Label L_good;
|
||||
__ cmpl(key_length, end_offset);
|
||||
__ jccb(Assembler::greaterEqual, L_good);
|
||||
__ hlt();
|
||||
__ bind(L_good);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Utility routine for loading a 128-bit key word in little endian format
|
||||
void StubGenerator::load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask) {
|
||||
check_key_offset(key, offset, 16);
|
||||
__ movdqu(xmmdst, Address(key, offset));
|
||||
__ pshufb(xmmdst, xmm_shuf_mask);
|
||||
}
|
||||
|
||||
void StubGenerator::load_key(XMMRegister xmmdst, Register key, int offset, Register rscratch) {
|
||||
check_key_offset(key, offset, 16);
|
||||
__ movdqu(xmmdst, Address(key, offset));
|
||||
__ pshufb(xmmdst, ExternalAddress(key_shuffle_mask_addr()), rscratch);
|
||||
}
|
||||
|
||||
void StubGenerator::ev_load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask) {
|
||||
check_key_offset(key, offset, 16);
|
||||
__ movdqu(xmmdst, Address(key, offset));
|
||||
__ pshufb(xmmdst, xmm_shuf_mask);
|
||||
__ evshufi64x2(xmmdst, xmmdst, xmmdst, 0x0, Assembler::AVX_512bit);
|
||||
}
|
||||
|
||||
void StubGenerator::ev_load_key(XMMRegister xmmdst, Register key, int offset, Register rscratch) {
|
||||
check_key_offset(key, offset, 16);
|
||||
__ movdqu(xmmdst, Address(key, offset));
|
||||
__ pshufb(xmmdst, ExternalAddress(key_shuffle_mask_addr()), rscratch);
|
||||
__ evshufi64x2(xmmdst, xmmdst, xmmdst, 0x0, Assembler::AVX_512bit);
|
||||
@@ -3205,12 +3223,12 @@ void StubGenerator::ghash16_encrypt_parallel16_avx512(Register in, Register out,
|
||||
|
||||
//AES round 9
|
||||
roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15);
|
||||
ev_load_key(AESKEY2, key, 11 * 16, rbx);
|
||||
//AES rounds up to 11 (AES192) or 13 (AES256)
|
||||
//AES128 is done
|
||||
__ cmpl(NROUNDS, 52);
|
||||
__ jcc(Assembler::less, last_aes_rnd);
|
||||
__ bind(aes_192);
|
||||
ev_load_key(AESKEY2, key, 11 * 16, rbx);
|
||||
roundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15);
|
||||
ev_load_key(AESKEY1, key, 12 * 16, rbx);
|
||||
roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2024, Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
* Copyright (C) 2021, Tencent. All rights reserved.
|
||||
* Intel Math Library (LIBM) Source Code
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2024, Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
* Copyright (C) 2021, Tencent. All rights reserved.
|
||||
* Intel Math Library (LIBM) Source Code
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2024, Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
* Copyright (C) 2021, Tencent. All rights reserved.
|
||||
* Intel Math Library (LIBM) Source Code
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
@@ -465,13 +465,19 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
|
||||
__ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dtan));
|
||||
}
|
||||
} else if (kind == Interpreter::java_lang_math_tanh) {
|
||||
assert(StubRoutines::dtanh() != nullptr, "not initialized");
|
||||
if (StubRoutines::dtanh() != nullptr) {
|
||||
__ movdbl(xmm0, Address(rsp, wordSize));
|
||||
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dtanh())));
|
||||
} else {
|
||||
return nullptr; // Fallback to default implementation
|
||||
}
|
||||
} else if (kind == Interpreter::java_lang_math_cbrt) {
|
||||
assert(StubRoutines::dcbrt() != nullptr, "not initialized");
|
||||
__ movdbl(xmm0, Address(rsp, wordSize));
|
||||
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcbrt())));
|
||||
if (StubRoutines::dcbrt() != nullptr) {
|
||||
__ movdbl(xmm0, Address(rsp, wordSize));
|
||||
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcbrt())));
|
||||
} else {
|
||||
return nullptr; // Fallback to default implementation
|
||||
}
|
||||
} else if (kind == Interpreter::java_lang_math_abs) {
|
||||
assert(StubRoutines::x86::double_sign_mask() != nullptr, "not initialized");
|
||||
__ movdbl(xmm0, Address(rsp, wordSize));
|
||||
|
||||
@@ -138,7 +138,7 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
|
||||
const uint32_t CPU_FAMILY_486 = (4 << CPU_FAMILY_SHIFT);
|
||||
bool use_evex = FLAG_IS_DEFAULT(UseAVX) || (UseAVX > 2);
|
||||
|
||||
Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4, std_cpuid24;
|
||||
Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4, std_cpuid24, std_cpuid29;
|
||||
Label sef_cpuid, sefsl1_cpuid, ext_cpuid, ext_cpuid1, ext_cpuid5, ext_cpuid7;
|
||||
Label ext_cpuid8, done, wrapup, vector_save_restore, apx_save_restore_warning;
|
||||
Label legacy_setup, save_restore_except, legacy_save_restore, start_simd_check;
|
||||
@@ -337,6 +337,16 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
|
||||
__ movl(Address(rsi, 0), rax);
|
||||
__ movl(Address(rsi, 4), rdx);
|
||||
|
||||
//
|
||||
// cpuid(0x29) APX NCI NDD NF (EAX = 29H, ECX = 0).
|
||||
//
|
||||
__ bind(std_cpuid29);
|
||||
__ movl(rax, 0x29);
|
||||
__ movl(rcx, 0);
|
||||
__ cpuid();
|
||||
__ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid29_offset())));
|
||||
__ movl(Address(rsi, 0), rbx);
|
||||
|
||||
//
|
||||
// cpuid(0x24) Converged Vector ISA Main Leaf (EAX = 24H, ECX = 0).
|
||||
//
|
||||
@@ -1015,16 +1025,6 @@ void VM_Version::get_processor_features() {
|
||||
_features.clear_feature(CPU_AVX10_2);
|
||||
}
|
||||
|
||||
// Currently APX support is only enabled for targets supporting AVX512VL feature.
|
||||
bool apx_supported = os_supports_apx_egprs() && supports_apx_f() && supports_avx512vl();
|
||||
if (UseAPX && !apx_supported) {
|
||||
warning("UseAPX is not supported on this CPU, setting it to false");
|
||||
FLAG_SET_DEFAULT(UseAPX, false);
|
||||
}
|
||||
|
||||
if (!UseAPX) {
|
||||
_features.clear_feature(CPU_APX_F);
|
||||
}
|
||||
|
||||
if (UseAVX < 2) {
|
||||
_features.clear_feature(CPU_AVX2);
|
||||
@@ -1048,6 +1048,7 @@ void VM_Version::get_processor_features() {
|
||||
_features.clear_feature(CPU_VZEROUPPER);
|
||||
_features.clear_feature(CPU_AVX512BW);
|
||||
_features.clear_feature(CPU_AVX512VL);
|
||||
_features.clear_feature(CPU_APX_F);
|
||||
_features.clear_feature(CPU_AVX512DQ);
|
||||
_features.clear_feature(CPU_AVX512_VNNI);
|
||||
_features.clear_feature(CPU_AVX512_VAES);
|
||||
@@ -1067,8 +1068,20 @@ void VM_Version::get_processor_features() {
|
||||
}
|
||||
}
|
||||
|
||||
// Currently APX support is only enabled for targets supporting AVX512VL feature.
|
||||
bool apx_supported = os_supports_apx_egprs() && supports_apx_f() && supports_avx512vl();
|
||||
if (UseAPX && !apx_supported) {
|
||||
warning("UseAPX is not supported on this CPU, setting it to false");
|
||||
FLAG_SET_DEFAULT(UseAPX, false);
|
||||
}
|
||||
|
||||
if (!UseAPX) {
|
||||
_features.clear_feature(CPU_APX_F);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(IntelJccErratumMitigation)) {
|
||||
_has_intel_jcc_erratum = compute_has_intel_jcc_erratum();
|
||||
FLAG_SET_ERGO(IntelJccErratumMitigation, _has_intel_jcc_erratum);
|
||||
} else {
|
||||
_has_intel_jcc_erratum = IntelJccErratumMitigation;
|
||||
}
|
||||
@@ -2932,7 +2945,8 @@ VM_Version::VM_Features VM_Version::CpuidInfo::feature_flags() const {
|
||||
if (std_cpuid1_ecx.bits.popcnt != 0)
|
||||
vm_features.set_feature(CPU_POPCNT);
|
||||
if (sefsl1_cpuid7_edx.bits.apx_f != 0 &&
|
||||
xem_xcr0_eax.bits.apx_f != 0) {
|
||||
xem_xcr0_eax.bits.apx_f != 0 &&
|
||||
std_cpuid29_ebx.bits.apx_nci_ndd_nf != 0) {
|
||||
vm_features.set_feature(CPU_APX_F);
|
||||
}
|
||||
if (std_cpuid1_ecx.bits.avx != 0 &&
|
||||
|
||||
@@ -303,6 +303,14 @@ class VM_Version : public Abstract_VM_Version {
|
||||
} bits;
|
||||
};
|
||||
|
||||
union StdCpuidEax29Ecx0 {
|
||||
uint32_t value;
|
||||
struct {
|
||||
uint32_t apx_nci_ndd_nf : 1,
|
||||
: 31;
|
||||
} bits;
|
||||
};
|
||||
|
||||
union StdCpuid24MainLeafEax {
|
||||
uint32_t value;
|
||||
struct {
|
||||
@@ -587,6 +595,10 @@ protected:
|
||||
StdCpuid24MainLeafEax std_cpuid24_eax;
|
||||
StdCpuid24MainLeafEbx std_cpuid24_ebx;
|
||||
|
||||
// cpuid function 0x29 APX Advanced Performance Extensions Leaf
|
||||
// eax = 0x29, ecx = 0
|
||||
StdCpuidEax29Ecx0 std_cpuid29_ebx;
|
||||
|
||||
// cpuid function 0xB (processor topology)
|
||||
// ecx = 0
|
||||
uint32_t tpl_cpuidB0_eax;
|
||||
@@ -707,6 +719,7 @@ public:
|
||||
static ByteSize std_cpuid0_offset() { return byte_offset_of(CpuidInfo, std_max_function); }
|
||||
static ByteSize std_cpuid1_offset() { return byte_offset_of(CpuidInfo, std_cpuid1_eax); }
|
||||
static ByteSize std_cpuid24_offset() { return byte_offset_of(CpuidInfo, std_cpuid24_eax); }
|
||||
static ByteSize std_cpuid29_offset() { return byte_offset_of(CpuidInfo, std_cpuid29_ebx); }
|
||||
static ByteSize dcp_cpuid4_offset() { return byte_offset_of(CpuidInfo, dcp_cpuid4_eax); }
|
||||
static ByteSize sef_cpuid7_offset() { return byte_offset_of(CpuidInfo, sef_cpuid7_eax); }
|
||||
static ByteSize sefsl1_cpuid7_offset() { return byte_offset_of(CpuidInfo, sefsl1_cpuid7_eax); }
|
||||
@@ -756,7 +769,9 @@ public:
|
||||
_features.set_feature(CPU_SSE2);
|
||||
_features.set_feature(CPU_VZEROUPPER);
|
||||
}
|
||||
static void set_apx_cpuFeatures() { _features.set_feature(CPU_APX_F); }
|
||||
static void set_apx_cpuFeatures() {
|
||||
_features.set_feature(CPU_APX_F);
|
||||
}
|
||||
static void set_bmi_cpuFeatures() {
|
||||
_features.set_feature(CPU_BMI1);
|
||||
_features.set_feature(CPU_BMI2);
|
||||
|
||||
@@ -2508,7 +2508,7 @@ static bool thread_cpu_time_unchecked(Thread* thread, jlong* p_sys_time, jlong*
|
||||
dummy, &dummy_size) == 0) {
|
||||
tid = pinfo.__pi_tid;
|
||||
} else {
|
||||
tty->print_cr("pthread_getthrds_np failed.");
|
||||
tty->print_cr("pthread_getthrds_np failed, errno: %d.", errno);
|
||||
error = true;
|
||||
}
|
||||
|
||||
@@ -2519,7 +2519,7 @@ static bool thread_cpu_time_unchecked(Thread* thread, jlong* p_sys_time, jlong*
|
||||
sys_time = thrdentry.ti_ru.ru_stime.tv_sec * 1000000000LL + thrdentry.ti_ru.ru_stime.tv_usec * 1000LL;
|
||||
user_time = thrdentry.ti_ru.ru_utime.tv_sec * 1000000000LL + thrdentry.ti_ru.ru_utime.tv_usec * 1000LL;
|
||||
} else {
|
||||
tty->print_cr("pthread_getthrds_np failed.");
|
||||
tty->print_cr("getthrds64 failed, errno: %d.", errno);
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,11 +349,20 @@ julong os::physical_memory() {
|
||||
return phys_mem;
|
||||
}
|
||||
|
||||
// Returns the resident set size (RSS) of the process.
|
||||
// Falls back to using VmRSS from /proc/self/status if /proc/self/smaps_rollup is unavailable.
|
||||
// Note: On kernels with memory cgroups or shared memory, VmRSS may underreport RSS.
|
||||
// Users requiring accurate RSS values should be aware of this limitation.
|
||||
size_t os::rss() {
|
||||
size_t size = 0;
|
||||
os::Linux::meminfo_t info;
|
||||
if (os::Linux::query_process_memory_info(&info)) {
|
||||
size = info.vmrss * K;
|
||||
os::Linux::accurate_meminfo_t accurate_info;
|
||||
if (os::Linux::query_accurate_process_memory_info(&accurate_info) && accurate_info.rss != -1) {
|
||||
size = accurate_info.rss * K;
|
||||
} else {
|
||||
os::Linux::meminfo_t info;
|
||||
if (os::Linux::query_process_memory_info(&info)) {
|
||||
size = info.vmrss * K;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@@ -2350,6 +2359,37 @@ bool os::Linux::query_process_memory_info(os::Linux::meminfo_t* info) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Accurate memory information need Linux 4.14 or newer
|
||||
bool os::Linux::query_accurate_process_memory_info(os::Linux::accurate_meminfo_t* info) {
|
||||
FILE* f = os::fopen("/proc/self/smaps_rollup", "r");
|
||||
if (f == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const size_t num_values = sizeof(os::Linux::accurate_meminfo_t) / sizeof(size_t);
|
||||
size_t num_found = 0;
|
||||
char buf[256];
|
||||
info->rss = info->pss = info->pssdirty = info->pssanon =
|
||||
info->pssfile = info->pssshmem = info->swap = info->swappss = -1;
|
||||
|
||||
while (::fgets(buf, sizeof(buf), f) != nullptr && num_found < num_values) {
|
||||
if ( (info->rss == -1 && sscanf(buf, "Rss: %zd kB", &info->rss) == 1) ||
|
||||
(info->pss == -1 && sscanf(buf, "Pss: %zd kB", &info->pss) == 1) ||
|
||||
(info->pssdirty == -1 && sscanf(buf, "Pss_Dirty: %zd kB", &info->pssdirty) == 1) ||
|
||||
(info->pssanon == -1 && sscanf(buf, "Pss_Anon: %zd kB", &info->pssanon) == 1) ||
|
||||
(info->pssfile == -1 && sscanf(buf, "Pss_File: %zd kB", &info->pssfile) == 1) ||
|
||||
(info->pssshmem == -1 && sscanf(buf, "Pss_Shmem: %zd kB", &info->pssshmem) == 1) ||
|
||||
(info->swap == -1 && sscanf(buf, "Swap: %zd kB", &info->swap) == 1) ||
|
||||
(info->swappss == -1 && sscanf(buf, "SwapPss: %zd kB", &info->swappss) == 1)
|
||||
)
|
||||
{
|
||||
num_found ++;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef __GLIBC__
|
||||
// For Glibc, print a one-liner with the malloc tunables.
|
||||
// Most important and popular is MALLOC_ARENA_MAX, but we are
|
||||
|
||||
@@ -181,6 +181,23 @@ class os::Linux {
|
||||
// fields will contain -1.
|
||||
static bool query_process_memory_info(meminfo_t* info);
|
||||
|
||||
// Output structure for query_accurate_process_memory_info() (all values in KB)
|
||||
struct accurate_meminfo_t {
|
||||
ssize_t rss; // current resident set size
|
||||
ssize_t pss; // current proportional set size
|
||||
ssize_t pssdirty; // proportional set size (dirty)
|
||||
ssize_t pssanon; // proportional set size (anonymous mappings)
|
||||
ssize_t pssfile; // proportional set size (file mappings)
|
||||
ssize_t pssshmem; // proportional set size (shared mappings)
|
||||
ssize_t swap; // swapped out
|
||||
ssize_t swappss; // proportional set size (swapped out)
|
||||
};
|
||||
|
||||
// Attempts to query accurate memory information from /proc/self/smaps_rollup and return it in the output structure.
|
||||
// May fail (returns false) or succeed (returns true) but not all output fields are available; unavailable
|
||||
// fields will contain -1.
|
||||
static bool query_accurate_process_memory_info(accurate_meminfo_t* info);
|
||||
|
||||
// Tells if the user asked for transparent huge pages.
|
||||
static bool _thp_requested;
|
||||
|
||||
|
||||
@@ -209,8 +209,16 @@ frame os::fetch_compiled_frame_from_context(const void* ucVoid) {
|
||||
}
|
||||
|
||||
intptr_t* os::fetch_bcp_from_context(const void* ucVoid) {
|
||||
Unimplemented();
|
||||
return nullptr;
|
||||
assert(ucVoid != nullptr, "invariant");
|
||||
const ucontext_t* uc = (const ucontext_t*)ucVoid;
|
||||
assert(os::Posix::ucontext_is_interpreter(uc), "invariant");
|
||||
#if (FP_REG_NUM == 11)
|
||||
assert(Rbcp == R7, "expected FP=R11, Rbcp=R7");
|
||||
return (intptr_t*)uc->uc_mcontext.arm_r7;
|
||||
#else
|
||||
assert(Rbcp == R11, "expected FP=R7, Rbcp=R11");
|
||||
return (intptr_t*)uc->uc_mcontext.arm_fp; // r11
|
||||
#endif
|
||||
}
|
||||
|
||||
frame os::get_sender_for_C_frame(frame* fr) {
|
||||
|
||||
@@ -89,6 +89,25 @@
|
||||
#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
|
||||
#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0)
|
||||
|
||||
#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
|
||||
|
||||
#define RISCV_HWPROBE_KEY_HIGHEST_VIRT_ADDRESS 7
|
||||
|
||||
#define RISCV_HWPROBE_KEY_TIME_CSR_FREQ 8
|
||||
|
||||
#define RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF 9
|
||||
#define RISCV_HWPROBE_MISALIGNED_SCALAR_UNKNOWN 0
|
||||
#define RISCV_HWPROBE_MISALIGNED_SCALAR_EMULATED 1
|
||||
#define RISCV_HWPROBE_MISALIGNED_SCALAR_SLOW 2
|
||||
#define RISCV_HWPROBE_MISALIGNED_SCALAR_FAST 3
|
||||
#define RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED 4
|
||||
|
||||
#define RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF 10
|
||||
#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN 0
|
||||
#define RISCV_HWPROBE_MISALIGNED_VECTOR_SLOW 2
|
||||
#define RISCV_HWPROBE_MISALIGNED_VECTOR_FAST 3
|
||||
#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED 4
|
||||
|
||||
#ifndef NR_riscv_hwprobe
|
||||
#ifndef NR_arch_specific_syscall
|
||||
#define NR_arch_specific_syscall 244
|
||||
@@ -114,7 +133,12 @@ static struct riscv_hwprobe query[] = {{RISCV_HWPROBE_KEY_MVENDORID, 0},
|
||||
{RISCV_HWPROBE_KEY_MIMPID, 0},
|
||||
{RISCV_HWPROBE_KEY_BASE_BEHAVIOR, 0},
|
||||
{RISCV_HWPROBE_KEY_IMA_EXT_0, 0},
|
||||
{RISCV_HWPROBE_KEY_CPUPERF_0, 0}};
|
||||
{RISCV_HWPROBE_KEY_CPUPERF_0, 0},
|
||||
{RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE, 0},
|
||||
{RISCV_HWPROBE_KEY_HIGHEST_VIRT_ADDRESS, 0},
|
||||
{RISCV_HWPROBE_KEY_TIME_CSR_FREQ, 0},
|
||||
{RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF, 0},
|
||||
{RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF, 0}};
|
||||
|
||||
bool RiscvHwprobe::probe_features() {
|
||||
assert(!rw_hwprobe_completed, "Called twice.");
|
||||
@@ -188,6 +212,9 @@ void RiscvHwprobe::add_features_from_query_result() {
|
||||
VM_Version::ext_Zbs.enable_feature();
|
||||
}
|
||||
#ifndef PRODUCT
|
||||
if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZICBOZ)) {
|
||||
VM_Version::ext_Zicboz.enable_feature();
|
||||
}
|
||||
if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZBKB)) {
|
||||
VM_Version::ext_Zbkb.enable_feature();
|
||||
}
|
||||
@@ -240,8 +267,22 @@ void RiscvHwprobe::add_features_from_query_result() {
|
||||
VM_Version::ext_Zicond.enable_feature();
|
||||
}
|
||||
#endif
|
||||
// RISCV_HWPROBE_KEY_CPUPERF_0 is deprecated and returns similar values
|
||||
// to RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF. Keep it there for backward
|
||||
// compatibility with old kernels.
|
||||
if (is_valid(RISCV_HWPROBE_KEY_CPUPERF_0)) {
|
||||
VM_Version::unaligned_access.enable_feature(
|
||||
VM_Version::unaligned_scalar.enable_feature(
|
||||
query[RISCV_HWPROBE_KEY_CPUPERF_0].value & RISCV_HWPROBE_MISALIGNED_MASK);
|
||||
} else if (is_valid(RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF)) {
|
||||
VM_Version::unaligned_scalar.enable_feature(
|
||||
query[RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF].value);
|
||||
}
|
||||
|
||||
if (is_valid(RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF)) {
|
||||
VM_Version::unaligned_vector.enable_feature(
|
||||
query[RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF].value);
|
||||
}
|
||||
if (is_valid(RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE)) {
|
||||
VM_Version::zicboz_block_size.enable_feature(query[RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE].value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,6 @@
|
||||
#endif
|
||||
|
||||
uint32_t VM_Version::cpu_vector_length() {
|
||||
assert(ext_V.enabled(), "should not call this");
|
||||
return (uint32_t)read_csr(CSR_VLENB);
|
||||
}
|
||||
|
||||
@@ -303,7 +302,7 @@ void VM_Version::rivos_features() {
|
||||
|
||||
ext_Zvfh.enable_feature();
|
||||
|
||||
unaligned_access.enable_feature(MISALIGNED_FAST);
|
||||
unaligned_scalar.enable_feature(MISALIGNED_SCALAR_FAST);
|
||||
satp_mode.enable_feature(VM_SV48);
|
||||
|
||||
// Features dependent on march/mimpid.
|
||||
|
||||
@@ -238,7 +238,7 @@ bool Compiler::is_intrinsic_supported(vmIntrinsics::ID id) {
|
||||
case vmIntrinsics::_counterTime:
|
||||
#endif
|
||||
case vmIntrinsics::_getObjectSize:
|
||||
#if defined(X86) || defined(AARCH64) || defined(S390) || defined(RISCV) || defined(PPC64)
|
||||
#if defined(X86) || defined(AARCH64) || defined(S390) || defined(RISCV64) || defined(PPC64)
|
||||
case vmIntrinsics::_clone:
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -350,8 +350,9 @@ LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_
|
||||
, _tmp(tmp)
|
||||
, _expected_type(expected_type)
|
||||
, _flags(flags) {
|
||||
#if defined(X86) || defined(AARCH64) || defined(S390) || defined(RISCV) || defined(PPC64)
|
||||
if (expected_type != nullptr && flags == 0) {
|
||||
#if defined(X86) || defined(AARCH64) || defined(S390) || defined(RISCV64) || defined(PPC64)
|
||||
if (expected_type != nullptr &&
|
||||
((flags & ~LIR_OpArrayCopy::get_initial_copy_flags()) == 0)) {
|
||||
_stub = nullptr;
|
||||
} else {
|
||||
_stub = new ArrayCopyStub(this);
|
||||
|
||||
@@ -1282,6 +1282,8 @@ public:
|
||||
int flags() const { return _flags; }
|
||||
ciArrayKlass* expected_type() const { return _expected_type; }
|
||||
ArrayCopyStub* stub() const { return _stub; }
|
||||
static int get_initial_copy_flags() { return LIR_OpArrayCopy::unaligned |
|
||||
LIR_OpArrayCopy::overlapping; }
|
||||
|
||||
virtual void emit_code(LIR_Assembler* masm);
|
||||
virtual LIR_OpArrayCopy* as_OpArrayCopy() { return this; }
|
||||
|
||||
@@ -818,7 +818,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* current, jint trap_request))
|
||||
Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request);
|
||||
|
||||
if (action == Deoptimization::Action_make_not_entrant) {
|
||||
if (nm->make_not_entrant("C1 deoptimize")) {
|
||||
if (nm->make_not_entrant(nmethod::ChangeReason::C1_deoptimize)) {
|
||||
if (reason == Deoptimization::Reason_tenured) {
|
||||
MethodData* trap_mdo = Deoptimization::get_method_data(current, method, true /*create_if_missing*/);
|
||||
if (trap_mdo != nullptr) {
|
||||
@@ -1110,7 +1110,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, C1StubId stub_id ))
|
||||
// safepoint, but if it's still alive then make it not_entrant.
|
||||
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
|
||||
if (nm != nullptr) {
|
||||
nm->make_not_entrant("C1 code patch");
|
||||
nm->make_not_entrant(nmethod::ChangeReason::C1_codepatch);
|
||||
}
|
||||
|
||||
Deoptimization::deoptimize_frame(current, caller_frame.id());
|
||||
@@ -1358,7 +1358,7 @@ void Runtime1::patch_code(JavaThread* current, C1StubId stub_id) {
|
||||
// Make sure the nmethod is invalidated, i.e. made not entrant.
|
||||
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
|
||||
if (nm != nullptr) {
|
||||
nm->make_not_entrant("C1 deoptimize for patching");
|
||||
nm->make_not_entrant(nmethod::ChangeReason::C1_deoptimize_for_patching);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1486,7 +1486,7 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* current))
|
||||
|
||||
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
|
||||
assert (nm != nullptr, "no more nmethod?");
|
||||
nm->make_not_entrant("C1 predicate failed trap");
|
||||
nm->make_not_entrant(nmethod::ChangeReason::C1_predicate_failed_trap);
|
||||
|
||||
methodHandle m(current, nm->method());
|
||||
MethodData* mdo = m->method_data();
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
\
|
||||
product(ccstr, AOTCacheOutput, nullptr, \
|
||||
"Specifies the file name for writing the AOT cache") \
|
||||
constraint(AOTCacheOutputConstraintFunc, AtParse) \
|
||||
\
|
||||
product(bool, AOTInvokeDynamicLinking, false, DIAGNOSTIC, \
|
||||
"AOT-link JVM_CONSTANT_InvokeDynamic entries in cached " \
|
||||
|
||||
@@ -1271,7 +1271,7 @@ void MetaspaceShared::unrecoverable_loading_error(const char* message) {
|
||||
} else if (CDSConfig::new_aot_flags_used()) {
|
||||
vm_exit_during_initialization("Unable to use AOT cache.", nullptr);
|
||||
} else {
|
||||
vm_exit_during_initialization("Unable to use shared archive.", nullptr);
|
||||
vm_exit_during_initialization("Unable to use shared archive. Unrecoverable archive loading error (run with -Xlog:aot,cds for details)", message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1395,6 +1395,7 @@ FileMapInfo* MetaspaceShared::open_static_archive() {
|
||||
FileMapInfo* mapinfo = new FileMapInfo(static_archive, true);
|
||||
if (!mapinfo->open_as_input()) {
|
||||
delete(mapinfo);
|
||||
log_info(cds)("Opening of static archive %s failed", static_archive);
|
||||
return nullptr;
|
||||
}
|
||||
return mapinfo;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user