mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 17:39:40 +01:00
Compare commits
682 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
869b50a639 | ||
|
|
77cf8ed0dd | ||
|
|
ffac8df8b1 | ||
|
|
24e29c8774 | ||
|
|
838741cf0f | ||
|
|
61e6fb1586 | ||
|
|
70d22558e6 | ||
|
|
8f203c3da6 | ||
|
|
7eb6a282e9 | ||
|
|
0b954aaa9c | ||
|
|
b48b9e0a27 | ||
|
|
76609f3ae2 | ||
|
|
7793fc89cb | ||
|
|
28ce81cb26 | ||
|
|
37d906e0bb | ||
|
|
cb0245e66f | ||
|
|
efb04a90de | ||
|
|
d7b0ebd0e2 | ||
|
|
4fe30ac595 | ||
|
|
698d8f6f45 | ||
|
|
e52e6f85f6 | ||
|
|
ecb5ff220e | ||
|
|
50f97dd320 | ||
|
|
fa3c1c0750 | ||
|
|
1dc6f955f6 | ||
|
|
57dd1b4bdd | ||
|
|
03fd0867a7 | ||
|
|
71db65e090 | ||
|
|
8e0458c4e8 | ||
|
|
22a229c23a | ||
|
|
d858fa2ac0 | ||
|
|
068a76c54c | ||
|
|
7303892b7f | ||
|
|
2799cdbdfd | ||
|
|
3b27838dab | ||
|
|
93e8419be6 | ||
|
|
b94d5431da | ||
|
|
2416c47967 | ||
|
|
40644b2736 | ||
|
|
53b6d61a17 | ||
|
|
40559f86bf | ||
|
|
fffb0e9560 | ||
|
|
9a2941aa8e | ||
|
|
61ea0be9b2 | ||
|
|
755e5f6b57 | ||
|
|
12ba27af82 | ||
|
|
6a000c143e | ||
|
|
13d71d1192 | ||
|
|
d12863856a | ||
|
|
d40efa111b | ||
|
|
17ef2ad1d1 | ||
|
|
e916dca5a7 | ||
|
|
8b0e632a0b | ||
|
|
982846e60c | ||
|
|
6567b4b1a9 | ||
|
|
0cbec0caef | ||
|
|
2a43129290 | ||
|
|
65a7cc6d22 | ||
|
|
857891fb87 | ||
|
|
d26b57199c | ||
|
|
a8725f2acb | ||
|
|
8c3873b7e8 | ||
|
|
81bf622589 | ||
|
|
96acea2265 | ||
|
|
946dcfe767 | ||
|
|
efecbac9bb | ||
|
|
fc222a0154 | ||
|
|
2a7428f3d7 | ||
|
|
48df5d367a | ||
|
|
578da92dc2 | ||
|
|
d1cea2ff04 | ||
|
|
ba02769ca6 | ||
|
|
8c8144a7c1 | ||
|
|
6a30c56138 | ||
|
|
93ad4f06dd | ||
|
|
d3018a1837 | ||
|
|
2bf43a57ab | ||
|
|
6769b27e53 | ||
|
|
e43cfd198f | ||
|
|
6e1c514c6c | ||
|
|
e2637199e9 | ||
|
|
47ff31ae82 | ||
|
|
a5e25d1ef9 | ||
|
|
eea293f4a4 | ||
|
|
e0475e9ba2 | ||
|
|
087ff34c2e | ||
|
|
0db7e948af | ||
|
|
b871188f44 | ||
|
|
51ce1d6427 | ||
|
|
7fb31a1665 | ||
|
|
e6752600a5 | ||
|
|
a5bd092449 | ||
|
|
b16ee45915 | ||
|
|
8c9402b60b | ||
|
|
2c0d6150d0 | ||
|
|
f309844f75 | ||
|
|
d45cab03b1 | ||
|
|
e33577c3a5 | ||
|
|
32e9c4d353 | ||
|
|
44d62b3234 | ||
|
|
0f0ab2c5ba | ||
|
|
1a807593ab | ||
|
|
241c14cb92 | ||
|
|
601064c09c | ||
|
|
2120a8a282 | ||
|
|
36ef23fb81 | ||
|
|
2afd3d4821 | ||
|
|
4b8e82db67 | ||
|
|
90d22980d5 | ||
|
|
0d1778962d | ||
|
|
276a53ba14 | ||
|
|
b483235e7f | ||
|
|
bc6ff706da | ||
|
|
27ffa822c1 | ||
|
|
9174496aa0 | ||
|
|
d7d16faf16 | ||
|
|
653e7a8101 | ||
|
|
fcb22de8b0 | ||
|
|
af0e3f69fa | ||
|
|
cd74581779 | ||
|
|
74ce667016 | ||
|
|
161a7eac4a | ||
|
|
54a2e76122 | ||
|
|
be4219caab | ||
|
|
4a3199dc9d | ||
|
|
b63b0ae668 | ||
|
|
7a084221ca | ||
|
|
4165ef6306 | ||
|
|
14b7c5adef | ||
|
|
71fa983bc1 | ||
|
|
8a2f49d98b | ||
|
|
c971c7fa88 | ||
|
|
b9996c7b47 | ||
|
|
f160303ec9 | ||
|
|
307d1c1fd7 | ||
|
|
25302b9289 | ||
|
|
1759eb2b89 | ||
|
|
d27d2e2baa | ||
|
|
c13fd2cb3e | ||
|
|
c1624ddd8d | ||
|
|
65affdb4f7 | ||
|
|
08f6a61016 | ||
|
|
edf629d075 | ||
|
|
d8d095563e | ||
|
|
486f078759 | ||
|
|
9b087fe5da | ||
|
|
bd606c0383 | ||
|
|
d05263d08c | ||
|
|
5629899859 | ||
|
|
d3107db64d | ||
|
|
e2901b99db | ||
|
|
d7723b6110 | ||
|
|
483e5158be | ||
|
|
5f3c9c11ba | ||
|
|
fd6e0efbd5 | ||
|
|
fbd999542a | ||
|
|
5a252a96f1 | ||
|
|
1b9c3ed57b | ||
|
|
8b32d4cc6f | ||
|
|
54152197f5 | ||
|
|
2588bb7a92 | ||
|
|
fb6a542b84 | ||
|
|
4606f42a4b | ||
|
|
6e29b5cd43 | ||
|
|
6c12492aef | ||
|
|
4ead63ebbe | ||
|
|
6934ca4826 | ||
|
|
f6b4e4d52d | ||
|
|
c49a889919 | ||
|
|
1ff8b4b6df | ||
|
|
748f55a971 | ||
|
|
3c594007b5 | ||
|
|
19482e0c9f | ||
|
|
c17f1e9ffe | ||
|
|
e6cae2dd1a | ||
|
|
8373d64d08 | ||
|
|
433d7d4681 | ||
|
|
9d03be4e29 | ||
|
|
0348537300 | ||
|
|
cd285c9022 | ||
|
|
4dcff472fa | ||
|
|
0b6cba009c | ||
|
|
fbb2e417c9 | ||
|
|
c866c331cd | ||
|
|
4c78467a0d | ||
|
|
6b0ad1c96f | ||
|
|
acb92a2a1a | ||
|
|
aea97028fb | ||
|
|
d6404cf65e | ||
|
|
20a26347e4 | ||
|
|
397f951cd2 | ||
|
|
d1b6691295 | ||
|
|
4a588d89f0 | ||
|
|
f70fc149b5 | ||
|
|
764b50a7e3 | ||
|
|
44c6537b57 | ||
|
|
4d13bf33d4 | ||
|
|
846d21961c | ||
|
|
6986d53af9 | ||
|
|
11a8c9c13e | ||
|
|
7efa6090e8 | ||
|
|
03cf1c3a83 | ||
|
|
3a8a15b5d0 | ||
|
|
fcd5d414d6 | ||
|
|
922ba8da30 | ||
|
|
8a9d2b08a0 | ||
|
|
a28f4100ce | ||
|
|
54ad4f9a80 | ||
|
|
33016a8325 | ||
|
|
39b22d134f | ||
|
|
c7b074a9db | ||
|
|
8d97637cf2 | ||
|
|
af0d6d28b0 | ||
|
|
ac38b399de | ||
|
|
4a4003e900 | ||
|
|
1c882d91f0 | ||
|
|
24a7d8c766 | ||
|
|
d63aebe6cb | ||
|
|
4320afbd58 | ||
|
|
546158fb42 | ||
|
|
9694ca9eaf | ||
|
|
3770be7f70 | ||
|
|
507e54840f | ||
|
|
1108a4a77c | ||
|
|
18f3591a1b | ||
|
|
55039aa1c6 | ||
|
|
24f4f14c3d | ||
|
|
f636b84f48 | ||
|
|
62d77dc3fc | ||
|
|
8cfc7e39df | ||
|
|
e07ad838b5 | ||
|
|
b27e717c56 | ||
|
|
1b5391264a | ||
|
|
be2a92d8c7 | ||
|
|
681d06d39b | ||
|
|
8906904591 | ||
|
|
a640835c62 | ||
|
|
d7c1bb1fb7 | ||
|
|
6d201dbba6 | ||
|
|
919eb12b14 | ||
|
|
6c95a87157 | ||
|
|
ba1db57dde | ||
|
|
765abcb329 | ||
|
|
606aad5dc8 | ||
|
|
52977fd914 | ||
|
|
265b36ff28 | ||
|
|
a9b7ae8ac2 | ||
|
|
7a6c1a66b2 | ||
|
|
be04c8c724 | ||
|
|
92be493f0b | ||
|
|
77c83d9ee6 | ||
|
|
5b2fd36a6d | ||
|
|
04280a0d05 | ||
|
|
c5ad1daa96 | ||
|
|
9bbec0433c | ||
|
|
a376fb7720 | ||
|
|
32482c82a6 | ||
|
|
b67814941f | ||
|
|
a18e8d3d57 | ||
|
|
8f26a1f748 | ||
|
|
37880ba60d | ||
|
|
1b1fb08000 | ||
|
|
183dadbef2 | ||
|
|
2fe15bc62e | ||
|
|
69a9403995 | ||
|
|
9f0bafe6ad | ||
|
|
dda0c6cecd | ||
|
|
e5c43ab86e | ||
|
|
a0e5043781 | ||
|
|
802737cae7 | ||
|
|
ddcb17e1e0 | ||
|
|
e87c864847 | ||
|
|
5899ef11fb | ||
|
|
f4756fdf48 | ||
|
|
ca91da0e0c | ||
|
|
c7ecaa4a1d | ||
|
|
1b3a127d06 | ||
|
|
653af300cc | ||
|
|
7a4bf2456e | ||
|
|
45fce6baf9 | ||
|
|
a8d20c9254 | ||
|
|
79ad5512cf | ||
|
|
63a6adf2b5 | ||
|
|
82cc03fa89 | ||
|
|
734a6c94d3 | ||
|
|
6c89a9653e | ||
|
|
5cf33168d7 | ||
|
|
999357250a | ||
|
|
5a90271d01 | ||
|
|
dc0c0c7eca | ||
|
|
72ae322022 | ||
|
|
a4b135316c | ||
|
|
2e65885257 | ||
|
|
55e7003fd5 | ||
|
|
83a8c4acc7 | ||
|
|
46ff8fdce9 | ||
|
|
0f43de9f02 | ||
|
|
abc55dea7e | ||
|
|
eb1bacc71b | ||
|
|
05dc2af21f | ||
|
|
d5ae932b3f | ||
|
|
a7e352b554 | ||
|
|
144267d30f | ||
|
|
d19f2bdec0 | ||
|
|
320af9b34b | ||
|
|
d180fb3044 | ||
|
|
1a4f31409a | ||
|
|
d16ea55b62 | ||
|
|
97cdfb92f8 | ||
|
|
f44f885f27 | ||
|
|
a2db08ae98 | ||
|
|
1ef33e4df9 | ||
|
|
2534e72618 | ||
|
|
e098a31307 | ||
|
|
708b60e8c6 | ||
|
|
fc82768478 | ||
|
|
8a424425e1 | ||
|
|
5724c0d321 | ||
|
|
b4ea9cf23e | ||
|
|
d886d8c465 | ||
|
|
601e566b26 | ||
|
|
31c511e6a5 | ||
|
|
42d3bad0b1 | ||
|
|
34755c3528 | ||
|
|
f45d121128 | ||
|
|
4b3c33bac1 | ||
|
|
d85ff3c7f0 | ||
|
|
29936542ad | ||
|
|
6715f2306e | ||
|
|
2f09989ec0 | ||
|
|
4bcd70acc0 | ||
|
|
e66a2a3384 | ||
|
|
1e1985da9b | ||
|
|
36d716aa08 | ||
|
|
7f69acc778 | ||
|
|
6469685285 | ||
|
|
4167ba1288 | ||
|
|
12554c2c03 | ||
|
|
9a99f511aa | ||
|
|
9a120e7f79 | ||
|
|
61e44cdb6a | ||
|
|
eb758d53f1 | ||
|
|
f834dc3dc9 | ||
|
|
c4df79117d | ||
|
|
25b1e5a7bd | ||
|
|
e0a7782a9e | ||
|
|
8b6d3147fb | ||
|
|
2e6923ffd6 | ||
|
|
9d40d80237 | ||
|
|
f2b191a6e9 | ||
|
|
983e012c9f | ||
|
|
ffbee17d8a | ||
|
|
226e852831 | ||
|
|
5d1255bf52 | ||
|
|
326ba31787 | ||
|
|
bf1e6903a2 | ||
|
|
e208d9aa1f | ||
|
|
510354452f | ||
|
|
6c2c0563eb | ||
|
|
2155d525dd | ||
|
|
de3923edf9 | ||
|
|
a750ac5feb | ||
|
|
56048d0480 | ||
|
|
11ac92c8fb | ||
|
|
cfab7f4c68 | ||
|
|
2cbdd21ed7 | ||
|
|
59a4517d07 | ||
|
|
ecb4cbfd4a | ||
|
|
ce4978ffe6 | ||
|
|
2a794b696c | ||
|
|
ed4b801771 | ||
|
|
338dd21cfe | ||
|
|
f740cda526 | ||
|
|
5547d3204d | ||
|
|
3237e82b4b | ||
|
|
a27ee6b284 | ||
|
|
dee90e4736 | ||
|
|
e7f8e1fdb5 | ||
|
|
5073b8c163 | ||
|
|
e5d33163c7 | ||
|
|
bf300e8d8c | ||
|
|
02cec3470f | ||
|
|
f968f32789 | ||
|
|
c55b06a4d5 | ||
|
|
898c638b95 | ||
|
|
6cdf06f02b | ||
|
|
6c3c3dad97 | ||
|
|
b71dac2502 | ||
|
|
fd7123b268 | ||
|
|
ca85c5ab15 | ||
|
|
e3b04bc135 | ||
|
|
bc73f12313 | ||
|
|
faaf52cc30 | ||
|
|
2536cbf2cf | ||
|
|
241f401815 | ||
|
|
e68f81ab4c | ||
|
|
7b988b31c6 | ||
|
|
eeb3c5e9e3 | ||
|
|
4bc69f4255 | ||
|
|
19c5bfe42f | ||
|
|
56d333c538 | ||
|
|
0b8f18beda | ||
|
|
edefd3c198 | ||
|
|
c0475c81f2 | ||
|
|
30ff2ad58c | ||
|
|
212ab17635 | ||
|
|
7e05213271 | ||
|
|
95730995b6 | ||
|
|
03642a01af | ||
|
|
2085fd32ff | ||
|
|
83d0318ea1 | ||
|
|
0228a5c767 | ||
|
|
b9ce3b435e | ||
|
|
6a2e3ca206 | ||
|
|
c563c3d15b | ||
|
|
96fadefaa3 | ||
|
|
6d8c81f694 | ||
|
|
2ff9f53a44 | ||
|
|
bb5e5b3826 | ||
|
|
462f806818 | ||
|
|
259662fe77 | ||
|
|
a2401333fa | ||
|
|
609819173e | ||
|
|
e3cb4df4ef | ||
|
|
52be8949e7 | ||
|
|
7450098458 | ||
|
|
54f7732c2b | ||
|
|
b03766fb79 | ||
|
|
120a0d116a | ||
|
|
99136026b8 | ||
|
|
e47b2bc8c3 | ||
|
|
bf22f82207 | ||
|
|
847a3baca8 | ||
|
|
268d870187 | ||
|
|
714b345bf5 | ||
|
|
191fe75c0f | ||
|
|
d36a55d2ac | ||
|
|
f3c2a17a30 | ||
|
|
65c461ed74 | ||
|
|
7e3d4f8c4f | ||
|
|
1dc79293a0 | ||
|
|
19be497143 | ||
|
|
2e8356ea40 | ||
|
|
c4985fb868 | ||
|
|
a5e03e234b | ||
|
|
0e770d1e3f | ||
|
|
b4d09cc9e4 | ||
|
|
81685b2ab3 | ||
|
|
c58aaca77e | ||
|
|
8e865fc569 | ||
|
|
90a774b922 | ||
|
|
a6df9ae23a | ||
|
|
07e6b75ff5 | ||
|
|
0652a7883d | ||
|
|
56abdc178e | ||
|
|
80ae89b1aa | ||
|
|
ee452946fc | ||
|
|
b6a9f3015a | ||
|
|
0bf3ba402b | ||
|
|
27e168677f | ||
|
|
140a79765f | ||
|
|
41c5a07fa9 | ||
|
|
9d0ba7ae7f | ||
|
|
d7e68f375c | ||
|
|
cd16b568ce | ||
|
|
63a3d8f0f2 | ||
|
|
4d8189b265 | ||
|
|
82e3640eb1 | ||
|
|
8dc66431d4 | ||
|
|
dc91b06661 | ||
|
|
b37d806d82 | ||
|
|
976c469305 | ||
|
|
71d646a160 | ||
|
|
6fc6476da8 | ||
|
|
9cd41b6555 | ||
|
|
1786701011 | ||
|
|
63ade9c49c | ||
|
|
46f4bf93db | ||
|
|
a748779e1e | ||
|
|
785b914282 | ||
|
|
a043bd0ff8 | ||
|
|
5805cbeaaf | ||
|
|
ea9aeda5ee | ||
|
|
b073038e54 | ||
|
|
e90621c169 | ||
|
|
358714bcd0 | ||
|
|
3943f9d0b7 | ||
|
|
2845c3d029 | ||
|
|
f87ef60b09 | ||
|
|
28d2cdf99a | ||
|
|
045d61b5e0 | ||
|
|
086c5f1750 | ||
|
|
201d0a48d1 | ||
|
|
6cbd66b1c1 | ||
|
|
f160c80e3b | ||
|
|
ac2828ddf1 | ||
|
|
9a8ace2c0a | ||
|
|
6e43cddad7 | ||
|
|
3df95aa377 | ||
|
|
5b6f050fce | ||
|
|
59428f4a0d | ||
|
|
ac906168c8 | ||
|
|
c47f27e1c6 | ||
|
|
022d7a19d3 | ||
|
|
9149f10fa4 | ||
|
|
7d6c1cf4a8 | ||
|
|
a98bad2b22 | ||
|
|
35ceac0083 | ||
|
|
be14526569 | ||
|
|
ff8c6d5deb | ||
|
|
2625942c43 | ||
|
|
cd651b9aad | ||
|
|
2048bcb648 | ||
|
|
71c926c4f6 | ||
|
|
a46a94c431 | ||
|
|
8d19eca78c | ||
|
|
9c3be78826 | ||
|
|
97fc959e35 | ||
|
|
13d30235e1 | ||
|
|
ec4240b342 | ||
|
|
efffff1dbb | ||
|
|
0b02c5b5e0 | ||
|
|
498b0e61ed | ||
|
|
06e47d05b6 | ||
|
|
c66bef0289 | ||
|
|
45fa5aa699 | ||
|
|
4de4200652 | ||
|
|
cb960ee7b5 | ||
|
|
f833afa660 | ||
|
|
5aea3f0250 | ||
|
|
5f0f4d75e0 | ||
|
|
6c3bc71079 | ||
|
|
0963050548 | ||
|
|
d071ed0294 | ||
|
|
b4943a3f02 | ||
|
|
e97c5f41ee | ||
|
|
d616488567 | ||
|
|
c328bca493 | ||
|
|
cd340d5e70 | ||
|
|
7514ad9ad0 | ||
|
|
604005d65c | ||
|
|
1d4bd253e4 | ||
|
|
9e43496c42 | ||
|
|
f79801b74d | ||
|
|
5314d28f84 | ||
|
|
e639c9a840 | ||
|
|
4f9020f481 | ||
|
|
d101efc16b | ||
|
|
72f1a49746 | ||
|
|
984373408e | ||
|
|
6fd44901ec | ||
|
|
02fbf44cc7 | ||
|
|
b43f356288 | ||
|
|
c0a1a4e4fc | ||
|
|
55ed0d853f | ||
|
|
5967aaf629 | ||
|
|
4708c6d343 | ||
|
|
53015e6d82 | ||
|
|
339d52600b | ||
|
|
7cc3ba5f9b | ||
|
|
e4a972de1a | ||
|
|
342e9f88cd | ||
|
|
85822a50d5 | ||
|
|
9b3fb5d1d5 | ||
|
|
c638618814 | ||
|
|
04b3bf6024 | ||
|
|
15433df97f | ||
|
|
ab042c601f | ||
|
|
af85c26514 | ||
|
|
b58735ea76 | ||
|
|
b852688c05 | ||
|
|
34fc33074a | ||
|
|
19c29923a5 | ||
|
|
d7bbb5c4a6 | ||
|
|
343ecd806b | ||
|
|
0ffa6b75fd | ||
|
|
fe514a2e55 | ||
|
|
e3673d4677 | ||
|
|
45258a1799 | ||
|
|
0c58055bac | ||
|
|
6ac3892e16 | ||
|
|
c90e523e0a | ||
|
|
800f133a29 | ||
|
|
45cace2867 | ||
|
|
8fdbb29079 | ||
|
|
fa3d79c2f8 | ||
|
|
151b6f1402 | ||
|
|
4d75aef609 | ||
|
|
8384f7ff28 | ||
|
|
1c27ce30b4 | ||
|
|
aee74901f7 | ||
|
|
9d5f388498 | ||
|
|
9a7f519aee | ||
|
|
507816d550 | ||
|
|
0db1be28c7 | ||
|
|
b94314a0d9 | ||
|
|
9a88048a05 | ||
|
|
1b59097077 | ||
|
|
9cadf1a004 | ||
|
|
dd016c34dd | ||
|
|
a351ebd40b | ||
|
|
e1b8e91e80 | ||
|
|
4365c2b745 | ||
|
|
62d1de37e2 | ||
|
|
bcbe46b0b3 | ||
|
|
2bfc64ad1f | ||
|
|
7d1eb8f07c | ||
|
|
827c8865d8 | ||
|
|
d9fc44540e | ||
|
|
f1e1cb7055 | ||
|
|
eec7750e55 | ||
|
|
f7cb0f760f | ||
|
|
99d6bea20d | ||
|
|
06b49fa3f7 | ||
|
|
10874e0291 | ||
|
|
a809ff0e3f | ||
|
|
b5678a43cc | ||
|
|
a180444c6f | ||
|
|
5fc89b6e72 | ||
|
|
1314ca87c1 | ||
|
|
26a18414f6 | ||
|
|
56b7960496 | ||
|
|
563ce12127 | ||
|
|
d347d2ebf9 | ||
|
|
3dc78e76e4 | ||
|
|
453f6cf4d9 | ||
|
|
f2cd6d6a10 | ||
|
|
0366f6bf45 | ||
|
|
ddbc7ed0a1 | ||
|
|
7e862f91dc | ||
|
|
47cc808b98 | ||
|
|
1933fe39ae | ||
|
|
5ce3d0d8e5 | ||
|
|
334df28eca | ||
|
|
512cc3ebf2 | ||
|
|
8752e02e66 | ||
|
|
5f67125ba6 | ||
|
|
f6ad22fce5 | ||
|
|
a1114948b0 | ||
|
|
ccb6d0e572 | ||
|
|
9c99008aff | ||
|
|
01cfedf2c9 | ||
|
|
ed538ea5e0 | ||
|
|
82dc495ca0 | ||
|
|
19257f4fb7 | ||
|
|
22532ff30e | ||
|
|
f7a65b7fff | ||
|
|
f39a71cafe | ||
|
|
b5775c831d | ||
|
|
f822eed55c | ||
|
|
5793b0633a | ||
|
|
44ae643b2b | ||
|
|
04ad75e788 | ||
|
|
1adecc8e3a | ||
|
|
00f223e22f | ||
|
|
30aa1b0689 | ||
|
|
d42bfef8a4 | ||
|
|
567692e4ae | ||
|
|
5e5880d4f1 | ||
|
|
1f698a35f2 | ||
|
|
f3e027c001 | ||
|
|
ad7dafb138 | ||
|
|
0b20eafb30 | ||
|
|
d0c6eef9a5 | ||
|
|
0ec39a0b70 | ||
|
|
5a57b9f8ec | ||
|
|
4d10ebba12 | ||
|
|
bfd2e96120 | ||
|
|
7467cd2ee5 | ||
|
|
231d9a01d9 | ||
|
|
116aee4950 | ||
|
|
0082c69496 | ||
|
|
6212aea580 | ||
|
|
4eeb61299f | ||
|
|
3476724641 | ||
|
|
697fb9e41b | ||
|
|
fc02d9872e | ||
|
|
d285fd6dce | ||
|
|
8a616df8b5 | ||
|
|
a5a46ff8e5 | ||
|
|
da6daad2e5 | ||
|
|
1bfcf768f5 |
13
.hgtags
13
.hgtags
@@ -638,3 +638,16 @@ f143729ca00ec14a98ea5c7f73acba88da97746e jdk-15+23
|
||||
58833044988772ca06c97ab2f142474a8627af80 jdk-15+25
|
||||
58833044988772ca06c97ab2f142474a8627af80 jdk-15+25
|
||||
90b266a84c06f1b3dc0ed8767856793e8c1c357e jdk-15+25
|
||||
0a32396f7a690015d22ca3328ac441a358295d90 jdk-15+26
|
||||
506abc554caeb275928c02bf3a16e95d1978749f jdk-15+27
|
||||
506abc554caeb275928c02bf3a16e95d1978749f jdk-15+27
|
||||
93813843680bbe1b7efbca56c03fd137f20a2c31 jdk-15+27
|
||||
06c9f89459daba98395fad726100feb44f89ba71 jdk-15+28
|
||||
b58fc60580550a4a587cab729d8fd87223ad6932 jdk-15+29
|
||||
6909e4a1f25bfe9a2727026f5845fc1fc44a36aa jdk-15+30
|
||||
a32f58c6b8be81877411767de7ba9c4cf087c1b5 jdk-15+31
|
||||
2dad000726b8d5db9f3df647fb4949d88f269dd4 jdk-15+32
|
||||
6b65f4e7a975628df51ef755b02642075390041d jdk-15+33
|
||||
b0817631d2f4395508cb10e81c3858a94d9ae4de jdk-15+34
|
||||
fd60c3146a024037cdd9be34c645bb793995a7cc jdk-15+35
|
||||
e3f940bd3c8fcdf4ca704c6eb1ac745d155859d5 jdk-15+36
|
||||
|
||||
8
README
8
README
@@ -2,11 +2,11 @@
|
||||
Welcome to the JDK!
|
||||
===================
|
||||
|
||||
For information about building the JDK, including how to retrieve all
|
||||
of the source code, please see either of these files:
|
||||
For build instructions, please see either of these files:
|
||||
|
||||
* doc/building.html (html version)
|
||||
* doc/building.md (markdown version)
|
||||
|
||||
See http://openjdk.java.net/ for more information about the OpenJDK
|
||||
Community and the JDK.
|
||||
See https://openjdk.java.net/ for more information about
|
||||
the OpenJDK Community and the JDK.
|
||||
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
###########################################################################################
|
||||
# This is a helper script to evaluate nashorn with optimistic types
|
||||
# it produces a flight recording for every run, and uses the best
|
||||
# known flags for performance for the current configration
|
||||
###########################################################################################
|
||||
|
||||
# Flags to enable assertions, we need the system assertions too, since
|
||||
# this script runs Nashorn in the BCP to override any nashorn.jar that might
|
||||
# reside in your $JAVA_HOME/jre/lib/ext/nashorn.jar
|
||||
#
|
||||
ENABLE_ASSERTIONS_FLAGS="-ea -esa"
|
||||
|
||||
# Flags to instrument lambdaform computation, caching, interpretation and compilation
|
||||
# Default compile threshold for lambdaforms is 30
|
||||
#
|
||||
#LAMBDAFORM_FLAGS="\
|
||||
# -Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=3 \
|
||||
# -Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES=true \
|
||||
# -Djava.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE=true \
|
||||
# -Djava.lang.invoke.MethodHandle.TRACE_INTERPRETER=true"
|
||||
|
||||
# Flags to run trusted tests from the Nashorn test suite
|
||||
#
|
||||
#TRUSTED_TEST_FLAGS="\
|
||||
#-Djava.security.manager \
|
||||
#-Djava.security.policy=../build/nashorn.policy -Dnashorn.debug"
|
||||
|
||||
# Testing out new code optimizations using the generic hotspot "new code" parameter
|
||||
#
|
||||
#USE_NEW_CODE_FLAGS=-XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode
|
||||
|
||||
#
|
||||
#-Dnashorn.typeInfo.disabled=false \
|
||||
# and for Nashorn options:
|
||||
# --class-cache-size=0 --persistent-code-cache=false
|
||||
|
||||
# Unique timestamped file name for JFR recordings. For JFR, we also have to
|
||||
# crank up the stack cutoff depth to 1024, because of ridiculously long lambda form
|
||||
# stack traces.
|
||||
#
|
||||
# It is also recommended that you go into $JAVA_HOME/jre/lib/jfr/default.jfc and
|
||||
# set the "method-sampling-interval" Normal and Maximum sample time as low as you
|
||||
# can go (10 ms on most platforms). The default is normally higher. The increased
|
||||
# sampling overhead is usually negligible for Nashorn runs, but the data is better
|
||||
|
||||
if [ -z $JFR_FILENAME ]; then
|
||||
JFR_FILENAME="./nashorn_$(date|sed "s/ /_/g"|sed "s/:/_/g").jfr"
|
||||
fi
|
||||
|
||||
# Flight recorder
|
||||
#
|
||||
# see above - already in place, copy the flags down here to disable
|
||||
ENABLE_FLIGHT_RECORDER_FLAGS="\
|
||||
-XX:+FlightRecorder \
|
||||
-XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=$JFR_FILENAME,stackdepth=1024"
|
||||
|
||||
# Type specialization and math intrinsic replacement should be enabled by default in 8u20 and nine,
|
||||
# keeping this flag around for experimental reasons. Replace + with - to switch it off
|
||||
#
|
||||
#ENABLE_TYPE_SPECIALIZATION_FLAGS=-XX:+UseTypeSpeculation
|
||||
|
||||
# Same with math intrinsics. They should be enabled by default in 8u20 and 9, so
|
||||
# this disables them if needed
|
||||
#
|
||||
#DISABLE_MATH_INTRINSICS_FLAGS=-XX:-UseMathExactIntrinsics
|
||||
|
||||
# Add timing to time the compilation phases.
|
||||
#ENABLE_TIME_FLAGS=--log=time
|
||||
|
||||
# Add ShowHiddenFrames to get lambda form internals on the stack traces
|
||||
#ENABLE_SHOW_HIDDEN_FRAMES_FLAGS=-XX:+ShowHiddenFrames
|
||||
|
||||
# Add print optoassembly to get an asm dump. This requires 1) a debug build, not product,
|
||||
# That tired compilation is switched off, for C2 only output and that the number of
|
||||
# compiler threads is set to 1 for determinsm.
|
||||
#
|
||||
#PRINT_ASM_FLAGS=-XX:+PrintOptoAssembly -XX:-TieredCompilation -XX:CICompilerCount=1 \
|
||||
|
||||
# Tier compile threasholds. Default value is 10. (1-100 is useful for experiments)
|
||||
#TIER_COMPILATION_THRESHOLD_FLAGS=-XX:IncreaseFirstTierCompileThresholdAt=10
|
||||
|
||||
# Directory where to look for nashorn.jar in a dist folder. The default is "..", assuming
|
||||
# that we run the script from the make dir
|
||||
DIR=..
|
||||
NASHORN_JAR=$DIR/dist/nashorn.jar
|
||||
|
||||
|
||||
# The built Nashorn jar is placed first in the bootclasspath to override the JDK
|
||||
# nashorn.jar in $JAVA_HOME/jre/lib/ext. Thus, we also need -esa, as assertions in
|
||||
# nashorn count as system assertions in this configuration
|
||||
|
||||
# Type profiling default level is 111, 222 adds some compile time, but is faster
|
||||
|
||||
$JAVA_HOME/bin/java \
|
||||
$ENABLE_ASSERTIONS_FLAGS \
|
||||
$LAMBDAFORM_FLAGS \
|
||||
$TRUSTED_FLAGS \
|
||||
$USE_NEW_CODE_FLAGS \
|
||||
$ENABLE_SHOW_HIDDEN_FRAMES_FLAGS \
|
||||
$ENABLE_FLIGHT_RECORDER_FLAGS \
|
||||
$ENABLE_TYPE_SPECIALIZATION_FLAGS \
|
||||
$TIERED_COMPILATION_THRESOLD_FLAGS \
|
||||
$DISABLE_MATH_INTRINSICS_FLAGS \
|
||||
$PRINT_ASM_FLAGS \
|
||||
-Xbootclasspath/p:$NASHORN_JAR \
|
||||
-Xms2G -Xmx2G \
|
||||
-XX:TypeProfileLevel=222 \
|
||||
-cp $CLASSPATH:../build/test/classes/ \
|
||||
jdk.nashorn.tools.Shell $ENABLE_TIME_FLAGS ${@}
|
||||
|
||||
|
||||
@@ -1,631 +0,0 @@
|
||||
This document describes system properties that are used for internal
|
||||
debugging and instrumentation purposes, along with the system loggers,
|
||||
which are used for the same thing.
|
||||
|
||||
This document is intended as a developer resource, and it is not
|
||||
needed as Nashorn documentation for normal usage. Flags and system
|
||||
properties described herein are subject to change without notice.
|
||||
|
||||
=====================================
|
||||
1. System properties used internally
|
||||
=====================================
|
||||
|
||||
This documentation of the system property flags assume that the
|
||||
default value of the flag is false, unless otherwise specified.
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.args=<string>
|
||||
|
||||
This property takes as its value a space separated list of Nashorn
|
||||
command line options that should be passed to Nashorn. This might be
|
||||
useful in environments where it is hard to tell how a nashorn.jar is
|
||||
launched.
|
||||
|
||||
Example:
|
||||
|
||||
> java -Dnashorn.args="--lazy-complation --log=compiler" large-java-app-with-nashorn.jar
|
||||
> ant -Dnashorn.args="--log=codegen" antjob
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.args.prepend=<string>
|
||||
|
||||
This property behaves like nashorn.args, but adds the given arguments
|
||||
before the existing ones instead of after them. Later arguments will
|
||||
overwrite earlier ones, so this is useful for setting default arguments
|
||||
that can be overwritten.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.unstable.relink.threshold=x
|
||||
|
||||
NOTE: This property is deprecated in favor of the
|
||||
"--unstable-relink-threshold" command line option. It controls how many
|
||||
call site misses are allowed before a callsite is relinked with "apply"
|
||||
semantics to never change again. In the case of megamorphic callsites,
|
||||
this is necessary, or the program would spend all its time swapping out
|
||||
callsite targets. When neither the system property nor the command line
|
||||
option are specified, defaults to 8, or 16 with optimistic types turned
|
||||
on.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.compiler.splitter.threshold=x
|
||||
|
||||
This will change the node weight that requires a subgraph of the IR to
|
||||
be split into several classes in order not to run out of bytecode space.
|
||||
The default value is 0x8000 (32768).
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.serialize.compression=<x>
|
||||
|
||||
This property sets the compression level used when deflating serialized
|
||||
AST structures of anonymous split functions. Valid values range from 0 to 9,
|
||||
the default value is 4. Higher values will reduce memory size of serialized
|
||||
AST but increase CPU usage required for compression.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.codegen.debug.trace=<x>
|
||||
|
||||
See the description of the codegen logger below.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.fields.objects, -Dnashorn.fields.dual
|
||||
|
||||
When the nashorn.fields.objects property is true, Nashorn will always
|
||||
use object fields for AccessorProperties, requiring boxing for all
|
||||
primitive property values. When nashorn.fields.dual is set, Nashorn
|
||||
will always use dual long/object fields, which allows primitives to be
|
||||
stored without boxing. When neither system property is set, Nashorn
|
||||
chooses a setting depending on the optimistic types setting (dual
|
||||
fields when optimistic types are enabled, object-only fields otherwise).
|
||||
|
||||
With dual fields, Nashorn uses long fields to store primitive values.
|
||||
Ints are represented as the 32 low bits of the long fields. Doubles
|
||||
are represented as the doubleToLongBits of their value. This way a
|
||||
single field can be used for all primitive types. Packing and
|
||||
unpacking doubles to their bit representation is intrinsified by
|
||||
the JVM and extremely fast.
|
||||
|
||||
In the future, this might complement or be replaced by experimental
|
||||
feature sun.misc.TaggedArray, which has been discussed on the mlvm
|
||||
mailing list. TaggedArrays are basically a way to share data space
|
||||
between primitives and references, and have the GC understand this.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.compiler.symbol.trace=[<x>[,*]],
|
||||
-Dnashorn.compiler.symbol.stacktrace=[<x>[,*]]
|
||||
|
||||
When this property is set, creation and manipulation of any symbol
|
||||
named "x" will show information about when the compiler changes its
|
||||
type assumption, bytecode local variable slot assignment and other
|
||||
data. This is useful if, for example, a symbol shows up as an Object,
|
||||
when you believe it should be a primitive. Usually there is an
|
||||
explanation for this, for example that it exists in the global scope
|
||||
and type analysis has to be more conservative.
|
||||
|
||||
Several symbols names to watch can be specified by comma separation.
|
||||
|
||||
If no variable name is specified (and no equals sign), all symbols
|
||||
will be watched
|
||||
|
||||
By using "stacktrace" instead of or together with "trace", stack
|
||||
traces will be displayed upon symbol changes according to the same
|
||||
semantics.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.lexer.xmlliterals
|
||||
|
||||
If this property it set, it means that the Lexer should attempt to
|
||||
parse XML literals, which would otherwise generate syntax
|
||||
errors. Warning: there are currently no unit tests for this
|
||||
functionality.
|
||||
|
||||
XML literals, when this is enabled, end up as standard LiteralNodes in
|
||||
the IR.
|
||||
|
||||
|
||||
SYSTEM_PROPERTY: -Dnashorn.debug
|
||||
|
||||
If this property is set to true, Nashorn runs in Debug mode. Debug
|
||||
mode is slightly slower, as for example statistics counters are enabled
|
||||
during the run. Debug mode makes available a NativeDebug instance
|
||||
called "Debug" in the global space that can be used to print property
|
||||
maps and layout for script objects, as well as a "dumpCounters" method
|
||||
that will print the current values of the previously mentioned stats
|
||||
counters.
|
||||
|
||||
These functions currently exists for Debug:
|
||||
|
||||
"map" - print(Debug.map(x)) will dump the PropertyMap for object x to
|
||||
stdout (currently there also exist functions called "embedX", where X
|
||||
is a value from 0 to 3, that will dump the contents of the embed pool
|
||||
for the first spill properties in any script object and "spill", that
|
||||
will dump the contents of the growing spill pool of spill properties
|
||||
in any script object. This is of course subject to change without
|
||||
notice, should we change the script object layout.
|
||||
|
||||
"methodHandle" - this method returns the method handle that is used
|
||||
for invoking a particular script function.
|
||||
|
||||
"identical" - this method compares two script objects for reference
|
||||
equality. It is a == Java comparison
|
||||
|
||||
"equals" - Returns true if two objects are either referentially
|
||||
identical or equal as defined by java.lang.Object.equals.
|
||||
|
||||
"dumpCounters" - will dump the debug counters' current values to
|
||||
stdout.
|
||||
|
||||
Currently we count number of ScriptObjects in the system, number of
|
||||
Scope objects in the system, number of ScriptObject listeners added,
|
||||
removed and dead (without references).
|
||||
|
||||
We also count number of ScriptFunctions, ScriptFunction invocations
|
||||
and ScriptFunction allocations.
|
||||
|
||||
Furthermore we count PropertyMap statistics: how many property maps
|
||||
exist, how many times were property maps cloned, how many times did
|
||||
the property map history cache hit, prevent new allocations, how many
|
||||
prototype invalidations were done, how many time the property map
|
||||
proto cache hit.
|
||||
|
||||
Finally we count callsite misses on a per callsite bases, which occur
|
||||
when a callsite has to be relinked, due to a previous assumption of
|
||||
object layout being invalidated.
|
||||
|
||||
"getContext" - return the current Nashorn context.
|
||||
|
||||
"equalWithoutType" - Returns true if if the two objects are both
|
||||
property maps, and they have identical properties in the same order,
|
||||
but allows the properties to differ in their types.
|
||||
|
||||
"diffPropertyMaps" Returns a diagnostic string representing the difference
|
||||
of two property maps.
|
||||
|
||||
"getClass" - Returns the Java class of an object, or undefined if null.
|
||||
|
||||
"toJavaString" - Returns the Java toString representation of an object.
|
||||
|
||||
"toIdentString" - Returns a string representation of an object consisting
|
||||
of its java class name and hash code.
|
||||
|
||||
"getListenerCount" - Return the number of property listeners for a
|
||||
script object.
|
||||
|
||||
"getEventQueueCapacity" - Get the capacity of the event queue.
|
||||
|
||||
"setEventQueueCapacity" - Set the event queue capacity.
|
||||
|
||||
"addRuntimeEvent" - Add a runtime event to the runtime event queue.
|
||||
The queue has a fixed size (see -Dnashorn.runtime.event.queue.size)
|
||||
and the oldest entry will be thrown out of the queue is about to overflow.
|
||||
|
||||
"expandEventQueueCapacity" - Expands the event queue capacity,
|
||||
or truncates if capacity is lower than current capacity. Then only
|
||||
the newest entries are kept.
|
||||
|
||||
"clearRuntimeEvents" - Clear the runtime event queue.
|
||||
|
||||
"removeRuntimeEvent" - Remove a specific runtime event from the event queue.
|
||||
|
||||
"getRuntimeEvents" - Return all runtime events in the queue as an array.
|
||||
|
||||
"getLastRuntimeEvent" - Return the last runtime event in the queue.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.methodhandles.debug.stacktrace
|
||||
|
||||
This enhances methodhandles logging (see below) to also dump the
|
||||
stack trace for every instrumented method handle operation.
|
||||
Warning: This is enormously verbose, but provides a pretty
|
||||
decent "grep:able" picture of where the calls are coming from.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.cce
|
||||
|
||||
Setting this system property causes the Nashorn linker to rely on
|
||||
ClassCastExceptions for triggering a callsite relink. If not set, the linker
|
||||
will add an explicit instanceof guard.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.spill.threshold=<x>
|
||||
|
||||
This property sets the number of fields in an object from which to use
|
||||
generic array based spill storage instead of Java fields. The default value
|
||||
is 256.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.tcs.miss.samplePercent=<x>
|
||||
|
||||
When running with the trace callsite option (-tcs), Nashorn will count
|
||||
and instrument any callsite misses that require relinking. As the
|
||||
number of relinks is large and usually produces a lot of output, this
|
||||
system property can be used to constrain the percentage of misses that
|
||||
should be logged. Typically this is set to 1 or 5 (percent). 1% is the
|
||||
default value.
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.persistent.code.cache
|
||||
|
||||
This property can be used to set the directory where Nashorn stores
|
||||
serialized script classes generated with the -pcc/--persistent-code-cache
|
||||
option. The default directory name is "nashorn_code_cache".
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.typeInfo.maxFiles
|
||||
|
||||
Maximum number of files to store in the type info cache. The type info cache
|
||||
is used to cache type data of JavaScript functions when running with
|
||||
optimistic types (-ot/--optimistic-types). There is one file per JavaScript
|
||||
function in the cache.
|
||||
|
||||
The default value is 0 which means the feature is disabled. Setting this
|
||||
to something like 20000 is probably good enough for most applications and
|
||||
will usually cap the cache directory to about 80MB presuming a 4kB
|
||||
filesystem allocation unit. Set this to "unlimited" to run without limit.
|
||||
|
||||
If the value is not 0 or "unlimited", Nashorn will spawn a cleanup thread
|
||||
that makes sure the number of files in the cache does not exceed the given
|
||||
value by deleting the least recently modified files.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.typeInfo.cacheDir
|
||||
|
||||
This property can be used to set the directory where Nashorn stores the
|
||||
type info cache when -Dnashorn.typeInfo.maxFiles is set to a nonzero
|
||||
value. The default location is platform specific. On Windows, it is
|
||||
"${java.io.tmpdir}\com.oracle.java.NashornTypeInfo". On Linux and
|
||||
Solaris it is "~/.cache/com.oracle.java.NashornTypeInfo". On Mac OS X,
|
||||
it is "~/Library/Caches/com.oracle.java.NashornTypeInfo".
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.typeInfo.cleanupDelaySeconds=<value>
|
||||
|
||||
This sets the delay between cleanups of the typeInfo cache, in seconds.
|
||||
The default delay is 20 seconds.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.profilefile=<filename>
|
||||
|
||||
When running with the profile callsite options (-pcs), Nashorn will
|
||||
dump profiling data for all callsites to stderr as a shutdown hook. To
|
||||
instead redirect this to a file, specify the path to the file using
|
||||
this system property.
|
||||
|
||||
|
||||
SYSTEM_PROPERTY: -Dnashorn.regexp.impl=[jdk|joni]
|
||||
|
||||
This property defines the regular expression engine to be used by
|
||||
Nashorn. Set this flag to "jdk" to get an implementation based on the
|
||||
JDK's java.util.regex package. Set this property to "joni" to install
|
||||
an implementation based on Joni, the regular expression engine used by
|
||||
the JRuby project. The default value for this flag is "joni"
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.runtime.event.queue.size=<value>
|
||||
|
||||
Nashorn provides a fixed sized runtime event queue for debugging purposes.
|
||||
See -Dnashorn.debug for methods to access the event queue.
|
||||
The default value is 1024.
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.anonymous.classes.threshold=<value>
|
||||
|
||||
Nashorn can use anonymous classes for loading compiled scripts, depending
|
||||
on the --anonymous-classes=[auto|true|false] option. Anonymous classes load
|
||||
faster, but the loaded classes get less optimization applied to them and
|
||||
therefore usually run slower. In the default "auto" setting, scripts are
|
||||
loaded as anonymous classes if the script size does not exceed 512 bytes.
|
||||
The above system property allows to set this threshold to a user defined
|
||||
value.
|
||||
|
||||
===============
|
||||
2. The loggers.
|
||||
===============
|
||||
|
||||
It is very simple to create your own logger. Use the DebugLogger class
|
||||
and give the subsystem name as a constructor argument.
|
||||
|
||||
The Nashorn loggers can be used to print per-module or per-subsystem
|
||||
debug information with different levels of verbosity. The loggers for
|
||||
a given subsystem are available are enabled by using
|
||||
|
||||
--log=<systemname>[:<level>]
|
||||
|
||||
on the command line.
|
||||
|
||||
Here <systemname> identifies the name of the subsystem to be logged
|
||||
and the optional colon and level argument is a standard
|
||||
java.util.logging.Level name (severe, warning, info, config, fine,
|
||||
finer, finest). If the level is left out for a particular subsystem,
|
||||
it defaults to "info". Any log message logged as the level or a level
|
||||
that is more important will be output to stderr by the logger.
|
||||
|
||||
Several loggers can be enabled by a single command line option, by
|
||||
putting a comma after each subsystem/level tuple (or each subsystem if
|
||||
level is unspecified). The --log option can also be given multiple
|
||||
times on the same command line, with the same effect.
|
||||
|
||||
For example: --log=codegen,fields:finest is equivalent to
|
||||
--log=codegen:info --log=fields:finest
|
||||
|
||||
The following is an incomplete list of subsystems that currently
|
||||
support logging. Look for classes implementing
|
||||
jdk.nashorn.internal.runtime.logging.Loggable for more loggers.
|
||||
|
||||
|
||||
* compiler
|
||||
|
||||
The compiler is in charge of turning source code and function nodes
|
||||
into byte code, and installs the classes into a class loader
|
||||
controlled from the Context. Log messages are, for example, about
|
||||
things like new compile units being allocated. The compiler has global
|
||||
settings that all the tiers of codegen (e.g. Lower and CodeGenerator)
|
||||
use.s
|
||||
|
||||
|
||||
* recompile
|
||||
|
||||
This logger shows information about recompilation of scripts and
|
||||
functions at runtime. Recompilation may happen because a function
|
||||
was called with different parameter types, or because an optimistic
|
||||
assumption failed while executing a function with -ot/--optimistic-types.
|
||||
|
||||
|
||||
* codegen
|
||||
|
||||
The code generator is the emitter stage of the code pipeline, and
|
||||
turns the lowest tier of a FunctionNode into bytecode. Codegen logging
|
||||
shows byte codes as they are being emitted, line number information
|
||||
and jumps. It also shows the contents of the bytecode stack prior to
|
||||
each instruction being emitted. This is a good debugging aid. For
|
||||
example:
|
||||
|
||||
[codegen] #41 line:2 (f)_afc824e
|
||||
[codegen] #42 load symbol x slot=2
|
||||
[codegen] #43 {1:O} load int 0
|
||||
[codegen] #44 {2:I O} dynamic_runtime_call GT:ZOI_I args=2 returnType=boolean
|
||||
[codegen] #45 signature (Ljava/lang/Object;I)Z
|
||||
[codegen] #46 {1:Z} ifeq ternary_false_5402fe28
|
||||
[codegen] #47 load symbol x slot=2
|
||||
[codegen] #48 {1:O} goto ternary_exit_107c1f2f
|
||||
[codegen] #49 ternary_false_5402fe28
|
||||
[codegen] #50 load symbol x slot=2
|
||||
[codegen] #51 {1:O} convert object -> double
|
||||
[codegen] #52 {1:D} neg
|
||||
[codegen] #53 {1:D} convert double -> object
|
||||
[codegen] #54 {1:O} ternary_exit_107c1f2f
|
||||
[codegen] #55 {1:O} return object
|
||||
|
||||
shows a ternary node being generated for the sequence "return x > 0 ?
|
||||
x : -x"
|
||||
|
||||
The first number on the log line is a unique monotonically increasing
|
||||
emission id per bytecode. There is no guarantee this is the same id
|
||||
between runs. depending on non deterministic code
|
||||
execution/compilation, but for small applications it usually is. If
|
||||
the system variable -Dnashorn.codegen.debug.trace=<x> is set, where x
|
||||
is a bytecode emission id, a stack trace will be shown as the
|
||||
particular bytecode is about to be emitted. This can be a quick way to
|
||||
determine where it comes from without attaching the debugger. "Who
|
||||
generated that neg?"
|
||||
|
||||
The --log=codegen option is equivalent to setting the system variable
|
||||
"nashorn.codegen.debug" to true.
|
||||
|
||||
* fold
|
||||
|
||||
Shows constant folding taking place before lowering
|
||||
|
||||
* lower
|
||||
|
||||
This is the first lowering pass.
|
||||
|
||||
Lower is a code generation pass that turns high level IR nodes into
|
||||
lower level one, for example substituting comparisons to RuntimeNodes
|
||||
and inlining finally blocks.
|
||||
|
||||
Lower is also responsible for determining control flow information
|
||||
like end points.
|
||||
|
||||
* symbols
|
||||
|
||||
The symbols logger tracks the assignment os symbols to identifiers.
|
||||
|
||||
* scopedepths
|
||||
|
||||
This logs the calculation of scope depths for non-local symbols.
|
||||
|
||||
* fields
|
||||
|
||||
The --log=fields option (at info level) is equivalent to setting the
|
||||
system variable "nashorn.fields.debug" to true. At the info level it
|
||||
will only show info about type assumptions that were invalidated. If
|
||||
the level is set to finest, it will also trace every AccessorProperty
|
||||
getter and setter in the program, show arguments, return values
|
||||
etc. It will also show the internal representation of respective field
|
||||
(Object in the normal case, unless running with the dual field
|
||||
representation)
|
||||
|
||||
* time
|
||||
|
||||
This enables timers for various phases of script compilation. The timers
|
||||
will be dumped when the Nashorn process exits. We see a percentage value
|
||||
of how much time was spent not executing bytecode (i.e. compilation and
|
||||
internal tasks) at the end of the report.
|
||||
|
||||
A finer level than "info" will show individual compilation timings as they
|
||||
happen.
|
||||
|
||||
Here is an example:
|
||||
|
||||
[time] Accumulated complation phase Timings:
|
||||
[time]
|
||||
[time] 'JavaScript Parsing' 1076 ms
|
||||
[time] 'Constant Folding' 159 ms
|
||||
[time] 'Control Flow Lowering' 303 ms
|
||||
[time] 'Program Point Calculation' 282 ms
|
||||
[time] 'Builtin Replacement' 71 ms
|
||||
[time] 'Code Splitting' 670 ms
|
||||
[time] 'Symbol Assignment' 474 ms
|
||||
[time] 'Scope Depth Computation' 249 ms
|
||||
[time] 'Optimistic Type Assignment' 186 ms
|
||||
[time] 'Local Variable Type Calculation' 526 ms
|
||||
[time] 'Bytecode Generation' 5177 ms
|
||||
[time] 'Class Installation' 1854 ms
|
||||
[time]
|
||||
[time] Total runtime: 11994 ms (Non-runtime: 11027 ms [91%])
|
||||
|
||||
* methodhandles
|
||||
|
||||
If this logger is enabled, each MethodHandle related call that uses
|
||||
the java.lang.invoke package gets its MethodHandle intercepted and an
|
||||
instrumentation printout of arguments and return value appended to
|
||||
it. This shows exactly which method handles are executed and from
|
||||
where. (Also MethodTypes and SwitchPoints).
|
||||
|
||||
* classcache
|
||||
|
||||
This logger shows information about reusing code classes using the
|
||||
in-memory class cache. Nashorn will try to avoid compilation of
|
||||
scripts by using existing classes. This can significantly improve
|
||||
performance when repeatedly evaluating the same script.
|
||||
|
||||
=======================
|
||||
3. Undocumented options
|
||||
=======================
|
||||
|
||||
Here follows a short description of undocumented options for Nashorn.
|
||||
To see a list of all undocumented options, use the (undocumented) flag
|
||||
"-xhelp".
|
||||
|
||||
i.e. jjs -xhelp or java -jar nashorn.jar -xhelp
|
||||
|
||||
Undocumented options are not guaranteed to work, run correctly or be
|
||||
bug free. They are experimental and for internal or debugging use.
|
||||
They are also subject to change without notice.
|
||||
|
||||
In practice, though, all options below not explicitly documented as
|
||||
EXPERIMENTAL can be relied upon, for example --dump-on-error is useful
|
||||
for any JavaScript/Nashorn developer, but there is no guarantee.
|
||||
|
||||
A short summary follows:
|
||||
|
||||
-D (-Dname=value. Set a system property. This option can be repeated.)
|
||||
|
||||
-ccs, --class-cache-size (Size of the Class cache size per global scope.)
|
||||
|
||||
-cp, -classpath (-cp path. Specify where to find user class files.)
|
||||
|
||||
-co, --compile-only (Compile without running.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-d, --dump-debug-dir (specify a destination directory to dump class files.)
|
||||
param: <path>
|
||||
|
||||
--debug-lines (Generate line number table in .class files.)
|
||||
param: [true|false] default: true
|
||||
|
||||
--debug-locals (Generate local variable table in .class files.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-doe, -dump-on-error (Dump a stack trace on errors.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--early-lvalue-error (invalid lvalue expressions should be reported as early errors.)
|
||||
param: [true|false] default: true
|
||||
|
||||
--empty-statements (Preserve empty statements in AST.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-fv, -fullversion (Print full version info of Nashorn.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--function-statement-error (Report an error when function declaration is used as a statement.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--function-statement-warning (Warn when function declaration is used as a statement.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-fx (Launch script as an fx application.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--global-per-engine (Use single Global instance per script engine instance.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-h, -help (Print help for command line flags.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--loader-per-compile (Create a new class loader per compile.)
|
||||
param: [true|false] default: true
|
||||
|
||||
-l, --locale (Set Locale for script execution.)
|
||||
param: <locale> default: en-US
|
||||
|
||||
--log (Enable logging of a given level for a given number of sub systems.
|
||||
[for example: --log=fields:finest,codegen:info].)
|
||||
param: <module:level>,*
|
||||
|
||||
-nj, --no-java (Disable Java support.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-nse, --no-syntax-extensions (Disallow non-standard syntax extensions.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-nta, --no-typed-arrays (Disable typed arrays support.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--parse-only (Parse without compiling.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--print-ast (Print abstract syntax tree.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-pc, --print-code (Print generated bytecode. If a directory is specified, nothing will
|
||||
be dumped to stderr. Also, in that case, .dot files will be generated
|
||||
for all functions or for the function with the specified name only.)
|
||||
param: [dir:<output-dir>,function:<name>]
|
||||
|
||||
--print-lower-ast (Print lowered abstract syntax tree.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-plp, --print-lower-parse (Print the parse tree after lowering.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--print-no-newline (Print function will not print new line char.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-pp, --print-parse (Print the parse tree.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--print-symbols (Print the symbol table.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-pcs, --profile-callsites (Dump callsite profile data.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-scripting (Enable scripting features.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--stderr (Redirect stderr to a filename or to another tty, e.g. stdout.)
|
||||
param: <output console>
|
||||
|
||||
--stdout (Redirect stdout to a filename or to another tty, e.g. stderr.)
|
||||
param: <output console>
|
||||
|
||||
-strict (Run scripts in strict mode.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-t, -timezone (Set timezone for script execution.)
|
||||
param: <timezone> default: Europe/Stockholm
|
||||
|
||||
-tcs, --trace-callsites (Enable callsite trace mode. Options are: miss [trace callsite misses]
|
||||
enterexit [trace callsite enter/exit], objects [print object properties].)
|
||||
param: [=[option,]*]
|
||||
|
||||
-urt, --unstable-relink-threshold (Number of times a dynamic call site has to be relinked before it
|
||||
is considered unstable, when the runtime will try to link it as
|
||||
if it is megamorphic.)
|
||||
|
||||
--verify-code (Verify byte code before running.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-v, -version (Print version info of Nashorn.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-xhelp (Print extended help for command line flags.)
|
||||
param: [true|false] default: false
|
||||
|
||||
@@ -1,988 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2010, 2013, 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.
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html class=" regenabled gecko radius jsenabled regloaded" xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Java Scripting Programmer's Guide</title>
|
||||
|
||||
<!-- ============ -->
|
||||
<!-- MAIN CONTENT -->
|
||||
<!-- ============ -->
|
||||
<table summary="layout" border="0" width="100%">
|
||||
<tbody><tr>
|
||||
<td>
|
||||
|
||||
<div id="sharepage" class="smallpagetitle"><h1>Java Scripting Programmer's Guide</h1><div class="sharepage"> <div class="sharepagew1 share-mailto"> <table summary="" cellpadding="0" cellspacing="0"><tbody><tr> <td id="share-mailto"><a href="mailto:?subject=Java%20Documentation%20Page:%20Java%20Scripting%20Programmer%27s%20Guide&body=Check%20out%20this%20page:%20%0A%0Ahttp%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html" class="sharelink mailto" title="Email this page to a friend"></a></td> <td id="share-technorati"><a href="http://technorati.com/search/http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html" class="sharelink technorati" title="See who links to this page on Technorati"></a></td> <td id="share-delicious"><a href="http://del.icio.us/post?v=4;url=http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html;title=Java%20Scripting%20Programmer%27s%20Guide" class="sharelink delicious" title="Bookmark this page in del.icio.us"></a></td> <td id="share-digg"><a href="http://digg.com/submit?phase=2&url=http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html&title=Java%20Scripting%20Programmer%27s%20Guide" class="sharelink digg" title="Submit this page to Digg"></a></td> <td id="share-slashdot"><a href="http://slashdot.org/bookmark.pl?title=Java%20Scripting%20Programmer%27s%20Guide&url=http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html" class="sharelink slashdot" title="Submit this page to Slashdot"></a></td> <td id="share-blank"> </td></tr></tbody></table></div></div></div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<!-- Body text begins here -->
|
||||
<ul>
|
||||
<li><span><a href="#who">Who is the Java Scripting API
|
||||
For?</a></span></li>
|
||||
<li><span><a href="#package">Scripting Package</a></span></li>
|
||||
<li><span><a href="#examples">Examples</a></span>
|
||||
<ul>
|
||||
<li><span><a href="#helloworld">"Hello, World"</a></span></li>
|
||||
<li><span><a href="#evalfile">Evaluating a Script
|
||||
File</a></span></li>
|
||||
<li><span><a href="#scriptvars">Script Variables</a></span></li>
|
||||
<li><span><a href="#invoke">Invoking Script Functions and
|
||||
Methods</a></span></li>
|
||||
<li><span><a href="#interfaces">Implementing Java Interfaces by
|
||||
Scripts</a></span></li>
|
||||
<li><span><a href="#scopes">Multiple Scopes for
|
||||
Scripts</a></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><span><a href="#jsengine">JavaScript Script
|
||||
Engine</a></span></li>
|
||||
<li><span><a href="#jstojava">JavaScript to Java
|
||||
Communication</a></span>
|
||||
<ul>
|
||||
<li><span><a href="#jsjavaclass">Accessing Java
|
||||
Classes</a></span></li>
|
||||
<li><span><a href="#jsimport">Importing Java Packages,
|
||||
Classes</a></span></li>
|
||||
<li><span><a href="#jsarrays">Creating, Converting and Using Java
|
||||
Arrays</a></span></li>
|
||||
<li><span><a href="#jsimplement">Implementing Java
|
||||
Interfaces</a></span></li>
|
||||
<li><span><a href="#jsextendabstract">Extending Abstract Java Classes
|
||||
</a></span></li>
|
||||
<li><span><a href="#jsextendconcrete">Extending Concrete Java Classes
|
||||
</a></span></li>
|
||||
<li><span><a href="#jsimplementmultiple">Implementing Multiple Java Interfaces
|
||||
</a></span></li>
|
||||
<li><span><a href="#classBoundImplementations">Class-Bound Implementations
|
||||
</a></span></li>
|
||||
<li><span><a href="#jsoverload">Overload Resolution</a></span></li>
|
||||
<li><span><a href="#dataTypeMapping">Mapping of Data Types Between Java
|
||||
and JavaScript</a></span></li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li><span><a href="#engineimpl">Implementing Your Own Script
|
||||
Engine</a></span></li>
|
||||
<li><span><a href="#refs">References</a></span></li>
|
||||
</ul>
|
||||
<span><a name="who" id="who"></a></span>
|
||||
<h2><span>Who is the Java Scripting API For?</span></h2>
|
||||
<span>Some useful characteristics of scripting languages
|
||||
are:</span>
|
||||
<ul>
|
||||
<li><span><b>Convenience</b>: Most scripting languages are
|
||||
dynamically typed. You can usually create new variables without
|
||||
declaring the variable type, and you can reuse variables to store
|
||||
objects of different types. Also, scripting languages tend to
|
||||
perform many type conversions automatically, for example,
|
||||
converting the number 10 to the text "10" as necessary.</span></li>
|
||||
<li><span><b>Developing rapid prototypes</b>: You can avoid the
|
||||
edit-compile-run cycle and just use edit-run!</span></li>
|
||||
<li><span><b>Application extension/customization</b>: You can
|
||||
"externalize" parts of your application - like configuration
|
||||
scripts, business logic/rules and math expressions for financial
|
||||
applications.</span></li>
|
||||
<li><span><b>"Command line" shells for applications</b> -for
|
||||
debugging, runtime/deploy time configuration etc. Most applications
|
||||
have a web-based GUI configuaration tool these days. But
|
||||
sysadmins/deployers frequently prefer command line tools. Instead
|
||||
of inventing ad-hoc scripting language for that purpose, a
|
||||
"standard" scripting language can be used.</span></li>
|
||||
</ul>
|
||||
<p><span>The Java<font size="-1"><sup>TM</sup></font> Scripting API
|
||||
is a scripting language indepedent framework for using script
|
||||
engines from Java code. With the Java Scripting API, it is possible
|
||||
to write customizable/extendable applications in the Java language
|
||||
and leave the customization scripting language choice to the end
|
||||
user. The Java application developer need not choose the extension
|
||||
language during development. If you write your application with
|
||||
JSR-223 API, then your users can use any JSR-223 compliant
|
||||
scripting language.</span></p>
|
||||
<hr>
|
||||
<span><a name="package" id="package"></a></span>
|
||||
<h2><span>Scripting Package</span></h2>
|
||||
<p><span>The Java Scripting functionality is in the <code><a href="http://docs.oracle.com/javase/9/docs/api/javax/script/package-summary.html">javax.script</a></code>
|
||||
package. This is a relatively small, simple API. The starting point
|
||||
of the scripting API is the <code>ScriptEngineManager</code> class.
|
||||
A ScriptEngineManager object can discover script engines through
|
||||
the jar file service discovery mechanism. It can also instantiate
|
||||
ScriptEngine objects that interpret scripts written in a specific
|
||||
scripting language. The simplest way to use the scripting API is as
|
||||
follows:</span></p>
|
||||
<ol>
|
||||
<li><span>Create a <code>ScriptEngineManager</code>
|
||||
object.</span></li>
|
||||
<li><span>Get a <code>ScriptEngine</code> object from the
|
||||
manager.</span></li>
|
||||
<li><span>Evaluate script using the <code>ScriptEngine</code>'s
|
||||
<code>eval</code> methods.</span></li>
|
||||
</ol>
|
||||
<p><span>Now, it is time to look at some sample code. While it is
|
||||
not mandatory, it may be useful to know a bit of JavaScript to read
|
||||
these examples.</span></p>
|
||||
<hr>
|
||||
<span><a name="examples" id="examples"></a></span>
|
||||
<h2><span>Examples</span></h2>
|
||||
<span><a name="helloworld" id="helloworld"></a></span>
|
||||
<h3><span>"Hello, World"</span></h3>
|
||||
<p><span>From the <code>ScriptEngineManager</code> instance, we
|
||||
request a JavaScript engine instance using
|
||||
<code>getEngineByName</code> method. On the script engine, the
|
||||
<code>eval</code> method is called to execute a given String as
|
||||
JavaScript code! For brevity, in this as well as in subsequent
|
||||
examples, we have not shown exception handling. There are checked
|
||||
and runtime exceptions thrown from <code>javax.script</code> API.
|
||||
Needless to say, you have to handle the exceptions
|
||||
appropriately.</span></p>
|
||||
<pre>
|
||||
<span><code>
|
||||
// <a href="source/EvalScript.java">EvalScript.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
public class EvalScript {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
<span class="classref">ScriptEngineManager</span> factory = new ScriptEngineManager();
|
||||
// create a JavaScript engine
|
||||
<span class="classref">ScriptEngine</span> engine = factory.<span class="methodref">getEngineByName</span>("nashorn");
|
||||
// evaluate JavaScript code from String
|
||||
engine.<span class="methodref">eval</span>("print('Hello, World')");
|
||||
}
|
||||
}
|
||||
</code></span>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="evalfile" id="evalfile"></a>
|
||||
<h3>Evaluating a Script File</h3>
|
||||
<p>In this example, we call the <code>eval</code> method that
|
||||
accepts <code>java.io.Reader</code> for the input source. The
|
||||
script read by the given reader is executed. This way it is
|
||||
possible to execute scripts from files, URLs and resources by
|
||||
wrapping the relevant input stream objects as readers.</p>
|
||||
<pre>
|
||||
<code>
|
||||
// <a href="source/EvalFile.java">EvalFile.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class EvalFile {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
<span class="classref">ScriptEngineManager</span> factory = new ScriptEngineManager();
|
||||
// create JavaScript engine
|
||||
<span class="classref">ScriptEngine</span> engine = factory.<span class="methodref">getEngineByName</span>("nashorn");
|
||||
// evaluate JavaScript code from given file - specified by first argument
|
||||
engine.<span class="methodref">eval</span>(new java.io.FileReader(args[0]));
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
Let us assume that we have the file named <a href="source/test.js">test.js</a> with the
|
||||
following text:
|
||||
<pre><code>
|
||||
print("This is hello from test.js");
|
||||
</code>
|
||||
</pre>
|
||||
We can run the above Java as
|
||||
<pre><code>
|
||||
java EvalFile test.js
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="scriptvars" id="scriptvars"></a>
|
||||
<h3>Script Variables</h3>
|
||||
<p>When you embed script engines and scripts with your Java
|
||||
application, you may want to expose your application objects as
|
||||
global variables to scripts. This example demonstrates how you can
|
||||
expose your application objects as global variables to a script. We
|
||||
create a <code>java.io.File</code> in the application and expose
|
||||
the same as a global variable with the name "file". The script can
|
||||
access the variable - for example, it can call public methods on
|
||||
it. Note that the syntax to access Java objects, methods and fields
|
||||
is dependent on the scripting language. JavaScript supports the
|
||||
most "natural" Java-like syntax.</p>
|
||||
<p>
|
||||
Nashorn script engine pre-defines two global variables named "context"
|
||||
and "engine". The "context" variable is of type javax.script.ScriptContext
|
||||
and refers to the current ScriptContext instance passed to script engine's
|
||||
eval method. The "engine" variable is of type javax.script.ScriptEngine and
|
||||
refers to the current nashorn script engine instance evaluating the script.
|
||||
Both of these variables are non-writable, non-enumerable and non-configurable
|
||||
- which implies script code can not write overwrite the value, for..loop iteration
|
||||
on global object will not iterate these variables and these variables can not be
|
||||
deleted by script.
|
||||
<pre><code>
|
||||
// <a href="source/ScriptVars.java">ScriptVars.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
import java.io.*;
|
||||
|
||||
public class ScriptVars {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
File f = new File("test.txt");
|
||||
// expose File object as variable to script
|
||||
engine.<span class="methodref">put</span>("file", f);
|
||||
|
||||
// evaluate a script string. The script accesses "file"
|
||||
// variable and calls method on it
|
||||
engine.eval("print(file.getAbsolutePath())");
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="invoke" id="invoke"></a>
|
||||
<h3>Invoking Script Functions and Methods</h3>
|
||||
<p>Sometimes you may want to call a specific scripting function
|
||||
repeatedly - for example, your application menu functionality might
|
||||
be implemented by a script. In your menu's action event handler you
|
||||
may want to call a specific script function. The following example
|
||||
demonstrates invoking a specific script function from Java
|
||||
code.</p>
|
||||
<pre><code>
|
||||
// <a href="source/InvokeScriptFunction.java">InvokeScriptFunction.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class InvokeScriptFunction {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
String script = "function hello(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// <code>javax.script.Invocable</code> is an optional interface.
|
||||
// Check whether your script engine implements it or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// invoke the global function named "hello"
|
||||
inv.<span class="methodref">invokeFunction</span>("hello", "Scripting!!" );
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<p>If your scripting language is object based (like JavaScript) or
|
||||
object-oriented, then you can invoke a script method on a script
|
||||
object.</p>
|
||||
<pre><code>
|
||||
// <a href="source/InvokeScriptMethod.java">InvokeScriptMethod.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class InvokeScriptMethod {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String. This code defines a script object 'obj'
|
||||
// with one method called 'hello'.
|
||||
String script = "var obj = new Object(); obj.hello = function(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// <code>javax.script.Invocable</code> is an optional interface.
|
||||
// Check whether your script engine implements or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// get script object on which we want to call the method
|
||||
Object obj = engine.<span class="methodref">get</span>("obj");
|
||||
|
||||
// invoke the method named "hello" on the script object "obj"
|
||||
inv.<span class="methodref">invokeMethod</span>(obj, "hello", "Script Method !!" );
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="interfaces" id="interfaces"></a>
|
||||
<h3>Implementing Java Interfaces by Scripts</h3>
|
||||
<p>Instead of calling specific script functions from Java,
|
||||
sometimes it is convenient to implement a Java interface by script
|
||||
functions or methods. Also, by using interfaces we can avoid having
|
||||
to use the <code>javax.script</code> API in many places. We can get
|
||||
an interface implementor object and pass it to various Java APIs.
|
||||
The following example demonstrates implementing the
|
||||
<code>java.lang.Runnable</code> interface with a script.</p>
|
||||
<pre><code>
|
||||
// <a href="source/RunnableImpl.java">RunnableImpl.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class RunnableImpl {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
String script = "function run() { print('run called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script functions with the matching name.
|
||||
Runnable r = inv.<span class="methodref">getInterface</span>(Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
<p>If your scripting language is object-based or object-oriented,
|
||||
it is possible to implement a Java interface by script methods on
|
||||
script objects. This avoids having to call script global functions
|
||||
for interface methods. The script object can store the "state"
|
||||
associated with the interface implementor.</p>
|
||||
<pre><code>
|
||||
// <a href="source/RunnableImplObject.java">RunnableImplObject.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class RunnableImplObject {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
String script = "var obj = new Object(); obj.run = function() { print('run method called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// get script object on which we want to implement the interface with
|
||||
Object obj = engine.<span class="methodref">get</span>("obj");
|
||||
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script methods of object 'obj'
|
||||
Runnable r = inv.<span class="methodref">getInterface</span>(obj, Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="scopes" id="scopes"></a>
|
||||
<h3>Multiple Scopes for Scripts</h3>
|
||||
<p>In the <a href="#scriptvars">script variables</a> example, we
|
||||
saw how to expose application objects as script global variables.
|
||||
It is possible to expose multiple global "scopes" for scripts. A
|
||||
single scope is an instance of <code>javax.script.Bindings</code>.
|
||||
This interface is derived from <code>java.util.Map<String,
|
||||
Object></code>. A scope a set of name-value pairs where name is
|
||||
any non-empty, non-null String.
|
||||
<code>javax.script.ScriptContext</code> interface supports multiple
|
||||
scopes with associated Bindings for each
|
||||
scope. By default, every script engine has a default script
|
||||
context. The default script context has atleast one scope called
|
||||
"ENGINE_SCOPE". Various scopes supported by a script context are
|
||||
available through <code>getScopes</code> method.</p>
|
||||
<pre><code>
|
||||
// <a href="source/MultiScopes.java">MultiScopes.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class MultiScopes {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
engine.put("x", "hello");
|
||||
// print global variable "x"
|
||||
engine.eval("print(x);");
|
||||
// the above line prints "hello"
|
||||
|
||||
// Now, pass a different script context
|
||||
<span class="classref">ScriptContext</span> newContext = new <span class="classref">SimpleScriptContext</span>();
|
||||
newContext.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
|
||||
<span class="classref">Bindings</span> engineScope = newContext.<span class="methodref">getBindings</span>(ScriptContext.ENGINE_SCOPE);
|
||||
|
||||
// add new variable "x" to the new engineScope
|
||||
engineScope.<span class="methodref">put</span>("x", "world");
|
||||
|
||||
// execute the same script - but this time pass a different script context
|
||||
engine.eval("print(x);", newContext);
|
||||
// the above line prints "world"
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="jsengine" id="jsengine"></a>
|
||||
<h2>JavaScript Script Engine</h2>
|
||||
<p>Oracle's implementation of JDK 8 is co-bundled with the Nashorn ECMAScript
|
||||
script engine.
|
||||
<hr>
|
||||
<a name="jstojava" id="jstojava"></a>
|
||||
<h2>JavaScript to Java Communication</h2>
|
||||
<p>For the most part, accessing Java classes, objects and methods
|
||||
is straightforward. In particular field and method access from
|
||||
JavaScript is the same as it is from Java. We highlight important
|
||||
aspects of JavaScript Java access here.
|
||||
The following examples are JavaScript snippets accessing Java. This
|
||||
section requires knowledge of JavaScript. This section can be
|
||||
skipped if you are planning to use some other JSR-223 scripting
|
||||
language rather than JavaScript.</p>
|
||||
<hr>
|
||||
<a name="jsjavaclass" id=jsjavalass"></a>
|
||||
<h3>Accessing Java Classes</h3>
|
||||
<pre>
|
||||
<code>
|
||||
// <a href="source/javatypes.js">javatypes.js</a>
|
||||
|
||||
var arrayListType = Java.type("java.util.ArrayList")
|
||||
var intType = Java.type("int")
|
||||
var stringArrayType = Java.type("java.lang.String[]")
|
||||
var int2DArrayType = Java.type("int[][]")
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
Note that the name of the type is always a string for a fully qualified name. You can use any of these expressions to create new instances, e.g.:
|
||||
|
||||
<pre><code>
|
||||
var anArrayList = new (Java.type("java.util.ArrayList"))
|
||||
</code></pre>
|
||||
|
||||
or
|
||||
|
||||
<pre><code>
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var anArrayList = new ArrayList
|
||||
var anArrayListWithSize = new ArrayList(16)
|
||||
</code></pre>
|
||||
|
||||
In the special case of inner classes, you can either use the JVM fully qualified name, meaning using the dollar sign in the class name, or you can use the dot:
|
||||
|
||||
<pre><code>
|
||||
var ftype = Java.type("java.awt.geom.Arc2D$Float")
|
||||
</code></pre>
|
||||
|
||||
and
|
||||
|
||||
<pre><code>
|
||||
var ftype = Java.type("java.awt.geom.Arc2D.Float")
|
||||
</code></pre>
|
||||
|
||||
both work. Note however that using the dollar sign is faster, as Java.type first tries to resolve the class name as it is originally specified, and the internal JVM names for inner classes use the dollar sign. If you use the dot, Java.type will internally get a ClassNotFoundException and subsequently retry by changing the last dot to dollar sign. As a matter of fact, it'll keep replacing dots with dollar signs until it either successfully loads the class or runs out of all dots in the name. This way it can correctly resolve and load even multiply nested inner classes with the dot notation. Again, this will be slower than using the dollar signs in the name. An alternative way to access the inner class is as a property of the outer class:
|
||||
|
||||
<pre><code>
|
||||
var arctype = Java.type("java.awt.geom.Arc2D")
|
||||
var ftype = arctype.Float
|
||||
</code></pre>
|
||||
<p>
|
||||
You can access both static and non-static inner classes. If you want to create an instance of a non-static inner class, remember to pass an instance of its outer class as the first argument to the constructor.
|
||||
</p>
|
||||
<p>
|
||||
In addition to creating new instances, the type objects returned from <code>Java.type</code> calls can also be used to access the
|
||||
static fields and methods of the classes:
|
||||
<pre><code>
|
||||
var File = Java.type("java.io.File")
|
||||
File.createTempFile("nashorn", ".tmp")
|
||||
</code></pre>
|
||||
<p>
|
||||
Methods with names of the form <code>isXxx()</code>, <code>getXxx()</code>, and <code>setXxx()</code> can also be used as properties, for both instances and statics.
|
||||
</p>
|
||||
<p>
|
||||
A type object returned from <code>Java.type</code> is distinct from a <code>java.lang.Class</code> object. You can obtain one from the other using properties <code>class</code> and <code>static</code> on them.
|
||||
<pre><code>
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var a = new ArrayList
|
||||
|
||||
// All of the following print true:
|
||||
print("Type acts as target of instanceof: " + (a instanceof ArrayList))
|
||||
print("Class doesn't act as target of instanceof: " + !(a instanceof a.getClass()))
|
||||
print("Type is not same as instance's getClass(): " + (a.getClass() !== ArrayList))
|
||||
print("Type's `class` property is same as instance getClass(): " + (a.getClass() === ArrayList.class))
|
||||
print("Type is same as instance getClass()'s `static` property: " + (a.getClass().static === ArrayList))
|
||||
</code></pre>
|
||||
<p>
|
||||
You can think of the type object as similar to the class names as used in Java source code: you use them as the
|
||||
arguments to the <code>new</code> and <code>instanceof</code> operators and as the namespace for the static fields
|
||||
and methods, but they are different than the runtime <code>Class</code> objects returned by <code>getClass()</code> calls.
|
||||
Syntactically and semantically, this separation produces code that is most similar to Java code, where a distinction
|
||||
between compile-time class expressions and runtime class objects also exists. (Also, Java can't have the equivalent of <code>static</code>
|
||||
property on a <code>Class</code> object since compile-time class expressions are never reified as objects).
|
||||
</p>
|
||||
<hr>
|
||||
<a name="jsimport" id="jsimport"></a>
|
||||
<h3>Importing Java Packages, Classes</h3>
|
||||
<p>The built-in functions <code>importPackage</code> (in compatibility script) and
|
||||
<code>importClass</code> can be used to import Java packages and
|
||||
classes.</p>
|
||||
<pre><code>
|
||||
|
||||
// <a href="source/importpackageclass.js">importpackageclass.js</a>
|
||||
|
||||
// load compatibility script
|
||||
load("nashorn:mozilla_compat.js");
|
||||
// Import Java packages and classes
|
||||
// like import package.*; in Java
|
||||
<span class="functionref">importPackage</span>(java.awt);
|
||||
// like import java.awt.Frame in Java
|
||||
<span class="functionref">importClass</span>(java.awt.Frame);
|
||||
// Create Java Objects by "new ClassName"
|
||||
var frame = new java.awt.Frame("hello");
|
||||
// Call Java public methods from script
|
||||
frame.setVisible(true);
|
||||
// Access "JavaBean" properties like "fields"
|
||||
print(frame.title);
|
||||
</code>
|
||||
</pre>
|
||||
<p>The <span class="objectref">Packages</span> global variable can
|
||||
be used to access Java packages. Examples:
|
||||
<code>Packages.java.util.Vector</code>,
|
||||
<code>Packages.javax.swing.JFrame</code>. Please note that "java"
|
||||
is a shortcut for "Packages.java". There are equivalent shortcuts
|
||||
for javax, org, edu, com, net prefixes, so pratically all JDK
|
||||
platform classes can be accessed without the "Packages" prefix.</p>
|
||||
<p>Note that java.lang is not imported by default (unlike Java)
|
||||
because that would result in conflicts with JavaScript's built-in
|
||||
Object, Boolean, Math and so on.</p>
|
||||
<p><code>importPackage</code> and <code>importClass</code>
|
||||
functions "pollute" the global variable scope of JavaScript. To
|
||||
avoid that, you may use <span class="functionref">JavaImporter</span>.</p>
|
||||
<pre><code>
|
||||
|
||||
// <a href="source/javaimporter.js">javaimporter.js</a>
|
||||
|
||||
// create JavaImporter with specific packages and classes to import
|
||||
|
||||
var SwingGui = new <span class="functionref">JavaImporter</span>(javax.swing,
|
||||
javax.swing.event,
|
||||
javax.swing.border,
|
||||
java.awt.event);
|
||||
with (SwingGui) {
|
||||
// within this 'with' statement, we can access Swing and AWT
|
||||
// classes by unqualified (simple) names.
|
||||
|
||||
var mybutton = new JButton("test");
|
||||
var myframe = new JFrame("test");
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="jsarrays" id="jsarrays"></a>
|
||||
<h3>Creating, Converting and Using Java Arrays</h3>
|
||||
<p>
|
||||
Array element access or length access is the same as in Java.</p>
|
||||
<pre><code>
|
||||
// <a href="source/javaarray.js">javaarray.js</a>
|
||||
|
||||
// create Java String array of 5 elements
|
||||
var StringArray = Java.type("java.lang.String[]");
|
||||
var a = new StringArray(5);
|
||||
|
||||
// Accessing elements and length access is by usual Java syntax
|
||||
a[0] = "scripting is great!";
|
||||
print(a.length);
|
||||
print(a[0]);
|
||||
</code>
|
||||
</pre>
|
||||
<p>
|
||||
It is also possible to convert between JavaScript and Java arrays.
|
||||
Given a JavaScript array and a Java type, <code>Java.to</code> returns a Java array with the same initial contents, and with the specified array type.
|
||||
</p>
|
||||
<pre><code>
|
||||
var anArray = [1, "13", false]
|
||||
var javaIntArray = Java.to(anArray, "int[]")
|
||||
print(javaIntArray[0]) // prints 1
|
||||
print(javaIntArray[1]) // prints 13, as string "13" was converted to number 13 as per ECMAScript ToNumber conversion
|
||||
print(javaIntArray[2]) // prints 0, as boolean false was converted to number 0 as per ECMAScript ToNumber conversion
|
||||
</code></pre>
|
||||
<p>
|
||||
You can use either a string or a type object returned from <code>Java.type()</code> to specify the type of the array.
|
||||
You can also omit the array type, in which case a <code>Object[]</code> will be created.
|
||||
</p>
|
||||
<p>
|
||||
Given a Java array or Collection, <code>Java.from</code> returns a JavaScript array with a shallow copy of its contents. Note that in most cases, you can use Java arrays and lists natively in Nashorn; in cases where for some reason you need to have an actual JavaScript native array (e.g. to work with the array comprehensions functions), you will want to use this method.
|
||||
</p>
|
||||
<pre><code>
|
||||
var File = Java.type("java.io.File");
|
||||
var listCurDir = new File(".").listFiles();
|
||||
var jsList = Java.from(listCurDir);
|
||||
print(jsList);
|
||||
</code></pre>
|
||||
<hr>
|
||||
<a name="jsimplement" id="jsimplement"></a>
|
||||
<h3>Implementing Java interfaces</h3>
|
||||
<p>A Java interface can be implemented in JavaScript by using a
|
||||
Java anonymous class-like syntax:</p>
|
||||
<pre><code>
|
||||
// <a href="source/runnable.js">runnable.js</a>
|
||||
|
||||
var r = new java.lang.Runnable() {
|
||||
run: function() {
|
||||
print("running...\n");
|
||||
}
|
||||
};
|
||||
|
||||
// "r" can be passed to Java methods that expect java.lang.Runnable
|
||||
var th = new java.lang.Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
</code>
|
||||
</pre>
|
||||
<p>When an interface with a single method is expected, you can pass
|
||||
a script function directly.(auto conversion)</p>
|
||||
<pre><code>
|
||||
// <a href="source/samfunc.js">samfunc.js</a>
|
||||
|
||||
function func() {
|
||||
print("I am func!");
|
||||
}
|
||||
|
||||
// pass script function for java.lang.Runnable argument
|
||||
var th = new java.lang.Thread(func);
|
||||
th.start();
|
||||
th.join();
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="jsextendabstract" id="jsextendabstract"></a>
|
||||
<h3>Extending Abstract Java Classes</h3>
|
||||
<p>
|
||||
If a Java class is abstract, you can instantiate an anonymous subclass of it using an argument list that is applicable to any of its public or protected constructors, but inserting a JavaScript object with functions properties that provide JavaScript implementations of the abstract methods. If method names are overloaded, the JavaScript function will provide implementation for all overloads. E.g.:
|
||||
</p>
|
||||
|
||||
<pre><code>
|
||||
var TimerTask = Java.type("java.util.TimerTask")
|
||||
var task = new TimerTask({ run: function() { print("Hello World!") } })
|
||||
</code></pre>
|
||||
|
||||
Nashorn supports a syntactic extension where a "new" expression followed by an argument is identical to invoking the constructor and passing the argument to it, so you can write the above example also as:
|
||||
|
||||
<pre><code>
|
||||
var task = new TimerTask {
|
||||
run: function() {
|
||||
print("Hello World!")
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
which is very similar to Java anonymous inner class definition. On the other hand, if the type is an abstract type with a single abstract method (commonly referred to as a "SAM type") or all abstract methods it has share the same overloaded name), then instead of an object, you can just pass a function, so the above example can become even more simplified to:
|
||||
|
||||
<pre><code>
|
||||
var task = new TimerTask(function() { print("Hello World!") })
|
||||
</code></pre>
|
||||
|
||||
<p>
|
||||
Note that in every one of these cases if you are trying to instantiate an abstract class that has constructors that take some arguments, you can invoke those simply by specifying the arguments after the initial implementation object or function.
|
||||
</p>
|
||||
<p>
|
||||
The use of functions can be taken even further; if you are invoking a Java method that takes a SAM type, you can just pass in a function object, and Nashorn will know what you meant:
|
||||
</p>
|
||||
<code><pre>
|
||||
Java.type("java.util.Timer")
|
||||
timer.schedule(function() { print("Hello World!") })
|
||||
</code></pre>
|
||||
|
||||
Here, <code>Timer.schedule()</code> expects a <code>TimerTask</code> as its argument, so Nashorn creates an instance of a TimerTask subclass and uses the passed function to implement its only abstract method, run(). In this usage though, you can't use non-default constructors; the type must be either an interface, or must have a protected or public no-arg constructor.
|
||||
|
||||
<hr>
|
||||
<a name="jsextendconcrete" id="jsextendconcrete"></a>
|
||||
<h3>Extending Concrete Java Classes</h3>
|
||||
<p>
|
||||
To extend a concrete Java class, you have to use <code>Java.extend</code> function.
|
||||
<code>Java.extend</code> returns a type object for a subclass of the specified Java class (or implementation of the specified interface) that acts as a script-to-Java adapter for it.
|
||||
</p>
|
||||
<pre><code>
|
||||
// <a href="source/javaextend.js">javaextend.js</a>
|
||||
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var ArrayListExtender = Java.extend(ArrayList)
|
||||
var printSizeInvokedArrayList = new ArrayListExtender() {
|
||||
size: function() { print("size invoked!"); }
|
||||
}
|
||||
var printAddInvokedArrayList = new ArrayListExtender() {
|
||||
add: function(x, y) {
|
||||
if(typeof(y) === "undefined") {
|
||||
print("add(e) invoked!");
|
||||
} else {
|
||||
print("add(i, e) invoked!");
|
||||
}
|
||||
}
|
||||
};
|
||||
printSizeInvokedArrayList.size();
|
||||
printAddInvokedArrayList.add(33, 33);
|
||||
</code></pre>
|
||||
<p>
|
||||
The reason you must use <code>Java.extend()</code> with concrete classes is that with concrete classes, there can be a
|
||||
syntactic ambiguity if you just invoke their constructor. Consider this example:
|
||||
</p>
|
||||
<pre><code>
|
||||
var t = new java.lang.Thread({ run: function() { print("Hello!") } })
|
||||
</code></pre>
|
||||
<p>
|
||||
If we allowed subclassing of concrete classes with constructor syntax, Nashorn couldn't tell if you're creating a new
|
||||
<code>Thread</code> and passing it a <code>Runnable</code> at this point, or you are subclassing <code>Thread</code> and
|
||||
passing it a new implementation for its own <code>run()</code> method.
|
||||
</p>
|
||||
<hr>
|
||||
<a name="jsimplementmultiple" id="jsimplementmultiple"></a>
|
||||
<h3>Implementing Multiple Interfaces</h3>
|
||||
<p>
|
||||
<code>Java.extend</code> can in fact take a list of multiple types. At most one of the types can be a class, and the rest must
|
||||
be interfaces (the class doesn't have to be the first in the list). You will get back an object that extends the class and
|
||||
implements all the interfaces. (Obviously, if you only specify interfaces and no class, the object will extend <code>java.lang.Object</code>).
|
||||
<hr>
|
||||
<a name="classBoundImplementations" id="classBoundImplementations"></a>
|
||||
<h3>Class-Bound Implementations</h3>
|
||||
<p>
|
||||
The methods shown so far for extending Java classes and implementing interfaces – passing an implementation JavaScript object
|
||||
or function to a constructor, or using <code>Java.extend</code> with <code>new</code> – all produce classes that take an
|
||||
extra JavaScript object parameter in their constructors that specifies the implementation. The implementation is therefore always bound
|
||||
to the actual instance being created with <code>new</code>, and not to the whole class. This has some advantages, for example in the
|
||||
memory footprint of the runtime, as Nashorn can just create a single "universal adapter" for every combination of types being implemented.
|
||||
In reality, the below code shows that different instantiations of, say, <code>Runnable</code> have the same class regardless of them having
|
||||
different JavaScript implementation objects:
|
||||
</p>
|
||||
<pre><code>
|
||||
var Runnable = java.lang.Runnable;
|
||||
var r1 = new Runnable(function() { print("I'm runnable 1!") })
|
||||
var r2 = new Runnable(function() { print("I'm runnable 2!") })
|
||||
r1.run()
|
||||
r2.run()
|
||||
print("We share the same class: " + (r1.class === r2.class))
|
||||
</code></pre>
|
||||
<p>
|
||||
prints:
|
||||
</p>
|
||||
<pre><code>
|
||||
I'm runnable 1!
|
||||
I'm runnable 2!
|
||||
We share the same class: true
|
||||
</code></pre>
|
||||
<p>
|
||||
Sometimes, however, you'll want to extend a Java class or implement an interface with implementation bound to the class, not to
|
||||
its instances. Such a need arises, for example, when you need to pass the class for instantiation to an external API; prime example
|
||||
of this is the JavaFX framework where you need to pass an Application class to the FX API and let it instantiate it.
|
||||
</p>
|
||||
<p>
|
||||
Fortunately, there's a solution for that: <code>Java.extend()</code> – aside from being able to take any number of type parameters
|
||||
denoting a class to extend and interfaces to implement – can also take one last argument that has to be a JavaScript object
|
||||
that serves as the implementation for the methods. In this case, <code>Java.extend()</code> will create a class that has the same
|
||||
constructors as the original class had, as they don't need to take an an extra implementation object parameter. The example below
|
||||
shows how you can create class-bound implementations, and shows that in this case, the implementation classes for different invocations
|
||||
are indeed different:
|
||||
</p>
|
||||
<pre><code>
|
||||
var RunnableImpl1 = Java.extend(java.lang.Runnable, function() { print("I'm runnable 1!") })
|
||||
var RunnableImpl2 = Java.extend(java.lang.Runnable, function() { print("I'm runnable 2!") })
|
||||
var r1 = new RunnableImpl1()
|
||||
var r2 = new RunnableImpl2()
|
||||
r1.run()
|
||||
r2.run()
|
||||
print("We share the same class: " + (r1.class === r2.class))
|
||||
</code></pre>
|
||||
<p>
|
||||
prints:
|
||||
</p>
|
||||
<pre><code>
|
||||
I'm runnable 1!
|
||||
I'm runnable 2!
|
||||
We share the same class: false
|
||||
</code></pre>
|
||||
<p>
|
||||
As you can see, the major difference here is that we moved the implementation object into the invocation of <code>Java.extend</code>
|
||||
from the constructor invocations – indeed the constructor invocations now don't even need to take an extra parameter! Since
|
||||
the implementations are bound to a class, the two classes obviously can't be the same, and we indeed see that the two runnables no
|
||||
longer share the same class – every invocation of <code>Java.extend()</code> with a class-specific implementation object triggers
|
||||
the creation of a new Java adapter class.
|
||||
</p>
|
||||
<p>
|
||||
Finally, the adapter classes with class-bound implementations can <i>still</i> take an additional constructor parameter to further
|
||||
override the behavior on a per-instance basis. Thus, you can even combine the two approaches: you can provide part of the implementation
|
||||
in a class-based JavaScript implementation object passed to <code>Java.extend</code>, and part in another object passed to the constructor.
|
||||
Whatever functions are provided by the constructor-passed object will override the functions in the class-bound object.
|
||||
</p>
|
||||
<pre><code>
|
||||
var RunnableImpl = Java.extend(java.lang.Runnable, function() { print("I'm runnable 1!") })
|
||||
var r1 = new RunnableImpl()
|
||||
var r2 = new RunnableImpl(function() { print("I'm runnable 2!") })
|
||||
r1.run()
|
||||
r2.run()
|
||||
print("We share the same class: " + (r1.class === r2.class))
|
||||
</code></pre>
|
||||
<p>
|
||||
prints:
|
||||
</p>
|
||||
<pre><code>
|
||||
I'm runnable 1!
|
||||
I'm runnable 2!
|
||||
We share the same class: true
|
||||
</code></pre>
|
||||
<hr>
|
||||
<a name="jsoverload" id="jsoverload"></a>
|
||||
<h3>Overload Resolution</h3>
|
||||
<p>Java methods can be overloaded by argument types. In Java,
|
||||
overload resolution occurs at compile time (performed by javac).
|
||||
When calling Java methods from Nashorn, the appropriate method will be
|
||||
selected based on the argument types at invocation time. You do not need
|
||||
to do anything special – the correct Java method overload variant
|
||||
is selected based automatically. You still have the option of explicitly
|
||||
specifying a particular overload variant. Reasons for this include
|
||||
either running into a genuine ambiguity with actual argument types, or
|
||||
rarely reasons of performance – if you specify the actual overload
|
||||
then the engine doesn't have to perform resolution during invocation.
|
||||
Individual overloads of a Java methods are exposed as special properties
|
||||
with the name of the method followed with its signature in parentheses.
|
||||
You can invoke them like this:</p>
|
||||
<pre><code>
|
||||
// <a href="source/overload.js">overload.js</a>
|
||||
|
||||
var out = java.lang.System.out;
|
||||
|
||||
// select a particular print function
|
||||
out["println(Object)"]("hello");
|
||||
</code>
|
||||
</pre>
|
||||
<p>
|
||||
Note that you normally don't even have to use qualified class names in
|
||||
the signatures as long as the unqualified name of the type is sufficient
|
||||
for uniquely identifying the signature. In practice this means that only
|
||||
in the extremely unlikely case that two overloads only differ in
|
||||
parameter types that have identical unqualified names but come from
|
||||
different packages would you need to use the fully qualified name of the
|
||||
class.
|
||||
</p>
|
||||
<hr>
|
||||
<a name="dataTypeMapping" id="dataTypeMapping"></a>
|
||||
<h3>Mapping of Data Types Between Java and JavaScript</h3>
|
||||
<p>
|
||||
We have previously shown some of the data type mappings between Java and JavaScript.
|
||||
We saw that arrays need to be explicitly converted. We have also shown that JavaScript functions
|
||||
are automatically converted to SAM types when passed as parameters to Java methods. Most other
|
||||
conversions work as you would expect.
|
||||
</p>
|
||||
<p>
|
||||
Every JavaScript object is also a <code>java.util.Map</code> so APIs receiving maps will receive them directly.
|
||||
</p>
|
||||
<p>
|
||||
When numbers are passed to a Java API, they will be converted to the expected target numeric type, either boxed or
|
||||
primitive, but if the target type is less specific, say <code>Number</code> or <code>Object</code>, you can only
|
||||
count on them being a <code>Number</code>, and have to test specifically for whether it's a boxed <code>Double</code>,
|
||||
<code>Integer</code>, <code>Long</code>, etc. – it can be any of these due to internal optimizations. Also, you
|
||||
can pass any JavaScript value to a Java API expecting either a boxed or primitive number; the JavaScript specification's
|
||||
<code>ToNumber</code> conversion algorithm will be applied to the value.
|
||||
</p>
|
||||
<p>
|
||||
In a similar vein, if a Java method expects a <code>String</code> or a <code>Boolean</code>, the values will be
|
||||
converted using all conversions allowed by the JavaScript specification's <code>ToString</code> and <code>ToBoolean</code>
|
||||
conversions.
|
||||
</p>
|
||||
<p>
|
||||
Finally, a word of caution about strings. Due to internal performance optimizations of string operations, JavaScript strings are
|
||||
not always necessarily of type <code>java.lang.String</code>, but they will always be of type <code>java.lang.CharSequence</code>.
|
||||
If you pass them to a Java method that expects a <code>java.lang.String</code> parameter, then you will naturally receive a Java
|
||||
String, but if the signature of your method is more generic, i.e. it receives a <code>java.lang.Object</code> parameter, you can
|
||||
end up with an object of private engine implementation class that implements <code>CharSequence</code> but is not a Java String.
|
||||
</p>
|
||||
<hr>
|
||||
<a name="engineimpl" id="engineimpl"></a>
|
||||
<h2>Implementing Your Own Script Engine</h2>
|
||||
<p>We will not cover implementation of JSR-223 compliant script
|
||||
engines in detail. Minimally, you need to implement the
|
||||
<code>javax.script.ScriptEngine</code> and
|
||||
<code>javax.script.ScriptEngineFactory</code> interfaces. The
|
||||
abstract class <code>javax.script.AbstractScriptEngine</code>
|
||||
provides useful defaults for a few methods of the
|
||||
<code>ScriptEngine</code> interface.</p>
|
||||
<p>Before starting to implement a JSR-223 engine, you may want to
|
||||
check <a href="http://java.net/projects/Scripting">http://java.net/projects/Scripting</a>
|
||||
project. This project maintains JSR-223 implementations for many
|
||||
popular open source scripting languages.</p>
|
||||
<hr>
|
||||
<a name="refs" id="refs"></a>
|
||||
<h2>References</h2>
|
||||
<ul>
|
||||
<li><a href="http://jcp.org/en/jsr/detail?id=223">JSR-223 Scripting
|
||||
for the Java Platform</a></li>
|
||||
<li><a href="http://java.net/projects/Scripting">http://java.net/projects/Scripting
|
||||
</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div class="hr"><hr></div>
|
||||
<table summary="layout" border="0" width="100%">
|
||||
<tbody><tr valign="TOP">
|
||||
<td width="30%"> <img src="Java%20Scripting%20Programmer%27s%20Guide_files/logo_oracle_footer.gif" alt="Oracle and/or its affiliates" border="0" height="29" width="100"><br>
|
||||
<font size="+1"> <i>Java Technology</i></font> </td>
|
||||
|
||||
<td width="30%">
|
||||
<p><font size="-2">
|
||||
<a href="http://docs.oracle.com/javase/6/docs/legal/cpyr.html">Copyright <20></a> 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
</font></p>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<p align="right"><font size="-2"><a href="http://download.oracle.com/javase/feedback.html">Contact Us</a></font></p><font size="-2">
|
||||
</font></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<div class="hr"><hr></div>
|
||||
</div>
|
||||
|
||||
<!-- Start SiteCatalyst code -->
|
||||
<script language="JavaScript" src="Java%20Scripting%20Programmer%27s%20Guide_files/s_code_download.js"></script>
|
||||
<script language="JavaScript" src="Java%20Scripting%20Programmer%27s%20Guide_files/s_code.js"></script>
|
||||
|
||||
<!-- ********** DO NOT ALTER ANYTHING BELOW THIS LINE ! *********** -->
|
||||
<!-- Below code will send the info to Omniture server -->
|
||||
<script language="javascript">var s_code=s.t();if(s_code)document.write(s_code)</script>
|
||||
|
||||
<!-- End SiteCatalyst code -->
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class EvalFile {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
final ScriptEngineManager factory = new ScriptEngineManager();
|
||||
// create JavaScript engine
|
||||
final ScriptEngine engine = factory.getEngineByName("nashorn");
|
||||
// evaluate JavaScript code from given file - specified by first argument
|
||||
engine.eval(new java.io.FileReader(args[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class EvalScript {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
final ScriptEngineManager factory = new ScriptEngineManager();
|
||||
// create a JavaScript engine
|
||||
final ScriptEngine engine = factory.getEngineByName("nashorn");
|
||||
// evaluate JavaScript code from String
|
||||
engine.eval("print('Hello, World')");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class InvokeScriptFunction {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
final String script = "function hello(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// javax.script.Invocable is an optional interface.
|
||||
// Check whether your script engine implements or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// invoke the global function named "hello"
|
||||
inv.invokeFunction("hello", "Scripting!!" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class InvokeScriptMethod {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String. This code defines a script object 'obj'
|
||||
// with one method called 'hello'.
|
||||
final String script = "var obj = new Object(); obj.hello = function(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// javax.script.Invocable is an optional interface.
|
||||
// Check whether your script engine implements or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// get script object on which we want to call the method
|
||||
final Object obj = engine.get("obj");
|
||||
|
||||
// invoke the method named "hello" on the script object "obj"
|
||||
inv.invokeMethod(obj, "hello", "Script Method !!" );
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Bindings;
|
||||
import javax.script.ScriptContext;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.SimpleScriptContext;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class MultiScopes {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
engine.put("x", "hello");
|
||||
// print global variable "x"
|
||||
engine.eval("print(x);");
|
||||
// the above line prints "hello"
|
||||
|
||||
// Now, pass a different script context
|
||||
final ScriptContext newContext = new SimpleScriptContext();
|
||||
newContext.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
|
||||
final Bindings engineScope = newContext.getBindings(ScriptContext.ENGINE_SCOPE);
|
||||
|
||||
// add new variable "x" to the new engineScope
|
||||
engineScope.put("x", "world");
|
||||
|
||||
// execute the same script - but this time pass a different script context
|
||||
engine.eval("print(x);", newContext);
|
||||
// the above line prints "world"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class RunnableImpl {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
final String script = "function run() { print('run called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script functions with the matching name.
|
||||
final Runnable r = inv.getInterface(Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
final Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class RunnableImplObject {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
final String script = "var obj = new Object(); obj.run = function() { print('run method called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// get script object on which we want to implement the interface with
|
||||
final Object obj = engine.get("obj");
|
||||
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script methods of object 'obj'
|
||||
final Runnable r = inv.getInterface(obj, Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
final Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class ScriptVars {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
final File f = new File("test.txt");
|
||||
// expose File object as variable to script
|
||||
engine.put("file", f);
|
||||
|
||||
// evaluate a script string. The script accesses "file"
|
||||
// variable and calls method on it
|
||||
engine.eval("print(file.getAbsolutePath())");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// load compatibility script
|
||||
load("nashorn:mozilla_compat.js");
|
||||
|
||||
// Import Java packages and classes
|
||||
// like import package.*; in Java
|
||||
importPackage(java.awt);
|
||||
// like import java.awt.Frame in Java
|
||||
importClass(java.awt.Frame);
|
||||
// Create Java Objects by "new ClassName"
|
||||
var frame = new java.awt.Frame("hello");
|
||||
// Call Java public methods from script
|
||||
frame.setVisible(true);
|
||||
// Access "JavaBean" properties like "fields"
|
||||
print(frame.title);
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// create Java String array of 5 elements
|
||||
var StringArray = Java.type("java.lang.String[]");
|
||||
var a = new StringArray(5);
|
||||
|
||||
// Accessing elements and length access is by usual Java syntax
|
||||
a[0] = "scripting is great!";
|
||||
print(a.length);
|
||||
print(a[0]);
|
||||
|
||||
// convert a script array to Java array
|
||||
var anArray = [1, "13", false];
|
||||
var javaIntArray = Java.to(anArray, "int[]");
|
||||
print(javaIntArray[0]);// prints 1
|
||||
print(javaIntArray[1]); // prints 13, as string "13" was converted to number 13 as per ECMAScript ToNumber conversion
|
||||
print(javaIntArray[2]);// prints 0, as boolean false was converted to number 0 as per ECMAScript ToNumber conversion
|
||||
|
||||
// convert a Java array to a JavaScript array
|
||||
var File = Java.type("java.io.File");
|
||||
var listCurDir = new File(".").listFiles();
|
||||
var jsList = Java.from(listCurDir);
|
||||
print(jsList);
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var ArrayListExtender = Java.extend(ArrayList)
|
||||
var printSizeInvokedArrayList = new ArrayListExtender() {
|
||||
size: function() { print("size invoked!"); }
|
||||
}
|
||||
var printAddInvokedArrayList = new ArrayListExtender() {
|
||||
add: function(x, y) {
|
||||
if(typeof(y) === "undefined") {
|
||||
print("add(e) invoked!");
|
||||
} else {
|
||||
print("add(i, e) invoked!");
|
||||
}
|
||||
}
|
||||
};
|
||||
printSizeInvokedArrayList.size();
|
||||
printAddInvokedArrayList.add(33, 33);
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// create JavaImporter with specific packages and classes to import
|
||||
|
||||
var SwingGui = new JavaImporter(javax.swing,
|
||||
javax.swing.event,
|
||||
javax.swing.border,
|
||||
java.awt.event);
|
||||
with (SwingGui) {
|
||||
// within this 'with' statement, we can access Swing and AWT
|
||||
// classes by unqualified (simple) names.
|
||||
|
||||
var mybutton = new JButton("test");
|
||||
print(mybutton);
|
||||
var myframe = new JFrame("test");
|
||||
print(myframe);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// accessing java types
|
||||
var arrayListType = Java.type("java.util.ArrayList")
|
||||
var intType = Java.type("int")
|
||||
var stringArrayType = Java.type("java.lang.String[]")
|
||||
var int2DArrayType = Java.type("int[][]")
|
||||
|
||||
// Using java types
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var anArrayList = new ArrayList
|
||||
var anArrayListWithSize = new ArrayList(16)
|
||||
|
||||
// fully qualified name
|
||||
var ftype = Java.type("java.awt.geom.Arc2D$Float")
|
||||
|
||||
// inner class property
|
||||
var arctype = Java.type("java.awt.geom.Arc2D")
|
||||
var ftype = arctype.Float
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var out = java.lang.System.out;
|
||||
|
||||
// select a particular print function
|
||||
out["println(java.lang.Object)"]("hello");
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var r = new java.lang.Runnable() {
|
||||
run: function() {
|
||||
print("running...\n");
|
||||
}
|
||||
};
|
||||
|
||||
// "r" can be passed to Java methods that expect java.lang.Runnable
|
||||
var th = new java.lang.Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
function func() {
|
||||
print("I am func!");
|
||||
}
|
||||
|
||||
// pass script function for java.lang.Runnable argument
|
||||
var th = new java.lang.Thread(func);
|
||||
th.start();
|
||||
th.join();
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
print("This is hello from test.js");
|
||||
12
jb/project/docker/Dockerfile
Normal file
12
jb/project/docker/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
# jetbrains/runtime:jbr15env
|
||||
FROM centos:7
|
||||
RUN yum -y install centos-release-scl
|
||||
RUN yum -y install devtoolset-8
|
||||
RUN yum -y install zip bzip2 unzip tar wget make autoconf automake libtool gcc gcc-c++ libstdc++-devel alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel freetype-devel file which libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel git
|
||||
# Install Java 15
|
||||
RUN wget https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz \
|
||||
-O - | tar xz -C /
|
||||
RUN mv /zulu15.27.17-ca-jdk15.0.0-linux_x64 /jdk15.0.0
|
||||
ENV PATH /opt/rh/devtoolset-8/root/usr/bin:$PATH
|
||||
RUN git config --global user.email "builduser@jetbrains.com"
|
||||
RUN git config --global user.name "builduser"
|
||||
10
jb/project/docker/x86/Dockerfile
Normal file
10
jb/project/docker/x86/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM i386/ubuntu:xenial
|
||||
|
||||
RUN linux32 apt-get update && apt-get install -y --no-install-recommends apt-utils
|
||||
RUN linux32 apt-get -y install file build-essential zip unzip tar wget curl libx11-dev libxext-dev \
|
||||
libxrender-dev libxrandr-dev libxtst-dev libxt-dev libcups2-dev libasound2-data \
|
||||
libpng12-0 libasound2 libfreetype6 libfontconfig1-dev libasound2-dev autoconf git
|
||||
# Install Java 15
|
||||
RUN wget https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_i686.tar.gz \
|
||||
-O - | tar xz -C /
|
||||
RUN mv /zulu15.27.17-ca-jdk15.0.0-linux_i686 /jdk15.0.0
|
||||
54
jb/project/tools/common/scripts/common.sh
Normal file
54
jb/project/tools/common/scripts/common.sh
Normal file
@@ -0,0 +1,54 @@
|
||||
VENDOR_NAME="JetBrains s.r.o."
|
||||
VENDOR_VERSION_STRING="JBR-${JBSDK_VERSION_WITH_DOTS}.${JDK_BUILD_NUMBER}-${build_number}"
|
||||
[ -z "$bundle_type" ] || VENDOR_VERSION_STRING="${VENDOR_VERSION_STRING}-${bundle_type}"
|
||||
|
||||
do_reset_changes=0
|
||||
do_reset_dcevm=0
|
||||
HEAD_REVISION=0
|
||||
|
||||
function do_exit() {
|
||||
exit_code=$1
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD modules.list src/java.desktop/share/classes/module-info.java
|
||||
if [ $do_reset_dcevm -eq 1 ]; then
|
||||
[ ! -z $HEAD_REVISION ] && git reset --hard $HEAD_REVISION
|
||||
fi
|
||||
exit "$exit_code"
|
||||
}
|
||||
|
||||
function update_jsdk_mods() {
|
||||
__jsdk=$1
|
||||
__jcef_mods=$2
|
||||
__orig_jsdk_mods=$3
|
||||
__updated_jsdk_mods=$4
|
||||
|
||||
# re-create java.desktop.jmod with updated module-info.class
|
||||
tmp=.java.desktop.$$.tmp
|
||||
mkdir "$tmp" || exit $?
|
||||
"$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.desktop.jmod || exit $?
|
||||
"$__jsdk"/bin/javac \
|
||||
--patch-module java.desktop="$__orig_jsdk_mods"/java.desktop.jmod \
|
||||
--module-path "$__jcef_mods" -d "$tmp"/classes src/java.desktop/share/classes/module-info.java || exit $?
|
||||
"$__jsdk"/bin/jmod \
|
||||
create --class-path "$tmp"/classes --config "$tmp"/conf --header-files "$tmp"/include --legal-notice "$tmp"/legal --libs "$tmp"/lib \
|
||||
java.desktop.jmod || exit $?
|
||||
mv java.desktop.jmod "$__updated_jsdk_mods" || exit $?
|
||||
rm -rf "$tmp"
|
||||
|
||||
# re-create java.base.jmod with updated hashes
|
||||
tmp=.java.base.$$.tmp
|
||||
mkdir "$tmp" || exit $?
|
||||
hash_modules=$("$JSDK"/bin/jmod describe "$__orig_jsdk_mods"/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
|
||||
"$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.base.jmod || exit $?
|
||||
rm "$__updated_jsdk_mods"/java.base.jmod || exit $? # temp exclude from path
|
||||
"$__jsdk"/bin/jmod \
|
||||
create --module-path "$__updated_jsdk_mods" --hash-modules "$hash_modules" \
|
||||
--class-path "$tmp"/classes --cmds "$tmp"/bin --config "$tmp"/conf --header-files "$tmp"/include --legal-notice "$tmp"/legal --libs "$tmp"/lib \
|
||||
java.base.jmod || exit $?
|
||||
mv java.base.jmod "$__updated_jsdk_mods" || exit $?
|
||||
rm -rf "$tmp"
|
||||
}
|
||||
|
||||
function get_mods_list() {
|
||||
__mods=$1
|
||||
echo $(ls $__mods) | sed s/\.jmod/,/g | sed s/,$//g | sed s/' '//g
|
||||
}
|
||||
84
jb/project/tools/linux/scripts/mkimages_aarch64.sh
Executable file
84
jb/project/tools/linux/scripts/mkimages_aarch64.sh
Executable file
@@ -0,0 +1,84 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=linux-aarch64-server-release || exit $?
|
||||
make images CONF=linux-aarch64-server-release test-image || exit $?
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-aarch64-b${build_number}
|
||||
BASE_DIR=build/linux-aarch64-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
|
||||
tar -pcf $JBSDK.tar \
|
||||
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
|
||||
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-aarch64-b$build_number
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.aarch64
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.aarch64 | sed s/" "//g | sed s/,$//g) \
|
||||
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
|
||||
|
||||
echo Modifying release info ...
|
||||
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
tar -pcf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
|
||||
gzip $JBR.tar || exit $?
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-aarch64-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' test || exit $?
|
||||
gzip $JBRSDK_TEST.tar || exit $?
|
||||
137
jb/project/tools/linux/scripts/mkimages_x64.sh
Executable file
137
jb/project/tools/linux/scripts/mkimages_x64.sh
Executable file
@@ -0,0 +1,137 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
# Environment variables:
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_linux_x64
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
function create_image_bundle {
|
||||
__bundle_name=$1
|
||||
__arch_name=$2
|
||||
__modules_path=$3
|
||||
__modules=$4
|
||||
|
||||
[ "$bundle_type" == "fd" ] && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-x64-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Running jlink....
|
||||
[ -d "$IMAGES_DIR"/"$__arch_name" ] && rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
$JSDK/bin/jlink \
|
||||
--module-path "$__modules_path" --no-man-pages --compress=2 \
|
||||
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__arch_name"
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__arch_name"/release
|
||||
if [ "$__bundle_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__arch_name"/release > release
|
||||
mv release "$IMAGES_DIR"/"$__arch_name"/release
|
||||
fi
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
[ -f "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
tar -pcf "$JBR".tar -C "$IMAGES_DIR" "$__arch_name" || do_exit $?
|
||||
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
|
||||
gzip "$JBR".tar || do_exit $?
|
||||
rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=linux-x86_64-server-release
|
||||
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
do_reset_dcevm=1
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=linux-x86_64-server-fastdebug
|
||||
;;
|
||||
esac
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
|
||||
--with-version-pre= \
|
||||
--with-version-build="$JDK_BUILD_NUMBER" \
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--enable-cds=yes || do_exit $?
|
||||
|
||||
make clean CONF=$RELEASE_NAME || exit $?
|
||||
make images CONF=$RELEASE_NAME || do_exit $?
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JSDK_MODS_DIR=$IMAGES_DIR/jmods
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
modules=$(xargs < modules.list | sed s/" "//g) || do_exit $?
|
||||
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
# create sdk image bundle
|
||||
modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/,/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
|
||||
fi
|
||||
create_image_bundle $JBRSDK_BUNDLE $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
if [ -z "$bundle_type" ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-test-x64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
fi
|
||||
|
||||
do_exit 0
|
||||
81
jb/project/tools/linux/scripts/mkimages_x86.sh
Executable file
81
jb/project/tools/linux/scripts/mkimages_x86.sh
Executable file
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
|
||||
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
|
||||
|
||||
linux32 bash configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-debug-level=release \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=$JDK_BUILD_NUMBER \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--enable-cds=yes || exit $?
|
||||
make clean CONF=linux-x86-server-release || exit $?
|
||||
make images CONF=linux-x86-server-release test-image || exit $?
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-linux-x86-b${build_number}
|
||||
BASE_DIR=build/linux-x86-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
echo Fixing permissions
|
||||
chmod -R a+r $JSDK
|
||||
|
||||
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
|
||||
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
|
||||
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
|
||||
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
|
||||
|
||||
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man -C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
|
||||
gzip $JBSDK.tar || exit $?
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
rm -rf $BASE_DIR/$JBR_BUNDLE
|
||||
|
||||
JBR=$JBR_BASE_NAME-linux-x86-b$build_number
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
echo Running jlink....
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.x86 | sed s/" "//g | sed s/,$//g) --output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
|
||||
|
||||
echo Modifying release info ...
|
||||
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
tar -pcf $JBR.tar -C $BASE_DIR $JBR_BUNDLE || exit $?
|
||||
gzip $JBR.tar || exit $?
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x86-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' --exclude='test/hotspot/gtest' test || exit $?
|
||||
gzip $JBRSDK_TEST.tar || exit $?
|
||||
16
jb/project/tools/mac/scripts/entitlements.xml
Normal file
16
jb/project/tools/mac/scripts/entitlements.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
138
jb/project/tools/mac/scripts/mkimages.sh
Executable file
138
jb/project/tools/mac/scripts/mkimages.sh
Executable file
@@ -0,0 +1,138 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
# Environment variables:
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_mac
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo "$JBSDK_VERSION" | sed 's/_/\./g')
|
||||
JCEF_PATH=${JCEF_PATH:=./jcef_mac}
|
||||
MAJOR_JBSDK_VERSION=$(echo "$JBSDK_VERSION_WITH_DOTS" | awk -F "." '{print $1}')
|
||||
BOOT_JDK=${BOOT_JDK:=$(/usr/libexec/java_home -v 14)}
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
function create_image_bundle {
|
||||
__bundle_name=$1
|
||||
__modules_path=$2
|
||||
__modules=$3
|
||||
|
||||
tmp=.bundle.$$.tmp
|
||||
mkdir "$tmp" || do_exit $?
|
||||
|
||||
[ "$bundle_type" == "fd" ] && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-osx-x64-${fastdebug_infix}b${build_number}
|
||||
|
||||
JRE_CONTENTS=$tmp/$__bundle_name/Contents
|
||||
mkdir -p "$JRE_CONTENTS" || do_exit $?
|
||||
|
||||
echo Running jlink...
|
||||
"$JSDK"/bin/jlink \
|
||||
--module-path "$__modules_path" --no-man-pages --compress=2 \
|
||||
--add-modules "$__modules" --output "$JRE_CONTENTS/Home" || do_exit $?
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$JRE_CONTENTS/Home/release"
|
||||
if [ "$__bundle_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $JRE_CONTENTS/Home/release > release
|
||||
mv release $JRE_CONTENTS/Home/release
|
||||
fi
|
||||
|
||||
cp -R "$JSDK"/../MacOS "$JRE_CONTENTS"
|
||||
cp "$JSDK"/../Info.plist "$JRE_CONTENTS"
|
||||
[ -n "$bundle_type" ] && (cp -a $JCEF_PATH/Frameworks "$JRE_CONTENTS" || do_exit $?)
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
COPYFILE_DISABLE=1 tar -pczf "$JBR".tar.gz --exclude='*.dSYM' --exclude='man' -C "$tmp" "$__bundle_name" || do_exit $?
|
||||
rm -rf "$tmp"
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=macosx-x86_64-server-release
|
||||
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
do_reset_dcevm=1
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=macosx-x86_64-server-fastdebug
|
||||
;;
|
||||
esac
|
||||
|
||||
sh configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
|
||||
--with-version-pre= \
|
||||
--with-version-build="$JDK_BUILD_NUMBER" \
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--enable-cds=yes || do_exit $?
|
||||
|
||||
make clean CONF=$RELEASE_NAME || do_exit $?
|
||||
make images CONF=$RELEASE_NAME || do_exit $?
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk-bundle/jdk-$MAJOR_JBSDK_VERSION.jdk/Contents/Home
|
||||
JSDK_MODS_DIR=$IMAGES_DIR/jmods
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
modules=$(xargs < modules.list | sed s/" "//g) || do_exit $?
|
||||
create_image_bundle "jbr${jbr_name_postfix}" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
# create sdk image bundle
|
||||
modules=$(cat "$JSDK"/release | grep MODULES | sed s/MODULES=//g | sed s/' '/,/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
|
||||
|
||||
if [ -z "$bundle_type" ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-osx-test-x64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
COPYFILE_DISABLE=1 tar -pczf "$JBRSDK_TEST".tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
|
||||
do_exit 0
|
||||
120
jb/project/tools/mac/scripts/notarize.sh
Executable file
120
jb/project/tools/mac/scripts/notarize.sh
Executable file
@@ -0,0 +1,120 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP_DIRECTORY=$1
|
||||
APPL_USER=$2
|
||||
APPL_PASSWORD=$3
|
||||
APP_NAME=$4
|
||||
BUNDLE_ID=$5
|
||||
FAKE_ROOT="${6:-fake-root}"
|
||||
|
||||
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$APPL_USER" ]] || [[ -z "$APPL_PASSWORD" ]]; then
|
||||
echo "Usage: $0 AppDirectory Username Password"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "$APP_DIRECTORY" ]]; then
|
||||
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
function publish-log() {
|
||||
id=$1
|
||||
file=$2
|
||||
curl -T "$file" "$ARTIFACTORY_URL/$id" || true
|
||||
}
|
||||
|
||||
function altool-upload() {
|
||||
# Since altool uses same file for upload token we have to trick it into using different folders for token file location
|
||||
# Also it copies zip into TMPDIR so we override it too, to simplify cleanup
|
||||
OLD_HOME="$HOME"
|
||||
export HOME="$FAKE_ROOT/home"
|
||||
export TMPDIR="$FAKE_ROOT/tmp"
|
||||
mkdir -p "$HOME"
|
||||
mkdir -p "$TMPDIR"
|
||||
export _JAVA_OPTIONS="-Duser.home=$HOME -Djava.io.tmpdir=$TMPDIR"
|
||||
# Reduce amount of downloads, cache transporter libraries
|
||||
shared_itmstransporter="$OLD_HOME/shared-itmstransporter"
|
||||
if [[ -f "$shared_itmstransporter" ]]; then
|
||||
cp -r "$shared_itmstransporter" "$HOME/.itmstransporter"
|
||||
fi
|
||||
# For some reason altool prints everything to stderr, not stdout
|
||||
set +e
|
||||
xcrun altool --notarize-app \
|
||||
--username "$APPL_USER" --password "$APPL_PASSWORD" \
|
||||
--primary-bundle-id "$BUNDLE_ID" \
|
||||
--asc-provider JetBrainssro --file "$1" 2>&1 | tee "altool.init.out"
|
||||
unset TMPDIR
|
||||
export HOME="$OLD_HOME"
|
||||
set -e
|
||||
}
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
file="$APP_NAME.zip"
|
||||
|
||||
log "Zipping $file..."
|
||||
rm -rf "$file"
|
||||
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY/Contents" "$file"
|
||||
|
||||
log "Notarizing $file..."
|
||||
rm -rf "altool.init.out" "altool.check.out"
|
||||
altool-upload "$file"
|
||||
|
||||
rm -rf "$file"
|
||||
|
||||
notarization_info="$(grep -e "RequestUUID" "altool.init.out" | grep -oE '([0-9a-f-]{36})')"
|
||||
|
||||
if [ -z "$notarization_info" ]; then
|
||||
log "Faile to read RequestUUID from altool.init.out"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
PATH="$PATH:/usr/local/bin/"
|
||||
|
||||
log "Notarization request sent, awaiting response"
|
||||
spent=0
|
||||
|
||||
while true; do
|
||||
# For some reason altool prints everything to stderr, not stdout
|
||||
xcrun altool --username "$APPL_USER" --notarization-info "$notarization_info" --password "$APPL_PASSWORD" >"altool.check.out" 2>&1 || true
|
||||
status="$(grep -oe 'Status: .*' "altool.check.out" | cut -c 9- || true)"
|
||||
log "Current status: $status"
|
||||
if [ "$status" = "invalid" ]; then
|
||||
log "Notarization failed"
|
||||
ec=1
|
||||
elif [ "$status" = "success" ]; then
|
||||
log "Notarization succeeded"
|
||||
ec=0
|
||||
else
|
||||
if [ "$status" != "in progress" ]; then
|
||||
log "Unknown notarization status, waiting more, altool output:"
|
||||
cat "altool.check.out"
|
||||
fi
|
||||
if [[ $spent -gt 60 ]]; then
|
||||
log "Waiting time out (apx 60 minutes)"
|
||||
ec=2
|
||||
break
|
||||
fi
|
||||
sleep 60
|
||||
((spent += 1))
|
||||
continue
|
||||
fi
|
||||
developer_log="developer_log.json"
|
||||
log "Fetching $developer_log"
|
||||
# TODO: Replace cut with trim or something better
|
||||
url="$(grep -oe 'LogFileURL: .*' "altool.check.out" | cut -c 13-)"
|
||||
wget "$url" -O "$developer_log" && cat "$developer_log" || true
|
||||
if [ $ec != 0 ]; then
|
||||
log "Publishing $developer_log"
|
||||
publish-log "$notarization_info" "$developer_log"
|
||||
fi
|
||||
break
|
||||
done
|
||||
cat "altool.check.out"
|
||||
|
||||
rm -rf "altool.init.out" "altool.check.out"
|
||||
exit $ec
|
||||
94
jb/project/tools/mac/scripts/sign.sh
Executable file
94
jb/project/tools/mac/scripts/sign.sh
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP_DIRECTORY=$1
|
||||
JB_CERT=$2
|
||||
|
||||
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$JB_CERT" ]]; then
|
||||
echo "Usage: $0 AppDirectory CertificateID"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "$APP_DIRECTORY" ]]; then
|
||||
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
# Cleanup files left from previous sign attempt (if any)
|
||||
find "$APP_DIRECTORY" -name '*.cstemp' -exec rm '{}' \;
|
||||
|
||||
log "Signing libraries and executables..."
|
||||
# -perm +111 searches for executables
|
||||
for f in \
|
||||
"Contents/Home/bin" \
|
||||
"Contents/Home/lib" \
|
||||
"Contents/Frameworks"; do
|
||||
if [ -d "$APP_DIRECTORY/$f" ]; then
|
||||
find "$APP_DIRECTORY/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
|
||||
-exec codesign --timestamp \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--entitlements entitlements.xml {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
log "Signing libraries in jars in $PWD"
|
||||
|
||||
# todo: add set -euo pipefail; into the inner sh -c
|
||||
# `-e` prevents `grep -q && printf` loginc
|
||||
# with `-o pipefail` there's no input for 'while' loop
|
||||
find "$APP_DIRECTORY" -name '*.jar' \
|
||||
-exec sh -c "set -u; unzip -l \"\$0\" | grep -q -e '\.dylib\$' -e '\.jnilib\$' -e '\.so\$' -e '^jattach\$' && printf \"\$0\0\" " {} \; |
|
||||
while IFS= read -r -d $'\0' file; do
|
||||
log "Processing libraries in $file"
|
||||
|
||||
rm -rf jarfolder jar.jar
|
||||
mkdir jarfolder
|
||||
filename="${file##*/}"
|
||||
log "Filename: $filename"
|
||||
cp "$file" jarfolder && (cd jarfolder && jar xf "$filename" && rm "$filename")
|
||||
|
||||
find jarfolder \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "jattach" \) \
|
||||
-exec codesign --timestamp \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--entitlements entitlements.xml {} \;
|
||||
|
||||
(cd jarfolder; zip -q -r -o ../jar.jar .)
|
||||
mv jar.jar "$file"
|
||||
done
|
||||
|
||||
rm -rf jarfolder jar.jar
|
||||
|
||||
log "Signing other files..."
|
||||
for f in \
|
||||
"Contents/MacOS"; do
|
||||
if [ -d "$APP_DIRECTORY/$f" ]; then
|
||||
find "$APP_DIRECTORY/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
|
||||
-exec codesign --timestamp \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--entitlements entitlements.xml {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
#log "Signing executable..."
|
||||
#codesign --timestamp \
|
||||
# -v -s "$JB_CERT" --options=runtime \
|
||||
# --force \
|
||||
# --entitlements entitlements.xml "$APP_DIRECTORY/Contents/MacOS/idea"
|
||||
|
||||
log "Signing whole app..."
|
||||
codesign --timestamp \
|
||||
-v -s "$JB_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements entitlements.xml "$APP_DIRECTORY"
|
||||
|
||||
log "Verifying java is not broken"
|
||||
find "$APP_DIRECTORY" \
|
||||
-type f -name 'java' -perm +111 -exec {} -version \;
|
||||
138
jb/project/tools/mac/scripts/signapp.sh
Executable file
138
jb/project/tools/mac/scripts/signapp.sh
Executable file
@@ -0,0 +1,138 @@
|
||||
#!/bin/bash
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
|
||||
export COPYFILE_DISABLE=true
|
||||
|
||||
INPUT_FILE=$1
|
||||
EXPLODED=$2.exploded
|
||||
BACKUP_JMODS=$2.backup
|
||||
USERNAME=$3
|
||||
PASSWORD=$4
|
||||
CODESIGN_STRING=$5
|
||||
NOTARIZE=$6
|
||||
BUNDLE_ID=$7
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
log "Deleting $EXPLODED ..."
|
||||
if test -d "$EXPLODED"; then
|
||||
find "$EXPLODED" -mindepth 1 -maxdepth 1 -exec chmod -R u+wx '{}' \;
|
||||
fi
|
||||
rm -rf "$EXPLODED"
|
||||
mkdir "$EXPLODED"
|
||||
rm -rf "$BACKUP_JMODS"
|
||||
mkdir "$BACKUP_JMODS"
|
||||
|
||||
log "Unzipping $INPUT_FILE to $EXPLODED ..."
|
||||
tar -xzvf "$INPUT_FILE" --directory $EXPLODED
|
||||
rm "$INPUT_FILE"
|
||||
BUILD_NAME="$(ls "$EXPLODED")"
|
||||
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/jmods; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/Home/jmods $BACKUP_JMODS
|
||||
fi
|
||||
if test -f $EXPLODED/$BUILD_NAME/Contents/MacOS/libjli.dylib; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/MacOS/libjli.dylib $BACKUP_JMODS
|
||||
fi
|
||||
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/Frameworks; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/Home/Frameworks $BACKUP_JMODS
|
||||
fi
|
||||
|
||||
log "$INPUT_FILE extracted and removed"
|
||||
|
||||
APPLICATION_PATH="$EXPLODED/$BUILD_NAME"
|
||||
|
||||
find "$APPLICATION_PATH/Contents/Home/bin" \
|
||||
-maxdepth 1 -type f -name '*.jnilib' -print0 |
|
||||
while IFS= read -r -d $'\0' file; do
|
||||
if [ -f "$file" ]; then
|
||||
log "Linking $file"
|
||||
b="$(basename "$file" .jnilib)"
|
||||
ln -sf "$b.jnilib" "$(dirname "$file")/$b.dylib"
|
||||
fi
|
||||
done
|
||||
|
||||
find "$APPLICATION_PATH/Contents/" \
|
||||
-maxdepth 1 -type f -name '*.txt' -print0 |
|
||||
while IFS= read -r -d $'\0' file; do
|
||||
if [ -f "$file" ]; then
|
||||
log "Moving $file"
|
||||
mv "$file" "$APPLICATION_PATH/Contents/Resources"
|
||||
fi
|
||||
done
|
||||
|
||||
non_plist=$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist' | wc -l)
|
||||
if [[ $non_plist -gt 0 ]]; then
|
||||
log "Only Info.plist file is allowed in Contents directory but found $non_plist file(s):"
|
||||
log "$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Unlocking keychain..."
|
||||
# Make sure *.p12 is imported into local KeyChain
|
||||
security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
|
||||
|
||||
attempt=1
|
||||
limit=3
|
||||
set +e
|
||||
while [[ $attempt -le $limit ]]; do
|
||||
log "Signing (attempt $attempt) $APPLICATION_PATH ..."
|
||||
./sign.sh "$APPLICATION_PATH" "$CODESIGN_STRING"
|
||||
ec=$?
|
||||
if [[ $ec -ne 0 ]]; then
|
||||
((attempt += 1))
|
||||
if [ $attempt -eq $limit ]; then
|
||||
set -e
|
||||
fi
|
||||
log "Signing failed, wait for 30 sec and try to sign again"
|
||||
sleep 30
|
||||
else
|
||||
log "Signing done"
|
||||
codesign -v "$APPLICATION_PATH" -vvvvv
|
||||
log "Check sign done"
|
||||
((attempt += limit))
|
||||
fi
|
||||
done
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$NOTARIZE" = "yes" ]; then
|
||||
log "Notarizing..."
|
||||
# shellcheck disable=SC1090
|
||||
source "$HOME/.notarize_token"
|
||||
APP_NAME=$(echo ${INPUT_FILE} | awk -F"." '{ print $1 }')
|
||||
# Since notarization tool uses same file for upload token we have to trick it into using different folders, hence fake root
|
||||
# Also it leaves copy of zip file in TMPDIR, so notarize.sh overrides it and uses FAKE_ROOT as location for temp TMPDIR
|
||||
FAKE_ROOT="$(pwd)/fake-root"
|
||||
mkdir -p "$FAKE_ROOT"
|
||||
echo "Notarization will use fake root: $FAKE_ROOT"
|
||||
./notarize.sh "$APPLICATION_PATH" "$APPLE_USERNAME" "$APPLE_PASSWORD" "$APP_NAME" "$BUNDLE_ID" "$FAKE_ROOT"
|
||||
rm -rf "$FAKE_ROOT"
|
||||
|
||||
set +e
|
||||
log "Stapling..."
|
||||
xcrun stapler staple "$APPLICATION_PATH"
|
||||
else
|
||||
log "Notarization disabled"
|
||||
log "Stapling disabled"
|
||||
fi
|
||||
|
||||
log "Zipping $BUILD_NAME to $INPUT_FILE ..."
|
||||
(
|
||||
#cd "$EXPLODED"
|
||||
#ditto -c -k --sequesterRsrc --keepParent "$BUILD_NAME" "../$INPUT_FILE"
|
||||
if test -d $BACKUP_JMODS/jmods; then
|
||||
mv $BACKUP_JMODS/jmods $EXPLODED/$BUILD_NAME/Contents/Home
|
||||
fi
|
||||
|
||||
COPYFILE_DISABLE=1 tar -pczf $INPUT_FILE --exclude='*.dSYM' --exclude='man' -C $EXPLODED $BUILD_NAME
|
||||
log "Finished zipping"
|
||||
)
|
||||
rm -rf "$EXPLODED"
|
||||
log "Done"
|
||||
30
jb/project/tools/patches/add_jcef_module.patch
Normal file
30
jb/project/tools/patches/add_jcef_module.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
diff --git modules.list modules.list
|
||||
index 7c4b3e9cb6d..5ed60349ca7 100644
|
||||
--- modules.list
|
||||
+++ modules.list
|
||||
@@ -53,4 +53,7 @@ jdk.security.jgss,
|
||||
jdk.unsupported,
|
||||
jdk.xml.dom,
|
||||
jdk.zipfs,
|
||||
-jdk.hotspot.agent
|
||||
+jdk.hotspot.agent,
|
||||
+jcef,
|
||||
+gluegen.rt,
|
||||
+jogl.all
|
||||
diff --git src/java.desktop/share/classes/module-info.java src/java.desktop/share/classes/module-info.java
|
||||
index b663b382f52..3e9acdc0c27 100644
|
||||
--- src/java.desktop/share/classes/module-info.java
|
||||
+++ src/java.desktop/share/classes/module-info.java
|
||||
@@ -109,7 +109,11 @@ module java.desktop {
|
||||
// see make/GensrcModuleInfo.gmk
|
||||
exports sun.awt to
|
||||
jdk.accessibility,
|
||||
- jdk.unsupported.desktop;
|
||||
+ jdk.unsupported.desktop,
|
||||
+ jcef,
|
||||
+ jogl.all;
|
||||
+
|
||||
+ exports java.awt.peer to jcef;
|
||||
|
||||
exports java.awt.dnd.peer to jdk.unsupported.desktop;
|
||||
exports sun.awt.dnd to jdk.unsupported.desktop;
|
||||
8853
jb/project/tools/patches/dcevm/0001-Apply-basic-dcevm11-patch.patch
Normal file
8853
jb/project/tools/patches/dcevm/0001-Apply-basic-dcevm11-patch.patch
Normal file
File diff suppressed because it is too large
Load Diff
1569
jb/project/tools/patches/dcevm/0002-dcevm11-fixes.patch
Normal file
1569
jb/project/tools/patches/dcevm/0002-dcevm11-fixes.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
From 960dafbeeba190911955c208b611fecc15d66738 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Wed, 11 Mar 2020 14:19:34 +0100
|
||||
Subject: [PATCH 03/34] Fix class cast exception on redefinition of class A,
|
||||
that is superclass of B that has anonymous class C
|
||||
|
||||
---
|
||||
src/hotspot/share/oops/instanceKlass.cpp | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index 994fc8a3bc8..3be3a09ef8f 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -953,7 +953,10 @@ bool InstanceKlass::link_class_impl(TRAPS) {
|
||||
|
||||
if (!is_linked()) {
|
||||
if (!is_rewritten()) {
|
||||
- {
|
||||
+ // (DCEVM): If class A is being redefined and class B->A (B is extended from A) and B is host class of anonymous class C
|
||||
+ // then second redefinition fails with cannot cast klass exception. So we currently turn off bytecode verification
|
||||
+ // on redefinition.
|
||||
+ if (!AllowEnhancedClassRedefinition || !newest_version()->is_redefining()) {
|
||||
bool verify_ok = verify_code(THREAD);
|
||||
if (!verify_ok) {
|
||||
return false;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
1086
jb/project/tools/patches/dcevm/0004-HotswapAgent-integration.patch
Normal file
1086
jb/project/tools/patches/dcevm/0004-HotswapAgent-integration.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,240 @@
|
||||
From 39df5f163d4a0f1fd6b92313a5570808f19d5e20 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 4 Oct 2020 21:12:12 +0200
|
||||
Subject: [PATCH 05/34] Support for Lambda class redefinition
|
||||
|
||||
---
|
||||
.../share/classfile/classLoaderData.cpp | 9 +++
|
||||
.../share/classfile/classLoaderData.hpp | 2 +-
|
||||
.../share/classfile/systemDictionary.cpp | 12 +++-
|
||||
.../share/classfile/systemDictionary.hpp | 1 +
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 65 +++++++++++++++++--
|
||||
.../prims/jvmtiEnhancedRedefineClasses.hpp | 1 +
|
||||
.../share/prims/resolvedMethodTable.cpp | 2 +
|
||||
src/hotspot/share/prims/unsafe.cpp | 1 +
|
||||
8 files changed, 83 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index 0cd90bb8c27..4d64c6b454a 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -593,6 +593,15 @@ Dictionary* ClassLoaderData::create_dictionary() {
|
||||
return new Dictionary(this, size, resizable);
|
||||
}
|
||||
|
||||
+void ClassLoaderData::exchange_holders(ClassLoaderData* cld) {
|
||||
+ oop holder_oop = _holder.peek();
|
||||
+ _holder.replace(cld->_holder.peek());
|
||||
+ cld->_holder.replace(holder_oop);
|
||||
+ WeakHandle<vm_class_loader_data> exchange = _holder;
|
||||
+ _holder = cld->_holder;
|
||||
+ cld->_holder = exchange;
|
||||
+}
|
||||
+
|
||||
// Tell the GC to keep this klass alive while iterating ClassLoaderDataGraph
|
||||
oop ClassLoaderData::holder_phantom() const {
|
||||
// A klass that was previously considered dead can be looked up in the
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.hpp b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
index ba2393f8dd0..e2ae0a77351 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
|
||||
@@ -181,7 +181,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
|
||||
bool has_accumulated_modified_oops() { return _accumulated_modified_oops; }
|
||||
oop holder_no_keepalive() const;
|
||||
oop holder_phantom() const;
|
||||
-
|
||||
+ void exchange_holders(ClassLoaderData* cld);
|
||||
private:
|
||||
void unload();
|
||||
bool keep_alive() const { return _keep_alive > 0; }
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index bd0cae7cb9b..8f2b46add4d 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -1062,10 +1062,14 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
Handle class_loader,
|
||||
ClassFileStream* st,
|
||||
const ClassLoadInfo& cl_info,
|
||||
+ InstanceKlass* old_klass,
|
||||
TRAPS) {
|
||||
|
||||
EventClassLoad class_load_start_event;
|
||||
ClassLoaderData* loader_data;
|
||||
+
|
||||
+ bool is_redefining = (old_klass != NULL);
|
||||
+
|
||||
bool is_unsafe_anon_class = cl_info.unsafe_anonymous_host() != NULL;
|
||||
|
||||
// - for unsafe anonymous class: create a new CLD whith a class holder that uses
|
||||
@@ -1094,8 +1098,12 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
class_name,
|
||||
loader_data,
|
||||
cl_info,
|
||||
- false, // pick_newest
|
||||
+ is_redefining, // pick_newest
|
||||
CHECK_NULL);
|
||||
+ if (is_redefining && k != NULL) {
|
||||
+ k->set_redefining(true);
|
||||
+ k->set_old_version(old_klass);
|
||||
+ }
|
||||
|
||||
if ((cl_info.is_hidden() || is_unsafe_anon_class) && k != NULL) {
|
||||
// Hidden classes that are not strong and unsafe anonymous classes must update
|
||||
@@ -1998,7 +2006,7 @@ void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
|
||||
k->remove_from_sibling_list();
|
||||
}
|
||||
|
||||
-// (DCEVM)
|
||||
+// (DCEVM)
|
||||
void SystemDictionary::update_constraints_after_redefinition() {
|
||||
constraints()->update_after_redefinition();
|
||||
}
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
index 4547449dbec..931e655d631 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
@@ -329,6 +329,7 @@ public:
|
||||
Handle class_loader,
|
||||
ClassFileStream* st,
|
||||
const ClassLoadInfo& cl_info,
|
||||
+ InstanceKlass* old_klass,
|
||||
TRAPS);
|
||||
|
||||
// Resolve from stream (called by jni_DefineClass and JVM_DefineClass)
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 92ce6c27b8a..8b765623dcd 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -494,6 +494,8 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
|
||||
|
||||
|
||||
+ // SystemDictionary::methods_do(fix_invoke_method);
|
||||
+
|
||||
// JSR-292 support
|
||||
if (_any_class_has_resolved_methods) {
|
||||
bool trace_name_printed = false;
|
||||
@@ -756,12 +758,34 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
|
||||
// load hook event.
|
||||
state->set_class_being_redefined(the_class, _class_load_kind);
|
||||
|
||||
- InstanceKlass* k = SystemDictionary::resolve_from_stream(the_class_sym,
|
||||
- the_class_loader,
|
||||
- protection_domain,
|
||||
- &st,
|
||||
- the_class,
|
||||
- THREAD);
|
||||
+ InstanceKlass* k;
|
||||
+
|
||||
+ if (InstanceKlass::cast(the_class)->is_anonymous()) {
|
||||
+ const InstanceKlass* host_class = the_class->host_klass();
|
||||
+
|
||||
+ // Make sure it's the real host class, not another anonymous class.
|
||||
+ while (host_class != NULL && host_class->is_anonymous()) {
|
||||
+ host_class = host_class->host_klass();
|
||||
+ }
|
||||
+
|
||||
+ k = SystemDictionary::parse_stream(the_class_sym,
|
||||
+ the_class_loader,
|
||||
+ protection_domain,
|
||||
+ &st,
|
||||
+ host_class,
|
||||
+ the_class,
|
||||
+ NULL,
|
||||
+ THREAD);
|
||||
+ k->class_loader_data()->exchange_holders(the_class->class_loader_data());
|
||||
+ the_class->class_loader_data()->inc_keep_alive();
|
||||
+ } else {
|
||||
+ k = SystemDictionary::resolve_from_stream(the_class_sym,
|
||||
+ the_class_loader,
|
||||
+ protection_domain,
|
||||
+ &st,
|
||||
+ the_class,
|
||||
+ THREAD);
|
||||
+ }
|
||||
// Clear class_being_redefined just to be sure.
|
||||
state->clear_class_being_redefined();
|
||||
|
||||
@@ -1442,6 +1466,30 @@ void VM_EnhancedRedefineClasses::MethodDataCleaner::do_klass(Klass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
+void VM_EnhancedRedefineClasses::fix_invoke_method(Method* method) {
|
||||
+
|
||||
+ constantPoolHandle other_cp = constantPoolHandle(method->constants());
|
||||
+
|
||||
+ for (int i = 0; i < other_cp->length(); i++) {
|
||||
+ if (other_cp->tag_at(i).is_klass()) {
|
||||
+ Klass* klass = other_cp->resolved_klass_at(i);
|
||||
+ if (klass->new_version() != NULL) {
|
||||
+ // Constant pool entry points to redefined class -- update to the new version
|
||||
+ other_cp->klass_at_put(i, klass->newest_version());
|
||||
+ }
|
||||
+ assert(other_cp->resolved_klass_at(i)->new_version() == NULL, "Must be new klass!");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ConstantPoolCache* cp_cache = other_cp->cache();
|
||||
+ if (cp_cache != NULL) {
|
||||
+ cp_cache->clear_entries();
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
void VM_EnhancedRedefineClasses::update_jmethod_ids() {
|
||||
for (int j = 0; j < _matching_methods_length; ++j) {
|
||||
Method* old_method = _matching_old_methods[j];
|
||||
@@ -1979,7 +2027,10 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
|
||||
// Find classes not directly redefined, but affected by a redefinition (because one of its supertypes is redefined)
|
||||
AffectedKlassClosure closure(_affected_klasses);
|
||||
// Updated in j10, from original SystemDictionary::classes_do
|
||||
- ClassLoaderDataGraph::dictionary_classes_do(&closure);
|
||||
+
|
||||
+ ClassLoaderDataGraph::classes_do(&closure);
|
||||
+ //ClassLoaderDataGraph::dictionary_classes_do(&closure);
|
||||
+
|
||||
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
|
||||
|
||||
// Sort the affected klasses such that a supertype is always on a smaller array index than its subtype.
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 60b62c3170a..d8a11b51fe9 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -116,6 +116,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
void rollback();
|
||||
static void mark_as_scavengable(nmethod* nm);
|
||||
static void unpatch_bytecode(Method* method);
|
||||
+ static void fix_invoke_method(Method* method);
|
||||
|
||||
// Figure out which new methods match old methods in name and signature,
|
||||
// which methods have been added, and which are no longer present
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index 122bb8c186b..81b3aa96564 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -414,6 +414,8 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
|
||||
Method* newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
|
||||
+ log_info(redefine, class, load, exceptions)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
|
||||
+
|
||||
assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
|
||||
assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
assert(old_method != newer_method, "sanity check");
|
||||
diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp
|
||||
index 72d81ec9d6c..027afa3fabd 100644
|
||||
--- a/src/hotspot/share/prims/unsafe.cpp
|
||||
+++ b/src/hotspot/share/prims/unsafe.cpp
|
||||
@@ -865,6 +865,7 @@ Unsafe_DefineAnonymousClass_impl(JNIEnv *env,
|
||||
host_loader,
|
||||
&st,
|
||||
cl_info,
|
||||
+ NULL,
|
||||
CHECK_NULL);
|
||||
if (anonk == NULL) {
|
||||
return NULL;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
From 5af1daedc86b5fec0f222cbdda3afbdf518985ea Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sat, 23 May 2020 10:02:15 +0200
|
||||
Subject: [PATCH 06/34] Fix "no original bytecode found" error if method with
|
||||
bkp is missing
|
||||
|
||||
Sometimes IDE can deploy class with erroneous method, such method has
|
||||
n bytecode, but breakpoint position can still exist.
|
||||
---
|
||||
src/hotspot/share/interpreter/bytecodes.cpp | 2 +-
|
||||
.../share/interpreter/interpreterRuntime.cpp | 2 +-
|
||||
src/hotspot/share/oops/method.cpp | 8 ++++----
|
||||
src/hotspot/share/oops/method.hpp | 4 ++--
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 18 ++++++++++--------
|
||||
5 files changed, 18 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/interpreter/bytecodes.cpp b/src/hotspot/share/interpreter/bytecodes.cpp
|
||||
index e377e36b88c..262ecc021b2 100644
|
||||
--- a/src/hotspot/share/interpreter/bytecodes.cpp
|
||||
+++ b/src/hotspot/share/interpreter/bytecodes.cpp
|
||||
@@ -84,7 +84,7 @@ Bytecodes::Code Bytecodes::code_at(Method* method, int bci) {
|
||||
Bytecodes::Code Bytecodes::non_breakpoint_code_at(const Method* method, address bcp) {
|
||||
assert(method != NULL, "must have the method for breakpoint conversion");
|
||||
assert(method->contains(bcp), "must be valid bcp in method");
|
||||
- return method->orig_bytecode_at(method->bci_from(bcp));
|
||||
+ return method->orig_bytecode_at(method->bci_from(bcp), false);
|
||||
}
|
||||
|
||||
int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) {
|
||||
diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp
|
||||
index ed3cc3eb6a2..504e59caf51 100644
|
||||
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp
|
||||
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp
|
||||
@@ -814,7 +814,7 @@ JRT_END
|
||||
// Invokes
|
||||
|
||||
JRT_ENTRY(Bytecodes::Code, InterpreterRuntime::get_original_bytecode_at(JavaThread* thread, Method* method, address bcp))
|
||||
- return method->orig_bytecode_at(method->bci_from(bcp));
|
||||
+ return method->orig_bytecode_at(method->bci_from(bcp), false);
|
||||
JRT_END
|
||||
|
||||
JRT_ENTRY(void, InterpreterRuntime::set_original_bytecode_at(JavaThread* thread, Method* method, address bcp, Bytecodes::Code new_code))
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index 516f2bb8f2f..1c88511a5fc 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -1853,14 +1853,14 @@ bool CompressedLineNumberReadStream::read_pair() {
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
|
||||
-Bytecodes::Code Method::orig_bytecode_at(int bci) const {
|
||||
+Bytecodes::Code Method::orig_bytecode_at(int bci, bool no_fatal) const {
|
||||
BreakpointInfo* bp = method_holder()->breakpoints();
|
||||
for (; bp != NULL; bp = bp->next()) {
|
||||
if (bp->match(this, bci)) {
|
||||
return bp->orig_bytecode();
|
||||
}
|
||||
}
|
||||
- {
|
||||
+ if (!no_fatal) {
|
||||
ResourceMark rm;
|
||||
fatal("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci);
|
||||
}
|
||||
@@ -2006,7 +2006,7 @@ BreakpointInfo::BreakpointInfo(Method* m, int bci) {
|
||||
_signature_index = m->signature_index();
|
||||
_orig_bytecode = (Bytecodes::Code) *m->bcp_from(_bci);
|
||||
if (_orig_bytecode == Bytecodes::_breakpoint)
|
||||
- _orig_bytecode = m->orig_bytecode_at(_bci);
|
||||
+ _orig_bytecode = m->orig_bytecode_at(_bci, false);
|
||||
_next = NULL;
|
||||
}
|
||||
|
||||
@@ -2015,7 +2015,7 @@ void BreakpointInfo::set(Method* method) {
|
||||
{
|
||||
Bytecodes::Code code = (Bytecodes::Code) *method->bcp_from(_bci);
|
||||
if (code == Bytecodes::_breakpoint)
|
||||
- code = method->orig_bytecode_at(_bci);
|
||||
+ code = method->orig_bytecode_at(_bci, false);
|
||||
assert(orig_bytecode() == code, "original bytecode must be the same");
|
||||
}
|
||||
#endif
|
||||
diff --git a/src/hotspot/share/oops/method.hpp b/src/hotspot/share/oops/method.hpp
|
||||
index 83ed2d9c3c1..4d4cc6dc012 100644
|
||||
--- a/src/hotspot/share/oops/method.hpp
|
||||
+++ b/src/hotspot/share/oops/method.hpp
|
||||
@@ -230,7 +230,7 @@ class Method : public Metadata {
|
||||
|
||||
// JVMTI breakpoints
|
||||
#if !INCLUDE_JVMTI
|
||||
- Bytecodes::Code orig_bytecode_at(int bci) const {
|
||||
+ Bytecodes::Code orig_bytecode_at(int bci, bool no_fatal) const {
|
||||
ShouldNotReachHere();
|
||||
return Bytecodes::_shouldnotreachhere;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class Method : public Metadata {
|
||||
};
|
||||
u2 number_of_breakpoints() const {return 0;}
|
||||
#else // !INCLUDE_JVMTI
|
||||
- Bytecodes::Code orig_bytecode_at(int bci) const;
|
||||
+ Bytecodes::Code orig_bytecode_at(int bci, bool no_fatal) const;
|
||||
void set_orig_bytecode_at(int bci, Bytecodes::Code code);
|
||||
void set_breakpoint(int bci);
|
||||
void clear_breakpoint(int bci);
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 8b765623dcd..a859b8e1162 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -1362,14 +1362,16 @@ void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method) {
|
||||
|
||||
if (code == Bytecodes::_breakpoint) {
|
||||
int bci = method->bci_from(bcp);
|
||||
- code = method->orig_bytecode_at(bci);
|
||||
- java_code = Bytecodes::java_code(code);
|
||||
- if (code != java_code &&
|
||||
- (java_code == Bytecodes::_getfield ||
|
||||
- java_code == Bytecodes::_putfield ||
|
||||
- java_code == Bytecodes::_aload_0)) {
|
||||
- // Let breakpoint table handling unpatch bytecode
|
||||
- method->set_orig_bytecode_at(bci, java_code);
|
||||
+ code = method->orig_bytecode_at(bci, true);
|
||||
+ if (code != Bytecodes::_shouldnotreachhere) {
|
||||
+ java_code = Bytecodes::java_code(code);
|
||||
+ if (code != java_code &&
|
||||
+ (java_code == Bytecodes::_getfield ||
|
||||
+ java_code == Bytecodes::_putfield ||
|
||||
+ java_code == Bytecodes::_aload_0)) {
|
||||
+ // Let breakpoint table handling unpatch bytecode
|
||||
+ method->set_orig_bytecode_at(bci, java_code);
|
||||
+ }
|
||||
}
|
||||
} else {
|
||||
java_code = Bytecodes::java_code(code);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
From 19d2274a5dff6e6b31474252b45e5e7484f0180b Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 24 May 2020 12:07:42 +0200
|
||||
Subject: [PATCH 07/34] Replace deleted method with
|
||||
Universe::throw_no_such_method_error
|
||||
|
||||
---
|
||||
.../share/prims/resolvedMethodTable.cpp | 28 +++++++++----------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index 81b3aa96564..caf03ffe56d 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -404,25 +404,25 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
|
||||
if (old_method->is_old()) {
|
||||
|
||||
+ InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
|
||||
+ Method* newer_method;
|
||||
+
|
||||
// Method* new_method;
|
||||
if (old_method->is_deleted()) {
|
||||
- // FIXME:(DCEVM) - check if exception can be thrown
|
||||
- // new_method = Universe::throw_no_such_method_error();
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
|
||||
- Method* newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
+ newer_method = Universe::throw_no_such_method_error();
|
||||
+ } else {
|
||||
+ newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
|
||||
- log_info(redefine, class, load, exceptions)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
|
||||
+ log_info(redefine, class, load, exceptions)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
|
||||
|
||||
- assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
|
||||
- assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
- assert(old_method != newer_method, "sanity check");
|
||||
+ assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
|
||||
+ assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
+ assert(old_method != newer_method, "sanity check");
|
||||
|
||||
- if (_the_table->lookup(newer_method) != NULL) {
|
||||
- // old method was already adjusted if new method exists in _the_table
|
||||
- continue;
|
||||
+ if (_the_table->lookup(newer_method) != NULL) {
|
||||
+ // old method was already adjusted if new method exists in _the_table
|
||||
+ continue;
|
||||
+ }
|
||||
}
|
||||
|
||||
java_lang_invoke_ResolvedMethodName::set_vmtarget(mem_name, newer_method);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
1310
jb/project/tools/patches/dcevm/0008-Support-for-G1-gc.patch
Normal file
1310
jb/project/tools/patches/dcevm/0008-Support-for-G1-gc.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,50 @@
|
||||
From ca47ab5a0a6ce8e2644736f323a335a957311af9 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sat, 13 Jun 2020 18:50:59 +0200
|
||||
Subject: [PATCH 09/34] Change log level in advanced redefinition
|
||||
|
||||
- Change log level for "Comparing different class ver.." to debug
|
||||
- Fix adjust_method_entries_dcevm logging levels and severity
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
|
||||
src/hotspot/share/prims/resolvedMethodTable.cpp | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 6c9eb40ecf5..b09ba554e07 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -916,7 +916,7 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
|
||||
// Calculated the difference between new and old class (field change, method change, supertype change, ...).
|
||||
int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_class) {
|
||||
int result = Klass::NoRedefinition;
|
||||
- log_info(redefine, class, load)("Comparing different class versions of class %s",new_class->name()->as_C_string());
|
||||
+ log_debug(redefine, class, load)("Comparing different class versions of class %s",new_class->name()->as_C_string());
|
||||
|
||||
assert(new_class->old_version() != NULL, "must have old version");
|
||||
InstanceKlass* the_class = InstanceKlass::cast(new_class->old_version());
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index caf03ffe56d..eb9fcda44f3 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -413,7 +413,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
} else {
|
||||
newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
|
||||
- log_info(redefine, class, load, exceptions)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
|
||||
+ log_debug(redefine, class, update)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
|
||||
|
||||
assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
|
||||
assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
@@ -433,7 +433,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
|
||||
|
||||
ResourceMark rm;
|
||||
if (!(*trace_name_printed)) {
|
||||
- log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
|
||||
+ log_debug(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
|
||||
*trace_name_printed = true;
|
||||
}
|
||||
log_debug(redefine, class, update, constantpool)
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 7e236beee0375656d1955fc1168143c1639fb7f1 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Tue, 6 Oct 2020 22:15:31 +0200
|
||||
Subject: [PATCH 10/34] AllowEnhancedClassRedefinition is false (disabled) by
|
||||
default
|
||||
|
||||
---
|
||||
src/hotspot/share/runtime/globals.hpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
|
||||
index 5b367704800..2710c6ea0e5 100644
|
||||
--- a/src/hotspot/share/runtime/globals.hpp
|
||||
+++ b/src/hotspot/share/runtime/globals.hpp
|
||||
@@ -2466,7 +2466,7 @@ const size_t minimumSymbolTableSize = 1024;
|
||||
diagnostic(bool, DeoptimizeNMethodBarriersALot, false, \
|
||||
"Make nmethod barriers deoptimise a lot.") \
|
||||
\
|
||||
- product(bool, AllowEnhancedClassRedefinition, true, \
|
||||
+ product(bool, AllowEnhancedClassRedefinition, false, \
|
||||
"Allow enhanced class redefinition beyond swapping method " \
|
||||
"bodies") \
|
||||
\
|
||||
--
|
||||
2.23.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
||||
From d56e73885111b386771f564ec6beb305338993df Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Mon, 19 Oct 2020 20:00:04 +0200
|
||||
Subject: [PATCH 12/34] Set HOTSPOT_VM_DISTRO=Dynamic Code Evolution
|
||||
|
||||
---
|
||||
make/autoconf/version-numbers | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers
|
||||
index aabdc5bed20..df8025a2e84 100644
|
||||
--- a/make/autoconf/version-numbers
|
||||
+++ b/make/autoconf/version-numbers
|
||||
@@ -45,7 +45,7 @@ PRODUCT_NAME=OpenJDK
|
||||
PRODUCT_SUFFIX="Runtime Environment"
|
||||
JDK_RC_PLATFORM_NAME=Platform
|
||||
COMPANY_NAME=N/A
|
||||
-HOTSPOT_VM_DISTRO="OpenJDK"
|
||||
+HOTSPOT_VM_DISTRO="Dynamic Code Evolution"
|
||||
VENDOR_URL=https://openjdk.java.net/
|
||||
VENDOR_URL_BUG=https://bugreport.java.com/bugreport/
|
||||
VENDOR_URL_VM_BUG=https://bugreport.java.com/bugreport/crash.jsp
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
From 7ebad43ed45805b0a3736c510f708ff17697ba7e Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 11 Oct 2020 10:43:28 +0200
|
||||
Subject: [PATCH 13/34] Fix G1 nmethod registration
|
||||
|
||||
---
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 19 ++++++++++++++++---
|
||||
.../prims/jvmtiEnhancedRedefineClasses.hpp | 3 ++-
|
||||
2 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index b09ba554e07..718426f2819 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -216,7 +216,14 @@ void VM_EnhancedRedefineClasses::mark_as_scavengable(nmethod* nm) {
|
||||
}
|
||||
}
|
||||
|
||||
-void VM_EnhancedRedefineClasses::mark_as_scavengable_g1(nmethod* nm) {
|
||||
+void VM_EnhancedRedefineClasses::unregister_nmethod_g1(nmethod* nm) {
|
||||
+ // It should work not only for G1 but also for another GCs, but this way is safer now
|
||||
+ if (!nm->is_zombie() && !nm->is_unloaded()) {
|
||||
+ Universe::heap()->unregister_nmethod(nm);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void VM_EnhancedRedefineClasses::register_nmethod_g1(nmethod* nm) {
|
||||
// It should work not only for G1 but also for another GCs, but this way is safer now
|
||||
if (!nm->is_zombie() && !nm->is_unloaded()) {
|
||||
Universe::heap()->register_nmethod(nm);
|
||||
@@ -521,8 +528,9 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
// For now, mark all nmethod's as scavengable that are not scavengable already
|
||||
if (ScavengeRootsInCode) {
|
||||
if (UseG1GC) {
|
||||
- // this should work also for other GCs
|
||||
- CodeCache::nmethods_do(mark_as_scavengable_g1);
|
||||
+ // G1 holds references to nmethods in regions based on oops values. Since oops in nmethod can be changed in ChangePointers* closures
|
||||
+ // we unregister nmethods from G1 heap, then closures are processed (oops are changed) and finally we register nmethod to G1 again
|
||||
+ CodeCache::nmethods_do(unregister_nmethod_g1);
|
||||
} else {
|
||||
CodeCache::nmethods_do(mark_as_scavengable);
|
||||
}
|
||||
@@ -545,6 +553,11 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
|
||||
Universe::root_oops_do(&oopClosureNoBarrier);
|
||||
|
||||
+ if (UseG1GC) {
|
||||
+ // this should work also for other GCs
|
||||
+ CodeCache::nmethods_do(register_nmethod_g1);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
log_trace(redefine, class, obsolete, metadata)("After updating instances");
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 9755944d70b..4c0412d343d 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -116,7 +116,8 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
|
||||
void rollback();
|
||||
static void mark_as_scavengable(nmethod* nm);
|
||||
- static void mark_as_scavengable_g1(nmethod* nm);
|
||||
+ static void unregister_nmethod_g1(nmethod* nm);
|
||||
+ static void register_nmethod_g1(nmethod* nm);
|
||||
static void unpatch_bytecode(Method* method);
|
||||
static void fix_invoke_method(Method* method);
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 5c7e5f245f79d7e8575461dab0c356ed74c8e9a3 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Thu, 22 Oct 2020 20:15:20 +0200
|
||||
Subject: [PATCH 14/34] Initialize method's _new_version/_old_version to NULL
|
||||
|
||||
---
|
||||
src/hotspot/share/oops/method.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index 1c88511a5fc..ce940cf10a9 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -91,7 +91,8 @@ Method* Method::allocate(ClassLoaderData* loader_data,
|
||||
return new (loader_data, size, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags);
|
||||
}
|
||||
|
||||
-Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
|
||||
+Method::Method(ConstMethod* xconst, AccessFlags access_flags) : _new_version(NULL),
|
||||
+ _old_version(NULL) {
|
||||
NoSafepointVerifier no_safepoint;
|
||||
set_constMethod(xconst);
|
||||
set_access_flags(access_flags);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
From 6ffac6e5064ec6633fdbeb8520333dca00bc6a62 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Fri, 23 Oct 2020 10:20:26 +0200
|
||||
Subject: [PATCH 15/34] Clear dcevm code separation
|
||||
|
||||
---
|
||||
src/hotspot/share/classfile/systemDictionary.cpp | 4 ++--
|
||||
src/hotspot/share/gc/serial/genMarkSweep.cpp | 8 +++++---
|
||||
src/hotspot/share/interpreter/linkResolver.cpp | 16 +++++++++++-----
|
||||
.../instrumentation/jfrEventClassTransformer.cpp | 2 +-
|
||||
src/hotspot/share/oops/instanceKlass.cpp | 10 ++++++----
|
||||
src/hotspot/share/oops/method.cpp | 2 +-
|
||||
.../share/prims/jvmtiGetLoadedClasses.cpp | 2 +-
|
||||
src/hotspot/share/runtime/reflection.cpp | 2 +-
|
||||
8 files changed, 28 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
index 8f2b46add4d..9ac6ec96cb5 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
|
||||
@@ -1241,7 +1241,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
MutexLocker mu(THREAD, SystemDictionary_lock);
|
||||
|
||||
Klass* check = find_class(h_name, k->class_loader_data());
|
||||
- assert((check == k && !k->is_redefining()) || (k->is_redefining() && check == k->old_version()), "should be present in the dictionary");
|
||||
+ assert(check == k && !k->is_redefining() || k->is_redefining() && check == k->old_version(), "should be present in the dictionary");
|
||||
} );
|
||||
|
||||
return k;
|
||||
@@ -2290,7 +2290,7 @@ void SystemDictionary::check_constraints(unsigned int d_hash,
|
||||
// also hold array classes.
|
||||
|
||||
assert(check->is_instance_klass(), "noninstance in systemdictionary");
|
||||
- if ((defining == true) || ((k != check) && k->old_version() != check)) {
|
||||
+ if ((defining == true) || (k != check && (!AllowEnhancedClassRedefinition || k->old_version() != check))) {
|
||||
throwException = true;
|
||||
ss.print("loader %s", loader_data->loader_name_and_id());
|
||||
ss.print(" attempted duplicate %s definition for %s. (%s)",
|
||||
diff --git a/src/hotspot/share/gc/serial/genMarkSweep.cpp b/src/hotspot/share/gc/serial/genMarkSweep.cpp
|
||||
index 1d13c647452..548df01e557 100644
|
||||
--- a/src/hotspot/share/gc/serial/genMarkSweep.cpp
|
||||
+++ b/src/hotspot/share/gc/serial/genMarkSweep.cpp
|
||||
@@ -334,7 +334,9 @@ void GenMarkSweep::mark_sweep_phase4() {
|
||||
|
||||
GenCompactClosure blk;
|
||||
gch->generation_iterate(&blk, true);
|
||||
- DcevmSharedGC::copy_rescued_objects_back(MarkSweep::_rescued_oops, true);
|
||||
- DcevmSharedGC::clear_rescued_objects_resource(MarkSweep::_rescued_oops);
|
||||
- MarkSweep::_rescued_oops = NULL;
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ DcevmSharedGC::copy_rescued_objects_back(MarkSweep::_rescued_oops, true);
|
||||
+ DcevmSharedGC::clear_rescued_objects_resource(MarkSweep::_rescued_oops);
|
||||
+ MarkSweep::_rescued_oops = NULL;
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
|
||||
index b6e9e0a308d..b2f24ddbeda 100644
|
||||
--- a/src/hotspot/share/interpreter/linkResolver.cpp
|
||||
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
|
||||
@@ -282,9 +282,14 @@ void LinkResolver::check_klass_accessibility(Klass* ref_klass, Klass* sel_klass,
|
||||
if (!base_klass->is_instance_klass()) {
|
||||
return; // no relevant check to do
|
||||
}
|
||||
-
|
||||
- Reflection::VerifyClassAccessResults vca_result =
|
||||
- Reflection::verify_class_access(ref_klass->newest_version(), InstanceKlass::cast(base_klass->newest_version()), true);
|
||||
+ Klass* refKlassNewest = ref_klass;
|
||||
+ Klass* baseKlassNewest = base_klass;
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ refKlassNewest = ref_klass->newest_version();
|
||||
+ baseKlassNewest = base_klass->newest_version();
|
||||
+ }
|
||||
+ Reflection::VerifyClassAccessResults vca_result =
|
||||
+ Reflection::verify_class_access(refKlassNewest, InstanceKlass::cast(baseKlassNewest), true);
|
||||
if (vca_result != Reflection::ACCESS_OK) {
|
||||
ResourceMark rm(THREAD);
|
||||
char* msg = Reflection::verify_class_access_msg(ref_klass,
|
||||
@@ -566,7 +571,8 @@ void LinkResolver::check_method_accessability(Klass* ref_klass,
|
||||
// We'll check for the method name first, as that's most likely
|
||||
// to be false (so we'll short-circuit out of these tests).
|
||||
if (sel_method->name() == vmSymbols::clone_name() &&
|
||||
- sel_klass->newest_version() == SystemDictionary::Object_klass()->newest_version() &&
|
||||
+ ( !AllowEnhancedClassRedefinition && sel_klass == SystemDictionary::Object_klass() ||
|
||||
+ AllowEnhancedClassRedefinition && sel_klass->newest_version() == SystemDictionary::Object_klass()->newest_version()) &&
|
||||
resolved_klass->is_array_klass()) {
|
||||
// We need to change "protected" to "public".
|
||||
assert(flags.is_protected(), "clone not protected?");
|
||||
@@ -1011,7 +1017,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
|
||||
// or by the <init> method (in case of an instance field).
|
||||
if (is_put && fd.access_flags().is_final()) {
|
||||
|
||||
- if (sel_klass != current_klass && sel_klass != current_klass->active_version()) {
|
||||
+ if (sel_klass != current_klass && (!AllowEnhancedClassRedefinition || sel_klass != current_klass->active_version())) {
|
||||
ResourceMark rm(THREAD);
|
||||
stringStream ss;
|
||||
ss.print("Update to %s final field %s.%s attempted from a different class (%s) than the field's declaring class",
|
||||
diff --git a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
index 96fc139bea3..f7284197c5a 100644
|
||||
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
|
||||
@@ -1471,7 +1471,7 @@ static InstanceKlass* create_new_instance_klass(InstanceKlass* ik, ClassFileStre
|
||||
cld,
|
||||
&cl_info,
|
||||
ClassFileParser::INTERNAL, // internal visibility
|
||||
- false,
|
||||
+ false,
|
||||
THREAD);
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
log_pending_exception(PENDING_EXCEPTION);
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index 3be3a09ef8f..f8e60941046 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -199,7 +199,9 @@ bool InstanceKlass::has_nest_member(InstanceKlass* k, TRAPS) const {
|
||||
// able to perform that loading but we can't exclude the compiler threads from
|
||||
// executing this logic. But it should actually be impossible to trigger loading here.
|
||||
Klass* k2 = _constants->klass_at(cp_index, THREAD);
|
||||
- k2 = k2->newest_version();
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ k2 = k2->newest_version();
|
||||
+ }
|
||||
assert(!HAS_PENDING_EXCEPTION || PENDING_EXCEPTION->is_a(SystemDictionary::VirtualMachineError_klass()),
|
||||
"Exceptions should not be possible here");
|
||||
if (k2 == k) {
|
||||
@@ -1003,7 +1005,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
|
||||
#endif
|
||||
set_init_state(linked);
|
||||
// (DCEVM) Must check for old version in order to prevent infinite loops.
|
||||
- if (JvmtiExport::should_post_class_prepare() && old_version() == NULL /* JVMTI deadlock otherwise */) {
|
||||
+ if (JvmtiExport::should_post_class_prepare() && (!AllowEnhancedClassRedefinition || old_version() == NULL) /* JVMTI deadlock otherwise */) {
|
||||
Thread *thread = THREAD;
|
||||
assert(thread->is_Java_thread(), "thread->is_Java_thread()");
|
||||
JvmtiExport::post_class_prepare((JavaThread *) thread, this);
|
||||
@@ -1084,7 +1086,7 @@ void InstanceKlass::initialize_impl(TRAPS) {
|
||||
// we might end up throwing IE from link/symbol resolution sites
|
||||
// that aren't expected to throw. This would wreak havoc. See 6320309.
|
||||
while ((is_being_initialized() && !is_reentrant_initialization(jt))
|
||||
- || (old_version() != NULL && InstanceKlass::cast(old_version())->is_being_initialized())) {
|
||||
+ || (AllowEnhancedClassRedefinition && old_version() != NULL && InstanceKlass::cast(old_version())->is_being_initialized())) {
|
||||
wait = true;
|
||||
jt->set_class_to_be_initialized(this);
|
||||
ol.wait_uninterruptibly(jt);
|
||||
@@ -3782,7 +3784,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||
|
||||
guarantee(sib->is_klass(), "should be klass");
|
||||
// TODO: (DCEVM) explain
|
||||
- guarantee(sib->super() == super || super->newest_version() == SystemDictionary::Object_klass(), "siblings should have same superklass");
|
||||
+ guarantee(sib->super() == super || AllowEnhancedClassRedefinition && super->newest_version() == SystemDictionary::Object_klass(), "siblings should have same superklass");
|
||||
}
|
||||
|
||||
// Verify local interfaces
|
||||
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
|
||||
index ce940cf10a9..2d8e5b0256b 100644
|
||||
--- a/src/hotspot/share/oops/method.cpp
|
||||
+++ b/src/hotspot/share/oops/method.cpp
|
||||
@@ -2208,7 +2208,7 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
||||
// Add a method id to the jmethod_ids
|
||||
jmethodID Method::make_jmethod_id(ClassLoaderData* loader_data, Method* m) {
|
||||
// FIXME: (DCEVM) ???
|
||||
- if (m != m->newest_version()) {
|
||||
+ if (AllowEnhancedClassRedefinition && m != m->newest_version()) {
|
||||
m = m->newest_version();
|
||||
}
|
||||
ClassLoaderData* cld = loader_data;
|
||||
diff --git a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
index 1c7677f270f..6c12ee64a6e 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
// the new version (SystemDictionary stores only new versions). But the LoadedClassesClosure's functionality was
|
||||
// changed in java8 where jvmtiLoadedClasses collects all classes from all classloaders, therefore we
|
||||
// must use new versions only.
|
||||
- if (k->new_version()==NULL) {
|
||||
+ if (AllowEnhancedClassRedefinition && k->new_version()==NULL) {
|
||||
_classStack.push((jclass) _env->jni_reference(Handle(_cur_thread, k->java_mirror())));
|
||||
if (_dictionary_walk) {
|
||||
// Collect array classes this way when walking the dictionary (because array classes are
|
||||
diff --git a/src/hotspot/share/runtime/reflection.cpp b/src/hotspot/share/runtime/reflection.cpp
|
||||
index 0e7722dba7d..d67457f02ac 100644
|
||||
--- a/src/hotspot/share/runtime/reflection.cpp
|
||||
+++ b/src/hotspot/share/runtime/reflection.cpp
|
||||
@@ -628,7 +628,7 @@ bool Reflection::verify_member_access(const Klass* current_class,
|
||||
TRAPS) {
|
||||
|
||||
// (DCEVM) Decide accessibility based on active version
|
||||
- if (current_class != NULL) {
|
||||
+ if (AllowEnhancedClassRedefinition && current_class != NULL) {
|
||||
current_class = current_class->active_version();
|
||||
}
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From dc675de6ac42819b8536827ea450fcad13a97448 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Wed, 11 Nov 2020 18:45:15 +0100
|
||||
Subject: [PATCH 16/34] Fix LoadedClassesClosure - fixes problems with remote
|
||||
debugging
|
||||
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
index 6c12ee64a6e..2a469555dbd 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
// the new version (SystemDictionary stores only new versions). But the LoadedClassesClosure's functionality was
|
||||
// changed in java8 where jvmtiLoadedClasses collects all classes from all classloaders, therefore we
|
||||
// must use new versions only.
|
||||
- if (AllowEnhancedClassRedefinition && k->new_version()==NULL) {
|
||||
+ if (!AllowEnhancedClassRedefinition || k->new_version()==NULL) {
|
||||
_classStack.push((jclass) _env->jni_reference(Handle(_cur_thread, k->java_mirror())));
|
||||
if (_dictionary_walk) {
|
||||
// Collect array classes this way when walking the dictionary (because array classes are
|
||||
--
|
||||
2.23.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,183 @@
|
||||
From 1d682efa88c716e1849163d5abff3a3367581d16 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Mon, 16 Nov 2020 21:11:19 +0100
|
||||
Subject: [PATCH 18/34] pre dcevm15 - fix GC spaces originally in removed CMS
|
||||
patch
|
||||
|
||||
---
|
||||
src/hotspot/share/gc/shared/space.cpp | 16 ++++++++--------
|
||||
src/hotspot/share/gc/shared/space.hpp | 6 +++---
|
||||
src/hotspot/share/gc/shared/space.inline.hpp | 14 ++++++++------
|
||||
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 6 ++----
|
||||
4 files changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp
|
||||
index 875a6dc854f..9772c32c42e 100644
|
||||
--- a/src/hotspot/share/gc/shared/space.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/space.cpp
|
||||
@@ -375,11 +375,11 @@ HeapWord* CompactibleSpace::forward_compact_top(size_t size, CompactPoint* cp, H
|
||||
}
|
||||
|
||||
HeapWord* CompactibleSpace::forward(oop q, size_t size,
|
||||
- CompactPoint* cp, HeapWord* compact_top) {
|
||||
+ CompactPoint* cp, HeapWord* compact_top, bool force_forward) {
|
||||
compact_top = forward_compact_top(size, cp, compact_top);
|
||||
|
||||
// store the forwarding pointer into the mark word
|
||||
- if (cast_from_oop<HeapWord*>(q) != compact_top || (size_t)q->size() != size) {
|
||||
+ if (force_forward || cast_from_oop<HeapWord*>(q) != compact_top || (size_t)q->size() != size) {
|
||||
q->forward_to(oop(compact_top));
|
||||
assert(q->is_gc_marked(), "encoding the pointer should preserve the mark");
|
||||
} else {
|
||||
@@ -501,7 +501,7 @@ bool CompactibleSpace::must_rescue(oop old_obj, oop new_obj) {
|
||||
|
||||
} else {
|
||||
assert(space_index(old_obj) != space_index(new_obj), "old_obj and new_obj must be in different spaces");
|
||||
- if (tenured_gen->is_in_reserved(new_obj)) {
|
||||
+ if (new_in_tenured) {
|
||||
// Must never rescue when moving from the new into the old generation.
|
||||
assert(GenCollectedHeap::heap()->young_gen()->is_in_reserved(old_obj), "old_obj must be in DefNewGeneration");
|
||||
assert(space_index(old_obj) > space_index(new_obj), "must be");
|
||||
@@ -824,14 +824,14 @@ void OffsetTableContigSpace::verify() const {
|
||||
// Compute the forward sizes and leave out objects whose position could
|
||||
// possibly overlap other objects.
|
||||
HeapWord* CompactibleSpace::forward_with_rescue(HeapWord* q, size_t size,
|
||||
- CompactPoint* cp, HeapWord* compact_top) {
|
||||
+ CompactPoint* cp, HeapWord* compact_top, bool force_forward) {
|
||||
size_t forward_size = size;
|
||||
|
||||
// (DCEVM) There is a new version of the class of q => different size
|
||||
if (oop(q)->klass()->new_version() != NULL) {
|
||||
|
||||
size_t new_size = oop(q)->size_given_klass(oop(q)->klass()->new_version());
|
||||
- assert(size != new_size, "instances without changed size have to be updated prior to GC run");
|
||||
+ // assert(size != new_size, "instances without changed size have to be updated prior to GC run");
|
||||
forward_size = new_size;
|
||||
}
|
||||
|
||||
@@ -845,7 +845,7 @@ HeapWord* CompactibleSpace::forward_with_rescue(HeapWord* q, size_t size,
|
||||
return compact_top;
|
||||
}
|
||||
|
||||
- return forward(oop(q), forward_size, cp, compact_top);
|
||||
+ return forward(oop(q), forward_size, cp, compact_top, force_forward);
|
||||
}
|
||||
|
||||
// Compute the forwarding addresses for the objects that need to be rescued.
|
||||
@@ -861,11 +861,11 @@ HeapWord* CompactibleSpace::forward_rescued(CompactPoint* cp, HeapWord* compact_
|
||||
// (DCEVM) There is a new version of the class of q => different size
|
||||
if (oop(q)->klass()->new_version() != NULL) {
|
||||
size_t new_size = oop(q)->size_given_klass(oop(q)->klass()->new_version());
|
||||
- assert(size != new_size, "instances without changed size have to be updated prior to GC run");
|
||||
+ // assert(size != new_size, "instances without changed size have to be updated prior to GC run");
|
||||
size = new_size;
|
||||
}
|
||||
|
||||
- compact_top = cp->space->forward(oop(q), size, cp, compact_top);
|
||||
+ compact_top = cp->space->forward(oop(q), size, cp, compact_top, true);
|
||||
assert(compact_top <= end(), "must not write over end of space!");
|
||||
}
|
||||
MarkSweep::_rescued_oops->clear();
|
||||
diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp
|
||||
index c9bfc365f0f..f7648995454 100644
|
||||
--- a/src/hotspot/share/gc/shared/space.hpp
|
||||
+++ b/src/hotspot/share/gc/shared/space.hpp
|
||||
@@ -405,7 +405,7 @@ public:
|
||||
virtual void prepare_for_compaction(CompactPoint* cp) = 0;
|
||||
// MarkSweep support phase3
|
||||
DEBUG_ONLY(int space_index(oop obj));
|
||||
- bool must_rescue(oop old_obj, oop new_obj);
|
||||
+ virtual bool must_rescue(oop old_obj, oop new_obj);
|
||||
HeapWord* rescue(HeapWord* old_obj);
|
||||
virtual void adjust_pointers();
|
||||
// MarkSweep support phase4
|
||||
@@ -436,11 +436,11 @@ public:
|
||||
// function of the then-current compaction space, and updates "cp->threshold
|
||||
// accordingly".
|
||||
virtual HeapWord* forward(oop q, size_t size, CompactPoint* cp,
|
||||
- HeapWord* compact_top);
|
||||
+ HeapWord* compact_top, bool force_forward);
|
||||
// (DCEVM) same as forwad, but can rescue objects. Invoked only during
|
||||
// redefinition runs
|
||||
HeapWord* forward_with_rescue(HeapWord* q, size_t size, CompactPoint* cp,
|
||||
- HeapWord* compact_top);
|
||||
+ HeapWord* compact_top, bool force_forward);
|
||||
|
||||
HeapWord* forward_rescued(CompactPoint* cp, HeapWord* compact_top);
|
||||
|
||||
diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp
|
||||
index 5a93e93471b..fa645423685 100644
|
||||
--- a/src/hotspot/share/gc/shared/space.inline.hpp
|
||||
+++ b/src/hotspot/share/gc/shared/space.inline.hpp
|
||||
@@ -163,6 +163,8 @@ inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* c
|
||||
HeapWord* cur_obj = space->bottom();
|
||||
HeapWord* scan_limit = space->scan_limit();
|
||||
|
||||
+ bool force_forward = false;
|
||||
+
|
||||
while (cur_obj < scan_limit) {
|
||||
assert(!space->scanned_block_is_obj(cur_obj) ||
|
||||
oop(cur_obj)->mark_raw().is_marked() || oop(cur_obj)->mark_raw().is_unlocked() ||
|
||||
@@ -174,14 +176,15 @@ inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* c
|
||||
size_t size = space->scanned_block_size(cur_obj);
|
||||
|
||||
if (redefinition_run) {
|
||||
- compact_top = cp->space->forward_with_rescue(cur_obj, size, cp, compact_top);
|
||||
+ compact_top = cp->space->forward_with_rescue(cur_obj, size, cp, compact_top, force_forward);
|
||||
if (first_dead == NULL && oop(cur_obj)->is_gc_marked()) {
|
||||
/* Was moved (otherwise, forward would reset mark),
|
||||
set first_dead to here */
|
||||
first_dead = cur_obj;
|
||||
+ force_forward = true;
|
||||
}
|
||||
} else {
|
||||
- compact_top = cp->space->forward(oop(cur_obj), size, cp, compact_top);
|
||||
+ compact_top = cp->space->forward(oop(cur_obj), size, cp, compact_top, false);
|
||||
}
|
||||
|
||||
cur_obj += size;
|
||||
@@ -197,9 +200,9 @@ inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* c
|
||||
|
||||
// see if we might want to pretend this object is alive so that
|
||||
// we don't have to compact quite as often.
|
||||
- if (cur_obj == compact_top && dead_spacer.insert_deadspace(cur_obj, end)) {
|
||||
+ if (!redefinition_run && cur_obj == compact_top && dead_spacer.insert_deadspace(cur_obj, end)) {
|
||||
oop obj = oop(cur_obj);
|
||||
- compact_top = cp->space->forward(obj, obj->size(), cp, compact_top);
|
||||
+ compact_top = cp->space->forward(obj, obj->size(), cp, compact_top, force_forward);
|
||||
end_of_live = end;
|
||||
} else {
|
||||
// otherwise, it really is a free region.
|
||||
@@ -362,8 +365,7 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space, bool redefiniti
|
||||
Prefetch::write(compaction_top, copy_interval);
|
||||
|
||||
// copy object and reinit its mark
|
||||
- assert(cur_obj != compaction_top || oop(cur_obj)->klass()->new_version() != NULL,
|
||||
- "everything in this pass should be moving");
|
||||
+ assert(redefinition_run || cur_obj != compaction_top, "everything in this pass should be moving");
|
||||
if (redefinition_run && oop(cur_obj)->klass()->new_version() != NULL) {
|
||||
Klass* new_version = oop(cur_obj)->klass()->new_version();
|
||||
if (new_version->update_information() == NULL) {
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 718426f2819..1da6661dd3e 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -431,13 +431,11 @@ public:
|
||||
Klass* new_klass = obj->klass()->new_version();
|
||||
|
||||
if (new_klass->update_information() != NULL) {
|
||||
- int size_diff = obj->size() - obj->size_given_klass(new_klass);
|
||||
-
|
||||
- // Either new size is bigger or gap is to small to be filled
|
||||
- if (size_diff < 0 || (size_diff > 0 && (size_t) size_diff < CollectedHeap::min_fill_size())) {
|
||||
+ if (obj->size() - obj->size_given_klass(new_klass) != 0) {
|
||||
// We need an instance update => set back to old klass
|
||||
_needs_instance_update = true;
|
||||
} else {
|
||||
+ // Either new size is bigger or gap is to small to be filled
|
||||
oop src = obj;
|
||||
if (new_klass->is_copying_backwards()) {
|
||||
copy_to_tmp(obj);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,942 @@
|
||||
From 297f564f6af79fb824f5b4e9119f1d3d0c827fb0 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Mon, 16 Nov 2020 20:20:12 +0100
|
||||
Subject: [PATCH 19/34] dcevm15 - fix java15 patch compilation issues
|
||||
|
||||
---
|
||||
.../share/classfile/classFileParser.hpp | 8 +-
|
||||
.../share/classfile/classLoaderData.cpp | 2 +-
|
||||
src/hotspot/share/classfile/dictionary.hpp | 10 +-
|
||||
src/hotspot/share/classfile/javaClasses.hpp | 2 +
|
||||
.../share/gc/g1/g1FullGCCompactTask.cpp | 4 +-
|
||||
.../share/gc/g1/g1FullGCCompactionPoint.cpp | 8 +-
|
||||
.../share/gc/g1/g1FullGCPrepareTask.cpp | 4 +-
|
||||
src/hotspot/share/gc/shared/dcevmSharedGC.cpp | 14 +-
|
||||
src/hotspot/share/gc/shared/dcevmSharedGC.hpp | 2 +-
|
||||
src/hotspot/share/gc/shared/gcConfig.cpp | 2 +-
|
||||
src/hotspot/share/gc/shared/space.cpp | 4 +-
|
||||
.../share/interpreter/linkResolver.cpp | 2 +-
|
||||
src/hotspot/share/oops/instanceKlass.cpp | 17 ++-
|
||||
src/hotspot/share/oops/instanceKlass.hpp | 1 +
|
||||
src/hotspot/share/oops/klass.cpp | 8 +-
|
||||
src/hotspot/share/prims/jvm.cpp | 2 +
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 129 +++++++++---------
|
||||
.../prims/jvmtiEnhancedRedefineClasses.hpp | 14 +-
|
||||
src/hotspot/share/prims/jvmtiEnv.cpp | 11 +-
|
||||
.../share/prims/jvmtiRedefineClasses.cpp | 1 +
|
||||
src/hotspot/share/prims/methodHandles.hpp | 3 +
|
||||
src/hotspot/share/runtime/arguments.cpp | 22 +--
|
||||
src/hotspot/share/runtime/mutexLocker.cpp | 2 +-
|
||||
23 files changed, 159 insertions(+), 113 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classFileParser.hpp b/src/hotspot/share/classfile/classFileParser.hpp
|
||||
index e5761e61767..0d266b9047e 100644
|
||||
--- a/src/hotspot/share/classfile/classFileParser.hpp
|
||||
+++ b/src/hotspot/share/classfile/classFileParser.hpp
|
||||
@@ -150,9 +150,6 @@ class ClassFileParser {
|
||||
const intArray* _method_ordering;
|
||||
GrowableArray<Method*>* _all_mirandas;
|
||||
|
||||
- // Enhanced class redefinition
|
||||
- const bool _pick_newest;
|
||||
-
|
||||
enum { fixed_buffer_size = 128 };
|
||||
u_char _linenumbertable_buffer[fixed_buffer_size];
|
||||
|
||||
@@ -206,6 +203,9 @@ class ClassFileParser {
|
||||
bool _has_vanilla_constructor;
|
||||
int _max_bootstrap_specifier_index; // detects BSS values
|
||||
|
||||
+ // (DCEVM) Enhanced class redefinition
|
||||
+ const bool _pick_newest;
|
||||
+
|
||||
void parse_stream(const ClassFileStream* const stream, TRAPS);
|
||||
|
||||
void mangle_hidden_class_name(InstanceKlass* const ik);
|
||||
@@ -582,7 +582,7 @@ class ClassFileParser {
|
||||
ClassLoaderData* loader_data() const { return _loader_data; }
|
||||
const Symbol* class_name() const { return _class_name; }
|
||||
const InstanceKlass* super_klass() const { return _super_klass; }
|
||||
- Array<Klass*>* local_interfaces() const { return _local_interfaces; }
|
||||
+ Array<InstanceKlass*>* local_interfaces() const { return _local_interfaces; }
|
||||
|
||||
ReferenceType reference_type() const { return _rt; }
|
||||
AccessFlags access_flags() const { return _access_flags; }
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
index 4d64c6b454a..aadcd50ef4a 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
|
||||
@@ -597,7 +597,7 @@ void ClassLoaderData::exchange_holders(ClassLoaderData* cld) {
|
||||
oop holder_oop = _holder.peek();
|
||||
_holder.replace(cld->_holder.peek());
|
||||
cld->_holder.replace(holder_oop);
|
||||
- WeakHandle<vm_class_loader_data> exchange = _holder;
|
||||
+ WeakHandle<vm_weak_data> exchange = _holder;
|
||||
_holder = cld->_holder;
|
||||
cld->_holder = exchange;
|
||||
}
|
||||
diff --git a/src/hotspot/share/classfile/dictionary.hpp b/src/hotspot/share/classfile/dictionary.hpp
|
||||
index 114a983e783..a50f4ff84d2 100644
|
||||
--- a/src/hotspot/share/classfile/dictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/dictionary.hpp
|
||||
@@ -84,6 +84,11 @@ public:
|
||||
void print_on(outputStream* st) const;
|
||||
void verify();
|
||||
|
||||
+ // (DCEVM) Enhanced class redefinition
|
||||
+ bool update_klass(unsigned int hash, Symbol* name, ClassLoaderData* loader_data, InstanceKlass* k, InstanceKlass* old_klass);
|
||||
+
|
||||
+ void rollback_redefinition();
|
||||
+
|
||||
private:
|
||||
DictionaryEntry* new_entry(unsigned int hash, InstanceKlass* klass);
|
||||
|
||||
@@ -106,11 +111,6 @@ public:
|
||||
|
||||
void free_entry(DictionaryEntry* entry);
|
||||
|
||||
- // Enhanced class redefinition
|
||||
- bool update_klass(unsigned int hash, Symbol* name, ClassLoaderData* loader_data, InstanceKlass* k, InstanceKlass* old_klass);
|
||||
-
|
||||
- void rollback_redefinition();
|
||||
-
|
||||
// (DCEVM) return old class if redefining in AllowEnhancedClassRedefinition, otherwise return "k"
|
||||
static InstanceKlass* old_if_redefined(InstanceKlass* k) {
|
||||
return (k != NULL && k->is_redefining()) ? ((InstanceKlass* )k->old_version()) : k;
|
||||
diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp
|
||||
index a68c5139151..9abf2e1d105 100644
|
||||
--- a/src/hotspot/share/classfile/javaClasses.hpp
|
||||
+++ b/src/hotspot/share/classfile/javaClasses.hpp
|
||||
@@ -255,7 +255,9 @@ class java_lang_Class : AllStatic {
|
||||
static void set_init_lock(oop java_class, oop init_lock);
|
||||
static void set_protection_domain(oop java_class, oop protection_domain);
|
||||
static void set_class_loader(oop java_class, oop class_loader);
|
||||
+ public: // DCEVM
|
||||
static void set_component_mirror(oop java_class, oop comp_mirror);
|
||||
+ private:
|
||||
static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
|
||||
Handle classData, TRAPS);
|
||||
static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain, TRAPS);
|
||||
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
|
||||
index f70f4606dc8..a22ed48560d 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
|
||||
@@ -157,14 +157,14 @@ void G1FullGCCompactTask::serial_compaction_dcevm() {
|
||||
|
||||
size_t G1FullGCCompactTask::G1CompactRegionClosureDcevm::apply(oop obj) {
|
||||
size_t size = obj->size();
|
||||
- HeapWord* destination = (HeapWord*)obj->forwardee();
|
||||
+ HeapWord* destination = cast_from_oop<HeapWord*>(obj->forwardee());
|
||||
if (destination == NULL) {
|
||||
// Object not moving
|
||||
return size;
|
||||
}
|
||||
|
||||
// copy object and reinit its mark
|
||||
- HeapWord* obj_addr = (HeapWord*) obj;
|
||||
+ HeapWord* obj_addr = cast_from_oop<HeapWord*>(obj);
|
||||
|
||||
if (!_rescue_oops_it->at_end() && **_rescue_oops_it == obj_addr) {
|
||||
++(*_rescue_oops_it);
|
||||
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
|
||||
index 1e49571c999..755935a2c91 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
|
||||
@@ -174,7 +174,7 @@ void G1FullGCCompactionPoint::forward_dcevm(oop object, size_t size, bool force_
|
||||
assert(_current_region != NULL, "Must have been initialized");
|
||||
|
||||
// Store a forwarding pointer if the object should be moved.
|
||||
- if ((HeapWord*)object != _compaction_top || force_forward) {
|
||||
+ if (cast_from_oop<HeapWord*>(object) != _compaction_top || force_forward) {
|
||||
object->forward_to(oop(_compaction_top));
|
||||
} else {
|
||||
if (object->forwardee() != NULL) {
|
||||
@@ -188,11 +188,11 @@ void G1FullGCCompactionPoint::forward_dcevm(oop object, size_t size, bool force_
|
||||
} else {
|
||||
// Make sure object has the correct mark-word set or that it will be
|
||||
// fixed when restoring the preserved marks.
|
||||
- assert(object->mark_raw() == markOopDesc::prototype_for_object(object) || // Correct mark
|
||||
- object->mark_raw()->must_be_preserved(object) || // Will be restored by PreservedMarksSet
|
||||
+ assert(object->mark_raw() == markWord::prototype_for_klass(object->klass()) || // Correct mark
|
||||
+ object->mark_must_be_preserved() || // Will be restored by PreservedMarksSet
|
||||
(UseBiasedLocking && object->has_bias_pattern_raw()), // Will be restored by BiasedLocking
|
||||
"should have correct prototype obj: " PTR_FORMAT " mark: " PTR_FORMAT " prototype: " PTR_FORMAT,
|
||||
- p2i(object), p2i(object->mark_raw()), p2i(markOopDesc::prototype_for_object(object)));
|
||||
+ p2i(object), object->mark_raw().value(), markWord::prototype_for_klass(object->klass()).value());
|
||||
}
|
||||
assert(object->forwardee() == NULL, "should be forwarded to NULL");
|
||||
}
|
||||
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
|
||||
index a45681b60cf..2f06b9617e4 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
|
||||
@@ -269,7 +269,7 @@ size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::apply(oop object)
|
||||
HeapWord* compact_top = _cp->forward_compact_top(forward_size);
|
||||
|
||||
if (compact_top == NULL || must_rescue(object, oop(compact_top))) {
|
||||
- _cp->rescued_oops()->append((HeapWord*)object);
|
||||
+ _cp->rescued_oops()->append(cast_from_oop<HeapWord*>(object));
|
||||
} else {
|
||||
_cp->forward_dcevm(object, forward_size, (size != forward_size));
|
||||
}
|
||||
@@ -295,7 +295,7 @@ bool G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::must_rescue(oop old_
|
||||
int new_size = old_obj->size_given_klass(oop(old_obj)->klass()->new_version());
|
||||
int original_size = old_obj->size();
|
||||
|
||||
- bool overlap = ((HeapWord*)old_obj + original_size < (HeapWord*)new_obj + new_size);
|
||||
+ bool overlap = (cast_from_oop<HeapWord*>(old_obj) + original_size < cast_from_oop<HeapWord*>(new_obj) + new_size);
|
||||
|
||||
return overlap;
|
||||
}
|
||||
diff --git a/src/hotspot/share/gc/shared/dcevmSharedGC.cpp b/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
|
||||
index 803e645f843..3dee097f1d3 100644
|
||||
--- a/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
|
||||
@@ -58,10 +58,10 @@ void DcevmSharedGC::copy_rescued_objects_back(GrowableArray<HeapWord*>* rescued_
|
||||
DcevmSharedGC::update_fields(rescued_obj, new_obj);
|
||||
} else {
|
||||
rescued_obj->set_klass(new_klass);
|
||||
- Copy::aligned_disjoint_words((HeapWord*)rescued_obj, (HeapWord*)new_obj, size);
|
||||
+ Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(rescued_obj), cast_from_oop<HeapWord*>(new_obj), size);
|
||||
}
|
||||
} else {
|
||||
- Copy::aligned_disjoint_words((HeapWord*)rescued_obj, (HeapWord*)new_obj, size);
|
||||
+ Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(rescued_obj), cast_from_oop<HeapWord*>(new_obj), size);
|
||||
}
|
||||
|
||||
new_obj->init_mark_raw();
|
||||
@@ -111,11 +111,11 @@ void DcevmSharedGC::update_fields(oop q, oop new_location) {
|
||||
|
||||
// Save object somewhere, there is an overlap in fields
|
||||
if (new_klass_oop->is_copying_backwards()) {
|
||||
- if (((HeapWord *)q >= (HeapWord *)new_location && (HeapWord *)q < (HeapWord *)new_location + new_size) ||
|
||||
- ((HeapWord *)new_location >= (HeapWord *)q && (HeapWord *)new_location < (HeapWord *)q + size)) {
|
||||
+ if ((cast_from_oop<HeapWord*>(q) >= cast_from_oop<HeapWord*>(new_location) && cast_from_oop<HeapWord*>(q) < cast_from_oop<HeapWord*>(new_location) + new_size) ||
|
||||
+ (cast_from_oop<HeapWord*>(new_location) >= cast_from_oop<HeapWord*>(q) && cast_from_oop<HeapWord*>(new_location) < cast_from_oop<HeapWord*>(q) + size)) {
|
||||
tmp = NEW_RESOURCE_ARRAY(HeapWord, size);
|
||||
q = (oop) tmp;
|
||||
- Copy::aligned_disjoint_words((HeapWord*)tmp_obj, (HeapWord*)q, size);
|
||||
+ Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(tmp_obj), cast_from_oop<HeapWord*>(q), size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,13 +131,13 @@ void DcevmSharedGC::update_fields(oop q, oop new_location) {
|
||||
|
||||
void DcevmSharedGC::update_fields(oop new_location, oop tmp_obj, int *cur) {
|
||||
assert(cur != NULL, "just checking");
|
||||
- char* to = (char*)(HeapWord*)new_location;
|
||||
+ char* to = (char*)cast_from_oop<HeapWord*>(new_location);
|
||||
while (*cur != 0) {
|
||||
int size = *cur;
|
||||
if (size > 0) {
|
||||
cur++;
|
||||
int offset = *cur;
|
||||
- HeapWord* from = (HeapWord*)(((char *)(HeapWord*)tmp_obj) + offset);
|
||||
+ HeapWord* from = (HeapWord*)(((char *)cast_from_oop<HeapWord*>(tmp_obj)) + offset);
|
||||
if (size == HeapWordSize) {
|
||||
*((HeapWord*)to) = *from;
|
||||
} else if (size == HeapWordSize * 2) {
|
||||
diff --git a/src/hotspot/share/gc/shared/dcevmSharedGC.hpp b/src/hotspot/share/gc/shared/dcevmSharedGC.hpp
|
||||
index e2ef0171fb2..a4e27e00280 100644
|
||||
--- a/src/hotspot/share/gc/shared/dcevmSharedGC.hpp
|
||||
+++ b/src/hotspot/share/gc/shared/dcevmSharedGC.hpp
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "gc/shared/genOopClosures.hpp"
|
||||
#include "gc/shared/taskqueue.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
-#include "oops/markOop.hpp"
|
||||
+#include "oops/markWord.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
#include "runtime/timer.hpp"
|
||||
#include "utilities/growableArray.hpp"
|
||||
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
index f01d64d1434..5c1a09390f1 100644
|
||||
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
@@ -100,7 +100,7 @@ void GCConfig::fail_if_non_included_gc_is_selected() {
|
||||
void GCConfig::select_gc_ergonomically() {
|
||||
if (AllowEnhancedClassRedefinition && !UseG1GC) {
|
||||
// Enhanced class redefinition only supports serial GC at the moment
|
||||
- FLAG_SET_ERGO(bool, UseSerialGC, true);
|
||||
+ FLAG_SET_ERGO(UseSerialGC, true);
|
||||
} else if (os::is_server_class_machine()) {
|
||||
#if INCLUDE_G1GC
|
||||
FLAG_SET_ERGO_IF_DEFAULT(UseG1GC, true);
|
||||
diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp
|
||||
index 9772c32c42e..e8e3d7884c2 100644
|
||||
--- a/src/hotspot/share/gc/shared/space.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/space.cpp
|
||||
@@ -440,7 +440,7 @@ int CompactibleSpace::space_index(oop obj) {
|
||||
index++;
|
||||
}
|
||||
|
||||
- tty->print_cr("could not compute space_index for %08xh", (HeapWord*)obj);
|
||||
+ tty->print_cr("could not compute space_index for %08xh", cast_from_oop<HeapWord*>(obj));
|
||||
index = 0;
|
||||
|
||||
Generation* gen = heap->old_gen();
|
||||
@@ -485,7 +485,7 @@ bool CompactibleSpace::must_rescue(oop old_obj, oop new_obj) {
|
||||
bool new_in_tenured = tenured_gen->is_in_reserved(new_obj);
|
||||
if (old_in_tenured == new_in_tenured) {
|
||||
// Rescue if object may overlap with a higher memory address.
|
||||
- bool overlap = ((HeapWord*)old_obj + original_size < (HeapWord*)new_obj + new_size);
|
||||
+ bool overlap = (cast_from_oop<HeapWord*>(old_obj) + original_size < cast_from_oop<HeapWord*>(new_obj) + new_size);
|
||||
if (old_in_tenured) {
|
||||
// Old and new address are in same space, so just compare the address.
|
||||
// Must rescue if object moves towards the top of the space.
|
||||
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
|
||||
index b2f24ddbeda..9daeeb70b34 100644
|
||||
--- a/src/hotspot/share/interpreter/linkResolver.cpp
|
||||
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
|
||||
@@ -1031,7 +1031,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
|
||||
assert(m != NULL, "information about the current method must be available for 'put' bytecodes");
|
||||
bool is_initialized_static_final_update = (byte == Bytecodes::_putstatic &&
|
||||
fd.is_static() &&
|
||||
- !(m()->is_static_initializer() || m()->name() == vmSymbols::ha_class_initializer_name()));
|
||||
+ !(m->is_static_initializer() || m->name() == vmSymbols::ha_class_initializer_name()));
|
||||
bool is_initialized_instance_final_update = ((byte == Bytecodes::_putfield || byte == Bytecodes::_nofast_putfield) &&
|
||||
!fd.is_static() &&
|
||||
!m->is_object_initializer());
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index f8e60941046..5e40d78a87e 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -1316,7 +1316,7 @@ void InstanceKlass::init_implementor() {
|
||||
// (DCEVM) - init_implementor() for dcevm
|
||||
void InstanceKlass::init_implementor_from_redefine() {
|
||||
assert(is_interface(), "not interface");
|
||||
- Klass** addr = adr_implementor();
|
||||
+ Klass* volatile* addr = adr_implementor();
|
||||
assert(addr != NULL, "null addr");
|
||||
if (addr != NULL) {
|
||||
*addr = NULL;
|
||||
@@ -1659,6 +1659,21 @@ void InstanceKlass::methods_do(void f(Method* method)) {
|
||||
}
|
||||
}
|
||||
|
||||
+void InstanceKlass::methods_do(void f(Method* method, TRAPS), TRAPS) {
|
||||
+ // Methods aren't stable until they are loaded. This can be read outside
|
||||
+ // a lock through the ClassLoaderData for profiling
|
||||
+ if (!is_loaded()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ int len = methods()->length();
|
||||
+ for (int index = 0; index < len; index++) {
|
||||
+ Method* m = methods()->at(index);
|
||||
+ assert(m->is_method(), "must be method");
|
||||
+ f(m, CHECK);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
// (DCEVM) Update information contains mapping of fields from old class to the new class.
|
||||
// Info is stored on HEAP, you need to call clear_update_information to free the space.
|
||||
void InstanceKlass::store_update_information(GrowableArray<int> &values) {
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp
|
||||
index 6ead9426728..b56d42cb177 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.hpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.hpp
|
||||
@@ -1069,6 +1069,7 @@ public:
|
||||
void clear_update_information();
|
||||
|
||||
void methods_do(void f(Method* method));
|
||||
+ void methods_do(void f(Method* method, TRAPS), TRAPS);
|
||||
void array_klasses_do(void f(Klass* k));
|
||||
void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
|
||||
|
||||
diff --git a/src/hotspot/share/oops/klass.cpp b/src/hotspot/share/oops/klass.cpp
|
||||
index 352d8f84631..88f5ec9ba4a 100644
|
||||
--- a/src/hotspot/share/oops/klass.cpp
|
||||
+++ b/src/hotspot/share/oops/klass.cpp
|
||||
@@ -200,13 +200,13 @@ void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word
|
||||
Klass::Klass(KlassID id) : _id(id),
|
||||
_java_mirror(NULL),
|
||||
_prototype_header(markWord::prototype()),
|
||||
- _shared_class_path_index(-1),
|
||||
- _new_version(NULL),
|
||||
_old_version(NULL),
|
||||
+ _new_version(NULL),
|
||||
+ _redefinition_flags(Klass::NoRedefinition),
|
||||
_is_redefining(false),
|
||||
+ _update_information(NULL),
|
||||
_is_copying_backwards(false),
|
||||
- _redefinition_flags(Klass::NoRedefinition),
|
||||
- _update_information(NULL) {
|
||||
+ _shared_class_path_index(-1) {
|
||||
CDS_ONLY(_shared_class_flags = 0;)
|
||||
CDS_JAVA_HEAP_ONLY(_archived_mirror = 0;)
|
||||
_primary_supers[0] = this;
|
||||
diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp
|
||||
index 333b65ccfc1..13bcac352fb 100644
|
||||
--- a/src/hotspot/share/prims/jvm.cpp
|
||||
+++ b/src/hotspot/share/prims/jvm.cpp
|
||||
@@ -1054,6 +1054,7 @@ static jclass jvm_lookup_define_class(JNIEnv *env, jclass lookup, const char *na
|
||||
class_loader,
|
||||
protection_domain,
|
||||
&st,
|
||||
+ NULL,
|
||||
CHECK_NULL);
|
||||
|
||||
if (log_is_enabled(Debug, class, resolve) && defined_k != NULL) {
|
||||
@@ -1074,6 +1075,7 @@ static jclass jvm_lookup_define_class(JNIEnv *env, jclass lookup, const char *na
|
||||
class_loader,
|
||||
&st,
|
||||
cl_info,
|
||||
+ NULL,
|
||||
CHECK_NULL);
|
||||
if (defined_k == NULL) {
|
||||
THROW_MSG_0(vmSymbols::java_lang_Error(), "Failure to define a hidden class");
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 1da6661dd3e..619e3988e3a 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -24,11 +24,14 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "aot/aotLoader.hpp"
|
||||
+#include "classfile/classFileParser.hpp"
|
||||
#include "classfile/classFileStream.hpp"
|
||||
#include "classfile/metadataOnStackMark.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/verifier.hpp"
|
||||
#include "classfile/dictionary.hpp"
|
||||
+#include "classfile/classLoaderDataGraph.hpp"
|
||||
+#include "interpreter/linkResolver.hpp"
|
||||
#include "interpreter/oopMapCache.hpp"
|
||||
#include "interpreter/rewriter.hpp"
|
||||
#include "logging/logStream.hpp"
|
||||
@@ -37,17 +40,22 @@
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/iterator.inline.hpp"
|
||||
#include "oops/fieldStreams.hpp"
|
||||
+#include "oops/fieldStreams.inline.hpp"
|
||||
#include "oops/klassVtable.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/constantPool.inline.hpp"
|
||||
+#include "oops/metadata.hpp"
|
||||
+#include "oops/methodData.hpp"
|
||||
#include "prims/jvmtiImpl.hpp"
|
||||
#include "prims/jvmtiClassFileReconstituter.hpp"
|
||||
#include "prims/jvmtiEnhancedRedefineClasses.hpp"
|
||||
#include "prims/methodComparator.hpp"
|
||||
#include "prims/resolvedMethodTable.hpp"
|
||||
+#include "prims/methodHandles.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
#include "runtime/relocator.hpp"
|
||||
+#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "utilities/bitMap.inline.hpp"
|
||||
#include "prims/jvmtiThreadState.inline.hpp"
|
||||
@@ -55,6 +63,8 @@
|
||||
#include "oops/constantPool.inline.hpp"
|
||||
#include "gc/g1/g1CollectedHeap.hpp"
|
||||
#include "gc/shared/dcevmSharedGC.hpp"
|
||||
+#include "gc/shared/scavengableNMethods.hpp"
|
||||
+#include "ci/ciObjectFactory.hpp"
|
||||
|
||||
Array<Method*>* VM_EnhancedRedefineClasses::_old_methods = NULL;
|
||||
Array<Method*>* VM_EnhancedRedefineClasses::_new_methods = NULL;
|
||||
@@ -66,6 +76,7 @@ int VM_EnhancedRedefineClasses::_matching_methods_length = 0;
|
||||
int VM_EnhancedRedefineClasses::_deleted_methods_length = 0;
|
||||
int VM_EnhancedRedefineClasses::_added_methods_length = 0;
|
||||
Klass* VM_EnhancedRedefineClasses::_the_class_oop = NULL;
|
||||
+u8 VM_EnhancedRedefineClasses::_id_counter = 0;
|
||||
|
||||
//
|
||||
// Create new instance of enhanced class redefiner.
|
||||
@@ -88,6 +99,7 @@ VM_EnhancedRedefineClasses::VM_EnhancedRedefineClasses(jint class_count, const j
|
||||
_class_load_kind = class_load_kind;
|
||||
_res = JVMTI_ERROR_NONE;
|
||||
_any_class_has_resolved_methods = false;
|
||||
+ _id = next_id();
|
||||
}
|
||||
|
||||
static inline InstanceKlass* get_ik(jclass def) {
|
||||
@@ -211,9 +223,7 @@ class FieldCopier : public FieldClosure {
|
||||
|
||||
// TODO: review...
|
||||
void VM_EnhancedRedefineClasses::mark_as_scavengable(nmethod* nm) {
|
||||
- if (!nm->on_scavenge_root_list()) {
|
||||
- CodeCache::add_scavenge_root_nmethod(nm);
|
||||
- }
|
||||
+ ScavengableNMethods::register_nmethod(nm);
|
||||
}
|
||||
|
||||
void VM_EnhancedRedefineClasses::unregister_nmethod_g1(nmethod* nm) {
|
||||
@@ -414,7 +424,7 @@ public:
|
||||
_tmp_obj_size = size;
|
||||
_tmp_obj = (oop)resource_allocate_bytes(size * HeapWordSize);
|
||||
}
|
||||
- Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)_tmp_obj, size);
|
||||
+ Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(o), cast_from_oop<HeapWord*>(_tmp_obj), size);
|
||||
}
|
||||
|
||||
virtual void do_object(oop obj) {
|
||||
@@ -505,9 +515,6 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
ClearCpoolCacheAndUnpatch clear_cpool_cache(thread);
|
||||
ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
|
||||
|
||||
-
|
||||
- // SystemDictionary::methods_do(fix_invoke_method);
|
||||
-
|
||||
// JSR-292 support
|
||||
if (_any_class_has_resolved_methods) {
|
||||
bool trace_name_printed = false;
|
||||
@@ -564,8 +571,8 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
InstanceKlass* old = InstanceKlass::cast(cur->old_version());
|
||||
|
||||
// Swap marks to have same hashcodes
|
||||
- markOop cur_mark = cur->prototype_header();
|
||||
- markOop old_mark = old->prototype_header();
|
||||
+ markWord cur_mark = cur->prototype_header();
|
||||
+ markWord old_mark = old->prototype_header();
|
||||
cur->set_prototype_header(old_mark);
|
||||
old->set_prototype_header(cur_mark);
|
||||
|
||||
@@ -579,14 +586,14 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
// Revert pool holder for old version of klass (it was updated by one of ours closure!)
|
||||
old->constants()->set_pool_holder(old);
|
||||
|
||||
- Klass* array_klasses = old->array_klasses();
|
||||
+ ObjArrayKlass* array_klasses = old->array_klasses();
|
||||
if (array_klasses != NULL) {
|
||||
assert(cur->array_klasses() == NULL, "just checking");
|
||||
|
||||
// Transfer the array classes, otherwise we might get cast exceptions when casting array types.
|
||||
// Also, set array klasses element klass.
|
||||
cur->set_array_klasses(array_klasses);
|
||||
- ObjArrayKlass::cast(array_klasses)->set_element_klass(cur);
|
||||
+ array_klasses->set_element_klass(cur);
|
||||
java_lang_Class::release_set_array_klass(cur->java_mirror(), array_klasses);
|
||||
java_lang_Class::set_component_mirror(array_klasses->java_mirror(), cur->java_mirror());
|
||||
}
|
||||
@@ -641,11 +648,15 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
//ClassLoaderDataGraph::classes_do(&clean_weak_method_links);
|
||||
|
||||
// Disable any dependent concurrent compilations
|
||||
- SystemDictionary::notice_modification();
|
||||
+ // SystemDictionary::notice_modification();
|
||||
+
|
||||
+ JvmtiExport::increment_redefinition_count();
|
||||
|
||||
// Set flag indicating that some invariants are no longer true.
|
||||
// See jvmtiExport.hpp for detailed explanation.
|
||||
- JvmtiExport::set_has_redefined_a_class();
|
||||
+
|
||||
+ // dcevm15: handled by _redefinition_count
|
||||
+ // JvmtiExport::set_has_redefined_a_class();
|
||||
|
||||
#ifdef PRODUCT
|
||||
if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
|
||||
@@ -718,7 +729,7 @@ bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
|
||||
}
|
||||
|
||||
// Cannot redefine or retransform an anonymous class.
|
||||
- if (InstanceKlass::cast(k)->is_anonymous()) {
|
||||
+ if (InstanceKlass::cast(k)->is_unsafe_anonymous()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -804,22 +815,30 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
|
||||
|
||||
InstanceKlass* k;
|
||||
|
||||
- if (InstanceKlass::cast(the_class)->is_anonymous()) {
|
||||
- const InstanceKlass* host_class = the_class->host_klass();
|
||||
+ if (InstanceKlass::cast(the_class)->is_unsafe_anonymous()) {
|
||||
+ const InstanceKlass* host_class = the_class->unsafe_anonymous_host();
|
||||
|
||||
// Make sure it's the real host class, not another anonymous class.
|
||||
- while (host_class != NULL && host_class->is_anonymous()) {
|
||||
- host_class = host_class->host_klass();
|
||||
+ while (host_class != NULL && host_class->is_unsafe_anonymous()) {
|
||||
+ host_class = host_class->unsafe_anonymous_host();
|
||||
}
|
||||
|
||||
+ ClassLoadInfo cl_info(protection_domain,
|
||||
+ host_class,
|
||||
+ NULL, // dynamic_nest_host
|
||||
+ NULL, // cp_patches
|
||||
+ Handle(), // classData
|
||||
+ false, // is_hidden
|
||||
+ false, // is_strong_hidden
|
||||
+ true); // FIXME: check if correct. can_access_vm_annotations
|
||||
+
|
||||
k = SystemDictionary::parse_stream(the_class_sym,
|
||||
the_class_loader,
|
||||
- protection_domain,
|
||||
&st,
|
||||
- host_class,
|
||||
+ cl_info,
|
||||
the_class,
|
||||
- NULL,
|
||||
THREAD);
|
||||
+
|
||||
k->class_loader_data()->exchange_holders(the_class->class_loader_data());
|
||||
the_class->class_loader_data()->inc_keep_alive();
|
||||
} else {
|
||||
@@ -966,7 +985,7 @@ int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_
|
||||
// Check interfaces
|
||||
|
||||
// Interfaces removed?
|
||||
- Array<Klass*>* old_interfaces = the_class->transitive_interfaces();
|
||||
+ Array<InstanceKlass*>* old_interfaces = the_class->transitive_interfaces();
|
||||
for (i = 0; i < old_interfaces->length(); i++) {
|
||||
InstanceKlass* old_interface = InstanceKlass::cast(old_interfaces->at(i));
|
||||
if (!new_class->implements_interface_any_version(old_interface)) {
|
||||
@@ -976,7 +995,7 @@ int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_
|
||||
}
|
||||
|
||||
// Interfaces added?
|
||||
- Array<Klass*>* new_interfaces = new_class->transitive_interfaces();
|
||||
+ Array<InstanceKlass*>* new_interfaces = new_class->transitive_interfaces();
|
||||
for (i = 0; i<new_interfaces->length(); i++) {
|
||||
if (!the_class->implements_interface_any_version(new_interfaces->at(i))) {
|
||||
result = result | Klass::ModifyClass;
|
||||
@@ -1389,8 +1408,8 @@ void VM_EnhancedRedefineClasses::rollback() {
|
||||
// Rewrite faster byte-codes back to their slower equivalent. Undoes rewriting happening in templateTable_xxx.cpp
|
||||
// The reason is that once we zero cpool caches, we need to re-resolve all entries again. Faster bytecodes do not
|
||||
// do that, they assume that cache entry is resolved already.
|
||||
-void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method) {
|
||||
- RawBytecodeStream bcs(method);
|
||||
+void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method, TRAPS) {
|
||||
+ RawBytecodeStream bcs(methodHandle(THREAD, method));
|
||||
Bytecodes::Code code;
|
||||
Bytecodes::Code java_code;
|
||||
while (!bcs.is_last_bytecode()) {
|
||||
@@ -1454,11 +1473,11 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
|
||||
HandleMark hm(_thread);
|
||||
InstanceKlass *ik = InstanceKlass::cast(k);
|
||||
|
||||
- constantPoolHandle other_cp = constantPoolHandle(ik->constants());
|
||||
+ constantPoolHandle other_cp = constantPoolHandle(_thread, ik->constants());
|
||||
|
||||
// Update host klass of anonymous classes (for example, produced by lambdas) to newest version.
|
||||
- if (ik->is_anonymous() && ik->host_klass()->new_version() != NULL) {
|
||||
- ik->set_host_klass(InstanceKlass::cast(ik->host_klass()->newest_version()));
|
||||
+ if (ik->is_unsafe_anonymous() && ik->unsafe_anonymous_host()->new_version() != NULL) {
|
||||
+ ik->set_unsafe_anonymous_host(InstanceKlass::cast(ik->unsafe_anonymous_host()->newest_version()));
|
||||
}
|
||||
|
||||
// Update implementor if there is only one, in this case implementor() can reference old class
|
||||
@@ -1492,7 +1511,18 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
|
||||
|
||||
// If bytecode rewriting is enabled, we also need to unpatch bytecode to force resolution of zeroed entries
|
||||
if (RewriteBytecodes) {
|
||||
- ik->methods_do(unpatch_bytecode);
|
||||
+ ik->methods_do(unpatch_bytecode, _thread);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+u8 VM_EnhancedRedefineClasses::next_id() {
|
||||
+ while (true) {
|
||||
+ u8 id = _id_counter;
|
||||
+ u8 next_id = id + 1;
|
||||
+ u8 result = Atomic::cmpxchg(&_id_counter, id, next_id);
|
||||
+ if (result == id) {
|
||||
+ return next_id;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1512,31 +1542,8 @@ void VM_EnhancedRedefineClasses::MethodDataCleaner::do_klass(Klass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
-void VM_EnhancedRedefineClasses::fix_invoke_method(Method* method) {
|
||||
-
|
||||
- constantPoolHandle other_cp = constantPoolHandle(method->constants());
|
||||
-
|
||||
- for (int i = 0; i < other_cp->length(); i++) {
|
||||
- if (other_cp->tag_at(i).is_klass()) {
|
||||
- Klass* klass = other_cp->resolved_klass_at(i);
|
||||
- if (klass->new_version() != NULL) {
|
||||
- // Constant pool entry points to redefined class -- update to the new version
|
||||
- other_cp->klass_at_put(i, klass->newest_version());
|
||||
- }
|
||||
- assert(other_cp->resolved_klass_at(i)->new_version() == NULL, "Must be new klass!");
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- ConstantPoolCache* cp_cache = other_cp->cache();
|
||||
- if (cp_cache != NULL) {
|
||||
- cp_cache->clear_entries();
|
||||
- }
|
||||
-
|
||||
-}
|
||||
-
|
||||
|
||||
-
|
||||
-void VM_EnhancedRedefineClasses::update_jmethod_ids() {
|
||||
+void VM_EnhancedRedefineClasses::update_jmethod_ids(TRAPS) {
|
||||
for (int j = 0; j < _matching_methods_length; ++j) {
|
||||
Method* old_method = _matching_old_methods[j];
|
||||
jmethodID jmid = old_method->find_jmethod_id_or_null();
|
||||
@@ -1547,10 +1554,10 @@ void VM_EnhancedRedefineClasses::update_jmethod_ids() {
|
||||
|
||||
if (jmid != NULL) {
|
||||
// There is a jmethodID, change it to point to the new method
|
||||
- methodHandle new_method_h(_matching_new_methods[j]);
|
||||
+ methodHandle new_method_h(THREAD, _matching_new_methods[j]);
|
||||
|
||||
if (old_method->new_version() == NULL) {
|
||||
- methodHandle old_method_h(_matching_old_methods[j]);
|
||||
+ methodHandle old_method_h(THREAD, _matching_old_methods[j]);
|
||||
jmethodID new_jmethod_id = Method::make_jmethod_id(old_method_h->method_holder()->class_loader_data(), old_method_h());
|
||||
bool result = InstanceKlass::cast(old_method_h->method_holder())->update_jmethod_id(old_method_h(), new_jmethod_id);
|
||||
} else {
|
||||
@@ -1887,7 +1894,7 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
|
||||
|
||||
// track number of methods that are EMCP for add_previous_version() call below
|
||||
check_methods_and_mark_as_obsolete();
|
||||
- update_jmethod_ids();
|
||||
+ update_jmethod_ids(THREAD);
|
||||
|
||||
_any_class_has_resolved_methods = the_class->has_resolved_methods() || _any_class_has_resolved_methods;
|
||||
|
||||
@@ -2119,12 +2126,12 @@ jvmtiError VM_EnhancedRedefineClasses::do_topological_class_sorting(TRAPS) {
|
||||
|
||||
Handle protection_domain(THREAD, klass->protection_domain());
|
||||
|
||||
+ ClassLoadInfo cl_info(protection_domain);
|
||||
+
|
||||
ClassFileParser parser(&st,
|
||||
klass->name(),
|
||||
klass->class_loader_data(),
|
||||
- protection_domain,
|
||||
- NULL, // host_klass
|
||||
- NULL, // cp_patches
|
||||
+ &cl_info,
|
||||
ClassFileParser::INTERNAL, // publicity level
|
||||
true,
|
||||
THREAD);
|
||||
@@ -2134,7 +2141,7 @@ jvmtiError VM_EnhancedRedefineClasses::do_topological_class_sorting(TRAPS) {
|
||||
links.append(KlassPair(super_klass, klass));
|
||||
}
|
||||
|
||||
- Array<Klass*>* local_interfaces = parser.local_interfaces();
|
||||
+ Array<InstanceKlass*>* local_interfaces = parser.local_interfaces();
|
||||
for (int j = 0; j < local_interfaces->length(); j++) {
|
||||
Klass* iface = local_interfaces->at(j);
|
||||
if (iface != NULL && _affected_klasses->contains(iface)) {
|
||||
@@ -2157,7 +2164,7 @@ jvmtiError VM_EnhancedRedefineClasses::do_topological_class_sorting(TRAPS) {
|
||||
links.append(KlassPair(super_klass, klass));
|
||||
}
|
||||
|
||||
- Array<Klass*>* local_interfaces = klass->local_interfaces();
|
||||
+ Array<InstanceKlass*>* local_interfaces = klass->local_interfaces();
|
||||
for (int j = 0; j < local_interfaces->length(); j++) {
|
||||
Klass* interfaceKlass = local_interfaces->at(j);
|
||||
if (_affected_klasses->contains(interfaceKlass)) {
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 4c0412d343d..0066088b3b0 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/objArrayOop.hpp"
|
||||
-#include "gc/shared/vmGCOperations.hpp"
|
||||
+#include "gc/shared/gcVMOperations.hpp"
|
||||
#include "../../../java.base/unix/native/include/jni_md.h"
|
||||
|
||||
//
|
||||
@@ -59,6 +59,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
static int _deleted_methods_length;
|
||||
static int _added_methods_length;
|
||||
static Klass* _the_class_oop;
|
||||
+ static u8 _id_counter;
|
||||
|
||||
// The instance fields are used to pass information from
|
||||
// doit_prologue() to doit() and doit_epilogue().
|
||||
@@ -91,6 +92,9 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
elapsedTimer _timer_heap_iterate;
|
||||
elapsedTimer _timer_heap_full_gc;
|
||||
|
||||
+ // Redefinition id used by JFR
|
||||
+ u8 _id;
|
||||
+
|
||||
// These routines are roughly in call order unless otherwise noted.
|
||||
|
||||
// Load and link new classes (either redefined or affected by redefinition - subclass, ...)
|
||||
@@ -118,15 +122,14 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
static void mark_as_scavengable(nmethod* nm);
|
||||
static void unregister_nmethod_g1(nmethod* nm);
|
||||
static void register_nmethod_g1(nmethod* nm);
|
||||
- static void unpatch_bytecode(Method* method);
|
||||
- static void fix_invoke_method(Method* method);
|
||||
+ static void unpatch_bytecode(Method* method, TRAPS);
|
||||
|
||||
// Figure out which new methods match old methods in name and signature,
|
||||
// which methods have been added, and which are no longer present
|
||||
void compute_added_deleted_matching_methods();
|
||||
|
||||
// Change jmethodIDs to point to the new methods
|
||||
- void update_jmethod_ids();
|
||||
+ void update_jmethod_ids(TRAPS);
|
||||
|
||||
// marking methods as old and/or obsolete
|
||||
void check_methods_and_mark_as_obsolete();
|
||||
@@ -141,6 +144,8 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
|
||||
void flush_dependent_code(InstanceKlass* k_h, TRAPS);
|
||||
|
||||
+ u8 next_id();
|
||||
+
|
||||
static void check_class(InstanceKlass* k_oop, TRAPS);
|
||||
|
||||
static void dump_methods();
|
||||
@@ -181,6 +186,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
|
||||
bool allow_nested_vm_operations() const { return true; }
|
||||
jvmtiError check_error() { return _res; }
|
||||
+ u8 id() { return _id; }
|
||||
|
||||
// Modifiable test must be shared between IsModifiableClass query
|
||||
// and redefine implementation
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
index b6838ac034d..fba0f48abd7 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp
|
||||
@@ -456,20 +456,23 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
||||
|
||||
EventRetransformClasses event;
|
||||
jvmtiError error;
|
||||
+ u8 op_id;
|
||||
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_retransform);
|
||||
VMThread::execute(&op);
|
||||
+ op_id = op.id();
|
||||
error = (op.check_error());
|
||||
} else {
|
||||
VM_RedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_retransform);
|
||||
VMThread::execute(&op);
|
||||
+ op_id = op.id();
|
||||
error = op.check_error();
|
||||
}
|
||||
if (error == JVMTI_ERROR_NONE) {
|
||||
event.set_classCount(class_count);
|
||||
- event.set_redefinitionId(op.id());
|
||||
+ event.set_redefinitionId(op_id);
|
||||
event.commit();
|
||||
}
|
||||
return error;
|
||||
@@ -484,19 +487,23 @@ JvmtiEnv::RedefineClasses(jint class_count, const jvmtiClassDefinition* class_de
|
||||
EventRedefineClasses event;
|
||||
jvmtiError error;
|
||||
|
||||
+ u8 op_id;
|
||||
+
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
MutexLocker sd_mutex(EnhancedRedefineClasses_lock);
|
||||
VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
|
||||
VMThread::execute(&op);
|
||||
+ op_id = op.id();
|
||||
error = (op.check_error());
|
||||
} else {
|
||||
VM_RedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
|
||||
VMThread::execute(&op);
|
||||
+ op_id = op.id();
|
||||
error = op.check_error();
|
||||
}
|
||||
if (error == JVMTI_ERROR_NONE) {
|
||||
event.set_classCount(class_count);
|
||||
- event.set_redefinitionId(op.id());
|
||||
+ event.set_redefinitionId(op_id);
|
||||
event.commit();
|
||||
}
|
||||
return error;
|
||||
diff --git a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
|
||||
index a7840848e10..346eac7c431 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
|
||||
@@ -1271,6 +1271,7 @@ jvmtiError VM_RedefineClasses::load_new_class_versions(TRAPS) {
|
||||
the_class_loader,
|
||||
&st,
|
||||
cl_info,
|
||||
+ NULL,
|
||||
THREAD);
|
||||
// Clear class_being_redefined just to be sure.
|
||||
state->clear_class_being_redefined();
|
||||
diff --git a/src/hotspot/share/prims/methodHandles.hpp b/src/hotspot/share/prims/methodHandles.hpp
|
||||
index 54f36202a5f..917d31efd77 100644
|
||||
--- a/src/hotspot/share/prims/methodHandles.hpp
|
||||
+++ b/src/hotspot/share/prims/methodHandles.hpp
|
||||
@@ -180,6 +180,9 @@ public:
|
||||
assert(ref_kind_is_valid(ref_kind), "");
|
||||
return (ref_kind & 1) != 0;
|
||||
}
|
||||
+ static bool ref_kind_is_static(int ref_kind) {
|
||||
+ return !ref_kind_has_receiver(ref_kind) && (ref_kind != JVM_REF_newInvokeSpecial);
|
||||
+ }
|
||||
|
||||
static int ref_kind_to_flags(int ref_kind);
|
||||
|
||||
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
|
||||
index d05a2893498..3a92b8869dc 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.cpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.cpp
|
||||
@@ -2128,13 +2128,15 @@ bool Arguments::check_gc_consistency() {
|
||||
// of collectors.
|
||||
uint i = 0;
|
||||
if (UseSerialGC) i++;
|
||||
- if (UseConcMarkSweepGC) i++;
|
||||
- if (UseParallelGC || UseParallelOldGC) i++;
|
||||
+ if (UseParallelGC) i++;
|
||||
if (UseG1GC) i++;
|
||||
+ if (UseEpsilonGC) i++;
|
||||
+ if (UseZGC) i++;
|
||||
+ if (UseShenandoahGC) i++;
|
||||
if (AllowEnhancedClassRedefinition) {
|
||||
// Must use serial GC. This limitation applies because the instance size changing GC modifications
|
||||
// are only built into the mark and compact algorithm.
|
||||
- if ((!UseSerialGC && !UseG1GC) && i >= 1) {
|
||||
+ if (!UseSerialGC && !UseG1GC && i >= 1) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Must use the Serial or G1 GC with enhanced class redefinition.\n");
|
||||
return false;
|
||||
@@ -4494,18 +4496,18 @@ void Arguments::setup_hotswap_agent() {
|
||||
|
||||
// TODO: open it only for org.hotswap.agent module
|
||||
// Use to access java.lang.reflect.Proxy/proxyCache
|
||||
- create_numbered_property("jdk.module.addopens", "java.base/java.lang=ALL-UNNAMED", addopens_count++);
|
||||
+ create_numbered_module_property("jdk.module.addopens", "java.base/java.lang=ALL-UNNAMED", addopens_count++);
|
||||
// Class of field java.lang.reflect.Proxy/proxyCache
|
||||
- create_numbered_property("jdk.module.addopens", "java.base/jdk.internal.loader=ALL-UNNAMED", addopens_count++);
|
||||
+ create_numbered_module_property("jdk.module.addopens", "java.base/jdk.internal.loader=ALL-UNNAMED", addopens_count++);
|
||||
// Use to access java.io.Reader, java.io.InputStream, java.io.FileInputStream
|
||||
- create_numbered_property("jdk.module.addopens", "java.base/java.io=ALL-UNNAMED", addopens_count++);
|
||||
+ create_numbered_module_property("jdk.module.addopens", "java.base/java.io=ALL-UNNAMED", addopens_count++);
|
||||
// java.beans.Introspector access
|
||||
- create_numbered_property("jdk.module.addopens", "java.desktop/java.beans=ALL-UNNAMED", addopens_count++);
|
||||
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/java.beans=ALL-UNNAMED", addopens_count++);
|
||||
// java.beans.Introspector access
|
||||
- create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans=ALL-UNNAMED", addopens_count++);
|
||||
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/com.sun.beans=ALL-UNNAMED", addopens_count++);
|
||||
// com.sun.beans.introspect.ClassInfo access
|
||||
- create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans.introspect=ALL-UNNAMED", addopens_count++);
|
||||
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/com.sun.beans.introspect=ALL-UNNAMED", addopens_count++);
|
||||
// com.sun.beans.introspect.util.Cache access
|
||||
- create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans.util=ALL-UNNAMED", addopens_count++);
|
||||
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/com.sun.beans.util=ALL-UNNAMED", addopens_count++);
|
||||
|
||||
}
|
||||
diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
index 6f982072909..14a3ed730fe 100644
|
||||
--- a/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
+++ b/src/hotspot/share/runtime/mutexLocker.cpp
|
||||
@@ -287,7 +287,7 @@ void mutex_init() {
|
||||
def(InitCompleted_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
|
||||
def(VtableStubs_lock , PaddedMutex , nonleaf, true, _safepoint_check_never);
|
||||
def(Notify_lock , PaddedMonitor, nonleaf, true, _safepoint_check_always);
|
||||
- def(EnhancedRedefineClasses_lock , PaddedMutex , nonleaf+7, false, Monitor::_safepoint_check_always); // for ensuring that class redefinition is not done in parallel
|
||||
+ def(EnhancedRedefineClasses_lock , PaddedMutex , nonleaf+7, false, _safepoint_check_always); // for ensuring that class redefinition is not done in parallel
|
||||
def(JNICritical_lock , PaddedMonitor, nonleaf, true, _safepoint_check_always); // used for JNI critical regions
|
||||
def(AdapterHandlerLibrary_lock , PaddedMutex , nonleaf, true, _safepoint_check_always);
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
25
jb/project/tools/patches/dcevm/0020-dcevm15-G1-fixes.patch
Normal file
25
jb/project/tools/patches/dcevm/0020-dcevm15-G1-fixes.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
From 336cab4f72c6e642e3077ea8d1a4860de33f5a4d Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Tue, 17 Nov 2020 17:40:24 +0100
|
||||
Subject: [PATCH 20/34] dcevm15 - G1 fixes
|
||||
|
||||
---
|
||||
src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
|
||||
index 2f06b9617e4..476728a5d26 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
|
||||
@@ -240,7 +240,7 @@ void G1FullGCPrepareTask::prepare_serial_compaction_dcevm() {
|
||||
|
||||
// collect remaining, not forwarded rescued oops using serial compact point
|
||||
while (cp->last_rescued_oop() < cp->rescued_oops()->length()) {
|
||||
- HeapRegion* hr = G1CollectedHeap::heap()->new_region(HeapRegion::GrainBytes / HeapWordSize, false, true);
|
||||
+ HeapRegion* hr = G1CollectedHeap::heap()->new_region(HeapRegion::GrainBytes / HeapWordSize, HeapRegionType::Eden, true, G1NUMA::AnyNodeIndex);
|
||||
if (hr == NULL) {
|
||||
vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "G1 - not enough of free regions after redefinition.");
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
From cea4e2cca3c37233c728be7235f8f9d8be136cb5 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Tue, 17 Nov 2020 18:52:57 +0100
|
||||
Subject: [PATCH 21/34] dcevm15 - Fix flush dependent code
|
||||
|
||||
---
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 57 +++++++------------
|
||||
.../prims/jvmtiEnhancedRedefineClasses.hpp | 4 +-
|
||||
2 files changed, 25 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 619e3988e3a..efaf11e1666 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -508,7 +508,7 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
|
||||
// Deoptimize all compiled code that depends on this class (do only once, because it clears whole cache)
|
||||
// if (_max_redefinition_flags > Klass::ModifyClass) {
|
||||
- flush_dependent_code(NULL, thread);
|
||||
+ flush_dependent_code(thread);
|
||||
// }
|
||||
|
||||
// Adjust constantpool caches for all classes that reference methods of the evolved class.
|
||||
@@ -647,17 +647,8 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
//MethodDataCleaner clean_weak_method_links;
|
||||
//ClassLoaderDataGraph::classes_do(&clean_weak_method_links);
|
||||
|
||||
- // Disable any dependent concurrent compilations
|
||||
- // SystemDictionary::notice_modification();
|
||||
-
|
||||
JvmtiExport::increment_redefinition_count();
|
||||
|
||||
- // Set flag indicating that some invariants are no longer true.
|
||||
- // See jvmtiExport.hpp for detailed explanation.
|
||||
-
|
||||
- // dcevm15: handled by _redefinition_count
|
||||
- // JvmtiExport::set_has_redefined_a_class();
|
||||
-
|
||||
#ifdef PRODUCT
|
||||
if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
|
||||
#endif
|
||||
@@ -1746,6 +1737,18 @@ void VM_EnhancedRedefineClasses::transfer_old_native_function_registrations(Inst
|
||||
transfer.transfer_registrations(_matching_old_methods, _matching_methods_length);
|
||||
}
|
||||
|
||||
+// First step is to walk the code cache for each class redefined and mark
|
||||
+// dependent methods. Wait until all classes are processed to deoptimize everything.
|
||||
+void VM_EnhancedRedefineClasses::mark_dependent_code(InstanceKlass* ik) {
|
||||
+ assert_locked_or_safepoint(Compile_lock);
|
||||
+
|
||||
+ // All dependencies have been recorded from startup or this is a second or
|
||||
+ // subsequent use of RedefineClasses
|
||||
+ if (0 && JvmtiExport::all_dependencies_are_recorded()) {
|
||||
+ CodeCache::mark_for_evol_deoptimization(ik);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
// DCEVM - it always deoptimizes everything! (because it is very difficult to find only correct dependencies)
|
||||
// Deoptimize all compiled code that depends on this class.
|
||||
//
|
||||
@@ -1762,33 +1765,21 @@ void VM_EnhancedRedefineClasses::transfer_old_native_function_registrations(Inst
|
||||
// subsequent calls to RedefineClasses need only throw away code
|
||||
// that depends on the class.
|
||||
//
|
||||
-void VM_EnhancedRedefineClasses::flush_dependent_code(InstanceKlass* k_h, TRAPS) {
|
||||
+void VM_EnhancedRedefineClasses::flush_dependent_code(TRAPS) {
|
||||
assert_locked_or_safepoint(Compile_lock);
|
||||
|
||||
// All dependencies have been recorded from startup or this is a second or
|
||||
// subsequent use of RedefineClasses
|
||||
// FIXME: for now, deoptimize all!
|
||||
- if (0 && k_h != NULL && JvmtiExport::all_dependencies_are_recorded()) {
|
||||
- CodeCache::flush_evol_dependents_on(k_h);
|
||||
- Klass* superCl = k_h->super();
|
||||
- // Deoptimize super classes since redefined class can has a new method override
|
||||
- while (superCl != NULL && !superCl->is_redefining()) {
|
||||
- CodeCache::flush_evol_dependents_on(InstanceKlass::cast(superCl));
|
||||
- superCl = superCl->super();
|
||||
+ if (0 && JvmtiExport::all_dependencies_are_recorded()) {
|
||||
+ int deopt = CodeCache::mark_dependents_for_evol_deoptimization();
|
||||
+ log_debug(redefine, class, nmethod)("Marked %d dependent nmethods for deopt", deopt);
|
||||
+ if (deopt != 0) {
|
||||
+ CodeCache::flush_evol_dependents();
|
||||
}
|
||||
} else {
|
||||
- CodeCache::mark_all_nmethods_for_deoptimization();
|
||||
-
|
||||
- ResourceMark rm(THREAD);
|
||||
- DeoptimizationMarker dm;
|
||||
-
|
||||
- // Deoptimize all activations depending on marked nmethods
|
||||
- Deoptimization::deoptimize_dependents();
|
||||
-
|
||||
- // Make the dependent methods not entrant
|
||||
- CodeCache::make_marked_nmethods_not_entrant();
|
||||
-
|
||||
- // From now on we know that the dependency information is complete
|
||||
+ CodeCache::mark_all_nmethods_for_evol_deoptimization();
|
||||
+ CodeCache::flush_evol_dependents();
|
||||
JvmtiExport::set_all_dependencies_are_recorded(true);
|
||||
}
|
||||
}
|
||||
@@ -1881,11 +1872,7 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
|
||||
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
|
||||
jvmti_breakpoints.clearall_in_class_at_safepoint(the_class);
|
||||
|
||||
- // DCEVM Deoptimization is always for whole java world, call only once after all classes are redefined
|
||||
- // Deoptimize all compiled code that depends on this class
|
||||
-// if (_max_redefinition_flags <= Klass::ModifyClass) {
|
||||
-// flush_dependent_code(the_class, THREAD);
|
||||
-// }
|
||||
+ mark_dependent_code(the_class);
|
||||
|
||||
_old_methods = the_class->methods();
|
||||
_new_methods = new_class->methods();
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index 0066088b3b0..bd5e7d153be 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -142,7 +142,9 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
// and in all direct and indirect subclasses.
|
||||
void increment_class_counter(InstanceKlass *ik, TRAPS);
|
||||
|
||||
- void flush_dependent_code(InstanceKlass* k_h, TRAPS);
|
||||
+ void mark_dependent_code(InstanceKlass* ik);
|
||||
+
|
||||
+ void flush_dependent_code(TRAPS);
|
||||
|
||||
u8 next_id();
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
From 4f88dcec830d39452f69d1117729469fdb768a8f Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 22 Nov 2020 12:05:26 +0100
|
||||
Subject: [PATCH 22/34] dcevm15 - fix ResolvedMethodTable
|
||||
|
||||
---
|
||||
src/hotspot/share/classfile/javaClasses.cpp | 5 -
|
||||
src/hotspot/share/classfile/javaClasses.hpp | 1 -
|
||||
.../share/prims/resolvedMethodTable.cpp | 139 +++++++++++-------
|
||||
3 files changed, 84 insertions(+), 61 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp
|
||||
index 9b086a241f7..9a627786d0f 100644
|
||||
--- a/src/hotspot/share/classfile/javaClasses.cpp
|
||||
+++ b/src/hotspot/share/classfile/javaClasses.cpp
|
||||
@@ -3996,11 +3996,6 @@ void java_lang_invoke_ResolvedMethodName::set_vmholder(oop resolved_method, oop
|
||||
resolved_method->obj_field_put(_vmholder_offset, holder);
|
||||
}
|
||||
|
||||
-void java_lang_invoke_ResolvedMethodName::set_vmholder_offset(oop resolved_method, Method* m) {
|
||||
- assert(is_instance(resolved_method), "wrong type");
|
||||
- resolved_method->obj_field_put(_vmholder_offset, m->method_holder()->java_mirror());
|
||||
-}
|
||||
-
|
||||
oop java_lang_invoke_ResolvedMethodName::find_resolved_method(const methodHandle& m, TRAPS) {
|
||||
const Method* method = m();
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp
|
||||
index 9abf2e1d105..8f5993b7225 100644
|
||||
--- a/src/hotspot/share/classfile/javaClasses.hpp
|
||||
+++ b/src/hotspot/share/classfile/javaClasses.hpp
|
||||
@@ -1107,7 +1107,6 @@ class java_lang_invoke_ResolvedMethodName : AllStatic {
|
||||
|
||||
static Method* vmtarget(oop resolved_method);
|
||||
static void set_vmtarget(oop resolved_method, Method* method);
|
||||
- static void set_vmholder_offset(oop resolved_method, Method* method);
|
||||
|
||||
static void set_vmholder(oop resolved_method, oop holder);
|
||||
|
||||
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
index eb9fcda44f3..d0f1667b967 100644
|
||||
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
|
||||
@@ -375,6 +375,67 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
+class AdjustMethodEntriesDcevm : public StackObj {
|
||||
+ bool* _trace_name_printed;
|
||||
+ GrowableArray<oop>* _oops_to_add;
|
||||
+public:
|
||||
+ AdjustMethodEntriesDcevm(GrowableArray<oop>* oops_to_add, bool* trace_name_printed) : _trace_name_printed(trace_name_printed), _oops_to_add(oops_to_add) {};
|
||||
+ bool operator()(WeakHandle<vm_resolved_method_table_data>* entry) {
|
||||
+ oop mem_name = entry->peek();
|
||||
+ if (mem_name == NULL) {
|
||||
+ // Removed
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ Method* old_method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(mem_name);
|
||||
+
|
||||
+ if (old_method->is_old()) {
|
||||
+
|
||||
+ InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
|
||||
+ Method* newer_method;
|
||||
+
|
||||
+ // Method* new_method;
|
||||
+ if (old_method->is_deleted()) {
|
||||
+ newer_method = Universe::throw_no_such_method_error();
|
||||
+ } else {
|
||||
+ newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
+
|
||||
+ log_debug(redefine, class, update)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
|
||||
+
|
||||
+ assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
|
||||
+ assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
+ assert(old_method != newer_method, "sanity check");
|
||||
+
|
||||
+ Thread* thread = Thread::current();
|
||||
+ ResolvedMethodTableLookup lookup(thread, method_hash(newer_method), newer_method);
|
||||
+ ResolvedMethodGet rmg(thread, newer_method);
|
||||
+
|
||||
+ if (_local_table->get(thread, lookup, rmg)) {
|
||||
+ // old method was already adjusted if new method exists in _the_table
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ java_lang_invoke_ResolvedMethodName::set_vmtarget(mem_name, newer_method);
|
||||
+ java_lang_invoke_ResolvedMethodName::set_vmholder(mem_name, newer_method->method_holder()->java_mirror());
|
||||
+
|
||||
+ newer_klass->set_has_resolved_methods();
|
||||
+ _oops_to_add->append(mem_name);
|
||||
+
|
||||
+ ResourceMark rm;
|
||||
+ if (!(*_trace_name_printed)) {
|
||||
+ log_debug(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
|
||||
+ *_trace_name_printed = true;
|
||||
+ }
|
||||
+ log_debug(redefine, class, update, constantpool)
|
||||
+ ("ResolvedMethod method update: %s(%s)",
|
||||
+ newer_method->name()->as_C_string(), newer_method->signature()->as_C_string());
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
// It is called at safepoint only for RedefineClasses
|
||||
void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
|
||||
@@ -382,73 +443,41 @@ void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
|
||||
AdjustMethodEntries adjust(trace_name_printed);
|
||||
_local_table->do_safepoint_scan(adjust);
|
||||
}
|
||||
-#endif // INCLUDE_JVMTI
|
||||
|
||||
-// (DCEVM) It is called at safepoint only for RedefineClasses
|
||||
+// It is called at safepoint only for RedefineClasses
|
||||
void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
|
||||
// For each entry in RMT, change to new method
|
||||
- GrowableArray<oop>* oops_to_add = new GrowableArray<oop>();
|
||||
-
|
||||
- for (int i = 0; i < _the_table->table_size(); ++i) {
|
||||
- for (ResolvedMethodEntry* entry = _the_table->bucket(i);
|
||||
- entry != NULL;
|
||||
- entry = entry->next()) {
|
||||
-
|
||||
- oop mem_name = entry->object_no_keepalive();
|
||||
- // except ones removed
|
||||
- if (mem_name == NULL) {
|
||||
- continue;
|
||||
- }
|
||||
- Method* old_method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(mem_name);
|
||||
-
|
||||
- if (old_method->is_old()) {
|
||||
-
|
||||
- InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
|
||||
- Method* newer_method;
|
||||
-
|
||||
- // Method* new_method;
|
||||
- if (old_method->is_deleted()) {
|
||||
- newer_method = Universe::throw_no_such_method_error();
|
||||
- } else {
|
||||
- newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
|
||||
-
|
||||
- log_debug(redefine, class, update)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
|
||||
-
|
||||
- assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
|
||||
- assert(newer_method != NULL, "method_with_idnum() should not be NULL");
|
||||
- assert(old_method != newer_method, "sanity check");
|
||||
-
|
||||
- if (_the_table->lookup(newer_method) != NULL) {
|
||||
- // old method was already adjusted if new method exists in _the_table
|
||||
- continue;
|
||||
- }
|
||||
- }
|
||||
+ GrowableArray<oop> oops_to_add(0);
|
||||
+ AdjustMethodEntriesDcevm adjust(&oops_to_add, trace_name_printed);
|
||||
+ _local_table->do_safepoint_scan(adjust);
|
||||
+ Thread* thread = Thread::current();
|
||||
+ for (int i = 0; i < oops_to_add.length(); i++) {
|
||||
+ oop mem_name = oops_to_add.at(i);
|
||||
+ Method* method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(mem_name);
|
||||
|
||||
- java_lang_invoke_ResolvedMethodName::set_vmtarget(mem_name, newer_method);
|
||||
- java_lang_invoke_ResolvedMethodName::set_vmholder_offset(mem_name, newer_method);
|
||||
+ // The hash table takes ownership of the WeakHandle, even if it's not inserted.
|
||||
|
||||
- newer_klass->set_has_resolved_methods();
|
||||
- oops_to_add->append(mem_name);
|
||||
+ ResolvedMethodTableLookup lookup(thread, method_hash(method), method);
|
||||
+ ResolvedMethodGet rmg(thread, method);
|
||||
|
||||
- ResourceMark rm;
|
||||
- if (!(*trace_name_printed)) {
|
||||
- log_debug(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
|
||||
- *trace_name_printed = true;
|
||||
- }
|
||||
- log_debug(redefine, class, update, constantpool)
|
||||
- ("ResolvedMethod method update: %s(%s)",
|
||||
- newer_method->name()->as_C_string(), newer_method->signature()->as_C_string());
|
||||
+ while (true) {
|
||||
+ if (_local_table->get(thread, lookup, rmg)) {
|
||||
+ break;
|
||||
+ }
|
||||
+ WeakHandle<vm_resolved_method_table_data> wh = WeakHandle<vm_resolved_method_table_data>::create(Handle(thread, mem_name));
|
||||
+ // The hash table takes ownership of the WeakHandle, even if it's not inserted.
|
||||
+ if (_local_table->insert(thread, lookup, wh)) {
|
||||
+ log_insert(method);
|
||||
+ wh.resolve();
|
||||
+ break;
|
||||
}
|
||||
- }
|
||||
- for (int i = 0; i < oops_to_add->length(); i++) {
|
||||
- oop mem_name = oops_to_add->at(i);
|
||||
- Method* method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(mem_name);
|
||||
- _the_table->basic_add(method, Handle(Thread::current(), mem_name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+#endif // INCLUDE_JVMTI
|
||||
+
|
||||
// Verification
|
||||
class VerifyResolvedMethod : StackObj {
|
||||
public:
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
From 5379e56465d3d3930ec7ea91b1c64db2cdf70170 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 22 Nov 2020 12:05:50 +0100
|
||||
Subject: [PATCH 23/34] dcevm15 - fix Universe::root_oops_do
|
||||
|
||||
---
|
||||
src/hotspot/share/memory/universe.cpp | 38 +++++++++------------------
|
||||
1 file changed, 12 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
|
||||
index f6e4253b5a5..8dad437bd51 100644
|
||||
--- a/src/hotspot/share/memory/universe.cpp
|
||||
+++ b/src/hotspot/share/memory/universe.cpp
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "gc/shared/gcConfig.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/shared/gcTraceTime.inline.hpp"
|
||||
+#include "gc/shared/weakProcessor.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "logging/logStream.hpp"
|
||||
@@ -75,6 +76,7 @@
|
||||
#include "runtime/thread.inline.hpp"
|
||||
#include "runtime/timerTrace.hpp"
|
||||
#include "runtime/vmOperations.hpp"
|
||||
+#include "services/management.hpp"
|
||||
#include "services/memoryService.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/copy.hpp"
|
||||
@@ -180,45 +182,29 @@ void Universe::basic_type_classes_do(KlassClosure *closure) {
|
||||
|
||||
// FIXME: (DCEVM) This method should iterate all pointers that are not within heap objects.
|
||||
void Universe::root_oops_do(OopClosure *oopClosure) {
|
||||
-
|
||||
- class AlwaysTrueClosure: public BoolObjectClosure {
|
||||
- public:
|
||||
- void do_object(oop p) { ShouldNotReachHere(); }
|
||||
- bool do_object_b(oop p) { return true; }
|
||||
- };
|
||||
- AlwaysTrueClosure always_true;
|
||||
-
|
||||
Universe::oops_do(oopClosure);
|
||||
// ReferenceProcessor::oops_do(oopClosure); (tw) check why no longer there
|
||||
JNIHandles::oops_do(oopClosure); // Global (strong) JNI handles
|
||||
Threads::oops_do(oopClosure, NULL);
|
||||
ObjectSynchronizer::oops_do(oopClosure);
|
||||
- // TODO: review, flat profiler was removed in j10
|
||||
- // FlatProfiler::oops_do(oopClosure);
|
||||
- JvmtiExport::oops_do(oopClosure);
|
||||
+ // (DCEVM) TODO: Check if this is correct?
|
||||
+ Management::oops_do(oopClosure);
|
||||
+ OopStorageSet::vm_global()->oops_do(oopClosure);
|
||||
+ CLDToOopClosure cld_closure(oopClosure, ClassLoaderData::_claim_none);
|
||||
+ ClassLoaderDataGraph::cld_do(&cld_closure);
|
||||
|
||||
// Now adjust pointers in remaining weak roots. (All of which should
|
||||
// have been cleared if they pointed to non-surviving objects.)
|
||||
// Global (weak) JNI handles
|
||||
- JNIHandles::weak_oops_do(&always_true, oopClosure);
|
||||
+ WeakProcessor::oops_do(oopClosure);
|
||||
|
||||
CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
|
||||
CodeCache::blobs_do(&blobClosure);
|
||||
- StringTable::oops_do(oopClosure);
|
||||
+ AOT_ONLY(AOTLoader::oops_do(oopClosure);)
|
||||
+ // StringTable::oops_do was removed in j15
|
||||
+ // StringTable::oops_do(oopClosure);
|
||||
|
||||
- // (DCEVM) TODO: Check if this is correct?
|
||||
- //CodeCache::scavenge_root_nmethods_oops_do(oopClosure);
|
||||
- //Management::oops_do(oopClosure);
|
||||
- //ref_processor()->weak_oops_do(&oopClosure);
|
||||
- //PSScavenge::reference_processor()->weak_oops_do(&oopClosure);
|
||||
-
|
||||
-#if INCLUDE_AOT
|
||||
- if (UseAOT) {
|
||||
- AOTLoader::oops_do(oopClosure);
|
||||
- }
|
||||
-#endif
|
||||
- // SO_AllClasses
|
||||
- SystemDictionary::oops_do(oopClosure);
|
||||
+ // PSScavenge::reference_processor()->weak_oops_do(oopClosure);
|
||||
}
|
||||
|
||||
void Universe::oops_do(OopClosure* f) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
From c6ea68e66d37d70739f7b0ee74131322b4526a68 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 22 Nov 2020 12:03:32 +0100
|
||||
Subject: [PATCH 24/34] Cleanup dcevm comments
|
||||
|
||||
---
|
||||
src/hotspot/share/classfile/classLoaderDataGraph.hpp | 2 +-
|
||||
src/hotspot/share/classfile/systemDictionary.hpp | 2 +-
|
||||
src/hotspot/share/gc/shared/gcConfig.cpp | 2 +-
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.hpp b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
|
||||
index f380aa3fa34..8ce94cccb47 100644
|
||||
--- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp
|
||||
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
|
||||
@@ -104,7 +104,7 @@ class ClassLoaderDataGraph : public AllStatic {
|
||||
|
||||
static void dictionary_classes_do(KlassClosure* klass_closure);
|
||||
|
||||
- // Enhanced class redefinition
|
||||
+ // (DCEVM) Enhanced class redefinition
|
||||
static void rollback_redefinition();
|
||||
|
||||
// VM_CounterDecay iteration support
|
||||
diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
index 931e655d631..1019dbd0d04 100644
|
||||
--- a/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
+++ b/src/hotspot/share/classfile/systemDictionary.hpp
|
||||
@@ -455,7 +455,7 @@ public:
|
||||
static bool is_well_known_klass(Symbol* class_name);
|
||||
#endif
|
||||
|
||||
- // Enhanced class redefinition
|
||||
+ // (DCEVM) Enhanced class redefinition
|
||||
static void remove_from_hierarchy(InstanceKlass* k);
|
||||
static void update_constraints_after_redefinition();
|
||||
|
||||
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
index 5c1a09390f1..23fbf715378 100644
|
||||
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
|
||||
@@ -99,7 +99,7 @@ void GCConfig::fail_if_non_included_gc_is_selected() {
|
||||
|
||||
void GCConfig::select_gc_ergonomically() {
|
||||
if (AllowEnhancedClassRedefinition && !UseG1GC) {
|
||||
- // Enhanced class redefinition only supports serial GC at the moment
|
||||
+ // (DCEVM) Enhanced class redefinition only supports serial GC at the moment
|
||||
FLAG_SET_ERGO(UseSerialGC, true);
|
||||
} else if (os::is_server_class_machine()) {
|
||||
#if INCLUDE_G1GC
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
index bd5e7d153be..5de375fb888 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
|
||||
@@ -78,7 +78,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
|
||||
// have any entries.
|
||||
bool _any_class_has_resolved_methods;
|
||||
|
||||
- // Enhanced class redefinition, affected klasses contain all classes which should be redefined
|
||||
+ // (DCEVM) Enhanced class redefinition, affected klasses contain all classes which should be redefined
|
||||
// either because of redefine, class hierarchy or interface change
|
||||
GrowableArray<Klass*>* _affected_klasses;
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 507d97966c7145d0ae2533459cc504c7b0d6d5b6 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 22 Nov 2020 18:49:05 +0100
|
||||
Subject: [PATCH 25/34] Fix cpCache in not AllowEnhancedClassRedefinition mode
|
||||
|
||||
---
|
||||
src/hotspot/share/oops/cpCache.hpp | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/cpCache.hpp b/src/hotspot/share/oops/cpCache.hpp
|
||||
index 121a13b1dda..64dcf6223f5 100644
|
||||
--- a/src/hotspot/share/oops/cpCache.hpp
|
||||
+++ b/src/hotspot/share/oops/cpCache.hpp
|
||||
@@ -148,13 +148,13 @@ class ConstantPoolCacheEntry {
|
||||
void set_bytecode_2(Bytecodes::Code code);
|
||||
void set_f1(Metadata* f1) {
|
||||
Metadata* existing_f1 = _f1; // read once
|
||||
- //assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change");
|
||||
+ assert(AllowEnhancedClassRedefinition || existing_f1 == NULL || existing_f1 == f1, "illegal field change");
|
||||
_f1 = f1;
|
||||
}
|
||||
void release_set_f1(Metadata* f1);
|
||||
void set_f2(intx f2) {
|
||||
intx existing_f2 = _f2; // read once
|
||||
- //assert(existing_f2 == 0 || existing_f2 == f2, "illegal field change");
|
||||
+ assert(AllowEnhancedClassRedefinition || existing_f2 == 0 || existing_f2 == f2, "illegal field change");
|
||||
_f2 = f2;
|
||||
}
|
||||
void set_f2_as_vfinal_method(Method* f2) {
|
||||
@@ -215,7 +215,9 @@ class ConstantPoolCacheEntry {
|
||||
void initialize_resolved_reference_index(int ref_index) {
|
||||
assert(_f2 == 0, "set once"); // note: ref_index might be zero also
|
||||
_f2 = ref_index;
|
||||
- _flags = 1 << is_resolved_ref_shift;
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ _flags = 1 << is_resolved_ref_shift;
|
||||
+ }
|
||||
}
|
||||
|
||||
void set_field( // sets entry to resolved field state
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From b516b615c20fafa2094dfb9f4cb08245b26418d0 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 22 Nov 2020 19:51:46 +0100
|
||||
Subject: [PATCH 26/34] dcevm15 - add ClassLoaderDataGraph_lock on
|
||||
ClassLoaderDataGraph::classes_do
|
||||
|
||||
ClassLoaderDataGraph::classes_do need safepoint or lock,
|
||||
find_sorted_affected_classes is not in safepoint therefore it must be
|
||||
locked
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index efaf11e1666..197e1c0029f 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -2063,7 +2063,10 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
|
||||
AffectedKlassClosure closure(_affected_klasses);
|
||||
// Updated in j10, from original SystemDictionary::classes_do
|
||||
|
||||
- ClassLoaderDataGraph::classes_do(&closure);
|
||||
+ {
|
||||
+ MutexLocker mcld(ClassLoaderDataGraph_lock);
|
||||
+ ClassLoaderDataGraph::classes_do(&closure);
|
||||
+ }
|
||||
//ClassLoaderDataGraph::dictionary_classes_do(&closure);
|
||||
|
||||
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From c6498946006879314bdc6218ee72da5d9c88f237 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sat, 28 Nov 2020 19:29:42 +0100
|
||||
Subject: [PATCH 27/34] dcevm15 - check if has_nestmate_access_to has newest
|
||||
host class
|
||||
|
||||
---
|
||||
src/hotspot/share/oops/instanceKlass.cpp | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
index 5e40d78a87e..1d9623f2446 100644
|
||||
--- a/src/hotspot/share/oops/instanceKlass.cpp
|
||||
+++ b/src/hotspot/share/oops/instanceKlass.cpp
|
||||
@@ -445,6 +445,11 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (AllowEnhancedClassRedefinition) {
|
||||
+ // TODO: (DCEVM) check if it correct. It fix problems with lambdas (hidden)
|
||||
+ cur_host = InstanceKlass::cast(cur_host->newest_version());
|
||||
+ }
|
||||
+
|
||||
Klass* k_nest_host = k->nest_host(CHECK_false);
|
||||
if (k_nest_host == NULL) {
|
||||
return false;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From 86c27155386c1c40642c99c63a242d1f5d8601a5 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sat, 28 Nov 2020 19:31:08 +0100
|
||||
Subject: [PATCH 28/34] Remove unused fieldType
|
||||
|
||||
---
|
||||
src/hotspot/share/classfile/vmSymbols.hpp | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
index 6a3b234b222..eb06684a288 100644
|
||||
--- a/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
+++ b/src/hotspot/share/classfile/vmSymbols.hpp
|
||||
@@ -465,7 +465,6 @@
|
||||
template(static_offset_name, "staticOffset") \
|
||||
template(static_base_name, "staticBase") \
|
||||
template(field_offset_name, "fieldOffset") \
|
||||
- template(field_type_name, "fieldType") \
|
||||
\
|
||||
/* name symbols needed by intrinsics */ \
|
||||
\
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From 025d0d2903963fb79f83cf0d90418783d3ef6813 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 29 Nov 2020 17:18:16 +0100
|
||||
Subject: [PATCH 29/34] mark_as_scavengable only alive methods
|
||||
|
||||
---
|
||||
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index 197e1c0029f..e00fac1f693 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -223,19 +223,21 @@ class FieldCopier : public FieldClosure {
|
||||
|
||||
// TODO: review...
|
||||
void VM_EnhancedRedefineClasses::mark_as_scavengable(nmethod* nm) {
|
||||
- ScavengableNMethods::register_nmethod(nm);
|
||||
+ if (nm->is_alive()) {
|
||||
+ ScavengableNMethods::register_nmethod(nm);
|
||||
+ }
|
||||
}
|
||||
|
||||
void VM_EnhancedRedefineClasses::unregister_nmethod_g1(nmethod* nm) {
|
||||
// It should work not only for G1 but also for another GCs, but this way is safer now
|
||||
- if (!nm->is_zombie() && !nm->is_unloaded()) {
|
||||
+ if (nm->is_alive()) {
|
||||
Universe::heap()->unregister_nmethod(nm);
|
||||
}
|
||||
}
|
||||
|
||||
void VM_EnhancedRedefineClasses::register_nmethod_g1(nmethod* nm) {
|
||||
// It should work not only for G1 but also for another GCs, but this way is safer now
|
||||
- if (!nm->is_zombie() && !nm->is_unloaded()) {
|
||||
+ if (nm->is_alive()) {
|
||||
Universe::heap()->register_nmethod(nm);
|
||||
}
|
||||
}
|
||||
@@ -511,9 +513,9 @@ void VM_EnhancedRedefineClasses::doit() {
|
||||
flush_dependent_code(thread);
|
||||
// }
|
||||
|
||||
- // Adjust constantpool caches for all classes that reference methods of the evolved class.
|
||||
- ClearCpoolCacheAndUnpatch clear_cpool_cache(thread);
|
||||
- ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
|
||||
+ // Adjust constantpool caches for all classes that reference methods of the evolved class.
|
||||
+ ClearCpoolCacheAndUnpatch clear_cpool_cache(thread);
|
||||
+ ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
|
||||
|
||||
// JSR-292 support
|
||||
if (_any_class_has_resolved_methods) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 27aabfefe7d799545049bb81ba19d4ed2ff6379c Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 29 Nov 2020 17:20:11 +0100
|
||||
Subject: [PATCH 30/34] dcevm15 - lock on
|
||||
ClassLoaderDataGraph::rollback_redefinition
|
||||
|
||||
rollback is not in safepoint, therefore must be locked
|
||||
---
|
||||
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index e00fac1f693..db5fb1c472b 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -1382,7 +1382,9 @@ void VM_EnhancedRedefineClasses::calculate_instance_update_information(Klass* ne
|
||||
// Rollback all changes - clear new classes from the system dictionary, return old classes to directory, free memory.
|
||||
void VM_EnhancedRedefineClasses::rollback() {
|
||||
log_info(redefine, class, load)("Rolling back redefinition, result=%d", _res);
|
||||
+ ClassLoaderDataGraph_lock->lock();
|
||||
ClassLoaderDataGraph::rollback_redefinition();
|
||||
+ ClassLoaderDataGraph_lock->unlock();
|
||||
|
||||
for (int i = 0; i < _new_classes->length(); i++) {
|
||||
SystemDictionary::remove_from_hierarchy(_new_classes->at(i));
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 9b405cb642d5935c39c8dbd522ea2fdecfc29ef3 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 29 Nov 2020 19:59:50 +0100
|
||||
Subject: [PATCH 31/34] ResourceMark in G1IterateObjectClosureTask fixing
|
||||
memory leaks
|
||||
|
||||
G1IterateObjectClosureTask is used only in redefinition full GC run
|
||||
---
|
||||
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
index a29d2dddc2d..2af6df6c1e4 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
@@ -2362,6 +2362,9 @@ class G1IterateObjectClosureTask : public AbstractGangTask {
|
||||
_cl(cl), _g1h(g1h), _hrclaimer(g1h->workers()->active_workers()) { }
|
||||
|
||||
virtual void work(uint worker_id) {
|
||||
+ Thread *thread = Thread::current();
|
||||
+ HandleMark hm(thread); // make sure any handles created are deleted
|
||||
+ ResourceMark rm(thread);
|
||||
IterateObjectClosureRegionClosure blk(_cl);
|
||||
_g1h->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
From 40fe40884d4efc50864bb3f2dd88f0a2e7122d5a Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 29 Nov 2020 20:05:03 +0100
|
||||
Subject: [PATCH 32/34] dcevm15 - fix hidded classes
|
||||
|
||||
---
|
||||
.../prims/jvmtiEnhancedRedefineClasses.cpp | 41 ++++++++++++++-----
|
||||
1 file changed, 30 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
index db5fb1c472b..590f7fdfafe 100644
|
||||
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
|
||||
@@ -722,7 +722,8 @@ bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
|
||||
}
|
||||
|
||||
// Cannot redefine or retransform an anonymous class.
|
||||
- if (InstanceKlass::cast(k)->is_unsafe_anonymous()) {
|
||||
+ // TODO: check if is correct in j15
|
||||
+ if (InstanceKlass::cast(k)->is_unsafe_anonymous() || InstanceKlass::cast(k)->is_hidden()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -808,21 +809,27 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
|
||||
|
||||
InstanceKlass* k;
|
||||
|
||||
- if (InstanceKlass::cast(the_class)->is_unsafe_anonymous()) {
|
||||
- const InstanceKlass* host_class = the_class->unsafe_anonymous_host();
|
||||
+ if (the_class->is_unsafe_anonymous() || the_class->is_hidden()) {
|
||||
+ InstanceKlass* dynamic_host_class = NULL;
|
||||
+ InstanceKlass* unsafe_anonymous_host = NULL;
|
||||
|
||||
- // Make sure it's the real host class, not another anonymous class.
|
||||
- while (host_class != NULL && host_class->is_unsafe_anonymous()) {
|
||||
- host_class = host_class->unsafe_anonymous_host();
|
||||
+ if (the_class->is_hidden()) {
|
||||
+ log_debug(redefine, class, load)("loading hidden class %s", the_class->name()->as_C_string());
|
||||
+ dynamic_host_class = the_class->nest_host(THREAD);
|
||||
+ }
|
||||
+
|
||||
+ if (the_class->is_unsafe_anonymous()) {
|
||||
+ log_debug(redefine, class, load)("loading usafe anonymous %s", the_class->name()->as_C_string());
|
||||
+ unsafe_anonymous_host = the_class->unsafe_anonymous_host();
|
||||
}
|
||||
|
||||
ClassLoadInfo cl_info(protection_domain,
|
||||
- host_class,
|
||||
- NULL, // dynamic_nest_host
|
||||
+ unsafe_anonymous_host,
|
||||
NULL, // cp_patches
|
||||
+ dynamic_host_class, // dynamic_nest_host
|
||||
Handle(), // classData
|
||||
- false, // is_hidden
|
||||
- false, // is_strong_hidden
|
||||
+ the_class->is_hidden(), // is_hidden
|
||||
+ !the_class->is_non_strong_hidden(), // is_strong_hidden
|
||||
true); // FIXME: check if correct. can_access_vm_annotations
|
||||
|
||||
k = SystemDictionary::parse_stream(the_class_sym,
|
||||
@@ -833,7 +840,17 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
|
||||
THREAD);
|
||||
|
||||
k->class_loader_data()->exchange_holders(the_class->class_loader_data());
|
||||
- the_class->class_loader_data()->inc_keep_alive();
|
||||
+
|
||||
+ if (the_class->is_hidden()) {
|
||||
+ // from jvm_lookup_define_class() (jvm.cpp):
|
||||
+ // The hidden class loader data has been artificially been kept alive to
|
||||
+ // this point. The mirror and any instances of this class have to keep
|
||||
+ // it alive afterwards.
|
||||
+ the_class->class_loader_data()->dec_keep_alive();
|
||||
+ } else {
|
||||
+ the_class->class_loader_data()->inc_keep_alive();
|
||||
+ }
|
||||
+
|
||||
} else {
|
||||
k = SystemDictionary::resolve_from_stream(the_class_sym,
|
||||
the_class_loader,
|
||||
@@ -1475,6 +1492,8 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
|
||||
ik->set_unsafe_anonymous_host(InstanceKlass::cast(ik->unsafe_anonymous_host()->newest_version()));
|
||||
}
|
||||
|
||||
+ // FIXME: check new nest_host for hidden
|
||||
+
|
||||
// Update implementor if there is only one, in this case implementor() can reference old class
|
||||
if (ik->is_interface()) {
|
||||
Klass* implKlass = ik->implementor();
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 29920b076b4ad96d85adbce0a1d947e5022ba3ad Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 29 Nov 2020 20:08:57 +0100
|
||||
Subject: [PATCH 33/34] dcevm15 - DON'T clear F2 in CP cache after indy
|
||||
unevolving
|
||||
|
||||
It's not clear why it was cleared in dcevm7-11
|
||||
---
|
||||
src/hotspot/share/oops/cpCache.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp
|
||||
index 79a38dbeff0..650e6fab42d 100644
|
||||
--- a/src/hotspot/share/oops/cpCache.cpp
|
||||
+++ b/src/hotspot/share/oops/cpCache.cpp
|
||||
@@ -650,7 +650,7 @@ void ConstantPoolCacheEntry::clear_entry() {
|
||||
|
||||
if (clearData) {
|
||||
if (!is_resolved_reference()) {
|
||||
- _f2 = 0;
|
||||
+ // _f2 = 0;
|
||||
}
|
||||
// FIXME: (DCEVM) we want to clear flags, but parameter size is actually used
|
||||
// after we return from the method, before entry is re-initialized. So let's
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From 1f13b20ab5553182680045b7d7324ff92da7e7f0 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
|
||||
Date: Sun, 29 Nov 2020 21:28:06 +0100
|
||||
Subject: [PATCH 34/34] dcevm15 - fix Universe::root_oops_do
|
||||
|
||||
Removed ClassLoaderDataGraph::cld_do was cause of crashes due multiple
|
||||
oop patching. ClassLoaderDataGraph::cld_do replaced in dcevm15
|
||||
previously used and removed SystemDictionary:oops_do
|
||||
---
|
||||
src/hotspot/share/memory/universe.cpp | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
|
||||
index 8dad437bd51..0199962a684 100644
|
||||
--- a/src/hotspot/share/memory/universe.cpp
|
||||
+++ b/src/hotspot/share/memory/universe.cpp
|
||||
@@ -190,21 +190,26 @@ void Universe::root_oops_do(OopClosure *oopClosure) {
|
||||
// (DCEVM) TODO: Check if this is correct?
|
||||
Management::oops_do(oopClosure);
|
||||
OopStorageSet::vm_global()->oops_do(oopClosure);
|
||||
- CLDToOopClosure cld_closure(oopClosure, ClassLoaderData::_claim_none);
|
||||
- ClassLoaderDataGraph::cld_do(&cld_closure);
|
||||
+ // CLDToOopClosure cld_closure(oopClosure, ClassLoaderData::_claim_none);
|
||||
+ // ClassLoaderDataGraph::cld_do(&cld_closure);
|
||||
|
||||
// Now adjust pointers in remaining weak roots. (All of which should
|
||||
// have been cleared if they pointed to non-surviving objects.)
|
||||
// Global (weak) JNI handles
|
||||
WeakProcessor::oops_do(oopClosure);
|
||||
|
||||
+ JvmtiExport::oops_do(oopClosure);
|
||||
+
|
||||
CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
|
||||
CodeCache::blobs_do(&blobClosure);
|
||||
+
|
||||
AOT_ONLY(AOTLoader::oops_do(oopClosure);)
|
||||
+
|
||||
// StringTable::oops_do was removed in j15
|
||||
// StringTable::oops_do(oopClosure);
|
||||
|
||||
- // PSScavenge::reference_processor()->weak_oops_do(oopClosure);
|
||||
+ // OopStorageSet::vm_global()->oops_do(oopClosure);
|
||||
+
|
||||
}
|
||||
|
||||
void Universe::oops_do(OopClosure* f) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
119
jb/project/tools/windows/scripts/mkimages_x64.sh
Executable file
119
jb/project/tools/windows/scripts/mkimages_x64.sh
Executable file
@@ -0,0 +1,119 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
|
||||
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# <empty> or nomod - the release bundles without any additional modules (jcef)
|
||||
# jcef - the release bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
# Environment variables:
|
||||
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
|
||||
# By default JCEF binaries should be located in ./jcef_win_x64
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
WORK_DIR=$(pwd)
|
||||
JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_x64}
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
function create_image_bundle {
|
||||
__bundle_name=$1
|
||||
__modules_path=$2
|
||||
__modules=$3
|
||||
|
||||
[ -d $__bundle_name ] && rm -rf $__bundle_name
|
||||
|
||||
echo Running jlink ...
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path $__modules_path --no-man-pages --compress=2 \
|
||||
--add-modules $__modules --output $__bundle_name || do_exit $?
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__bundle_name/release
|
||||
if [ "$__bundle_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__bundle_name/release > release
|
||||
mv release $__bundle_name/release
|
||||
fi
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
RELEASE_NAME=windows-x86_64-server-release
|
||||
|
||||
case "$bundle_type" in
|
||||
"jcef")
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"dcevm")
|
||||
HEAD_REVISION=$(git rev-parse HEAD)
|
||||
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
|
||||
do_reset_dcevm=1
|
||||
do_reset_changes=1
|
||||
;;
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
do_reset_changes=1
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
|
||||
RELEASE_NAME=windows-x86_64-server-fastdebug
|
||||
;;
|
||||
esac
|
||||
|
||||
sh ./configure \
|
||||
--disable-warnings-as-errors \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=$JDK_BUILD_NUMBER \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || do_exit $?
|
||||
|
||||
if [ -z "$bundle_type" ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JSDK_MODS_DIR=$IMAGES_DIR/jmods
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
|
||||
update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
|
||||
cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
fi
|
||||
|
||||
# create runtime image bundle
|
||||
modules=$(xargs < modules.list | sed s/" "//g) || do_exit $?
|
||||
create_image_bundle "jbr${jbr_name_postfix}" $JSDK_MODS_DIR "$modules" || do_exit $?
|
||||
|
||||
# create sdk image bundle
|
||||
modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/,/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g)
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
|
||||
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
|
||||
|
||||
do_exit 0
|
||||
63
jb/project/tools/windows/scripts/mkimages_x86.sh
Executable file
63
jb/project/tools/windows/scripts/mkimages_x86.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
|
||||
WORK_DIR=$(pwd)
|
||||
|
||||
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
|
||||
|
||||
PATH="/usr/local/bin:/usr/bin:${PATH}"
|
||||
./configure \
|
||||
--disable-warnings-as-errors \
|
||||
--with-target-bits=32 \
|
||||
--with-vendor-name="${VENDOR_NAME}" \
|
||||
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
|
||||
--with-version-pre= \
|
||||
--with-version-build=${JDK_BUILD_NUMBER} \
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=${TOOLCHAIN_VERSION} \
|
||||
--with-boot-jdk=${BOOT_JDK} \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes || exit 1
|
||||
make clean CONF=windows-x86-server-release || exit 1
|
||||
make LOG=info images CONF=windows-x86-server-release test-image || exit 1
|
||||
|
||||
JBSDK=${JBRSDK_BASE_NAME}-windows-x86-b${build_number}
|
||||
BASE_DIR=build/windows-x86-server-release/images
|
||||
JSDK=${BASE_DIR}/jdk
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
|
||||
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
|
||||
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
|
||||
mv release ${JBRSDK_BUNDLE}/release
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
rm -rf ${JBR_BUNDLE}
|
||||
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
|
||||
${JSDK}/bin/jlink \
|
||||
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
|
||||
--add-modules $(xargs < modules.list.x86 | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
|
||||
|
||||
echo Modifying release info ...
|
||||
#grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release
|
||||
77
jb/project/tools/windows/scripts/pack_x64.sh
Executable file
77
jb/project/tools/windows/scripts/pack_x64.sh
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
|
||||
# JDK_BUILD_NUMBER - specifies udate release of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
# bundle_type - specifies bundle to be built; possible values:
|
||||
# <empty> or nomod - the bundles without any additional modules (jcef)
|
||||
# jcef - the bundles with jcef
|
||||
# fd - the fastdebug bundles which also include the jcef module
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
bundle_type=$4
|
||||
|
||||
function pack_jbr {
|
||||
|
||||
if [ -z "${bundle_type}" ]; then
|
||||
JBR_BUNDLE=jbr
|
||||
else
|
||||
JBR_BUNDLE=jbr_${bundle_type}
|
||||
[ -d ${BASE_DIR}/jbr ] && rm -rf ${BASE_DIR}/jbr
|
||||
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
|
||||
fi
|
||||
JBR_BASE_NAME=${JBR_BUNDLE}-${JBSDK_VERSION}
|
||||
|
||||
JBR=$JBR_BASE_NAME-windows-x64-b$build_number
|
||||
echo Creating $JBR.tar.gz ...
|
||||
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || do_exit $?
|
||||
}
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
RELEASE_NAME=windows-x86_64-server-release
|
||||
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-b${build_number}
|
||||
case "$bundle_type" in
|
||||
"nomod" | "")
|
||||
bundle_type=""
|
||||
;;
|
||||
"fd")
|
||||
RELEASE_NAME=macosx-x86_64-server-fastdebug
|
||||
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-fastdebug-b${build_number}
|
||||
;;
|
||||
esac
|
||||
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JBSDK=$JBRSDK_BASE_NAME-windows-x64-b$build_number
|
||||
BASE_DIR=.
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
[ -f "$JBSDK.tar.gz" ] && rm "$JBSDK.tar.gz"
|
||||
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || do_exit $?
|
||||
fi
|
||||
|
||||
pack_jbr $bundle_type
|
||||
|
||||
if [ -z "$bundle_type" ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x64-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
42
jb/project/tools/windows/scripts/pack_x86.sh
Executable file
42
jb/project/tools/windows/scripts/pack_x86.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# The following parameters must be specified:
|
||||
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
|
||||
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
|
||||
# build_number - specifies the number of JetBrainsRuntime build
|
||||
#
|
||||
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
|
||||
#
|
||||
# $ ./java --version
|
||||
# openjdk 11.0.6 2020-01-14
|
||||
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
|
||||
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
|
||||
#
|
||||
|
||||
JBSDK_VERSION=$1
|
||||
JDK_BUILD_NUMBER=$2
|
||||
build_number=$3
|
||||
|
||||
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
|
||||
JBR_BASE_NAME=jbr-$JBSDK_VERSION
|
||||
|
||||
IMAGES_DIR=build/windows-x86-server-release/images
|
||||
JSDK=$IMAGES_DIR/jdk
|
||||
JBSDK=$JBRSDK_BASE_NAME-windows-x86-b$build_number
|
||||
BASE_DIR=.
|
||||
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
echo Creating $JBSDK.tar.gz ...
|
||||
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
|
||||
|
||||
JBR_BUNDLE=jbr
|
||||
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
|
||||
|
||||
JBR=$JBR_BASE_NAME-windows-x86-b$build_number
|
||||
echo Creating $JBR.tar.gz ...
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR ${JBR_BUNDLE} || exit 1
|
||||
|
||||
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x86-b$build_number
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || exit 1
|
||||
@@ -103,8 +103,8 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-troff-manpage-filter.sh.template, \
|
||||
OUTPUT_FILE := $(PANDOC_TROFF_MANPAGE_FILTER), \
|
||||
REPLACEMENTS := \
|
||||
@@JJS@@ => $(JJS) ; \
|
||||
@@TOPDIR@@ => $(TOPDIR) ; \
|
||||
@@JAVA_SMALL@@ => $(JAVA_SMALL) ; \
|
||||
@@BUILDTOOLS_OUTPUTDIR@@ => $(BUILDTOOLS_OUTPUTDIR) ; \
|
||||
))
|
||||
|
||||
# Created script must be made executable
|
||||
@@ -126,8 +126,8 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-html-manpage-filter.sh.template, \
|
||||
OUTPUT_FILE := $(PANDOC_HTML_MANPAGE_FILTER), \
|
||||
REPLACEMENTS := \
|
||||
@@JJS@@ => $(JJS) ; \
|
||||
@@TOPDIR@@ => $(TOPDIR) ; \
|
||||
@@JAVA_SMALL@@ => $(JAVA_SMALL) ; \
|
||||
@@BUILDTOOLS_OUTPUTDIR@@ => $(BUILDTOOLS_OUTPUTDIR) ; \
|
||||
))
|
||||
|
||||
# Created script must be made executable
|
||||
|
||||
@@ -610,9 +610,9 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
# PANDOC_HTML_MANPAGE_FILTER, a wrapper around
|
||||
# PANDOC_HTML_MANPAGE_FILTER_JAVASCRIPT. This is created by buildtools-jdk.
|
||||
|
||||
# We should also depend on the source javascript filter
|
||||
PANDOC_HTML_MANPAGE_FILTER_JAVASCRIPT := \
|
||||
$(TOPDIR)/make/scripts/pandoc-html-manpage-filter.js
|
||||
# We should also depend on the source code for the filter
|
||||
PANDOC_HTML_MANPAGE_FILTER_SOURCE := $(call FindFiles, \
|
||||
$(TOPDIR)/make/jdk/src/classes/build/tools/pandocfilter)
|
||||
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval MAN_$m := $(call FindModuleManDirs, $m)) \
|
||||
@@ -632,7 +632,7 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
OPTIONS := --toc -V include-before='$(SPECS_TOP)' -V include-after='$(SPECS_BOTTOM_1)', \
|
||||
POST_PROCESS := $(TOOL_FIXUPPANDOC), \
|
||||
EXTRA_DEPS := $(PANDOC_HTML_MANPAGE_FILTER) \
|
||||
$(PANDOC_HTML_MANPAGE_FILTER_JAVASCRIPT), \
|
||||
$(PANDOC_HTML_MANPAGE_FILTER_SOURCE), \
|
||||
)) \
|
||||
$(eval JDK_SPECS_TARGETS += $($($m_$f_NAME))) \
|
||||
) \
|
||||
|
||||
@@ -69,10 +69,12 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
|
||||
-Duser.language=en -Duser.country=US \
|
||||
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
|
||||
build.tools.classlist.HelloClasslist $(LOG_DEBUG)
|
||||
$(GREP) -v HelloClasslist $@.raw > $(INTERIM_IMAGE_DIR)/lib/classlist
|
||||
$(GREP) -v HelloClasslist $@.raw > $@.interim
|
||||
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
|
||||
-Xmx128M -Xms128M $(LOG_INFO)
|
||||
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \
|
||||
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw.2 \
|
||||
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
|
||||
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
|
||||
-Duser.language=en -Duser.country=US \
|
||||
--module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \
|
||||
@@ -86,7 +88,7 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
|
||||
$(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \
|
||||
exit $$exitcode \
|
||||
)
|
||||
$(GREP) -v HelloClasslist $@.raw > $@
|
||||
$(GREP) -v HelloClasslist $@.raw.2 > $@
|
||||
|
||||
# The jli trace is created by the same recipe as classlist. By declaring these
|
||||
# dependencies, make will correctly rebuild both jli trace and classlist
|
||||
|
||||
@@ -372,6 +372,10 @@ else # $(HAS_SPEC)=true
|
||||
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
|
||||
endif
|
||||
PATCH_DRY_RUN := $$(shell cd $$(topdir) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
|
||||
ifeq ($$(PATCH_DRY_RUN), FAILED)
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
|
||||
endif
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_FAIL), true)
|
||||
COMPARE_BUILD_IGNORE_RESULT := || true
|
||||
|
||||
@@ -217,7 +217,7 @@ $(eval $(call DeclareRecipesForPhase, STATIC_LIBS, \
|
||||
TARGET_SUFFIX := static-libs, \
|
||||
FILE_PREFIX := Lib, \
|
||||
MAKE_SUBDIR := lib, \
|
||||
CHECK_MODULES := $(STATIC_LIBS_MODULES), \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
EXTRA_ARGS := STATIC_LIBS=true, \
|
||||
))
|
||||
|
||||
@@ -640,6 +640,18 @@ $(eval $(call SetupTarget, test-image-jdk-jtreg-native, \
|
||||
DEPS := build-test-jdk-jtreg-native, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, build-test-libtest-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeLibTest, \
|
||||
TARGET := build-test-libtest-jtreg-native, \
|
||||
DEPS := buildtools-jdk, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, test-image-libtest-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeLibTest, \
|
||||
TARGET := test-image-libtest-jtreg-native, \
|
||||
DEPS := build-test-libtest-jtreg-native, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, build-test-hotspot-jtreg-graal, \
|
||||
MAKEFILE := test/JtregGraalUnit, \
|
||||
TARGET := build-test-hotspot-jtreg-graal, \
|
||||
@@ -652,7 +664,7 @@ $(eval $(call SetupTarget, test-image-hotspot-jtreg-graal, \
|
||||
DEPS := build-test-hotspot-jtreg-graal, \
|
||||
))
|
||||
|
||||
ifneq ($GTEST_FRAMEWORK_SRC), )
|
||||
ifneq ($(GTEST_FRAMEWORK_SRC), )
|
||||
$(eval $(call SetupTarget, test-image-hotspot-gtest, \
|
||||
MAKEFILE := hotspot/test/GtestImage, \
|
||||
DEPS := hotspot, \
|
||||
@@ -798,10 +810,14 @@ else
|
||||
|
||||
# If not already set, set the JVM variant target so that the JVM will be built.
|
||||
JVM_MAIN_LIB_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-libs
|
||||
JVM_MAIN_GENSRC_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc
|
||||
|
||||
# Building one JVM variant is enough to start building the other libs
|
||||
$(LIBS_TARGETS): $(JVM_MAIN_LIB_TARGETS)
|
||||
|
||||
# Static libs depend on hotspot gensrc
|
||||
$(STATIC_LIBS_TARGETS): $(JVM_MAIN_GENSRC_TARGETS)
|
||||
|
||||
$(LAUNCHER_TARGETS): java.base-libs
|
||||
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
@@ -978,6 +994,7 @@ else
|
||||
interim-image: $(INTERIM_JMOD_TARGETS)
|
||||
|
||||
build-test-hotspot-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs
|
||||
build-test-libtest-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs
|
||||
|
||||
endif
|
||||
|
||||
@@ -1101,7 +1118,7 @@ endif
|
||||
docs-image: docs-jdk
|
||||
|
||||
# This target builds the test image
|
||||
test-image: prepare-test-image test-image-jdk-jtreg-native test-image-demos-jdk
|
||||
test-image: prepare-test-image test-image-jdk-jtreg-native test-image-demos-jdk test-image-libtest-jtreg-native
|
||||
|
||||
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
|
||||
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the
|
||||
|
||||
@@ -342,11 +342,13 @@ hotspot_JTREG_MAX_MEM := 0
|
||||
hotspot_JTREG_ASSERT := false
|
||||
hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native
|
||||
jdk_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/jdk/jtreg/native
|
||||
lib-test_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/lib-test/jtreg/native
|
||||
|
||||
jdk_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jdk/ProblemList.txt
|
||||
jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt
|
||||
langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
|
||||
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
|
||||
lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt
|
||||
|
||||
langtools_JTREG_MAX_MEM := 768m
|
||||
|
||||
@@ -687,13 +689,15 @@ define SetupRunMicroTestBody
|
||||
$1_MICRO_BASIC_OPTIONS += -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
|
||||
endif
|
||||
|
||||
# Set library path for native dependencies
|
||||
$1_JMH_JVM_ARGS := -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
|
||||
|
||||
ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
|
||||
JMH_JVM_ARGS := $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
|
||||
# Set library path for native dependencies
|
||||
JMH_JVM_ARGS += -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
|
||||
$1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$(JMH_JVM_ARGS))
|
||||
$1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
|
||||
endif
|
||||
|
||||
$1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$($1_JMH_JVM_ARGS))
|
||||
|
||||
ifneq ($$(MICRO_ITER), )
|
||||
$1_MICRO_ITER := -i $$(MICRO_ITER)
|
||||
endif
|
||||
|
||||
@@ -32,11 +32,13 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Modules.gmk
|
||||
|
||||
ALL_MODULES = $(call FindAllModules)
|
||||
|
||||
################################################################################
|
||||
|
||||
TARGETS :=
|
||||
|
||||
$(foreach m, $(STATIC_LIBS_MODULES), \
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval $(call SetupCopyFiles, COPY_STATIC_LIBS_$m, \
|
||||
FLATTEN := true, \
|
||||
SRC := $(SUPPORT_OUTPUTDIR)/native/$m, \
|
||||
|
||||
@@ -86,17 +86,18 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
|
||||
AC_SUBST(TOPDIR)
|
||||
AC_SUBST(CONFIGURE_START_DIR)
|
||||
|
||||
# We can only call UTIL_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
|
||||
UTIL_FIXUP_PATH(TOPDIR)
|
||||
UTIL_FIXUP_PATH(CONFIGURE_START_DIR)
|
||||
|
||||
if test "x$CUSTOM_ROOT" != x; then
|
||||
UTIL_FIXUP_PATH(CUSTOM_ROOT)
|
||||
WORKSPACE_ROOT="${CUSTOM_ROOT}"
|
||||
else
|
||||
WORKSPACE_ROOT="${TOPDIR}"
|
||||
fi
|
||||
AC_SUBST(WORKSPACE_ROOT)
|
||||
|
||||
# We can only call UTIL_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
|
||||
UTIL_FIXUP_PATH(CONFIGURE_START_DIR)
|
||||
UTIL_FIXUP_PATH(TOPDIR)
|
||||
|
||||
# Locate the directory of this script.
|
||||
AUTOCONF_DIR=$TOPDIR/make/autoconf
|
||||
|
||||
|
||||
@@ -381,22 +381,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
||||
BOOTJDK_USE_LOCAL_CDS=false
|
||||
AC_MSG_RESULT([no, -XX:SharedArchiveFile not supported])
|
||||
fi
|
||||
|
||||
# Check for jjs in bootjdk
|
||||
UTIL_SETUP_TOOL(JJS,
|
||||
[
|
||||
AC_MSG_CHECKING([for jjs in Boot JDK])
|
||||
JJS=$BOOT_JDK/bin/jjs
|
||||
if test ! -x $JJS; then
|
||||
AC_MSG_RESULT(not found)
|
||||
JJS=""
|
||||
AC_MSG_NOTICE([Cannot use pandoc without jjs])
|
||||
ENABLE_PANDOC=false
|
||||
else
|
||||
AC_MSG_RESULT(ok)
|
||||
fi
|
||||
AC_SUBST(JJS)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
|
||||
@@ -239,21 +239,11 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# On MacOSX we optimize for size, something
|
||||
# we should do for all platforms?
|
||||
C_O_FLAG_HIGHEST_JVM="-Os"
|
||||
C_O_FLAG_HIGHEST="-Os"
|
||||
C_O_FLAG_HI="-Os"
|
||||
C_O_FLAG_NORM="-Os"
|
||||
C_O_FLAG_DEBUG_JVM=""
|
||||
else
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_DEBUG_JVM="-O0"
|
||||
fi
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_DEBUG_JVM="-O0"
|
||||
C_O_FLAG_SIZE="-Os"
|
||||
C_O_FLAG_DEBUG="-O0"
|
||||
C_O_FLAG_NONE="-O0"
|
||||
|
||||
@@ -218,10 +218,12 @@ AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
|
||||
# We also need -iframework<path>/System/Library/Frameworks
|
||||
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
|
||||
# These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
|
||||
# set this here so it doesn't have to be peppered throughout the forest
|
||||
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
if test -d "[$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" ; then
|
||||
# These always need to be set on macOS 10.X, or we can't find the frameworks embedded in JavaVM.framework
|
||||
# set this here so it doesn't have to be peppered throughout the forest
|
||||
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST($1SYSROOT_CFLAGS)
|
||||
|
||||
@@ -565,6 +565,8 @@ CXXFILT:=@CXXFILT@
|
||||
|
||||
LIPO:=@LIPO@
|
||||
INSTALL_NAME_TOOL:=@INSTALL_NAME_TOOL@
|
||||
METAL := @METAL@
|
||||
METALLIB := @METALLIB@
|
||||
|
||||
# Options to linker to specify a mapfile.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
@@ -625,7 +627,6 @@ JAR_CMD:=@JAR@
|
||||
JLINK_CMD := @JLINK@
|
||||
JMOD_CMD := @JMOD@
|
||||
JARSIGNER_CMD:=@JARSIGNER@
|
||||
JJS_CMD:=@JJS@
|
||||
# These variables are meant to be used. They are defined with = instead of := to make
|
||||
# it possible to override only the *_CMD variables.
|
||||
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
||||
@@ -637,7 +638,6 @@ JAR=@FIXPATH@ $(JAR_CMD)
|
||||
JLINK = @FIXPATH@ $(JLINK_CMD)
|
||||
JMOD = @FIXPATH@ $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL)
|
||||
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
|
||||
JJS=@FIXPATH@ $(JJS_CMD) $(JAVA_TOOL_FLAGS_SMALL)
|
||||
|
||||
BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
|
||||
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
|
||||
@@ -650,6 +650,7 @@ INTERIM_LANGTOOLS_ADD_EXPORTS := \
|
||||
--add-exports java.base/sun.reflect.annotation=jdk.compiler.interim \
|
||||
--add-exports java.base/jdk.internal.jmod=jdk.compiler.interim \
|
||||
--add-exports java.base/jdk.internal.misc=jdk.compiler.interim \
|
||||
--add-exports java.base/sun.invoke.util=jdk.compiler.interim \
|
||||
#
|
||||
INTERIM_LANGTOOLS_MODULES_COMMA := $(strip $(subst $(SPACE),$(COMMA),$(strip \
|
||||
$(INTERIM_LANGTOOLS_MODULES))))
|
||||
|
||||
@@ -776,6 +776,32 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
||||
UTIL_FIXUP_EXECUTABLE(OTOOL)
|
||||
UTIL_REQUIRE_PROGS(INSTALL_NAME_TOOL, install_name_tool)
|
||||
UTIL_FIXUP_EXECUTABLE(INSTALL_NAME_TOOL)
|
||||
|
||||
UTIL_PATH_PROGS(METAL, metal)
|
||||
if test "x$METAL" = x; then
|
||||
AC_MSG_CHECKING([if metal can be run using xcrun])
|
||||
METAL="xcrun -sdk macosx metal"
|
||||
test_metal=`$METAL --version 2>&1`
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([XCode tool 'metal' neither found in path nor with xcrun])
|
||||
else
|
||||
AC_MSG_RESULT([yes, will be using '$METAL'])
|
||||
fi
|
||||
fi
|
||||
|
||||
UTIL_PATH_PROGS(METALLIB, metallib)
|
||||
if test "x$METALLIB" = x; then
|
||||
AC_MSG_CHECKING([if metallib can be run using xcrun])
|
||||
METALLIB="xcrun -sdk macosx metallib"
|
||||
test_metallib=`$METALLIB --version 2>&1`
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([XCode tool 'metallib' neither found in path nor with xcrun])
|
||||
else
|
||||
AC_MSG_RESULT([yes, will be using '$METALLIB'])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
|
||||
@@ -38,7 +38,7 @@ DEFAULT_VERSION_CLASSFILE_MAJOR=59 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="14 15"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=15
|
||||
DEFAULT_PROMOTED_VERSION_PRE=ea
|
||||
DEFAULT_PROMOTED_VERSION_PRE=
|
||||
|
||||
LAUNCHER_NAME=openjdk
|
||||
PRODUCT_NAME=OpenJDK
|
||||
|
||||
@@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, common/FindTests.gmk))
|
||||
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)
|
||||
|
||||
# JTREG_TESTROOTS might have been set by a custom extension
|
||||
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp)
|
||||
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test)
|
||||
|
||||
# Extract the names of the Jtreg group files from the TEST.ROOT files. The
|
||||
# TEST.ROOT files being properties files can be interpreted as makefiles so
|
||||
|
||||
@@ -193,21 +193,6 @@ HOTSPOT_MODULES := \
|
||||
jdk.internal.vm.compiler.management \
|
||||
#
|
||||
|
||||
# The native dynamic libraries in these modules will also get built into static
|
||||
# libraries for consumption by downstream projects that need to statically link
|
||||
# the JDK libraries. Those static libraries are not part of the main JDK
|
||||
# distribution.
|
||||
STATIC_LIBS_MODULES := \
|
||||
java.base \
|
||||
jdk.crypto.ec \
|
||||
jdk.security.auth \
|
||||
java.prefs \
|
||||
java.security.jgss \
|
||||
java.smartcardio \
|
||||
jdk.crypto.cryptoki \
|
||||
jdk.net \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Some platforms don't have the serviceability agent
|
||||
|
||||
|
||||
@@ -103,12 +103,22 @@ define SetupBuildLauncherBody
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
ifeq ($$($1_MACOSX_PRIVILEGED), true)
|
||||
$1_PLIST_FILE := Info-privileged.plist
|
||||
$1_PLIST_SRC_FILE := Info-privileged.plist
|
||||
else
|
||||
$1_PLIST_FILE := Info-cmdline.plist
|
||||
$1_PLIST_SRC_FILE := Info-cmdline.plist
|
||||
endif
|
||||
|
||||
$1_LDFLAGS += -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
|
||||
$1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist
|
||||
|
||||
$$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \
|
||||
SOURCE_FILES := $$(TOPDIR)/src/java.base/macosx/native/launcher/$$($1_PLIST_SRC_FILE), \
|
||||
OUTPUT_FILE := $$($1_PLIST_FILE), \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT).$1 ; \
|
||||
@@VERSION@@ => $(VERSION_NUMBER) ; \
|
||||
))
|
||||
|
||||
$1_LDFLAGS += -sectcreate __TEXT __info_plist $$($1_PLIST_FILE)
|
||||
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$1_LDFLAGS += -exported_symbols_list \
|
||||
@@ -168,6 +178,8 @@ define SetupBuildLauncherBody
|
||||
$1 += $$(BUILD_LAUNCHER_$1)
|
||||
TARGETS += $$($1)
|
||||
|
||||
$$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
|
||||
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
|
||||
endif
|
||||
@@ -199,9 +211,9 @@ ifeq ($(call isTargetOsType, unix), true)
|
||||
# PANDOC_TROFF_MANPAGE_FILTER, a wrapper around
|
||||
# PANDOC_TROFF_MANPAGE_FILTER_JAVASCRIPT. This is created by buildtools-jdk.
|
||||
|
||||
# We should also depend on the source javascript filter
|
||||
PANDOC_TROFF_MANPAGE_FILTER_JAVASCRIPT := \
|
||||
$(TOPDIR)/make/scripts/pandoc-troff-manpage-filter.js
|
||||
# We should also depend on the source code for the filter
|
||||
PANDOC_TROFF_MANPAGE_FILTER_SOURCE := $(call FindFiles, \
|
||||
$(TOPDIR)/make/jdk/src/classes/build/tools/pandocfilter)
|
||||
|
||||
# The norm in man pages is to display code literals as bold, but pandoc
|
||||
# "correctly" converts these constructs (encoded in markdown using `...`
|
||||
@@ -231,7 +243,7 @@ ifeq ($(call isTargetOsType, unix), true)
|
||||
@@VERSION_SHORT@@ => $(VERSION_SHORT) ; \
|
||||
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION), \
|
||||
EXTRA_DEPS := $(PANDOC_TROFF_MANPAGE_FILTER) \
|
||||
$(PANDOC_TROFF_MANPAGE_FILTER_JAVASCRIPT), \
|
||||
$(PANDOC_TROFF_MANPAGE_FILTER_SOURCE), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_MAN_PAGES)
|
||||
|
||||
@@ -426,7 +426,10 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
target_cpu: "x64",
|
||||
dependencies: ["devkit", "gtest", "pandoc", "graalunit_lib"],
|
||||
configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
|
||||
"--with-macosx-version-max=10.9.0"),
|
||||
"--with-macosx-version-max=10.9.0",
|
||||
// Use system SetFile instead of the one in the devkit as the
|
||||
// devkit one may not work on Catalina.
|
||||
"SETFILE=/usr/bin/SetFile"),
|
||||
},
|
||||
|
||||
"windows-x64": {
|
||||
@@ -604,10 +607,6 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
dependencies: [ name + ".jdk" ],
|
||||
configure_args: [
|
||||
"--with-boot-jdk=" + input.get(name + ".jdk", "home_path"),
|
||||
// Full docs do not currently work with bootcycle build
|
||||
// since Nashorn was removed. This negates the
|
||||
// --enable-full-docs from the main profile.
|
||||
"--enable-full-docs=auto",
|
||||
]
|
||||
}
|
||||
profiles[bootcyclePrebuiltName] = concatObjects(profiles[name],
|
||||
@@ -688,7 +687,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
|
||||
remote: [
|
||||
"bundles/common/jdk-" + data.version + "_doc-api-spec.tar.gz",
|
||||
"bundles/linux-x64/\\1"
|
||||
"bundles/common/\\1"
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -765,7 +764,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
profiles[cmpBaselineName].make_args = [ "COMPARE_BUILD=CONF=" ];
|
||||
profiles[cmpBaselineName].configure_args = concat(
|
||||
profiles[cmpBaselineName].configure_args,
|
||||
"--with-hotspot-build-time=n/a",
|
||||
"--with-hotspot-build-time=n/a",
|
||||
"--disable-precompiled-headers");
|
||||
// Do not inherit artifact definitions from base profile
|
||||
delete profiles[cmpBaselineName].artifacts;
|
||||
@@ -1046,10 +1045,10 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
jtreg: {
|
||||
server: "jpg",
|
||||
product: "jtreg",
|
||||
version: "5.0",
|
||||
version: "5.1",
|
||||
build_number: "b01",
|
||||
checksum_file: "MD5_VALUES",
|
||||
file: "bundles/jtreg_bin-5.0.zip",
|
||||
file: "bundles/jtreg_bin-5.1.zip",
|
||||
environment_name: "JT_HOME",
|
||||
environment_path: input.get("jtreg", "home_path") + "/bin",
|
||||
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
<key>JavaVM</key>
|
||||
<dict>
|
||||
<key>JVMCapabilities</key>
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
<key>JavaVM</key>
|
||||
<dict>
|
||||
<key>JVMMinimumFrameworkVersion</key>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# generate these charsets into sun.nio.cs
|
||||
#
|
||||
GBK
|
||||
GB18030
|
||||
Johab
|
||||
MS1255
|
||||
MS1256
|
||||
|
||||
@@ -52,7 +52,7 @@ allfonts.myanmar=Myanmar Text
|
||||
allfonts.dingbats=Wingdings
|
||||
allfonts.symbol=Symbol
|
||||
allfonts.symbols=Segoe UI Symbol
|
||||
allfonts.thai=DokChampa
|
||||
allfonts.thai=Tahoma
|
||||
allfonts.georgian=Sylfaen
|
||||
|
||||
serif.plain.alphabetic=Times New Roman
|
||||
@@ -60,140 +60,140 @@ serif.plain.chinese-ms950=MingLiU
|
||||
serif.plain.chinese-ms950-extb=MingLiU-ExtB
|
||||
serif.plain.hebrew=David
|
||||
serif.plain.japanese=MS Mincho
|
||||
serif.plain.korean=Batang
|
||||
serif.plain.korean=Malgun Gothic
|
||||
|
||||
serif.bold.alphabetic=Times New Roman Bold
|
||||
serif.bold.chinese-ms950=PMingLiU
|
||||
serif.bold.chinese-ms950-extb=PMingLiU-ExtB
|
||||
serif.bold.hebrew=David Bold
|
||||
serif.bold.japanese=MS Mincho
|
||||
serif.bold.korean=Batang
|
||||
serif.bold.korean=Malgun Gothic
|
||||
|
||||
serif.italic.alphabetic=Times New Roman Italic
|
||||
serif.italic.chinese-ms950=PMingLiU
|
||||
serif.italic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
serif.italic.hebrew=David
|
||||
serif.italic.japanese=MS Mincho
|
||||
serif.italic.korean=Batang
|
||||
serif.italic.korean=Malgun Gothic
|
||||
|
||||
serif.bolditalic.alphabetic=Times New Roman Bold Italic
|
||||
serif.bolditalic.chinese-ms950=PMingLiU
|
||||
serif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
serif.bolditalic.hebrew=David Bold
|
||||
serif.bolditalic.japanese=MS Mincho
|
||||
serif.bolditalic.korean=Batang
|
||||
serif.bolditalic.korean=Malgun Gothic
|
||||
|
||||
sansserif.plain.alphabetic=Arial
|
||||
sansserif.plain.chinese-ms950=MingLiU
|
||||
sansserif.plain.chinese-ms950-extb=MingLiU-ExtB
|
||||
sansserif.plain.hebrew=David
|
||||
sansserif.plain.japanese=MS Gothic
|
||||
sansserif.plain.korean=Gulim
|
||||
sansserif.plain.korean=Malgun Gothic
|
||||
|
||||
sansserif.bold.alphabetic=Arial Bold
|
||||
sansserif.bold.chinese-ms950=PMingLiU
|
||||
sansserif.bold.chinese-ms950-extb=PMingLiU-ExtB
|
||||
sansserif.bold.hebrew=David Bold
|
||||
sansserif.bold.japanese=MS Gothic
|
||||
sansserif.bold.korean=Gulim
|
||||
sansserif.bold.korean=Malgun Gothic
|
||||
|
||||
sansserif.italic.alphabetic=Arial Italic
|
||||
sansserif.italic.chinese-ms950=PMingLiU
|
||||
sansserif.italic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
sansserif.italic.hebrew=David
|
||||
sansserif.italic.japanese=MS Gothic
|
||||
sansserif.italic.korean=Gulim
|
||||
sansserif.italic.korean=Malgun Gothic
|
||||
|
||||
sansserif.bolditalic.alphabetic=Arial Bold Italic
|
||||
sansserif.bolditalic.chinese-ms950=PMingLiU
|
||||
sansserif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
sansserif.bolditalic.hebrew=David Bold
|
||||
sansserif.bolditalic.japanese=MS Gothic
|
||||
sansserif.bolditalic.korean=Gulim
|
||||
sansserif.bolditalic.korean=Malgun Gothic
|
||||
|
||||
monospaced.plain.alphabetic=Courier New
|
||||
monospaced.plain.chinese-ms950=MingLiU
|
||||
monospaced.plain.chinese-ms950-extb=MingLiU-ExtB
|
||||
monospaced.plain.hebrew=Courier New
|
||||
monospaced.plain.japanese=MS Gothic
|
||||
monospaced.plain.korean=GulimChe
|
||||
monospaced.plain.korean=Malgun Gothic
|
||||
|
||||
monospaced.bold.alphabetic=Courier New Bold
|
||||
monospaced.bold.chinese-ms950=PMingLiU
|
||||
monospaced.bold.chinese-ms950-extb=PMingLiU-ExtB
|
||||
monospaced.bold.hebrew=Courier New Bold
|
||||
monospaced.bold.japanese=MS Gothic
|
||||
monospaced.bold.korean=GulimChe
|
||||
monospaced.bold.korean=Malgun Gothic
|
||||
|
||||
monospaced.italic.alphabetic=Courier New Italic
|
||||
monospaced.italic.chinese-ms950=PMingLiU
|
||||
monospaced.italic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
monospaced.italic.hebrew=Courier New
|
||||
monospaced.italic.japanese=MS Gothic
|
||||
monospaced.italic.korean=GulimChe
|
||||
monospaced.italic.korean=Malgun Gothic
|
||||
|
||||
monospaced.bolditalic.alphabetic=Courier New Bold Italic
|
||||
monospaced.bolditalic.chinese-ms950=PMingLiU
|
||||
monospaced.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
monospaced.bolditalic.hebrew=Courier New Bold
|
||||
monospaced.bolditalic.japanese=MS Gothic
|
||||
monospaced.bolditalic.korean=GulimChe
|
||||
monospaced.bolditalic.korean=Malgun Gothic
|
||||
|
||||
dialog.plain.alphabetic=Arial
|
||||
dialog.plain.chinese-ms950=MingLiU
|
||||
dialog.plain.chinese-ms950-extb=MingLiU-ExtB
|
||||
dialog.plain.hebrew=David
|
||||
dialog.plain.japanese=MS Gothic
|
||||
dialog.plain.korean=Gulim
|
||||
dialog.plain.korean=Malgun Gothic
|
||||
|
||||
dialog.bold.alphabetic=Arial Bold
|
||||
dialog.bold.chinese-ms950=PMingLiU
|
||||
dialog.bold.chinese-ms950-extb=PMingLiU-ExtB
|
||||
dialog.bold.hebrew=David Bold
|
||||
dialog.bold.japanese=MS Gothic
|
||||
dialog.bold.korean=Gulim
|
||||
dialog.bold.korean=Malgun Gothic
|
||||
|
||||
dialog.italic.alphabetic=Arial Italic
|
||||
dialog.italic.chinese-ms950=PMingLiU
|
||||
dialog.italic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
dialog.italic.hebrew=David
|
||||
dialog.italic.japanese=MS Gothic
|
||||
dialog.italic.korean=Gulim
|
||||
dialog.italic.korean=Malgun Gothic
|
||||
|
||||
dialog.bolditalic.alphabetic=Arial Bold Italic
|
||||
dialog.bolditalic.chinese-ms950=PMingLiU
|
||||
dialog.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
dialog.bolditalic.hebrew=David Bold
|
||||
dialog.bolditalic.japanese=MS Gothic
|
||||
dialog.bolditalic.korean=Gulim
|
||||
dialog.bolditalic.korean=Malgun Gothic
|
||||
|
||||
dialoginput.plain.alphabetic=Courier New
|
||||
dialoginput.plain.chinese-ms950=MingLiU
|
||||
dialoginput.plain.chinese-ms950-extb=MingLiU-ExtB
|
||||
dialoginput.plain.hebrew=David
|
||||
dialoginput.plain.japanese=MS Gothic
|
||||
dialoginput.plain.korean=Gulim
|
||||
dialoginput.plain.korean=Malgun Gothic
|
||||
|
||||
dialoginput.bold.alphabetic=Courier New Bold
|
||||
dialoginput.bold.chinese-ms950=PMingLiU
|
||||
dialoginput.bold.chinese-ms950-extb=PMingLiU-ExtB
|
||||
dialoginput.bold.hebrew=David Bold
|
||||
dialoginput.bold.japanese=MS Gothic
|
||||
dialoginput.bold.korean=Gulim
|
||||
dialoginput.bold.korean=Malgun Gothic
|
||||
|
||||
dialoginput.italic.alphabetic=Courier New Italic
|
||||
dialoginput.italic.chinese-ms950=PMingLiU
|
||||
dialoginput.italic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
dialoginput.italic.hebrew=David
|
||||
dialoginput.italic.japanese=MS Gothic
|
||||
dialoginput.italic.korean=Gulim
|
||||
dialoginput.italic.korean=Malgun Gothic
|
||||
|
||||
dialoginput.bolditalic.alphabetic=Courier New Bold Italic
|
||||
dialoginput.bolditalic.chinese-ms950=PMingLiU
|
||||
dialoginput.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
|
||||
dialoginput.bolditalic.hebrew=David Bold
|
||||
dialoginput.bolditalic.japanese=MS Gothic
|
||||
dialoginput.bolditalic.korean=Gulim
|
||||
dialoginput.bolditalic.korean=Malgun Gothic
|
||||
|
||||
# Search Sequences
|
||||
|
||||
@@ -257,7 +257,7 @@ sequence.fallback=symbols,\
|
||||
|
||||
# Exclusion Ranges
|
||||
|
||||
exclusion.alphabetic=0700-1cff,1d80-1e9f,1f00-2017,2020-20ab,20ad-20b8,20bb-20bc,20be-f8ff
|
||||
exclusion.alphabetic=0700-1cff,1d80-1e9f,1f00-2017,2020-20ab,20ad-20b8,20bb-20bc,20be-24ff,2501-2501,2503-250b,250d-250f,2511-2513,2515-2517,2519-251b,251d-2523,2525-252b,252d-2533,2535-253b,253d-254f,256d-f8ff
|
||||
exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be
|
||||
exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac
|
||||
|
||||
@@ -303,21 +303,18 @@ filename.MS_PMincho=MSMINCHO.TTC
|
||||
filename.MS_Gothic=MSGOTHIC.TTC
|
||||
filename.MS_PGothic=MSGOTHIC.TTC
|
||||
|
||||
filename.Gulim=gulim.TTC
|
||||
filename.Batang=batang.TTC
|
||||
filename.GulimChe=gulim.TTC
|
||||
|
||||
filename.Gautami=gautami.ttf
|
||||
filename.Iskoola_Pota=iskpota.ttf
|
||||
filename.Kalinga=kalinga.ttf
|
||||
filename.Kartika=kartika.ttf
|
||||
filename.Latha=latha.ttf
|
||||
filename.Malgun_Gothic=malgun.ttf
|
||||
filename.Mangal=MANGAL.TTF
|
||||
filename.Raavi=raavi.ttf
|
||||
filename.Shruti=shruti.ttf
|
||||
filename.Tahoma=tahoma.ttf
|
||||
filename.Tunga=TUNGA.TTF
|
||||
filename.Vrinda=vrinda.ttf
|
||||
filename.DokChampa=dokchamp.ttf
|
||||
filename.Khmer_UI=KhmerUI.ttf
|
||||
filename.Mongolian_Baiti=monbaiti.ttf
|
||||
filename.Myanmar_Text=mmrtext.ttf
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -393,11 +393,14 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
(boolean canRedefineClasses
|
||||
"Can the VM redefine classes?")
|
||||
(boolean canAddMethod
|
||||
"Can the VM add methods when redefining "
|
||||
"classes?")
|
||||
"Can the VM add methods when redefining classes? "
|
||||
"<p>@Deprecated(since=\"15\") A JVM TI based JDWP back-end "
|
||||
"will never set this capability to true.")
|
||||
(boolean canUnrestrictedlyRedefineClasses
|
||||
"Can the VM redefine classes "
|
||||
"in ways that are normally restricted?")
|
||||
"in ways that are normally restricted?"
|
||||
"<p>@Deprecated(since=\"15\") A JVM TI based JDWP back-end "
|
||||
"will never set this capability to true.")
|
||||
(boolean canPopFrames
|
||||
"Can the VM pop stack frames?")
|
||||
(boolean canUseInstanceFilters
|
||||
@@ -467,6 +470,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"<p>"
|
||||
"Requires canRedefineClasses capability - see "
|
||||
"<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>. "
|
||||
"<p>@Deprecated(since=\"15\") "
|
||||
"In addition to the canRedefineClasses capability, the target VM must "
|
||||
"have the canAddMethod capability to add methods when redefining classes, "
|
||||
"or the canUnrestrictedlyRedefineClasses capability to redefine classes in ways "
|
||||
@@ -526,7 +530,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"returned for each class. "
|
||||
"Generic signatures are described in the signature attribute "
|
||||
"section in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"Since JDWP version 1.5."
|
||||
(Out
|
||||
)
|
||||
@@ -639,7 +643,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
)
|
||||
(Reply
|
||||
(int modBits "Modifier bits as defined in Chapter 4 of "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>")
|
||||
"<cite>The Java Virtual Machine Specification</cite>")
|
||||
)
|
||||
(ErrorSet
|
||||
(Error INVALID_CLASS "refType is not the ID of a reference "
|
||||
@@ -667,7 +671,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"which provide additional information on the "
|
||||
"field declaration. Individual flag values are "
|
||||
"defined in Chapter 4 of "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"In addition, The <code>0xf0000000</code> bit identifies "
|
||||
"the field as synthetic, if the synthetic attribute "
|
||||
"<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
|
||||
@@ -702,7 +706,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"which provide additional information on the "
|
||||
"method declaration. Individual flag values are "
|
||||
"defined in Chapter 4 of "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"In addition, The <code>0xf0000000</code> bit identifies "
|
||||
"the method as synthetic, if the synthetic attribute "
|
||||
"<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
|
||||
@@ -789,7 +793,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"Returns the current status of the reference type. The status "
|
||||
"indicates the extent to which the reference type has been "
|
||||
"initialized, as described in section 2.1.6 of "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"If the class is linked the PREPARED and VERIFIED bits in the returned status bits "
|
||||
"will be set. If the class is initialized the INITIALIZED bit in the returned "
|
||||
"status bits will be set. If an error occured during initialization then the "
|
||||
@@ -868,7 +872,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"generic signature if there is one. "
|
||||
"Generic signatures are described in the signature attribute "
|
||||
"section in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"Since JDWP version 1.5."
|
||||
(Out
|
||||
(referenceType refType "The reference type ID.")
|
||||
@@ -896,7 +900,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"Fields are returned in the order they occur in the class file. "
|
||||
"Generic signatures are described in the signature attribute "
|
||||
"section in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"Since JDWP version 1.5."
|
||||
(Out
|
||||
(referenceType refType "The reference type ID.")
|
||||
@@ -913,7 +917,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"which provide additional information on the "
|
||||
"field declaration. Individual flag values are "
|
||||
"defined in Chapter 4 of "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"In addition, The <code>0xf0000000</code> bit identifies "
|
||||
"the field as synthetic, if the synthetic attribute "
|
||||
"<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
|
||||
@@ -938,7 +942,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"Methods are returned in the order they occur in the class file. "
|
||||
"Generic signatures are described in the signature attribute "
|
||||
"section in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"Since JDWP version 1.5."
|
||||
(Out
|
||||
(referenceType refType "The reference type ID.")
|
||||
@@ -955,7 +959,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"which provide additional information on the "
|
||||
"method declaration. Individual flag values are "
|
||||
"defined in Chapter 4 of "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"In addition, The <code>0xf0000000</code> bit identifies "
|
||||
"the method as synthetic, if the synthetic attribute "
|
||||
"<a href=\"#JDWP_VirtualMachine_Capabilities\">capability</a> is available.")
|
||||
@@ -1018,7 +1022,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
(Command ConstantPool=18
|
||||
"Return the raw bytes of the constant pool in the format of the "
|
||||
"constant_pool item of the Class File Format in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"<p>Since JDWP version 1.6. Requires canGetConstantPool capability - see "
|
||||
"<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>.""
|
||||
(Out
|
||||
@@ -1028,7 +1032,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
(int count "Total number of constant pool entries plus one. This "
|
||||
"corresponds to the constant_pool_count item of the "
|
||||
"Class File Format in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. ")
|
||||
"<cite>The Java Virtual Machine Specification</cite>. ")
|
||||
(Repeat bytes
|
||||
(byte cpbytes "Raw bytes of constant pool")
|
||||
)
|
||||
@@ -1431,7 +1435,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
)
|
||||
(Command Bytecodes=3
|
||||
"Retrieve the method's bytecodes as defined in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"Requires canGetBytecodes capability - see "
|
||||
"<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>."
|
||||
(Out
|
||||
@@ -1487,7 +1491,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"table. Also, synthetic variables may be present. "
|
||||
"Generic signatures are described in the signature attribute "
|
||||
"section in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>. "
|
||||
"<cite>The Java Virtual Machine Specification</cite>. "
|
||||
"Since JDWP version 1.5."
|
||||
(Out
|
||||
(referenceType refType "The class.")
|
||||
@@ -2078,7 +2082,7 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"The method which will return early is referred to as the "
|
||||
"called method. The called method is the current method (as "
|
||||
"defined by the Frames section in "
|
||||
"<cite>The Java™ Virtual Machine Specification</cite>) "
|
||||
"<cite>The Java Virtual Machine Specification</cite>) "
|
||||
"for the specified thread at the time this command "
|
||||
"is received. "
|
||||
"<p>"
|
||||
@@ -3160,8 +3164,8 @@ JDWP "Java(tm) Debug Wire Protocol"
|
||||
"canUnrestrictedlyRedefineClasses is false.")
|
||||
(Constant CLASS_ATTRIBUTE_CHANGE_NOT_IMPLEMENTED
|
||||
=72 "The new class version has a different NestHost, "
|
||||
"NestMembers, or Record class attribute and "
|
||||
"canUnrestrictedlyRedefineClasses is false.")
|
||||
"NestMembers, PermittedSubclasses, or Record class attribute "
|
||||
"and canUnrestrictedlyRedefineClasses is false.")
|
||||
(Constant NOT_IMPLEMENTED =99 "The functionality is not implemented in "
|
||||
"this virtual machine.")
|
||||
(Constant NULL_POINTER =100 "Invalid pointer.")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -632,10 +632,37 @@ class name java/security/cert/X509CRL
|
||||
class name java/security/cert/X509Certificate
|
||||
-method name verify descriptor (Ljava/security/PublicKey;Ljava/security/Provider;)V
|
||||
|
||||
class name java/security/interfaces/RSAKey
|
||||
-method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
-class name java/security/spec/DSAGenParameterSpec
|
||||
|
||||
class name java/security/spec/MGF1ParameterSpec
|
||||
-field name SHA224 descriptor Ljava/security/spec/MGF1ParameterSpec;
|
||||
-field name SHA512_224 descriptor Ljava/security/spec/MGF1ParameterSpec;
|
||||
-field name SHA512_256 descriptor Ljava/security/spec/MGF1ParameterSpec;
|
||||
|
||||
class name java/security/spec/PSSParameterSpec
|
||||
-field name TRAILER_FIELD_BC descriptor I
|
||||
-method name toString descriptor ()Ljava/lang/String;
|
||||
|
||||
class name java/security/spec/RSAKeyGenParameterSpec
|
||||
-method name <init> descriptor (ILjava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
-method name getKeyParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
class name java/security/spec/RSAMultiPrimePrivateCrtKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;[Ljava/security/spec/RSAOtherPrimeInfo;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
|
||||
class name java/security/spec/RSAPrivateCrtKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
|
||||
class name java/security/spec/RSAPrivateKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
-method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
class name java/security/spec/RSAPublicKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
-method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
class name java/text/Collator
|
||||
-method name getInstance descriptor (Ljava/util/Locale;)Ljava/text/Collator;
|
||||
@@ -1457,6 +1484,14 @@ method name newUpdater descriptor (Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/
|
||||
|
||||
-class name java/util/function/UnaryOperator
|
||||
|
||||
class name java/util/jar/Attributes$Name
|
||||
-field name EXTENSION_INSTALLATION descriptor Ljava/util/jar/Attributes$Name;
|
||||
-field name IMPLEMENTATION_VENDOR_ID descriptor Ljava/util/jar/Attributes$Name;
|
||||
-field name IMPLEMENTATION_URL descriptor Ljava/util/jar/Attributes$Name;
|
||||
field name EXTENSION_INSTALLATION descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name IMPLEMENTATION_VENDOR_ID descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name IMPLEMENTATION_URL descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
|
||||
class name java/util/jar/JarFile
|
||||
-method name stream descriptor ()Ljava/util/stream/Stream;
|
||||
|
||||
@@ -1535,6 +1570,9 @@ class name java/util/zip/ZipEntry
|
||||
class name java/util/zip/ZipFile
|
||||
-method name stream descriptor ()Ljava/util/stream/Stream;
|
||||
|
||||
class name javax/crypto/SealedObject
|
||||
header extends java/lang/Object implements java/io/Serializable flags 21
|
||||
|
||||
class name javax/crypto/SecretKey
|
||||
header extends java/lang/Object implements java/security/Key flags 601
|
||||
|
||||
@@ -1559,6 +1597,12 @@ class name javax/net/ssl/ExtendedSSLSession
|
||||
|
||||
-class name javax/net/ssl/SNIServerName
|
||||
|
||||
class name javax/net/ssl/SSLEngine
|
||||
-method name getApplicationProtocol descriptor ()Ljava/lang/String;
|
||||
-method name getHandshakeApplicationProtocol descriptor ()Ljava/lang/String;
|
||||
-method name setHandshakeApplicationProtocolSelector descriptor (Ljava/util/function/BiFunction;)V
|
||||
-method name getHandshakeApplicationProtocolSelector descriptor ()Ljava/util/function/BiFunction;
|
||||
|
||||
class name javax/net/ssl/SSLParameters
|
||||
-method name setServerNames descriptor (Ljava/util/List;)V
|
||||
-method name getServerNames descriptor ()Ljava/util/List;
|
||||
@@ -1566,6 +1610,14 @@ class name javax/net/ssl/SSLParameters
|
||||
-method name getSNIMatchers descriptor ()Ljava/util/Collection;
|
||||
-method name setUseCipherSuitesOrder descriptor (Z)V
|
||||
-method name getUseCipherSuitesOrder descriptor ()Z
|
||||
-method name getApplicationProtocols descriptor ()[Ljava/lang/String;
|
||||
-method name setApplicationProtocols descriptor ([Ljava/lang/String;)V
|
||||
|
||||
class name javax/net/ssl/SSLSocket
|
||||
-method name getApplicationProtocol descriptor ()Ljava/lang/String;
|
||||
-method name getHandshakeApplicationProtocol descriptor ()Ljava/lang/String;
|
||||
-method name setHandshakeApplicationProtocolSelector descriptor (Ljava/util/function/BiFunction;)V
|
||||
-method name getHandshakeApplicationProtocolSelector descriptor ()Ljava/util/function/BiFunction;
|
||||
|
||||
class name javax/net/ssl/SSLSocketFactory
|
||||
-method name createSocket descriptor (Ljava/net/Socket;Ljava/io/InputStream;Z)Ljava/net/Socket;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -8200,6 +8200,7 @@ method name getW descriptor ()Ljava/security/spec/ECPoint; flags 401
|
||||
class name java/security/interfaces/RSAKey
|
||||
header extends java/lang/Object flags 601 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
method name getModulus descriptor ()Ljava/math/BigInteger; flags 401
|
||||
method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec; flags 1
|
||||
|
||||
class name java/security/interfaces/RSAMultiPrimePrivateCrtKey
|
||||
header extends java/lang/Object implements java/security/interfaces/RSAPrivateKey flags 601 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -8363,6 +8364,8 @@ field name SHA224 descriptor Ljava/security/spec/MGF1ParameterSpec; flags 19
|
||||
field name SHA256 descriptor Ljava/security/spec/MGF1ParameterSpec; flags 19
|
||||
field name SHA384 descriptor Ljava/security/spec/MGF1ParameterSpec; flags 19
|
||||
field name SHA512 descriptor Ljava/security/spec/MGF1ParameterSpec; flags 19
|
||||
field name SHA512_224 descriptor Ljava/security/spec/MGF1ParameterSpec; flags 19
|
||||
field name SHA512_256 descriptor Ljava/security/spec/MGF1ParameterSpec; flags 19
|
||||
method name <init> descriptor (Ljava/lang/String;)V flags 1
|
||||
method name getDigestAlgorithm descriptor ()Ljava/lang/String; flags 1
|
||||
|
||||
@@ -8375,6 +8378,7 @@ method name getFormat descriptor ()Ljava/lang/String; flags 11
|
||||
class name java/security/spec/PSSParameterSpec
|
||||
header extends java/lang/Object implements java/security/spec/AlgorithmParameterSpec flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
field name DEFAULT descriptor Ljava/security/spec/PSSParameterSpec; flags 19
|
||||
field name TRAILER_FIELD_BC descriptor I constantValue 1 flags 19
|
||||
method name <init> descriptor (Ljava/lang/String;Ljava/lang/String;Ljava/security/spec/AlgorithmParameterSpec;II)V flags 1
|
||||
method name <init> descriptor (I)V flags 1
|
||||
method name getDigestAlgorithm descriptor ()Ljava/lang/String; flags 1
|
||||
@@ -8382,6 +8386,7 @@ method name getMGFAlgorithm descriptor ()Ljava/lang/String; flags 1
|
||||
method name getMGFParameters descriptor ()Ljava/security/spec/AlgorithmParameterSpec; flags 1
|
||||
method name getSaltLength descriptor ()I flags 1
|
||||
method name getTrailerField descriptor ()I flags 1
|
||||
method name toString descriptor ()Ljava/lang/String; flags 1
|
||||
|
||||
class name java/security/spec/RSAKeyGenParameterSpec
|
||||
header extends java/lang/Object implements java/security/spec/AlgorithmParameterSpec flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -8390,6 +8395,8 @@ field name F4 descriptor Ljava/math/BigInteger; flags 19
|
||||
method name <init> descriptor (ILjava/math/BigInteger;)V flags 1
|
||||
method name getKeysize descriptor ()I flags 1
|
||||
method name getPublicExponent descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name <init> descriptor (ILjava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V flags 1
|
||||
method name getKeyParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec; flags 1
|
||||
|
||||
class name java/security/spec/RSAMultiPrimePrivateCrtKeySpec
|
||||
header extends java/security/spec/RSAPrivateKeySpec flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -8401,6 +8408,7 @@ method name getPrimeExponentP descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getPrimeExponentQ descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getCrtCoefficient descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getOtherPrimeInfo descriptor ()[Ljava/security/spec/RSAOtherPrimeInfo; flags 1
|
||||
method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;[Ljava/security/spec/RSAOtherPrimeInfo;Ljava/security/spec/AlgorithmParameterSpec;)V flags 1
|
||||
|
||||
class name java/security/spec/RSAOtherPrimeInfo
|
||||
header extends java/lang/Object flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -8418,18 +8426,23 @@ method name getPrimeQ descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getPrimeExponentP descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getPrimeExponentQ descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getCrtCoefficient descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V flags 1
|
||||
|
||||
class name java/security/spec/RSAPrivateKeySpec
|
||||
header extends java/lang/Object implements java/security/spec/KeySpec flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;)V flags 1
|
||||
method name getModulus descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getPrivateExponent descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V flags 1
|
||||
method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec; flags 1
|
||||
|
||||
class name java/security/spec/RSAPublicKeySpec
|
||||
header extends java/lang/Object implements java/security/spec/KeySpec flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;)V flags 1
|
||||
method name getModulus descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name getPublicExponent descriptor ()Ljava/math/BigInteger; flags 1
|
||||
method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V flags 1
|
||||
method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec; flags 1
|
||||
|
||||
class name java/security/spec/X509EncodedKeySpec
|
||||
header extends java/security/spec/EncodedKeySpec flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -10429,6 +10442,7 @@ method name values descriptor ()[Ljava/time/chrono/JapaneseEra; flags 9
|
||||
method name getValue descriptor ()I flags 1
|
||||
method name range descriptor (Ljava/time/temporal/TemporalField;)Ljava/time/temporal/ValueRange; flags 1
|
||||
method name toString descriptor ()Ljava/lang/String; flags 1
|
||||
method name getDisplayName descriptor (Ljava/time/format/TextStyle;Ljava/util/Locale;)Ljava/lang/String; flags 1
|
||||
|
||||
class name java/time/chrono/MinguoChronology
|
||||
header extends java/time/chrono/AbstractChronology implements java/io/Serializable flags 31 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -15563,15 +15577,15 @@ field name MAIN_CLASS descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name SEALED descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name EXTENSION_LIST descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name EXTENSION_NAME descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name EXTENSION_INSTALLATION descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name IMPLEMENTATION_TITLE descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name IMPLEMENTATION_VERSION descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name IMPLEMENTATION_VENDOR descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name IMPLEMENTATION_VENDOR_ID descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name IMPLEMENTATION_URL descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name SPECIFICATION_TITLE descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name SPECIFICATION_VERSION descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name SPECIFICATION_VENDOR descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
field name EXTENSION_INSTALLATION descriptor Ljava/util/jar/Attributes$Name; flags 19 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;
|
||||
field name IMPLEMENTATION_VENDOR_ID descriptor Ljava/util/jar/Attributes$Name; flags 19 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;
|
||||
field name IMPLEMENTATION_URL descriptor Ljava/util/jar/Attributes$Name; flags 19 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;
|
||||
method name <init> descriptor (Ljava/lang/String;)V flags 1
|
||||
method name equals descriptor (Ljava/lang/Object;)Z flags 1
|
||||
method name hashCode descriptor ()I flags 1
|
||||
@@ -16698,6 +16712,7 @@ method name <init> descriptor ()V flags 1
|
||||
|
||||
class name javax/crypto/SealedObject
|
||||
header extends java/lang/Object implements java/io/Serializable flags 21
|
||||
innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19
|
||||
field name encodedParams descriptor [B flags 4
|
||||
method name <init> descriptor (Ljava/io/Serializable;Ljavax/crypto/Cipher;)V thrownTypes java/io/IOException,javax/crypto/IllegalBlockSizeException flags 1
|
||||
method name <init> descriptor (Ljavax/crypto/SealedObject;)V flags 4
|
||||
@@ -17086,6 +17101,10 @@ method name setEnableSessionCreation descriptor (Z)V flags 401
|
||||
method name getEnableSessionCreation descriptor ()Z flags 401
|
||||
method name getSSLParameters descriptor ()Ljavax/net/ssl/SSLParameters; flags 1
|
||||
method name setSSLParameters descriptor (Ljavax/net/ssl/SSLParameters;)V flags 1
|
||||
method name getApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name getHandshakeApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name setHandshakeApplicationProtocolSelector descriptor (Ljava/util/function/BiFunction;)V flags 1 signature (Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLEngine;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;)V
|
||||
method name getHandshakeApplicationProtocolSelector descriptor ()Ljava/util/function/BiFunction; flags 1 signature ()Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLEngine;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;
|
||||
|
||||
class name javax/net/ssl/SSLEngineResult
|
||||
header extends java/lang/Object flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -17156,6 +17175,8 @@ method name setSNIMatchers descriptor (Ljava/util/Collection;)V flags 11 signatu
|
||||
method name getSNIMatchers descriptor ()Ljava/util/Collection; flags 11 signature ()Ljava/util/Collection<Ljavax/net/ssl/SNIMatcher;>;
|
||||
method name setUseCipherSuitesOrder descriptor (Z)V flags 11
|
||||
method name getUseCipherSuitesOrder descriptor ()Z flags 11
|
||||
method name getApplicationProtocols descriptor ()[Ljava/lang/String; flags 1
|
||||
method name setApplicationProtocols descriptor ([Ljava/lang/String;)V flags 1
|
||||
|
||||
class name javax/net/ssl/SSLPeerUnverifiedException
|
||||
header extends javax/net/ssl/SSLException flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
@@ -17272,6 +17293,10 @@ method name setEnableSessionCreation descriptor (Z)V flags 401
|
||||
method name getEnableSessionCreation descriptor ()Z flags 401
|
||||
method name getSSLParameters descriptor ()Ljavax/net/ssl/SSLParameters; flags 1
|
||||
method name setSSLParameters descriptor (Ljavax/net/ssl/SSLParameters;)V flags 1
|
||||
method name getApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name getHandshakeApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name setHandshakeApplicationProtocolSelector descriptor (Ljava/util/function/BiFunction;)V flags 1 signature (Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLSocket;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;)V
|
||||
method name getHandshakeApplicationProtocolSelector descriptor ()Ljava/util/function/BiFunction; flags 1 signature ()Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLSocket;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;
|
||||
|
||||
class name javax/net/ssl/SSLSocketFactory
|
||||
header extends javax/net/SocketFactory flags 421 classAnnotations @Ljdk/Profile+Annotation;(value=I1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -2083,13 +2083,42 @@ method name equals descriptor (Ljava/lang/Object;)Z flags 1
|
||||
method name toString descriptor ()Ljava/lang/String; flags 1
|
||||
method name clone descriptor ()Ljava/lang/Object; thrownTypes java/lang/CloneNotSupportedException flags 1041
|
||||
|
||||
class name java/security/interfaces/RSAKey
|
||||
-method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
class name java/security/spec/EncodedKeySpec
|
||||
method name <init> descriptor ([BLjava/lang/String;)V flags 4
|
||||
method name getAlgorithm descriptor ()Ljava/lang/String; flags 1
|
||||
|
||||
class name java/security/spec/MGF1ParameterSpec
|
||||
-field name SHA512_224 descriptor Ljava/security/spec/MGF1ParameterSpec;
|
||||
-field name SHA512_256 descriptor Ljava/security/spec/MGF1ParameterSpec;
|
||||
|
||||
class name java/security/spec/PKCS8EncodedKeySpec
|
||||
method name <init> descriptor ([BLjava/lang/String;)V flags 1
|
||||
|
||||
class name java/security/spec/PSSParameterSpec
|
||||
-field name TRAILER_FIELD_BC descriptor I
|
||||
-method name toString descriptor ()Ljava/lang/String;
|
||||
|
||||
class name java/security/spec/RSAKeyGenParameterSpec
|
||||
-method name <init> descriptor (ILjava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
-method name getKeyParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
class name java/security/spec/RSAMultiPrimePrivateCrtKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;[Ljava/security/spec/RSAOtherPrimeInfo;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
|
||||
class name java/security/spec/RSAPrivateCrtKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
|
||||
class name java/security/spec/RSAPrivateKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
-method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
class name java/security/spec/RSAPublicKeySpec
|
||||
-method name <init> descriptor (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/security/spec/AlgorithmParameterSpec;)V
|
||||
-method name getParams descriptor ()Ljava/security/spec/AlgorithmParameterSpec;
|
||||
|
||||
class name java/security/spec/X509EncodedKeySpec
|
||||
method name <init> descriptor ([BLjava/lang/String;)V flags 1
|
||||
|
||||
@@ -2224,9 +2253,6 @@ innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang
|
||||
class name java/time/chrono/IsoChronology
|
||||
method name epochSecond descriptor (IIIIIILjava/time/ZoneOffset;)J flags 1
|
||||
|
||||
class name java/time/chrono/JapaneseEra
|
||||
method name getDisplayName descriptor (Ljava/time/format/TextStyle;Ljava/util/Locale;)Ljava/lang/String; flags 1
|
||||
|
||||
class name java/time/format/DateTimeFormatter
|
||||
header extends java/lang/Object flags 31
|
||||
innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19
|
||||
@@ -3221,12 +3247,6 @@ header extends java/lang/Object implements java/util/function/Function flags 601
|
||||
innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19
|
||||
|
||||
class name java/util/jar/Attributes$Name
|
||||
-field name EXTENSION_INSTALLATION descriptor Ljava/util/jar/Attributes$Name;
|
||||
-field name IMPLEMENTATION_VENDOR_ID descriptor Ljava/util/jar/Attributes$Name;
|
||||
-field name IMPLEMENTATION_URL descriptor Ljava/util/jar/Attributes$Name;
|
||||
field name EXTENSION_INSTALLATION descriptor Ljava/util/jar/Attributes$Name; flags 19 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;
|
||||
field name IMPLEMENTATION_VENDOR_ID descriptor Ljava/util/jar/Attributes$Name; flags 19 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;
|
||||
field name IMPLEMENTATION_URL descriptor Ljava/util/jar/Attributes$Name; flags 19 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;
|
||||
field name MULTI_RELEASE descriptor Ljava/util/jar/Attributes$Name; flags 19
|
||||
|
||||
class name java/util/jar/JarFile
|
||||
@@ -3381,6 +3401,9 @@ method name finalize descriptor ()V thrownTypes java/io/IOException flags 4 depr
|
||||
class name javax/crypto/ExemptionMechanism
|
||||
-method name finalize descriptor ()V
|
||||
|
||||
class name javax/crypto/SealedObject
|
||||
header extends java/lang/Object implements java/io/Serializable flags 21
|
||||
|
||||
class name javax/net/ssl/ExtendedSSLSession
|
||||
method name getStatusResponses descriptor ()Ljava/util/List; flags 1 signature ()Ljava/util/List<[B>;
|
||||
|
||||
@@ -3388,12 +3411,6 @@ class name javax/net/ssl/HandshakeCompletedEvent
|
||||
-method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate;
|
||||
method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate; thrownTypes javax/net/ssl/SSLPeerUnverifiedException flags 1 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(since="9")
|
||||
|
||||
class name javax/net/ssl/SSLEngine
|
||||
method name getApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name getHandshakeApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name setHandshakeApplicationProtocolSelector descriptor (Ljava/util/function/BiFunction;)V flags 1 signature (Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLEngine;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;)V
|
||||
method name getHandshakeApplicationProtocolSelector descriptor ()Ljava/util/function/BiFunction; flags 1 signature ()Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLEngine;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;
|
||||
|
||||
class name javax/net/ssl/SSLEngineResult
|
||||
header extends java/lang/Object flags 21
|
||||
innerclass innerClass javax/net/ssl/SSLEngineResult$HandshakeStatus outerClass javax/net/ssl/SSLEngineResult innerClassName HandshakeStatus flags 4019
|
||||
@@ -3409,19 +3426,11 @@ method name setEnableRetransmissions descriptor (Z)V flags 1
|
||||
method name getEnableRetransmissions descriptor ()Z flags 1
|
||||
method name setMaximumPacketSize descriptor (I)V flags 1
|
||||
method name getMaximumPacketSize descriptor ()I flags 1
|
||||
method name getApplicationProtocols descriptor ()[Ljava/lang/String; flags 1
|
||||
method name setApplicationProtocols descriptor ([Ljava/lang/String;)V flags 1
|
||||
|
||||
class name javax/net/ssl/SSLSession
|
||||
-method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate;
|
||||
method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate; thrownTypes javax/net/ssl/SSLPeerUnverifiedException flags 401 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(since="9")
|
||||
|
||||
class name javax/net/ssl/SSLSocket
|
||||
method name getApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name getHandshakeApplicationProtocol descriptor ()Ljava/lang/String; flags 1
|
||||
method name setHandshakeApplicationProtocolSelector descriptor (Ljava/util/function/BiFunction;)V flags 1 signature (Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLSocket;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;)V
|
||||
method name getHandshakeApplicationProtocolSelector descriptor ()Ljava/util/function/BiFunction; flags 1 signature ()Ljava/util/function/BiFunction<Ljavax/net/ssl/SSLSocket;Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;
|
||||
|
||||
class name javax/security/auth/Policy
|
||||
header extends java/lang/Object flags 421 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(since="1.4")
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -77,6 +77,9 @@ class name javax/swing/ImageIcon
|
||||
field name component descriptor Ljava/awt/Component; flags 1c
|
||||
field name tracker descriptor Ljava/awt/MediaTracker; flags 1c
|
||||
|
||||
class name javax/swing/JComboBox
|
||||
-method name processKeyBinding descriptor (Ljavax/swing/KeyStroke;Ljava/awt/event/KeyEvent;IZ)Z
|
||||
|
||||
class name javax/swing/JComponent
|
||||
field name accessibleContext descriptor Ljavax/accessibility/AccessibleContext; flags 4
|
||||
-method name hide descriptor ()V
|
||||
@@ -90,8 +93,12 @@ field name accessibleFocusHandler descriptor Ljava/awt/event/FocusListener; flag
|
||||
class name javax/swing/JDesktopPane
|
||||
-method name remove descriptor (Ljava/awt/Component;)V
|
||||
|
||||
class name javax/swing/JViewport
|
||||
-method name addNotify descriptor ()V
|
||||
class name javax/swing/JList$AccessibleJList$AccessibleJListChild
|
||||
method name getAccessibleAction descriptor ()Ljavax/accessibility/AccessibleAction; flags 1
|
||||
|
||||
class name javax/swing/plaf/basic/BasicRadioButtonUI
|
||||
-method name installListeners descriptor (Ljavax/swing/AbstractButton;)V
|
||||
-method name uninstallListeners descriptor (Ljavax/swing/AbstractButton;)V
|
||||
|
||||
class name javax/swing/tree/DefaultMutableTreeNode
|
||||
-method name setParent descriptor (Ljavax/swing/tree/MutableTreeNode;)V
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user