mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-22 09:19:37 +01:00
Compare commits
409 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
743c821289 | ||
|
|
b02c125676 | ||
|
|
06f9ff047f | ||
|
|
e6ac956a7a | ||
|
|
9f796da377 | ||
|
|
ceb0c0fc39 | ||
|
|
5160cfb496 | ||
|
|
0735dc27c7 | ||
|
|
79f9d8d832 | ||
|
|
4994bd5942 | ||
|
|
016694bf74 | ||
|
|
5540a7859b | ||
|
|
aae9902234 | ||
|
|
ea6674fec8 | ||
|
|
d714b5d3da | ||
|
|
ce02836232 | ||
|
|
ac141c2fa1 | ||
|
|
ed70910b0f | ||
|
|
f155661151 | ||
|
|
c68697e178 | ||
|
|
dccb1782ec | ||
|
|
699b8112f8 | ||
|
|
0385975f44 | ||
|
|
7d7d308d9a | ||
|
|
eceb3bbc80 | ||
|
|
3acdba38ce | ||
|
|
523993e9e8 | ||
|
|
b8da9695f0 | ||
|
|
48ba9d415f | ||
|
|
9dd93c6a2c | ||
|
|
f8c8bcf4fd | ||
|
|
15b5b54ac7 | ||
|
|
644e400cd1 | ||
|
|
fd7f78a535 | ||
|
|
1b94a3466e | ||
|
|
13bab09bff | ||
|
|
8f1bb59e1a | ||
|
|
1bd683b588 | ||
|
|
37b70707bd | ||
|
|
62a58062e5 | ||
|
|
9609f57cef | ||
|
|
441dbde2c3 | ||
|
|
ee0bcc5526 | ||
|
|
ceb51d4444 | ||
|
|
d83346dcff | ||
|
|
9334fe2eca | ||
|
|
03230f8565 | ||
|
|
a3843e8e6e | ||
|
|
60c29ff57b | ||
|
|
30d2003698 | ||
|
|
9dc62825b5 | ||
|
|
6949e34575 | ||
|
|
7da274ded4 | ||
|
|
4e0b03580d | ||
|
|
a23987fecb | ||
|
|
04c0b130f0 | ||
|
|
cab515962b | ||
|
|
bd55d7a495 | ||
|
|
2b11a28997 | ||
|
|
5ed72775a7 | ||
|
|
dc08cf016e | ||
|
|
ea774b74e8 | ||
|
|
365660e667 | ||
|
|
1d73f8842a | ||
|
|
cb9358b561 | ||
|
|
bc9ece9698 | ||
|
|
1cde536b98 | ||
|
|
1a6cbe421f | ||
|
|
3fd89be6d1 | ||
|
|
18190519e7 | ||
|
|
be0161a8e6 | ||
|
|
bc72f476d1 | ||
|
|
a65d9532ed | ||
|
|
20b5f09777 | ||
|
|
3b44d7bfa4 | ||
|
|
8193856af8 | ||
|
|
10ae602944 | ||
|
|
770d2b41d1 | ||
|
|
70c1ff7e15 | ||
|
|
6ed81641b1 | ||
|
|
5e4a2ead71 | ||
|
|
b787ad6f69 | ||
|
|
6b4a5ef105 | ||
|
|
9f7dc19ffd | ||
|
|
805f1deebc | ||
|
|
b85440d085 | ||
|
|
fd2ee0844a | ||
|
|
27c58c06cf | ||
|
|
cbb3d23e19 | ||
|
|
6e368e0c69 | ||
|
|
e1b2229b0b | ||
|
|
bdd37b0e5e | ||
|
|
5ddeb56759 | ||
|
|
a5c9bc7032 | ||
|
|
5fd2b7d61a | ||
|
|
9bef2d1610 | ||
|
|
6fc032de2c | ||
|
|
413c6bd040 | ||
|
|
2eaddd5b0a | ||
|
|
7db8bff9e1 | ||
|
|
5ad102ca3f | ||
|
|
a56cd371a2 | ||
|
|
d3429ada8f | ||
|
|
db3f6eabb5 | ||
|
|
017dc093ac | ||
|
|
1d8cca2b84 | ||
|
|
eefbfdce31 | ||
|
|
401af27b9d | ||
|
|
38af17d078 | ||
|
|
820263e48a | ||
|
|
b65fdf5af0 | ||
|
|
d2082c58ff | ||
|
|
563e876246 | ||
|
|
c70258ca1c | ||
|
|
9697e5bf74 | ||
|
|
c9ecc82666 | ||
|
|
bf225c201f | ||
|
|
e5ab210713 | ||
|
|
18c2e40de7 | ||
|
|
40d159d4a9 | ||
|
|
25e509b0db | ||
|
|
0acd065bf5 | ||
|
|
f36147b326 | ||
|
|
5cf672e778 | ||
|
|
a10ee46e6d | ||
|
|
6cff49c0fe | ||
|
|
ebb1095805 | ||
|
|
bcd86d575f | ||
|
|
5edd546585 | ||
|
|
a531c9aece | ||
|
|
99c299f098 | ||
|
|
272e66d017 | ||
|
|
14c79be161 | ||
|
|
7c34bdf73c | ||
|
|
0029554d20 | ||
|
|
77bd417c99 | ||
|
|
bc828c8fb6 | ||
|
|
917d0182cb | ||
|
|
3bacf7ea85 | ||
|
|
4a351e3e57 | ||
|
|
189017f750 | ||
|
|
3f59eae3d0 | ||
|
|
46988e1073 | ||
|
|
f7e8d255cc | ||
|
|
26b002805a | ||
|
|
8c00c374ec | ||
|
|
59bec29c35 | ||
|
|
a86dd56de3 | ||
|
|
76442f39b9 | ||
|
|
445e5ecd98 | ||
|
|
3ffc5b9ef7 | ||
|
|
529049be6b | ||
|
|
eddfc6449f | ||
|
|
2e7e272d7b | ||
|
|
ee0d309bbd | ||
|
|
2300a212dd | ||
|
|
3d74cbe0ac | ||
|
|
f5afbbd32a | ||
|
|
cbc7090b91 | ||
|
|
f735275021 | ||
|
|
3d37c4e37a | ||
|
|
73ab54e4c3 | ||
|
|
80662a485a | ||
|
|
c118543efe | ||
|
|
13e0f99626 | ||
|
|
bf3cfbeff4 | ||
|
|
2a53f5a5c2 | ||
|
|
f67e435431 | ||
|
|
c28bb8bf7a | ||
|
|
518536c607 | ||
|
|
0f7808f333 | ||
|
|
c9bea77342 | ||
|
|
6681fc72d3 | ||
|
|
7282f68cee | ||
|
|
6e203384f8 | ||
|
|
6249259c80 | ||
|
|
a41d35073e | ||
|
|
7daf9813c0 | ||
|
|
a201be8555 | ||
|
|
db4b4a5b35 | ||
|
|
d886ae12a2 | ||
|
|
eec04dd010 | ||
|
|
a9bd1ad40c | ||
|
|
b1fa1ecc98 | ||
|
|
83feb7a238 | ||
|
|
963b83fcf1 | ||
|
|
68b27b88b5 | ||
|
|
e0245682c8 | ||
|
|
4761479608 | ||
|
|
fe26467633 | ||
|
|
e2c5d03546 | ||
|
|
19bb6ebfaf | ||
|
|
54e37629f6 | ||
|
|
974ad4e8cd | ||
|
|
117f0b4051 | ||
|
|
dedcce0450 | ||
|
|
03526e250d | ||
|
|
1de2acea77 | ||
|
|
fa32bfe113 | ||
|
|
91df797879 | ||
|
|
92712ef45d | ||
|
|
5850bf4488 | ||
|
|
853319439e | ||
|
|
63e08d4af7 | ||
|
|
5c67e3d6e5 | ||
|
|
2349304bb1 | ||
|
|
0bd2f9cba2 | ||
|
|
27e6a4d2f7 | ||
|
|
1934bd8d2c | ||
|
|
7b255b8a62 | ||
|
|
310ef85667 | ||
|
|
5205eae6ff | ||
|
|
bbc5c98b14 | ||
|
|
563a3358f6 | ||
|
|
ec7c6be6a9 | ||
|
|
197fde5363 | ||
|
|
ec3bb93d79 | ||
|
|
39c9de2ace | ||
|
|
05c9eec8d0 | ||
|
|
fea73c1d40 | ||
|
|
afb4a1be9e | ||
|
|
7c13a2cd9a | ||
|
|
4df9c87345 | ||
|
|
9449fea2cd | ||
|
|
1fa772e814 | ||
|
|
8ad4836883 | ||
|
|
d75ea7e679 | ||
|
|
e9a434165a | ||
|
|
45300dd123 | ||
|
|
44cff9d6ab | ||
|
|
3bcbcc5747 | ||
|
|
f3e0588d0b | ||
|
|
f2d2eef988 | ||
|
|
1c560727b8 | ||
|
|
f153e415d7 | ||
|
|
fba74f796e | ||
|
|
56ebb8c1b9 | ||
|
|
5cf349c3b0 | ||
|
|
21f2e9a71c | ||
|
|
854de8c9c6 | ||
|
|
16af473397 | ||
|
|
da0a51ce97 | ||
|
|
566279af49 | ||
|
|
77e69e02eb | ||
|
|
dcc7254a38 | ||
|
|
003be0dee2 | ||
|
|
2d9f0324ba | ||
|
|
25ed36f3ef | ||
|
|
a2315ddd2a | ||
|
|
66836d40b8 | ||
|
|
3daa03c30f | ||
|
|
24117c6e9a | ||
|
|
5e40fb6bda | ||
|
|
2528c620a6 | ||
|
|
1be29bd725 | ||
|
|
2f683fdc4a | ||
|
|
c75df634be | ||
|
|
fd13e1ce98 | ||
|
|
6c9236c80c | ||
|
|
1926aeb1a3 | ||
|
|
74822ce12a | ||
|
|
ea86a20e6d | ||
|
|
5e30bf6835 | ||
|
|
c50370599e | ||
|
|
c460f842bf | ||
|
|
549b875866 | ||
|
|
832bfbc0dd | ||
|
|
3066a67e62 | ||
|
|
ce9986991d | ||
|
|
eac8f5d2c9 | ||
|
|
2304044ab2 | ||
|
|
0f1cd987b3 | ||
|
|
1ac7489874 | ||
|
|
055d2ffa69 | ||
|
|
2bff8e0a13 | ||
|
|
c6448dc3af | ||
|
|
1703915d3f | ||
|
|
a910b20b51 | ||
|
|
7d7e60c8ae | ||
|
|
534d2b33dc | ||
|
|
e9a62d79cd | ||
|
|
13a3927855 | ||
|
|
282ee40a56 | ||
|
|
e7a450038a | ||
|
|
38f59f84c9 | ||
|
|
e1681c4828 | ||
|
|
e138297323 | ||
|
|
7583a7b857 | ||
|
|
e85c7d09df | ||
|
|
eec1153993 | ||
|
|
fc739fee53 | ||
|
|
aeca49e43f | ||
|
|
54c95cf226 | ||
|
|
cd6caedd0a | ||
|
|
b32ccf2cb2 | ||
|
|
0572b6ece7 | ||
|
|
d1052c70cb | ||
|
|
61a590e9be | ||
|
|
9d518b3213 | ||
|
|
1dda79cfab | ||
|
|
aa1911191c | ||
|
|
00adbbe553 | ||
|
|
c2d76f9844 | ||
|
|
4dd1b3a610 | ||
|
|
240541e1c1 | ||
|
|
a23de2ec09 | ||
|
|
3525a40f39 | ||
|
|
712d866b72 | ||
|
|
da7080fffb | ||
|
|
4edf791aec | ||
|
|
12196baf67 | ||
|
|
a471fe992f | ||
|
|
839cede1a4 | ||
|
|
ecd2d83096 | ||
|
|
d8f9b188fa | ||
|
|
aa26cede63 | ||
|
|
20e983a97c | ||
|
|
97ec9d3e0a | ||
|
|
01b15bc1f9 | ||
|
|
6d05a1d3f4 | ||
|
|
8ea544c33f | ||
|
|
334683e634 | ||
|
|
20e0055e20 | ||
|
|
83fe688d80 | ||
|
|
a49ecb26c5 | ||
|
|
7f702cf483 | ||
|
|
bd666f90eb | ||
|
|
a0c3efa6a8 | ||
|
|
7576064a10 | ||
|
|
8df6b2c4a3 | ||
|
|
ff24088c86 | ||
|
|
5a1301df19 | ||
|
|
5039b42de1 | ||
|
|
1ca008fd02 | ||
|
|
cf75f1f9c6 | ||
|
|
52526080ba | ||
|
|
f799cf180a | ||
|
|
56c75453cd | ||
|
|
7447276475 | ||
|
|
c90c31b07e | ||
|
|
52c6044fe4 | ||
|
|
4e1bf31368 | ||
|
|
878497fb85 | ||
|
|
f2ef809719 | ||
|
|
1fa090524a | ||
|
|
f71d64fbeb | ||
|
|
850bc20306 | ||
|
|
75ce44aa84 | ||
|
|
5c4f92ba9a | ||
|
|
263e32bb85 | ||
|
|
7d6c902ce8 | ||
|
|
5091057614 | ||
|
|
ba0c12231b | ||
|
|
cbcf401170 | ||
|
|
f8de5bc582 | ||
|
|
9a726df373 | ||
|
|
2af869b193 | ||
|
|
5c1f77fab1 | ||
|
|
54acadbe66 | ||
|
|
0514cee6c8 | ||
|
|
28e96e333b | ||
|
|
f5201ac117 | ||
|
|
a3609ba5ac | ||
|
|
116b8543b0 | ||
|
|
fdfc557878 | ||
|
|
54fec2b98b | ||
|
|
03d66d9ee2 | ||
|
|
f6ff38ab42 | ||
|
|
dbbfa76b73 | ||
|
|
9af36b13c5 | ||
|
|
34412da52b | ||
|
|
a350a1115a | ||
|
|
bcad87eacb | ||
|
|
2a70a6dc58 | ||
|
|
6df0f5e390 | ||
|
|
9c3eaa49f7 | ||
|
|
dfcea0547e | ||
|
|
c748d358b2 | ||
|
|
72679c94ee | ||
|
|
10e6eec9e6 | ||
|
|
251f2ac785 | ||
|
|
fe7ec31259 | ||
|
|
516197f50b | ||
|
|
ad1033d68f | ||
|
|
c220b1358c | ||
|
|
9ae39b62b9 | ||
|
|
3d35b408e1 | ||
|
|
de34bb8e66 | ||
|
|
620df7ec34 | ||
|
|
6b4393917a | ||
|
|
81985d422d | ||
|
|
d627282f0c | ||
|
|
96f71a9a6b | ||
|
|
17cf49746d | ||
|
|
c6ab63d306 | ||
|
|
ff54a6493a | ||
|
|
c11f36e620 | ||
|
|
8f121a173c | ||
|
|
33970629ac | ||
|
|
c51bed739d | ||
|
|
a6464b74a8 | ||
|
|
0dd50dbb3e | ||
|
|
dec42bebb8 | ||
|
|
2fe1298447 | ||
|
|
2e3bdec985 | ||
|
|
c4fb00a7be | ||
|
|
01d4b772de | ||
|
|
c7125aa2af | ||
|
|
0dce98b716 |
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
|
||||
|
||||
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 }}
|
||||
|
||||
6
.github/workflows/build-cross-compile.yml
vendored
6
.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:
|
||||
@@ -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 }}
|
||||
|
||||
62
.github/workflows/main.yml
vendored
62
.github/workflows/main.yml
vendored
@@ -28,9 +28,7 @@ name: 'OpenJDK GHA Sanity Checks'
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
- pr/*
|
||||
- jdk*
|
||||
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 =~ "jdk(.*)" ]]; 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:
|
||||
@@ -290,6 +331,7 @@ jobs:
|
||||
xcode-toolset-version: '14.3.1'
|
||||
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:
|
||||
@@ -302,6 +344,7 @@ jobs:
|
||||
xcode-toolset-version: '15.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:
|
||||
@@ -310,10 +353,11 @@ jobs:
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
msvc-toolset-version: '14.43'
|
||||
msvc-toolset-version: '14.44'
|
||||
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:
|
||||
@@ -322,12 +366,13 @@ jobs:
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-aarch64
|
||||
msvc-toolset-version: '14.43'
|
||||
msvc-toolset-version: '14.44'
|
||||
msvc-toolset-architecture: 'arm64'
|
||||
make-target: 'hotspot'
|
||||
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
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
xcode-toolset-version: '15.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
|
||||
|
||||
@@ -77,6 +77,9 @@ SFINAE</a></li>
|
||||
<li><a href="#thread_local" id="toc-thread_local">thread_local</a></li>
|
||||
<li><a href="#nullptr" id="toc-nullptr">nullptr</a></li>
|
||||
<li><a href="#atomic" id="toc-atomic"><atomic></a></li>
|
||||
<li><a href="#initializing-variables-with-static-storage-duration"
|
||||
id="toc-initializing-variables-with-static-storage-duration">Initializing
|
||||
variables with static storage duration</a></li>
|
||||
<li><a href="#uniform-initialization"
|
||||
id="toc-uniform-initialization">Uniform Initialization</a></li>
|
||||
<li><a href="#local-function-objects"
|
||||
@@ -84,6 +87,7 @@ id="toc-local-function-objects">Local Function Objects</a></li>
|
||||
<li><a href="#inheriting-constructors"
|
||||
id="toc-inheriting-constructors">Inheriting constructors</a></li>
|
||||
<li><a href="#attributes" id="toc-attributes">Attributes</a></li>
|
||||
<li><a href="#noexcept" id="toc-noexcept">noexcept</a></li>
|
||||
<li><a href="#additional-permitted-features"
|
||||
id="toc-additional-permitted-features">Additional Permitted
|
||||
Features</a></li>
|
||||
@@ -791,6 +795,33 @@ differ from what the Java compilers implement.</p>
|
||||
"conservative" memory ordering, which may differ from (may be stronger
|
||||
than) sequentially consistent. There are algorithms in HotSpot that are
|
||||
believed to rely on that ordering.</p>
|
||||
<h3
|
||||
id="initializing-variables-with-static-storage-duration">Initializing
|
||||
variables with static storage duration</h3>
|
||||
<p>Variables with static storage duration and <em>dynamic
|
||||
initialization</em> <a
|
||||
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf">C++14
|
||||
3.6.2</a>). should be avoided, unless an implementation is permitted to
|
||||
perform the initialization as a static initialization. The order in
|
||||
which dynamic initializations occur is incompletely specified.
|
||||
Initialization order problems can be difficult to deal with and lead to
|
||||
surprises.</p>
|
||||
<p>Variables with static storage duration and non-trivial destructors
|
||||
should be avoided. HotSpot doesn't generally try to cleanup on exit, and
|
||||
running destructors at exit can lead to problems.</p>
|
||||
<p>Some of the approaches used in HotSpot to avoid dynamic
|
||||
initialization include:</p>
|
||||
<ul>
|
||||
<li><p>Use the <code>Deferred<T></code> class template. Add a call
|
||||
to its initialization function at an appropriate place during VM
|
||||
initialization. The underlying object is never destroyed.</p></li>
|
||||
<li><p>For objects of class type, use a variable whose value is a
|
||||
pointer to the class, initialized to <code>nullptr</code>. Provide an
|
||||
initialization function that sets the variable to a dynamically
|
||||
allocated object. Add a call to that function at an appropriate place
|
||||
during VM initialization. Such objects are usually never
|
||||
destroyed.</p></li>
|
||||
</ul>
|
||||
<h3 id="uniform-initialization">Uniform Initialization</h3>
|
||||
<p>The use of <em>uniform initialization</em> (<a
|
||||
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm">n2672</a>),
|
||||
@@ -1110,6 +1141,58 @@ function name and the parameter list.</li>
|
||||
<code>memory_order_consume</code>.</li>
|
||||
<li><code>[[deprecated]]</code> - Not relevant in HotSpot code.</li>
|
||||
</ul>
|
||||
<h3 id="noexcept">noexcept</h3>
|
||||
<p>Use of <code>noexcept</code> exception specifications (<a
|
||||
href="http://wg21.link/n3050">n3050</a>) are permitted with restrictions
|
||||
described below.</p>
|
||||
<ul>
|
||||
<li>Only the argument-less form of <code>noexcept</code> exception
|
||||
specifications are permitted.</li>
|
||||
<li>Allocation functions that may return <code>nullptr</code> to
|
||||
indicate allocation failure must be declared <code>noexcept</code>.</li>
|
||||
<li>All other uses of <code>noexcept</code> exception specifications are
|
||||
forbidden.</li>
|
||||
<li><code>noexcept</code> expressions are forbidden.</li>
|
||||
<li>Dynamic exception specifications are forbidden.</li>
|
||||
</ul>
|
||||
<p>HotSpot is built with exceptions disabled, e.g. compile with
|
||||
<code>-fno-exceptions</code> (gcc, clang) or no <code>/EH</code> option
|
||||
(MSVC++). So why do we need to consider <code>noexcept</code> at all?
|
||||
It's because <code>noexcept</code> exception specifications serve two
|
||||
distinct purposes.</p>
|
||||
<p>The first is to allow the compiler to avoid generating code or data
|
||||
in support of exceptions being thrown by a function. But this is
|
||||
unnecessary, because exceptions are disabled.</p>
|
||||
<p>The second is to allow the compiler and library code to choose
|
||||
different algorithms, depending on whether some function may throw
|
||||
exceptions. This is only relevant to a certain set of functions.</p>
|
||||
<ul>
|
||||
<li><p>Some allocation functions (<code>operator new</code> and
|
||||
<code>operator new[]</code>) return <code>nullptr</code> to indicate
|
||||
allocation failure. If a <code>new</code> expression calls such an
|
||||
allocation function, it must check for and handle that possibility.
|
||||
Declaring such a function <code>noexcept</code> informs the compiler
|
||||
that <code>nullptr</code> is a possible result. If an allocation
|
||||
function is not declared <code>noexcept</code> then the compiler may
|
||||
elide that checking and handling for a <code>new</code> expression
|
||||
calling that function.</p></li>
|
||||
<li><p>Certain Standard Library facilities (notably containers) provide
|
||||
different guarantees for some operations (and may choose different
|
||||
algorithms to implement those operations), depending on whether certain
|
||||
functions (constructors, copy/move operations, swap) are nothrow or not.
|
||||
They detect this using type traits that test whether a function is
|
||||
declared <code>noexcept</code>. This can have a significant performance
|
||||
impact if, for example, copying is chosen over a potentially throwing
|
||||
move. But this isn't relevant, since HotSpot forbids the use of most
|
||||
Standard Library facilities.</p></li>
|
||||
</ul>
|
||||
<p>HotSpot code can assume no exceptions will ever be thrown, even from
|
||||
functions not declared <code>noexcept</code>. So HotSpot code doesn't
|
||||
ever need to check, either with conditional exception specifications or
|
||||
with <code>noexcept</code> expressions.</p>
|
||||
<p>Dynamic exception specifications were deprecated in C++11. C++17
|
||||
removed all but <code>throw()</code>, with that remaining a deprecated
|
||||
equivalent to <code>noexcept</code>.</p>
|
||||
<h3 id="additional-permitted-features">Additional Permitted
|
||||
Features</h3>
|
||||
<ul>
|
||||
@@ -1198,12 +1281,6 @@ Library names.</p></li>
|
||||
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">n2179</a>)
|
||||
— HotSpot does not permit the use of exceptions, so this feature isn't
|
||||
useful.</p></li>
|
||||
<li><p>Avoid non-local variables with non-constexpr initialization. In
|
||||
particular, avoid variables with types requiring non-trivial
|
||||
initialization or destruction. Initialization order problems can be
|
||||
difficult to deal with and lead to surprises, as can destruction
|
||||
ordering. HotSpot doesn't generally try to cleanup on exit, and running
|
||||
destructors at exit can also lead to problems.</p></li>
|
||||
<li><p>Avoid most operator overloading, preferring named functions. When
|
||||
operator overloading is used, ensure the semantics conform to the normal
|
||||
expected behavior of the operation.</p></li>
|
||||
|
||||
@@ -770,6 +770,32 @@ ordering, which may differ from (may be stronger than) sequentially
|
||||
consistent. There are algorithms in HotSpot that are believed to rely
|
||||
on that ordering.
|
||||
|
||||
### Initializing variables with static storage duration
|
||||
|
||||
Variables with static storage duration and _dynamic initialization_
|
||||
[C++14 3.6.2](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
|
||||
should be avoided, unless an implementation is permitted to perform the
|
||||
initialization as a static initialization. The order in which dynamic
|
||||
initializations occur is incompletely specified. Initialization order
|
||||
problems can be difficult to deal with and lead to surprises.
|
||||
|
||||
Variables with static storage duration and non-trivial destructors should be
|
||||
avoided. HotSpot doesn't generally try to cleanup on exit, and running
|
||||
destructors at exit can lead to problems.
|
||||
|
||||
Some of the approaches used in HotSpot to avoid dynamic initialization
|
||||
include:
|
||||
|
||||
* Use the `Deferred<T>` class template. Add a call to its initialization
|
||||
function at an appropriate place during VM initialization. The underlying
|
||||
object is never destroyed.
|
||||
|
||||
* For objects of class type, use a variable whose value is a pointer to the
|
||||
class, initialized to `nullptr`. Provide an initialization function that sets
|
||||
the variable to a dynamically allocated object. Add a call to that function at
|
||||
an appropriate place during VM initialization. Such objects are usually never
|
||||
destroyed.
|
||||
|
||||
### Uniform Initialization
|
||||
|
||||
The use of _uniform initialization_
|
||||
@@ -1104,6 +1130,57 @@ The following attributes are expressly forbidden:
|
||||
* `[[carries_dependency]]` - Related to `memory_order_consume`.
|
||||
* `[[deprecated]]` - Not relevant in HotSpot code.
|
||||
|
||||
### noexcept
|
||||
|
||||
Use of `noexcept` exception specifications
|
||||
([n3050](http://wg21.link/n3050))
|
||||
are permitted with restrictions described below.
|
||||
|
||||
* Only the argument-less form of `noexcept` exception specifications are
|
||||
permitted.
|
||||
* Allocation functions that may return `nullptr` to indicate allocation
|
||||
failure must be declared `noexcept`.
|
||||
* All other uses of `noexcept` exception specifications are forbidden.
|
||||
* `noexcept` expressions are forbidden.
|
||||
* Dynamic exception specifications are forbidden.
|
||||
|
||||
HotSpot is built with exceptions disabled, e.g. compile with `-fno-exceptions`
|
||||
(gcc, clang) or no `/EH` option (MSVC++). So why do we need to consider
|
||||
`noexcept` at all? It's because `noexcept` exception specifications serve two
|
||||
distinct purposes.
|
||||
|
||||
The first is to allow the compiler to avoid generating code or data in support
|
||||
of exceptions being thrown by a function. But this is unnecessary, because
|
||||
exceptions are disabled.
|
||||
|
||||
The second is to allow the compiler and library code to choose different
|
||||
algorithms, depending on whether some function may throw exceptions. This is
|
||||
only relevant to a certain set of functions.
|
||||
|
||||
* Some allocation functions (`operator new` and `operator new[]`) return
|
||||
`nullptr` to indicate allocation failure. If a `new` expression calls such an
|
||||
allocation function, it must check for and handle that possibility. Declaring
|
||||
such a function `noexcept` informs the compiler that `nullptr` is a possible
|
||||
result. If an allocation function is not declared `noexcept` then the compiler
|
||||
may elide that checking and handling for a `new` expression calling that
|
||||
function.
|
||||
|
||||
* Certain Standard Library facilities (notably containers) provide different
|
||||
guarantees for some operations (and may choose different algorithms to
|
||||
implement those operations), depending on whether certain functions
|
||||
(constructors, copy/move operations, swap) are nothrow or not. They detect
|
||||
this using type traits that test whether a function is declared `noexcept`.
|
||||
This can have a significant performance impact if, for example, copying is
|
||||
chosen over a potentially throwing move. But this isn't relevant, since
|
||||
HotSpot forbids the use of most Standard Library facilities.
|
||||
|
||||
HotSpot code can assume no exceptions will ever be thrown, even from functions
|
||||
not declared `noexcept`. So HotSpot code doesn't ever need to check, either
|
||||
with conditional exception specifications or with `noexcept` expressions.
|
||||
|
||||
Dynamic exception specifications were deprecated in C++11. C++17 removed all
|
||||
but `throw()`, with that remaining a deprecated equivalent to `noexcept`.
|
||||
|
||||
### Additional Permitted Features
|
||||
|
||||
* `alignof`
|
||||
@@ -1199,13 +1276,6 @@ namespace std;` to avoid needing to qualify Standard Library names.
|
||||
([n2179](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html)) —
|
||||
HotSpot does not permit the use of exceptions, so this feature isn't useful.
|
||||
|
||||
* Avoid non-local variables with non-constexpr initialization.
|
||||
In particular, avoid variables with types requiring non-trivial
|
||||
initialization or destruction. Initialization order problems can be
|
||||
difficult to deal with and lead to surprises, as can destruction
|
||||
ordering. HotSpot doesn't generally try to cleanup on exit, and
|
||||
running destructors at exit can also lead to problems.
|
||||
|
||||
* Avoid most operator overloading, preferring named functions. When
|
||||
operator overloading is used, ensure the semantics conform to the
|
||||
normal expected behavior of the operation.
|
||||
|
||||
@@ -1014,7 +1014,7 @@ else
|
||||
else ifeq ($(EXTERNAL_BUILDJDK), false)
|
||||
# When not cross compiling, the BUILD_JDK is the interim jdk image, and
|
||||
# the javac launcher is needed.
|
||||
jdk.compiler-gendata: jdk.compiler-launchers
|
||||
jdk.compiler-gendata: jdk.compiler-launchers java.base-launchers
|
||||
jdk.javadoc-gendata: jdk.compiler-launchers
|
||||
endif
|
||||
|
||||
|
||||
@@ -78,6 +78,9 @@ TOOL_GENERATECACERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_class
|
||||
TOOL_GENERATEEXTRAPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.generateextraproperties.GenerateExtraProperties
|
||||
|
||||
TOOL_GENERATECASEFOLDING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.generatecharacter.CaseFolding
|
||||
|
||||
TOOL_MAKEZIPREPRODUCIBLE = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.makezipreproducible.MakeZipReproducible
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ ATTRIBUTE_DEFAULT_VISIBILITY ATTRIBUTE_USED const char* CDECL __asan_default_opt
|
||||
#endif
|
||||
"print_suppressions=0,"
|
||||
"handle_segv=0,"
|
||||
// A lot of libjsig related tests fail because of the link order check; so better avoid it
|
||||
"verify_asan_link_order=0,"
|
||||
// See https://github.com/google/sanitizers/issues/1322. Hopefully this is resolved
|
||||
// at some point and we can remove this option.
|
||||
"intercept_tls_get_addr=0";
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -64,6 +64,30 @@ IS_WSL=`echo $UNAME_RELEASE | grep Microsoft`
|
||||
IS_MSYS=`echo $UNAME_OS | grep -i Msys`
|
||||
MSYS2_ARG_CONV_EXCL="*" # make "cmd.exe /c" work for msys2
|
||||
CMD_EXE="cmd.exe /c"
|
||||
|
||||
# Detect host architecture to determine devkit platform support
|
||||
# Note: The devkit always includes x86, x64, and aarch64 libraries and tools
|
||||
# The difference is in toolchain capabilities:
|
||||
# - On x64|AMD64 hosts: aarch64 tools are cross-compilation tools (Hostx64/arm64)
|
||||
# - On aarch64|ARMv8 hosts: aarch64 tools are native tools (Hostarm64/arm64)
|
||||
HOST_ARCH=`echo $PROCESSOR_IDENTIFIER`
|
||||
case $HOST_ARCH in
|
||||
AMD64)
|
||||
echo "Running on x64 host - generating devkit with native x86/x64 tools and cross-compiled aarch64 tools."
|
||||
echo "For native aarch64 compilation tools, run this script on a Windows/aarch64 machine."
|
||||
SUPPORTED_PLATFORMS="x86, x64 (native) and aarch64 (cross-compiled)"
|
||||
;;
|
||||
ARMv8)
|
||||
echo "Running on aarch64 host - generating devkit with native tools for all platforms (x86, x64, aarch64)."
|
||||
SUPPORTED_PLATFORMS="x86, x64, and aarch64 (all native)"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown host architecture: $HOST_ARCH"
|
||||
echo "Proceeding with devkit generation - toolchain capabilities may vary."
|
||||
SUPPORTED_PLATFORMS="x86, x64, and aarch64"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$IS_CYGWIN" != "x"; then
|
||||
BUILD_ENV="cygwin"
|
||||
elif test "x$IS_MSYS" != "x"; then
|
||||
@@ -139,6 +163,7 @@ DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit"
|
||||
DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
|
||||
|
||||
echo "Creating devkit in $DEVKIT_ROOT"
|
||||
echo "Platform support: $SUPPORTED_PLATFORMS"
|
||||
|
||||
MSVCR_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}.dll
|
||||
VCRUNTIME_1_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}_1.dll
|
||||
@@ -156,7 +181,11 @@ REDIST_SUBDIR="VC/Redist/MSVC/$REDIST_VERSION"
|
||||
echo "Copying VC..."
|
||||
rm -rf $DEVKIT_ROOT/VC
|
||||
mkdir -p $DEVKIT_ROOT/VC/bin
|
||||
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/arm64" $DEVKIT_ROOT/VC/bin/
|
||||
if [ -d "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostarm64/arm64" ]; then
|
||||
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostarm64/arm64" $DEVKIT_ROOT/VC/bin/
|
||||
else
|
||||
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/arm64" $DEVKIT_ROOT/VC/bin/
|
||||
fi
|
||||
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/
|
||||
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/
|
||||
mkdir -p $DEVKIT_ROOT/VC/lib
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package build.tools.generatecharacter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class CaseFolding {
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
if (args.length != 3) {
|
||||
System.err.println("Usage: java CaseFolding TemplateFile CaseFolding.txt CaseFolding.java");
|
||||
System.exit(1);
|
||||
}
|
||||
var templateFile = Paths.get(args[0]);
|
||||
var caseFoldingTxt = Paths.get(args[1]);
|
||||
var genSrcFile = Paths.get(args[2]);
|
||||
var supportedTypes = "^.*; [CTS]; .*$";
|
||||
var caseFoldingEntries = Files.lines(caseFoldingTxt)
|
||||
.filter(line -> !line.startsWith("#") && line.matches(supportedTypes))
|
||||
.map(line -> {
|
||||
String[] cols = line.split("; ");
|
||||
return new String[] {cols[0], cols[1], cols[2]};
|
||||
})
|
||||
.filter(cols -> {
|
||||
// the folding case doesn't map back to the original char.
|
||||
var cp1 = Integer.parseInt(cols[0], 16);
|
||||
var cp2 = Integer.parseInt(cols[2], 16);
|
||||
return Character.toUpperCase(cp2) != cp1 && Character.toLowerCase(cp2) != cp1;
|
||||
})
|
||||
.map(cols -> String.format(" entry(0x%s, 0x%s)", cols[0], cols[2]))
|
||||
.collect(Collectors.joining(",\n", "", ""));
|
||||
|
||||
// hack, hack, hack! the logic does not pick 0131. just add manually to support 'I's.
|
||||
// 0049; T; 0131; # LATIN CAPITAL LETTER I
|
||||
final String T_0x0131_0x49 = String.format(" entry(0x%04x, 0x%04x),\n", 0x0131, 0x49);
|
||||
|
||||
// Generate .java file
|
||||
Files.write(
|
||||
genSrcFile,
|
||||
Files.lines(templateFile)
|
||||
.map(line -> line.contains("%%%Entries") ? T_0x0131_0x49 + caseFoldingEntries : line)
|
||||
.collect(Collectors.toList()),
|
||||
StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -47,6 +47,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Properties;
|
||||
@@ -93,7 +94,9 @@ public class ClassGenerator {
|
||||
FACTORY_FIELD_LINT("factory.decl.field.lint"),
|
||||
WILDCARDS_EXTENDS("wildcards.extends"),
|
||||
SUPPRESS_WARNINGS("suppress.warnings"),
|
||||
LINT_CATEGORY("lint.category");
|
||||
LINT_CATEGORY("lint.category"),
|
||||
DIAGNOSTIC_FLAGS_EMPTY("diagnostic.flags.empty"),
|
||||
DIAGNOSTIC_FLAGS_NON_EMPTY("diagnostic.flags.non-empty");
|
||||
|
||||
/** stub key (as it appears in the property file) */
|
||||
String key;
|
||||
@@ -259,17 +262,30 @@ public class ClassGenerator {
|
||||
.map(MessageLine::lintCategory)
|
||||
.findFirst().orElse(null);
|
||||
//System.out.println("category for " + key + " = " + lintCategory);
|
||||
String diagnosticFlags = lines.stream()
|
||||
.filter(MessageLine::isDiagnosticFlags)
|
||||
.map(MessageLine::diagnosticFlags)
|
||||
.flatMap(Stream::of)
|
||||
.map(s -> s.replace('-', '_'))
|
||||
.map(s -> s.toUpperCase(Locale.ROOT))
|
||||
.collect(Collectors.joining(", "));
|
||||
String factoryName = factoryName(key);
|
||||
if (msgInfo.getTypes().isEmpty()) {
|
||||
//generate field
|
||||
String factoryField;
|
||||
if (lintCategory == null) {
|
||||
factoryField = StubKind.FACTORY_FIELD.format(k.keyClazz, factoryName,
|
||||
diagnosticFlags.isEmpty() ?
|
||||
StubKind.DIAGNOSTIC_FLAGS_EMPTY.format() :
|
||||
StubKind.DIAGNOSTIC_FLAGS_NON_EMPTY.format(diagnosticFlags),
|
||||
"\"" + keyParts[0] + "\"",
|
||||
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
|
||||
javadoc);
|
||||
} else {
|
||||
factoryField = StubKind.FACTORY_FIELD_LINT.format(k.keyClazz, factoryName,
|
||||
diagnosticFlags.isEmpty() ?
|
||||
StubKind.DIAGNOSTIC_FLAGS_EMPTY.format() :
|
||||
StubKind.DIAGNOSTIC_FLAGS_NON_EMPTY.format(diagnosticFlags),
|
||||
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
|
||||
"\"" + keyParts[0] + "\"",
|
||||
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
|
||||
@@ -287,11 +303,17 @@ public class ClassGenerator {
|
||||
String methodBody;
|
||||
if (lintCategory == null) {
|
||||
methodBody = StubKind.FACTORY_METHOD_BODY.format(k.keyClazz,
|
||||
diagnosticFlags.isEmpty() ?
|
||||
StubKind.DIAGNOSTIC_FLAGS_EMPTY.format() :
|
||||
StubKind.DIAGNOSTIC_FLAGS_NON_EMPTY.format(diagnosticFlags),
|
||||
"\"" + keyParts[0] + "\"",
|
||||
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
|
||||
argNames.stream().collect(Collectors.joining(", ")));
|
||||
} else {
|
||||
methodBody = StubKind.FACTORY_METHOD_BODY_LINT.format(k.keyClazz,
|
||||
diagnosticFlags.isEmpty() ?
|
||||
StubKind.DIAGNOSTIC_FLAGS_EMPTY.format() :
|
||||
StubKind.DIAGNOSTIC_FLAGS_NON_EMPTY.format(diagnosticFlags),
|
||||
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
|
||||
"\"" + keyParts[0] + "\"",
|
||||
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
|
||||
|
||||
@@ -32,7 +32,8 @@ import java.util.List;
|
||||
* A message within the message file.
|
||||
* A message is a series of lines containing a "name=value" property,
|
||||
* optionally preceded by a comment describing the use of placeholders
|
||||
* such as {0}, {1}, etc within the property value.
|
||||
* such as {0}, {1}, etc within the property value, a lint category,
|
||||
* and/or a list of diagnostic flags.
|
||||
*/
|
||||
public final class Message {
|
||||
final MessageLine firstLine;
|
||||
@@ -49,7 +50,7 @@ public final class Message {
|
||||
public MessageInfo getMessageInfo() {
|
||||
if (messageInfo == null) {
|
||||
MessageLine l = firstLine.prev;
|
||||
if (l != null && l.isLint()) {
|
||||
while (l != null && (l.isLint() || l.isDiagnosticFlags())) {
|
||||
l = l.prev;
|
||||
}
|
||||
if (l != null && l.isInfo())
|
||||
@@ -74,7 +75,7 @@ public final class Message {
|
||||
while (l.text.isEmpty())
|
||||
l = l.next;
|
||||
} else {
|
||||
if (l.prev != null && (l.prev.isInfo() || l.prev.isLint()))
|
||||
while (l.prev != null && (l.prev.isInfo() || l.prev.isLint() || l.prev.isDiagnosticFlags()))
|
||||
l = l.prev;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package propertiesparser.parser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -39,6 +40,7 @@ public class MessageLine {
|
||||
static final Pattern infoPattern = Pattern.compile(String.format("# ([0-9]+: %s, )*[0-9]+: %s",
|
||||
typePattern.pattern(), typePattern.pattern()));
|
||||
static final Pattern lintPattern = Pattern.compile("# lint: ([a-z\\-]+)");
|
||||
static final Pattern diagnosticFlagsPattern = Pattern.compile("# flags: ([a-z\\-]+(, ([a-z\\-]+))*)");
|
||||
|
||||
public String text;
|
||||
MessageLine prev;
|
||||
@@ -69,6 +71,19 @@ public class MessageLine {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDiagnosticFlags() {
|
||||
return diagnosticFlagsPattern.matcher(text).matches();
|
||||
}
|
||||
|
||||
public String[] diagnosticFlags() {
|
||||
Matcher matcher = diagnosticFlagsPattern.matcher(text);
|
||||
if (matcher.matches()) {
|
||||
return matcher.group(1).split(", ", -1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
boolean hasContinuation() {
|
||||
return (next != null) && text.endsWith("\\");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -27,6 +27,7 @@ toplevel.decl=\
|
||||
package {0};\n\
|
||||
\n\
|
||||
{1}\n\
|
||||
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;\n\
|
||||
import com.sun.tools.javac.util.JCDiagnostic.Error;\n\
|
||||
import com.sun.tools.javac.util.JCDiagnostic.Warning;\n\
|
||||
import com.sun.tools.javac.util.JCDiagnostic.LintWarning;\n\
|
||||
@@ -34,6 +35,10 @@ toplevel.decl=\
|
||||
import com.sun.tools.javac.util.JCDiagnostic.Fragment;\n\
|
||||
import com.sun.tools.javac.code.Lint.LintCategory;\n\
|
||||
\n\
|
||||
import java.util.EnumSet;\n\
|
||||
\n\
|
||||
import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;\n\
|
||||
\n\
|
||||
public class {2} '{'\n\
|
||||
{3}\n\
|
||||
'}'\n
|
||||
@@ -58,22 +63,22 @@ factory.decl.method.arg=\
|
||||
arg{0}
|
||||
|
||||
factory.decl.method.body=\
|
||||
return new {0}({1}, {2}, {3});
|
||||
return new {0}({1}, {2}, {3}, {4});
|
||||
|
||||
factory.decl.method.body.lint=\
|
||||
return new {0}({1}, {2}, {3}, {4});
|
||||
return new {0}({1}, {2}, {3}, {4}, {5});
|
||||
|
||||
factory.decl.field=\
|
||||
/**\n\
|
||||
' '* {4}\n\
|
||||
' '*/\n\
|
||||
public static final {0} {1} = new {0}({2}, {3});
|
||||
public static final {0} {1} = new {0}({2}, {3}, {4});
|
||||
|
||||
factory.decl.field.lint=\
|
||||
/**\n\
|
||||
' '* {5}\n\
|
||||
' '*/\n\
|
||||
public static final {0} {1} = new {0}({2}, {3}, {4});
|
||||
public static final {0} {1} = new {0}({2}, {3}, {4}, {5});
|
||||
|
||||
wildcards.extends=\
|
||||
{0}<? extends {1}>
|
||||
@@ -84,3 +89,9 @@ suppress.warnings=\
|
||||
lint.category=\
|
||||
LintCategory.get({0}).get()
|
||||
|
||||
diagnostic.flags.empty=\
|
||||
EnumSet.noneOf(DiagnosticFlag.class)
|
||||
|
||||
diagnostic.flags.non-empty=\
|
||||
EnumSet.of({0})
|
||||
|
||||
|
||||
@@ -50,5 +50,22 @@ TARGETS += $(GENSRC_INDICCONJUNCTBREAK)
|
||||
|
||||
################################################################################
|
||||
|
||||
GENSRC_CASEFOLDING := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/util/regex/CaseFolding.java
|
||||
|
||||
CASEFOLDINGTEMP := $(MODULE_SRC)/share/classes/jdk/internal/util/regex/CaseFolding.java.template
|
||||
CASEFOLDINGTXT := $(MODULE_SRC)/share/data/unicodedata/CaseFolding.txt
|
||||
|
||||
$(GENSRC_CASEFOLDING): $(BUILD_TOOLS_JDK) $(CASEFOLDINGTEMP) $(CASEFOLDINGTXT)
|
||||
$(call LogInfo, Generating $@)
|
||||
$(call MakeTargetDir)
|
||||
$(TOOL_GENERATECASEFOLDING) \
|
||||
$(CASEFOLDINGTEMP) \
|
||||
$(CASEFOLDINGTXT) \
|
||||
$(GENSRC_CASEFOLDING)
|
||||
|
||||
TARGETS += $(GENSRC_CASEFOLDING)
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
|
||||
@@ -92,6 +92,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
|
||||
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.jimage=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.util=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
|
||||
|
||||
ifndef SOURCE
|
||||
export SOURCE := 7
|
||||
export SOURCE := 8
|
||||
endif
|
||||
ifndef TARGET
|
||||
export TARGET := 7
|
||||
export TARGET := 8
|
||||
endif
|
||||
ifndef JAVAC
|
||||
export JAVAC := javac
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
<property name="dist" location="dist"/>
|
||||
<property name="resources" location="resources"/>
|
||||
|
||||
<condition property="source" value="7">
|
||||
<condition property="source" value="8">
|
||||
<not>
|
||||
<isset property="source"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="target" value="7">
|
||||
<condition property="target" value="8">
|
||||
<not>
|
||||
<isset property="target"/>
|
||||
</not>
|
||||
@@ -54,11 +54,6 @@
|
||||
<isset property="java"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="javac" value="javac">
|
||||
<not>
|
||||
<isset property="javac"/>
|
||||
</not>
|
||||
</condition>
|
||||
|
||||
<target name="init">
|
||||
<!-- Create the time stamp -->
|
||||
@@ -70,7 +65,7 @@
|
||||
<target name="compile" depends="init"
|
||||
description="compile the source " >
|
||||
<!-- Compile the java code from ${src} into ${build} -->
|
||||
<javac debug="off" source="${source}" target="${target}" srcdir="${src}" destdir="${build}" fork="true" executable="${javac}"/>
|
||||
<javac debug="off" source="${source}" target="${target}" srcdir="${src}" destdir="${build}"/>
|
||||
</target>
|
||||
|
||||
<target name="run" depends="dist"
|
||||
|
||||
@@ -270,7 +270,7 @@ public class J2DAnalyzer {
|
||||
} else {
|
||||
double overallscore = totalscore[i]/numtests[i];
|
||||
System.out.println(" Number of tests: "+numtests[i]);
|
||||
System.out.println(" Overall average: "+overallscore);
|
||||
System.out.printf( " Overall average: %-10.4f%n", overallscore);
|
||||
System.out.println(" Best spread: "+bestspread[i]+
|
||||
"% variance");
|
||||
System.out.println(" Worst spread: "+worstspread[i]+
|
||||
|
||||
@@ -362,7 +362,7 @@ public class RunWindow extends JPanel implements Runnable, ActionListener {
|
||||
/**
|
||||
* This class contains initial values for instance variables of 'RunWindow' class,
|
||||
* and its instance is used in creation of 'RunWindow' object. Values parsed from
|
||||
* certain command line options of the demo or from the demo applet parameters are
|
||||
* certain command line options of the demo
|
||||
* set to the fields of this class instance. It is a part of the fix which changed
|
||||
* static variables for instance variables in certain demo classes.
|
||||
*
|
||||
|
||||
@@ -406,13 +406,6 @@ public final class Tools extends JPanel implements ActionListener,
|
||||
if (pDialogState) {
|
||||
printJob.print(aset);
|
||||
}
|
||||
} catch (@SuppressWarnings("removal") java.security.AccessControlException ace) {
|
||||
String errmsg = "Applet access control exception; to allow "
|
||||
+ "access to printer, set\n"
|
||||
+ "permission for \"queuePrintJob\" in "
|
||||
+ "RuntimePermission.";
|
||||
JOptionPane.showMessageDialog(this, errmsg, "Printer Access Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(Tools.class.getName()).log(Level.SEVERE,
|
||||
null, ex);
|
||||
|
||||
@@ -131,7 +131,7 @@ public class SwingSet2 extends JPanel {
|
||||
private JEditorPane demoSrcPane = null;
|
||||
|
||||
|
||||
// contentPane cache, saved from the applet or application frame
|
||||
// contentPane cache, saved from the application frame
|
||||
Container contentPane = null;
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ public class SwingSet2 extends JPanel {
|
||||
|
||||
|
||||
/**
|
||||
* SwingSet2 Main. Called only if we're an application, not an applet.
|
||||
* SwingSet2 Main.
|
||||
*/
|
||||
public static void main(final String[] args) {
|
||||
// must run in EDT when constructing the GUI components
|
||||
@@ -716,8 +716,7 @@ public class SwingSet2 extends JPanel {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content pane whether we're in an applet
|
||||
* or application
|
||||
* Returns the content pane
|
||||
*/
|
||||
public Container getContentPane() {
|
||||
if(contentPane == null) {
|
||||
|
||||
@@ -456,13 +456,13 @@ SliderDemo.horizontal=Horizontal
|
||||
SliderDemo.vertical=Vertikal
|
||||
SliderDemo.plain=Einfach
|
||||
SliderDemo.a_plain_slider=Ein einfacher Schieberegler
|
||||
SliderDemo.majorticks=Grobteilungen
|
||||
SliderDemo.majorticksdescription=Ein Schieberegler mit Grobteilungsmarkierungen
|
||||
SliderDemo.ticks=Feinteilungen, Teilungen zum Einrasten und Labels
|
||||
SliderDemo.minorticks=Feinteilungen
|
||||
SliderDemo.minorticksdescription=Ein Schieberegler mit Grob- und Feinteilungen, mit Teilungen, in die der Schieberegler einrastet, wobei einige Teilungen mit einem sichtbaren Label versehen sind
|
||||
SliderDemo.majorticks=Hauptteilstriche
|
||||
SliderDemo.majorticksdescription=Ein Schieberegler mit Hauptteilstrichen
|
||||
SliderDemo.ticks=Hilfsteilstriche, zum Einrasten und Beschriften
|
||||
SliderDemo.minorticks=Hilfsteilstriche
|
||||
SliderDemo.minorticksdescription=Ein Schieberegler mit Haupt- und Hilfsteilstrichen, in die der Schieberegler einrastet, wobei einige Teilstriche mit einer sichtbaren Beschriftung versehen sind
|
||||
SliderDemo.disabled=Deaktiviert
|
||||
SliderDemo.disableddescription=Ein Schieberegler mit Grob- und Feinteilungen, der nicht aktiviert ist (kann nicht bearbeitet werden)
|
||||
SliderDemo.disableddescription=Ein Schieberegler mit Haupt- und Hilfsteilstrichen, der nicht aktiviert ist (kann nicht bearbeitet werden)
|
||||
|
||||
### SplitPane Demo ###
|
||||
|
||||
|
||||
@@ -1765,10 +1765,6 @@ void MachPrologNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
|
||||
// n.b. frame size includes space for return pc and rfp
|
||||
const int framesize = C->output()->frame_size_in_bytes();
|
||||
|
||||
// insert a nop at the start of the prolog so we can patch in a
|
||||
// branch if we need to invalidate the method later
|
||||
__ nop();
|
||||
|
||||
if (C->clinit_barrier_on_entry()) {
|
||||
assert(!C->method()->holder()->is_not_initialized(), "initialization should have been started");
|
||||
|
||||
@@ -2366,17 +2362,34 @@ int Matcher::max_vector_size(const BasicType bt) {
|
||||
}
|
||||
|
||||
int Matcher::min_vector_size(const BasicType bt) {
|
||||
int max_size = max_vector_size(bt);
|
||||
// Limit the min vector size to 8 bytes.
|
||||
int size = 8 / type2aelembytes(bt);
|
||||
if (bt == T_BYTE) {
|
||||
// To support vector api shuffle/rearrange.
|
||||
size = 4;
|
||||
} else if (bt == T_BOOLEAN) {
|
||||
// To support vector api load/store mask.
|
||||
size = 2;
|
||||
// Usually, the shortest vector length supported by AArch64 ISA and
|
||||
// Vector API species is 64 bits. However, we allow 32-bit or 16-bit
|
||||
// vectors in a few special cases.
|
||||
int size;
|
||||
switch(bt) {
|
||||
case T_BOOLEAN:
|
||||
// Load/store a vector mask with only 2 elements for vector types
|
||||
// such as "2I/2F/2L/2D".
|
||||
size = 2;
|
||||
break;
|
||||
case T_BYTE:
|
||||
// Generate a "4B" vector, to support vector cast between "8B/16B"
|
||||
// and "4S/4I/4L/4F/4D".
|
||||
size = 4;
|
||||
break;
|
||||
case T_SHORT:
|
||||
// Generate a "2S" vector, to support vector cast between "4S/8S"
|
||||
// and "2I/2L/2F/2D".
|
||||
size = 2;
|
||||
break;
|
||||
default:
|
||||
// Limit the min vector length to 64-bit.
|
||||
size = 8 / type2aelembytes(bt);
|
||||
// The number of elements in a vector should be at least 2.
|
||||
size = MAX2(size, 2);
|
||||
}
|
||||
if (size < 2) size = 2;
|
||||
|
||||
int max_size = max_vector_size(bt);
|
||||
return MIN2(size, max_size);
|
||||
}
|
||||
|
||||
@@ -3454,10 +3467,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;
|
||||
@@ -4558,20 +4567,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()
|
||||
@@ -6858,20 +6853,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)
|
||||
|
||||
@@ -131,7 +131,7 @@ source %{
|
||||
// These operations are not profitable to be vectorized on NEON, because no direct
|
||||
// NEON instructions support them. But the match rule support for them is profitable for
|
||||
// Vector API intrinsics.
|
||||
if ((opcode == Op_VectorCastD2X && bt == T_INT) ||
|
||||
if ((opcode == Op_VectorCastD2X && (bt == T_INT || bt == T_SHORT)) ||
|
||||
(opcode == Op_VectorCastL2X && bt == T_FLOAT) ||
|
||||
(opcode == Op_CountLeadingZerosV && bt == T_LONG) ||
|
||||
(opcode == Op_CountTrailingZerosV && bt == T_LONG) ||
|
||||
@@ -189,6 +189,18 @@ source %{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_AddReductionVI:
|
||||
case Op_AndReductionV:
|
||||
case Op_OrReductionV:
|
||||
case Op_XorReductionV:
|
||||
case Op_MinReductionV:
|
||||
case Op_MaxReductionV:
|
||||
// Reductions with less than 8 bytes vector length are
|
||||
// not supported.
|
||||
if (length_in_bytes < 8) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_MulReductionVD:
|
||||
case Op_MulReductionVF:
|
||||
case Op_MulReductionVI:
|
||||
@@ -4244,8 +4256,8 @@ instruct vzeroExtStoX(vReg dst, vReg src) %{
|
||||
assert(bt == T_INT || bt == T_LONG, "must be");
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
// 4S to 4I
|
||||
__ neon_vector_extend($dst$$FloatRegister, T_INT, length_in_bytes,
|
||||
// 2S to 2I/2L, 4S to 4I
|
||||
__ neon_vector_extend($dst$$FloatRegister, bt, length_in_bytes,
|
||||
$src$$FloatRegister, T_SHORT, /* is_unsigned */ true);
|
||||
} else {
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
@@ -4265,11 +4277,11 @@ instruct vzeroExtItoX(vReg dst, vReg src) %{
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
// 2I to 2L
|
||||
__ neon_vector_extend($dst$$FloatRegister, T_LONG, length_in_bytes,
|
||||
__ neon_vector_extend($dst$$FloatRegister, bt, length_in_bytes,
|
||||
$src$$FloatRegister, T_INT, /* is_unsigned */ true);
|
||||
} else {
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
__ sve_vector_extend($dst$$FloatRegister, __ D,
|
||||
__ sve_vector_extend($dst$$FloatRegister, __ elemType_to_regVariant(bt),
|
||||
$src$$FloatRegister, __ S, /* is_unsigned */ true);
|
||||
}
|
||||
%}
|
||||
@@ -4343,11 +4355,15 @@ instruct vcvtStoX_extend(vReg dst, vReg src) %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
// 4S to 4I/4F
|
||||
__ neon_vector_extend($dst$$FloatRegister, T_INT, length_in_bytes,
|
||||
$src$$FloatRegister, T_SHORT);
|
||||
if (bt == T_FLOAT) {
|
||||
__ scvtfv(__ T4S, $dst$$FloatRegister, $dst$$FloatRegister);
|
||||
if (is_floating_point_type(bt)) {
|
||||
// 2S to 2F/2D, 4S to 4F
|
||||
__ neon_vector_extend($dst$$FloatRegister, bt == T_FLOAT ? T_INT : T_LONG,
|
||||
length_in_bytes, $src$$FloatRegister, T_SHORT);
|
||||
__ scvtfv(get_arrangement(this), $dst$$FloatRegister, $dst$$FloatRegister);
|
||||
} else {
|
||||
// 2S to 2I/2L, 4S to 4I
|
||||
__ neon_vector_extend($dst$$FloatRegister, bt, length_in_bytes,
|
||||
$src$$FloatRegister, T_SHORT);
|
||||
}
|
||||
} else {
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
@@ -4371,7 +4387,7 @@ instruct vcvtItoX_narrow_neon(vReg dst, vReg src) %{
|
||||
effect(TEMP_DEF dst);
|
||||
format %{ "vcvtItoX_narrow_neon $dst, $src" %}
|
||||
ins_encode %{
|
||||
// 4I to 4B/4S
|
||||
// 2I to 2S, 4I to 4B/4S
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src);
|
||||
__ neon_vector_narrow($dst$$FloatRegister, bt,
|
||||
@@ -4434,28 +4450,29 @@ instruct vcvtItoX(vReg dst, vReg src) %{
|
||||
|
||||
// VectorCastL2X
|
||||
|
||||
instruct vcvtLtoI_neon(vReg dst, vReg src) %{
|
||||
predicate(Matcher::vector_element_basic_type(n) == T_INT &&
|
||||
instruct vcvtLtoX_narrow_neon(vReg dst, vReg src) %{
|
||||
predicate((Matcher::vector_element_basic_type(n) == T_INT ||
|
||||
Matcher::vector_element_basic_type(n) == T_SHORT) &&
|
||||
VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1))));
|
||||
match(Set dst (VectorCastL2X src));
|
||||
format %{ "vcvtLtoI_neon $dst, $src" %}
|
||||
format %{ "vcvtLtoX_narrow_neon $dst, $src" %}
|
||||
ins_encode %{
|
||||
// 2L to 2I
|
||||
// 2L to 2S/2I
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src);
|
||||
__ neon_vector_narrow($dst$$FloatRegister, T_INT,
|
||||
__ neon_vector_narrow($dst$$FloatRegister, bt,
|
||||
$src$$FloatRegister, T_LONG, length_in_bytes);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct vcvtLtoI_sve(vReg dst, vReg src, vReg tmp) %{
|
||||
predicate((Matcher::vector_element_basic_type(n) == T_INT &&
|
||||
!VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1)))) ||
|
||||
Matcher::vector_element_basic_type(n) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n) == T_SHORT);
|
||||
instruct vcvtLtoX_narrow_sve(vReg dst, vReg src, vReg tmp) %{
|
||||
predicate(!VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1))) &&
|
||||
!is_floating_point_type(Matcher::vector_element_basic_type(n)) &&
|
||||
type2aelembytes(Matcher::vector_element_basic_type(n)) <= 4);
|
||||
match(Set dst (VectorCastL2X src));
|
||||
effect(TEMP_DEF dst, TEMP tmp);
|
||||
format %{ "vcvtLtoI_sve $dst, $src\t# KILL $tmp" %}
|
||||
format %{ "vcvtLtoX_narrow_sve $dst, $src\t# KILL $tmp" %}
|
||||
ins_encode %{
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
@@ -4521,10 +4538,11 @@ instruct vcvtFtoX_narrow_neon(vReg dst, vReg src) %{
|
||||
effect(TEMP_DEF dst);
|
||||
format %{ "vcvtFtoX_narrow_neon $dst, $src" %}
|
||||
ins_encode %{
|
||||
// 4F to 4B/4S
|
||||
// 2F to 2S, 4F to 4B/4S
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src);
|
||||
__ fcvtzs($dst$$FloatRegister, __ T4S, $src$$FloatRegister);
|
||||
__ fcvtzs($dst$$FloatRegister, length_in_bytes == 16 ? __ T4S : __ T2S,
|
||||
$src$$FloatRegister);
|
||||
__ neon_vector_narrow($dst$$FloatRegister, bt,
|
||||
$dst$$FloatRegister, T_INT, length_in_bytes);
|
||||
%}
|
||||
@@ -4590,12 +4608,14 @@ instruct vcvtFtoX(vReg dst, vReg src) %{
|
||||
// VectorCastD2X
|
||||
|
||||
instruct vcvtDtoI_neon(vReg dst, vReg src) %{
|
||||
predicate(UseSVE == 0 && Matcher::vector_element_basic_type(n) == T_INT);
|
||||
predicate(UseSVE == 0 &&
|
||||
(Matcher::vector_element_basic_type(n) == T_INT ||
|
||||
Matcher::vector_element_basic_type(n) == T_SHORT));
|
||||
match(Set dst (VectorCastD2X src));
|
||||
effect(TEMP_DEF dst);
|
||||
format %{ "vcvtDtoI_neon $dst, $src\t# 2D to 2I" %}
|
||||
format %{ "vcvtDtoI_neon $dst, $src\t# 2D to 2S/2I" %}
|
||||
ins_encode %{
|
||||
// 2D to 2I
|
||||
// 2D to 2S/2I
|
||||
__ ins($dst$$FloatRegister, __ D, $src$$FloatRegister, 0, 1);
|
||||
// We can't use fcvtzs(vector, integer) instruction here because we need
|
||||
// saturation arithmetic. See JDK-8276151.
|
||||
@@ -4603,6 +4623,10 @@ instruct vcvtDtoI_neon(vReg dst, vReg src) %{
|
||||
__ fcvtzdw(rscratch2, $dst$$FloatRegister);
|
||||
__ fmovs($dst$$FloatRegister, rscratch1);
|
||||
__ mov($dst$$FloatRegister, __ S, 1, rscratch2);
|
||||
if (Matcher::vector_element_basic_type(this) == T_SHORT) {
|
||||
__ neon_vector_narrow($dst$$FloatRegister, T_SHORT,
|
||||
$dst$$FloatRegister, T_INT, 8);
|
||||
}
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
@@ -4676,7 +4700,7 @@ instruct vcvtHFtoF(vReg dst, vReg src) %{
|
||||
ins_encode %{
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
// 4HF to 4F
|
||||
// 2HF to 2F, 4HF to 4F
|
||||
__ fcvtl($dst$$FloatRegister, __ T4S, $src$$FloatRegister, __ T4H);
|
||||
} else {
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
@@ -4692,9 +4716,9 @@ instruct vcvtHFtoF(vReg dst, vReg src) %{
|
||||
instruct vcvtFtoHF_neon(vReg dst, vReg src) %{
|
||||
predicate(VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1))));
|
||||
match(Set dst (VectorCastF2HF src));
|
||||
format %{ "vcvtFtoHF_neon $dst, $src\t# 4F to 4HF" %}
|
||||
format %{ "vcvtFtoHF_neon $dst, $src\t# 2F/4F to 2HF/4HF" %}
|
||||
ins_encode %{
|
||||
// 4F to 4HF
|
||||
// 2F to 2HF, 4F to 4HF
|
||||
__ fcvtn($dst$$FloatRegister, __ T4H, $src$$FloatRegister, __ T4S);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
@@ -6396,14 +6420,12 @@ instruct vpopcountI(vReg dst, vReg src) %{
|
||||
} else {
|
||||
assert(bt == T_SHORT || bt == T_INT, "unsupported");
|
||||
if (UseSVE == 0) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
__ cnt($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
$src$$FloatRegister);
|
||||
__ uaddlp($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
$dst$$FloatRegister);
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
bool isQ = length_in_bytes == 16;
|
||||
__ cnt($dst$$FloatRegister, isQ ? __ T16B : __ T8B, $src$$FloatRegister);
|
||||
__ uaddlp($dst$$FloatRegister, isQ ? __ T16B : __ T8B, $dst$$FloatRegister);
|
||||
if (bt == T_INT) {
|
||||
__ uaddlp($dst$$FloatRegister, length_in_bytes == 16 ? __ T8H : __ T4H,
|
||||
$dst$$FloatRegister);
|
||||
__ uaddlp($dst$$FloatRegister, isQ ? __ T8H : __ T4H, $dst$$FloatRegister);
|
||||
}
|
||||
} else {
|
||||
__ sve_cnt($dst$$FloatRegister, __ elemType_to_regVariant(bt),
|
||||
@@ -6465,7 +6487,7 @@ instruct vblend_neon(vReg dst, vReg src1, vReg src2) %{
|
||||
format %{ "vblend_neon $dst, $src1, $src2" %}
|
||||
ins_encode %{
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "must be");
|
||||
assert(length_in_bytes <= 16, "must be");
|
||||
__ bsl($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
$src2$$FloatRegister, $src1$$FloatRegister);
|
||||
%}
|
||||
@@ -6852,7 +6874,7 @@ instruct vcountTrailingZeros(vReg dst, vReg src) %{
|
||||
} else {
|
||||
assert(bt == T_SHORT || bt == T_INT || bt == T_LONG, "unsupported type");
|
||||
if (UseSVE == 0) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
__ neon_reverse_bits($dst$$FloatRegister, $src$$FloatRegister,
|
||||
bt, /* isQ */ length_in_bytes == 16);
|
||||
if (bt != T_LONG) {
|
||||
@@ -6911,7 +6933,7 @@ instruct vreverse(vReg dst, vReg src) %{
|
||||
} else {
|
||||
assert(bt == T_SHORT || bt == T_INT || bt == T_LONG, "unsupported type");
|
||||
if (UseSVE == 0) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
__ neon_reverse_bits($dst$$FloatRegister, $src$$FloatRegister,
|
||||
bt, /* isQ */ length_in_bytes == 16);
|
||||
} else {
|
||||
@@ -6947,7 +6969,7 @@ instruct vreverseBytes(vReg dst, vReg src) %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
if (bt == T_BYTE) {
|
||||
if ($dst$$FloatRegister != $src$$FloatRegister) {
|
||||
__ orr($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
|
||||
@@ -121,7 +121,7 @@ source %{
|
||||
// These operations are not profitable to be vectorized on NEON, because no direct
|
||||
// NEON instructions support them. But the match rule support for them is profitable for
|
||||
// Vector API intrinsics.
|
||||
if ((opcode == Op_VectorCastD2X && bt == T_INT) ||
|
||||
if ((opcode == Op_VectorCastD2X && (bt == T_INT || bt == T_SHORT)) ||
|
||||
(opcode == Op_VectorCastL2X && bt == T_FLOAT) ||
|
||||
(opcode == Op_CountLeadingZerosV && bt == T_LONG) ||
|
||||
(opcode == Op_CountTrailingZerosV && bt == T_LONG) ||
|
||||
@@ -179,6 +179,18 @@ source %{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_AddReductionVI:
|
||||
case Op_AndReductionV:
|
||||
case Op_OrReductionV:
|
||||
case Op_XorReductionV:
|
||||
case Op_MinReductionV:
|
||||
case Op_MaxReductionV:
|
||||
// Reductions with less than 8 bytes vector length are
|
||||
// not supported.
|
||||
if (length_in_bytes < 8) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_MulReductionVD:
|
||||
case Op_MulReductionVF:
|
||||
case Op_MulReductionVI:
|
||||
@@ -2502,31 +2514,31 @@ instruct reinterpret_resize_gt128b(vReg dst, vReg src, pReg ptmp, rFlagsReg cr)
|
||||
%}
|
||||
|
||||
// ---------------------------- Vector zero extend --------------------------------
|
||||
dnl VECTOR_ZERO_EXTEND($1, $2, $3, $4, $5 $6, $7, )
|
||||
dnl VECTOR_ZERO_EXTEND(op_name, dst_bt, src_bt, dst_size, src_size, assertion, neon_comment)
|
||||
dnl VECTOR_ZERO_EXTEND($1, $2, $3, $4, $5, )
|
||||
dnl VECTOR_ZERO_EXTEND(op_name, src_bt, src_size, assertion, neon_comment)
|
||||
define(`VECTOR_ZERO_EXTEND', `
|
||||
instruct vzeroExt$1toX(vReg dst, vReg src) %{
|
||||
match(Set dst (VectorUCast`$1'2X src));
|
||||
format %{ "vzeroExt$1toX $dst, $src" %}
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
assert($6, "must be");
|
||||
assert($4, "must be");
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
// $7
|
||||
__ neon_vector_extend($dst$$FloatRegister, $2, length_in_bytes,
|
||||
$src$$FloatRegister, $3, /* is_unsigned */ true);
|
||||
// $5
|
||||
__ neon_vector_extend($dst$$FloatRegister, bt, length_in_bytes,
|
||||
$src$$FloatRegister, $2, /* is_unsigned */ true);
|
||||
} else {
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
__ sve_vector_extend($dst$$FloatRegister, __ $4,
|
||||
$src$$FloatRegister, __ $5, /* is_unsigned */ true);
|
||||
__ sve_vector_extend($dst$$FloatRegister, __ elemType_to_regVariant(bt),
|
||||
$src$$FloatRegister, __ $3, /* is_unsigned */ true);
|
||||
}
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}')dnl
|
||||
VECTOR_ZERO_EXTEND(B, bt, T_BYTE, elemType_to_regVariant(bt), B, bt == T_SHORT || bt == T_INT || bt == T_LONG, `4B to 4S/4I, 8B to 8S')
|
||||
VECTOR_ZERO_EXTEND(S, T_INT, T_SHORT, elemType_to_regVariant(bt), H, bt == T_INT || bt == T_LONG, `4S to 4I')
|
||||
VECTOR_ZERO_EXTEND(I, T_LONG, T_INT, D, S, bt == T_LONG, `2I to 2L')
|
||||
VECTOR_ZERO_EXTEND(B, T_BYTE, B, bt == T_SHORT || bt == T_INT || bt == T_LONG, `4B to 4S/4I, 8B to 8S')
|
||||
VECTOR_ZERO_EXTEND(S, T_SHORT, H, bt == T_INT || bt == T_LONG, `2S to 2I/2L, 4S to 4I')
|
||||
VECTOR_ZERO_EXTEND(I, T_INT, S, bt == T_LONG, `2I to 2L')
|
||||
|
||||
// ------------------------------ Vector cast ----------------------------------
|
||||
|
||||
@@ -2595,11 +2607,15 @@ instruct vcvtStoX_extend(vReg dst, vReg src) %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
// 4S to 4I/4F
|
||||
__ neon_vector_extend($dst$$FloatRegister, T_INT, length_in_bytes,
|
||||
$src$$FloatRegister, T_SHORT);
|
||||
if (bt == T_FLOAT) {
|
||||
__ scvtfv(__ T4S, $dst$$FloatRegister, $dst$$FloatRegister);
|
||||
if (is_floating_point_type(bt)) {
|
||||
// 2S to 2F/2D, 4S to 4F
|
||||
__ neon_vector_extend($dst$$FloatRegister, bt == T_FLOAT ? T_INT : T_LONG,
|
||||
length_in_bytes, $src$$FloatRegister, T_SHORT);
|
||||
__ scvtfv(get_arrangement(this), $dst$$FloatRegister, $dst$$FloatRegister);
|
||||
} else {
|
||||
// 2S to 2I/2L, 4S to 4I
|
||||
__ neon_vector_extend($dst$$FloatRegister, bt, length_in_bytes,
|
||||
$src$$FloatRegister, T_SHORT);
|
||||
}
|
||||
} else {
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
@@ -2623,7 +2639,7 @@ instruct vcvtItoX_narrow_neon(vReg dst, vReg src) %{
|
||||
effect(TEMP_DEF dst);
|
||||
format %{ "vcvtItoX_narrow_neon $dst, $src" %}
|
||||
ins_encode %{
|
||||
// 4I to 4B/4S
|
||||
// 2I to 2S, 4I to 4B/4S
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src);
|
||||
__ neon_vector_narrow($dst$$FloatRegister, bt,
|
||||
@@ -2686,28 +2702,29 @@ instruct vcvtItoX(vReg dst, vReg src) %{
|
||||
|
||||
// VectorCastL2X
|
||||
|
||||
instruct vcvtLtoI_neon(vReg dst, vReg src) %{
|
||||
predicate(Matcher::vector_element_basic_type(n) == T_INT &&
|
||||
instruct vcvtLtoX_narrow_neon(vReg dst, vReg src) %{
|
||||
predicate((Matcher::vector_element_basic_type(n) == T_INT ||
|
||||
Matcher::vector_element_basic_type(n) == T_SHORT) &&
|
||||
VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1))));
|
||||
match(Set dst (VectorCastL2X src));
|
||||
format %{ "vcvtLtoI_neon $dst, $src" %}
|
||||
format %{ "vcvtLtoX_narrow_neon $dst, $src" %}
|
||||
ins_encode %{
|
||||
// 2L to 2I
|
||||
// 2L to 2S/2I
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src);
|
||||
__ neon_vector_narrow($dst$$FloatRegister, T_INT,
|
||||
__ neon_vector_narrow($dst$$FloatRegister, bt,
|
||||
$src$$FloatRegister, T_LONG, length_in_bytes);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct vcvtLtoI_sve(vReg dst, vReg src, vReg tmp) %{
|
||||
predicate((Matcher::vector_element_basic_type(n) == T_INT &&
|
||||
!VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1)))) ||
|
||||
Matcher::vector_element_basic_type(n) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n) == T_SHORT);
|
||||
instruct vcvtLtoX_narrow_sve(vReg dst, vReg src, vReg tmp) %{
|
||||
predicate(!VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1))) &&
|
||||
!is_floating_point_type(Matcher::vector_element_basic_type(n)) &&
|
||||
type2aelembytes(Matcher::vector_element_basic_type(n)) <= 4);
|
||||
match(Set dst (VectorCastL2X src));
|
||||
effect(TEMP_DEF dst, TEMP tmp);
|
||||
format %{ "vcvtLtoI_sve $dst, $src\t# KILL $tmp" %}
|
||||
format %{ "vcvtLtoX_narrow_sve $dst, $src\t# KILL $tmp" %}
|
||||
ins_encode %{
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
@@ -2773,10 +2790,11 @@ instruct vcvtFtoX_narrow_neon(vReg dst, vReg src) %{
|
||||
effect(TEMP_DEF dst);
|
||||
format %{ "vcvtFtoX_narrow_neon $dst, $src" %}
|
||||
ins_encode %{
|
||||
// 4F to 4B/4S
|
||||
// 2F to 2S, 4F to 4B/4S
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src);
|
||||
__ fcvtzs($dst$$FloatRegister, __ T4S, $src$$FloatRegister);
|
||||
__ fcvtzs($dst$$FloatRegister, length_in_bytes == 16 ? __ T4S : __ T2S,
|
||||
$src$$FloatRegister);
|
||||
__ neon_vector_narrow($dst$$FloatRegister, bt,
|
||||
$dst$$FloatRegister, T_INT, length_in_bytes);
|
||||
%}
|
||||
@@ -2842,12 +2860,14 @@ instruct vcvtFtoX(vReg dst, vReg src) %{
|
||||
// VectorCastD2X
|
||||
|
||||
instruct vcvtDtoI_neon(vReg dst, vReg src) %{
|
||||
predicate(UseSVE == 0 && Matcher::vector_element_basic_type(n) == T_INT);
|
||||
predicate(UseSVE == 0 &&
|
||||
(Matcher::vector_element_basic_type(n) == T_INT ||
|
||||
Matcher::vector_element_basic_type(n) == T_SHORT));
|
||||
match(Set dst (VectorCastD2X src));
|
||||
effect(TEMP_DEF dst);
|
||||
format %{ "vcvtDtoI_neon $dst, $src\t# 2D to 2I" %}
|
||||
format %{ "vcvtDtoI_neon $dst, $src\t# 2D to 2S/2I" %}
|
||||
ins_encode %{
|
||||
// 2D to 2I
|
||||
// 2D to 2S/2I
|
||||
__ ins($dst$$FloatRegister, __ D, $src$$FloatRegister, 0, 1);
|
||||
// We can't use fcvtzs(vector, integer) instruction here because we need
|
||||
// saturation arithmetic. See JDK-8276151.
|
||||
@@ -2855,6 +2875,10 @@ instruct vcvtDtoI_neon(vReg dst, vReg src) %{
|
||||
__ fcvtzdw(rscratch2, $dst$$FloatRegister);
|
||||
__ fmovs($dst$$FloatRegister, rscratch1);
|
||||
__ mov($dst$$FloatRegister, __ S, 1, rscratch2);
|
||||
if (Matcher::vector_element_basic_type(this) == T_SHORT) {
|
||||
__ neon_vector_narrow($dst$$FloatRegister, T_SHORT,
|
||||
$dst$$FloatRegister, T_INT, 8);
|
||||
}
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
@@ -2928,7 +2952,7 @@ instruct vcvtHFtoF(vReg dst, vReg src) %{
|
||||
ins_encode %{
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
// 4HF to 4F
|
||||
// 2HF to 2F, 4HF to 4F
|
||||
__ fcvtl($dst$$FloatRegister, __ T4S, $src$$FloatRegister, __ T4H);
|
||||
} else {
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
@@ -2944,9 +2968,9 @@ instruct vcvtHFtoF(vReg dst, vReg src) %{
|
||||
instruct vcvtFtoHF_neon(vReg dst, vReg src) %{
|
||||
predicate(VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(1))));
|
||||
match(Set dst (VectorCastF2HF src));
|
||||
format %{ "vcvtFtoHF_neon $dst, $src\t# 4F to 4HF" %}
|
||||
format %{ "vcvtFtoHF_neon $dst, $src\t# 2F/4F to 2HF/4HF" %}
|
||||
ins_encode %{
|
||||
// 4F to 4HF
|
||||
// 2F to 2HF, 4F to 4HF
|
||||
__ fcvtn($dst$$FloatRegister, __ T4H, $src$$FloatRegister, __ T4S);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
@@ -4417,14 +4441,12 @@ instruct vpopcountI(vReg dst, vReg src) %{
|
||||
} else {
|
||||
assert(bt == T_SHORT || bt == T_INT, "unsupported");
|
||||
if (UseSVE == 0) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
__ cnt($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
$src$$FloatRegister);
|
||||
__ uaddlp($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
$dst$$FloatRegister);
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
bool isQ = length_in_bytes == 16;
|
||||
__ cnt($dst$$FloatRegister, isQ ? __ T16B : __ T8B, $src$$FloatRegister);
|
||||
__ uaddlp($dst$$FloatRegister, isQ ? __ T16B : __ T8B, $dst$$FloatRegister);
|
||||
if (bt == T_INT) {
|
||||
__ uaddlp($dst$$FloatRegister, length_in_bytes == 16 ? __ T8H : __ T4H,
|
||||
$dst$$FloatRegister);
|
||||
__ uaddlp($dst$$FloatRegister, isQ ? __ T8H : __ T4H, $dst$$FloatRegister);
|
||||
}
|
||||
} else {
|
||||
__ sve_cnt($dst$$FloatRegister, __ elemType_to_regVariant(bt),
|
||||
@@ -4475,7 +4497,7 @@ instruct vblend_neon(vReg dst, vReg src1, vReg src2) %{
|
||||
format %{ "vblend_neon $dst, $src1, $src2" %}
|
||||
ins_encode %{
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "must be");
|
||||
assert(length_in_bytes <= 16, "must be");
|
||||
__ bsl($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
$src2$$FloatRegister, $src1$$FloatRegister);
|
||||
%}
|
||||
@@ -4851,7 +4873,7 @@ instruct vcountTrailingZeros(vReg dst, vReg src) %{
|
||||
} else {
|
||||
assert(bt == T_SHORT || bt == T_INT || bt == T_LONG, "unsupported type");
|
||||
if (UseSVE == 0) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
__ neon_reverse_bits($dst$$FloatRegister, $src$$FloatRegister,
|
||||
bt, /* isQ */ length_in_bytes == 16);
|
||||
if (bt != T_LONG) {
|
||||
@@ -4910,7 +4932,7 @@ instruct vreverse(vReg dst, vReg src) %{
|
||||
} else {
|
||||
assert(bt == T_SHORT || bt == T_INT || bt == T_LONG, "unsupported type");
|
||||
if (UseSVE == 0) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
__ neon_reverse_bits($dst$$FloatRegister, $src$$FloatRegister,
|
||||
bt, /* isQ */ length_in_bytes == 16);
|
||||
} else {
|
||||
@@ -4935,7 +4957,7 @@ instruct vreverseBytes(vReg dst, vReg src) %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
|
||||
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
|
||||
assert(length_in_bytes == 8 || length_in_bytes == 16, "unsupported");
|
||||
assert(length_in_bytes <= 16, "unsupported");
|
||||
if (bt == T_BYTE) {
|
||||
if ($dst$$FloatRegister != $src$$FloatRegister) {
|
||||
__ orr($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
|
||||
|
||||
@@ -1136,6 +1136,10 @@ public:
|
||||
system(0b00, 0b011, 0b00011, SY, 0b110);
|
||||
}
|
||||
|
||||
void sb() {
|
||||
system(0b00, 0b011, 0b00011, 0b0000, 0b111);
|
||||
}
|
||||
|
||||
void sys(int op1, int CRn, int CRm, int op2,
|
||||
Register rt = as_Register(0b11111)) {
|
||||
system(0b01, op1, CRn, CRm, op2, rt);
|
||||
|
||||
@@ -56,7 +56,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
|
||||
__ mov_metadata(rscratch1, m);
|
||||
ce->store_parameter(rscratch1, 1);
|
||||
ce->store_parameter(_bci, 0);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::counter_overflow_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_counter_overflow_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
__ b(_continuation);
|
||||
@@ -65,7 +65,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
|
||||
void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
address a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
__ far_call(RuntimeAddress(a));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
@@ -78,13 +78,13 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
} else {
|
||||
__ mov(rscratch1, _index->as_jint());
|
||||
}
|
||||
C1StubId stub_id;
|
||||
StubId stub_id;
|
||||
if (_throw_index_out_of_bounds_exception) {
|
||||
stub_id = C1StubId::throw_index_exception_id;
|
||||
stub_id = StubId::c1_throw_index_exception_id;
|
||||
} else {
|
||||
assert(_array != LIR_Opr::nullOpr(), "sanity");
|
||||
__ mov(rscratch2, _array->as_pointer_register());
|
||||
stub_id = C1StubId::throw_range_check_failed_id;
|
||||
stub_id = StubId::c1_throw_range_check_failed_id;
|
||||
}
|
||||
__ lea(lr, RuntimeAddress(Runtime1::entry_for(stub_id)));
|
||||
__ blr(lr);
|
||||
@@ -99,7 +99,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
|
||||
|
||||
void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
address a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
__ far_call(RuntimeAddress(a));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
@@ -111,7 +111,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
}
|
||||
__ bind(_entry);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::throw_div0_exception_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_throw_div0_exception_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
#ifdef ASSERT
|
||||
@@ -123,14 +123,14 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
|
||||
// Implementation of NewInstanceStub
|
||||
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) {
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, StubId stub_id) {
|
||||
_result = result;
|
||||
_klass = klass;
|
||||
_klass_reg = klass_reg;
|
||||
_info = new CodeEmitInfo(info);
|
||||
assert(stub_id == C1StubId::new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_init_check_id,
|
||||
assert(stub_id == StubId::c1_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_init_check_id,
|
||||
"need new_instance id");
|
||||
_stub_id = stub_id;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
assert(_length->as_register() == r19, "length must in r19,");
|
||||
assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_type_array_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_type_array_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
assert(_result->as_register() == r0, "result must in r0");
|
||||
@@ -189,7 +189,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
assert(_length->as_register() == r19, "length must in r19,");
|
||||
assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_object_array_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
assert(_result->as_register() == r0, "result must in r0");
|
||||
@@ -201,11 +201,11 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_obj_reg->as_register(), 1);
|
||||
ce->store_parameter(_lock_reg->as_register(), 0);
|
||||
C1StubId enter_id;
|
||||
StubId enter_id;
|
||||
if (ce->compilation()->has_fpu_code()) {
|
||||
enter_id = C1StubId::monitorenter_id;
|
||||
enter_id = StubId::c1_monitorenter_id;
|
||||
} else {
|
||||
enter_id = C1StubId::monitorenter_nofpu_id;
|
||||
enter_id = StubId::c1_monitorenter_nofpu_id;
|
||||
}
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
@@ -222,11 +222,11 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) {
|
||||
}
|
||||
ce->store_parameter(_lock_reg->as_register(), 0);
|
||||
// note: non-blocking leaf routine => no call info needed
|
||||
C1StubId exit_id;
|
||||
StubId exit_id;
|
||||
if (ce->compilation()->has_fpu_code()) {
|
||||
exit_id = C1StubId::monitorexit_id;
|
||||
exit_id = StubId::c1_monitorexit_id;
|
||||
} else {
|
||||
exit_id = C1StubId::monitorexit_nofpu_id;
|
||||
exit_id = StubId::c1_monitorexit_nofpu_id;
|
||||
}
|
||||
__ adr(lr, _continuation);
|
||||
__ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id)));
|
||||
@@ -254,7 +254,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_trap_request, 0);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::deoptimize_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_deoptimize_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
DEBUG_ONLY(__ should_not_reach_here());
|
||||
}
|
||||
@@ -264,9 +264,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
address a;
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
// Deoptimize, do not throw the exception, because it is probably wrong to do it here.
|
||||
a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
} else {
|
||||
a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id);
|
||||
a = Runtime1::entry_for(StubId::c1_throw_null_pointer_exception_id);
|
||||
}
|
||||
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
|
||||
@@ -320,19 +320,19 @@ void LIR_Assembler::deoptimize_trap(CodeEmitInfo *info) {
|
||||
|
||||
switch (patching_id(info)) {
|
||||
case PatchingStub::access_field_id:
|
||||
target = Runtime1::entry_for(C1StubId::access_field_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_access_field_patching_id);
|
||||
reloc_type = relocInfo::section_word_type;
|
||||
break;
|
||||
case PatchingStub::load_klass_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_klass_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_klass_patching_id);
|
||||
reloc_type = relocInfo::metadata_type;
|
||||
break;
|
||||
case PatchingStub::load_mirror_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_mirror_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_mirror_patching_id);
|
||||
reloc_type = relocInfo::oop_type;
|
||||
break;
|
||||
case PatchingStub::load_appendix_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_appendix_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_appendix_patching_id);
|
||||
reloc_type = relocInfo::oop_type;
|
||||
break;
|
||||
default: ShouldNotReachHere();
|
||||
@@ -374,7 +374,7 @@ int LIR_Assembler::emit_exception_handler() {
|
||||
__ verify_not_null_oop(r0);
|
||||
|
||||
// search an exception handler (r0: exception oop, r3: throwing pc)
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_handle_exception_from_callee_id)));
|
||||
__ should_not_reach_here();
|
||||
guarantee(code_offset() - offset <= exception_handler_size(), "overflow");
|
||||
__ end_a_stub();
|
||||
@@ -431,7 +431,7 @@ int LIR_Assembler::emit_unwind_handler() {
|
||||
// remove the activation and dispatch to the unwind handler
|
||||
__ block_comment("remove_frame and dispatch to the unwind handler");
|
||||
__ remove_frame(initial_frame_size_in_bytes());
|
||||
__ far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::unwind_exception_id)));
|
||||
__ far_jump(RuntimeAddress(Runtime1::entry_for(StubId::c1_unwind_exception_id)));
|
||||
|
||||
// Emit the slow path assembly
|
||||
if (stub != nullptr) {
|
||||
@@ -874,19 +874,19 @@ void LIR_Assembler::klass2reg_with_patching(Register reg, CodeEmitInfo* info) {
|
||||
|
||||
switch (patching_id(info)) {
|
||||
case PatchingStub::access_field_id:
|
||||
target = Runtime1::entry_for(C1StubId::access_field_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_access_field_patching_id);
|
||||
reloc_type = relocInfo::section_word_type;
|
||||
break;
|
||||
case PatchingStub::load_klass_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_klass_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_klass_patching_id);
|
||||
reloc_type = relocInfo::metadata_type;
|
||||
break;
|
||||
case PatchingStub::load_mirror_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_mirror_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_mirror_patching_id);
|
||||
reloc_type = relocInfo::oop_type;
|
||||
break;
|
||||
case PatchingStub::load_appendix_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_appendix_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_appendix_patching_id);
|
||||
reloc_type = relocInfo::oop_type;
|
||||
break;
|
||||
default: ShouldNotReachHere();
|
||||
@@ -1358,7 +1358,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
__ br(Assembler::EQ, *success_target);
|
||||
|
||||
__ stp(klass_RInfo, k_RInfo, Address(__ pre(sp, -2 * wordSize)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
__ ldr(klass_RInfo, Address(__ post(sp, 2 * wordSize)));
|
||||
// result is a boolean
|
||||
__ cbzw(klass_RInfo, *failure_target);
|
||||
@@ -1369,7 +1369,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, nullptr);
|
||||
// call out-of-line instance of __ check_klass_subtype_slow_path(...):
|
||||
__ stp(klass_RInfo, k_RInfo, Address(__ pre(sp, -2 * wordSize)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
__ ldp(k_RInfo, klass_RInfo, Address(__ post(sp, 2 * wordSize)));
|
||||
// result is a boolean
|
||||
__ cbz(k_RInfo, *failure_target);
|
||||
@@ -1447,7 +1447,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, nullptr);
|
||||
// call out-of-line instance of __ check_klass_subtype_slow_path(...):
|
||||
__ stp(klass_RInfo, k_RInfo, Address(__ pre(sp, -2 * wordSize)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
__ ldp(k_RInfo, klass_RInfo, Address(__ post(sp, 2 * wordSize)));
|
||||
// result is a boolean
|
||||
__ cbzw(k_RInfo, *failure_target);
|
||||
@@ -2033,7 +2033,7 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
|
||||
// exception object is not added to oop map by LinearScan
|
||||
// (LinearScan assumes that no oops are in fixed registers)
|
||||
info->add_register_oop(exceptionOop);
|
||||
C1StubId unwind_id;
|
||||
StubId unwind_id;
|
||||
|
||||
// get current pc information
|
||||
// pc is only needed if the method has an exception handler, the unwind code does not need it.
|
||||
@@ -2052,9 +2052,9 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
|
||||
__ verify_not_null_oop(r0);
|
||||
// search an exception handler (r0: exception oop, r3: throwing pc)
|
||||
if (compilation()->has_fpu_code()) {
|
||||
unwind_id = C1StubId::handle_exception_id;
|
||||
unwind_id = StubId::c1_handle_exception_id;
|
||||
} else {
|
||||
unwind_id = C1StubId::handle_exception_nofpu_id;
|
||||
unwind_id = StubId::c1_handle_exception_nofpu_id;
|
||||
}
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(unwind_id)));
|
||||
|
||||
@@ -2325,7 +2325,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
__ check_klass_subtype_fast_path(src, dst, tmp, &cont, &slow, nullptr);
|
||||
|
||||
__ PUSH(src, dst);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
__ POP(src, dst);
|
||||
|
||||
__ cbnz(src, cont);
|
||||
|
||||
@@ -1245,7 +1245,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
|
||||
args->append(rank);
|
||||
args->append(varargs);
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id),
|
||||
__ call_runtime(Runtime1::entry_for(StubId::c1_new_multi_array_id),
|
||||
LIR_OprFact::illegalOpr,
|
||||
reg, args, info);
|
||||
|
||||
@@ -1276,14 +1276,14 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
CodeStub* stub;
|
||||
if (x->is_incompatible_class_change_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
|
||||
} else if (x->is_invokespecial_receiver_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
stub = new DeoptimizeStub(info_for_exception,
|
||||
Deoptimization::Reason_class_check,
|
||||
Deoptimization::Action_none);
|
||||
} else {
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception);
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_class_cast_exception_id, obj.result(), info_for_exception);
|
||||
}
|
||||
LIR_Opr reg = rlock_result(x);
|
||||
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
|
||||
@@ -1318,7 +1318,7 @@ void LIRGenerator::do_InstanceOf(InstanceOf* x) {
|
||||
|
||||
// Intrinsic for Class::isInstance
|
||||
address LIRGenerator::isInstance_entry() {
|
||||
return Runtime1::entry_for(C1StubId::is_instance_of_id);
|
||||
return Runtime1::entry_for(StubId::c1_is_instance_of_id);
|
||||
}
|
||||
|
||||
void LIRGenerator::do_If(If* x) {
|
||||
|
||||
@@ -271,7 +271,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
|
||||
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
assert(obj == r0, "must be");
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)));
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)));
|
||||
}
|
||||
|
||||
verify_oop(obj);
|
||||
@@ -312,7 +312,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
|
||||
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
assert(obj == r0, "must be");
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)));
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)));
|
||||
}
|
||||
|
||||
verify_oop(obj);
|
||||
|
||||
@@ -99,10 +99,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre
|
||||
if (frame_size() == no_frame_size) {
|
||||
leave();
|
||||
far_jump(RuntimeAddress(StubRoutines::forward_exception_entry()));
|
||||
} else if (_stub_id == (int)C1StubId::forward_exception_id) {
|
||||
} else if (_stub_id == (int)StubId::c1_forward_exception_id) {
|
||||
should_not_reach_here();
|
||||
} else {
|
||||
far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id)));
|
||||
far_jump(RuntimeAddress(Runtime1::entry_for(StubId::c1_forward_exception_id)));
|
||||
}
|
||||
bind(L);
|
||||
}
|
||||
@@ -350,8 +350,8 @@ void Runtime1::initialize_pd() {
|
||||
// return: offset in 64-bit words.
|
||||
uint Runtime1::runtime_blob_current_thread_offset(frame f) {
|
||||
CodeBlob* cb = f.cb();
|
||||
assert(cb == Runtime1::blob_for(C1StubId::monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(C1StubId::monitorenter_nofpu_id), "must be");
|
||||
assert(cb == Runtime1::blob_for(StubId::c1_monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(StubId::c1_monitorenter_nofpu_id), "must be");
|
||||
assert(cb != nullptr && cb->is_runtime_stub(), "invalid frame");
|
||||
int offset = cpu_reg_save_offsets[rthread->encoding()];
|
||||
return offset / 2; // SP offsets are in halfwords
|
||||
@@ -377,7 +377,7 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe
|
||||
}
|
||||
|
||||
|
||||
OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) {
|
||||
OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler *sasm) {
|
||||
__ block_comment("generate_handle_exception");
|
||||
|
||||
// incoming parameters
|
||||
@@ -389,7 +389,7 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm)
|
||||
OopMapSet* oop_maps = new OopMapSet();
|
||||
OopMap* oop_map = nullptr;
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
// We're handling an exception in the context of a compiled frame.
|
||||
// The registers have been saved in the standard places. Perform
|
||||
// an exception lookup in the caller and dispatch to the handler
|
||||
@@ -409,12 +409,12 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm)
|
||||
__ str(zr, Address(rthread, JavaThread::vm_result_oop_offset()));
|
||||
__ str(zr, Address(rthread, JavaThread::vm_result_metadata_offset()));
|
||||
break;
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
// At this point all registers MAY be live.
|
||||
oop_map = save_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id);
|
||||
oop_map = save_live_registers(sasm, id != StubId::c1_handle_exception_nofpu_id);
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id: {
|
||||
case StubId::c1_handle_exception_from_callee_id: {
|
||||
// At this point all registers except exception oop (r0) and
|
||||
// exception pc (lr) are dead.
|
||||
const int frame_size = 2 /*fp, return address*/;
|
||||
@@ -472,13 +472,13 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm)
|
||||
__ str(r0, Address(rfp, 1*BytesPerWord));
|
||||
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
// Restore the registers that were saved at the beginning.
|
||||
restore_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id);
|
||||
restore_live_registers(sasm, id != StubId::c1_handle_exception_nofpu_id);
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
@@ -630,7 +630,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
|
||||
}
|
||||
|
||||
|
||||
OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* Runtime1::generate_code_for(StubId id, StubAssembler* sasm) {
|
||||
|
||||
const Register exception_oop = r0;
|
||||
const Register exception_pc = r3;
|
||||
@@ -647,7 +647,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
OopMap* oop_map = nullptr;
|
||||
switch (id) {
|
||||
{
|
||||
case C1StubId::forward_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
{
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
__ leave();
|
||||
@@ -655,31 +655,31 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_div0_exception_id:
|
||||
case StubId::c1_throw_div0_exception_id:
|
||||
{ StubFrame f(sasm, "throw_div0_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_null_pointer_exception_id:
|
||||
case StubId::c1_throw_null_pointer_exception_id:
|
||||
{ StubFrame f(sasm, "throw_null_pointer_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_instance_id:
|
||||
case C1StubId::fast_new_instance_id:
|
||||
case C1StubId::fast_new_instance_init_check_id:
|
||||
case StubId::c1_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_init_check_id:
|
||||
{
|
||||
Register klass = r3; // Incoming
|
||||
Register obj = r0; // Result
|
||||
|
||||
if (id == C1StubId::new_instance_id) {
|
||||
if (id == StubId::c1_new_instance_id) {
|
||||
__ set_info("new_instance", dont_gc_arguments);
|
||||
} else if (id == C1StubId::fast_new_instance_id) {
|
||||
} else if (id == StubId::c1_fast_new_instance_id) {
|
||||
__ set_info("fast new_instance", dont_gc_arguments);
|
||||
} else {
|
||||
assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId");
|
||||
assert(id == StubId::c1_fast_new_instance_init_check_id, "bad StubId");
|
||||
__ set_info("fast new_instance init check", dont_gc_arguments);
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
|
||||
break;
|
||||
|
||||
case C1StubId::counter_overflow_id:
|
||||
case StubId::c1_counter_overflow_id:
|
||||
{
|
||||
Register bci = r0, method = r1;
|
||||
__ enter();
|
||||
@@ -716,14 +716,14 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_type_array_id:
|
||||
case C1StubId::new_object_array_id:
|
||||
case StubId::c1_new_type_array_id:
|
||||
case StubId::c1_new_object_array_id:
|
||||
{
|
||||
Register length = r19; // Incoming
|
||||
Register klass = r3; // Incoming
|
||||
Register obj = r0; // Result
|
||||
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
__ set_info("new_type_array", dont_gc_arguments);
|
||||
} else {
|
||||
__ set_info("new_object_array", dont_gc_arguments);
|
||||
@@ -736,7 +736,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
Register t0 = obj;
|
||||
__ ldrw(t0, Address(klass, Klass::layout_helper_offset()));
|
||||
__ asrw(t0, t0, Klass::_lh_array_tag_shift);
|
||||
int tag = ((id == C1StubId::new_type_array_id)
|
||||
int tag = ((id == StubId::c1_new_type_array_id)
|
||||
? Klass::_lh_array_tag_type_value
|
||||
: Klass::_lh_array_tag_obj_value);
|
||||
__ mov(rscratch1, tag);
|
||||
@@ -751,7 +751,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
__ enter();
|
||||
OopMap* map = save_live_registers(sasm);
|
||||
int call_offset;
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length);
|
||||
} else {
|
||||
call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length);
|
||||
@@ -769,7 +769,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_multi_array_id:
|
||||
case StubId::c1_new_multi_array_id:
|
||||
{ StubFrame f(sasm, "new_multi_array", dont_gc_arguments);
|
||||
// r0,: klass
|
||||
// r19,: rank
|
||||
@@ -789,7 +789,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::register_finalizer_id:
|
||||
case StubId::c1_register_finalizer_id:
|
||||
{
|
||||
__ set_info("register_finalizer", dont_gc_arguments);
|
||||
|
||||
@@ -821,19 +821,19 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_class_cast_exception_id:
|
||||
case StubId::c1_throw_class_cast_exception_id:
|
||||
{ StubFrame f(sasm, "throw_class_cast_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_incompatible_class_change_error_id:
|
||||
case StubId::c1_throw_incompatible_class_change_error_id:
|
||||
{ StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::slow_subtype_check_id:
|
||||
case StubId::c1_slow_subtype_check_id:
|
||||
{
|
||||
// Typical calling sequence:
|
||||
// __ push(klass_RInfo); // object klass or other subclass
|
||||
@@ -882,10 +882,10 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorenter_nofpu_id:
|
||||
case StubId::c1_monitorenter_nofpu_id:
|
||||
save_fpu_registers = false;
|
||||
// fall through
|
||||
case C1StubId::monitorenter_id:
|
||||
case StubId::c1_monitorenter_id:
|
||||
{
|
||||
StubFrame f(sasm, "monitorenter", dont_gc_arguments, requires_pop_epilogue_return);
|
||||
OopMap* map = save_live_registers(sasm, save_fpu_registers);
|
||||
@@ -903,7 +903,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::is_instance_of_id:
|
||||
case StubId::c1_is_instance_of_id:
|
||||
{
|
||||
// Mirror: c_rarg0
|
||||
// Object: c_rarg1
|
||||
@@ -952,10 +952,10 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorexit_nofpu_id:
|
||||
case StubId::c1_monitorexit_nofpu_id:
|
||||
save_fpu_registers = false;
|
||||
// fall through
|
||||
case C1StubId::monitorexit_id:
|
||||
case StubId::c1_monitorexit_id:
|
||||
{
|
||||
StubFrame f(sasm, "monitorexit", dont_gc_arguments);
|
||||
OopMap* map = save_live_registers(sasm, save_fpu_registers);
|
||||
@@ -975,7 +975,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::deoptimize_id:
|
||||
case StubId::c1_deoptimize_id:
|
||||
{
|
||||
StubFrame f(sasm, "deoptimize", dont_gc_arguments, does_not_return);
|
||||
OopMap* oop_map = save_live_registers(sasm);
|
||||
@@ -992,13 +992,13 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_range_check_failed_id:
|
||||
case StubId::c1_throw_range_check_failed_id:
|
||||
{ StubFrame f(sasm, "range_check_failed", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::unwind_exception_id:
|
||||
case StubId::c1_unwind_exception_id:
|
||||
{ __ set_info("unwind_exception", dont_gc_arguments);
|
||||
// note: no stubframe since we are about to leave the current
|
||||
// activation and we are calling a leaf VM function only.
|
||||
@@ -1006,54 +1006,54 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::access_field_patching_id:
|
||||
case StubId::c1_access_field_patching_id:
|
||||
{ StubFrame f(sasm, "access_field_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_klass_patching_id:
|
||||
case StubId::c1_load_klass_patching_id:
|
||||
{ StubFrame f(sasm, "load_klass_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_mirror_patching_id:
|
||||
case StubId::c1_load_mirror_patching_id:
|
||||
{ StubFrame f(sasm, "load_mirror_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_appendix_patching_id:
|
||||
case StubId::c1_load_appendix_patching_id:
|
||||
{ StubFrame f(sasm, "load_appendix_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
{ StubFrame f(sasm, "handle_exception", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
{ StubFrame f(sasm, "handle_exception_from_callee", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_index_exception_id:
|
||||
case StubId::c1_throw_index_exception_id:
|
||||
{ StubFrame f(sasm, "index_range_check_failed", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_array_store_exception_id:
|
||||
case StubId::c1_throw_array_store_exception_id:
|
||||
{ StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments, does_not_return);
|
||||
// tos + 0: link
|
||||
// + 1: return address
|
||||
@@ -1061,7 +1061,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::predicate_failed_trap_id:
|
||||
case StubId::c1_predicate_failed_trap_id:
|
||||
{
|
||||
StubFrame f(sasm, "predicate_failed_trap", dont_gc_arguments, does_not_return);
|
||||
|
||||
@@ -1079,7 +1079,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::dtrace_object_alloc_id:
|
||||
case StubId::c1_dtrace_object_alloc_id:
|
||||
{ // c_rarg0: object
|
||||
StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments);
|
||||
save_live_registers(sasm);
|
||||
|
||||
@@ -1778,19 +1778,21 @@ void C2_MacroAssembler::sve_vmask_lasttrue(Register dst, BasicType bt, PRegister
|
||||
void C2_MacroAssembler::neon_vector_extend(FloatRegister dst, BasicType dst_bt, unsigned dst_vlen_in_bytes,
|
||||
FloatRegister src, BasicType src_bt, bool is_unsigned) {
|
||||
if (src_bt == T_BYTE) {
|
||||
if (dst_bt == T_SHORT) {
|
||||
// 4B/8B to 4S/8S
|
||||
_xshll(is_unsigned, dst, T8H, src, T8B, 0);
|
||||
} else {
|
||||
// 4B to 4I
|
||||
assert(dst_vlen_in_bytes == 16 && dst_bt == T_INT, "unsupported");
|
||||
_xshll(is_unsigned, dst, T8H, src, T8B, 0);
|
||||
// 4B to 4S/4I, 8B to 8S
|
||||
assert(dst_vlen_in_bytes == 8 || dst_vlen_in_bytes == 16, "unsupported");
|
||||
assert(dst_bt == T_SHORT || dst_bt == T_INT, "unsupported");
|
||||
_xshll(is_unsigned, dst, T8H, src, T8B, 0);
|
||||
if (dst_bt == T_INT) {
|
||||
_xshll(is_unsigned, dst, T4S, dst, T4H, 0);
|
||||
}
|
||||
} else if (src_bt == T_SHORT) {
|
||||
// 4S to 4I
|
||||
assert(dst_vlen_in_bytes == 16 && dst_bt == T_INT, "unsupported");
|
||||
// 2S to 2I/2L, 4S to 4I
|
||||
assert(dst_vlen_in_bytes == 8 || dst_vlen_in_bytes == 16, "unsupported");
|
||||
assert(dst_bt == T_INT || dst_bt == T_LONG, "unsupported");
|
||||
_xshll(is_unsigned, dst, T4S, src, T4H, 0);
|
||||
if (dst_bt == T_LONG) {
|
||||
_xshll(is_unsigned, dst, T2D, dst, T2S, 0);
|
||||
}
|
||||
} else if (src_bt == T_INT) {
|
||||
// 2I to 2L
|
||||
assert(dst_vlen_in_bytes == 16 && dst_bt == T_LONG, "unsupported");
|
||||
@@ -1810,18 +1812,21 @@ void C2_MacroAssembler::neon_vector_narrow(FloatRegister dst, BasicType dst_bt,
|
||||
assert(dst_bt == T_BYTE, "unsupported");
|
||||
xtn(dst, T8B, src, T8H);
|
||||
} else if (src_bt == T_INT) {
|
||||
// 4I to 4B/4S
|
||||
assert(src_vlen_in_bytes == 16, "unsupported");
|
||||
// 2I to 2S, 4I to 4B/4S
|
||||
assert(src_vlen_in_bytes == 8 || src_vlen_in_bytes == 16, "unsupported");
|
||||
assert(dst_bt == T_BYTE || dst_bt == T_SHORT, "unsupported");
|
||||
xtn(dst, T4H, src, T4S);
|
||||
if (dst_bt == T_BYTE) {
|
||||
xtn(dst, T8B, dst, T8H);
|
||||
}
|
||||
} else if (src_bt == T_LONG) {
|
||||
// 2L to 2I
|
||||
// 2L to 2S/2I
|
||||
assert(src_vlen_in_bytes == 16, "unsupported");
|
||||
assert(dst_bt == T_INT, "unsupported");
|
||||
assert(dst_bt == T_INT || dst_bt == T_SHORT, "unsupported");
|
||||
xtn(dst, T2S, src, T2D);
|
||||
if (dst_bt == T_SHORT) {
|
||||
xtn(dst, T4H, dst, T4S);
|
||||
}
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
@@ -441,8 +441,8 @@ JavaThread** frame::saved_thread_address(const frame& f) {
|
||||
|
||||
JavaThread** thread_addr;
|
||||
#ifdef COMPILER1
|
||||
if (cb == Runtime1::blob_for(C1StubId::monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(C1StubId::monitorenter_nofpu_id)) {
|
||||
if (cb == Runtime1::blob_for(StubId::c1_monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(StubId::c1_monitorenter_nofpu_id)) {
|
||||
thread_addr = (JavaThread**)(f.sp() + Runtime1::runtime_blob_current_thread_offset(f));
|
||||
} else
|
||||
#endif
|
||||
|
||||
@@ -117,7 +117,8 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
||||
product(ccstr, OnSpinWaitInst, "yield", DIAGNOSTIC, \
|
||||
"The instruction to use to implement " \
|
||||
"java.lang.Thread.onSpinWait()." \
|
||||
"Options: none, nop, isb, yield.") \
|
||||
"Valid values are: none, nop, isb, yield, sb.") \
|
||||
constraint(OnSpinWaitInstNameConstraintFunc, AtParse) \
|
||||
product(uint, OnSpinWaitInstCount, 1, DIAGNOSTIC, \
|
||||
"The number of OnSpinWaitInst instructions to generate." \
|
||||
"It cannot be used with OnSpinWaitInst=none.") \
|
||||
|
||||
@@ -1016,31 +1016,16 @@ void InterpreterMacroAssembler::update_mdp_for_ret(Register return_bci) {
|
||||
}
|
||||
|
||||
|
||||
void InterpreterMacroAssembler::profile_taken_branch(Register mdp,
|
||||
Register bumped_count) {
|
||||
void InterpreterMacroAssembler::profile_taken_branch(Register mdp) {
|
||||
if (ProfileInterpreter) {
|
||||
Label profile_continue;
|
||||
|
||||
// If no method data exists, go to profile_continue.
|
||||
// Otherwise, assign to mdp
|
||||
test_method_data_pointer(mdp, profile_continue);
|
||||
|
||||
// We are taking a branch. Increment the taken count.
|
||||
// We inline increment_mdp_data_at to return bumped_count in a register
|
||||
//increment_mdp_data_at(mdp, in_bytes(JumpData::taken_offset()));
|
||||
Address data(mdp, in_bytes(JumpData::taken_offset()));
|
||||
ldr(bumped_count, data);
|
||||
assert(DataLayout::counter_increment == 1,
|
||||
"flow-free idiom only works with 1");
|
||||
// Intel does this to catch overflow
|
||||
// addptr(bumped_count, DataLayout::counter_increment);
|
||||
// sbbptr(bumped_count, 0);
|
||||
// so we do this
|
||||
adds(bumped_count, bumped_count, DataLayout::counter_increment);
|
||||
Label L;
|
||||
br(Assembler::CS, L); // skip store if counter overflow
|
||||
str(bumped_count, data);
|
||||
bind(L);
|
||||
increment_mdp_data_at(mdp, in_bytes(JumpData::taken_offset()));
|
||||
|
||||
// The method data pointer needs to be updated to reflect the new target.
|
||||
update_mdp_by_offset(mdp, in_bytes(JumpData::displacement_offset()));
|
||||
bind(profile_continue);
|
||||
@@ -1055,7 +1040,7 @@ void InterpreterMacroAssembler::profile_not_taken_branch(Register mdp) {
|
||||
// If no method data exists, go to profile_continue.
|
||||
test_method_data_pointer(mdp, profile_continue);
|
||||
|
||||
// We are taking a branch. Increment the not taken count.
|
||||
// We are not taking a branch. Increment the not taken count.
|
||||
increment_mdp_data_at(mdp, in_bytes(BranchData::not_taken_offset()));
|
||||
|
||||
// The method data pointer needs to be updated to correspond to
|
||||
|
||||
@@ -276,7 +276,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
// narrow int return value
|
||||
void narrow(Register result);
|
||||
|
||||
void profile_taken_branch(Register mdp, Register bumped_count);
|
||||
void profile_taken_branch(Register mdp);
|
||||
void profile_not_taken_branch(Register mdp);
|
||||
void profile_call(Register mdp);
|
||||
void profile_final_call(Register mdp);
|
||||
|
||||
@@ -6803,6 +6803,7 @@ void MacroAssembler::verify_cross_modify_fence_not_required() {
|
||||
#endif
|
||||
|
||||
void MacroAssembler::spin_wait() {
|
||||
block_comment("spin_wait {");
|
||||
for (int i = 0; i < VM_Version::spin_wait_desc().inst_count(); ++i) {
|
||||
switch (VM_Version::spin_wait_desc().inst()) {
|
||||
case SpinWait::NOP:
|
||||
@@ -6814,10 +6815,15 @@ void MacroAssembler::spin_wait() {
|
||||
case SpinWait::YIELD:
|
||||
yield();
|
||||
break;
|
||||
case SpinWait::SB:
|
||||
assert(VM_Version::supports_sb(), "current CPU does not support SB instruction");
|
||||
sb();
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
block_comment("}");
|
||||
}
|
||||
|
||||
// Stack frame creation/removal
|
||||
|
||||
@@ -543,7 +543,7 @@ void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw,
|
||||
// }
|
||||
//
|
||||
// /* compute n */
|
||||
// z = scalbnA(z,q0); /* actual value of z */
|
||||
// z = scalbn(z,q0); /* actual value of z */
|
||||
// z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */
|
||||
// n = (int) z;
|
||||
// z -= (double)n;
|
||||
@@ -576,7 +576,7 @@ void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw,
|
||||
// }
|
||||
// if(ih==2) {
|
||||
// z = one - z;
|
||||
// if(carry!=0) z -= scalbnA(one,q0);
|
||||
// if(carry!=0) z -= scalbn(one,q0);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@@ -602,7 +602,7 @@ void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw,
|
||||
// jz -= 1; q0 -= 24;
|
||||
// while(iq[jz]==0) { jz--; q0-=24;}
|
||||
// } else { /* break z into 24-bit if necessary */
|
||||
// z = scalbnA(z,-q0);
|
||||
// z = scalbn(z,-q0);
|
||||
// if(z>=two24B) {
|
||||
// fw = (double)((int)(twon24*z));
|
||||
// iq[jz] = (int)(z-two24B*fw);
|
||||
@@ -612,7 +612,7 @@ void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw,
|
||||
// }
|
||||
//
|
||||
// /* convert integer "bit" chunk to floating-point value */
|
||||
// fw = scalbnA(one,q0);
|
||||
// fw = scalbn(one,q0);
|
||||
// for(i=jz;i>=0;i--) {
|
||||
// q[i] = fw*(double)iq[i]; fw*=twon24;
|
||||
// }
|
||||
@@ -925,7 +925,7 @@ void MacroAssembler::generate__kernel_rem_pio2(address two_over_pi, address pio2
|
||||
fmovd(v25, 1.0);
|
||||
fsubd(v18, v25, v18); // z = one - z;
|
||||
cbzw(rscratch2, IH_HANDLED);
|
||||
fsubd(v18, v18, v30); // z -= scalbnA(one,q0);
|
||||
fsubd(v18, v18, v30); // z -= scalbn(one,q0);
|
||||
}
|
||||
}
|
||||
bind(IH_HANDLED);
|
||||
@@ -1026,7 +1026,7 @@ void MacroAssembler::generate__kernel_rem_pio2(address two_over_pi, address pio2
|
||||
bind(Z_ZERO_CHECK_DONE);
|
||||
// convert integer "bit" chunk to floating-point value
|
||||
// v17 = twon24
|
||||
// update v30, which was scalbnA(1.0, <old q0>);
|
||||
// update v30, which was scalbn(1.0, <old q0>);
|
||||
addw(tmp2, rscratch1, 1023); // biased exponent
|
||||
lsl(tmp2, tmp2, 52); // put at correct position
|
||||
mov(i, jz);
|
||||
|
||||
@@ -212,11 +212,6 @@ void NativeMovRegMem::verify() {
|
||||
|
||||
void NativeJump::verify() { ; }
|
||||
|
||||
|
||||
void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
|
||||
}
|
||||
|
||||
|
||||
address NativeJump::jump_destination() const {
|
||||
address dest = MacroAssembler::target_addr_for_insn_or_null(instruction_address());
|
||||
|
||||
@@ -345,10 +340,6 @@ bool NativeInstruction::is_movk() {
|
||||
return Instruction_aarch64::extract(int_at(0), 30, 23) == 0b11100101;
|
||||
}
|
||||
|
||||
bool NativeInstruction::is_sigill_not_entrant() {
|
||||
return uint_at(0) == 0xd4bbd5a1; // dcps1 #0xdead
|
||||
}
|
||||
|
||||
void NativeIllegalInstruction::insert(address code_pos) {
|
||||
*(juint*)code_pos = 0xd4bbd5a1; // dcps1 #0xdead
|
||||
}
|
||||
@@ -359,31 +350,6 @@ bool NativeInstruction::is_stop() {
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
// MT-safe inserting of a jump over a jump or a nop (used by
|
||||
// nmethod::make_not_entrant)
|
||||
|
||||
void NativeJump::patch_verified_entry(address entry, address verified_entry, address dest) {
|
||||
|
||||
assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "expected fixed destination of patch");
|
||||
assert(nativeInstruction_at(verified_entry)->is_jump_or_nop()
|
||||
|| nativeInstruction_at(verified_entry)->is_sigill_not_entrant(),
|
||||
"Aarch64 cannot replace non-jump with jump");
|
||||
|
||||
// Patch this nmethod atomically.
|
||||
if (Assembler::reachable_from_branch_at(verified_entry, dest)) {
|
||||
ptrdiff_t disp = dest - verified_entry;
|
||||
guarantee(disp < 1 << 27 && disp > - (1 << 27), "branch overflow");
|
||||
|
||||
unsigned int insn = (0b000101 << 26) | ((disp >> 2) & 0x3ffffff);
|
||||
*(unsigned int*)verified_entry = insn;
|
||||
} else {
|
||||
// We use an illegal instruction for marking a method as not_entrant.
|
||||
NativeIllegalInstruction::insert(verified_entry);
|
||||
}
|
||||
|
||||
ICache::invalidate_range(verified_entry, instruction_size);
|
||||
}
|
||||
|
||||
void NativeGeneralJump::verify() { }
|
||||
|
||||
// MT-safe patching of a long jump instruction.
|
||||
|
||||
@@ -83,7 +83,6 @@ public:
|
||||
bool is_safepoint_poll();
|
||||
bool is_movz();
|
||||
bool is_movk();
|
||||
bool is_sigill_not_entrant();
|
||||
bool is_stop();
|
||||
|
||||
protected:
|
||||
@@ -360,9 +359,6 @@ public:
|
||||
|
||||
// Insertion of native jump instruction
|
||||
static void insert(address code_pos, address entry);
|
||||
// MT-safe insertion of native jump at verified method entry
|
||||
static void check_verified_entry_alignment(address entry, address verified_entry);
|
||||
static void patch_verified_entry(address entry, address verified_entry, address dest);
|
||||
};
|
||||
|
||||
inline NativeJump* nativeJump_at(address address) {
|
||||
|
||||
@@ -61,8 +61,8 @@ class SimpleRuntimeFrame {
|
||||
|
||||
//------------------------------generate_uncommon_trap_blob--------------------
|
||||
UncommonTrapBlob* OptoRuntime::generate_uncommon_trap_blob() {
|
||||
const char* name = OptoRuntime::stub_name(OptoStubId::uncommon_trap_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, (uint)OptoStubId::uncommon_trap_id, name);
|
||||
const char* name = OptoRuntime::stub_name(StubId::c2_uncommon_trap_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, BlobId::c2_uncommon_trap_id);
|
||||
if (blob != nullptr) {
|
||||
return blob->as_uncommon_trap_blob();
|
||||
}
|
||||
@@ -254,7 +254,7 @@ UncommonTrapBlob* OptoRuntime::generate_uncommon_trap_blob() {
|
||||
|
||||
UncommonTrapBlob *ut_blob = UncommonTrapBlob::create(&buffer, oop_maps,
|
||||
SimpleRuntimeFrame::framesize >> 1);
|
||||
AOTCodeCache::store_code_blob(*ut_blob, AOTCodeEntry::C2Blob, (uint)OptoStubId::uncommon_trap_id, name);
|
||||
AOTCodeCache::store_code_blob(*ut_blob, AOTCodeEntry::C2Blob, BlobId::c2_uncommon_trap_id);
|
||||
return ut_blob;
|
||||
}
|
||||
|
||||
@@ -291,8 +291,8 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
|
||||
|
||||
assert(SimpleRuntimeFrame::framesize % 4 == 0, "sp not 16-byte aligned");
|
||||
|
||||
const char* name = OptoRuntime::stub_name(OptoStubId::exception_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, (uint)OptoStubId::exception_id, name);
|
||||
const char* name = OptoRuntime::stub_name(StubId::c2_exception_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, (uint)BlobId::c2_exception_id, name);
|
||||
if (blob != nullptr) {
|
||||
return blob->as_exception_blob();
|
||||
}
|
||||
@@ -398,7 +398,7 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
|
||||
|
||||
// Set exception blob
|
||||
ExceptionBlob* ex_blob = ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
|
||||
AOTCodeCache::store_code_blob(*ex_blob, AOTCodeEntry::C2Blob, (uint)OptoStubId::exception_id, name);
|
||||
AOTCodeCache::store_code_blob(*ex_blob, AOTCodeEntry::C2Blob, BlobId::c2_exception_id);
|
||||
return ex_blob;
|
||||
}
|
||||
#endif // COMPILER2
|
||||
|
||||
@@ -2201,8 +2201,8 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
pad += 512; // Increase the buffer size when compiling for JVMCI
|
||||
}
|
||||
#endif
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, (uint)SharedStubId::deopt_id, name);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_deopt_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, BlobId::shared_deopt_id);
|
||||
if (blob != nullptr) {
|
||||
_deopt_blob = blob->as_deoptimization_blob();
|
||||
return;
|
||||
@@ -2572,7 +2572,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
}
|
||||
#endif
|
||||
|
||||
AOTCodeCache::store_code_blob(*_deopt_blob, AOTCodeEntry::SharedBlob, (uint)SharedStubId::deopt_id, name);
|
||||
AOTCodeCache::store_code_blob(*_deopt_blob, AOTCodeEntry::SharedBlob, BlobId::shared_deopt_id);
|
||||
}
|
||||
|
||||
// Number of stack slots between incoming argument block and the start of
|
||||
@@ -2598,12 +2598,12 @@ VMReg SharedRuntime::thread_register() {
|
||||
// Generate a special Compile2Runtime blob that saves all registers,
|
||||
// and setup oopmap.
|
||||
//
|
||||
SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address call_ptr) {
|
||||
SafepointBlob* SharedRuntime::generate_handler_blob(StubId id, address call_ptr) {
|
||||
assert(is_polling_page_id(id), "expected a polling page stub id");
|
||||
|
||||
// Allocate space for the code. Setup code generation tools.
|
||||
const char* name = SharedRuntime::stub_name(id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, (uint)id, name);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, StubInfo::blob(id));
|
||||
if (blob != nullptr) {
|
||||
return blob->as_safepoint_blob();
|
||||
}
|
||||
@@ -2617,8 +2617,8 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
address start = __ pc();
|
||||
address call_pc = nullptr;
|
||||
int frame_size_in_words;
|
||||
bool cause_return = (id == SharedStubId::polling_page_return_handler_id);
|
||||
RegisterSaver reg_save(id == SharedStubId::polling_page_vectors_safepoint_handler_id /* save_vectors */);
|
||||
bool cause_return = (id == StubId::shared_polling_page_return_handler_id);
|
||||
RegisterSaver reg_save(id == StubId::shared_polling_page_vectors_safepoint_handler_id /* save_vectors */);
|
||||
|
||||
// When the signal occurred, the LR was either signed and stored on the stack (in which
|
||||
// case it will be restored from the stack before being used) or unsigned and not stored
|
||||
@@ -2721,7 +2721,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
// Fill-out other meta info
|
||||
SafepointBlob* sp_blob = SafepointBlob::create(&buffer, oop_maps, frame_size_in_words);
|
||||
|
||||
AOTCodeCache::store_code_blob(*sp_blob, AOTCodeEntry::SharedBlob, (uint)id, name);
|
||||
AOTCodeCache::store_code_blob(*sp_blob, AOTCodeEntry::SharedBlob, StubInfo::blob(id));
|
||||
return sp_blob;
|
||||
}
|
||||
|
||||
@@ -2733,12 +2733,12 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
// but since this is generic code we don't know what they are and the caller
|
||||
// must do any gc of the args.
|
||||
//
|
||||
RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address destination) {
|
||||
RuntimeStub* SharedRuntime::generate_resolve_blob(StubId id, address destination) {
|
||||
assert (StubRoutines::forward_exception_entry() != nullptr, "must be generated before");
|
||||
assert(is_resolve_id(id), "expected a resolve stub id");
|
||||
|
||||
const char* name = SharedRuntime::stub_name(id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, (uint)id, name);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, StubInfo::blob(id));
|
||||
if (blob != nullptr) {
|
||||
return blob->as_runtime_stub();
|
||||
}
|
||||
@@ -2819,7 +2819,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti
|
||||
// frame_size_words or bytes??
|
||||
RuntimeStub* rs_blob = RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_in_words, oop_maps, true);
|
||||
|
||||
AOTCodeCache::store_code_blob(*rs_blob, AOTCodeEntry::SharedBlob, (uint)id, name);
|
||||
AOTCodeCache::store_code_blob(*rs_blob, AOTCodeEntry::SharedBlob, StubInfo::blob(id));
|
||||
return rs_blob;
|
||||
}
|
||||
|
||||
@@ -2839,7 +2839,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti
|
||||
// otherwise assume that stack unwinding will be initiated, so
|
||||
// caller saved registers were assumed volatile in the compiler.
|
||||
|
||||
RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address runtime_entry) {
|
||||
RuntimeStub* SharedRuntime::generate_throw_exception(StubId id, address runtime_entry) {
|
||||
assert(is_throw_id(id), "expected a throw stub id");
|
||||
|
||||
const char* name = SharedRuntime::stub_name(id);
|
||||
@@ -2863,7 +2863,7 @@ RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address ru
|
||||
const char* timer_msg = "SharedRuntime generate_throw_exception";
|
||||
TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));
|
||||
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, (uint)id, name);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, StubInfo::blob(id));
|
||||
if (blob != nullptr) {
|
||||
return blob->as_runtime_stub();
|
||||
}
|
||||
@@ -2928,7 +2928,7 @@ RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address ru
|
||||
frame_complete,
|
||||
(framesize >> (LogBytesPerWord - LogBytesPerInt)),
|
||||
oop_maps, false);
|
||||
AOTCodeCache::store_code_blob(*stub, AOTCodeEntry::SharedBlob, (uint)id, name);
|
||||
AOTCodeCache::store_code_blob(*stub, AOTCodeEntry::SharedBlob, StubInfo::blob(id));
|
||||
|
||||
return stub;
|
||||
}
|
||||
@@ -2959,7 +2959,7 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
|
||||
|
||||
int insts_size = 1024;
|
||||
int locs_size = 64;
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_write_checkpoint_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_jfr_write_checkpoint_id);
|
||||
CodeBuffer code(name, insts_size, locs_size);
|
||||
OopMapSet* oop_maps = new OopMapSet();
|
||||
MacroAssembler* masm = new MacroAssembler(&code);
|
||||
@@ -2998,7 +2998,7 @@ RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
|
||||
int insts_size = 1024;
|
||||
int locs_size = 64;
|
||||
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_return_lease_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_jfr_return_lease_id);
|
||||
CodeBuffer code(name, insts_size, locs_size);
|
||||
OopMapSet* oop_maps = new OopMapSet();
|
||||
MacroAssembler* masm = new MacroAssembler(&code);
|
||||
|
||||
@@ -19,42 +19,34 @@
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.runtime;
|
||||
#include "spin_wait_aarch64.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
import sun.jvm.hotspot.types.TypeDataBase;
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/** Encapsulates the LockingMode enum in globalDefinitions.hpp in
|
||||
the VM. */
|
||||
|
||||
public class LockingMode {
|
||||
private static int monitor;
|
||||
private static int legacy;
|
||||
private static int lightweight;
|
||||
|
||||
static {
|
||||
VM.registerVMInitializedObserver(
|
||||
(o, d) -> initialize(VM.getVM().getTypeDataBase()));
|
||||
}
|
||||
|
||||
private static synchronized void initialize(TypeDataBase db) {
|
||||
monitor = db.lookupIntConstant("LM_MONITOR").intValue();
|
||||
legacy = db.lookupIntConstant("LM_LEGACY").intValue();
|
||||
lightweight = db.lookupIntConstant("LM_LIGHTWEIGHT").intValue();
|
||||
}
|
||||
|
||||
public static int getMonitor() {
|
||||
return monitor;
|
||||
}
|
||||
|
||||
public static int getLegacy() {
|
||||
return legacy;
|
||||
}
|
||||
|
||||
public static int getLightweight() {
|
||||
return lightweight;
|
||||
}
|
||||
bool SpinWait::supports(const char *name) {
|
||||
return name != nullptr &&
|
||||
(strcmp(name, "nop") == 0 ||
|
||||
strcmp(name, "isb") == 0 ||
|
||||
strcmp(name, "yield") == 0 ||
|
||||
strcmp(name, "sb") == 0 ||
|
||||
strcmp(name, "none") == 0);
|
||||
}
|
||||
|
||||
SpinWait::Inst SpinWait::from_name(const char* name) {
|
||||
assert(supports(name), "checked by OnSpinWaitInstNameConstraintFunc");
|
||||
|
||||
if (strcmp(name, "nop") == 0) {
|
||||
return SpinWait::NOP;
|
||||
} else if (strcmp(name, "isb") == 0) {
|
||||
return SpinWait::ISB;
|
||||
} else if (strcmp(name, "yield") == 0) {
|
||||
return SpinWait::YIELD;
|
||||
} else if (strcmp(name, "sb") == 0) {
|
||||
return SpinWait::SB;
|
||||
}
|
||||
|
||||
return SpinWait::NONE;
|
||||
}
|
||||
@@ -19,7 +19,6 @@
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_AARCH64_SPIN_WAIT_AARCH64_HPP
|
||||
@@ -31,18 +30,24 @@ public:
|
||||
NONE = -1,
|
||||
NOP,
|
||||
ISB,
|
||||
YIELD
|
||||
YIELD,
|
||||
SB
|
||||
};
|
||||
|
||||
private:
|
||||
Inst _inst;
|
||||
int _count;
|
||||
|
||||
Inst from_name(const char *name);
|
||||
|
||||
public:
|
||||
SpinWait(Inst inst = NONE, int count = 0) : _inst(inst), _count(count) {}
|
||||
SpinWait(Inst inst = NONE, int count = 0) : _inst(inst), _count(inst == NONE ? 0 : count) {}
|
||||
SpinWait(const char *name, int count) : SpinWait(from_name(name), count) {}
|
||||
|
||||
Inst inst() const { return _inst; }
|
||||
int inst_count() const { return _count; }
|
||||
|
||||
static bool supports(const char *name);
|
||||
};
|
||||
|
||||
#endif // CPU_AARCH64_SPIN_WAIT_AARCH64_HPP
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1759,7 +1759,7 @@ void TemplateTable::float_cmp(bool is_float, int unordered_result)
|
||||
|
||||
void TemplateTable::branch(bool is_jsr, bool is_wide)
|
||||
{
|
||||
__ profile_taken_branch(r0, r1);
|
||||
__ profile_taken_branch(r0);
|
||||
const ByteSize be_offset = MethodCounters::backedge_counter_offset() +
|
||||
InvocationCounter::counter_offset();
|
||||
const ByteSize inv_offset = MethodCounters::invocation_counter_offset() +
|
||||
@@ -1809,7 +1809,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide)
|
||||
if (UseLoopCounter) {
|
||||
// increment backedge counter for backward branches
|
||||
// r0: MDO
|
||||
// w1: MDO bumped taken-count
|
||||
// r2: target offset
|
||||
__ cmp(r2, zr);
|
||||
__ br(Assembler::GT, dispatch); // count only if backward branch
|
||||
@@ -1820,12 +1819,10 @@ void TemplateTable::branch(bool is_jsr, bool is_wide)
|
||||
__ ldr(rscratch1, Address(rmethod, Method::method_counters_offset()));
|
||||
__ cbnz(rscratch1, has_counters);
|
||||
__ push(r0);
|
||||
__ push(r1);
|
||||
__ push(r2);
|
||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address,
|
||||
InterpreterRuntime::build_method_counters), rmethod);
|
||||
__ pop(r2);
|
||||
__ pop(r1);
|
||||
__ pop(r0);
|
||||
__ ldr(rscratch1, Address(rmethod, Method::method_counters_offset()));
|
||||
__ cbz(rscratch1, dispatch); // No MethodCounters allocated, OutOfMemory
|
||||
|
||||
@@ -51,21 +51,12 @@ uintptr_t VM_Version::_pac_mask;
|
||||
SpinWait VM_Version::_spin_wait;
|
||||
|
||||
static SpinWait get_spin_wait_desc() {
|
||||
if (strcmp(OnSpinWaitInst, "nop") == 0) {
|
||||
return SpinWait(SpinWait::NOP, OnSpinWaitInstCount);
|
||||
} else if (strcmp(OnSpinWaitInst, "isb") == 0) {
|
||||
return SpinWait(SpinWait::ISB, OnSpinWaitInstCount);
|
||||
} else if (strcmp(OnSpinWaitInst, "yield") == 0) {
|
||||
return SpinWait(SpinWait::YIELD, OnSpinWaitInstCount);
|
||||
} else if (strcmp(OnSpinWaitInst, "none") != 0) {
|
||||
vm_exit_during_initialization("The options for OnSpinWaitInst are nop, isb, yield, and none", OnSpinWaitInst);
|
||||
SpinWait spin_wait(OnSpinWaitInst, OnSpinWaitInstCount);
|
||||
if (spin_wait.inst() == SpinWait::SB && !VM_Version::supports_sb()) {
|
||||
vm_exit_during_initialization("OnSpinWaitInst is SB but current CPU does not support SB instruction");
|
||||
}
|
||||
|
||||
if (!FLAG_IS_DEFAULT(OnSpinWaitInstCount) && OnSpinWaitInstCount > 0) {
|
||||
vm_exit_during_initialization("OnSpinWaitInstCount cannot be used for OnSpinWaitInst 'none'");
|
||||
}
|
||||
|
||||
return SpinWait{};
|
||||
return spin_wait;
|
||||
}
|
||||
|
||||
void VM_Version::initialize() {
|
||||
|
||||
@@ -131,6 +131,7 @@ enum Ampere_CPU_Model {
|
||||
decl(SHA3, sha3, 17) \
|
||||
decl(SHA512, sha512, 21) \
|
||||
decl(SVE, sve, 22) \
|
||||
decl(SB, sb, 29) \
|
||||
decl(PACA, paca, 30) \
|
||||
/* flags above must follow Linux HWCAP */ \
|
||||
decl(SVEBITPERM, svebitperm, 27) \
|
||||
|
||||
@@ -8888,13 +8888,8 @@ instruct TailCalljmpInd(IPRegP jump_target, inline_cache_regP method_ptr) %{
|
||||
match(TailCall jump_target method_ptr);
|
||||
|
||||
ins_cost(CALL_COST);
|
||||
format %{ "MOV Rexception_pc, LR\n\t"
|
||||
"jump $jump_target \t! $method_ptr holds method" %}
|
||||
format %{ "jump $jump_target \t! $method_ptr holds method" %}
|
||||
ins_encode %{
|
||||
__ mov(Rexception_pc, LR); // this is used only to call
|
||||
// StubRoutines::forward_exception_entry()
|
||||
// which expects PC of exception in
|
||||
// R5. FIXME?
|
||||
__ jump($jump_target$$Register);
|
||||
%}
|
||||
ins_pipe(tail_call);
|
||||
@@ -8939,8 +8934,10 @@ instruct ForwardExceptionjmp()
|
||||
match(ForwardException);
|
||||
ins_cost(CALL_COST);
|
||||
|
||||
format %{ "b forward_exception_stub" %}
|
||||
format %{ "MOV Rexception_pc, LR\n\t"
|
||||
"b forward_exception_entry" %}
|
||||
ins_encode %{
|
||||
__ mov(Rexception_pc, LR);
|
||||
// OK to trash Rtemp, because Rtemp is used by stub
|
||||
__ jump(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type, Rtemp);
|
||||
%}
|
||||
|
||||
@@ -45,7 +45,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_bci, 0);
|
||||
ce->store_parameter(_method->as_constant_ptr()->as_metadata(), 1);
|
||||
__ call(Runtime1::entry_for(C1StubId::counter_overflow_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_counter_overflow_id), relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
|
||||
@@ -56,7 +56,7 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
__ call(Runtime1::entry_for(C1StubId::predicate_failed_trap_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_predicate_failed_trap_id), relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
DEBUG_ONLY(__ should_not_reach_here());
|
||||
@@ -72,10 +72,10 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
}
|
||||
|
||||
if (_throw_index_out_of_bounds_exception) {
|
||||
__ call(Runtime1::entry_for(C1StubId::throw_index_exception_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_throw_index_exception_id), relocInfo::runtime_call_type);
|
||||
} else {
|
||||
__ str(_array->as_pointer_register(), Address(SP, BytesPerWord)); // ??? Correct offset? Correct instruction?
|
||||
__ call(Runtime1::entry_for(C1StubId::throw_range_check_failed_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_throw_range_check_failed_id), relocInfo::runtime_call_type);
|
||||
}
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
@@ -88,7 +88,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
|
||||
|
||||
void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
__ call(Runtime1::entry_for(C1StubId::predicate_failed_trap_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_predicate_failed_trap_id), relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
DEBUG_ONLY(__ should_not_reach_here());
|
||||
@@ -99,7 +99,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
}
|
||||
__ bind(_entry);
|
||||
__ call(Runtime1::entry_for(C1StubId::throw_div0_exception_id),
|
||||
__ call(Runtime1::entry_for(StubId::c1_throw_div0_exception_id),
|
||||
relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
DEBUG_ONLY(STOP("DivByZero");)
|
||||
@@ -108,14 +108,14 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
|
||||
// Implementation of NewInstanceStub
|
||||
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) {
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, StubId stub_id) {
|
||||
_result = result;
|
||||
_klass = klass;
|
||||
_klass_reg = klass_reg;
|
||||
_info = new CodeEmitInfo(info);
|
||||
assert(stub_id == C1StubId::new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_init_check_id,
|
||||
assert(stub_id == StubId::c1_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_init_check_id,
|
||||
"need new_instance id");
|
||||
_stub_id = stub_id;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(_klass_reg->as_register() == R1, "runtime call setup");
|
||||
assert(_length->as_register() == R2, "runtime call setup");
|
||||
__ bind(_entry);
|
||||
__ call(Runtime1::entry_for(C1StubId::new_type_array_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_new_type_array_id), relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
__ b(_continuation);
|
||||
@@ -169,7 +169,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
assert(_klass_reg->as_register() == R1, "runtime call setup");
|
||||
assert(_length->as_register() == R2, "runtime call setup");
|
||||
__ bind(_entry);
|
||||
__ call(Runtime1::entry_for(C1StubId::new_object_array_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_new_object_array_id), relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
__ b(_continuation);
|
||||
@@ -188,9 +188,9 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
|
||||
__ str(lock_reg, Address(SP, BytesPerWord));
|
||||
}
|
||||
|
||||
C1StubId enter_id = ce->compilation()->has_fpu_code() ?
|
||||
C1StubId::monitorenter_id :
|
||||
C1StubId::monitorenter_nofpu_id;
|
||||
StubId enter_id = ce->compilation()->has_fpu_code() ?
|
||||
StubId::c1_monitorenter_id :
|
||||
StubId::c1_monitorenter_nofpu_id;
|
||||
__ call(Runtime1::entry_for(enter_id), relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
@@ -209,9 +209,9 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) {
|
||||
__ str(lock_reg, Address(SP));
|
||||
|
||||
// Non-blocking leaf routine - no call info needed
|
||||
C1StubId exit_id = ce->compilation()->has_fpu_code() ?
|
||||
C1StubId::monitorexit_id :
|
||||
C1StubId::monitorexit_nofpu_id;
|
||||
StubId exit_id = ce->compilation()->has_fpu_code() ?
|
||||
StubId::c1_monitorexit_id :
|
||||
StubId::c1_monitorexit_nofpu_id;
|
||||
__ call(Runtime1::entry_for(exit_id), relocInfo::runtime_call_type);
|
||||
__ b(_continuation);
|
||||
}
|
||||
@@ -321,10 +321,10 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
address target = nullptr;
|
||||
relocInfo::relocType reloc_type = relocInfo::none;
|
||||
switch (_id) {
|
||||
case access_field_id: target = Runtime1::entry_for(C1StubId::access_field_patching_id); break;
|
||||
case load_klass_id: target = Runtime1::entry_for(C1StubId::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break;
|
||||
case load_mirror_id: target = Runtime1::entry_for(C1StubId::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break;
|
||||
case load_appendix_id: target = Runtime1::entry_for(C1StubId::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break;
|
||||
case access_field_id: target = Runtime1::entry_for(StubId::c1_access_field_patching_id); break;
|
||||
case load_klass_id: target = Runtime1::entry_for(StubId::c1_load_klass_patching_id); reloc_type = relocInfo::metadata_type; break;
|
||||
case load_mirror_id: target = Runtime1::entry_for(StubId::c1_load_mirror_patching_id); reloc_type = relocInfo::oop_type; break;
|
||||
case load_appendix_id: target = Runtime1::entry_for(StubId::c1_load_appendix_patching_id); reloc_type = relocInfo::oop_type; break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
__ bind(call_patch);
|
||||
@@ -350,7 +350,7 @@ void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
|
||||
__ mov_slow(Rtemp, _trap_request);
|
||||
ce->verify_reserved_argument_area_size(1);
|
||||
__ str(Rtemp, Address(SP));
|
||||
__ call(Runtime1::entry_for(C1StubId::deoptimize_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_deoptimize_id), relocInfo::runtime_call_type);
|
||||
ce->add_call_info_here(_info);
|
||||
DEBUG_ONLY(__ should_not_reach_here());
|
||||
}
|
||||
@@ -361,9 +361,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
// Deoptimize, do not throw the exception, because it is
|
||||
// probably wrong to do it here.
|
||||
a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
} else {
|
||||
a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id);
|
||||
a = Runtime1::entry_for(StubId::c1_throw_null_pointer_exception_id);
|
||||
}
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
__ bind(_entry);
|
||||
|
||||
@@ -212,7 +212,7 @@ int LIR_Assembler::emit_exception_handler() {
|
||||
// check that there is really an exception
|
||||
__ verify_not_null_oop(Rexception_obj);
|
||||
|
||||
__ call(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_handle_exception_from_callee_id), relocInfo::runtime_call_type);
|
||||
__ should_not_reach_here();
|
||||
|
||||
assert(code_offset() - offset <= exception_handler_size(), "overflow");
|
||||
@@ -252,7 +252,7 @@ int LIR_Assembler::emit_unwind_handler() {
|
||||
|
||||
// remove the activation and dispatch to the unwind handler
|
||||
__ remove_frame(initial_frame_size_in_bytes()); // restores FP and LR
|
||||
__ jump(Runtime1::entry_for(C1StubId::unwind_exception_id), relocInfo::runtime_call_type, Rtemp);
|
||||
__ jump(Runtime1::entry_for(StubId::c1_unwind_exception_id), relocInfo::runtime_call_type, Rtemp);
|
||||
|
||||
// Emit the slow path assembly
|
||||
if (stub != nullptr) {
|
||||
@@ -1136,7 +1136,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
__ b(*failure_target, ne);
|
||||
// slow case
|
||||
assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup");
|
||||
__ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ cbz(R0, *failure_target);
|
||||
if (op->should_profile()) {
|
||||
Register mdo = klass_RInfo, recv = k_RInfo, tmp1 = Rtemp;
|
||||
@@ -1210,7 +1210,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
__ cmp(Rtemp, k_RInfo, ne);
|
||||
__ b(*success_target, eq);
|
||||
assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup");
|
||||
__ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ cbz(R0, *failure_target);
|
||||
}
|
||||
} else {
|
||||
@@ -1227,7 +1227,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
__ b(*failure_target, ne);
|
||||
// slow case
|
||||
assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup");
|
||||
__ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ cbz(R0, *failure_target);
|
||||
}
|
||||
|
||||
@@ -1303,7 +1303,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
}
|
||||
__ b(*success_target, eq);
|
||||
assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup");
|
||||
__ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
if (!op->should_profile()) {
|
||||
move_regs(R0, res);
|
||||
} else {
|
||||
@@ -1334,7 +1334,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
__ b(*failure_target, ne);
|
||||
// slow case
|
||||
assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup");
|
||||
__ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
__ call(Runtime1::entry_for(StubId::c1_slow_subtype_check_id), relocInfo::runtime_call_type);
|
||||
if (!op->should_profile()) {
|
||||
move_regs(R0, res);
|
||||
}
|
||||
@@ -1981,9 +1981,9 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
|
||||
assert(exceptionPC->as_register() == Rexception_pc, "must match");
|
||||
info->add_register_oop(exceptionOop);
|
||||
|
||||
C1StubId handle_id = compilation()->has_fpu_code() ?
|
||||
C1StubId::handle_exception_id :
|
||||
C1StubId::handle_exception_nofpu_id;
|
||||
StubId handle_id = compilation()->has_fpu_code() ?
|
||||
StubId::c1_handle_exception_id :
|
||||
StubId::c1_handle_exception_nofpu_id;
|
||||
Label return_address;
|
||||
__ adr(Rexception_pc, return_address);
|
||||
__ call(Runtime1::entry_for(handle_id), relocInfo::runtime_call_type);
|
||||
@@ -2260,7 +2260,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
__ mov(altFP_7_11, R1);
|
||||
__ mov(R0, tmp);
|
||||
__ mov(R1, tmp2);
|
||||
__ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type); // does not blow any registers except R0, LR and Rtemp
|
||||
__ call(Runtime1::entry_for(StubId::c1_slow_subtype_check_id), relocInfo::runtime_call_type); // does not blow any registers except R0, LR and Rtemp
|
||||
__ cmp_32(R0, 0);
|
||||
__ mov(R0, R6);
|
||||
__ mov(R1, altFP_7_11);
|
||||
|
||||
@@ -1057,7 +1057,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
|
||||
args->append(rank);
|
||||
args->append(varargs);
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id),
|
||||
__ call_runtime(Runtime1::entry_for(StubId::c1_new_multi_array_id),
|
||||
LIR_OprFact::illegalOpr, reg, args, info);
|
||||
|
||||
LIR_Opr result = rlock_result(x);
|
||||
@@ -1086,7 +1086,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
CodeStub* stub;
|
||||
if (x->is_incompatible_class_change_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id,
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_incompatible_class_change_error_id,
|
||||
LIR_OprFact::illegalOpr, info_for_exception);
|
||||
} else if (x->is_invokespecial_receiver_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
@@ -1094,7 +1094,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
Deoptimization::Reason_class_check,
|
||||
Deoptimization::Action_none);
|
||||
} else {
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id,
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_class_cast_exception_id,
|
||||
LIR_OprFact::illegalOpr, info_for_exception);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre
|
||||
reset_last_Java_frame(Rtemp);
|
||||
|
||||
assert(frame_size() != no_frame_size, "frame must be fixed");
|
||||
if (_stub_id != (int)C1StubId::forward_exception_id) {
|
||||
if (_stub_id != (int)StubId::c1_forward_exception_id) {
|
||||
ldr(R3, Address(Rthread, Thread::pending_exception_offset()));
|
||||
}
|
||||
|
||||
@@ -80,10 +80,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre
|
||||
// Check for pending exception
|
||||
// unpack_with_exception_in_tls path is taken through
|
||||
// Runtime1::exception_handler_for_pc
|
||||
if (_stub_id != (int)C1StubId::forward_exception_id) {
|
||||
if (_stub_id != (int)StubId::c1_forward_exception_id) {
|
||||
assert(frame_size() != no_frame_size, "cannot directly call forward_exception_id");
|
||||
cmp(R3, 0);
|
||||
jump(Runtime1::entry_for(C1StubId::forward_exception_id), relocInfo::runtime_call_type, Rtemp, ne);
|
||||
jump(Runtime1::entry_for(StubId::c1_forward_exception_id), relocInfo::runtime_call_type, Rtemp, ne);
|
||||
} else {
|
||||
#ifdef ASSERT
|
||||
// Should not have pending exception in forward_exception stub
|
||||
@@ -283,7 +283,7 @@ static void restore_sp_for_method_handle(StubAssembler* sasm) {
|
||||
}
|
||||
|
||||
|
||||
OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler* sasm) {
|
||||
__ block_comment("generate_handle_exception");
|
||||
|
||||
bool save_fpu_registers = false;
|
||||
@@ -293,7 +293,7 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm)
|
||||
OopMap* oop_map = nullptr;
|
||||
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id: {
|
||||
case StubId::c1_forward_exception_id: {
|
||||
save_fpu_registers = HaveVFP;
|
||||
oop_map = generate_oop_map(sasm);
|
||||
__ ldr(Rexception_obj, Address(Rthread, Thread::pending_exception_offset()));
|
||||
@@ -302,14 +302,14 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm)
|
||||
__ str(zero, Address(Rthread, Thread::pending_exception_offset()));
|
||||
break;
|
||||
}
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
save_fpu_registers = HaveVFP;
|
||||
// fall-through
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
// At this point all registers MAY be live.
|
||||
oop_map = save_live_registers(sasm, save_fpu_registers);
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
// At this point all registers except exception oop (R4/R19) and
|
||||
// exception pc (R5/R20) are dead.
|
||||
oop_map = save_live_registers(sasm); // TODO it's not required to save all registers
|
||||
@@ -331,13 +331,13 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm)
|
||||
// Restore the registers that were saved at the beginning, remove
|
||||
// frame and jump to the exception handler.
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
restore_live_registers(sasm, save_fpu_registers);
|
||||
// Note: the restore live registers includes the jump to LR (patched to R0)
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
restore_live_registers_without_return(sasm); // must not jump immediately to handler
|
||||
restore_sp_for_method_handle(sasm);
|
||||
__ ret();
|
||||
@@ -406,7 +406,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
|
||||
}
|
||||
|
||||
|
||||
OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* Runtime1::generate_code_for(StubId id, StubAssembler* sasm) {
|
||||
const bool must_gc_arguments = true;
|
||||
const bool dont_gc_arguments = false;
|
||||
|
||||
@@ -414,16 +414,16 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
bool save_fpu_registers = HaveVFP;
|
||||
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
{
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
// does not return on ARM
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_instance_id:
|
||||
case C1StubId::fast_new_instance_id:
|
||||
case C1StubId::fast_new_instance_init_check_id:
|
||||
case StubId::c1_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_init_check_id:
|
||||
{
|
||||
const Register result = R0;
|
||||
const Register klass = R1;
|
||||
@@ -439,7 +439,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::counter_overflow_id:
|
||||
case StubId::c1_counter_overflow_id:
|
||||
{
|
||||
OopMap* oop_map = save_live_registers(sasm);
|
||||
__ ldr(R1, Address(SP, arg1_offset));
|
||||
@@ -451,10 +451,10 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_type_array_id:
|
||||
case C1StubId::new_object_array_id:
|
||||
case StubId::c1_new_type_array_id:
|
||||
case StubId::c1_new_object_array_id:
|
||||
{
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
__ set_info("new_type_array", dont_gc_arguments);
|
||||
} else {
|
||||
__ set_info("new_object_array", dont_gc_arguments);
|
||||
@@ -466,7 +466,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
|
||||
OopMap* map = save_live_registers(sasm);
|
||||
int call_offset;
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
call_offset = __ call_RT(result, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length);
|
||||
} else {
|
||||
call_offset = __ call_RT(result, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length);
|
||||
@@ -480,7 +480,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_multi_array_id:
|
||||
case StubId::c1_new_multi_array_id:
|
||||
{
|
||||
__ set_info("new_multi_array", dont_gc_arguments);
|
||||
|
||||
@@ -503,7 +503,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::register_finalizer_id:
|
||||
case StubId::c1_register_finalizer_id:
|
||||
{
|
||||
__ set_info("register_finalizer", dont_gc_arguments);
|
||||
|
||||
@@ -524,78 +524,78 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_range_check_failed_id:
|
||||
case StubId::c1_throw_range_check_failed_id:
|
||||
{
|
||||
__ set_info("range_check_failed", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_index_exception_id:
|
||||
case StubId::c1_throw_index_exception_id:
|
||||
{
|
||||
__ set_info("index_range_check_failed", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_div0_exception_id:
|
||||
case StubId::c1_throw_div0_exception_id:
|
||||
{
|
||||
__ set_info("throw_div0_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_null_pointer_exception_id:
|
||||
case StubId::c1_throw_null_pointer_exception_id:
|
||||
{
|
||||
__ set_info("throw_null_pointer_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
{
|
||||
__ set_info("handle_exception", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
{
|
||||
__ set_info("handle_exception_from_callee", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::unwind_exception_id:
|
||||
case StubId::c1_unwind_exception_id:
|
||||
{
|
||||
__ set_info("unwind_exception", dont_gc_arguments);
|
||||
generate_unwind_exception(sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_array_store_exception_id:
|
||||
case StubId::c1_throw_array_store_exception_id:
|
||||
{
|
||||
__ set_info("throw_array_store_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_class_cast_exception_id:
|
||||
case StubId::c1_throw_class_cast_exception_id:
|
||||
{
|
||||
__ set_info("throw_class_cast_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_incompatible_class_change_error_id:
|
||||
case StubId::c1_throw_incompatible_class_change_error_id:
|
||||
{
|
||||
__ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::slow_subtype_check_id:
|
||||
case StubId::c1_slow_subtype_check_id:
|
||||
{
|
||||
// (in) R0 - sub, destroyed,
|
||||
// (in) R1 - super, not changed
|
||||
@@ -628,10 +628,10 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorenter_nofpu_id:
|
||||
case StubId::c1_monitorenter_nofpu_id:
|
||||
save_fpu_registers = false;
|
||||
// fall through
|
||||
case C1StubId::monitorenter_id:
|
||||
case StubId::c1_monitorenter_id:
|
||||
{
|
||||
__ set_info("monitorenter", dont_gc_arguments);
|
||||
const Register obj = R1;
|
||||
@@ -646,10 +646,10 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorexit_nofpu_id:
|
||||
case StubId::c1_monitorexit_nofpu_id:
|
||||
save_fpu_registers = false;
|
||||
// fall through
|
||||
case C1StubId::monitorexit_id:
|
||||
case StubId::c1_monitorexit_id:
|
||||
{
|
||||
__ set_info("monitorexit", dont_gc_arguments);
|
||||
const Register lock = R1;
|
||||
@@ -662,7 +662,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::deoptimize_id:
|
||||
case StubId::c1_deoptimize_id:
|
||||
{
|
||||
__ set_info("deoptimize", dont_gc_arguments);
|
||||
OopMap* oop_map = save_live_registers(sasm);
|
||||
@@ -678,35 +678,35 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::access_field_patching_id:
|
||||
case StubId::c1_access_field_patching_id:
|
||||
{
|
||||
__ set_info("access_field_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_klass_patching_id:
|
||||
case StubId::c1_load_klass_patching_id:
|
||||
{
|
||||
__ set_info("load_klass_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_appendix_patching_id:
|
||||
case StubId::c1_load_appendix_patching_id:
|
||||
{
|
||||
__ set_info("load_appendix_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_mirror_patching_id:
|
||||
case StubId::c1_load_mirror_patching_id:
|
||||
{
|
||||
__ set_info("load_mirror_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::predicate_failed_trap_id:
|
||||
case StubId::c1_predicate_failed_trap_id:
|
||||
{
|
||||
__ set_info("predicate_failed_trap", dont_gc_arguments);
|
||||
|
||||
|
||||
@@ -193,10 +193,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) {
|
||||
__ bind(guard);
|
||||
|
||||
// nmethod guard value. Skipped over in common case.
|
||||
//
|
||||
// Put a debug value to make any offsets skew
|
||||
// clearly visible in coredump
|
||||
__ emit_int32(0xDEADBEAF);
|
||||
__ emit_int32(0); // initial armed value, will be reset later
|
||||
|
||||
__ bind(skip);
|
||||
__ block_comment("nmethod_barrier end");
|
||||
|
||||
@@ -282,16 +282,6 @@ void NativeMovConstReg::set_pc_relative_offset(address addr, address pc) {
|
||||
}
|
||||
}
|
||||
|
||||
void RawNativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
|
||||
}
|
||||
|
||||
void RawNativeJump::patch_verified_entry(address entry, address verified_entry, address dest) {
|
||||
assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "should be");
|
||||
int *a = (int *)verified_entry;
|
||||
a[0] = not_entrant_illegal_instruction; // always illegal
|
||||
ICache::invalidate_range((address)&a[0], sizeof a[0]);
|
||||
}
|
||||
|
||||
void NativeGeneralJump::insert_unconditional(address code_pos, address entry) {
|
||||
int offset = (int)(entry - code_pos - 8);
|
||||
assert(offset < 0x2000000 && offset > -0x2000000, "encoding constraint");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -61,10 +61,6 @@ class RawNativeInstruction {
|
||||
instr_fld_fst = 0xd0
|
||||
};
|
||||
|
||||
// illegal instruction used by NativeJump::patch_verified_entry
|
||||
// permanently undefined (UDF): 0xe << 28 | 0b1111111 << 20 | 0b1111 << 4
|
||||
static const int not_entrant_illegal_instruction = 0xe7f000f0;
|
||||
|
||||
static int decode_rotated_imm12(int encoding) {
|
||||
int base = encoding & 0xff;
|
||||
int right_rotation = (encoding & 0xf00) >> 7;
|
||||
@@ -274,10 +270,6 @@ class RawNativeJump: public NativeInstruction {
|
||||
}
|
||||
}
|
||||
|
||||
static void check_verified_entry_alignment(address entry, address verified_entry);
|
||||
|
||||
static void patch_verified_entry(address entry, address verified_entry, address dest);
|
||||
|
||||
};
|
||||
|
||||
inline RawNativeJump* rawNativeJump_at(address address) {
|
||||
|
||||
@@ -47,7 +47,7 @@ UncommonTrapBlob* OptoRuntime::generate_uncommon_trap_blob() {
|
||||
ResourceMark rm;
|
||||
|
||||
// setup code generation tools
|
||||
const char* name = OptoRuntime::stub_name(OptoStubId::uncommon_trap_id);
|
||||
const char* name = OptoRuntime::stub_name(StubId::c2_uncommon_trap_id);
|
||||
#ifdef _LP64
|
||||
CodeBuffer buffer(name, 2700, 512);
|
||||
#else
|
||||
@@ -210,7 +210,7 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
|
||||
|
||||
// setup code generation tools
|
||||
// Measured 8/7/03 at 256 in 32bit debug build
|
||||
const char* name = OptoRuntime::stub_name(OptoStubId::exception_id);
|
||||
const char* name = OptoRuntime::stub_name(StubId::c2_exception_id);
|
||||
CodeBuffer buffer(name, 600, 512);
|
||||
if (buffer.blob() == nullptr) {
|
||||
return nullptr;
|
||||
|
||||
@@ -1366,7 +1366,7 @@ VMReg SharedRuntime::thread_register() {
|
||||
//------------------------------generate_deopt_blob----------------------------
|
||||
void SharedRuntime::generate_deopt_blob() {
|
||||
ResourceMark rm;
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_deopt_id);
|
||||
CodeBuffer buffer(name, 1024, 1024);
|
||||
int frame_size_in_words;
|
||||
OopMapSet* oop_maps;
|
||||
@@ -1608,7 +1608,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
// setup oopmap, and calls safepoint code to stop the compiled code for
|
||||
// a safepoint.
|
||||
//
|
||||
SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address call_ptr) {
|
||||
SafepointBlob* SharedRuntime::generate_handler_blob(StubId id, address call_ptr) {
|
||||
assert(StubRoutines::forward_exception_entry() != nullptr, "must be generated before");
|
||||
assert(is_polling_page_id(id), "expected a polling page stub id");
|
||||
|
||||
@@ -1618,7 +1618,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
int frame_size_words;
|
||||
OopMapSet* oop_maps;
|
||||
|
||||
bool cause_return = (id == SharedStubId::polling_page_return_handler_id);
|
||||
bool cause_return = (id == StubId::shared_polling_page_return_handler_id);
|
||||
|
||||
MacroAssembler* masm = new MacroAssembler(&buffer);
|
||||
address start = __ pc();
|
||||
@@ -1680,7 +1680,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
return SafepointBlob::create(&buffer, oop_maps, frame_size_words);
|
||||
}
|
||||
|
||||
RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address destination) {
|
||||
RuntimeStub* SharedRuntime::generate_resolve_blob(StubId id, address destination) {
|
||||
assert(StubRoutines::forward_exception_entry() != nullptr, "must be generated before");
|
||||
assert(is_resolve_id(id), "expected a resolve stub id");
|
||||
|
||||
@@ -1744,7 +1744,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti
|
||||
// Continuation point for throwing of implicit exceptions that are not handled in
|
||||
// the current activation. Fabricates an exception oop and initiates normal
|
||||
// exception dispatching in this frame.
|
||||
RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address runtime_entry) {
|
||||
RuntimeStub* SharedRuntime::generate_throw_exception(StubId id, address runtime_entry) {
|
||||
assert(is_throw_id(id), "expected a throw stub id");
|
||||
|
||||
const char* name = SharedRuntime::stub_name(id);
|
||||
@@ -1808,7 +1808,7 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
|
||||
framesize // inclusive of return address
|
||||
};
|
||||
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_write_checkpoint_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_jfr_write_checkpoint_id);
|
||||
CodeBuffer code(name, 512, 64);
|
||||
MacroAssembler* masm = new MacroAssembler(&code);
|
||||
|
||||
@@ -1852,7 +1852,7 @@ RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
|
||||
framesize // inclusive of return address
|
||||
};
|
||||
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_return_lease_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_jfr_return_lease_id);
|
||||
CodeBuffer code(name, 512, 64);
|
||||
MacroAssembler* masm = new MacroAssembler(&code);
|
||||
|
||||
|
||||
@@ -30,7 +30,13 @@
|
||||
do_arch_blob, \
|
||||
do_arch_entry, \
|
||||
do_arch_entry_init) \
|
||||
do_arch_blob(preuniverse, 0) \
|
||||
do_arch_blob(preuniverse, 500) \
|
||||
do_stub(preuniverse, atomic_load_long) \
|
||||
do_arch_entry(Arm, preuniverse, atomic_load_long, \
|
||||
atomic_load_long_entry, atomic_load_long_entry) \
|
||||
do_stub(preuniverse, atomic_store_long) \
|
||||
do_arch_entry(Arm, preuniverse, atomic_store_long, \
|
||||
atomic_store_long_entry, atomic_store_long_entry) \
|
||||
|
||||
|
||||
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
|
||||
@@ -41,12 +47,6 @@
|
||||
do_stub(initial, idiv_irem) \
|
||||
do_arch_entry(Arm, initial, idiv_irem, \
|
||||
idiv_irem_entry, idiv_irem_entry) \
|
||||
do_stub(initial, atomic_load_long) \
|
||||
do_arch_entry(Arm, initial, atomic_load_long, \
|
||||
atomic_load_long_entry, atomic_load_long_entry) \
|
||||
do_stub(initial, atomic_store_long) \
|
||||
do_arch_entry(Arm, initial, atomic_load_long, \
|
||||
atomic_store_long_entry, atomic_store_long_entry) \
|
||||
|
||||
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
|
||||
do_arch_blob, \
|
||||
|
||||
@@ -172,7 +172,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
private:
|
||||
|
||||
address generate_call_stub(address& return_address) {
|
||||
StubGenStubId stub_id = StubGenStubId::call_stub_id;
|
||||
StubId stub_id = StubId::stubgen_call_stub_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -252,7 +252,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
// (in) Rexception_obj: exception oop
|
||||
address generate_catch_exception() {
|
||||
StubGenStubId stub_id = StubGenStubId::catch_exception_id;
|
||||
StubId stub_id = StubId::stubgen_catch_exception_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -265,7 +265,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
// (in) Rexception_pc: return address
|
||||
address generate_forward_exception() {
|
||||
StubGenStubId stub_id = StubGenStubId::forward_exception_id;
|
||||
StubId stub_id = StubId::stubgen_forward_exception_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -315,7 +315,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
Register tmp = LR;
|
||||
assert(dividend == remainder, "must be");
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::idiv_irem_id;
|
||||
StubId stub_id = StubId::stubgen_idiv_irem_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -458,7 +458,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address generate_atomic_add() {
|
||||
address start;
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::atomic_add_id;
|
||||
StubId stub_id = StubId::stubgen_atomic_add_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
Label retry;
|
||||
start = __ pc();
|
||||
@@ -510,7 +510,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address generate_atomic_xchg() {
|
||||
address start;
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::atomic_xchg_id;
|
||||
StubId stub_id = StubId::stubgen_atomic_xchg_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
start = __ pc();
|
||||
Register newval = R0;
|
||||
@@ -561,7 +561,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address generate_atomic_cmpxchg() {
|
||||
address start;
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::atomic_cmpxchg_id;
|
||||
StubId stub_id = StubId::stubgen_atomic_cmpxchg_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
start = __ pc();
|
||||
Register cmp = R0;
|
||||
@@ -600,7 +600,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address generate_atomic_cmpxchg_long() {
|
||||
address start;
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::atomic_cmpxchg_long_id;
|
||||
StubId stub_id = StubId::stubgen_atomic_cmpxchg_long_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
start = __ pc();
|
||||
Register cmp_lo = R0;
|
||||
@@ -638,7 +638,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address generate_atomic_load_long() {
|
||||
address start;
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::atomic_load_long_id;
|
||||
StubId stub_id = StubId::stubgen_atomic_load_long_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
start = __ pc();
|
||||
Register result_lo = R0;
|
||||
@@ -663,7 +663,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address generate_atomic_store_long() {
|
||||
address start;
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::atomic_store_long_id;
|
||||
StubId stub_id = StubId::stubgen_atomic_store_long_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
start = __ pc();
|
||||
Register newval_lo = R0;
|
||||
@@ -706,7 +706,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// raddr: LR, blown by call
|
||||
address generate_partial_subtype_check() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::partial_subtype_check_id;
|
||||
StubId stub_id = StubId::stubgen_partial_subtype_check_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -796,7 +796,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Non-destructive plausibility checks for oops
|
||||
|
||||
address generate_verify_oop() {
|
||||
StubGenStubId stub_id = StubGenStubId::verify_oop_id;
|
||||
StubId stub_id = StubId::stubgen_verify_oop_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -2027,98 +2027,98 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R1
|
||||
// count: R2 treated as signed 32-bit int
|
||||
//
|
||||
address generate_primitive_copy(StubGenStubId stub_id, address nooverlap_target = nullptr) {
|
||||
address generate_primitive_copy(StubId stub_id, address nooverlap_target = nullptr) {
|
||||
bool aligned;
|
||||
bool status;
|
||||
int bytes_per_count;
|
||||
bool disjoint;
|
||||
|
||||
switch (stub_id) {
|
||||
case jbyte_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jbyte_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 1;
|
||||
disjoint = true;
|
||||
break;
|
||||
case jshort_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jshort_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 2;
|
||||
disjoint = true;
|
||||
break;
|
||||
case jint_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jint_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 4;
|
||||
disjoint = true;
|
||||
break;
|
||||
case jlong_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jlong_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 8;
|
||||
disjoint = true;
|
||||
break;
|
||||
case arrayof_jbyte_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jbyte_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
bytes_per_count = 1;
|
||||
disjoint = true;
|
||||
break;
|
||||
case arrayof_jshort_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jshort_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
bytes_per_count = 2;
|
||||
disjoint = true;
|
||||
break;
|
||||
case arrayof_jint_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jint_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
bytes_per_count = 4;
|
||||
disjoint = true;
|
||||
break;
|
||||
case arrayof_jlong_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jlong_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
status = set_status;
|
||||
bytes_per_count = 8;
|
||||
disjoint = true;
|
||||
break;
|
||||
case jbyte_arraycopy_id:
|
||||
case StubId::stubgen_jbyte_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 1;
|
||||
disjoint = false;
|
||||
break;
|
||||
case jshort_arraycopy_id:
|
||||
case StubId::stubgen_jshort_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 2;
|
||||
disjoint = false;
|
||||
break;
|
||||
case jint_arraycopy_id:
|
||||
case StubId::stubgen_jint_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 4;
|
||||
disjoint = false;
|
||||
break;
|
||||
case jlong_arraycopy_id:
|
||||
case StubId::stubgen_jlong_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
bytes_per_count = 8;
|
||||
disjoint = false;
|
||||
break;
|
||||
case arrayof_jbyte_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jbyte_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
bytes_per_count = 1;
|
||||
disjoint = false;
|
||||
break;
|
||||
case arrayof_jshort_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jshort_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
bytes_per_count = 2;
|
||||
disjoint = false;
|
||||
break;
|
||||
case arrayof_jint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jint_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
bytes_per_count = 4;
|
||||
@@ -2301,28 +2301,28 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R1
|
||||
// count: R2 treated as signed 32-bit int
|
||||
//
|
||||
address generate_oop_copy(StubGenStubId stub_id, address nooverlap_target = nullptr) {
|
||||
address generate_oop_copy(StubId stub_id, address nooverlap_target = nullptr) {
|
||||
bool aligned;
|
||||
bool status;
|
||||
bool disjoint;
|
||||
|
||||
switch (stub_id) {
|
||||
case oop_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_oop_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
disjoint = true;
|
||||
break;
|
||||
case arrayof_oop_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_oop_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
disjoint = true;
|
||||
break;
|
||||
case oop_arraycopy_id:
|
||||
case StubId::stubgen_oop_arraycopy_id:
|
||||
aligned = false;
|
||||
status = true;
|
||||
disjoint = false;
|
||||
break;
|
||||
case arrayof_oop_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_oop_arraycopy_id:
|
||||
aligned = true;
|
||||
status = set_status;
|
||||
disjoint = false;
|
||||
@@ -2476,7 +2476,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
const Register R3_bits = R3; // test copy of low bits
|
||||
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::unsafe_arraycopy_id;
|
||||
StubId stub_id = StubId::stubgen_unsafe_arraycopy_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
const Register tmp = Rtemp;
|
||||
@@ -2604,7 +2604,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
//
|
||||
address generate_checkcast_copy() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::checkcast_arraycopy_id;
|
||||
StubId stub_id = StubId::stubgen_checkcast_arraycopy_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -2772,7 +2772,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
const Register R8_temp = R8;
|
||||
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::generic_arraycopy_id;
|
||||
StubId stub_id = StubId::stubgen_generic_arraycopy_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -3008,35 +3008,35 @@ class StubGenerator: public StubCodeGenerator {
|
||||
UnsafeMemoryAccess::set_common_exit_stub_pc(ucm_common_error_exit);
|
||||
|
||||
// these need always status in case they are called from generic_arraycopy
|
||||
StubRoutines::_jbyte_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_jshort_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_jint_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_jlong_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_oop_disjoint_arraycopy = generate_oop_copy (StubGenStubId::oop_disjoint_arraycopy_id);
|
||||
StubRoutines::_jbyte_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_jshort_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_jint_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_jlong_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_oop_disjoint_arraycopy = generate_oop_copy (StubId::stubgen_oop_disjoint_arraycopy_id);
|
||||
|
||||
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_oop_copy (StubGenStubId::arrayof_oop_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_arrayof_jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_arrayof_jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_arrayof_jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_primitive_copy(StubId::stubgen_arrayof_jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_oop_copy (StubId::stubgen_arrayof_oop_disjoint_arraycopy_id);
|
||||
|
||||
// these need always status in case they are called from generic_arraycopy
|
||||
StubRoutines::_jbyte_arraycopy = generate_primitive_copy(StubGenStubId::jbyte_arraycopy_id, StubRoutines::_jbyte_disjoint_arraycopy);
|
||||
StubRoutines::_jshort_arraycopy = generate_primitive_copy(StubGenStubId::jshort_arraycopy_id, StubRoutines::_jshort_disjoint_arraycopy);
|
||||
StubRoutines::_jint_arraycopy = generate_primitive_copy(StubGenStubId::jint_arraycopy_id, StubRoutines::_jint_disjoint_arraycopy);
|
||||
StubRoutines::_jlong_arraycopy = generate_primitive_copy(StubGenStubId::jlong_arraycopy_id, StubRoutines::_jlong_disjoint_arraycopy);
|
||||
StubRoutines::_oop_arraycopy = generate_oop_copy (StubGenStubId::oop_arraycopy_id, StubRoutines::_oop_disjoint_arraycopy);
|
||||
StubRoutines::_jbyte_arraycopy = generate_primitive_copy(StubId::stubgen_jbyte_arraycopy_id, StubRoutines::_jbyte_disjoint_arraycopy);
|
||||
StubRoutines::_jshort_arraycopy = generate_primitive_copy(StubId::stubgen_jshort_arraycopy_id, StubRoutines::_jshort_disjoint_arraycopy);
|
||||
StubRoutines::_jint_arraycopy = generate_primitive_copy(StubId::stubgen_jint_arraycopy_id, StubRoutines::_jint_disjoint_arraycopy);
|
||||
StubRoutines::_jlong_arraycopy = generate_primitive_copy(StubId::stubgen_jlong_arraycopy_id, StubRoutines::_jlong_disjoint_arraycopy);
|
||||
StubRoutines::_oop_arraycopy = generate_oop_copy (StubId::stubgen_oop_arraycopy_id, StubRoutines::_oop_disjoint_arraycopy);
|
||||
|
||||
StubRoutines::_arrayof_jbyte_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jbyte_arraycopy_id, StubRoutines::_arrayof_jbyte_disjoint_arraycopy);
|
||||
StubRoutines::_arrayof_jshort_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jshort_arraycopy_id, StubRoutines::_arrayof_jshort_disjoint_arraycopy);
|
||||
StubRoutines::_arrayof_jbyte_arraycopy = generate_primitive_copy(StubId::stubgen_arrayof_jbyte_arraycopy_id, StubRoutines::_arrayof_jbyte_disjoint_arraycopy);
|
||||
StubRoutines::_arrayof_jshort_arraycopy = generate_primitive_copy(StubId::stubgen_arrayof_jshort_arraycopy_id, StubRoutines::_arrayof_jshort_disjoint_arraycopy);
|
||||
#ifdef _LP64
|
||||
// since sizeof(jint) < sizeof(HeapWord), there's a different flavor:
|
||||
StubRoutines::_arrayof_jint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jint_arraycopy_id, StubRoutines::_arrayof_jint_disjoint_arraycopy);
|
||||
StubRoutines::_arrayof_jint_arraycopy = generate_primitive_copy(StubId::stubgen_arrayof_jint_arraycopy_id, StubRoutines::_arrayof_jint_disjoint_arraycopy);
|
||||
#else
|
||||
StubRoutines::_arrayof_jint_arraycopy = StubRoutines::_jint_arraycopy;
|
||||
#endif
|
||||
if (BytesPerHeapOop < HeapWordSize) {
|
||||
StubRoutines::_arrayof_oop_arraycopy = generate_oop_copy (StubGenStubId::arrayof_oop_arraycopy_id, StubRoutines::_arrayof_oop_disjoint_arraycopy);
|
||||
StubRoutines::_arrayof_oop_arraycopy = generate_oop_copy (StubId::stubgen_arrayof_oop_arraycopy_id, StubRoutines::_arrayof_oop_disjoint_arraycopy);
|
||||
} else {
|
||||
StubRoutines::_arrayof_oop_arraycopy = StubRoutines::_oop_arraycopy;
|
||||
}
|
||||
@@ -3051,7 +3051,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
address generate_method_entry_barrier() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::method_entry_barrier_id;
|
||||
StubId stub_id = StubId::stubgen_method_entry_barrier_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
Label deoptimize_label;
|
||||
@@ -3105,29 +3105,36 @@ class StubGenerator: public StubCodeGenerator {
|
||||
#undef __
|
||||
#define __ masm->
|
||||
|
||||
address generate_cont_thaw(StubGenStubId stub_id) {
|
||||
address generate_cont_thaw(StubId stub_id) {
|
||||
if (!Continuations::enabled()) return nullptr;
|
||||
Unimplemented();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
address generate_cont_thaw() {
|
||||
return generate_cont_thaw(StubGenStubId::cont_thaw_id);
|
||||
return generate_cont_thaw(StubId::stubgen_cont_thaw_id);
|
||||
}
|
||||
|
||||
address generate_cont_returnBarrier() {
|
||||
return generate_cont_thaw(StubGenStubId::cont_returnBarrier_id);
|
||||
return generate_cont_thaw(StubId::stubgen_cont_returnBarrier_id);
|
||||
}
|
||||
|
||||
address generate_cont_returnBarrier_exception() {
|
||||
return generate_cont_thaw(StubGenStubId::cont_returnBarrierExc_id);
|
||||
return generate_cont_thaw(StubId::stubgen_cont_returnBarrierExc_id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Initialization
|
||||
|
||||
void generate_preuniverse_stubs() {
|
||||
// preuniverse stubs are not needed for arm
|
||||
// Atomics are used in universe initialization code (e.g. CDS relocation),
|
||||
// therefore we need to generate real stubs very early on.
|
||||
StubRoutines::_atomic_add_entry = generate_atomic_add();
|
||||
StubRoutines::_atomic_xchg_entry = generate_atomic_xchg();
|
||||
StubRoutines::_atomic_cmpxchg_entry = generate_atomic_cmpxchg();
|
||||
StubRoutines::_atomic_cmpxchg_long_entry = generate_atomic_cmpxchg_long();
|
||||
StubRoutines::Arm::_atomic_load_long_entry = generate_atomic_load_long();
|
||||
StubRoutines::Arm::_atomic_store_long_entry = generate_atomic_store_long();
|
||||
}
|
||||
|
||||
void generate_initial_stubs() {
|
||||
@@ -3151,14 +3158,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
// integer division used both by interpreter and compiler
|
||||
StubRoutines::Arm::_idiv_irem_entry = generate_idiv_irem();
|
||||
|
||||
StubRoutines::_atomic_add_entry = generate_atomic_add();
|
||||
StubRoutines::_atomic_xchg_entry = generate_atomic_xchg();
|
||||
StubRoutines::_atomic_cmpxchg_entry = generate_atomic_cmpxchg();
|
||||
StubRoutines::_atomic_cmpxchg_long_entry = generate_atomic_cmpxchg_long();
|
||||
StubRoutines::Arm::_atomic_load_long_entry = generate_atomic_load_long();
|
||||
StubRoutines::Arm::_atomic_store_long_entry = generate_atomic_store_long();
|
||||
|
||||
}
|
||||
|
||||
void generate_continuation_stubs() {
|
||||
@@ -3203,31 +3202,31 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
|
||||
public:
|
||||
StubGenerator(CodeBuffer* code, StubGenBlobId blob_id) : StubCodeGenerator(code, blob_id) {
|
||||
StubGenerator(CodeBuffer* code, BlobId blob_id) : StubCodeGenerator(code, blob_id) {
|
||||
switch(blob_id) {
|
||||
case preuniverse_id:
|
||||
case BlobId::stubgen_preuniverse_id:
|
||||
generate_preuniverse_stubs();
|
||||
break;
|
||||
case initial_id:
|
||||
case BlobId::stubgen_initial_id:
|
||||
generate_initial_stubs();
|
||||
break;
|
||||
case continuation_id:
|
||||
case BlobId::stubgen_continuation_id:
|
||||
generate_continuation_stubs();
|
||||
break;
|
||||
case compiler_id:
|
||||
case BlobId::stubgen_compiler_id:
|
||||
generate_compiler_stubs();
|
||||
break;
|
||||
case final_id:
|
||||
case BlobId::stubgen_final_id:
|
||||
generate_final_stubs();
|
||||
break;
|
||||
default:
|
||||
fatal("unexpected blob id: %d", blob_id);
|
||||
fatal("unexpected blob id: %s", StubInfo::name(blob_id));
|
||||
break;
|
||||
};
|
||||
}
|
||||
}; // end class declaration
|
||||
|
||||
void StubGenerator_generate(CodeBuffer* code, StubGenBlobId blob_id) {
|
||||
void StubGenerator_generate(CodeBuffer* code, BlobId blob_id) {
|
||||
StubGenerator g(code, blob_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -119,7 +119,7 @@ void aes_init() {
|
||||
|
||||
address generate_aescrypt_encryptBlock() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::aescrypt_encryptBlock_id;
|
||||
StubId stub_id = StubId::stubgen_aescrypt_encryptBlock_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ pc();
|
||||
@@ -317,7 +317,7 @@ address generate_aescrypt_encryptBlock() {
|
||||
|
||||
address generate_aescrypt_decryptBlock() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::aescrypt_decryptBlock_id;
|
||||
StubId stub_id = StubId::stubgen_aescrypt_decryptBlock_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ pc();
|
||||
@@ -538,7 +538,7 @@ address generate_cipherBlockChaining_encryptAESCrypt() {
|
||||
// [sp+4] Transposition Box reference
|
||||
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_encryptAESCrypt_id;
|
||||
StubId stub_id = StubId::stubgen_cipherBlockChaining_encryptAESCrypt_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ pc();
|
||||
@@ -604,7 +604,7 @@ address generate_cipherBlockChaining_encryptAESCrypt() {
|
||||
|
||||
address generate_cipherBlockChaining_decryptAESCrypt() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_decryptAESCrypt_id;
|
||||
StubId stub_id = StubId::stubgen_cipherBlockChaining_decryptAESCrypt_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ pc();
|
||||
|
||||
@@ -757,6 +757,7 @@ class Assembler : public AbstractAssembler {
|
||||
VCTZH_OPCODE = (4u << OPCODE_SHIFT | 29u << 16 | 1538u),
|
||||
VCTZW_OPCODE = (4u << OPCODE_SHIFT | 30u << 16 | 1538u),
|
||||
VCTZD_OPCODE = (4u << OPCODE_SHIFT | 31u << 16 | 1538u),
|
||||
VNEGW_OPCODE = (4u << OPCODE_SHIFT | 6u << 16 | 1538u),
|
||||
|
||||
// Vector Floating-Point
|
||||
// not implemented yet
|
||||
@@ -2372,6 +2373,7 @@ class Assembler : public AbstractAssembler {
|
||||
inline void vctzh( VectorRegister d, VectorRegister b);
|
||||
inline void vctzw( VectorRegister d, VectorRegister b);
|
||||
inline void vctzd( VectorRegister d, VectorRegister b);
|
||||
inline void vnegw( VectorRegister d, VectorRegister b);
|
||||
// Vector Floating-Point not implemented yet
|
||||
inline void mtvscr( VectorRegister b);
|
||||
inline void mfvscr( VectorRegister d);
|
||||
|
||||
@@ -1092,6 +1092,9 @@ inline void Assembler::vctzd( VectorRegister d, VectorRegister b)
|
||||
inline void Assembler::mtvscr( VectorRegister b) { emit_int32( MTVSCR_OPCODE | vrb(b)); }
|
||||
inline void Assembler::mfvscr( VectorRegister d) { emit_int32( MFVSCR_OPCODE | vrt(d)); }
|
||||
|
||||
// Vector Negate Word (introduced with Power 9)
|
||||
inline void Assembler::vnegw( VectorRegister d, VectorRegister b) { emit_int32( VNEGW_OPCODE | vrt(d) | vrb(b)); }
|
||||
|
||||
// AES (introduced with Power 8)
|
||||
inline void Assembler::vcipher( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VCIPHER_OPCODE | vrt(d) | vra(a) | vrb(b)); }
|
||||
inline void Assembler::vcipherlast( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VCIPHERLAST_OPCODE | vrt(d) | vra(a) | vrb(b)); }
|
||||
|
||||
@@ -50,7 +50,7 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
address a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
//__ load_const_optimized(R0, a);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
|
||||
__ mtctr(R0);
|
||||
@@ -61,8 +61,8 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
return;
|
||||
}
|
||||
|
||||
address stub = _throw_index_out_of_bounds_exception ? Runtime1::entry_for(C1StubId::throw_index_exception_id)
|
||||
: Runtime1::entry_for(C1StubId::throw_range_check_failed_id);
|
||||
address stub = _throw_index_out_of_bounds_exception ? Runtime1::entry_for(StubId::c1_throw_index_exception_id)
|
||||
: Runtime1::entry_for(StubId::c1_throw_range_check_failed_id);
|
||||
//__ load_const_optimized(R0, stub);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
|
||||
__ mtctr(R0);
|
||||
@@ -91,7 +91,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
|
||||
|
||||
void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
address a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
//__ load_const_optimized(R0, a);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
|
||||
__ mtctr(R0);
|
||||
@@ -115,7 +115,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
|
||||
__ load_const_optimized(R0, md.value());
|
||||
__ std(R0, -8, R1_SP);
|
||||
|
||||
address a = Runtime1::entry_for(C1StubId::counter_overflow_id);
|
||||
address a = Runtime1::entry_for(StubId::c1_counter_overflow_id);
|
||||
//__ load_const_optimized(R0, a);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
|
||||
__ mtctr(R0);
|
||||
@@ -132,7 +132,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
}
|
||||
__ bind(_entry);
|
||||
address stub = Runtime1::entry_for(C1StubId::throw_div0_exception_id);
|
||||
address stub = Runtime1::entry_for(StubId::c1_throw_div0_exception_id);
|
||||
//__ load_const_optimized(R0, stub);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
|
||||
__ mtctr(R0);
|
||||
@@ -147,9 +147,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
address a;
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
// Deoptimize, do not throw the exception, because it is probably wrong to do it here.
|
||||
a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
} else {
|
||||
a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id);
|
||||
a = Runtime1::entry_for(StubId::c1_throw_null_pointer_exception_id);
|
||||
}
|
||||
|
||||
if (ImplicitNullChecks || TrapBasedNullChecks) {
|
||||
@@ -181,14 +181,14 @@ void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
|
||||
|
||||
|
||||
// Implementation of NewInstanceStub
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) {
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, StubId stub_id) {
|
||||
_result = result;
|
||||
_klass = klass;
|
||||
_klass_reg = klass_reg;
|
||||
_info = new CodeEmitInfo(info);
|
||||
assert(stub_id == C1StubId::new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_init_check_id,
|
||||
assert(stub_id == StubId::c1_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_init_check_id,
|
||||
"need new_instance id");
|
||||
_stub_id = stub_id;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr re
|
||||
void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
|
||||
address entry = Runtime1::entry_for(C1StubId::new_type_array_id);
|
||||
address entry = Runtime1::entry_for(StubId::c1_new_type_array_id);
|
||||
//__ load_const_optimized(R0, entry);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry));
|
||||
__ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended
|
||||
@@ -241,7 +241,7 @@ NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Op
|
||||
void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
|
||||
address entry = Runtime1::entry_for(C1StubId::new_object_array_id);
|
||||
address entry = Runtime1::entry_for(StubId::c1_new_object_array_id);
|
||||
//__ load_const_optimized(R0, entry);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry));
|
||||
__ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended
|
||||
@@ -254,7 +254,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
|
||||
void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? C1StubId::monitorenter_id : C1StubId::monitorenter_nofpu_id);
|
||||
address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? StubId::c1_monitorenter_id : StubId::c1_monitorenter_nofpu_id);
|
||||
//__ load_const_optimized(R0, stub);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
|
||||
__ mr_if_needed(/*scratch_opr()->as_register()*/ R4_ARG2, _obj_reg->as_register());
|
||||
@@ -271,7 +271,7 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) {
|
||||
if (_compute_lock) {
|
||||
ce->monitor_address(_monitor_ix, _lock_reg);
|
||||
}
|
||||
address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? C1StubId::monitorexit_id : C1StubId::monitorexit_nofpu_id);
|
||||
address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? StubId::c1_monitorexit_id : StubId::c1_monitorexit_nofpu_id);
|
||||
//__ load_const_optimized(R0, stub);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
|
||||
assert(_lock_reg->as_register() == R4_ARG2, "");
|
||||
@@ -385,12 +385,12 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
address target = nullptr;
|
||||
relocInfo::relocType reloc_type = relocInfo::none;
|
||||
switch (_id) {
|
||||
case access_field_id: target = Runtime1::entry_for(C1StubId::access_field_patching_id); break;
|
||||
case load_klass_id: target = Runtime1::entry_for(C1StubId::load_klass_patching_id);
|
||||
case access_field_id: target = Runtime1::entry_for(StubId::c1_access_field_patching_id); break;
|
||||
case load_klass_id: target = Runtime1::entry_for(StubId::c1_load_klass_patching_id);
|
||||
reloc_type = relocInfo::metadata_type; break;
|
||||
case load_mirror_id: target = Runtime1::entry_for(C1StubId::load_mirror_patching_id);
|
||||
case load_mirror_id: target = Runtime1::entry_for(StubId::c1_load_mirror_patching_id);
|
||||
reloc_type = relocInfo::oop_type; break;
|
||||
case load_appendix_id: target = Runtime1::entry_for(C1StubId::load_appendix_patching_id);
|
||||
case load_appendix_id: target = Runtime1::entry_for(StubId::c1_load_appendix_patching_id);
|
||||
reloc_type = relocInfo::oop_type; break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
@@ -416,7 +416,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
|
||||
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
address stub = Runtime1::entry_for(C1StubId::deoptimize_id);
|
||||
address stub = Runtime1::entry_for(StubId::c1_deoptimize_id);
|
||||
//__ load_const_optimized(R0, stub);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
|
||||
__ mtctr(R0);
|
||||
|
||||
@@ -191,7 +191,7 @@ int LIR_Assembler::emit_exception_handler() {
|
||||
}
|
||||
|
||||
int offset = code_offset();
|
||||
address entry_point = CAST_FROM_FN_PTR(address, Runtime1::entry_for(C1StubId::handle_exception_from_callee_id));
|
||||
address entry_point = CAST_FROM_FN_PTR(address, Runtime1::entry_for(StubId::c1_handle_exception_from_callee_id));
|
||||
//__ load_const_optimized(R0, entry_point);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry_point));
|
||||
__ mtctr(R0);
|
||||
@@ -241,7 +241,7 @@ int LIR_Assembler::emit_unwind_handler() {
|
||||
}
|
||||
|
||||
// Dispatch to the unwind logic.
|
||||
address unwind_stub = Runtime1::entry_for(C1StubId::unwind_exception_id);
|
||||
address unwind_stub = Runtime1::entry_for(StubId::c1_unwind_exception_id);
|
||||
//__ load_const_optimized(R0, unwind_stub);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(unwind_stub));
|
||||
if (preserve_exception) { __ mr(Rexception, Rexception_save); }
|
||||
@@ -1788,8 +1788,8 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
|
||||
__ calculate_address_from_global_toc(exceptionPC->as_register(), pc_for_athrow, true, true, /*add_relocation*/ true);
|
||||
add_call_info(pc_for_athrow_offset, info); // for exception handler
|
||||
|
||||
address stub = Runtime1::entry_for(compilation()->has_fpu_code() ? C1StubId::handle_exception_id
|
||||
: C1StubId::handle_exception_nofpu_id);
|
||||
address stub = Runtime1::entry_for(compilation()->has_fpu_code() ? StubId::c1_handle_exception_id
|
||||
: StubId::c1_handle_exception_nofpu_id);
|
||||
//__ load_const_optimized(R0, stub);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
|
||||
__ mtctr(R0);
|
||||
@@ -1980,7 +1980,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
__ check_klass_subtype_fast_path(sub_klass, super_klass, tmp, tmp2,
|
||||
&cont, copyfunc_addr != nullptr ? ©func : &slow, nullptr);
|
||||
|
||||
address slow_stc = Runtime1::entry_for(C1StubId::slow_subtype_check_id);
|
||||
address slow_stc = Runtime1::entry_for(StubId::c1_slow_subtype_check_id);
|
||||
//__ load_const_optimized(tmp, slow_stc, tmp2);
|
||||
__ calculate_address_from_global_toc(tmp, slow_stc, true, true, false);
|
||||
__ mtctr(tmp);
|
||||
@@ -2408,7 +2408,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
__ b(*success);
|
||||
} else {
|
||||
// Call out-of-line instance of __ check_klass_subtype_slow_path(...):
|
||||
address entry = Runtime1::entry_for(C1StubId::slow_subtype_check_id);
|
||||
address entry = Runtime1::entry_for(StubId::c1_slow_subtype_check_id);
|
||||
// Stub needs fixed registers (tmp1-3).
|
||||
Register original_k_RInfo = op->tmp1()->as_register();
|
||||
Register original_klass_RInfo = op->tmp2()->as_register();
|
||||
@@ -2499,7 +2499,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, &done, &failure, nullptr);
|
||||
|
||||
// Call out-of-line instance of __ check_klass_subtype_slow_path(...):
|
||||
const address slow_path = Runtime1::entry_for(C1StubId::slow_subtype_check_id);
|
||||
const address slow_path = Runtime1::entry_for(StubId::c1_slow_subtype_check_id);
|
||||
//__ load_const_optimized(R0, slow_path);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(slow_path));
|
||||
__ mtctr(R0);
|
||||
@@ -2801,9 +2801,9 @@ void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest, LIR_Opr tmp) {
|
||||
void LIR_Assembler::rt_call(LIR_Opr result, address dest,
|
||||
const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {
|
||||
// Stubs: Called via rt_call, but dest is a stub address (no FunctionDescriptor).
|
||||
if (dest == Runtime1::entry_for(C1StubId::register_finalizer_id) ||
|
||||
dest == Runtime1::entry_for(C1StubId::new_multi_array_id ) ||
|
||||
dest == Runtime1::entry_for(C1StubId::is_instance_of_id )) {
|
||||
if (dest == Runtime1::entry_for(StubId::c1_register_finalizer_id) ||
|
||||
dest == Runtime1::entry_for(StubId::c1_new_multi_array_id ) ||
|
||||
dest == Runtime1::entry_for(StubId::c1_is_instance_of_id )) {
|
||||
assert(CodeCache::contains(dest), "simplified call is only for special C1 stubs");
|
||||
//__ load_const_optimized(R0, dest);
|
||||
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(dest));
|
||||
|
||||
@@ -976,7 +976,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
|
||||
args->append(rank);
|
||||
args->append(varargs);
|
||||
const LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id),
|
||||
__ call_runtime(Runtime1::entry_for(StubId::c1_new_multi_array_id),
|
||||
LIR_OprFact::illegalOpr,
|
||||
reg, args, info);
|
||||
|
||||
@@ -1011,7 +1011,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
|
||||
if (x->is_incompatible_class_change_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id,
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_incompatible_class_change_error_id,
|
||||
LIR_OprFact::illegalOpr, info_for_exception);
|
||||
} else if (x->is_invokespecial_receiver_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
@@ -1019,7 +1019,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
Deoptimization::Reason_class_check,
|
||||
Deoptimization::Action_none);
|
||||
} else {
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception);
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_class_cast_exception_id, obj.result(), info_for_exception);
|
||||
}
|
||||
// Following registers are used by slow_subtype_check:
|
||||
LIR_Opr tmp1 = FrameMap::R4_oop_opr; // super_klass
|
||||
@@ -1053,7 +1053,7 @@ void LIRGenerator::do_InstanceOf(InstanceOf* x) {
|
||||
|
||||
// Intrinsic for Class::isInstance
|
||||
address LIRGenerator::isInstance_entry() {
|
||||
return Runtime1::entry_for(C1StubId::is_instance_of_id);
|
||||
return Runtime1::entry_for(StubId::c1_is_instance_of_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ void C1_MacroAssembler::explicit_null_check(Register base) {
|
||||
|
||||
|
||||
void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
|
||||
// Avoid stack bang as first instruction. It may get overwritten by patch_verified_entry.
|
||||
const Register return_pc = R20;
|
||||
mflr(return_pc);
|
||||
|
||||
@@ -308,7 +307,7 @@ void C1_MacroAssembler::initialize_object(
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
Unimplemented();
|
||||
// assert(obj == O0, "must be");
|
||||
// call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)),
|
||||
// call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)),
|
||||
// relocInfo::runtime_call_type);
|
||||
}
|
||||
|
||||
@@ -384,7 +383,7 @@ void C1_MacroAssembler::allocate_array(
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
Unimplemented();
|
||||
//assert(obj == O0, "must be");
|
||||
//call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)),
|
||||
//call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)),
|
||||
// relocInfo::runtime_call_type);
|
||||
}
|
||||
|
||||
@@ -413,7 +412,7 @@ void C1_MacroAssembler::null_check(Register r, Label* Lnull) {
|
||||
if (TrapBasedNullChecks) { // SIGTRAP based
|
||||
trap_null_check(r);
|
||||
} else { // explicit
|
||||
//const address exception_entry = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id);
|
||||
//const address exception_entry = Runtime1::entry_for(StubId::c1_throw_null_pointer_exception_id);
|
||||
assert(Lnull != nullptr, "must have Label for explicit check");
|
||||
cmpdi(CR0, r, 0);
|
||||
bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CR0, Assembler::equal), *Lnull);
|
||||
|
||||
@@ -97,12 +97,12 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result,
|
||||
//load_const_optimized(R0, StubRoutines::forward_exception_entry());
|
||||
//mtctr(R0);
|
||||
//bctr();
|
||||
} else if (_stub_id == (int)C1StubId::forward_exception_id) {
|
||||
} else if (_stub_id == (int)StubId::c1_forward_exception_id) {
|
||||
should_not_reach_here();
|
||||
} else {
|
||||
// keep stub frame for next call_RT
|
||||
//load_const_optimized(R0, Runtime1::entry_for(C1StubId::forward_exception_id));
|
||||
add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(Runtime1::entry_for(C1StubId::forward_exception_id)));
|
||||
//load_const_optimized(R0, Runtime1::entry_for(StubId::c1_forward_exception_id));
|
||||
add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(Runtime1::entry_for(StubId::c1_forward_exception_id)));
|
||||
mtctr(R0);
|
||||
bctr();
|
||||
}
|
||||
@@ -391,7 +391,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
|
||||
return oop_maps;
|
||||
}
|
||||
|
||||
OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* Runtime1::generate_code_for(StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* oop_maps = nullptr;
|
||||
|
||||
// For better readability.
|
||||
@@ -400,22 +400,22 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
|
||||
// Stub code & info for the different stubs.
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
{
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_instance_id:
|
||||
case C1StubId::fast_new_instance_id:
|
||||
case C1StubId::fast_new_instance_init_check_id:
|
||||
case StubId::c1_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_init_check_id:
|
||||
{
|
||||
if (id == C1StubId::new_instance_id) {
|
||||
if (id == StubId::c1_new_instance_id) {
|
||||
__ set_info("new_instance", dont_gc_arguments);
|
||||
} else if (id == C1StubId::fast_new_instance_id) {
|
||||
} else if (id == StubId::c1_fast_new_instance_id) {
|
||||
__ set_info("fast new_instance", dont_gc_arguments);
|
||||
} else {
|
||||
assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId");
|
||||
assert(id == StubId::c1_fast_new_instance_init_check_id, "bad StubId");
|
||||
__ set_info("fast new_instance init check", dont_gc_arguments);
|
||||
}
|
||||
|
||||
@@ -425,15 +425,15 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::counter_overflow_id:
|
||||
case StubId::c1_counter_overflow_id:
|
||||
// Bci and method are on stack.
|
||||
oop_maps = stub_call_with_stack_parms(sasm, noreg, CAST_FROM_FN_PTR(address, counter_overflow), 2);
|
||||
break;
|
||||
|
||||
case C1StubId::new_type_array_id:
|
||||
case C1StubId::new_object_array_id:
|
||||
case StubId::c1_new_type_array_id:
|
||||
case StubId::c1_new_object_array_id:
|
||||
{
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
__ set_info("new_type_array", dont_gc_arguments);
|
||||
} else {
|
||||
__ set_info("new_object_array", dont_gc_arguments);
|
||||
@@ -442,7 +442,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
#ifdef ASSERT
|
||||
// Assert object type is really an array of the proper kind.
|
||||
{
|
||||
int tag = (id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value;
|
||||
int tag = (id == StubId::c1_new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value;
|
||||
Label ok;
|
||||
__ lwz(R0, in_bytes(Klass::layout_helper_offset()), R4_ARG2);
|
||||
__ srawi(R0, R0, Klass::_lh_array_tag_shift);
|
||||
@@ -456,7 +456,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
|
||||
// We don't support eden allocation.
|
||||
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_type_array), R4_ARG2, R5_ARG3);
|
||||
} else {
|
||||
oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_object_array), R4_ARG2, R5_ARG3);
|
||||
@@ -464,7 +464,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_multi_array_id:
|
||||
case StubId::c1_new_multi_array_id:
|
||||
{
|
||||
// R4: klass
|
||||
// R5: rank
|
||||
@@ -474,7 +474,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::register_finalizer_id:
|
||||
case StubId::c1_register_finalizer_id:
|
||||
{
|
||||
__ set_info("register_finalizer", dont_gc_arguments);
|
||||
// This code is called via rt_call. Hence, caller-save registers have been saved.
|
||||
@@ -504,50 +504,50 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_range_check_failed_id:
|
||||
case StubId::c1_throw_range_check_failed_id:
|
||||
{
|
||||
__ set_info("range_check_failed", dont_gc_arguments); // Arguments will be discarded.
|
||||
oop_maps = generate_exception_throw_with_stack_parms(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_index_exception_id:
|
||||
case StubId::c1_throw_index_exception_id:
|
||||
{
|
||||
__ set_info("index_range_check_failed", dont_gc_arguments); // Arguments will be discarded.
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_div0_exception_id:
|
||||
case StubId::c1_throw_div0_exception_id:
|
||||
{
|
||||
__ set_info("throw_div0_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_null_pointer_exception_id:
|
||||
case StubId::c1_throw_null_pointer_exception_id:
|
||||
{
|
||||
__ set_info("throw_null_pointer_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
{
|
||||
__ set_info("handle_exception", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
{
|
||||
__ set_info("handle_exception_from_callee", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::unwind_exception_id:
|
||||
case StubId::c1_unwind_exception_id:
|
||||
{
|
||||
const Register Rexception = R3 /*LIRGenerator::exceptionOopOpr()*/,
|
||||
Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/,
|
||||
@@ -575,28 +575,28 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_array_store_exception_id:
|
||||
case StubId::c1_throw_array_store_exception_id:
|
||||
{
|
||||
__ set_info("throw_array_store_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_class_cast_exception_id:
|
||||
case StubId::c1_throw_class_cast_exception_id:
|
||||
{
|
||||
__ set_info("throw_class_cast_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_incompatible_class_change_error_id:
|
||||
case StubId::c1_throw_incompatible_class_change_error_id:
|
||||
{
|
||||
__ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::slow_subtype_check_id:
|
||||
case StubId::c1_slow_subtype_check_id:
|
||||
{ // Support for uint StubRoutine::partial_subtype_check( Klass sub, Klass super );
|
||||
const Register sub_klass = R5,
|
||||
super_klass = R4,
|
||||
@@ -607,7 +607,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::is_instance_of_id:
|
||||
case StubId::c1_is_instance_of_id:
|
||||
{
|
||||
// Called like a C function, but without FunctionDescriptor (see LIR_Assembler::rt_call).
|
||||
|
||||
@@ -674,12 +674,12 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorenter_nofpu_id:
|
||||
case C1StubId::monitorenter_id:
|
||||
case StubId::c1_monitorenter_nofpu_id:
|
||||
case StubId::c1_monitorenter_id:
|
||||
{
|
||||
__ set_info("monitorenter", dont_gc_arguments);
|
||||
|
||||
int save_fpu_registers = (id == C1StubId::monitorenter_id);
|
||||
int save_fpu_registers = (id == StubId::c1_monitorenter_id);
|
||||
// Make a frame and preserve the caller's caller-save registers.
|
||||
OopMap* oop_map = save_live_registers(sasm, save_fpu_registers);
|
||||
|
||||
@@ -693,15 +693,15 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorexit_nofpu_id:
|
||||
case C1StubId::monitorexit_id:
|
||||
case StubId::c1_monitorexit_nofpu_id:
|
||||
case StubId::c1_monitorexit_id:
|
||||
{
|
||||
// note: Really a leaf routine but must setup last java sp
|
||||
// => use call_RT for now (speed can be improved by
|
||||
// doing last java sp setup manually).
|
||||
__ set_info("monitorexit", dont_gc_arguments);
|
||||
|
||||
int save_fpu_registers = (id == C1StubId::monitorexit_id);
|
||||
int save_fpu_registers = (id == StubId::c1_monitorexit_id);
|
||||
// Make a frame and preserve the caller's caller-save registers.
|
||||
OopMap* oop_map = save_live_registers(sasm, save_fpu_registers);
|
||||
|
||||
@@ -715,7 +715,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::deoptimize_id:
|
||||
case StubId::c1_deoptimize_id:
|
||||
{
|
||||
__ set_info("deoptimize", dont_gc_arguments);
|
||||
__ std(R0, -8, R1_SP); // Pass trap_request on stack.
|
||||
@@ -731,35 +731,35 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::access_field_patching_id:
|
||||
case StubId::c1_access_field_patching_id:
|
||||
{
|
||||
__ set_info("access_field_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_klass_patching_id:
|
||||
case StubId::c1_load_klass_patching_id:
|
||||
{
|
||||
__ set_info("load_klass_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_mirror_patching_id:
|
||||
case StubId::c1_load_mirror_patching_id:
|
||||
{
|
||||
__ set_info("load_mirror_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_appendix_patching_id:
|
||||
case StubId::c1_load_appendix_patching_id:
|
||||
{
|
||||
__ set_info("load_appendix_patching", dont_gc_arguments);
|
||||
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching));
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::dtrace_object_alloc_id:
|
||||
case StubId::c1_dtrace_object_alloc_id:
|
||||
{ // O0: object
|
||||
__ unimplemented("stub dtrace_object_alloc_id");
|
||||
__ set_info("dtrace_object_alloc", dont_gc_arguments);
|
||||
@@ -779,7 +779,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::predicate_failed_trap_id:
|
||||
case StubId::c1_predicate_failed_trap_id:
|
||||
{
|
||||
__ set_info("predicate_failed_trap", dont_gc_arguments);
|
||||
OopMap* oop_map = save_live_registers(sasm);
|
||||
@@ -823,7 +823,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
|
||||
|
||||
OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler* sasm) {
|
||||
__ block_comment("generate_handle_exception");
|
||||
|
||||
// Save registers, if required.
|
||||
@@ -833,7 +833,7 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm)
|
||||
Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/;
|
||||
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
// We're handling an exception in the context of a compiled frame.
|
||||
// The registers have been saved in the standard places. Perform
|
||||
// an exception lookup in the caller and dispatch to the handler
|
||||
@@ -849,12 +849,12 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm)
|
||||
__ ld(Rexception_pc, _abi0(lr), Rexception_pc);
|
||||
__ std(R0, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
|
||||
break;
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
// At this point all registers MAY be live.
|
||||
oop_map = save_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id, Rexception_pc);
|
||||
oop_map = save_live_registers(sasm, id != StubId::c1_handle_exception_nofpu_id, Rexception_pc);
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
// At this point all registers except exception oop and exception pc are dead.
|
||||
oop_map = new OopMap(frame_size_in_bytes / sizeof(jint), 0);
|
||||
sasm->set_frame_size(frame_size_in_bytes / BytesPerWord);
|
||||
@@ -893,13 +893,13 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm)
|
||||
// Restore the registers that were saved at the beginning, remove
|
||||
// the frame and jump to the exception handler.
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
restore_live_registers(sasm, noreg, noreg, id != C1StubId::handle_exception_nofpu_id);
|
||||
case StubId::c1_forward_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
restore_live_registers(sasm, noreg, noreg, id != StubId::c1_handle_exception_nofpu_id);
|
||||
__ bctr();
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id: {
|
||||
case StubId::c1_handle_exception_from_callee_id: {
|
||||
__ pop_frame();
|
||||
__ ld(Rexception_pc, _abi0(lr), R1_SP);
|
||||
__ mtlr(Rexception_pc);
|
||||
|
||||
@@ -3928,8 +3928,10 @@ void MacroAssembler::kernel_crc32_vpmsum_aligned(Register crc, Register buf, Reg
|
||||
Label L_outer_loop, L_inner_loop, L_last;
|
||||
|
||||
// Set DSCR pre-fetch to deepest.
|
||||
load_const_optimized(t0, VM_Version::_dscr_val | 7);
|
||||
mtdscr(t0);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
load_const_optimized(t0, VM_Version::_dscr_val | 7);
|
||||
mtdscr(t0);
|
||||
}
|
||||
|
||||
mtvrwz(VCRC, crc); // crc lives in VCRC, now
|
||||
|
||||
@@ -4073,8 +4075,10 @@ void MacroAssembler::kernel_crc32_vpmsum_aligned(Register crc, Register buf, Reg
|
||||
// ********** Main loop end **********
|
||||
|
||||
// Restore DSCR pre-fetch value.
|
||||
load_const_optimized(t0, VM_Version::_dscr_val);
|
||||
mtdscr(t0);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
load_const_optimized(t0, VM_Version::_dscr_val);
|
||||
mtdscr(t0);
|
||||
}
|
||||
|
||||
// ********** Simple loop for remaining 16 byte blocks **********
|
||||
{
|
||||
|
||||
@@ -39,18 +39,6 @@
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#endif
|
||||
|
||||
// We use an illtrap for marking a method as not_entrant
|
||||
// Work around a C++ compiler bug which changes 'this'
|
||||
bool NativeInstruction::is_sigill_not_entrant_at(address addr) {
|
||||
if (!Assembler::is_illtrap(addr)) return false;
|
||||
CodeBlob* cb = CodeCache::find_blob(addr);
|
||||
if (cb == nullptr || !cb->is_nmethod()) return false;
|
||||
nmethod *nm = (nmethod *)cb;
|
||||
// This method is not_entrant iff the illtrap instruction is
|
||||
// located at the verified entry point.
|
||||
return nm->verified_entry_point() == addr;
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
void NativeInstruction::verify() {
|
||||
// Make sure code pattern is actually an instruction address.
|
||||
@@ -331,25 +319,6 @@ void NativeMovConstReg::verify() {
|
||||
}
|
||||
#endif // ASSERT
|
||||
|
||||
void NativeJump::patch_verified_entry(address entry, address verified_entry, address dest) {
|
||||
ResourceMark rm;
|
||||
int code_size = 1 * BytesPerInstWord;
|
||||
CodeBuffer cb(verified_entry, code_size + 1);
|
||||
MacroAssembler* a = new MacroAssembler(&cb);
|
||||
#ifdef COMPILER2
|
||||
assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "expected fixed destination of patch");
|
||||
#endif
|
||||
// Patch this nmethod atomically. Always use illtrap/trap in debug build.
|
||||
if (DEBUG_ONLY(false &&) a->is_within_range_of_b(dest, a->pc())) {
|
||||
a->b(dest);
|
||||
} else {
|
||||
// The signal handler will continue at dest=OptoRuntime::handle_wrong_method_stub().
|
||||
// We use an illtrap for marking a method as not_entrant.
|
||||
a->illtrap();
|
||||
}
|
||||
ICache::ppc64_flush_icache_bytes(verified_entry, code_size);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
void NativeJump::verify() {
|
||||
address addr = addr_at(0);
|
||||
@@ -462,9 +431,7 @@ bool NativeDeoptInstruction::is_deopt_at(address code_pos) {
|
||||
if (!Assembler::is_illtrap(code_pos)) return false;
|
||||
CodeBlob* cb = CodeCache::find_blob(code_pos);
|
||||
if (cb == nullptr || !cb->is_nmethod()) return false;
|
||||
nmethod *nm = (nmethod *)cb;
|
||||
// see NativeInstruction::is_sigill_not_entrant_at()
|
||||
return nm->verified_entry_point() != code_pos;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Inserts an instruction which is specified to cause a SIGILL at a given pc
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -69,13 +69,6 @@ class NativeInstruction {
|
||||
return MacroAssembler::tdi_get_si16(long_at(0), Assembler::traptoUnconditional, 0);
|
||||
}
|
||||
|
||||
// We use an illtrap for marking a method as not_entrant.
|
||||
bool is_sigill_not_entrant() {
|
||||
// Work around a C++ compiler bug which changes 'this'.
|
||||
return NativeInstruction::is_sigill_not_entrant_at(addr_at(0));
|
||||
}
|
||||
static bool is_sigill_not_entrant_at(address addr);
|
||||
|
||||
#ifdef COMPILER2
|
||||
// SIGTRAP-based implicit range checks
|
||||
bool is_sigtrap_range_check() {
|
||||
@@ -328,15 +321,7 @@ class NativeJump: public NativeInstruction {
|
||||
}
|
||||
}
|
||||
|
||||
// MT-safe insertion of native jump at verified method entry
|
||||
static void patch_verified_entry(address entry, address verified_entry, address dest);
|
||||
|
||||
void verify() NOT_DEBUG_RETURN;
|
||||
|
||||
static void check_verified_entry_alignment(address entry, address verified_entry) {
|
||||
// We just patch one instruction on ppc64, so the jump doesn't have to
|
||||
// be aligned. Nothing to do here.
|
||||
}
|
||||
};
|
||||
|
||||
// Instantiates a NativeJump object starting at the given instruction
|
||||
|
||||
@@ -1493,12 +1493,7 @@ void MachPrologNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
|
||||
const Register toc_temp = R23;
|
||||
assert_different_registers(R11, return_pc, callers_sp, push_frame_temp, toc_temp);
|
||||
|
||||
if (method_is_frameless) {
|
||||
// Add nop at beginning of all frameless methods to prevent any
|
||||
// oop instructions from getting overwritten by make_not_entrant
|
||||
// (patching attempt would fail).
|
||||
__ nop();
|
||||
} else {
|
||||
if (!method_is_frameless) {
|
||||
// Get return pc.
|
||||
__ mflr(return_pc);
|
||||
}
|
||||
@@ -2198,6 +2193,7 @@ bool Matcher::match_rule_supported(int opcode) {
|
||||
case Op_DivVD:
|
||||
case Op_AbsVF:
|
||||
case Op_AbsVD:
|
||||
case Op_NegVI:
|
||||
case Op_NegVF:
|
||||
case Op_NegVD:
|
||||
case Op_SqrtVF:
|
||||
@@ -2208,6 +2204,8 @@ bool Matcher::match_rule_supported(int opcode) {
|
||||
case Op_RoundDoubleModeV:
|
||||
case Op_MinV:
|
||||
case Op_MaxV:
|
||||
case Op_UMinV:
|
||||
case Op_UMaxV:
|
||||
case Op_AndV:
|
||||
case Op_OrV:
|
||||
case Op_XorV:
|
||||
@@ -2273,7 +2271,11 @@ bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType bt) {
|
||||
// MaxV, MinV need types == INT || LONG.
|
||||
case Op_MaxV:
|
||||
case Op_MinV:
|
||||
case Op_UMinV:
|
||||
case Op_UMaxV:
|
||||
return bt == T_INT || bt == T_LONG;
|
||||
case Op_NegVI:
|
||||
return PowerArchitecturePPC64 >= 9 && bt == T_INT;
|
||||
}
|
||||
return true; // Per default match rules are supported.
|
||||
}
|
||||
@@ -8427,6 +8429,18 @@ instruct mulHighL_reg_reg(iRegLdst dst, iRegLsrc src1, iRegLsrc src2) %{
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct uMulHighL_reg_reg(iRegLdst dst, iRegLsrc src1, iRegLsrc src2) %{
|
||||
match(Set dst (UMulHiL src1 src2));
|
||||
ins_cost(DEFAULT_COST);
|
||||
|
||||
format %{ "MULHDU $dst $src1, $src2 \t// unsigned long" %}
|
||||
size(4);
|
||||
ins_encode %{
|
||||
__ mulhdu($dst$$Register, $src1$$Register, $src2$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
// Immediate Multiplication
|
||||
instruct mulL_reg_imm16(iRegLdst dst, iRegLsrc src1, immL16 src2) %{
|
||||
match(Set dst (MulL src1 src2));
|
||||
@@ -10788,6 +10802,36 @@ instruct cmpL3_reg_reg(iRegIdst dst, iRegLsrc src1, iRegLsrc src2, flagsRegCR0 c
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct cmpU3_reg_reg(iRegIdst dst, iRegIsrc src1, iRegIsrc src2, flagsRegCR0 cr0) %{
|
||||
match(Set dst (CmpU3 src1 src2));
|
||||
effect(KILL cr0);
|
||||
ins_cost(DEFAULT_COST * 5);
|
||||
size((VM_Version::has_brw() ? 16 : 20));
|
||||
|
||||
format %{ "cmpU3_reg_reg $dst, $src1, $src2" %}
|
||||
|
||||
ins_encode %{
|
||||
__ cmplw(CR0, $src1$$Register, $src2$$Register);
|
||||
__ set_cmp3($dst$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct cmpUL3_reg_reg(iRegIdst dst, iRegLsrc src1, iRegLsrc src2, flagsRegCR0 cr0) %{
|
||||
match(Set dst (CmpUL3 src1 src2));
|
||||
effect(KILL cr0);
|
||||
ins_cost(DEFAULT_COST * 5);
|
||||
size((VM_Version::has_brw() ? 16 : 20));
|
||||
|
||||
format %{ "cmpUL3_reg_reg $dst, $src1, $src2" %}
|
||||
|
||||
ins_encode %{
|
||||
__ cmpld(CR0, $src1$$Register, $src2$$Register);
|
||||
__ set_cmp3($dst$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
// Implicit range checks.
|
||||
// A range check in the ideal world has one of the following shapes:
|
||||
// - (If le (CmpU length index)), (IfTrue throw exception)
|
||||
@@ -13352,6 +13396,46 @@ instruct vmax_reg(vecX dst, vecX src1, vecX src2) %{
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct vminu_reg(vecX dst, vecX src1, vecX src2) %{
|
||||
match(Set dst (UMinV src1 src2));
|
||||
format %{ "VMINU $dst,$src1,$src2\t// vector unsigned min" %}
|
||||
size(4);
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
switch (bt) {
|
||||
case T_INT:
|
||||
__ vminuw($dst$$VectorRegister, $src1$$VectorRegister, $src2$$VectorRegister);
|
||||
break;
|
||||
case T_LONG:
|
||||
__ vminud($dst$$VectorRegister, $src1$$VectorRegister, $src2$$VectorRegister);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct vmaxu_reg(vecX dst, vecX src1, vecX src2) %{
|
||||
match(Set dst (UMaxV src1 src2));
|
||||
format %{ "VMAXU $dst,$src1,$src2\t// vector unsigned max" %}
|
||||
size(4);
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this);
|
||||
switch (bt) {
|
||||
case T_INT:
|
||||
__ vmaxuw($dst$$VectorRegister, $src1$$VectorRegister, $src2$$VectorRegister);
|
||||
break;
|
||||
case T_LONG:
|
||||
__ vmaxud($dst$$VectorRegister, $src1$$VectorRegister, $src2$$VectorRegister);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct vand(vecX dst, vecX src1, vecX src2) %{
|
||||
match(Set dst (AndV src1 src2));
|
||||
size(4);
|
||||
@@ -13512,6 +13596,17 @@ instruct vneg2D_reg(vecX dst, vecX src) %{
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
instruct vneg4I_reg(vecX dst, vecX src) %{
|
||||
match(Set dst (NegVI src));
|
||||
predicate(PowerArchitecturePPC64 >= 9 && Matcher::vector_element_basic_type(n) == T_INT);
|
||||
format %{ "VNEGW $dst,$src\t// negate int vector" %}
|
||||
size(4);
|
||||
ins_encode %{
|
||||
__ vnegw($dst$$VectorRegister, $src$$VectorRegister);
|
||||
%}
|
||||
ins_pipe(pipe_class_default);
|
||||
%}
|
||||
|
||||
// Vector Square Root Instructions
|
||||
|
||||
instruct vsqrt4F_reg(vecX dst, vecX src) %{
|
||||
|
||||
@@ -71,7 +71,7 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
|
||||
// Allocate space for the code.
|
||||
ResourceMark rm;
|
||||
// Setup code generation tools.
|
||||
const char* name = OptoRuntime::stub_name(OptoStubId::exception_id);
|
||||
const char* name = OptoRuntime::stub_name(StubId::c2_exception_id);
|
||||
CodeBuffer buffer(name, 2048, 1024);
|
||||
if (buffer.blob() == nullptr) {
|
||||
return nullptr;
|
||||
|
||||
@@ -2947,7 +2947,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
// Allocate space for the code
|
||||
ResourceMark rm;
|
||||
// Setup code generation tools
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_deopt_id);
|
||||
CodeBuffer buffer(name, 2048, 1024);
|
||||
InterpreterMacroAssembler* masm = new InterpreterMacroAssembler(&buffer);
|
||||
Label exec_mode_initialized;
|
||||
@@ -3170,7 +3170,7 @@ UncommonTrapBlob* OptoRuntime::generate_uncommon_trap_blob() {
|
||||
// Allocate space for the code.
|
||||
ResourceMark rm;
|
||||
// Setup code generation tools.
|
||||
const char* name = OptoRuntime::stub_name(OptoStubId::uncommon_trap_id);
|
||||
const char* name = OptoRuntime::stub_name(StubId::c2_uncommon_trap_id);
|
||||
CodeBuffer buffer(name, 2048, 1024);
|
||||
if (buffer.blob() == nullptr) {
|
||||
return nullptr;
|
||||
@@ -3302,7 +3302,7 @@ UncommonTrapBlob* OptoRuntime::generate_uncommon_trap_blob() {
|
||||
#endif // COMPILER2
|
||||
|
||||
// Generate a special Compile2Runtime blob that saves all registers, and setup oopmap.
|
||||
SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address call_ptr) {
|
||||
SafepointBlob* SharedRuntime::generate_handler_blob(StubId id, address call_ptr) {
|
||||
assert(StubRoutines::forward_exception_entry() != nullptr,
|
||||
"must be generated before");
|
||||
assert(is_polling_page_id(id), "expected a polling page stub id");
|
||||
@@ -3320,7 +3320,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
int frame_size_in_bytes = 0;
|
||||
|
||||
RegisterSaver::ReturnPCLocation return_pc_location;
|
||||
bool cause_return = (id == SharedStubId::polling_page_return_handler_id);
|
||||
bool cause_return = (id == StubId::shared_polling_page_return_handler_id);
|
||||
if (cause_return) {
|
||||
// Nothing to do here. The frame has already been popped in MachEpilogNode.
|
||||
// Register LR already contains the return pc.
|
||||
@@ -3330,7 +3330,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
return_pc_location = RegisterSaver::return_pc_is_thread_saved_exception_pc;
|
||||
}
|
||||
|
||||
bool save_vectors = (id == SharedStubId::polling_page_vectors_safepoint_handler_id);
|
||||
bool save_vectors = (id == StubId::shared_polling_page_vectors_safepoint_handler_id);
|
||||
|
||||
// Save registers, fpu state, and flags. Set R31 = return pc.
|
||||
map = RegisterSaver::push_frame_reg_args_and_save_live_registers(masm,
|
||||
@@ -3417,7 +3417,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
|
||||
// but since this is generic code we don't know what they are and the caller
|
||||
// must do any gc of the args.
|
||||
//
|
||||
RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address destination) {
|
||||
RuntimeStub* SharedRuntime::generate_resolve_blob(StubId id, address destination) {
|
||||
assert(is_resolve_id(id), "expected a resolve stub id");
|
||||
|
||||
// allocate space for the code
|
||||
@@ -3521,7 +3521,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti
|
||||
// Note: the routine set_pc_not_at_call_for_caller in
|
||||
// SharedRuntime.cpp requires that this code be generated into a
|
||||
// RuntimeStub.
|
||||
RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address runtime_entry) {
|
||||
RuntimeStub* SharedRuntime::generate_throw_exception(StubId id, address runtime_entry) {
|
||||
assert(is_throw_id(id), "expected a throw stub id");
|
||||
|
||||
const char* name = SharedRuntime::stub_name(id);
|
||||
@@ -3844,7 +3844,7 @@ void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints,
|
||||
// It returns a jobject handle to the event writer.
|
||||
// The handle is dereferenced and the return value is the event writer oop.
|
||||
RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_write_checkpoint_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_jfr_write_checkpoint_id);
|
||||
CodeBuffer code(name, 512, 64);
|
||||
MacroAssembler* masm = new MacroAssembler(&code);
|
||||
|
||||
@@ -3881,7 +3881,7 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
|
||||
|
||||
// For c2: call to return a leased buffer.
|
||||
RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
|
||||
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_return_lease_id);
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_jfr_return_lease_id);
|
||||
CodeBuffer code(name, 512, 64);
|
||||
MacroAssembler* masm = new MacroAssembler(&code);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Setup a new c frame, copy java arguments, call template interpreter or
|
||||
// native_entry, and process result.
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::call_stub_id;
|
||||
StubId stub_id = StubId::stubgen_call_stub_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ function_entry();
|
||||
@@ -365,7 +365,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// within the VM.
|
||||
//
|
||||
address generate_catch_exception() {
|
||||
StubGenStubId stub_id = StubGenStubId::catch_exception_id;
|
||||
StubId stub_id = StubId::stubgen_catch_exception_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ pc();
|
||||
@@ -421,7 +421,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// (LR is unchanged and is live out).
|
||||
//
|
||||
address generate_forward_exception() {
|
||||
StubGenStubId stub_id = StubGenStubId::forward_exception_id;
|
||||
StubId stub_id = StubId::stubgen_forward_exception_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -706,32 +706,32 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// value: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_fill(StubGenStubId stub_id) {
|
||||
address generate_fill(StubId stub_id) {
|
||||
BasicType t;
|
||||
bool aligned;
|
||||
|
||||
switch (stub_id) {
|
||||
case jbyte_fill_id:
|
||||
case StubId::stubgen_jbyte_fill_id:
|
||||
t = T_BYTE;
|
||||
aligned = false;
|
||||
break;
|
||||
case jshort_fill_id:
|
||||
case StubId::stubgen_jshort_fill_id:
|
||||
t = T_SHORT;
|
||||
aligned = false;
|
||||
break;
|
||||
case jint_fill_id:
|
||||
case StubId::stubgen_jint_fill_id:
|
||||
t = T_INT;
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jbyte_fill_id:
|
||||
case StubId::stubgen_arrayof_jbyte_fill_id:
|
||||
t = T_BYTE;
|
||||
aligned = true;
|
||||
break;
|
||||
case arrayof_jshort_fill_id:
|
||||
case StubId::stubgen_arrayof_jshort_fill_id:
|
||||
t = T_SHORT;
|
||||
aligned = true;
|
||||
break;
|
||||
case arrayof_jint_fill_id:
|
||||
case StubId::stubgen_arrayof_jint_fill_id:
|
||||
t = T_INT;
|
||||
aligned = true;
|
||||
break;
|
||||
@@ -952,8 +952,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address start_pc = __ pc();
|
||||
Register tmp1 = R6_ARG4;
|
||||
// probably copy stub would have changed value reset it.
|
||||
__ load_const_optimized(tmp1, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp1);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp1, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp1);
|
||||
}
|
||||
__ li(R3_RET, 0); // return 0
|
||||
__ blr();
|
||||
return start_pc;
|
||||
@@ -982,13 +984,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_disjoint_byte_copy(StubGenStubId stub_id) {
|
||||
address generate_disjoint_byte_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jbyte_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jbyte_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jbyte_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jbyte_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1070,9 +1072,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ dcbt(R3_ARG1, 0);
|
||||
|
||||
// If supported set DSCR pre-fetch to deepest.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
__ li(tmp1, 16);
|
||||
|
||||
// Backbranch target aligned to 32-byte. Not 16-byte align as
|
||||
@@ -1092,8 +1095,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ bdnz(l_10); // Dec CTR and loop if not zero.
|
||||
|
||||
// Restore DSCR pre-fetch value.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
|
||||
} // FasterArrayCopy
|
||||
|
||||
@@ -1149,13 +1154,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_conjoint_byte_copy(StubGenStubId stub_id) {
|
||||
address generate_conjoint_byte_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jbyte_arraycopy_id:
|
||||
case StubId::stubgen_jbyte_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jbyte_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jbyte_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1250,13 +1255,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
//
|
||||
// 1. check if aligning the backbranch target of loops is beneficial
|
||||
//
|
||||
address generate_disjoint_short_copy(StubGenStubId stub_id) {
|
||||
address generate_disjoint_short_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jshort_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jshort_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jshort_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jshort_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1344,8 +1349,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ dcbt(R3_ARG1, 0);
|
||||
|
||||
// If supported set DSCR pre-fetch to deepest.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
__ li(tmp1, 16);
|
||||
|
||||
// Backbranch target aligned to 32-byte. It's not aligned 16-byte
|
||||
@@ -1365,8 +1372,11 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ bdnz(l_9); // Dec CTR and loop if not zero.
|
||||
|
||||
// Restore DSCR pre-fetch value.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
|
||||
} // FasterArrayCopy
|
||||
__ bind(l_6);
|
||||
|
||||
@@ -1422,13 +1432,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_conjoint_short_copy(StubGenStubId stub_id) {
|
||||
address generate_conjoint_short_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jshort_arraycopy_id:
|
||||
case StubId::stubgen_jshort_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jshort_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jshort_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1527,9 +1537,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ dcbt(R3_ARG1, 0);
|
||||
|
||||
// Set DSCR pre-fetch to deepest.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
__ li(tmp1, 16);
|
||||
|
||||
// Backbranch target aligned to 32-byte. Not 16-byte align as
|
||||
@@ -1549,9 +1560,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ bdnz(l_7); // Dec CTR and loop if not zero.
|
||||
|
||||
// Restore DSCR pre-fetch value.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
|
||||
} // FasterArrayCopy
|
||||
|
||||
@@ -1583,13 +1595,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_disjoint_int_copy(StubGenStubId stub_id) {
|
||||
address generate_disjoint_int_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jint_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jint_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jint_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jint_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1672,9 +1684,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ dcbt(R3_ARG1, 0);
|
||||
|
||||
// Set DSCR pre-fetch to deepest.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
__ li(tmp1, 16);
|
||||
|
||||
// Backbranch target aligned to 32-byte. Not 16-byte align as
|
||||
@@ -1694,8 +1707,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ bdnz(l_4);
|
||||
|
||||
// Restore DSCR pre-fetch value.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
|
||||
__ cmpwi(CR0, R5_ARG3, 0);
|
||||
__ beq(CR0, l_6);
|
||||
@@ -1721,13 +1736,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_conjoint_int_copy(StubGenStubId stub_id) {
|
||||
address generate_conjoint_int_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jint_arraycopy_id:
|
||||
case StubId::stubgen_jint_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jint_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1788,9 +1803,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ dcbt(R3_ARG1, 0);
|
||||
|
||||
// Set DSCR pre-fetch to deepest.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
__ li(tmp1, 16);
|
||||
|
||||
// Backbranch target aligned to 32-byte. Not 16-byte align as
|
||||
@@ -1810,8 +1826,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ bdnz(l_5); // Dec CTR and loop if not zero.
|
||||
|
||||
// Restore DSCR pre-fetch value.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
|
||||
} // FasterArrayCopy
|
||||
|
||||
@@ -1842,13 +1860,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_disjoint_long_copy(StubGenStubId stub_id) {
|
||||
address generate_disjoint_long_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jlong_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_jlong_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jlong_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jlong_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1910,9 +1928,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ dcbt(R3_ARG1, 0);
|
||||
|
||||
// Set DSCR pre-fetch to deepest.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val | 7);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
__ li(tmp1, 16);
|
||||
|
||||
// Backbranch target aligned to 32-byte. Not 16-byte align as
|
||||
@@ -1932,8 +1951,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ bdnz(l_4);
|
||||
|
||||
// Restore DSCR pre-fetch value.
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
__ load_const_optimized(tmp2, VM_Version::_dscr_val);
|
||||
__ mtdscr(tmp2);
|
||||
}
|
||||
|
||||
__ cmpwi(CR0, R5_ARG3, 0);
|
||||
__ beq(CR0, l_1);
|
||||
@@ -1959,13 +1980,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// to: R4_ARG2
|
||||
// count: R5_ARG3 treated as signed
|
||||
//
|
||||
address generate_conjoint_long_copy(StubGenStubId stub_id) {
|
||||
address generate_conjoint_long_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
switch (stub_id) {
|
||||
case jlong_arraycopy_id:
|
||||
case StubId::stubgen_jlong_arraycopy_id:
|
||||
aligned = false;
|
||||
break;
|
||||
case arrayof_jlong_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_jlong_arraycopy_id:
|
||||
aligned = true;
|
||||
break;
|
||||
default:
|
||||
@@ -2000,23 +2021,23 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// count: R5_ARG3 treated as signed
|
||||
// dest_uninitialized: G1 support
|
||||
//
|
||||
address generate_conjoint_oop_copy(StubGenStubId stub_id) {
|
||||
address generate_conjoint_oop_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
bool dest_uninitialized;
|
||||
switch (stub_id) {
|
||||
case oop_arraycopy_id:
|
||||
case StubId::stubgen_oop_arraycopy_id:
|
||||
aligned = false;
|
||||
dest_uninitialized = false;
|
||||
break;
|
||||
case arrayof_oop_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_oop_arraycopy_id:
|
||||
aligned = true;
|
||||
dest_uninitialized = false;
|
||||
break;
|
||||
case oop_arraycopy_uninit_id:
|
||||
case StubId::stubgen_oop_arraycopy_uninit_id:
|
||||
aligned = false;
|
||||
dest_uninitialized = true;
|
||||
break;
|
||||
case arrayof_oop_arraycopy_uninit_id:
|
||||
case StubId::stubgen_arrayof_oop_arraycopy_uninit_id:
|
||||
aligned = true;
|
||||
dest_uninitialized = true;
|
||||
break;
|
||||
@@ -2071,23 +2092,23 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// count: R5_ARG3 treated as signed
|
||||
// dest_uninitialized: G1 support
|
||||
//
|
||||
address generate_disjoint_oop_copy(StubGenStubId stub_id) {
|
||||
address generate_disjoint_oop_copy(StubId stub_id) {
|
||||
bool aligned;
|
||||
bool dest_uninitialized;
|
||||
switch (stub_id) {
|
||||
case oop_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_oop_disjoint_arraycopy_id:
|
||||
aligned = false;
|
||||
dest_uninitialized = false;
|
||||
break;
|
||||
case arrayof_oop_disjoint_arraycopy_id:
|
||||
case StubId::stubgen_arrayof_oop_disjoint_arraycopy_id:
|
||||
aligned = true;
|
||||
dest_uninitialized = false;
|
||||
break;
|
||||
case oop_disjoint_arraycopy_uninit_id:
|
||||
case StubId::stubgen_oop_disjoint_arraycopy_uninit_id:
|
||||
aligned = false;
|
||||
dest_uninitialized = true;
|
||||
break;
|
||||
case arrayof_oop_disjoint_arraycopy_uninit_id:
|
||||
case StubId::stubgen_arrayof_oop_disjoint_arraycopy_uninit_id:
|
||||
aligned = true;
|
||||
dest_uninitialized = true;
|
||||
break;
|
||||
@@ -2163,7 +2184,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// ckval: R7 (super_klass)
|
||||
// ret: R3 zero for success; (-1^K) where K is partial transfer count
|
||||
//
|
||||
address generate_checkcast_copy(StubGenStubId stub_id) {
|
||||
address generate_checkcast_copy(StubId stub_id) {
|
||||
const Register R3_from = R3_ARG1; // source array address
|
||||
const Register R4_to = R4_ARG2; // destination array address
|
||||
const Register R5_count = R5_ARG3; // elements count
|
||||
@@ -2179,10 +2200,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
bool dest_uninitialized;
|
||||
switch (stub_id) {
|
||||
case checkcast_arraycopy_id:
|
||||
case StubId::stubgen_checkcast_arraycopy_id:
|
||||
dest_uninitialized = false;
|
||||
break;
|
||||
case checkcast_arraycopy_uninit_id:
|
||||
case StubId::stubgen_checkcast_arraycopy_uninit_id:
|
||||
dest_uninitialized = true;
|
||||
break;
|
||||
default:
|
||||
@@ -2321,7 +2342,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
const Register R7_tmp = R7_ARG5;
|
||||
|
||||
//__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::unsafe_arraycopy_id;
|
||||
StubId stub_id = StubId::stubgen_unsafe_arraycopy_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ function_entry();
|
||||
|
||||
@@ -2434,7 +2455,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
//
|
||||
address generate_unsafe_setmemory(address unsafe_byte_fill) {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, StubGenStubId::unsafe_setmemory_id);
|
||||
StubCodeMark mark(this, StubId::stubgen_unsafe_setmemory_id);
|
||||
address start = __ function_entry();
|
||||
|
||||
// bump this on entry, not on exit:
|
||||
@@ -2527,7 +2548,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
const Register temp = R2;
|
||||
|
||||
//__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::generic_arraycopy_id;
|
||||
StubId stub_id = StubId::stubgen_generic_arraycopy_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ function_entry();
|
||||
|
||||
@@ -2730,7 +2751,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// R5_ARG3 - round key array
|
||||
address generate_aescrypt_encryptBlock() {
|
||||
assert(UseAES, "need AES instructions and misaligned SSE support");
|
||||
StubGenStubId stub_id = StubGenStubId::aescrypt_encryptBlock_id;
|
||||
StubId stub_id = StubId::stubgen_aescrypt_encryptBlock_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ function_entry();
|
||||
@@ -2938,7 +2959,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// R5_ARG3 - K (key) in little endian int array
|
||||
address generate_aescrypt_decryptBlock() {
|
||||
assert(UseAES, "need AES instructions and misaligned SSE support");
|
||||
StubGenStubId stub_id = StubGenStubId::aescrypt_decryptBlock_id;
|
||||
StubId stub_id = StubId::stubgen_aescrypt_decryptBlock_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ function_entry();
|
||||
@@ -3176,14 +3197,14 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_sha256_implCompress(StubGenStubId stub_id) {
|
||||
address generate_sha256_implCompress(StubId stub_id) {
|
||||
assert(UseSHA, "need SHA instructions");
|
||||
bool multi_block;
|
||||
switch (stub_id) {
|
||||
case sha256_implCompress_id:
|
||||
case StubId::stubgen_sha256_implCompress_id:
|
||||
multi_block = false;
|
||||
break;
|
||||
case sha256_implCompressMB_id:
|
||||
case StubId::stubgen_sha256_implCompressMB_id:
|
||||
multi_block = true;
|
||||
break;
|
||||
default:
|
||||
@@ -3198,14 +3219,14 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_sha512_implCompress(StubGenStubId stub_id) {
|
||||
address generate_sha512_implCompress(StubId stub_id) {
|
||||
assert(UseSHA, "need SHA instructions");
|
||||
bool multi_block;
|
||||
switch (stub_id) {
|
||||
case sha512_implCompress_id:
|
||||
case StubId::stubgen_sha512_implCompress_id:
|
||||
multi_block = false;
|
||||
break;
|
||||
case sha512_implCompressMB_id:
|
||||
case StubId::stubgen_sha512_implCompressMB_id:
|
||||
multi_block = true;
|
||||
break;
|
||||
default:
|
||||
@@ -3222,7 +3243,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
address generate_data_cache_writeback() {
|
||||
const Register cacheline = R3_ARG1;
|
||||
StubGenStubId stub_id = StubGenStubId::data_cache_writeback_id;
|
||||
StubId stub_id = StubId::stubgen_data_cache_writeback_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -3236,7 +3257,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
const Register is_presync = R3_ARG1;
|
||||
Register temp = R4;
|
||||
Label SKIP;
|
||||
StubGenStubId stub_id = StubGenStubId::data_cache_writeback_sync_id;
|
||||
StubId stub_id = StubId::stubgen_data_cache_writeback_sync_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -3257,40 +3278,40 @@ class StubGenerator: public StubCodeGenerator {
|
||||
UnsafeMemoryAccess::set_common_exit_stub_pc(ucm_common_error_exit);
|
||||
|
||||
// non-aligned disjoint versions
|
||||
StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(StubGenStubId::jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(StubGenStubId::jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_copy(StubGenStubId::jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_copy(StubGenStubId::jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_oop_copy(StubGenStubId::oop_disjoint_arraycopy_id);
|
||||
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy(StubGenStubId::oop_disjoint_arraycopy_uninit_id);
|
||||
StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(StubId::stubgen_jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(StubId::stubgen_jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_copy(StubId::stubgen_jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_copy(StubId::stubgen_jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_oop_copy(StubId::stubgen_oop_disjoint_arraycopy_id);
|
||||
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy(StubId::stubgen_oop_disjoint_arraycopy_uninit_id);
|
||||
|
||||
// aligned disjoint versions
|
||||
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(StubGenStubId::arrayof_jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_short_copy(StubGenStubId::arrayof_jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_disjoint_int_copy(StubGenStubId::arrayof_jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_disjoint_long_copy(StubGenStubId::arrayof_jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_disjoint_oop_copy(StubGenStubId::arrayof_oop_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy(StubGenStubId::oop_disjoint_arraycopy_uninit_id);
|
||||
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(StubId::stubgen_arrayof_jbyte_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_short_copy(StubId::stubgen_arrayof_jshort_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_disjoint_int_copy(StubId::stubgen_arrayof_jint_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_disjoint_long_copy(StubId::stubgen_arrayof_jlong_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_disjoint_oop_copy(StubId::stubgen_arrayof_oop_disjoint_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy(StubId::stubgen_oop_disjoint_arraycopy_uninit_id);
|
||||
|
||||
// non-aligned conjoint versions
|
||||
StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(StubGenStubId::jbyte_arraycopy_id);
|
||||
StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(StubGenStubId::jshort_arraycopy_id);
|
||||
StubRoutines::_jint_arraycopy = generate_conjoint_int_copy(StubGenStubId::jint_arraycopy_id);
|
||||
StubRoutines::_jlong_arraycopy = generate_conjoint_long_copy(StubGenStubId::jlong_arraycopy_id);
|
||||
StubRoutines::_oop_arraycopy = generate_conjoint_oop_copy(StubGenStubId::oop_arraycopy_id);
|
||||
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_oop_copy(StubGenStubId::oop_arraycopy_uninit_id);
|
||||
StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(StubId::stubgen_jbyte_arraycopy_id);
|
||||
StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(StubId::stubgen_jshort_arraycopy_id);
|
||||
StubRoutines::_jint_arraycopy = generate_conjoint_int_copy(StubId::stubgen_jint_arraycopy_id);
|
||||
StubRoutines::_jlong_arraycopy = generate_conjoint_long_copy(StubId::stubgen_jlong_arraycopy_id);
|
||||
StubRoutines::_oop_arraycopy = generate_conjoint_oop_copy(StubId::stubgen_oop_arraycopy_id);
|
||||
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_oop_copy(StubId::stubgen_oop_arraycopy_uninit_id);
|
||||
|
||||
// aligned conjoint versions
|
||||
StubRoutines::_arrayof_jbyte_arraycopy = generate_conjoint_byte_copy(StubGenStubId::arrayof_jbyte_arraycopy_id);
|
||||
StubRoutines::_arrayof_jshort_arraycopy = generate_conjoint_short_copy(StubGenStubId::arrayof_jshort_arraycopy_id);
|
||||
StubRoutines::_arrayof_jint_arraycopy = generate_conjoint_int_copy(StubGenStubId::arrayof_jint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jlong_arraycopy = generate_conjoint_long_copy(StubGenStubId::arrayof_jlong_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_arraycopy = generate_conjoint_oop_copy(StubGenStubId::arrayof_oop_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_arraycopy_uninit = generate_conjoint_oop_copy(StubGenStubId::arrayof_oop_arraycopy_id);
|
||||
StubRoutines::_arrayof_jbyte_arraycopy = generate_conjoint_byte_copy(StubId::stubgen_arrayof_jbyte_arraycopy_id);
|
||||
StubRoutines::_arrayof_jshort_arraycopy = generate_conjoint_short_copy(StubId::stubgen_arrayof_jshort_arraycopy_id);
|
||||
StubRoutines::_arrayof_jint_arraycopy = generate_conjoint_int_copy(StubId::stubgen_arrayof_jint_arraycopy_id);
|
||||
StubRoutines::_arrayof_jlong_arraycopy = generate_conjoint_long_copy(StubId::stubgen_arrayof_jlong_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_arraycopy = generate_conjoint_oop_copy(StubId::stubgen_arrayof_oop_arraycopy_id);
|
||||
StubRoutines::_arrayof_oop_arraycopy_uninit = generate_conjoint_oop_copy(StubId::stubgen_arrayof_oop_arraycopy_id);
|
||||
|
||||
// special/generic versions
|
||||
StubRoutines::_checkcast_arraycopy = generate_checkcast_copy(StubGenStubId::checkcast_arraycopy_id);
|
||||
StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy(StubGenStubId::checkcast_arraycopy_uninit_id);
|
||||
StubRoutines::_checkcast_arraycopy = generate_checkcast_copy(StubId::stubgen_checkcast_arraycopy_id);
|
||||
StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy(StubId::stubgen_checkcast_arraycopy_uninit_id);
|
||||
|
||||
StubRoutines::_unsafe_arraycopy = generate_unsafe_copy(STUB_ENTRY(jbyte_arraycopy()),
|
||||
STUB_ENTRY(jshort_arraycopy()),
|
||||
@@ -3307,12 +3328,12 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// fill routines
|
||||
#ifdef COMPILER2
|
||||
if (OptimizeFill) {
|
||||
StubRoutines::_jbyte_fill = generate_fill(StubGenStubId::jbyte_fill_id);
|
||||
StubRoutines::_jshort_fill = generate_fill(StubGenStubId::jshort_fill_id);
|
||||
StubRoutines::_jint_fill = generate_fill(StubGenStubId::jint_fill_id);
|
||||
StubRoutines::_arrayof_jbyte_fill = generate_fill(StubGenStubId::arrayof_jbyte_fill_id);
|
||||
StubRoutines::_arrayof_jshort_fill = generate_fill(StubGenStubId::arrayof_jshort_fill_id);
|
||||
StubRoutines::_arrayof_jint_fill = generate_fill(StubGenStubId::arrayof_jint_fill_id);
|
||||
StubRoutines::_jbyte_fill = generate_fill(StubId::stubgen_jbyte_fill_id);
|
||||
StubRoutines::_jshort_fill = generate_fill(StubId::stubgen_jshort_fill_id);
|
||||
StubRoutines::_jint_fill = generate_fill(StubId::stubgen_jint_fill_id);
|
||||
StubRoutines::_arrayof_jbyte_fill = generate_fill(StubId::stubgen_arrayof_jbyte_fill_id);
|
||||
StubRoutines::_arrayof_jshort_fill = generate_fill(StubId::stubgen_arrayof_jshort_fill_id);
|
||||
StubRoutines::_arrayof_jint_fill = generate_fill(StubId::stubgen_arrayof_jint_fill_id);
|
||||
}
|
||||
StubRoutines::_unsafe_setmemory = generate_unsafe_setmemory(StubRoutines::_jbyte_fill);
|
||||
#endif
|
||||
@@ -3331,7 +3352,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
//
|
||||
address generate_multiplyToLen() {
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::multiplyToLen_id;
|
||||
StubId stub_id = StubId::stubgen_multiplyToLen_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ function_entry();
|
||||
@@ -3408,7 +3429,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
*/
|
||||
address generate_mulAdd() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::mulAdd_id;
|
||||
StubId stub_id = StubId::stubgen_mulAdd_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ function_entry();
|
||||
@@ -3439,7 +3460,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
*/
|
||||
address generate_squareToLen() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::squareToLen_id;
|
||||
StubId stub_id = StubId::stubgen_squareToLen_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ function_entry();
|
||||
@@ -3673,13 +3694,13 @@ class StubGenerator: public StubCodeGenerator {
|
||||
* R3_RET - int crc result
|
||||
*/
|
||||
// Compute CRC32 function.
|
||||
address generate_CRC32_updateBytes(StubGenStubId stub_id) {
|
||||
address generate_CRC32_updateBytes(StubId stub_id) {
|
||||
bool is_crc32c;
|
||||
switch (stub_id) {
|
||||
case updateBytesCRC32_id:
|
||||
case StubId::stubgen_updateBytesCRC32_id:
|
||||
is_crc32c = false;
|
||||
break;
|
||||
case updateBytesCRC32C_id:
|
||||
case StubId::stubgen_updateBytesCRC32C_id:
|
||||
is_crc32c = true;
|
||||
break;
|
||||
default:
|
||||
@@ -3713,7 +3734,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
address generate_method_entry_barrier() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::method_entry_barrier_id;
|
||||
StubId stub_id = StubId::stubgen_method_entry_barrier_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address stub_address = __ pc();
|
||||
@@ -3811,7 +3832,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Base64 decodeBlock intrinsic
|
||||
address generate_base64_decodeBlock() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::base64_decodeBlock_id;
|
||||
StubId stub_id = StubId::stubgen_base64_decodeBlock_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ function_entry();
|
||||
|
||||
@@ -4400,7 +4421,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
address generate_base64_encodeBlock() {
|
||||
__ align(CodeEntryAlignment);
|
||||
StubGenStubId stub_id = StubGenStubId::base64_encodeBlock_id;
|
||||
StubId stub_id = StubId::stubgen_base64_encodeBlock_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ function_entry();
|
||||
|
||||
@@ -4691,7 +4712,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
#endif // VM_LITTLE_ENDIAN
|
||||
|
||||
void generate_lookup_secondary_supers_table_stub() {
|
||||
StubGenStubId stub_id = StubGenStubId::lookup_secondary_supers_table_id;
|
||||
StubId stub_id = StubId::stubgen_lookup_secondary_supers_table_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
const Register
|
||||
@@ -4714,7 +4735,7 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
|
||||
// Slow path implementation for UseSecondarySupersTable.
|
||||
address generate_lookup_secondary_supers_table_slow_path_stub() {
|
||||
StubGenStubId stub_id = StubGenStubId::lookup_secondary_supers_table_slow_path_id;
|
||||
StubId stub_id = StubId::stubgen_lookup_secondary_supers_table_slow_path_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
|
||||
address start = __ pc();
|
||||
@@ -4732,7 +4753,7 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_cont_thaw(StubGenStubId stub_id) {
|
||||
address generate_cont_thaw(StubId stub_id) {
|
||||
if (!Continuations::enabled()) return nullptr;
|
||||
|
||||
Continuation::thaw_kind kind;
|
||||
@@ -4740,17 +4761,17 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
bool return_barrier_exception;
|
||||
|
||||
switch (stub_id) {
|
||||
case cont_thaw_id:
|
||||
case StubId::stubgen_cont_thaw_id:
|
||||
kind = Continuation::thaw_top;
|
||||
return_barrier = false;
|
||||
return_barrier_exception = false;
|
||||
break;
|
||||
case cont_returnBarrier_id:
|
||||
case StubId::stubgen_cont_returnBarrier_id:
|
||||
kind = Continuation::thaw_return_barrier;
|
||||
return_barrier = true;
|
||||
return_barrier_exception = false;
|
||||
break;
|
||||
case cont_returnBarrierExc_id:
|
||||
case StubId::stubgen_cont_returnBarrierExc_id:
|
||||
kind = Continuation::thaw_return_barrier_exception;
|
||||
return_barrier = true;
|
||||
return_barrier_exception = true;
|
||||
@@ -4847,22 +4868,22 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
}
|
||||
|
||||
address generate_cont_thaw() {
|
||||
return generate_cont_thaw(StubGenStubId::cont_thaw_id);
|
||||
return generate_cont_thaw(StubId::stubgen_cont_thaw_id);
|
||||
}
|
||||
|
||||
// TODO: will probably need multiple return barriers depending on return type
|
||||
|
||||
address generate_cont_returnBarrier() {
|
||||
return generate_cont_thaw(StubGenStubId::cont_returnBarrier_id);
|
||||
return generate_cont_thaw(StubId::stubgen_cont_returnBarrier_id);
|
||||
}
|
||||
|
||||
address generate_cont_returnBarrier_exception() {
|
||||
return generate_cont_thaw(StubGenStubId::cont_returnBarrierExc_id);
|
||||
return generate_cont_thaw(StubId::stubgen_cont_returnBarrierExc_id);
|
||||
}
|
||||
|
||||
address generate_cont_preempt_stub() {
|
||||
if (!Continuations::enabled()) return nullptr;
|
||||
StubGenStubId stub_id = StubGenStubId::cont_preempt_id;
|
||||
StubId stub_id = StubId::stubgen_cont_preempt_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -4898,7 +4919,7 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
|
||||
// exception handler for upcall stubs
|
||||
address generate_upcall_stub_exception_handler() {
|
||||
StubGenStubId stub_id = StubGenStubId::upcall_stub_exception_handler_id;
|
||||
StubId stub_id = StubId::stubgen_upcall_stub_exception_handler_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -4917,7 +4938,7 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
// R19_method = result Method*
|
||||
address generate_upcall_stub_load_target() {
|
||||
|
||||
StubGenStubId stub_id = StubGenStubId::upcall_stub_load_target_id;
|
||||
StubId stub_id = StubId::stubgen_upcall_stub_load_target_id;
|
||||
StubCodeMark mark(this, stub_id);
|
||||
address start = __ pc();
|
||||
|
||||
@@ -4962,13 +4983,13 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
// CRC32 Intrinsics.
|
||||
if (UseCRC32Intrinsics) {
|
||||
StubRoutines::_crc_table_adr = StubRoutines::ppc::generate_crc_constants(REVERSE_CRC32_POLY);
|
||||
StubRoutines::_updateBytesCRC32 = generate_CRC32_updateBytes(StubGenStubId::updateBytesCRC32_id);
|
||||
StubRoutines::_updateBytesCRC32 = generate_CRC32_updateBytes(StubId::stubgen_updateBytesCRC32_id);
|
||||
}
|
||||
|
||||
// CRC32C Intrinsics.
|
||||
if (UseCRC32CIntrinsics) {
|
||||
StubRoutines::_crc32c_table_addr = StubRoutines::ppc::generate_crc_constants(REVERSE_CRC32C_POLY);
|
||||
StubRoutines::_updateBytesCRC32C = generate_CRC32_updateBytes(StubGenStubId::updateBytesCRC32C_id);
|
||||
StubRoutines::_updateBytesCRC32C = generate_CRC32_updateBytes(StubId::stubgen_updateBytesCRC32C_id);
|
||||
}
|
||||
|
||||
if (VM_Version::supports_float16()) {
|
||||
@@ -5050,12 +5071,12 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
}
|
||||
|
||||
if (UseSHA256Intrinsics) {
|
||||
StubRoutines::_sha256_implCompress = generate_sha256_implCompress(StubGenStubId::sha256_implCompress_id);
|
||||
StubRoutines::_sha256_implCompressMB = generate_sha256_implCompress(StubGenStubId::sha256_implCompressMB_id);
|
||||
StubRoutines::_sha256_implCompress = generate_sha256_implCompress(StubId::stubgen_sha256_implCompress_id);
|
||||
StubRoutines::_sha256_implCompressMB = generate_sha256_implCompress(StubId::stubgen_sha256_implCompressMB_id);
|
||||
}
|
||||
if (UseSHA512Intrinsics) {
|
||||
StubRoutines::_sha512_implCompress = generate_sha512_implCompress(StubGenStubId::sha512_implCompress_id);
|
||||
StubRoutines::_sha512_implCompressMB = generate_sha512_implCompress(StubGenStubId::sha512_implCompressMB_id);
|
||||
StubRoutines::_sha512_implCompress = generate_sha512_implCompress(StubId::stubgen_sha512_implCompress_id);
|
||||
StubRoutines::_sha512_implCompressMB = generate_sha512_implCompress(StubId::stubgen_sha512_implCompressMB_id);
|
||||
}
|
||||
|
||||
#ifdef VM_LITTLE_ENDIAN
|
||||
@@ -5069,31 +5090,31 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
}
|
||||
|
||||
public:
|
||||
StubGenerator(CodeBuffer* code, StubGenBlobId blob_id) : StubCodeGenerator(code, blob_id) {
|
||||
StubGenerator(CodeBuffer* code, BlobId blob_id) : StubCodeGenerator(code, blob_id) {
|
||||
switch(blob_id) {
|
||||
case preuniverse_id:
|
||||
case BlobId::stubgen_preuniverse_id:
|
||||
generate_preuniverse_stubs();
|
||||
break;
|
||||
case initial_id:
|
||||
case BlobId::stubgen_initial_id:
|
||||
generate_initial_stubs();
|
||||
break;
|
||||
case continuation_id:
|
||||
case BlobId::stubgen_continuation_id:
|
||||
generate_continuation_stubs();
|
||||
break;
|
||||
case compiler_id:
|
||||
case BlobId::stubgen_compiler_id:
|
||||
generate_compiler_stubs();
|
||||
break;
|
||||
case final_id:
|
||||
case BlobId::stubgen_final_id:
|
||||
generate_final_stubs();
|
||||
break;
|
||||
default:
|
||||
fatal("unexpected blob id: %d", blob_id);
|
||||
fatal("unexpected blob id: %s", StubInfo::name(blob_id));
|
||||
break;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
void StubGenerator_generate(CodeBuffer* code, StubGenBlobId blob_id) {
|
||||
void StubGenerator_generate(CodeBuffer* code, BlobId blob_id) {
|
||||
StubGenerator g(code, blob_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,9 @@ void VM_Version::initialize() {
|
||||
"%zu on this machine", PowerArchitecturePPC64);
|
||||
|
||||
// Power 8: Configure Data Stream Control Register.
|
||||
config_dscr();
|
||||
if (VM_Version::has_mfdscr()) {
|
||||
config_dscr();
|
||||
}
|
||||
|
||||
if (!UseSIGTRAP) {
|
||||
MSG(TrapBasedICMissChecks);
|
||||
@@ -170,7 +172,8 @@ void VM_Version::initialize() {
|
||||
// Create and print feature-string.
|
||||
char buf[(num_features+1) * 16]; // Max 16 chars per feature.
|
||||
jio_snprintf(buf, sizeof(buf),
|
||||
"ppc64 sha aes%s%s",
|
||||
"ppc64 sha aes%s%s%s",
|
||||
(has_mfdscr() ? " mfdscr" : ""),
|
||||
(has_darn() ? " darn" : ""),
|
||||
(has_brw() ? " brw" : "")
|
||||
// Make sure number of %s matches num_features!
|
||||
@@ -488,6 +491,7 @@ void VM_Version::determine_features() {
|
||||
uint32_t *code = (uint32_t *)a->pc();
|
||||
// Keep R3_ARG1 unmodified, it contains &field (see below).
|
||||
// Keep R4_ARG2 unmodified, it contains offset = 0 (see below).
|
||||
a->mfdscr(R0);
|
||||
a->darn(R7);
|
||||
a->brw(R5, R6);
|
||||
a->blr();
|
||||
@@ -524,6 +528,7 @@ void VM_Version::determine_features() {
|
||||
|
||||
// determine which instructions are legal.
|
||||
int feature_cntr = 0;
|
||||
if (code[feature_cntr++]) features |= mfdscr_m;
|
||||
if (code[feature_cntr++]) features |= darn_m;
|
||||
if (code[feature_cntr++]) features |= brw_m;
|
||||
|
||||
|
||||
@@ -32,12 +32,14 @@
|
||||
class VM_Version: public Abstract_VM_Version {
|
||||
protected:
|
||||
enum Feature_Flag {
|
||||
mfdscr,
|
||||
darn,
|
||||
brw,
|
||||
num_features // last entry to count features
|
||||
};
|
||||
enum Feature_Flag_Set {
|
||||
unknown_m = 0,
|
||||
mfdscr_m = (1 << mfdscr ),
|
||||
darn_m = (1 << darn ),
|
||||
brw_m = (1 << brw ),
|
||||
all_features_m = (unsigned long)-1
|
||||
@@ -67,8 +69,9 @@ public:
|
||||
|
||||
static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
|
||||
// CPU instruction support
|
||||
static bool has_darn() { return (_features & darn_m) != 0; }
|
||||
static bool has_brw() { return (_features & brw_m) != 0; }
|
||||
static bool has_mfdscr() { return (_features & mfdscr_m) != 0; } // Power8, but may be unavailable (QEMU)
|
||||
static bool has_darn() { return (_features & darn_m) != 0; }
|
||||
static bool has_brw() { return (_features & brw_m) != 0; }
|
||||
|
||||
// Assembler testing
|
||||
static void allow_all();
|
||||
|
||||
@@ -57,7 +57,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
|
||||
__ mov_metadata(t0, m);
|
||||
ce->store_parameter(t0, 1);
|
||||
ce->store_parameter(_bci, 0);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::counter_overflow_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_counter_overflow_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
__ j(_continuation);
|
||||
@@ -66,7 +66,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
|
||||
void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
address a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
__ far_call(RuntimeAddress(a));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
@@ -79,13 +79,13 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
} else {
|
||||
__ mv(t0, _index->as_jint());
|
||||
}
|
||||
C1StubId stub_id;
|
||||
StubId stub_id;
|
||||
if (_throw_index_out_of_bounds_exception) {
|
||||
stub_id = C1StubId::throw_index_exception_id;
|
||||
stub_id = StubId::c1_throw_index_exception_id;
|
||||
} else {
|
||||
assert(_array != LIR_Opr::nullOpr(), "sanity");
|
||||
__ mv(t1, _array->as_pointer_register());
|
||||
stub_id = C1StubId::throw_range_check_failed_id;
|
||||
stub_id = StubId::c1_throw_range_check_failed_id;
|
||||
}
|
||||
// t0 and t1 are used as args in generate_exception_throw,
|
||||
// so use x1/ra as the tmp register for rt_call.
|
||||
@@ -101,7 +101,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
|
||||
|
||||
void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
address a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
__ far_call(RuntimeAddress(a));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
@@ -113,7 +113,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
}
|
||||
__ bind(_entry);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::throw_div0_exception_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_throw_div0_exception_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
#ifdef ASSERT
|
||||
@@ -122,14 +122,14 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) {
|
||||
}
|
||||
|
||||
// Implementation of NewInstanceStub
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) {
|
||||
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, StubId stub_id) {
|
||||
_result = result;
|
||||
_klass = klass;
|
||||
_klass_reg = klass_reg;
|
||||
_info = new CodeEmitInfo(info);
|
||||
assert(stub_id == C1StubId::new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_id ||
|
||||
stub_id == C1StubId::fast_new_instance_init_check_id,
|
||||
assert(stub_id == StubId::c1_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_id ||
|
||||
stub_id == StubId::c1_fast_new_instance_init_check_id,
|
||||
"need new_instance id");
|
||||
_stub_id = stub_id;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
assert(_length->as_register() == x9, "length must in x9");
|
||||
assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_type_array_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_type_array_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
assert(_result->as_register() == x10, "result must in x10");
|
||||
@@ -178,7 +178,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
assert(_length->as_register() == x9, "length must in x9");
|
||||
assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_object_array_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
ce->verify_oop_map(_info);
|
||||
assert(_result->as_register() == x10, "result must in x10");
|
||||
@@ -190,11 +190,11 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_obj_reg->as_register(), 1);
|
||||
ce->store_parameter(_lock_reg->as_register(), 0);
|
||||
C1StubId enter_id;
|
||||
StubId enter_id;
|
||||
if (ce->compilation()->has_fpu_code()) {
|
||||
enter_id = C1StubId::monitorenter_id;
|
||||
enter_id = StubId::c1_monitorenter_id;
|
||||
} else {
|
||||
enter_id = C1StubId::monitorenter_nofpu_id;
|
||||
enter_id = StubId::c1_monitorenter_nofpu_id;
|
||||
}
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
@@ -210,11 +210,11 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) {
|
||||
}
|
||||
ce->store_parameter(_lock_reg->as_register(), 0);
|
||||
// note: non-blocking leaf routine => no call info needed
|
||||
C1StubId exit_id;
|
||||
StubId exit_id;
|
||||
if (ce->compilation()->has_fpu_code()) {
|
||||
exit_id = C1StubId::monitorexit_id;
|
||||
exit_id = StubId::c1_monitorexit_id;
|
||||
} else {
|
||||
exit_id = C1StubId::monitorexit_nofpu_id;
|
||||
exit_id = StubId::c1_monitorexit_nofpu_id;
|
||||
}
|
||||
__ la(ra, _continuation);
|
||||
__ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id)));
|
||||
@@ -239,7 +239,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_trap_request, 0);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::deoptimize_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_deoptimize_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
DEBUG_ONLY(__ should_not_reach_here());
|
||||
}
|
||||
@@ -248,9 +248,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
|
||||
address a = nullptr;
|
||||
if (_info->deoptimize_on_exception()) {
|
||||
// Deoptimize, do not throw the exception, because it is probably wrong to do it here.
|
||||
a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id);
|
||||
a = Runtime1::entry_for(StubId::c1_predicate_failed_trap_id);
|
||||
} else {
|
||||
a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id);
|
||||
a = Runtime1::entry_for(StubId::c1_throw_null_pointer_exception_id);
|
||||
}
|
||||
|
||||
ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
|
||||
|
||||
@@ -225,7 +225,7 @@ void LIR_Assembler::arraycopy_type_check(Register src, Register src_pos, Registe
|
||||
__ check_klass_subtype_fast_path(src, dst, tmp, &cont, &slow, nullptr);
|
||||
|
||||
PUSH(src, dst);
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
POP(src, dst);
|
||||
__ bnez(dst, cont);
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ int LIR_Assembler::emit_exception_handler() {
|
||||
__ verify_not_null_oop(x10);
|
||||
|
||||
// search an exception handler (x10: exception oop, x13: throwing pc)
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_handle_exception_from_callee_id)));
|
||||
__ should_not_reach_here();
|
||||
guarantee(code_offset() - offset <= exception_handler_size(), "overflow");
|
||||
__ end_a_stub();
|
||||
@@ -360,7 +360,7 @@ int LIR_Assembler::emit_unwind_handler() {
|
||||
// remove the activation and dispatch to the unwind handler
|
||||
__ block_comment("remove_frame and dispatch to the unwind handler");
|
||||
__ remove_frame(initial_frame_size_in_bytes());
|
||||
__ far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::unwind_exception_id)));
|
||||
__ far_jump(RuntimeAddress(Runtime1::entry_for(StubId::c1_unwind_exception_id)));
|
||||
|
||||
// Emit the slow path assembly
|
||||
if (stub != nullptr) {
|
||||
@@ -1096,7 +1096,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe
|
||||
__ subi(sp, sp, 2 * wordSize); // 2: store k_RInfo and klass_RInfo
|
||||
__ sd(k_RInfo, Address(sp, 0)); // sub klass
|
||||
__ sd(klass_RInfo, Address(sp, wordSize)); // super klass
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
// load result to k_RInfo
|
||||
__ ld(k_RInfo, Address(sp, 0));
|
||||
__ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo
|
||||
@@ -1111,7 +1111,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe
|
||||
__ subi(sp, sp, 2 * wordSize); // 2: store k_RInfo and klass_RInfo
|
||||
__ sd(klass_RInfo, Address(sp, wordSize)); // sub klass
|
||||
__ sd(k_RInfo, Address(sp, 0)); // super klass
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
// load result to k_RInfo
|
||||
__ ld(k_RInfo, Address(sp, 0));
|
||||
__ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo
|
||||
@@ -1399,7 +1399,7 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
|
||||
// exception object is not added to oop map by LinearScan
|
||||
// (LinearScan assumes that no oops are in fixed registers)
|
||||
info->add_register_oop(exceptionOop);
|
||||
C1StubId unwind_id;
|
||||
StubId unwind_id;
|
||||
|
||||
// get current pc information
|
||||
// pc is only needed if the method has an exception handler, the unwind code does not need it.
|
||||
@@ -1418,9 +1418,9 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit
|
||||
__ verify_not_null_oop(x10);
|
||||
// search an exception handler (x10: exception oop, x13: throwing pc)
|
||||
if (compilation()->has_fpu_code()) {
|
||||
unwind_id = C1StubId::handle_exception_id;
|
||||
unwind_id = StubId::c1_handle_exception_id;
|
||||
} else {
|
||||
unwind_id = C1StubId::handle_exception_nofpu_id;
|
||||
unwind_id = StubId::c1_handle_exception_nofpu_id;
|
||||
}
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(unwind_id)));
|
||||
__ nop();
|
||||
@@ -2053,16 +2053,16 @@ void LIR_Assembler::deoptimize_trap(CodeEmitInfo *info) {
|
||||
|
||||
switch (patching_id(info)) {
|
||||
case PatchingStub::access_field_id:
|
||||
target = Runtime1::entry_for(C1StubId::access_field_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_access_field_patching_id);
|
||||
break;
|
||||
case PatchingStub::load_klass_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_klass_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_klass_patching_id);
|
||||
break;
|
||||
case PatchingStub::load_mirror_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_mirror_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_mirror_patching_id);
|
||||
break;
|
||||
case PatchingStub::load_appendix_id:
|
||||
target = Runtime1::entry_for(C1StubId::load_appendix_patching_id);
|
||||
target = Runtime1::entry_for(StubId::c1_load_appendix_patching_id);
|
||||
break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
@@ -2151,7 +2151,7 @@ void LIR_Assembler::lir_store_slowcheck(Register k_RInfo, Register klass_RInfo,
|
||||
__ subi(sp, sp, 2 * wordSize); // 2: store k_RInfo and klass_RInfo
|
||||
__ sd(klass_RInfo, Address(sp, wordSize)); // sub klass
|
||||
__ sd(k_RInfo, Address(sp, 0)); // super klass
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
|
||||
__ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_slow_subtype_check_id)));
|
||||
// load result to k_RInfo
|
||||
__ ld(k_RInfo, Address(sp, 0));
|
||||
__ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo
|
||||
|
||||
@@ -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,
|
||||
@@ -1029,7 +1029,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
|
||||
args->append(rank);
|
||||
args->append(varargs);
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id),
|
||||
__ call_runtime(Runtime1::entry_for(StubId::c1_new_multi_array_id),
|
||||
LIR_OprFact::illegalOpr,
|
||||
reg, args, info);
|
||||
|
||||
@@ -1061,7 +1061,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
CodeStub* stub = nullptr;
|
||||
if (x->is_incompatible_class_change_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr,
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr,
|
||||
info_for_exception);
|
||||
} else if (x->is_invokespecial_receiver_check()) {
|
||||
assert(patching_info == nullptr, "can't patch this");
|
||||
@@ -1069,7 +1069,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
Deoptimization::Reason_class_check,
|
||||
Deoptimization::Action_none);
|
||||
} else {
|
||||
stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception);
|
||||
stub = new SimpleExceptionStub(StubId::c1_throw_class_cast_exception_id, obj.result(), info_for_exception);
|
||||
}
|
||||
LIR_Opr reg = rlock_result(x);
|
||||
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
|
||||
@@ -1104,7 +1104,7 @@ void LIRGenerator::do_InstanceOf(InstanceOf* x) {
|
||||
|
||||
// Intrinsic for Class::isInstance
|
||||
address LIRGenerator::isInstance_entry() {
|
||||
return Runtime1::entry_for(C1StubId::is_instance_of_id);
|
||||
return Runtime1::entry_for(StubId::c1_is_instance_of_id);
|
||||
}
|
||||
|
||||
void LIRGenerator::do_If(If* x) {
|
||||
|
||||
@@ -281,7 +281,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
|
||||
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
assert(obj == x10, "must be");
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)));
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)));
|
||||
}
|
||||
|
||||
verify_oop(obj);
|
||||
@@ -321,7 +321,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1
|
||||
|
||||
if (CURRENT_ENV->dtrace_alloc_probes()) {
|
||||
assert(obj == x10, "must be");
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)));
|
||||
far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)));
|
||||
}
|
||||
|
||||
verify_oop(obj);
|
||||
|
||||
@@ -97,10 +97,10 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres
|
||||
if (frame_size() == no_frame_size) {
|
||||
leave();
|
||||
far_jump(RuntimeAddress(StubRoutines::forward_exception_entry()));
|
||||
} else if (_stub_id == (int)C1StubId::forward_exception_id) {
|
||||
} else if (_stub_id == (int)StubId::c1_forward_exception_id) {
|
||||
should_not_reach_here();
|
||||
} else {
|
||||
far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id)));
|
||||
far_jump(RuntimeAddress(Runtime1::entry_for(StubId::c1_forward_exception_id)));
|
||||
}
|
||||
bind(L);
|
||||
}
|
||||
@@ -370,8 +370,8 @@ void Runtime1::initialize_pd() {
|
||||
// return: offset in 64-bit words.
|
||||
uint Runtime1::runtime_blob_current_thread_offset(frame f) {
|
||||
CodeBlob* cb = f.cb();
|
||||
assert(cb == Runtime1::blob_for(C1StubId::monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(C1StubId::monitorenter_nofpu_id), "must be");
|
||||
assert(cb == Runtime1::blob_for(StubId::c1_monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(StubId::c1_monitorenter_nofpu_id), "must be");
|
||||
assert(cb != nullptr && cb->is_runtime_stub(), "invalid frame");
|
||||
int offset = cpu_reg_save_offsets[xthread->encoding()];
|
||||
return offset / 2; // SP offsets are in halfwords
|
||||
@@ -399,7 +399,7 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe
|
||||
return oop_maps;
|
||||
}
|
||||
|
||||
OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) {
|
||||
OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler *sasm) {
|
||||
__ block_comment("generate_handle_exception");
|
||||
|
||||
// incoming parameters
|
||||
@@ -411,7 +411,7 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm)
|
||||
OopMap* oop_map = nullptr;
|
||||
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
// We're handling an exception in the context of a compiled frame.
|
||||
// The registers have been saved in the standard places. Perform
|
||||
// an exception lookup in the caller and dispatch to the handler
|
||||
@@ -430,12 +430,12 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm)
|
||||
__ sd(zr, Address(xthread, JavaThread::vm_result_oop_offset()));
|
||||
__ sd(zr, Address(xthread, JavaThread::vm_result_metadata_offset()));
|
||||
break;
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
// At this point all registers MAY be live.
|
||||
oop_map = save_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id);
|
||||
oop_map = save_live_registers(sasm, id != StubId::c1_handle_exception_nofpu_id);
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id: {
|
||||
case StubId::c1_handle_exception_from_callee_id: {
|
||||
// At this point all registers except exception oop (x10) and
|
||||
// exception pc (ra) are dead.
|
||||
const int frame_size = 2 /* fp, return address */;
|
||||
@@ -492,13 +492,13 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm)
|
||||
__ sd(x10, Address(fp, frame::return_addr_offset * BytesPerWord));
|
||||
|
||||
switch (id) {
|
||||
case C1StubId::forward_exception_id:
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
// Restore the registers that were saved at the beginning.
|
||||
restore_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id);
|
||||
restore_live_registers(sasm, id != StubId::c1_handle_exception_nofpu_id);
|
||||
break;
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
@@ -644,7 +644,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
|
||||
return oop_maps;
|
||||
}
|
||||
|
||||
OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* Runtime1::generate_code_for(StubId id, StubAssembler* sasm) {
|
||||
// for better readability
|
||||
const bool dont_gc_arguments = false;
|
||||
|
||||
@@ -655,7 +655,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
OopMapSet* oop_maps = nullptr;
|
||||
switch (id) {
|
||||
{
|
||||
case C1StubId::forward_exception_id:
|
||||
case StubId::c1_forward_exception_id:
|
||||
{
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
__ leave();
|
||||
@@ -663,32 +663,32 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_div0_exception_id:
|
||||
case StubId::c1_throw_div0_exception_id:
|
||||
{
|
||||
StubFrame f(sasm, "throw_div0_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_null_pointer_exception_id:
|
||||
case StubId::c1_throw_null_pointer_exception_id:
|
||||
{ StubFrame f(sasm, "throw_null_pointer_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_instance_id:
|
||||
case C1StubId::fast_new_instance_id:
|
||||
case C1StubId::fast_new_instance_init_check_id:
|
||||
case StubId::c1_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_id:
|
||||
case StubId::c1_fast_new_instance_init_check_id:
|
||||
{
|
||||
Register klass = x13; // Incoming
|
||||
Register obj = x10; // Result
|
||||
|
||||
if (id == C1StubId::new_instance_id) {
|
||||
if (id == StubId::c1_new_instance_id) {
|
||||
__ set_info("new_instance", dont_gc_arguments);
|
||||
} else if (id == C1StubId::fast_new_instance_id) {
|
||||
} else if (id == StubId::c1_fast_new_instance_id) {
|
||||
__ set_info("fast new_instance", dont_gc_arguments);
|
||||
} else {
|
||||
assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId");
|
||||
assert(id == StubId::c1_fast_new_instance_init_check_id, "bad StubId");
|
||||
__ set_info("fast new_instance init check", dont_gc_arguments);
|
||||
}
|
||||
|
||||
@@ -709,7 +709,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
|
||||
break;
|
||||
|
||||
case C1StubId::counter_overflow_id:
|
||||
case StubId::c1_counter_overflow_id:
|
||||
{
|
||||
Register bci = x10;
|
||||
Register method = x11;
|
||||
@@ -733,14 +733,14 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_type_array_id:
|
||||
case C1StubId::new_object_array_id:
|
||||
case StubId::c1_new_type_array_id:
|
||||
case StubId::c1_new_object_array_id:
|
||||
{
|
||||
Register length = x9; // Incoming
|
||||
Register klass = x13; // Incoming
|
||||
Register obj = x10; // Result
|
||||
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
__ set_info("new_type_array", dont_gc_arguments);
|
||||
} else {
|
||||
__ set_info("new_object_array", dont_gc_arguments);
|
||||
@@ -753,7 +753,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
Register tmp = obj;
|
||||
__ lwu(tmp, Address(klass, Klass::layout_helper_offset()));
|
||||
__ sraiw(tmp, tmp, Klass::_lh_array_tag_shift);
|
||||
int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value);
|
||||
int tag = ((id == StubId::c1_new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value);
|
||||
__ mv(t0, tag);
|
||||
__ beq(t0, tmp, ok);
|
||||
__ stop("assert(is an array klass)");
|
||||
@@ -766,7 +766,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
OopMap* map = save_live_registers(sasm);
|
||||
assert_cond(map != nullptr);
|
||||
int call_offset = 0;
|
||||
if (id == C1StubId::new_type_array_id) {
|
||||
if (id == StubId::c1_new_type_array_id) {
|
||||
call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length);
|
||||
} else {
|
||||
call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length);
|
||||
@@ -785,7 +785,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::new_multi_array_id:
|
||||
case StubId::c1_new_multi_array_id:
|
||||
{
|
||||
StubFrame f(sasm, "new_multi_array", dont_gc_arguments);
|
||||
// x10: klass
|
||||
@@ -808,7 +808,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::register_finalizer_id:
|
||||
case StubId::c1_register_finalizer_id:
|
||||
{
|
||||
__ set_info("register_finalizer", dont_gc_arguments);
|
||||
|
||||
@@ -842,14 +842,14 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_class_cast_exception_id:
|
||||
case StubId::c1_throw_class_cast_exception_id:
|
||||
{
|
||||
StubFrame f(sasm, "throw_class_cast_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_incompatible_class_change_error_id:
|
||||
case StubId::c1_throw_incompatible_class_change_error_id:
|
||||
{
|
||||
StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm,
|
||||
@@ -857,7 +857,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::slow_subtype_check_id:
|
||||
case StubId::c1_slow_subtype_check_id:
|
||||
{
|
||||
// Typical calling sequence:
|
||||
// push klass_RInfo (object klass or other subclass)
|
||||
@@ -903,10 +903,10 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorenter_nofpu_id:
|
||||
case StubId::c1_monitorenter_nofpu_id:
|
||||
save_fpu_registers = false;
|
||||
// fall through
|
||||
case C1StubId::monitorenter_id:
|
||||
case StubId::c1_monitorenter_id:
|
||||
{
|
||||
StubFrame f(sasm, "monitorenter", dont_gc_arguments, requires_pop_epilogue_return);
|
||||
OopMap* map = save_live_registers(sasm, save_fpu_registers);
|
||||
@@ -925,7 +925,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::is_instance_of_id:
|
||||
case StubId::c1_is_instance_of_id:
|
||||
{
|
||||
// Mirror: x10
|
||||
// Object: x11
|
||||
@@ -971,10 +971,10 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::monitorexit_nofpu_id:
|
||||
case StubId::c1_monitorexit_nofpu_id:
|
||||
save_fpu_registers = false;
|
||||
// fall through
|
||||
case C1StubId::monitorexit_id:
|
||||
case StubId::c1_monitorexit_id:
|
||||
{
|
||||
StubFrame f(sasm, "monitorexit", dont_gc_arguments);
|
||||
OopMap* map = save_live_registers(sasm, save_fpu_registers);
|
||||
@@ -995,7 +995,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::deoptimize_id:
|
||||
case StubId::c1_deoptimize_id:
|
||||
{
|
||||
StubFrame f(sasm, "deoptimize", dont_gc_arguments, does_not_return);
|
||||
OopMap* oop_map = save_live_registers(sasm);
|
||||
@@ -1014,14 +1014,14 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_range_check_failed_id:
|
||||
case StubId::c1_throw_range_check_failed_id:
|
||||
{
|
||||
StubFrame f(sasm, "range_check_failed", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::unwind_exception_id:
|
||||
case StubId::c1_unwind_exception_id:
|
||||
{
|
||||
__ set_info("unwind_exception", dont_gc_arguments);
|
||||
// note: no stubframe since we are about to leave the current
|
||||
@@ -1030,7 +1030,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::access_field_patching_id:
|
||||
case StubId::c1_access_field_patching_id:
|
||||
{
|
||||
StubFrame f(sasm, "access_field_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
@@ -1038,7 +1038,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_klass_patching_id:
|
||||
case StubId::c1_load_klass_patching_id:
|
||||
{
|
||||
StubFrame f(sasm, "load_klass_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
@@ -1046,7 +1046,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_mirror_patching_id:
|
||||
case StubId::c1_load_mirror_patching_id:
|
||||
{
|
||||
StubFrame f(sasm, "load_mirror_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
@@ -1054,7 +1054,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::load_appendix_patching_id:
|
||||
case StubId::c1_load_appendix_patching_id:
|
||||
{
|
||||
StubFrame f(sasm, "load_appendix_patching", dont_gc_arguments, does_not_return);
|
||||
// we should set up register map
|
||||
@@ -1062,29 +1062,29 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_nofpu_id:
|
||||
case C1StubId::handle_exception_id:
|
||||
case StubId::c1_handle_exception_nofpu_id:
|
||||
case StubId::c1_handle_exception_id:
|
||||
{
|
||||
StubFrame f(sasm, "handle_exception", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::handle_exception_from_callee_id:
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
{
|
||||
StubFrame f(sasm, "handle_exception_from_callee", dont_gc_arguments);
|
||||
oop_maps = generate_handle_exception(id, sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_index_exception_id:
|
||||
case StubId::c1_throw_index_exception_id:
|
||||
{
|
||||
StubFrame f(sasm, "index_range_check_failed", dont_gc_arguments, does_not_return);
|
||||
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::throw_array_store_exception_id:
|
||||
case StubId::c1_throw_array_store_exception_id:
|
||||
{
|
||||
StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments, does_not_return);
|
||||
// tos + 0: link
|
||||
@@ -1093,7 +1093,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::predicate_failed_trap_id:
|
||||
case StubId::c1_predicate_failed_trap_id:
|
||||
{
|
||||
StubFrame f(sasm, "predicate_failed_trap", dont_gc_arguments, does_not_return);
|
||||
|
||||
@@ -1113,7 +1113,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case C1StubId::dtrace_object_alloc_id:
|
||||
case StubId::c1_dtrace_object_alloc_id:
|
||||
{ // c_rarg0: object
|
||||
StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments);
|
||||
save_live_registers(sasm);
|
||||
|
||||
@@ -414,8 +414,8 @@ JavaThread** frame::saved_thread_address(const frame& f) {
|
||||
|
||||
JavaThread** thread_addr;
|
||||
#ifdef COMPILER1
|
||||
if (cb == Runtime1::blob_for(C1StubId::monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(C1StubId::monitorenter_nofpu_id)) {
|
||||
if (cb == Runtime1::blob_for(StubId::c1_monitorenter_id) ||
|
||||
cb == Runtime1::blob_for(StubId::c1_monitorenter_nofpu_id)) {
|
||||
thread_addr = (JavaThread**)(f.sp() + Runtime1::runtime_blob_current_thread_offset(f));
|
||||
} else
|
||||
#endif
|
||||
|
||||
@@ -1050,26 +1050,16 @@ void InterpreterMacroAssembler::update_mdp_for_ret(Register return_bci) {
|
||||
addi(sp, sp, 2 * wordSize);
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::profile_taken_branch(Register mdp,
|
||||
Register bumped_count) {
|
||||
void InterpreterMacroAssembler::profile_taken_branch(Register mdp) {
|
||||
if (ProfileInterpreter) {
|
||||
Label profile_continue;
|
||||
|
||||
// If no method data exists, go to profile_continue.
|
||||
// Otherwise, assign to mdp
|
||||
test_method_data_pointer(mdp, profile_continue);
|
||||
|
||||
// We are taking a branch. Increment the taken count.
|
||||
Address data(mdp, in_bytes(JumpData::taken_offset()));
|
||||
ld(bumped_count, data);
|
||||
assert(DataLayout::counter_increment == 1,
|
||||
"flow-free idiom only works with 1");
|
||||
addi(bumped_count, bumped_count, DataLayout::counter_increment);
|
||||
Label L;
|
||||
// eg: bumped_count=0x7fff ffff ffff ffff + 1 < 0. so we use <= 0;
|
||||
blez(bumped_count, L); // skip store if counter overflow,
|
||||
sd(bumped_count, data);
|
||||
bind(L);
|
||||
increment_mdp_data_at(mdp, in_bytes(JumpData::taken_offset()));
|
||||
|
||||
// The method data pointer needs to be updated to reflect the new target.
|
||||
update_mdp_by_offset(mdp, in_bytes(JumpData::displacement_offset()));
|
||||
bind(profile_continue);
|
||||
@@ -1083,7 +1073,7 @@ void InterpreterMacroAssembler::profile_not_taken_branch(Register mdp) {
|
||||
// If no method data exists, go to profile_continue.
|
||||
test_method_data_pointer(mdp, profile_continue);
|
||||
|
||||
// We are taking a branch. Increment the not taken count.
|
||||
// We are not taking a branch. Increment the not taken count.
|
||||
increment_mdp_data_at(mdp, in_bytes(BranchData::not_taken_offset()));
|
||||
|
||||
// The method data pointer needs to be updated to correspond to
|
||||
|
||||
@@ -261,7 +261,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
// narrow int return value
|
||||
void narrow(Register result);
|
||||
|
||||
void profile_taken_branch(Register mdp, Register bumped_count);
|
||||
void profile_taken_branch(Register mdp);
|
||||
void profile_not_taken_branch(Register mdp);
|
||||
void profile_call(Register mdp);
|
||||
void profile_final_call(Register mdp);
|
||||
|
||||
@@ -5341,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.
|
||||
*/
|
||||
@@ -5593,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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -60,13 +60,13 @@ class NativeFarCall: public NativeInstruction {
|
||||
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);
|
||||
address reloc_destination();
|
||||
|
||||
void set_destination(address dest);
|
||||
void verify();
|
||||
void print();
|
||||
|
||||
bool set_destination_mt_safe(address dest, bool assert_lock = true);
|
||||
bool set_destination_mt_safe(address dest);
|
||||
bool reloc_set_destination(address dest);
|
||||
|
||||
private:
|
||||
@@ -88,7 +88,7 @@ address NativeFarCall::destination() const {
|
||||
address destination = 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");
|
||||
@@ -96,20 +96,22 @@ address NativeFarCall::destination() const {
|
||||
return stub_address_destination_at(destination);
|
||||
}
|
||||
|
||||
address NativeFarCall::reloc_destination(address orig_address) {
|
||||
address NativeFarCall::reloc_destination() {
|
||||
address call_addr = instruction_address();
|
||||
assert(NativeFarCall::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()) {
|
||||
stub_addr = trampoline_stub_Relocation::get_trampoline_for(call_addr, code->as_nmethod());
|
||||
}
|
||||
|
||||
if (stub_addr != nullptr) {
|
||||
stub_addr = MacroAssembler::target_addr_for_insn(call_addr);
|
||||
}
|
||||
|
||||
return stub_addr;
|
||||
}
|
||||
|
||||
@@ -128,18 +130,13 @@ void NativeFarCall::print() {
|
||||
tty->print_cr(PTR_FORMAT ": auipc,ld,jalr x1, offset/reg, ", p2i(addr_at(0)));
|
||||
}
|
||||
|
||||
bool NativeFarCall::set_destination_mt_safe(address dest, bool assert_lock) {
|
||||
bool NativeFarCall::set_destination_mt_safe(address dest) {
|
||||
assert(NativeFarCall::is_at(addr_at(0)), "unexpected code at call site");
|
||||
assert(!assert_lock ||
|
||||
(CodeCache_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
|
||||
assert((CodeCache_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
|
||||
CompiledICLocker::is_safe(addr_at(0)),
|
||||
"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();
|
||||
|
||||
if (stub_addr != nullptr) {
|
||||
set_stub_address_destination_at(stub_addr, dest);
|
||||
return true;
|
||||
@@ -156,10 +153,9 @@ bool NativeFarCall::reloc_set_destination(address dest) {
|
||||
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()) {
|
||||
stub_addr = trampoline_stub_Relocation::get_trampoline_for(call_addr, code->as_nmethod());
|
||||
}
|
||||
|
||||
if (stub_addr != nullptr) {
|
||||
MacroAssembler::pd_patch_instruction_size(call_addr, stub_addr);
|
||||
}
|
||||
@@ -209,7 +205,7 @@ 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;
|
||||
}
|
||||
return false;
|
||||
@@ -238,8 +234,8 @@ 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);
|
||||
address NativeCall::reloc_destination() {
|
||||
return NativeFarCall::at(addr_at(0))->reloc_destination();
|
||||
}
|
||||
|
||||
void NativeCall::set_destination(address dest) {
|
||||
@@ -254,8 +250,8 @@ 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::set_destination_mt_safe(address dest) {
|
||||
return NativeFarCall::at(addr_at(0))->set_destination_mt_safe(dest);
|
||||
}
|
||||
|
||||
bool NativeCall::reloc_set_destination(address dest) {
|
||||
@@ -339,35 +335,10 @@ void NativeMovConstReg::print() {
|
||||
p2i(instruction_address()), data());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
int NativeMovRegMem::offset() const {
|
||||
Unimplemented();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NativeMovRegMem::set_offset(int x) { Unimplemented(); }
|
||||
|
||||
void NativeMovRegMem::verify() {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
void NativeJump::verify() { }
|
||||
|
||||
|
||||
void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
|
||||
// Patching to not_entrant can happen while activations of the method are
|
||||
// in use. The patching in that instance must happen only when certain
|
||||
// alignment restrictions are true. These guarantees check those
|
||||
// conditions.
|
||||
|
||||
// Must be 4 bytes aligned
|
||||
MacroAssembler::assert_alignment(verified_entry);
|
||||
}
|
||||
|
||||
|
||||
address NativeJump::jump_destination() const {
|
||||
address dest = MacroAssembler::target_addr_for_insn(instruction_address());
|
||||
|
||||
@@ -420,12 +391,6 @@ bool NativeInstruction::is_safepoint_poll() {
|
||||
return MacroAssembler::is_lwu_to_zr(address(this));
|
||||
}
|
||||
|
||||
// A 16-bit instruction with all bits ones is permanently reserved as an illegal instruction.
|
||||
bool NativeInstruction::is_sigill_not_entrant() {
|
||||
// jvmci
|
||||
return uint_at(0) == 0xffffffff;
|
||||
}
|
||||
|
||||
void NativeIllegalInstruction::insert(address code_pos) {
|
||||
assert_cond(code_pos != nullptr);
|
||||
Assembler::sd_instr(code_pos, 0xffffffff); // all bits ones is permanently reserved as an illegal instruction
|
||||
@@ -437,45 +402,6 @@ bool NativeInstruction::is_stop() {
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
// MT-safe inserting of a jump over a jump or a nop (used by
|
||||
// nmethod::make_not_entrant)
|
||||
|
||||
void NativeJump::patch_verified_entry(address entry, address verified_entry, address dest) {
|
||||
|
||||
assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "expected fixed destination of patch");
|
||||
|
||||
assert(nativeInstruction_at(verified_entry)->is_jump_or_nop() ||
|
||||
nativeInstruction_at(verified_entry)->is_sigill_not_entrant(),
|
||||
"riscv cannot replace non-jump with jump");
|
||||
|
||||
check_verified_entry_alignment(entry, verified_entry);
|
||||
|
||||
// Patch this nmethod atomically.
|
||||
if (Assembler::reachable_from_branch_at(verified_entry, dest)) {
|
||||
ptrdiff_t offset = dest - verified_entry;
|
||||
guarantee(Assembler::is_simm21(offset) && ((offset % 2) == 0),
|
||||
"offset is too large to be patched in one jal instruction."); // 1M
|
||||
|
||||
uint32_t insn = 0;
|
||||
address pInsn = (address)&insn;
|
||||
Assembler::patch(pInsn, 31, 31, (offset >> 20) & 0x1);
|
||||
Assembler::patch(pInsn, 30, 21, (offset >> 1) & 0x3ff);
|
||||
Assembler::patch(pInsn, 20, 20, (offset >> 11) & 0x1);
|
||||
Assembler::patch(pInsn, 19, 12, (offset >> 12) & 0xff);
|
||||
Assembler::patch(pInsn, 11, 7, 0); // zero, no link jump
|
||||
Assembler::patch(pInsn, 6, 0, 0b1101111); // j, (jal x0 offset)
|
||||
Assembler::sd_instr(verified_entry, insn);
|
||||
} else {
|
||||
// We use an illegal instruction for marking a method as
|
||||
// not_entrant.
|
||||
NativeIllegalInstruction::insert(verified_entry);
|
||||
}
|
||||
|
||||
ICache::invalidate_range(verified_entry, instruction_size);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void NativeGeneralJump::insert_unconditional(address code_pos, address entry) {
|
||||
CodeBuffer cb(code_pos, instruction_size);
|
||||
MacroAssembler a(&cb);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@@ -37,7 +37,7 @@
|
||||
// - NativeInstruction
|
||||
// - - NativeCall
|
||||
// - - NativeMovConstReg
|
||||
// - - NativeMovRegMem
|
||||
// - - NativeMovRegMem - Unimplemented
|
||||
// - - NativeJump
|
||||
// - - NativeGeneralJump
|
||||
// - - NativeIllegalInstruction
|
||||
@@ -74,7 +74,6 @@ class NativeInstruction {
|
||||
bool is_nop() const;
|
||||
bool is_jump_or_nop();
|
||||
bool is_safepoint_poll();
|
||||
bool is_sigill_not_entrant();
|
||||
bool is_stop();
|
||||
|
||||
protected:
|
||||
@@ -135,14 +134,14 @@ class NativeCall: private NativeInstruction {
|
||||
address next_instruction_address() const;
|
||||
address return_address() const;
|
||||
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);
|
||||
bool set_destination_mt_safe(address dest);
|
||||
bool reloc_set_destination(address dest);
|
||||
|
||||
static bool is_at(address addr);
|
||||
@@ -219,38 +218,18 @@ inline NativeMovConstReg* nativeMovConstReg_before(address addr) {
|
||||
// NativeMovRegMem to keep some compilers happy.
|
||||
class NativeMovRegMem: public NativeInstruction {
|
||||
public:
|
||||
enum RISCV_specific_constants {
|
||||
instruction_size = NativeInstruction::instruction_size,
|
||||
instruction_offset = 0,
|
||||
data_offset = 0,
|
||||
next_instruction_offset = NativeInstruction::instruction_size
|
||||
};
|
||||
int num_bytes_to_end_of_patch() const { Unimplemented(); return 0; }
|
||||
|
||||
int instruction_start() const { return instruction_offset; }
|
||||
int offset() const { Unimplemented(); return 0; }
|
||||
|
||||
address instruction_address() const { return addr_at(instruction_offset); }
|
||||
void set_offset(int x) { Unimplemented(); }
|
||||
|
||||
int num_bytes_to_end_of_patch() const { return instruction_offset + instruction_size; }
|
||||
|
||||
int offset() const;
|
||||
|
||||
void set_offset(int x);
|
||||
|
||||
void add_offset_in_bytes(int add_offset) {
|
||||
set_offset(offset() + add_offset);
|
||||
}
|
||||
|
||||
void verify();
|
||||
void print();
|
||||
|
||||
private:
|
||||
inline friend NativeMovRegMem* nativeMovRegMem_at(address addr);
|
||||
void add_offset_in_bytes(int add_offset) { Unimplemented(); }
|
||||
};
|
||||
|
||||
inline NativeMovRegMem* nativeMovRegMem_at(address addr) {
|
||||
NativeMovRegMem* test = (NativeMovRegMem*)(addr - NativeMovRegMem::instruction_offset);
|
||||
DEBUG_ONLY(test->verify());
|
||||
return test;
|
||||
Unimplemented();
|
||||
return (NativeMovRegMem*)nullptr;
|
||||
}
|
||||
|
||||
class NativeJump: public NativeInstruction {
|
||||
@@ -274,9 +253,6 @@ class NativeJump: public NativeInstruction {
|
||||
|
||||
// Insertion of native jump instruction
|
||||
static void insert(address code_pos, address entry);
|
||||
// MT-safe insertion of native jump at verified method entry
|
||||
static void check_verified_entry_alignment(address entry, address verified_entry);
|
||||
static void patch_verified_entry(address entry, address verified_entry, address dest);
|
||||
};
|
||||
|
||||
inline NativeJump* nativeJump_at(address addr) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -1368,14 +1368,6 @@ void MachPrologNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
|
||||
// n.b. frame size includes space for return pc and fp
|
||||
const int framesize = C->output()->frame_size_in_bytes();
|
||||
|
||||
// insert a nop at the start of the prolog so we can patch in a
|
||||
// branch if we need to invalidate the method later
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm); // keep the nop as 4 bytes for patching.
|
||||
MacroAssembler::assert_alignment(__ pc());
|
||||
__ nop(); // 4 bytes
|
||||
}
|
||||
|
||||
assert_cond(C != nullptr);
|
||||
|
||||
if (C->clinit_barrier_on_entry()) {
|
||||
@@ -1804,7 +1796,6 @@ void MachUEPNode::emit(C2_MacroAssembler* masm, PhaseRegAlloc* ra_) const
|
||||
// This is the unverified entry point.
|
||||
__ ic_check(CodeEntryAlignment);
|
||||
|
||||
// Verified entry point must be properly 4 bytes aligned for patching by NativeJump::patch_verified_entry().
|
||||
// ic_check() aligns to CodeEntryAlignment >= InteriorEntryAlignment(min 16) > NativeInstruction::instruction_size(4).
|
||||
assert(((__ offset()) % CodeEntryAlignment) == 0, "Misaligned verified entry point");
|
||||
}
|
||||
@@ -1994,17 +1985,31 @@ int Matcher::max_vector_size(const BasicType bt) {
|
||||
}
|
||||
|
||||
int Matcher::min_vector_size(const BasicType bt) {
|
||||
int max_size = max_vector_size(bt);
|
||||
// Limit the min vector size to 8 bytes.
|
||||
int size = 8 / type2aelembytes(bt);
|
||||
if (bt == T_BYTE) {
|
||||
// To support vector api shuffle/rearrange.
|
||||
size = 4;
|
||||
} else if (bt == T_BOOLEAN) {
|
||||
// To support vector api load/store mask.
|
||||
size = 2;
|
||||
int size;
|
||||
switch(bt) {
|
||||
case T_BOOLEAN:
|
||||
// Load/store a vector mask with only 2 elements for vector types
|
||||
// such as "2I/2F/2L/2D".
|
||||
size = 2;
|
||||
break;
|
||||
case T_BYTE:
|
||||
// Generate a "4B" vector, to support vector cast between "8B/16B"
|
||||
// and "4S/4I/4L/4F/4D".
|
||||
size = 4;
|
||||
break;
|
||||
case T_SHORT:
|
||||
// Generate a "2S" vector, to support vector cast between "4S/8S"
|
||||
// and "2I/2L/2F/2D".
|
||||
size = 2;
|
||||
break;
|
||||
default:
|
||||
// Limit the min vector length to 64-bit.
|
||||
size = 8 / type2aelembytes(bt);
|
||||
// The number of elements in a vector should be at least 2.
|
||||
size = MAX2(size, 2);
|
||||
}
|
||||
if (size < 2) size = 2;
|
||||
|
||||
int max_size = max_vector_size(bt);
|
||||
return MIN2(size, max_size);
|
||||
}
|
||||
|
||||
@@ -8199,7 +8204,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");
|
||||
@@ -8435,6 +8440,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
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user