mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-12 20:39:38 +01:00
Compare commits
1703 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fe07ccc53 | ||
|
|
1e8e543b26 | ||
|
|
04ca660e81 | ||
|
|
49128a1ee5 | ||
|
|
9543d7607b | ||
|
|
4dfa411247 | ||
|
|
97ff38caff | ||
|
|
cd4faff0ec | ||
|
|
bdd5782a67 | ||
|
|
703b345eee | ||
|
|
397307311e | ||
|
|
2a0389a892 | ||
|
|
ac772cd916 | ||
|
|
6712f8caff | ||
|
|
82fe023b06 | ||
|
|
bd50ccd037 | ||
|
|
54b340b44f | ||
|
|
51fdb4c039 | ||
|
|
77921b9736 | ||
|
|
57493c1991 | ||
|
|
d2b1dc6d78 | ||
|
|
a34f48bcf5 | ||
|
|
f397b60ae1 | ||
|
|
c9d1dcc63d | ||
|
|
919978380c | ||
|
|
1728547270 | ||
|
|
6e61861740 | ||
|
|
5d84e95ed5 | ||
|
|
4fe68f55a4 | ||
|
|
c9d0407e94 | ||
|
|
f2f77f7b14 | ||
|
|
b29e1086ac | ||
|
|
88d75c9ad5 | ||
|
|
ea27a54bf0 | ||
|
|
4d29116d6d | ||
|
|
81dae70f67 | ||
|
|
65cab55c1b | ||
|
|
19219a964b | ||
|
|
5d4a1350d0 | ||
|
|
289ae798f4 | ||
|
|
9604ee8269 | ||
|
|
1c2754bfe3 | ||
|
|
d296708ca6 | ||
|
|
58102386eb | ||
|
|
123e786db2 | ||
|
|
22f091608d | ||
|
|
777804759f | ||
|
|
87d77eb2a0 | ||
|
|
dffe9db25c | ||
|
|
406db1c270 | ||
|
|
ea5a2b15a0 | ||
|
|
fff8c8deaa | ||
|
|
7dcdc1fbdd | ||
|
|
0fd41c3b6a | ||
|
|
f686a380f3 | ||
|
|
b8966e1f7b | ||
|
|
4185ed3290 | ||
|
|
6f40a41466 | ||
|
|
b9505df3b4 | ||
|
|
3c4e824aa5 | ||
|
|
9230c2aaae | ||
|
|
cfd41c0c1d | ||
|
|
8fda5b82f0 | ||
|
|
60ec2a53c2 | ||
|
|
90c131f29f | ||
|
|
96704253b6 | ||
|
|
84402796b2 | ||
|
|
44e6820c37 | ||
|
|
ed62b0104f | ||
|
|
87276bce47 | ||
|
|
dd36d8c64d | ||
|
|
2d9fa9da02 | ||
|
|
928da494a8 | ||
|
|
3e96721cd9 | ||
|
|
7779ce9fb4 | ||
|
|
a8242892c2 | ||
|
|
1d88172c06 | ||
|
|
5dd9353b83 | ||
|
|
05a764f4ff | ||
|
|
55c282bb34 | ||
|
|
776acfd80a | ||
|
|
79d70f6b51 | ||
|
|
ca0e014e60 | ||
|
|
092c227721 | ||
|
|
06d8cf6fef | ||
|
|
424d7d6485 | ||
|
|
2a406f3ce5 | ||
|
|
4b16f8ab94 | ||
|
|
4fb8c77696 | ||
|
|
e5ba020ee9 | ||
|
|
9e453d9792 | ||
|
|
8f7c9a7b18 | ||
|
|
8cf8e463c6 | ||
|
|
8b3d67681e | ||
|
|
709cfe5f28 | ||
|
|
f80a6066e4 | ||
|
|
04775f11fe | ||
|
|
dc3a0f5f88 | ||
|
|
8331e63fe4 | ||
|
|
4c65365116 | ||
|
|
3078b5f340 | ||
|
|
4622a18a72 | ||
|
|
ac02afe9dc | ||
|
|
4d9f207347 | ||
|
|
1eca634736 | ||
|
|
a55cde4d6b | ||
|
|
ffc97ba585 | ||
|
|
5310d85809 | ||
|
|
8df3e72cea | ||
|
|
2fe0a5d75e | ||
|
|
fb206908b4 | ||
|
|
b1ce6bdba9 | ||
|
|
ff6843ca48 | ||
|
|
d5be82948b | ||
|
|
6e5d4f33c5 | ||
|
|
3ed960ec77 | ||
|
|
86491a5f6b | ||
|
|
ebf443a16f | ||
|
|
431338bcb3 | ||
|
|
6bddeb709d | ||
|
|
6d19fe65d1 | ||
|
|
55c90a171f | ||
|
|
b65913249f | ||
|
|
e63b90cc17 | ||
|
|
9c17a35e50 | ||
|
|
70b0fccf79 | ||
|
|
527b0e44eb | ||
|
|
ac15d6445b | ||
|
|
d25b03e987 | ||
|
|
821bd08cd6 | ||
|
|
1ae6b533fb | ||
|
|
77a0f3999a | ||
|
|
0054c15f60 | ||
|
|
8e338f67b2 | ||
|
|
ec9bee6866 | ||
|
|
16b8c39964 | ||
|
|
840aa2b79e | ||
|
|
8e87d46f41 | ||
|
|
c2692f8875 | ||
|
|
e9c178276f | ||
|
|
276fcee795 | ||
|
|
ca1ed16292 | ||
|
|
fed3636f12 | ||
|
|
625a9352bf | ||
|
|
f014854ac7 | ||
|
|
7817963ce9 | ||
|
|
79904c1fa3 | ||
|
|
ea7c47c1bb | ||
|
|
b66fa8f444 | ||
|
|
4167540074 | ||
|
|
5a57945f1a | ||
|
|
b159e4ed9e | ||
|
|
0e855fe5fa | ||
|
|
9150b902d5 | ||
|
|
0187567704 | ||
|
|
a75edc29c6 | ||
|
|
1f5a033421 | ||
|
|
f62eefc02b | ||
|
|
1b79326c05 | ||
|
|
dc1ef58351 | ||
|
|
27d0a70b34 | ||
|
|
e12d94af0b | ||
|
|
cfa3f74931 | ||
|
|
37b70282b5 | ||
|
|
dcde95ba0d | ||
|
|
0b83fc0150 | ||
|
|
8239b67d4f | ||
|
|
24a424891c | ||
|
|
8b85c3a6d7 | ||
|
|
9ac162e896 | ||
|
|
527a30930e | ||
|
|
3495c19d1a | ||
|
|
a9d04408b3 | ||
|
|
89c5e49ba2 | ||
|
|
bf442c5b9e | ||
|
|
dd2c456eb8 | ||
|
|
b1e2f026d9 | ||
|
|
c303fd5de9 | ||
|
|
f3ea0d362f | ||
|
|
4440bda325 | ||
|
|
154b8cfcfd | ||
|
|
ba174af344 | ||
|
|
3320fc0f52 | ||
|
|
f765a7f513 | ||
|
|
c21690b518 | ||
|
|
0bc01da702 | ||
|
|
812b39f574 | ||
|
|
5f1d6120a5 | ||
|
|
b8ea80af33 | ||
|
|
e4d0e5af4d | ||
|
|
3fe5886baf | ||
|
|
226faa5503 | ||
|
|
bd6797543f | ||
|
|
bddb82255c | ||
|
|
c68a31ddce | ||
|
|
93a2018d1e | ||
|
|
426c9049ce | ||
|
|
65af837391 | ||
|
|
581f0f2643 | ||
|
|
7b860120e1 | ||
|
|
0f26ab16dd | ||
|
|
c1df13b855 | ||
|
|
24e12b3811 | ||
|
|
3d5fea1f07 | ||
|
|
8c02bdbf13 | ||
|
|
0c287de4f6 | ||
|
|
aa3862403b | ||
|
|
ae20dd6b9b | ||
|
|
b9729cb432 | ||
|
|
284bbf02dd | ||
|
|
a4affd5b04 | ||
|
|
96f722cf63 | ||
|
|
f7b1ce457a | ||
|
|
282b9dcfdc | ||
|
|
0e98fc1ccd | ||
|
|
d1f9b8a8b5 | ||
|
|
d8921ed573 | ||
|
|
f800af978c | ||
|
|
2e30ff61b0 | ||
|
|
43be5a3cb6 | ||
|
|
5a7390b62a | ||
|
|
7e49eaecbc | ||
|
|
fbfb62dffe | ||
|
|
dad6edbf83 | ||
|
|
edc14f92d9 | ||
|
|
bba948f0ff | ||
|
|
955c2e6292 | ||
|
|
34ec1bedd1 | ||
|
|
fdce055a9b | ||
|
|
388c8f2538 | ||
|
|
bca9e55b1e | ||
|
|
cc7521c452 | ||
|
|
3d88d387c3 | ||
|
|
83b05373a1 | ||
|
|
d27835b34e | ||
|
|
1438ce097f | ||
|
|
224a30f12c | ||
|
|
22f7af7fcf | ||
|
|
f55dd9d40e | ||
|
|
d35b117956 | ||
|
|
f37c34d32e | ||
|
|
89044200cd | ||
|
|
52c28b8692 | ||
|
|
05572e8651 | ||
|
|
43019a0e6b | ||
|
|
6e9efffced | ||
|
|
83b2411fd1 | ||
|
|
86a16400bd | ||
|
|
11c4ea963c | ||
|
|
73c9088b81 | ||
|
|
3ef2efb1f4 | ||
|
|
fd380d75b0 | ||
|
|
2c3a37c6d7 | ||
|
|
d4269fd520 | ||
|
|
6c3e483b56 | ||
|
|
0a1dc50f54 | ||
|
|
1e39649907 | ||
|
|
12dfe1c9b6 | ||
|
|
3570f5a924 | ||
|
|
24765e4559 | ||
|
|
81e2cf82d9 | ||
|
|
cca3a26e43 | ||
|
|
a4c6a99e61 | ||
|
|
a67f890fc6 | ||
|
|
f972155d63 | ||
|
|
a9993f9464 | ||
|
|
4ac6934965 | ||
|
|
53a4ef2670 | ||
|
|
b87a159967 | ||
|
|
9a7dcdcdba | ||
|
|
1c84cfa236 | ||
|
|
ce93cbce77 | ||
|
|
d250f9e08c | ||
|
|
d38c97dd52 | ||
|
|
671dfba802 | ||
|
|
e5866aa756 | ||
|
|
10867134fd | ||
|
|
e2196f8882 | ||
|
|
300b8517c3 | ||
|
|
c781594bfe | ||
|
|
33f8e7022c | ||
|
|
f509eb069d | ||
|
|
7f9b5d9e32 | ||
|
|
e0cf023263 | ||
|
|
60c4902f61 | ||
|
|
dd43533165 | ||
|
|
efe3540d8f | ||
|
|
fbf4699d23 | ||
|
|
7c564e13ee | ||
|
|
2caa20a76d | ||
|
|
57f92d23b1 | ||
|
|
65bfe0928a | ||
|
|
fc36328d4f | ||
|
|
40206822f4 | ||
|
|
46598c8644 | ||
|
|
5191f3159a | ||
|
|
65d6c10185 | ||
|
|
74851c507b | ||
|
|
b5620a36f4 | ||
|
|
d219d8b987 | ||
|
|
dafcf1056f | ||
|
|
7eb4d4aa01 | ||
|
|
fa30241ddb | ||
|
|
9ea43a9213 | ||
|
|
3f455f09dc | ||
|
|
af8c678038 | ||
|
|
70cc7fc198 | ||
|
|
ac9d1b08ee | ||
|
|
9c24a5635e | ||
|
|
e6a493ab88 | ||
|
|
68da63dcde | ||
|
|
b05290aaea | ||
|
|
779d2c34ae | ||
|
|
07da3a1808 | ||
|
|
f978f6fe8a | ||
|
|
c5e63b639e | ||
|
|
03a4df0acd | ||
|
|
998ce78e53 | ||
|
|
b1b0f0b2cc | ||
|
|
306b166336 | ||
|
|
5c0d985abf | ||
|
|
952518640a | ||
|
|
7f27d0b013 | ||
|
|
e7a1b9bf81 | ||
|
|
040c8f58e5 | ||
|
|
9687dcabb6 | ||
|
|
8777ded123 | ||
|
|
c7062dc22b | ||
|
|
5144190ea0 | ||
|
|
976acddeb5 | ||
|
|
488022689f | ||
|
|
8da6c8d6aa | ||
|
|
ff21696bc0 | ||
|
|
44a74dac95 | ||
|
|
418e4a259c | ||
|
|
41d29b752b | ||
|
|
5b30a83133 | ||
|
|
8db333531f | ||
|
|
7ccf435825 | ||
|
|
d236cf4bec | ||
|
|
6a005343b4 | ||
|
|
f78f780570 | ||
|
|
f9339616e1 | ||
|
|
433394203d | ||
|
|
5166094647 | ||
|
|
6329de4504 | ||
|
|
d56096471b | ||
|
|
5fef8ddaff | ||
|
|
382b8fedf5 | ||
|
|
c98417ebca | ||
|
|
c655b703a9 | ||
|
|
30fa8d5d34 | ||
|
|
26c7218ab9 | ||
|
|
e20004d7c1 | ||
|
|
63a5a12949 | ||
|
|
001e51d965 | ||
|
|
91a20ca7e5 | ||
|
|
704f784c88 | ||
|
|
bf5da0c778 | ||
|
|
76002747d5 | ||
|
|
4fb1980fd0 | ||
|
|
73ba3ae1f5 | ||
|
|
5dd1eaded7 | ||
|
|
2cceeedfe1 | ||
|
|
188b0bc7be | ||
|
|
891886b622 | ||
|
|
7686e87155 | ||
|
|
8d6d43c33b | ||
|
|
70d5cac961 | ||
|
|
e0d5b5f7f2 | ||
|
|
e29c3f6123 | ||
|
|
e0c8d4420c | ||
|
|
cc5039e19e | ||
|
|
55c7e769c8 | ||
|
|
5f76deb2e0 | ||
|
|
1262ae36af | ||
|
|
d0f4366a85 | ||
|
|
4b3a0b789e | ||
|
|
3e81b3ad48 | ||
|
|
5d2e79e2c3 | ||
|
|
15af276157 | ||
|
|
8f36580594 | ||
|
|
9b5a9b6189 | ||
|
|
0dadf81e14 | ||
|
|
e25f2a5715 | ||
|
|
ae5a6dde2d | ||
|
|
a9e78595f0 | ||
|
|
4e6a4af186 | ||
|
|
49a9d49dbd | ||
|
|
933f90fbfa | ||
|
|
850d62301c | ||
|
|
76f0588aaf | ||
|
|
57a27a6fb9 | ||
|
|
43d36857d0 | ||
|
|
35ea00085f | ||
|
|
a951a15379 | ||
|
|
aab706c66f | ||
|
|
869b05169f | ||
|
|
38cd5d0936 | ||
|
|
c61204b3f3 | ||
|
|
261eb76ea2 | ||
|
|
a588752fd6 | ||
|
|
f3597c4a54 | ||
|
|
737ae7742a | ||
|
|
4c73e045ce | ||
|
|
7282d0deb5 | ||
|
|
02049ee6c3 | ||
|
|
ac2b1ae5e2 | ||
|
|
553f3b1497 | ||
|
|
f01e6261a2 | ||
|
|
f9e6f26ca4 | ||
|
|
75a69333f8 | ||
|
|
c8257ea4e2 | ||
|
|
be5ed8666c | ||
|
|
1e4f886107 | ||
|
|
ca3374253c | ||
|
|
4fe6a3da68 | ||
|
|
de49337060 | ||
|
|
b3e264187a | ||
|
|
64e2c67e7b | ||
|
|
dc549663d7 | ||
|
|
a4ab61339b | ||
|
|
2914064cf4 | ||
|
|
c89ee9b0a1 | ||
|
|
9d71814dca | ||
|
|
4e3d9e3944 | ||
|
|
79d12507b3 | ||
|
|
dd89c92c50 | ||
|
|
a616bc979b | ||
|
|
62cc45c3df | ||
|
|
1a480ab570 | ||
|
|
22bb597d0d | ||
|
|
8d30bb03ee | ||
|
|
8f98911c7b | ||
|
|
24e9d356df | ||
|
|
178c2ff5eb | ||
|
|
1605edfcc3 | ||
|
|
3d7b524593 | ||
|
|
acb329cd0e | ||
|
|
31cccbe016 | ||
|
|
c8b6cfbdc5 | ||
|
|
33ee441df1 | ||
|
|
50cc54c730 | ||
|
|
bfabf1279d | ||
|
|
5490b03160 | ||
|
|
b957d802e6 | ||
|
|
f0b30a5d24 | ||
|
|
02062b34ad | ||
|
|
09e86303ab | ||
|
|
24578630cf | ||
|
|
0f64d4bead | ||
|
|
e1d29cd6fb | ||
|
|
507ec8ab30 | ||
|
|
07a879a9f7 | ||
|
|
f0acabc64b | ||
|
|
26b48999df | ||
|
|
7df86108cb | ||
|
|
925d275a62 | ||
|
|
30c2dbea95 | ||
|
|
31f2426821 | ||
|
|
80d889189a | ||
|
|
13918a4519 | ||
|
|
4b1b547020 | ||
|
|
9523001f65 | ||
|
|
b6c6b4a89a | ||
|
|
00452d32f5 | ||
|
|
c58de6c6ff | ||
|
|
e19022e515 | ||
|
|
9924c45fae | ||
|
|
5ca47be633 | ||
|
|
0e42d5c4ae | ||
|
|
6428c693f0 | ||
|
|
2c4fbbca23 | ||
|
|
0d1aa3cbc8 | ||
|
|
a1176dc8c9 | ||
|
|
ba7f7fe417 | ||
|
|
235ef8e6df | ||
|
|
edf36d90c3 | ||
|
|
0504064717 | ||
|
|
79dd472913 | ||
|
|
e0989c0068 | ||
|
|
4b8ea58b76 | ||
|
|
fa31c0de68 | ||
|
|
0643f3aa4c | ||
|
|
4d4161a57e | ||
|
|
e11ce6d5fe | ||
|
|
c663323043 | ||
|
|
01dc2644c3 | ||
|
|
6ed221cb9a | ||
|
|
484864c932 | ||
|
|
b6c861f9f8 | ||
|
|
8bf5b1d18b | ||
|
|
fb8ceae0a7 | ||
|
|
6612598a13 | ||
|
|
31d108c1af | ||
|
|
ca6d6385f8 | ||
|
|
5db57dc1a5 | ||
|
|
d1ab20c633 | ||
|
|
4ee601c870 | ||
|
|
6a85e1454d | ||
|
|
56d8e8a0a1 | ||
|
|
08310982f4 | ||
|
|
16d8f5f6ef | ||
|
|
0351595ba8 | ||
|
|
84d2c2678a | ||
|
|
c31bcc58b0 | ||
|
|
124db3be8e | ||
|
|
0483ff56a0 | ||
|
|
7a702ae55e | ||
|
|
c98fd38979 | ||
|
|
f586b6c0cd | ||
|
|
d4e6262f3c | ||
|
|
a6f41d513e | ||
|
|
88f93f3214 | ||
|
|
f879698c63 | ||
|
|
0df797de94 | ||
|
|
55dd4401ce | ||
|
|
6c4a27ccb1 | ||
|
|
84e62e8597 | ||
|
|
b978ebee46 | ||
|
|
0c20de1954 | ||
|
|
b4787e6c3f | ||
|
|
7856c1a311 | ||
|
|
25af8d8f69 | ||
|
|
27b5007ad5 | ||
|
|
2847cd5e66 | ||
|
|
2462995662 | ||
|
|
ef614ed8af | ||
|
|
03f2ab325d | ||
|
|
fc19aa9263 | ||
|
|
b2da6e1a90 | ||
|
|
51a3b25d71 | ||
|
|
6160353be3 | ||
|
|
99c9b39058 | ||
|
|
17bc6915a1 | ||
|
|
b29c1fbbd1 | ||
|
|
b9a37e48e2 | ||
|
|
49e7609da2 | ||
|
|
93c00472eb | ||
|
|
8e4a4cdbe0 | ||
|
|
ecfb2914d0 | ||
|
|
3fb8f4364d | ||
|
|
9fc76c2b2c | ||
|
|
fcd005c417 | ||
|
|
fc0d883a13 | ||
|
|
e56002c7d3 | ||
|
|
fac22ce20c | ||
|
|
9d00332ee5 | ||
|
|
fe8439f0d4 | ||
|
|
8a56d7e00d | ||
|
|
f189db2813 | ||
|
|
10fb6f9c4b | ||
|
|
e6a0c6cf4d | ||
|
|
d8d3cc3ab6 | ||
|
|
b328bc14a0 | ||
|
|
67b3cbff2e | ||
|
|
c2ee432602 | ||
|
|
f1e0780668 | ||
|
|
a1c29335a8 | ||
|
|
fbad5a0d5b | ||
|
|
69c0df6b8f | ||
|
|
2ef86262e0 | ||
|
|
0cf76bde34 | ||
|
|
d6348691ee | ||
|
|
4264cd9f46 | ||
|
|
a0d6a8a174 | ||
|
|
8d432d29b8 | ||
|
|
087cbbfd69 | ||
|
|
65b99c7b1a | ||
|
|
5732032707 | ||
|
|
a963aab1a8 | ||
|
|
9573ef8bda | ||
|
|
552a73301c | ||
|
|
50f1b87a97 | ||
|
|
fe8fcfb4be | ||
|
|
d2d5bc7038 | ||
|
|
3148072079 | ||
|
|
dce1aee4ef | ||
|
|
62a67c5d90 | ||
|
|
63b3498733 | ||
|
|
5d2f6e737b | ||
|
|
d6bd183b84 | ||
|
|
b16a01bb67 | ||
|
|
28f963f6fc | ||
|
|
315ae4c51c | ||
|
|
23ed3a9e91 | ||
|
|
91926e262c | ||
|
|
b83ea8b391 | ||
|
|
092389e3c9 | ||
|
|
6cfe3fea08 | ||
|
|
e64a25b256 | ||
|
|
5e9702d390 | ||
|
|
929ffca471 | ||
|
|
714db70bf3 | ||
|
|
ae912be86f | ||
|
|
f797e19e3d | ||
|
|
9871f3a27a | ||
|
|
74cb1b4e75 | ||
|
|
54490d30c8 | ||
|
|
e8d284faac | ||
|
|
f779affda0 | ||
|
|
70c0815335 | ||
|
|
daffaa8376 | ||
|
|
74ae13716b | ||
|
|
cc8d52020d | ||
|
|
61e42ed85d | ||
|
|
39c9560cbf | ||
|
|
38f4f06ccc | ||
|
|
c190193eac | ||
|
|
89d7530411 | ||
|
|
57d2c86985 | ||
|
|
5dbcdbbef7 | ||
|
|
35421399a4 | ||
|
|
51c8ac362e | ||
|
|
34949494e4 | ||
|
|
5d9c1e45dc | ||
|
|
2631422bc5 | ||
|
|
ea73b5b0d9 | ||
|
|
55e3560abc | ||
|
|
f1a5cbb11e | ||
|
|
fb300a3ff3 | ||
|
|
77522d1270 | ||
|
|
50c37fc749 | ||
|
|
d1b6691295 | ||
|
|
79a4a019bb | ||
|
|
f70fc149b5 | ||
|
|
90f0612ada | ||
|
|
35e3226df8 | ||
|
|
7638580477 | ||
|
|
0db838628c | ||
|
|
473fa82000 | ||
|
|
3498a10a2b | ||
|
|
9f090cb6f8 | ||
|
|
e44575ad3e | ||
|
|
d8355e0281 | ||
|
|
03e5f256ca | ||
|
|
12ae68b197 | ||
|
|
19a08080e4 | ||
|
|
9edcdf12a0 | ||
|
|
a096c0a83f | ||
|
|
e648a907b3 | ||
|
|
191e1e6075 | ||
|
|
51b3bd2c2e | ||
|
|
0615eac2e6 | ||
|
|
2c00d740d4 | ||
|
|
764b50a7e3 | ||
|
|
c32923e06f | ||
|
|
44c6537b57 | ||
|
|
18d5626e25 | ||
|
|
13946835b5 | ||
|
|
0019679c69 | ||
|
|
c798b3d040 | ||
|
|
96f56eb4fc | ||
|
|
97bbbbba51 | ||
|
|
c200b4f1cb | ||
|
|
1066357887 | ||
|
|
7f74c7dd7f | ||
|
|
3a0741afa1 | ||
|
|
61ebb6adb7 | ||
|
|
a53ecac07c | ||
|
|
30c8811d11 | ||
|
|
6b8c16cf41 | ||
|
|
45c4d9d519 | ||
|
|
36b129fe84 | ||
|
|
eaf70e0ab8 | ||
|
|
1cc09ccaef | ||
|
|
ed5696dd2c | ||
|
|
688e5d9071 | ||
|
|
d0d925c13a | ||
|
|
b5f785ba9b | ||
|
|
db1e207a72 | ||
|
|
55e381b32f | ||
|
|
8e687450d6 | ||
|
|
b35a3bdee9 | ||
|
|
c57d89ad1a | ||
|
|
c2fa441d8d | ||
|
|
7332181372 | ||
|
|
1d480a7b96 | ||
|
|
660272ce7c | ||
|
|
032a4d6b9f | ||
|
|
970e251a54 | ||
|
|
c1093dc244 | ||
|
|
ee060c777c | ||
|
|
6df465de73 | ||
|
|
b5d775f115 | ||
|
|
3ed56830b4 | ||
|
|
084e15bca3 | ||
|
|
c79e6346d0 | ||
|
|
84e397b4de | ||
|
|
d7c7f70a6a | ||
|
|
f4de95a97c | ||
|
|
38af8be984 | ||
|
|
b0ceab23dd | ||
|
|
39616b4d7c | ||
|
|
00d223cff6 | ||
|
|
bafa476135 | ||
|
|
15a9c29036 | ||
|
|
4bd94fb9ea | ||
|
|
54bed60bfe | ||
|
|
d12fdfa3b7 | ||
|
|
1e535dfa53 | ||
|
|
9385203fbd | ||
|
|
42f4170b2a | ||
|
|
696b9e1847 | ||
|
|
e15e30fef2 | ||
|
|
d9abf606d9 | ||
|
|
ddb726d4a0 | ||
|
|
aab365f746 | ||
|
|
13a335722f | ||
|
|
9390446081 | ||
|
|
b76a154c6d | ||
|
|
ee5dc7cbb4 | ||
|
|
e03ca73dc1 | ||
|
|
a9ad296a55 | ||
|
|
024fa0969a | ||
|
|
dc71097c2e | ||
|
|
229f41808d | ||
|
|
58107e52a8 | ||
|
|
0f5e57aa8c | ||
|
|
7fd5cb6117 | ||
|
|
2dda9965cd | ||
|
|
1cc8d3a34b | ||
|
|
38636a8c96 | ||
|
|
c4bb35ef33 | ||
|
|
52117c6f62 | ||
|
|
0ea0338055 | ||
|
|
13c176bee4 | ||
|
|
afce1f4ebd | ||
|
|
5585e6f63a | ||
|
|
9e6782d24b | ||
|
|
d4626d89cc | ||
|
|
eaeddeddb1 | ||
|
|
8ebe591a28 | ||
|
|
58a3e40a5c | ||
|
|
8ce2053723 | ||
|
|
97f8261e41 | ||
|
|
e4eaa2377b | ||
|
|
56881d6465 | ||
|
|
d5c4c292a0 | ||
|
|
e3c6574ac0 | ||
|
|
72b530aac4 | ||
|
|
d6035a522e | ||
|
|
39892bf43f | ||
|
|
9798a0846b | ||
|
|
d3776c7d30 | ||
|
|
07c3021936 | ||
|
|
60745d14ec | ||
|
|
5735fce331 | ||
|
|
ee2e61d7e0 | ||
|
|
c55e52e01f | ||
|
|
7f0777ae88 | ||
|
|
831f23ee86 | ||
|
|
c540da3c4c | ||
|
|
6a5203877e | ||
|
|
d502554467 | ||
|
|
9885ac18ac | ||
|
|
178eea6065 | ||
|
|
a5ae1e306e | ||
|
|
fe5817aae8 | ||
|
|
832d896443 | ||
|
|
dc8026d66d | ||
|
|
7ca448b4fc | ||
|
|
fff8122978 | ||
|
|
8812113984 | ||
|
|
74eb250e36 | ||
|
|
846d21961c | ||
|
|
6986d53af9 | ||
|
|
11a8c9c13e | ||
|
|
7efa6090e8 | ||
|
|
03cf1c3a83 | ||
|
|
3a8a15b5d0 | ||
|
|
3c276ce1fe | ||
|
|
4ac45a3b50 | ||
|
|
c8c4d8377a | ||
|
|
9852a6f75c | ||
|
|
1ad1659413 | ||
|
|
e800cc2d2d | ||
|
|
77c46ea911 | ||
|
|
45c89daf72 | ||
|
|
0c9e0c2e7f | ||
|
|
4d3baa2d37 | ||
|
|
c148c2c176 | ||
|
|
555f0e6e2a | ||
|
|
12879e91b4 | ||
|
|
ef86f06c42 | ||
|
|
70885cae5e | ||
|
|
d02e7d55e8 | ||
|
|
db46b297fa | ||
|
|
c202bd705e | ||
|
|
111ba18ac6 | ||
|
|
c02b75705f | ||
|
|
9886b7e9e9 | ||
|
|
deaadfad52 | ||
|
|
99c7b2b85b | ||
|
|
db4d59cc0c | ||
|
|
b0e4e9a2e4 | ||
|
|
2d3372c8b5 | ||
|
|
dc86b2e22b | ||
|
|
b37b1a391a | ||
|
|
65577cf58a | ||
|
|
3ea5fdc9ac | ||
|
|
339016a0f2 | ||
|
|
831e98327b | ||
|
|
dfd3080c05 | ||
|
|
091b0c95c3 | ||
|
|
41eaa00eed | ||
|
|
5a365e8627 | ||
|
|
c0b9999c35 | ||
|
|
0e54ce2a8e | ||
|
|
ac4dc0470e | ||
|
|
cce3929e07 | ||
|
|
bbddae5552 | ||
|
|
5db58348f8 | ||
|
|
9b73fb125d | ||
|
|
fcd5d414d6 | ||
|
|
4b076cb93f | ||
|
|
922ba8da30 | ||
|
|
a0149f53f1 | ||
|
|
e6875c9bac | ||
|
|
75d642a467 | ||
|
|
cbf6894299 | ||
|
|
77c4adbeb5 | ||
|
|
890ca6ea2c | ||
|
|
bd12e85975 | ||
|
|
4a1d4be729 | ||
|
|
f79b7e62db | ||
|
|
c63911b33b | ||
|
|
778d8a45cb | ||
|
|
8b005fa74e | ||
|
|
26680f0c1a | ||
|
|
eaeb43542b | ||
|
|
22006dceb4 | ||
|
|
df923ff2fb | ||
|
|
55b19e84f2 | ||
|
|
0ef80293f9 | ||
|
|
1f91e0ebe3 | ||
|
|
e427697e55 | ||
|
|
5c8a154e93 | ||
|
|
2abefad512 | ||
|
|
9f23c2c159 | ||
|
|
6d665ed31f | ||
|
|
bb6647c845 | ||
|
|
8a9d2b08a0 | ||
|
|
6e198fec0b | ||
|
|
5088193336 | ||
|
|
8b87402a44 | ||
|
|
1f63603288 | ||
|
|
a28f4100ce | ||
|
|
dc80e63811 | ||
|
|
63d2421c3b | ||
|
|
993b1b0afa | ||
|
|
54ad4f9a80 | ||
|
|
33016a8325 | ||
|
|
b1ff2bd00a | ||
|
|
2f8653fbf0 | ||
|
|
1b1c1cd7b9 | ||
|
|
401d3ea9bc | ||
|
|
9cf96bf398 | ||
|
|
668acc7581 | ||
|
|
f8a06bc497 | ||
|
|
a764279daa | ||
|
|
9b42f4786c | ||
|
|
2d8e74ddea | ||
|
|
4d43cf9fc6 | ||
|
|
45e17d8dd2 | ||
|
|
18cf3d8080 | ||
|
|
4f99e1fb11 | ||
|
|
73c75ed838 | ||
|
|
2a8f92e7e7 | ||
|
|
39b22d134f | ||
|
|
dff37f89c5 | ||
|
|
9ff01f7b2f | ||
|
|
c7b074a9db | ||
|
|
f8c1d79917 | ||
|
|
cd98f7d5bf | ||
|
|
006d0bcec1 | ||
|
|
a20c31865d | ||
|
|
d116022893 | ||
|
|
35554ea085 | ||
|
|
3a69dfb5c5 | ||
|
|
8d97637cf2 | ||
|
|
af0d6d28b0 | ||
|
|
6ee76b6b05 | ||
|
|
ac38b399de | ||
|
|
4a4003e900 | ||
|
|
1c882d91f0 | ||
|
|
24a7d8c766 | ||
|
|
4d13bf33d4 | ||
|
|
d63aebe6cb | ||
|
|
4320afbd58 | ||
|
|
546158fb42 | ||
|
|
9694ca9eaf | ||
|
|
3770be7f70 | ||
|
|
3e641b796f | ||
|
|
631085bdfd | ||
|
|
1ce6ec6a28 | ||
|
|
3ec5f6b374 | ||
|
|
ca2df0e543 | ||
|
|
df3c55230e | ||
|
|
c9f9fde366 | ||
|
|
39d4b22fc0 | ||
|
|
507e54840f | ||
|
|
1108a4a77c | ||
|
|
18f3591a1b | ||
|
|
d11b0078a1 | ||
|
|
55039aa1c6 | ||
|
|
24f4f14c3d | ||
|
|
f636b84f48 | ||
|
|
62d77dc3fc | ||
|
|
8cfc7e39df | ||
|
|
e07ad838b5 | ||
|
|
b27e717c56 | ||
|
|
1b5391264a | ||
|
|
be2a92d8c7 | ||
|
|
681d06d39b | ||
|
|
8906904591 | ||
|
|
a640835c62 | ||
|
|
d7c1bb1fb7 | ||
|
|
6d201dbba6 | ||
|
|
919eb12b14 | ||
|
|
6c95a87157 | ||
|
|
ba1db57dde | ||
|
|
765abcb329 | ||
|
|
606aad5dc8 | ||
|
|
52977fd914 | ||
|
|
265b36ff28 | ||
|
|
7a0914c44c | ||
|
|
13bcda40dc | ||
|
|
a9b7ae8ac2 | ||
|
|
7a6c1a66b2 | ||
|
|
be04c8c724 | ||
|
|
92be493f0b | ||
|
|
77c83d9ee6 | ||
|
|
5b2fd36a6d | ||
|
|
04280a0d05 | ||
|
|
c5ad1daa96 | ||
|
|
9bbec0433c | ||
|
|
a376fb7720 | ||
|
|
32482c82a6 | ||
|
|
54c0178787 | ||
|
|
3e0dc68883 | ||
|
|
ba2caf0014 | ||
|
|
907719baec | ||
|
|
99eccaf6ec | ||
|
|
c7d84850bf | ||
|
|
ec074011a4 | ||
|
|
9376dd810c | ||
|
|
5d270677f7 | ||
|
|
b7c307c019 | ||
|
|
d1d17200c5 | ||
|
|
59cd79a8f9 | ||
|
|
7339cf8f54 | ||
|
|
2f6afe55d8 | ||
|
|
e13cb76baa | ||
|
|
955aee3bfa | ||
|
|
a8d6a05ce8 | ||
|
|
55af701cc3 | ||
|
|
749be7e761 | ||
|
|
1f5e21a16e | ||
|
|
cdc1dc939f | ||
|
|
bcd4690bc3 | ||
|
|
fd206e1e7e | ||
|
|
f1bdd9fca6 | ||
|
|
c83ce2e8d9 | ||
|
|
ee1efed55d | ||
|
|
05bb6f1ec2 | ||
|
|
2f989d273d | ||
|
|
023c53d190 | ||
|
|
1982432db4 | ||
|
|
590de670a9 | ||
|
|
f8f35d30af | ||
|
|
10e6a6a19a | ||
|
|
4922a35c6a | ||
|
|
82cc03fa89 | ||
|
|
734a6c94d3 | ||
|
|
83fff05498 | ||
|
|
6c89a9653e | ||
|
|
20147c36fe | ||
|
|
4506975561 | ||
|
|
e2072bba70 | ||
|
|
5cf33168d7 | ||
|
|
999357250a | ||
|
|
396146854b | ||
|
|
af51a73224 | ||
|
|
e0c26b37fd | ||
|
|
6b8bf62a75 | ||
|
|
4858141ce4 | ||
|
|
8b7c959164 | ||
|
|
ec25b42804 | ||
|
|
5a90271d01 | ||
|
|
579ed70629 | ||
|
|
78b9de8e40 | ||
|
|
dc0c0c7eca | ||
|
|
1eaa4116f5 | ||
|
|
4e962f9675 | ||
|
|
1356a0f1ac | ||
|
|
72ae322022 | ||
|
|
3d9bad16d1 | ||
|
|
dc63bf261b | ||
|
|
51937e18f8 | ||
|
|
00e0a60955 | ||
|
|
5fbac4a34c | ||
|
|
911c553cd2 | ||
|
|
c3ec97d41a | ||
|
|
43a2010936 | ||
|
|
637fdbc83c | ||
|
|
2e65885257 | ||
|
|
55e7003fd5 | ||
|
|
b67814941f | ||
|
|
83a8c4acc7 | ||
|
|
5699024184 | ||
|
|
7e93e03da5 | ||
|
|
bf04926d72 | ||
|
|
dc74336a65 | ||
|
|
4b85bd546e | ||
|
|
32aa66126e | ||
|
|
292a3d5722 | ||
|
|
03d47d58d6 | ||
|
|
eb78035d05 | ||
|
|
13b7c2e131 | ||
|
|
2a37607e98 | ||
|
|
f5673586b7 | ||
|
|
545d56dd42 | ||
|
|
7d54e71d38 | ||
|
|
46ff8fdce9 | ||
|
|
7c3d72fd3a | ||
|
|
0f43de9f02 | ||
|
|
a18e8d3d57 | ||
|
|
8f26a1f748 | ||
|
|
37880ba60d | ||
|
|
1b1fb08000 | ||
|
|
183dadbef2 | ||
|
|
2fe15bc62e | ||
|
|
69a9403995 | ||
|
|
9f0bafe6ad | ||
|
|
dda0c6cecd | ||
|
|
e5c43ab86e | ||
|
|
a0e5043781 | ||
|
|
802737cae7 | ||
|
|
ddcb17e1e0 | ||
|
|
e87c864847 | ||
|
|
5899ef11fb | ||
|
|
f4756fdf48 | ||
|
|
ca91da0e0c | ||
|
|
13750b6aca | ||
|
|
abc55dea7e | ||
|
|
a338213bb4 | ||
|
|
eb1bacc71b | ||
|
|
2de3595895 | ||
|
|
f19db799f3 | ||
|
|
f23c983a46 | ||
|
|
c7ecaa4a1d | ||
|
|
1b3a127d06 | ||
|
|
653af300cc | ||
|
|
7a4bf2456e | ||
|
|
45fce6baf9 | ||
|
|
a8d20c9254 | ||
|
|
79ad5512cf | ||
|
|
63a6adf2b5 | ||
|
|
622117d275 | ||
|
|
20a1e352c0 | ||
|
|
46f86477ad | ||
|
|
51b7c76a95 | ||
|
|
ba711f63ba | ||
|
|
682e836d60 | ||
|
|
5a6954abba | ||
|
|
840867efa6 | ||
|
|
fe145646e7 | ||
|
|
c07ce7eec7 | ||
|
|
55bbaf1ae1 | ||
|
|
48c0ce3b4b | ||
|
|
a25bacdd13 | ||
|
|
a793293464 | ||
|
|
5ad963cf61 | ||
|
|
9d6797019b | ||
|
|
ac4f14c386 | ||
|
|
f44f885f27 | ||
|
|
a2db08ae98 | ||
|
|
bdab5a0a3a | ||
|
|
1ef33e4df9 | ||
|
|
a0a0539b0d | ||
|
|
f6c537f8bc | ||
|
|
fc82a465d3 | ||
|
|
c0c4a8d738 | ||
|
|
57b792cba2 | ||
|
|
18cddad5a2 | ||
|
|
51ddc2adbf | ||
|
|
e7fa180e05 | ||
|
|
9ffba3002a | ||
|
|
55b472251e | ||
|
|
b87302ca99 | ||
|
|
2534e72618 | ||
|
|
e098a31307 | ||
|
|
708b60e8c6 | ||
|
|
fc82768478 | ||
|
|
23bbc981a6 | ||
|
|
4682835fb4 | ||
|
|
8a424425e1 | ||
|
|
5724c0d321 | ||
|
|
b4ea9cf23e | ||
|
|
e00aa7c866 | ||
|
|
aacb827896 | ||
|
|
d886d8c465 | ||
|
|
47e465cf1b | ||
|
|
0f2ac2021b | ||
|
|
8c20401051 | ||
|
|
a953a0f4ab | ||
|
|
a6e794b3e8 | ||
|
|
06cea107ef | ||
|
|
601e566b26 | ||
|
|
31c511e6a5 | ||
|
|
42d3bad0b1 | ||
|
|
921155dfc7 | ||
|
|
233cac3232 | ||
|
|
9e5f6885d8 | ||
|
|
34755c3528 | ||
|
|
a1b5e01003 | ||
|
|
f45d121128 | ||
|
|
ac37a29914 | ||
|
|
3e4ad5d8d1 | ||
|
|
362f168d23 | ||
|
|
2ad638621c | ||
|
|
1e45eb3b13 | ||
|
|
95b9024ab2 | ||
|
|
4b3c33bac1 | ||
|
|
0e60e8ad85 | ||
|
|
1550fd889b | ||
|
|
6b251191e0 | ||
|
|
112a4bd8bc | ||
|
|
9584e01d24 | ||
|
|
ef3b0ec567 | ||
|
|
9d6aa42a7c | ||
|
|
3797364ce9 | ||
|
|
156f6174ed | ||
|
|
a1f02d13e5 | ||
|
|
27fc8b6787 | ||
|
|
e178f0467b | ||
|
|
1aa6539576 | ||
|
|
0a6262f0b8 | ||
|
|
d85ff3c7f0 | ||
|
|
29936542ad | ||
|
|
6715f2306e | ||
|
|
2f09989ec0 | ||
|
|
4bcd70acc0 | ||
|
|
e66a2a3384 | ||
|
|
4076ca82d2 | ||
|
|
6986ab256d | ||
|
|
1e1985da9b | ||
|
|
36d716aa08 | ||
|
|
7f69acc778 | ||
|
|
6469685285 | ||
|
|
4167ba1288 | ||
|
|
2c868d6101 | ||
|
|
12554c2c03 | ||
|
|
9a99f511aa | ||
|
|
9a120e7f79 | ||
|
|
4862d0d542 | ||
|
|
3192ef367a | ||
|
|
cb9d3efe5d | ||
|
|
c0b348f3ef | ||
|
|
d8219d0a78 | ||
|
|
2765410a28 | ||
|
|
a10a9284c1 | ||
|
|
88df2f0f7f | ||
|
|
f8596b57f3 | ||
|
|
e3eb38f4d2 | ||
|
|
8d9826e4d1 | ||
|
|
17f2250c5a | ||
|
|
b7e944953e | ||
|
|
61e44cdb6a | ||
|
|
3c472b6700 | ||
|
|
02201d19c6 | ||
|
|
79f02a67ce | ||
|
|
a4eaf9536c | ||
|
|
cf345fd768 | ||
|
|
d86ab942f6 | ||
|
|
0417fcf13f | ||
|
|
257809d744 | ||
|
|
7685e53426 | ||
|
|
bd843673a8 | ||
|
|
0aefe6f20a | ||
|
|
4946a162aa | ||
|
|
6e32338330 | ||
|
|
eef2e1e3fc | ||
|
|
e6517d1ae2 | ||
|
|
10b9d0b6a6 | ||
|
|
27a9a2f64a | ||
|
|
b37228e11f | ||
|
|
17035efe87 | ||
|
|
6af643e5a1 | ||
|
|
3349e10b7f | ||
|
|
a72a8984a9 | ||
|
|
25d1305f7e | ||
|
|
76baa501fa | ||
|
|
64d130efc4 | ||
|
|
77a10a182f | ||
|
|
0b42b1cf15 | ||
|
|
f4301530b4 | ||
|
|
99ae9558fe | ||
|
|
816a7060ba | ||
|
|
ab729d7075 | ||
|
|
1a5ef6606f | ||
|
|
8a9675663f | ||
|
|
31368cd1f0 | ||
|
|
aff80ee900 | ||
|
|
42ac8e1856 | ||
|
|
0ebcf5c59d | ||
|
|
5b99c6ae1f | ||
|
|
e7289aa4d4 | ||
|
|
188ad9714d | ||
|
|
2aa291ad2c | ||
|
|
f2e69156c8 | ||
|
|
277ec3d260 | ||
|
|
ed7f796494 | ||
|
|
761a92d7c9 | ||
|
|
31753ef9bf | ||
|
|
6c2ff1781b | ||
|
|
af8c3b4a7e | ||
|
|
417e8e449d | ||
|
|
f84b5d2f80 | ||
|
|
3dba35d248 | ||
|
|
112bbcb396 | ||
|
|
eb758d53f1 | ||
|
|
f834dc3dc9 | ||
|
|
c4df79117d | ||
|
|
25b1e5a7bd | ||
|
|
e0a7782a9e | ||
|
|
8b6d3147fb | ||
|
|
2e6923ffd6 | ||
|
|
9d40d80237 | ||
|
|
f2b191a6e9 | ||
|
|
983e012c9f | ||
|
|
ffbee17d8a | ||
|
|
226e852831 | ||
|
|
5d1255bf52 | ||
|
|
326ba31787 | ||
|
|
bf1e6903a2 | ||
|
|
e208d9aa1f | ||
|
|
510354452f | ||
|
|
6c2c0563eb | ||
|
|
2155d525dd | ||
|
|
de3923edf9 | ||
|
|
05dc2af21f | ||
|
|
d5ae932b3f | ||
|
|
a7e352b554 | ||
|
|
144267d30f | ||
|
|
d19f2bdec0 | ||
|
|
320af9b34b | ||
|
|
d180fb3044 | ||
|
|
1a4f31409a | ||
|
|
d16ea55b62 | ||
|
|
97cdfb92f8 | ||
|
|
4a588d89f0 | ||
|
|
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 | ||
|
|
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 | ||
|
|
732d8865df | ||
|
|
5adfaa3986 | ||
|
|
04adafb753 | ||
|
|
3576a88369 | ||
|
|
927a7287b7 | ||
|
|
5bd6e9d790 | ||
|
|
4ef42b9215 | ||
|
|
cd3354756a | ||
|
|
651c20d4ef | ||
|
|
a16994ff7b | ||
|
|
0bacc69a4c | ||
|
|
2627f15348 | ||
|
|
9a26a01e2f | ||
|
|
07f9376f54 | ||
|
|
1cb5a48ed7 | ||
|
|
175b597ad2 | ||
|
|
4f2edacaaf | ||
|
|
34c79640e7 | ||
|
|
1d87958ead | ||
|
|
44d4e37ccb | ||
|
|
00dc525e5f | ||
|
|
d2c1027edc | ||
|
|
aeeaffa888 | ||
|
|
6d2959b393 | ||
|
|
3e5abdaf32 | ||
|
|
3839c8656e | ||
|
|
a512099313 | ||
|
|
9e4b9e9151 | ||
|
|
77bdc30650 | ||
|
|
0a108f9ef2 | ||
|
|
e33ebc7f0a | ||
|
|
c1cd3893bd | ||
|
|
0be5b7d66e | ||
|
|
23e2f27996 | ||
|
|
38f9a938e5 | ||
|
|
ab57f7d628 | ||
|
|
08df6a1f15 | ||
|
|
3341d36131 | ||
|
|
3752a81ec8 | ||
|
|
76879aa9c6 | ||
|
|
0f7b18a9c8 | ||
|
|
c82c50b2a2 | ||
|
|
af83d6ab25 | ||
|
|
1faed205df | ||
|
|
bac2e7fcad | ||
|
|
8c90f4c0a7 | ||
|
|
892d998587 | ||
|
|
be278bc564 | ||
|
|
1a681a434f | ||
|
|
0e4829ef0a | ||
|
|
c06fe155ef | ||
|
|
ac4603144d | ||
|
|
1b64fb2063 | ||
|
|
24f040da36 | ||
|
|
1b75b7de80 | ||
|
|
08304ada3c | ||
|
|
494f9667b4 | ||
|
|
2f5d4c633b | ||
|
|
b81f2f1f48 | ||
|
|
6341f8c077 | ||
|
|
319b4e71e1 | ||
|
|
a5b5712733 | ||
|
|
15999a9f21 | ||
|
|
6dec50a7e8 | ||
|
|
65455ff60b | ||
|
|
bb86779366 | ||
|
|
4862a00f6b | ||
|
|
9ac1ab372d | ||
|
|
7da56dfbf3 | ||
|
|
a4b135316c | ||
|
|
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 | ||
|
|
b852688c05 | ||
|
|
34fc33074a | ||
|
|
19c29923a5 | ||
|
|
d7bbb5c4a6 | ||
|
|
343ecd806b | ||
|
|
0ffa6b75fd | ||
|
|
fe514a2e55 | ||
|
|
e3673d4677 | ||
|
|
45258a1799 | ||
|
|
0c58055bac | ||
|
|
6ac3892e16 | ||
|
|
c90e523e0a | ||
|
|
800f133a29 | ||
|
|
45cace2867 | ||
|
|
8fdbb29079 | ||
|
|
fa3d79c2f8 | ||
|
|
195c45a0e1 | ||
|
|
30bc2b7ca1 | ||
|
|
49002194fb | ||
|
|
c4f835b3a7 | ||
|
|
7436ef236e | ||
|
|
231a8408b2 | ||
|
|
8f8ff52cae | ||
|
|
83a458c5f7 | ||
|
|
5146474954 | ||
|
|
097720cce5 | ||
|
|
a14490dd16 | ||
|
|
deddbe5a85 | ||
|
|
f613d43f26 | ||
|
|
870e67d520 | ||
|
|
2d3c928f0b | ||
|
|
faf4d7ccb7 | ||
|
|
09510a15a1 | ||
|
|
086124845f | ||
|
|
985061ac28 | ||
|
|
0a38584c10 | ||
|
|
d3d29a4f82 | ||
|
|
5c76194ae9 | ||
|
|
9bac33fbc6 | ||
|
|
97b948a9b2 | ||
|
|
6b911624f2 | ||
|
|
59e3ebb4a5 | ||
|
|
65b23ca67a | ||
|
|
f4f094021c | ||
|
|
6a91c73dda | ||
|
|
ed31b661d3 | ||
|
|
3dcd1c1ab0 | ||
|
|
11ba454f39 | ||
|
|
fc1b24e4e8 | ||
|
|
e2353cc324 | ||
|
|
dfe381ae08 | ||
|
|
4d2b0b53b4 | ||
|
|
0853b33004 | ||
|
|
d308558d4f | ||
|
|
d42f541dc3 | ||
|
|
1d5ec8f363 | ||
|
|
d7b097f117 | ||
|
|
eeb4b15f06 | ||
|
|
ed05d57603 | ||
|
|
c782d0e486 | ||
|
|
db2d4e8f5a | ||
|
|
f243b281ea | ||
|
|
50e18e29e3 | ||
|
|
a6cf325152 | ||
|
|
584e983c38 | ||
|
|
c5bb023584 | ||
|
|
485194c1a7 | ||
|
|
3d1b1a6bc9 | ||
|
|
e58423796e | ||
|
|
8170244a81 | ||
|
|
28e219f038 | ||
|
|
2e09a58f64 | ||
|
|
6d137a3616 | ||
|
|
b02e4d4aba | ||
|
|
459da4aa11 | ||
|
|
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 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* -text
|
||||
949
.github/workflows/submit.yml
vendored
Normal file
949
.github/workflows/submit.yml
vendored
Normal file
@@ -0,0 +1,949 @@
|
||||
name: Pre-submit tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platforms:
|
||||
description: "Platform(s) to execute on"
|
||||
required: true
|
||||
default: "Linux x64, Windows x64, macOS x64"
|
||||
|
||||
jobs:
|
||||
prerequisites:
|
||||
name: Prerequisites
|
||||
runs-on: "ubuntu-latest"
|
||||
outputs:
|
||||
should_run: ${{ steps.check_submit.outputs.should_run }}
|
||||
bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }}
|
||||
platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }}
|
||||
platform_windows_x64: ${{ steps.check_platforms.outputs.platform_windows_x64 }}
|
||||
platform_macos_x64: ${{ steps.check_platforms.outputs.platform_macos_x64 }}
|
||||
dependencies: ${{ steps.check_deps.outputs.dependencies }}
|
||||
|
||||
steps:
|
||||
- name: Check if submit tests should actually run depending on secrets and manual triggering
|
||||
id: check_submit
|
||||
run: echo "::set-output name=should_run::${{ github.event.inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}"
|
||||
|
||||
- name: Check which platforms should be included
|
||||
id: check_platforms
|
||||
run: |
|
||||
echo "::set-output name=platform_linux_x64::${{ contains(github.event.inputs.platforms, 'linux x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux x64'))) }}"
|
||||
echo "::set-output name=platform_windows_x64::${{ contains(github.event.inputs.platforms, 'windows x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'windows x64'))) }}"
|
||||
echo "::set-output name=platform_macos_x64::${{ contains(github.event.inputs.platforms, 'macos x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'macos x64'))) }}"
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Determine unique bundle identifier
|
||||
run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}"
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: jdk
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Determine versions and locations to be used for dependencies
|
||||
id: check_deps
|
||||
run: "echo ::set-output name=dependencies::`cat make/autoconf/version-numbers make/conf/test-dependencies | sed -e '1i {' -e 's/#.*//g' -e 's/\"//g' -e 's/\\(.*\\)=\\(.*\\)/\"\\1\": \"\\2\",/g' -e '$s/,\\s\\{0,\\}$/\\}/'`"
|
||||
working-directory: jdk
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Print extracted dependencies to the log
|
||||
run: "echo '${{ steps.check_deps.outputs.dependencies }}'"
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Determine the jtreg ref to checkout
|
||||
run: "echo JTREG_REF=jtreg${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }} >> $GITHUB_ENV"
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Check if a jtreg image is present in the cache
|
||||
id: jtreg
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/jtreg/
|
||||
key: jtreg-${{ env.JTREG_REF }}-v1
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
- name: Checkout the jtreg source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: "openjdk/jtreg"
|
||||
ref: ${{ env.JTREG_REF }}
|
||||
path: jtreg
|
||||
if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Build jtreg
|
||||
run: sh make/build-all.sh ${JAVA_HOME}
|
||||
working-directory: jtreg
|
||||
if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Move jtreg image to destination folder
|
||||
run: mv build/images/jtreg ~/
|
||||
working-directory: jtreg
|
||||
if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Store jtreg for use by later steps
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ steps.check_bundle_id.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.check_submit.outputs.should_run != 'false'
|
||||
|
||||
linux_x64_build:
|
||||
name: Linux x64
|
||||
runs-on: "ubuntu-latest"
|
||||
needs: prerequisites
|
||||
if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_x64 != 'false'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor:
|
||||
- build release
|
||||
- build debug
|
||||
- build hotspot no-pch
|
||||
include:
|
||||
- flavor: build debug
|
||||
flags: --enable-debug
|
||||
artifact: -debug
|
||||
- flavor: build hotspot no-pch
|
||||
flags: --disable-precompiled-headers
|
||||
build-target: hotspot
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
|
||||
- name: Download boot JDK
|
||||
run: |
|
||||
mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
|
||||
wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
|
||||
echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
|
||||
tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
|
||||
mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
path: gtest
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
|
||||
|
||||
- name: Configure
|
||||
run: >
|
||||
bash configure
|
||||
--with-conf-name=linux-x64
|
||||
${{ matrix.flags }}
|
||||
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
|
||||
--with-version-build=0
|
||||
--with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}
|
||||
--with-jtreg=${HOME}/jtreg
|
||||
--with-gtest=${GITHUB_WORKSPACE}/gtest
|
||||
--with-default-make-target="product-bundles test-bundles"
|
||||
--with-zlib=system
|
||||
--enable-jtreg-failure-handler
|
||||
working-directory: jdk
|
||||
|
||||
- name: Build
|
||||
run: make CONF_NAME=linux-x64 ${{ matrix.build-target }}
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
jdk/build/linux-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz
|
||||
jdk/build/linux-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}.tar.gz
|
||||
if: matrix.build-target == false
|
||||
|
||||
linux_x64_test:
|
||||
name: Linux x64
|
||||
runs-on: "ubuntu-latest"
|
||||
needs:
|
||||
- prerequisites
|
||||
- linux_x64_build
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test:
|
||||
- jdk/tier1 part 1
|
||||
- jdk/tier1 part 2
|
||||
- jdk/tier1 part 3
|
||||
- langtools/tier1
|
||||
- hs/tier1 common
|
||||
- hs/tier1 compiler
|
||||
- hs/tier1 gc
|
||||
- hs/tier1 runtime
|
||||
- hs/tier1 serviceability
|
||||
include:
|
||||
- test: jdk/tier1 part 1
|
||||
suites: test/jdk/:tier1_part1
|
||||
- test: jdk/tier1 part 2
|
||||
suites: test/jdk/:tier1_part2
|
||||
- test: jdk/tier1 part 3
|
||||
suites: test/jdk/:tier1_part3
|
||||
- test: langtools/tier1
|
||||
suites: test/langtools/:tier1
|
||||
- test: hs/tier1 common
|
||||
suites: test/hotspot/jtreg/:tier1_common
|
||||
artifact: -debug
|
||||
- test: hs/tier1 compiler
|
||||
suites: test/hotspot/jtreg/:tier1_compiler
|
||||
artifact: -debug
|
||||
- test: hs/tier1 gc
|
||||
suites: test/hotspot/jtreg/:tier1_gc
|
||||
artifact: -debug
|
||||
- test: hs/tier1 runtime
|
||||
suites: test/hotspot/jtreg/:tier1_runtime
|
||||
artifact: -debug
|
||||
- test: hs/tier1 serviceability
|
||||
suites: test/hotspot/jtreg/:tier1_serviceability
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
|
||||
- name: Download boot JDK
|
||||
run: |
|
||||
mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
|
||||
wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
|
||||
echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
|
||||
tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
|
||||
mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Restore build artifacts
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x64${{ matrix.artifact }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build artifacts (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-linux-x64${{ matrix.artifact }}
|
||||
if: steps.build_restore.outcome == 'failure'
|
||||
|
||||
- name: Unpack jdk
|
||||
run: |
|
||||
mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}"
|
||||
tar -xf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}"
|
||||
|
||||
- name: Unpack tests
|
||||
run: |
|
||||
mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}"
|
||||
tar -xf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}"
|
||||
|
||||
- name: Find root of jdk image dir
|
||||
run: |
|
||||
imageroot=`find ${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }} -name release -type f`
|
||||
echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
|
||||
|
||||
- name: Run tests
|
||||
run: >
|
||||
JDK_IMAGE_DIR=${{ env.imageroot }}
|
||||
TEST_IMAGE_DIR=${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}
|
||||
BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION}
|
||||
JT_HOME=${HOME}/jtreg
|
||||
make test-prebuilt
|
||||
CONF_NAME=run-test-prebuilt
|
||||
LOG_CMDLINES=true
|
||||
JTREG_VERBOSE=fail,error,time
|
||||
TEST="${{ matrix.suites }}"
|
||||
TEST_OPTS_JAVA_OPTIONS=
|
||||
JTREG_KEYWORDS="!headful"
|
||||
JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
|
||||
|
||||
- name: Check that all tests executed successfully
|
||||
if: always()
|
||||
run: >
|
||||
if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
|
||||
cat build/*/test-results/*/text/newfailures.txt ;
|
||||
exit 1 ;
|
||||
fi
|
||||
|
||||
- name: Create suitable test log artifact name
|
||||
if: always()
|
||||
run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV
|
||||
|
||||
- name: Persist test logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: linux-x64${{ matrix.artifact }}_testlogs_${{ env.logsuffix }}
|
||||
path: build/*/test-results
|
||||
continue-on-error: true
|
||||
|
||||
windows_x64_build:
|
||||
name: Windows x64
|
||||
runs-on: "windows-latest"
|
||||
needs: prerequisites
|
||||
if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_windows_x64 != 'false'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor:
|
||||
- build release
|
||||
- build debug
|
||||
include:
|
||||
- flavor: build debug
|
||||
flags: --enable-debug
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Restore cygwin packages from cache
|
||||
id: cygwin
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/cygwin/packages
|
||||
key: cygwin-packages-${{ runner.os }}-v1
|
||||
|
||||
- name: Install cygwin
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
|
||||
- name: Download boot JDK
|
||||
run: |
|
||||
mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
|
||||
& curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
|
||||
$FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
|
||||
$FileHash.Hash -eq $env:BOOT_JDK_SHA256
|
||||
& tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION"
|
||||
Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
path: gtest
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Configure
|
||||
run: >
|
||||
$env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
|
||||
$env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
|
||||
& bash configure
|
||||
--with-conf-name=windows-x64
|
||||
${{ matrix.flags }}
|
||||
--with-version-opt="$env:GITHUB_ACTOR-$env:GITHUB_SHA"
|
||||
--with-version-build=0
|
||||
--with-boot-jdk="$HOME/bootjdk/$env:BOOT_JDK_VERSION"
|
||||
--with-jtreg="$HOME/jtreg"
|
||||
--with-gtest="$env:GITHUB_WORKSPACE/gtest"
|
||||
--with-default-make-target="product-bundles test-bundles"
|
||||
--enable-jtreg-failure-handler
|
||||
working-directory: jdk
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
$env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
|
||||
$env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
|
||||
& make CONF_NAME=windows-x64 ${{ matrix.build-target }}
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}.zip
|
||||
jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}.tar.gz
|
||||
jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols.tar.gz
|
||||
if: matrix.build-target == false
|
||||
|
||||
windows_x64_test:
|
||||
name: Windows x64
|
||||
runs-on: "windows-latest"
|
||||
needs:
|
||||
- prerequisites
|
||||
- windows_x64_build
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test:
|
||||
- jdk/tier1 part 1
|
||||
- jdk/tier1 part 2
|
||||
- jdk/tier1 part 3
|
||||
- langtools/tier1
|
||||
- hs/tier1 common
|
||||
- hs/tier1 compiler
|
||||
- hs/tier1 gc
|
||||
- hs/tier1 runtime
|
||||
- hs/tier1 serviceability
|
||||
include:
|
||||
- test: jdk/tier1 part 1
|
||||
suites: test/jdk/:tier1_part1
|
||||
- test: jdk/tier1 part 2
|
||||
suites: test/jdk/:tier1_part2
|
||||
- test: jdk/tier1 part 3
|
||||
suites: test/jdk/:tier1_part3
|
||||
- test: langtools/tier1
|
||||
suites: test/langtools/:tier1
|
||||
- test: hs/tier1 common
|
||||
suites: test/hotspot/jtreg/:tier1_common
|
||||
artifact: -debug
|
||||
- test: hs/tier1 compiler
|
||||
suites: test/hotspot/jtreg/:tier1_compiler
|
||||
artifact: -debug
|
||||
- test: hs/tier1 gc
|
||||
suites: test/hotspot/jtreg/:tier1_gc
|
||||
artifact: -debug
|
||||
- test: hs/tier1 runtime
|
||||
suites: test/hotspot/jtreg/:tier1_runtime
|
||||
artifact: -debug
|
||||
- test: hs/tier1 serviceability
|
||||
suites: test/hotspot/jtreg/:tier1_serviceability
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
|
||||
- name: Download boot JDK
|
||||
run: |
|
||||
mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
|
||||
& curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
|
||||
$FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
|
||||
$FileHash.Hash -eq $env:BOOT_JDK_SHA256
|
||||
& tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION"
|
||||
Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore cygwin packages from cache
|
||||
id: cygwin
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/cygwin/packages
|
||||
key: cygwin-packages-${{ runner.os }}-v1
|
||||
|
||||
- name: Install cygwin
|
||||
run: |
|
||||
New-Item -Force -ItemType directory -Path "$HOME\cygwin"
|
||||
& curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
|
||||
Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Restore build artifacts
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-windows-x64${{ matrix.artifact }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build artifacts (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-windows-x64${{ matrix.artifact }}
|
||||
if: steps.build_restore.outcome == 'failure'
|
||||
|
||||
- name: Unpack jdk
|
||||
run: |
|
||||
mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}"
|
||||
tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}.zip" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}"
|
||||
|
||||
- name: Unpack symbols
|
||||
run: |
|
||||
mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols"
|
||||
tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols.tar.gz" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols"
|
||||
|
||||
- name: Unpack tests
|
||||
run: |
|
||||
mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}"
|
||||
tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}"
|
||||
|
||||
- name: Find root of jdk image dir
|
||||
run: echo ("imageroot=" + (Get-ChildItem -Path $HOME/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }} -Filter release -Recurse -ErrorAction SilentlyContinue -Force).DirectoryName) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
|
||||
- name: Run tests
|
||||
run: >
|
||||
$env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
|
||||
$env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
|
||||
$env:JDK_IMAGE_DIR = cygpath "${{ env.imageroot }}" ;
|
||||
$env:SYMBOLS_IMAGE_DIR = cygpath "${{ env.imageroot }}" ;
|
||||
$env:TEST_IMAGE_DIR = cygpath "$HOME/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}" ;
|
||||
$env:BOOT_JDK = cygpath "$HOME/bootjdk/$env:BOOT_JDK_VERSION" ;
|
||||
$env:JT_HOME = cygpath "$HOME/jtreg" ;
|
||||
& make test-prebuilt
|
||||
CONF_NAME=run-test-prebuilt
|
||||
LOG_CMDLINES=true
|
||||
JTREG_VERBOSE=fail,error,time
|
||||
TEST=${{ matrix.suites }}
|
||||
TEST_OPTS_JAVA_OPTIONS=
|
||||
JTREG_KEYWORDS="!headful"
|
||||
JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
|
||||
|
||||
- name: Check that all tests executed successfully
|
||||
if: always()
|
||||
run: >
|
||||
if ((Get-ChildItem -Path build\*\test-results\test-summary.txt -Recurse | Select-String -Pattern "TEST SUCCESS" ).Count -eq 0) {
|
||||
Get-Content -Path build\*\test-results\*\*\newfailures.txt ;
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Create suitable test log artifact name
|
||||
if: always()
|
||||
run: echo ("logsuffix=" + ("${{ matrix.test }}" -replace "/", "_" -replace " ", "_")) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
|
||||
- name: Persist test logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: windows-x64${{ matrix.artifact }}_testlogs_${{ env.logsuffix }}
|
||||
path: build/*/test-results
|
||||
continue-on-error: true
|
||||
|
||||
macos_x64_build:
|
||||
name: macOS x64
|
||||
runs-on: "macos-latest"
|
||||
needs: prerequisites
|
||||
if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_macos_x64 != 'false'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor:
|
||||
- build release
|
||||
- build debug
|
||||
include:
|
||||
- flavor: build release
|
||||
- flavor: build debug
|
||||
flags: --enable-debug
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: jdk
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
|
||||
- name: Download boot JDK
|
||||
run: |
|
||||
mkdir -p ${HOME}/bootjdk/${BOOT_JDK_VERSION} || true
|
||||
wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
|
||||
echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | shasum -a 256 -c >/dev/null -
|
||||
tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
|
||||
mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Checkout gtest sources
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: "google/googletest"
|
||||
ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
|
||||
path: gtest
|
||||
|
||||
- name: Install dependencies
|
||||
run: brew install make
|
||||
|
||||
- name: Configure
|
||||
run: >
|
||||
bash configure
|
||||
--with-conf-name=macos-x64
|
||||
${{ matrix.flags }}
|
||||
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
|
||||
--with-version-build=0
|
||||
--with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}/Contents/Home
|
||||
--with-jtreg=${HOME}/jtreg
|
||||
--with-gtest=${GITHUB_WORKSPACE}/gtest
|
||||
--with-default-make-target="product-bundles test-bundles"
|
||||
--with-zlib=system
|
||||
--enable-jtreg-failure-handler
|
||||
working-directory: jdk
|
||||
|
||||
- name: Build
|
||||
run: make CONF_NAME=macos-x64 ${{ matrix.build-target }}
|
||||
working-directory: jdk
|
||||
|
||||
- name: Persist test bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: |
|
||||
jdk/build/macos-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}.tar.gz
|
||||
jdk/build/macos-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}.tar.gz
|
||||
if: matrix.build-target == false
|
||||
|
||||
macos_x64_test:
|
||||
name: macOS x64
|
||||
runs-on: "macos-latest"
|
||||
needs:
|
||||
- prerequisites
|
||||
- macos_x64_build
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test:
|
||||
- jdk/tier1 part 1
|
||||
- jdk/tier1 part 2
|
||||
- jdk/tier1 part 3
|
||||
- langtools/tier1
|
||||
- hs/tier1 common
|
||||
- hs/tier1 compiler
|
||||
- hs/tier1 gc
|
||||
- hs/tier1 runtime
|
||||
- hs/tier1 serviceability
|
||||
include:
|
||||
- test: jdk/tier1 part 1
|
||||
suites: test/jdk/:tier1_part1
|
||||
- test: jdk/tier1 part 2
|
||||
suites: test/jdk/:tier1_part2
|
||||
- test: jdk/tier1 part 3
|
||||
suites: test/jdk/:tier1_part3
|
||||
- test: langtools/tier1
|
||||
suites: test/langtools/:tier1
|
||||
- test: hs/tier1 common
|
||||
suites: test/hotspot/jtreg/:tier1_common
|
||||
artifact: -debug
|
||||
- test: hs/tier1 compiler
|
||||
suites: test/hotspot/jtreg/:tier1_compiler
|
||||
artifact: -debug
|
||||
- test: hs/tier1 gc
|
||||
suites: test/hotspot/jtreg/:tier1_gc
|
||||
artifact: -debug
|
||||
- test: hs/tier1 runtime
|
||||
suites: test/hotspot/jtreg/:tier1_runtime
|
||||
artifact: -debug
|
||||
- test: hs/tier1 serviceability
|
||||
suites: test/hotspot/jtreg/:tier1_serviceability
|
||||
artifact: -debug
|
||||
|
||||
env:
|
||||
JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
|
||||
BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
|
||||
BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
|
||||
BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
|
||||
BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_SHA256 }}"
|
||||
|
||||
steps:
|
||||
- name: Checkout the source
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Restore boot JDK from cache
|
||||
id: bootjdk
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
|
||||
key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
|
||||
|
||||
- name: Download boot JDK
|
||||
run: |
|
||||
mkdir -p ${HOME}/bootjdk/${BOOT_JDK_VERSION} || true
|
||||
wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
|
||||
echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | shasum -a 256 -c >/dev/null -
|
||||
tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
|
||||
mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
|
||||
if: steps.bootjdk.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Restore jtreg artifact
|
||||
id: jtreg_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore jtreg artifact (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jtreg/
|
||||
if: steps.jtreg_restore.outcome == 'failure'
|
||||
|
||||
- name: Restore build artifacts
|
||||
id: build_restore
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-macos-x64${{ matrix.artifact }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Restore build artifacts (retry)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: ~/jdk-macos-x64${{ matrix.artifact }}
|
||||
if: steps.build_restore.outcome == 'failure'
|
||||
|
||||
- name: Unpack jdk
|
||||
run: |
|
||||
mkdir -p "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}"
|
||||
tar -xf "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}"
|
||||
|
||||
- name: Unpack tests
|
||||
run: |
|
||||
mkdir -p "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}"
|
||||
tar -xf "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}"
|
||||
|
||||
- name: Install dependencies
|
||||
run: brew install make
|
||||
|
||||
- name: Find root of jdk image dir
|
||||
run: |
|
||||
imageroot=`find ${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }} -name release -type f`
|
||||
echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
|
||||
|
||||
- name: Run tests
|
||||
run: >
|
||||
JDK_IMAGE_DIR=${{ env.imageroot }}
|
||||
TEST_IMAGE_DIR=${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}
|
||||
BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION}/Contents/Home
|
||||
JT_HOME=${HOME}/jtreg
|
||||
gmake test-prebuilt
|
||||
CONF_NAME=run-test-prebuilt
|
||||
LOG_CMDLINES=true
|
||||
JTREG_VERBOSE=fail,error,time
|
||||
TEST=${{ matrix.suites }}
|
||||
TEST_OPTS_JAVA_OPTIONS=
|
||||
JTREG_KEYWORDS="!headful"
|
||||
JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
|
||||
|
||||
- name: Check that all tests executed successfully
|
||||
if: always()
|
||||
run: >
|
||||
if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
|
||||
cat build/*/test-results/*/text/newfailures.txt ;
|
||||
exit 1 ;
|
||||
fi
|
||||
|
||||
- name: Create suitable test log artifact name
|
||||
if: always()
|
||||
run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV
|
||||
|
||||
- name: Persist test logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: macos-x64${{ matrix.artifact }}_testlogs_${{ env.logsuffix }}
|
||||
path: build/*/test-results
|
||||
continue-on-error: true
|
||||
|
||||
artifacts:
|
||||
name: Post-process artifacts
|
||||
runs-on: "ubuntu-latest"
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
needs:
|
||||
- linux_x64_test
|
||||
- windows_x64_test
|
||||
- macos_x64_test
|
||||
|
||||
steps:
|
||||
- name: Determine current artifacts endpoint
|
||||
id: actions_runtime
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
script: "return { url: process.env['ACTIONS_RUNTIME_URL'], token: process.env['ACTIONS_RUNTIME_TOKEN'] }"
|
||||
|
||||
- name: Display current artifacts
|
||||
run: >
|
||||
curl -s -H 'Accept: application/json;api-version=6.0-preview'
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
|
||||
'${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview'
|
||||
|
||||
- name: Delete transient artifacts
|
||||
run: >
|
||||
for url in `
|
||||
curl -s -H 'Accept: application/json;api-version=6.0-preview'
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
|
||||
'${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview' |
|
||||
jq -r -c '.value | map(select(.name|startswith("transient_"))) | .[].url'`; do
|
||||
curl -s -H 'Accept: application/json;api-version=6.0-preview'
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
|
||||
-X DELETE "${url}";
|
||||
done
|
||||
|
||||
- name: Fetch remaining artifacts (test results)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: test-results
|
||||
|
||||
- name: Delete remaining artifacts
|
||||
run: >
|
||||
for url in `
|
||||
curl -s -H 'Accept: application/json;api-version=6.0-preview'
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
|
||||
'${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview' |
|
||||
jq -r -c '.value | .[].url'`; do
|
||||
curl -s -H 'Accept: application/json;api-version=6.0-preview'
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
|
||||
-X DELETE "${url}";
|
||||
done
|
||||
|
||||
- name: Upload a combined test results artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: test-results_${{ needs.prerequisites.outputs.bundle_id }}
|
||||
path: test-results
|
||||
28
.hgtags
28
.hgtags
@@ -635,6 +635,30 @@ dd5198db2e5b1ebcafe065d987c03ba9fcb50fc3 jdk-15+17
|
||||
7223c6d610343fd8323af9d07d501e01fa1a7696 jdk-15+22
|
||||
f143729ca00ec14a98ea5c7f73acba88da97746e jdk-15+23
|
||||
497fd9f9129c4928fd5a876dd55e0daf6298b511 jdk-15+24
|
||||
58833044988772ca06c97ab2f142474a8627af80 jdk-15+25
|
||||
58833044988772ca06c97ab2f142474a8627af80 jdk-15+25
|
||||
90b266a84c06f1b3dc0ed8767856793e8c1c357e jdk-15+25
|
||||
0a32396f7a690015d22ca3328ac441a358295d90 jdk-15+26
|
||||
93813843680bbe1b7efbca56c03fd137f20a2c31 jdk-16+0
|
||||
93813843680bbe1b7efbca56c03fd137f20a2c31 jdk-15+27
|
||||
4a485c89d5a08b495961835f5308a96038678aeb jdk-16+1
|
||||
06c9f89459daba98395fad726100feb44f89ba71 jdk-15+28
|
||||
bcbe7b8a77b8971bc221c0be1bd2abb6fb68c2d0 jdk-16+2
|
||||
b58fc60580550a4a587cab729d8fd87223ad6932 jdk-15+29
|
||||
76810b3a88c8c641ae3850a8dfd7c40c984aea9d jdk-16+3
|
||||
6909e4a1f25bfe9a2727026f5845fc1fc44a36aa jdk-15+30
|
||||
e2622818f0bd30e736252eba101fe7d2c27f400b jdk-16+4
|
||||
a32f58c6b8be81877411767de7ba9c4cf087c1b5 jdk-15+31
|
||||
143e258f64af490010eb7e0bacc1cfaeceff0993 jdk-16+5
|
||||
2dad000726b8d5db9f3df647fb4949d88f269dd4 jdk-15+32
|
||||
4a8fd81d64bafa523cddb45f82805536edace106 jdk-16+6
|
||||
6b65f4e7a975628df51ef755b02642075390041d jdk-15+33
|
||||
c3a4a7ea7c304cabdacdc31741eb94c51351668d jdk-16+7
|
||||
b0817631d2f4395508cb10e81c3858a94d9ae4de jdk-15+34
|
||||
0a73d6f3aab48ff6d7e61e47f0bc2d87a054f217 jdk-16+8
|
||||
fd60c3146a024037cdd9be34c645bb793995a7cc jdk-15+35
|
||||
c075a286cc7df767cce28e8057d6ec5051786490 jdk-16+9
|
||||
b01985b4f88f554f97901e53e1ba314681dd9c19 jdk-16+10
|
||||
e3f940bd3c8fcdf4ca704c6eb1ac745d155859d5 jdk-15+36
|
||||
5c18d696c7ce724ca36df13933aa53f50e12b9e0 jdk-16+11
|
||||
fc8e62b399bd93d06e8d13dc3b384c450e853dcd jdk-16+12
|
||||
fd07cdb26fc70243ef23d688b545514f4ddf1c2b jdk-16+13
|
||||
36b29df125dc88f11657ce93b4998aa9ff5f5d41 jdk-16+14
|
||||
|
||||
33
.jcheck/conf
33
.jcheck/conf
@@ -1,2 +1,33 @@
|
||||
[general]
|
||||
project=jdk
|
||||
bugids=dup
|
||||
jbs=JDK
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
|
||||
|
||||
[repository]
|
||||
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)
|
||||
branches=
|
||||
|
||||
[census]
|
||||
version=0
|
||||
domain=openjdk.org
|
||||
|
||||
[checks "whitespace"]
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm
|
||||
|
||||
[checks "merge"]
|
||||
message=Merge
|
||||
|
||||
[checks "reviewers"]
|
||||
reviewers=1
|
||||
ignore=duke
|
||||
|
||||
[checks "committer"]
|
||||
role=committer
|
||||
|
||||
[checks "issues"]
|
||||
pattern=^([124-8][0-9]{6}): (\S.*)$
|
||||
|
||||
[checks "problemlists"]
|
||||
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp
|
||||
|
||||
3
CONTRIBUTING.md
Normal file
3
CONTRIBUTING.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Contributing to the JDK
|
||||
|
||||
Please see <https://openjdk.java.net/contribute/> for how to contribute.
|
||||
12
README
12
README
@@ -1,12 +0,0 @@
|
||||
|
||||
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:
|
||||
|
||||
* 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.
|
||||
11
README.md
Normal file
11
README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Welcome to the JDK!
|
||||
|
||||
For build instructions please see the
|
||||
[online documentation](https://openjdk.java.net/groups/build/doc/building.html),
|
||||
or either of these files:
|
||||
|
||||
- [doc/building.html](doc/building.html) (html version)
|
||||
- [doc/building.md](doc/building.md) (markdown version)
|
||||
|
||||
See <https://openjdk.java.net/> for more information about
|
||||
the OpenJDK Community and the JDK.
|
||||
69
bin/idea.sh
69
bin/idea.sh
@@ -147,13 +147,7 @@ add_replacement() {
|
||||
add_replacement "###MODULE_NAMES###" "$MODULE_NAMES"
|
||||
add_replacement "###VCS_TYPE###" "$VCS_TYPE"
|
||||
SPEC_DIR=`dirname $SPEC`
|
||||
if [ "x$CYGPATH" = "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "$SPEC_DIR"
|
||||
add_replacement "###JTREG_HOME###" "$JT_HOME"
|
||||
add_replacement "###IMAGES_DIR###" "$SPEC_DIR/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "$TOPLEVEL_DIR"
|
||||
add_replacement "###IDEA_DIR###" "$IDEA_OUTPUT"
|
||||
else
|
||||
if [ "x$CYGPATH" != "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "`cygpath -am $SPEC_DIR`"
|
||||
add_replacement "###IMAGES_DIR###" "`cygpath -am $SPEC_DIR`/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "`cygpath -am $TOPLEVEL_DIR`"
|
||||
@@ -163,6 +157,22 @@ else
|
||||
else
|
||||
add_replacement "###JTREG_HOME###" "`cygpath -am $JT_HOME`"
|
||||
fi
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "`wslpath -am $SPEC_DIR`"
|
||||
add_replacement "###IMAGES_DIR###" "`wslpath -am $SPEC_DIR`/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "`wslpath -am $TOPLEVEL_DIR`"
|
||||
add_replacement "###IDEA_DIR###" "`wslpath -am $IDEA_OUTPUT`"
|
||||
if [ "x$JT_HOME" = "x" ]; then
|
||||
add_replacement "###JTREG_HOME###" ""
|
||||
else
|
||||
add_replacement "###JTREG_HOME###" "`wslpath -am $JT_HOME`"
|
||||
fi
|
||||
else
|
||||
add_replacement "###BUILD_DIR###" "$SPEC_DIR"
|
||||
add_replacement "###JTREG_HOME###" "$JT_HOME"
|
||||
add_replacement "###IMAGES_DIR###" "$SPEC_DIR/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "$TOPLEVEL_DIR"
|
||||
add_replacement "###IDEA_DIR###" "$IDEA_OUTPUT"
|
||||
fi
|
||||
|
||||
SOURCE_PREFIX="<sourceFolder url=\"file://"
|
||||
@@ -170,9 +180,22 @@ SOURCE_POSTFIX="\" isTestSource=\"false\" />"
|
||||
|
||||
for root in $MODULE_ROOTS; do
|
||||
if [ "x$CYGPATH" != "x" ]; then
|
||||
root=`cygpath -am $root`
|
||||
root=`cygpath -am $root`
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
root=`wslpath -am $root`
|
||||
fi
|
||||
|
||||
VM_CI="jdk.internal.vm.ci/share/classes"
|
||||
VM_COMPILER="src/jdk.internal.vm.compiler/share/classes"
|
||||
if test "${root#*$VM_CI}" != "$root" || test "${root#*$VM_COMPILER}" != "$root"; then
|
||||
for subdir in "$root"/*; do
|
||||
if [ -d "$subdir" ]; then
|
||||
SOURCES=$SOURCES" $SOURCE_PREFIX""$subdir"/src"$SOURCE_POSTFIX"
|
||||
fi
|
||||
done
|
||||
else
|
||||
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
|
||||
fi
|
||||
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
|
||||
done
|
||||
|
||||
add_replacement "###SOURCE_ROOTS###" "$SOURCES"
|
||||
@@ -196,16 +219,30 @@ fi
|
||||
CP=$ANT_HOME/lib/ant.jar
|
||||
rm -rf $CLASSES; mkdir $CLASSES
|
||||
|
||||
if [ "x$CYGPATH" = "x" ] ; then ## CYGPATH may be set in env.cfg
|
||||
JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java
|
||||
JAVAC_SOURCE_PATH=$IDEA_OUTPUT/src
|
||||
JAVAC_CLASSES=$CLASSES
|
||||
JAVAC_CP=$CP
|
||||
else
|
||||
if [ "x$CYGPATH" != "x" ] ; then ## CYGPATH may be set in env.cfg
|
||||
JAVAC_SOURCE_FILE=`cygpath -am $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
|
||||
JAVAC_SOURCE_PATH=`cygpath -am $IDEA_OUTPUT/src`
|
||||
JAVAC_CLASSES=`cygpath -am $CLASSES`
|
||||
JAVAC_CP=`cygpath -am $CP`
|
||||
JAVAC=javac
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
JAVAC_SOURCE_FILE=`realpath --relative-to=./ $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
|
||||
JAVAC_SOURCE_PATH=`realpath --relative-to=./ $IDEA_OUTPUT/src`
|
||||
JAVAC_CLASSES=`realpath --relative-to=./ $CLASSES`
|
||||
ANT_TEMP=`mktemp -d -p ./`
|
||||
cp $ANT_HOME/lib/ant.jar $ANT_TEMP/ant.jar
|
||||
JAVAC_CP=$ANT_TEMP/ant.jar
|
||||
JAVAC=javac.exe
|
||||
else
|
||||
JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java
|
||||
JAVAC_SOURCE_PATH=$IDEA_OUTPUT/src
|
||||
JAVAC_CLASSES=$CLASSES
|
||||
JAVAC_CP=$CP
|
||||
JAVAC=javac
|
||||
fi
|
||||
|
||||
$BOOT_JDK/bin/javac -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE
|
||||
$BOOT_JDK/bin/$JAVAC -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE
|
||||
|
||||
if [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
rm -rf $ANT_TEMP
|
||||
fi
|
||||
@@ -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 ${@}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">Linux</td>
|
||||
<td style="text-align: left;">gcc 9.2.0</td>
|
||||
<td style="text-align: left;">gcc 10.2.0</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">macOS</td>
|
||||
@@ -273,17 +273,17 @@
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">Windows</td>
|
||||
<td style="text-align: left;">Microsoft Visual Studio 2019 update 16.5.3</td>
|
||||
<td style="text-align: left;">Microsoft Visual Studio 2019 update 16.7.2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>All compilers are expected to be able to compile to the C99 language standard, as some C99 features are used in the source code. Microsoft Visual Studio doesn't fully support C99 so in practice shared code is limited to using C99 features that it does support.</p>
|
||||
<h3 id="gcc">gcc</h3>
|
||||
<p>The minimum accepted version of gcc is 5.0. Older versions will generate a warning by <code>configure</code> and are unlikely to work.</p>
|
||||
<p>The JDK is currently known to be able to compile with at least version 9.2 of gcc.</p>
|
||||
<p>The JDK is currently known to be able to compile with at least version 10.2 of gcc.</p>
|
||||
<p>In general, any version between these two should be usable.</p>
|
||||
<h3 id="clang">clang</h3>
|
||||
<p>The minimum accepted version of clang is 3.2. Older versions will not be accepted by <code>configure</code>.</p>
|
||||
<p>The minimum accepted version of clang is 3.5. Older versions will not be accepted by <code>configure</code>.</p>
|
||||
<p>To use clang instead of gcc on Linux, use <code>--with-toolchain-type=clang</code>.</p>
|
||||
<h3 id="apple-xcode">Apple Xcode</h3>
|
||||
<p>The oldest supported version of Xcode is 8.</p>
|
||||
@@ -292,9 +292,8 @@
|
||||
<p>It is advisable to keep an older version of Xcode for building the JDK when updating Xcode. This <a href="http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html">blog page</a> has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use <code>xcode-select -s</code> before running <code>configure</code>, or use <code>--with-toolchain-path</code> to point to the version of Xcode to use, e.g. <code>configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin</code></p>
|
||||
<p>If you have recently (inadvertently) updated your OS and/or Xcode version, and the JDK can no longer be built, please see the section on <a href="#problems-with-the-build-environment">Problems with the Build Environment</a>, and <a href="#getting-help">Getting Help</a> to find out if there are any recent, non-merged patches available for this update.</p>
|
||||
<h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
|
||||
<p>The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by <code>configure</code>. The maximum accepted version of Visual Studio is 2019. Versions older than 2017 are unlikely to continue working for long.</p>
|
||||
<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2015</code>.</p>
|
||||
<p>If you get <code>LINK: fatal error LNK1123: failure during conversion to COFF: file invalid</code> when building using Visual Studio 2010, you have encountered <a href="http://support.microsoft.com/kb/2757355">KB2757355</a>, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See <a href="https://stackoverflow.com/questions/10888391">this stackoverflow discussion</a> for other suggestions.</p>
|
||||
<p>The minimum accepted version of Visual Studio is 2017. Older versions will not be accepted by <code>configure</code> and will not work. The maximum accepted version of Visual Studio is 2019.</p>
|
||||
<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2017</code>.</p>
|
||||
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
|
||||
<p>Please consult the AIX section of the <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a> OpenJDK Build Wiki page for details about which versions of XLC are supported.</p>
|
||||
<h2 id="boot-jdk-requirements">Boot JDK Requirements</h2>
|
||||
|
||||
@@ -302,9 +302,9 @@ issues.
|
||||
|
||||
Operating system Toolchain version
|
||||
------------------ -------------------------------------------------------
|
||||
Linux gcc 9.2.0
|
||||
Linux gcc 10.2.0
|
||||
macOS Apple Xcode 10.1 (using clang 10.0.0)
|
||||
Windows Microsoft Visual Studio 2019 update 16.5.3
|
||||
Windows Microsoft Visual Studio 2019 update 16.7.2
|
||||
|
||||
All compilers are expected to be able to compile to the C99 language standard,
|
||||
as some C99 features are used in the source code. Microsoft Visual Studio
|
||||
@@ -316,14 +316,14 @@ features that it does support.
|
||||
The minimum accepted version of gcc is 5.0. Older versions will generate a warning
|
||||
by `configure` and are unlikely to work.
|
||||
|
||||
The JDK is currently known to be able to compile with at least version 9.2 of
|
||||
The JDK is currently known to be able to compile with at least version 10.2 of
|
||||
gcc.
|
||||
|
||||
In general, any version between these two should be usable.
|
||||
|
||||
### clang
|
||||
|
||||
The minimum accepted version of clang is 3.2. Older versions will not be
|
||||
The minimum accepted version of clang is 3.5. Older versions will not be
|
||||
accepted by `configure`.
|
||||
|
||||
To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
|
||||
@@ -355,20 +355,13 @@ available for this update.
|
||||
|
||||
### Microsoft Visual Studio
|
||||
|
||||
The minimum accepted version of Visual Studio is 2010. Older versions will not
|
||||
be accepted by `configure`. The maximum accepted version of Visual Studio is
|
||||
2019. Versions older than 2017 are unlikely to continue working for long.
|
||||
The minimum accepted version of Visual Studio is 2017. Older versions will not
|
||||
be accepted by `configure` and will not work. The maximum accepted
|
||||
version of Visual Studio is 2019.
|
||||
|
||||
If you have multiple versions of Visual Studio installed, `configure` will by
|
||||
default pick the latest. You can request a specific version to be used by
|
||||
setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2015`.
|
||||
|
||||
If you get `LINK: fatal error LNK1123: failure during conversion to COFF: file
|
||||
invalid` when building using Visual Studio 2010, you have encountered
|
||||
[KB2757355](http://support.microsoft.com/kb/2757355), a bug triggered by a
|
||||
specific installation order. However, the solution suggested by the KB article
|
||||
does not always resolve the problem. See [this stackoverflow discussion](
|
||||
https://stackoverflow.com/questions/10888391) for other suggestions.
|
||||
setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2017`.
|
||||
|
||||
### IBM XL C/C++
|
||||
|
||||
|
||||
329
doc/hotspot-style.html
Normal file
329
doc/hotspot-style.html
Normal file
@@ -0,0 +1,329 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>HotSpot Coding Style</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">HotSpot Coding Style</h1>
|
||||
</header>
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#introduction">Introduction</a><ul>
|
||||
<li><a href="#why-care-about-style">Why Care About Style?</a></li>
|
||||
<li><a href="#counterexamples-and-updates">Counterexamples and Updates</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#structure-and-formatting">Structure and Formatting</a><ul>
|
||||
<li><a href="#factoring-and-class-design">Factoring and Class Design</a></li>
|
||||
<li><a href="#source-files">Source Files</a></li>
|
||||
<li><a href="#jtreg-tests">JTReg Tests</a></li>
|
||||
<li><a href="#naming">Naming</a></li>
|
||||
<li><a href="#commenting">Commenting</a></li>
|
||||
<li><a href="#macros">Macros</a></li>
|
||||
<li><a href="#whitespace">Whitespace</a></li>
|
||||
<li><a href="#miscellaneous">Miscellaneous</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#use-of-c-features">Use of C++ Features</a><ul>
|
||||
<li><a href="#error-handling">Error Handling</a></li>
|
||||
<li><a href="#rtti-runtime-type-information">RTTI (Runtime Type Information)</a></li>
|
||||
<li><a href="#memory-allocation">Memory Allocation</a></li>
|
||||
<li><a href="#class-inheritance">Class Inheritance</a></li>
|
||||
<li><a href="#namespaces">Namespaces</a></li>
|
||||
<li><a href="#c-standard-library">C++ Standard Library</a></li>
|
||||
<li><a href="#type-deduction">Type Deduction</a></li>
|
||||
<li><a href="#expression-sfinae">Expression SFINAE</a></li>
|
||||
<li><a href="#enum">enum</a></li>
|
||||
<li><a href="#thread_local">thread_local</a></li>
|
||||
<li><a href="#nullptr">nullptr</a></li>
|
||||
<li><a href="#atomic"><atomic></a></li>
|
||||
<li><a href="#additional-permitted-features">Additional Permitted Features</a></li>
|
||||
<li><a href="#excluded-features">Excluded Features</a></li>
|
||||
<li><a href="#undecided-features">Undecided Features</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
<p>This is a collection of rules, guidelines, and suggestions for writing HotSpot code. Following these will help new code fit in with existing HotSpot code, making it easier to read and maintain. Failure to follow these guidelines may lead to discussion during code reviews, if not outright rejection of a change.</p>
|
||||
<h3 id="why-care-about-style">Why Care About Style?</h3>
|
||||
<p>Some programmers seem to have lexers and even C preprocessors installed directly behind their eyeballs. The rest of us require code that is not only functionally correct but also easy to read. More than that, since there is no one style for easy-to-read code, and since a mashup of many styles is just as confusing as no style at all, it is important for coders to be conscious of the many implicit stylistic choices that historically have gone into the HotSpot code base.</p>
|
||||
<p>Some of these guidelines are driven by the cross-platform requirements for HotSpot. Shared code must work on a variety of platforms, and may encounter deficiencies in some. Using platform conditionalization in shared code is usually avoided, while shared code is strongly preferred to multiple platform-dependent implementations, so some language features may be recommended against.</p>
|
||||
<p>Some of the guidelines here are relatively arbitrary choices among equally plausible alternatives. The purpose of stating and enforcing these rules is largely to provide a consistent look to the code. That consistency makes the code more readable by avoiding non-functional distractions from the interesting functionality.</p>
|
||||
<p>When changing pre-existing code, it is reasonable to adjust it to match these conventions. Exception: If the pre-existing code clearly conforms locally to its own peculiar conventions, it is not worth reformatting the whole thing. Also consider separating changes that make extensive stylistic updates from those which make functional changes.</p>
|
||||
<h3 id="counterexamples-and-updates">Counterexamples and Updates</h3>
|
||||
<p>Many of the guidelines mentioned here have (sometimes widespread) counterexamples in the HotSpot code base. Finding a counterexample is not sufficient justification for new code to follow the counterexample as a precedent, since readers of your code will rightfully expect your code to follow the greater bulk of precedents documented here.</p>
|
||||
<p>Occasionally a guideline mentioned here may be just out of synch with the actual HotSpot code base. If you find that a guideline is consistently contradicted by a large number of counterexamples, please bring it up for discussion and possible change. The architectural rule, of course, is "When in Rome do as the Romans". Sometimes in the suburbs of Rome the rules are a little different; these differences can be pointed out here.</p>
|
||||
<p>Proposed changes should be discussed on the <a href="mailto:hotspot-dev@openjdk.java.net">HotSpot Developers</a> mailing list, and approved by <a href="https://en.wikipedia.org/wiki/Rough_consensus">rough consensus</a> of the <a href="https://openjdk.java.net/census#hotspot">HotSpot Group</a> Members. The Group Lead determines whether consensus has been reached. Changes are likely to be cautious and incremental, since HotSpot coders have been using these guidelines for years.</p>
|
||||
<h2 id="structure-and-formatting">Structure and Formatting</h2>
|
||||
<h3 id="factoring-and-class-design">Factoring and Class Design</h3>
|
||||
<ul>
|
||||
<li><p>Group related code together, so readers can concentrate on one section of one file.</p></li>
|
||||
<li><p>Classes are the primary code structuring mechanism. Place related functionality in a class, or a set of related classes. Use of either namespaces or public non-member functions is rare in HotSpot code. Static non-member functions are not uncommon.</p></li>
|
||||
<li><p>If a class <code>FooBar</code> is going to be used in more than one place, put it a file named fooBar.hpp and fooBar.cpp. If the class is a sidekick to a more important class <code>BazBat</code>, it can go in bazBat.hpp.</p></li>
|
||||
<li><p>Put a member function <code>FooBar::bang</code> into the same file that defined <code>FooBar</code>, or its associated <em>.inline.hpp or </em>.cpp file.</p></li>
|
||||
<li><p>Use public accessor functions for member variables accessed outside the class.</p></li>
|
||||
<li><p>Assign names to constant literals and use the names instead.</p></li>
|
||||
<li><p>Keep functions small, a screenful at most. Split out chunks of logic into file-local classes or static functions if needed.</p></li>
|
||||
<li><p>Factor away nonessential complexity into local inline helper functions and helper classes.</p></li>
|
||||
<li><p>Think clearly about internal invariants that apply to each class, and document them in the form of asserts within member functions.</p></li>
|
||||
<li><p>Make simple, self-evident contracts for member functions. If you cannot communicate a simple contract, redesign the class.</p></li>
|
||||
<li><p>Implement classes as if expecting rough usage by clients. Check for incorrect usage of a class using <code>assert(...)</code>, <code>guarantee(...)</code>, <code>ShouldNotReachHere()</code> and comments wherever needed. Performance is almost never a reason to omit asserts.</p></li>
|
||||
<li><p>When possible, design as if for reusability. This forces a clear design of the class's externals, and clean hiding of its internals.</p></li>
|
||||
<li><p>Initialize all variables and data structures to a known state. If a class has a constructor, initialize it there.</p></li>
|
||||
<li><p>Do no optimization before its time. Prove the need to optimize.</p></li>
|
||||
<li><p>When you must defactor to optimize, preserve as much structure as possible. If you must hand-inline some name, label the local copy with the original name.</p></li>
|
||||
<li><p>If you need to use a hidden detail (e.g., a structure offset), name it (as a constant or function) in the class that owns it.</p></li>
|
||||
<li><p>Don't use the Copy and Paste keys to replicate more than a couple lines of code. Name what you must repeat.</p></li>
|
||||
<li><p>If a class needs a member function to change a user-visible attribute, the change should be done with a "setter" accessor matched to the simple "getter".</p></li>
|
||||
</ul>
|
||||
<h3 id="source-files">Source Files</h3>
|
||||
<ul>
|
||||
<li><p>All source files must have a globally unique basename. The build system depends on this uniqueness.</p></li>
|
||||
<li><p>Do not put non-trivial function implementations in .hpp files. If the implementation depends on other .hpp files, put it in a .cpp or a .inline.hpp file.</p></li>
|
||||
<li><p>.inline.hpp files should only be included in .cpp or .inline.hpp files.</p></li>
|
||||
<li><p>All .cpp files include precompiled.hpp as the first include line.</p></li>
|
||||
<li><p>precompiled.hpp is just a build time optimization, so don't rely on it to resolve include problems.</p></li>
|
||||
<li><p>Keep the include lines alphabetically sorted.</p></li>
|
||||
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of the include list.</p></li>
|
||||
</ul>
|
||||
<h3 id="jtreg-tests">JTReg Tests</h3>
|
||||
<ul>
|
||||
<li><p>JTReg tests should have meaningful names.</p></li>
|
||||
<li><p>JTReg tests associated with specific bugs should be tagged with the <code>@bug</code> keyword in the test description.</p></li>
|
||||
<li><p>JTReg tests should be organized by component or feature under <code>test/</code>, in a directory hierarchy that generally follows that of the <code>src/</code> directory. There may be additional subdirectories to further categorize tests by feature. This structure makes it easy to run a collection of tests associated with a specific feature by specifying the associated directory as the source of the tests to run.</p>
|
||||
<ul>
|
||||
<li>Some (older) tests use the associated bug number in the directory name, the test name, or both. That naming style should no longer be used, with existing tests using that style being candidates for migration.</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h3 id="naming">Naming</h3>
|
||||
<ul>
|
||||
<li><p>The length of a name may be correlated to the size of its scope. In particular, short names (even single letter names) may be fine in a small scope, but are usually inappropriate for larger scopes.</p></li>
|
||||
<li><p>Prefer whole words rather than abbreviations, unless the abbreviation is more widely used than the long form in the code's domain.</p></li>
|
||||
<li><p>Choose names consistently. Do not introduce spurious variations. Abbreviate corresponding terms to a consistent length.</p></li>
|
||||
<li><p>Global names must be unique, to avoid <a href="https://en.cppreference.com/w/cpp/language/definition" title="One Definition Rule">One Definition Rule</a> (ODR) violations. A common prefixing scheme for related global names is often used. (This is instead of using namespaces, which are mostly avoided in HotSpot.)</p></li>
|
||||
<li><p>Don't give two names to the semantically same thing. But use different names for semantically different things, even if they are representationally the same. (So use meaningful <code>typedef</code> or template alias names where appropriate.)</p></li>
|
||||
<li><p>When choosing names, avoid categorical nouns like "variable", "field", "parameter", "value", and verbs like "compute", "get". (<code>storeValue(int param)</code> is bad.)</p></li>
|
||||
<li><p>Type names and global names should use mixed-case with the first letter of each word capitalized (<code>FooBar</code>).</p></li>
|
||||
<li><p>Embedded abbreviations in otherwise mixed-case names are usually capitalized entirely rather than being treated as a single word with only the initial letter capitalized, e.g. "HTML" rather than "Html".</p></li>
|
||||
<li><p>Function and local variable names use lowercase with words separated by a single underscore (<code>foo_bar</code>).</p></li>
|
||||
<li><p>Class data member names have a leading underscore, and use lowercase with words separated by a single underscore (<code>_foo_bar</code>).</p></li>
|
||||
<li><p>Constant names may be upper-case or mixed-case, according to historical necessity. (Note: There are many examples of constants with lowercase names.)</p></li>
|
||||
<li><p>Constant names should follow an existing pattern, and must have a distinct appearance from other names in related APIs.</p></li>
|
||||
<li><p>Class and type names should be noun phrases. Consider an "er" suffix for a class that represents an action.</p></li>
|
||||
<li><p>Function names should be verb phrases that reflect changes of state known to a class's user, or else noun phrases if they cause no change of state visible to the class's user.</p></li>
|
||||
<li><p>Getter accessor names are noun phrases, with no "<code>get_</code>" noise word. Boolean getters can also begin with "<code>is_</code>" or "<code>has_</code>". Member function for reading data members usually have the same name as the data member, exclusive of the leading underscore.</p></li>
|
||||
<li><p>Setter accessor names prepend "<code>set_</code>" to the getter name.</p></li>
|
||||
<li><p>Other member function names are verb phrases, as if commands to the receiver.</p></li>
|
||||
<li><p>Avoid leading underscores (as "<code>_oop</code>") except in cases required above. (Names with leading underscores can cause portability problems.)</p></li>
|
||||
</ul>
|
||||
<h3 id="commenting">Commenting</h3>
|
||||
<ul>
|
||||
<li><p>Clearly comment subtle fixes.</p></li>
|
||||
<li><p>Clearly comment tricky classes and functions.</p></li>
|
||||
<li><p>If you have to choose between commenting code and writing wiki content, comment the code. Link from the wiki to the source file if it makes sense.</p></li>
|
||||
<li><p>As a general rule don't add bug numbers to comments (they would soon overwhelm the code). But if the bug report contains significant information that can't reasonably be added as a comment, then refer to the bug report.</p></li>
|
||||
<li><p>Personal names are discouraged in the source code, which is a team product.</p></li>
|
||||
</ul>
|
||||
<h3 id="macros">Macros</h3>
|
||||
<ul>
|
||||
<li><p>You can almost always use an inline function or class instead of a macro. Use a macro only when you really need it.</p></li>
|
||||
<li><p>Templates may be preferable to multi-line macros. (There may be subtle performance effects with templates on some platforms; revert to macros if absolutely necessary.)</p></li>
|
||||
<li><p><code>#ifdef</code>s should not be used to introduce platform-specific code into shared code (except for <code>_LP64</code>). They must be used to manage header files, in the pattern found at the top of every source file. They should be used mainly for major build features, including <code>PRODUCT</code>, <code>ASSERT</code>, <code>_LP64</code>, <code>INCLUDE_SERIALGC</code>, <code>COMPILER1</code>, etc.</p></li>
|
||||
<li><p>For build features such as <code>PRODUCT</code>, use <code>#ifdef PRODUCT</code> for multiple-line inclusions or exclusions.</p></li>
|
||||
<li><p>For short inclusions or exclusions based on build features, use macros like <code>PRODUCT_ONLY</code> and <code>NOT_PRODUCT</code>. But avoid using them with multiple-line arguments, since debuggers do not handle that well.</p></li>
|
||||
<li><p>Use <code>CATCH</code>, <code>THROW</code>, etc. for HotSpot-specific exception processing.</p></li>
|
||||
</ul>
|
||||
<h3 id="whitespace">Whitespace</h3>
|
||||
<ul>
|
||||
<li><p>In general, don't change whitespace unless it improves readability or consistency. Gratuitous whitespace changes will make integrations and backports more difficult.</p></li>
|
||||
<li><p>Use One-True-Brace-Style. The opening brace for a function or class is normally at the end of the line; it is sometimes moved to the beginning of the next line for emphasis. Substatements are enclosed in braces, even if there is only a single statement. Extremely simple one-line statements may drop braces around a substatement.</p></li>
|
||||
<li><p>Indentation levels are two columns.</p></li>
|
||||
<li><p>There is no hard line length limit. That said, bear in mind that excessively long lines can cause difficulties. Some people like to have multiple side-by-side windows in their editors, and long lines may force them to choose among unpleasant options. They can use wide windows, reducing the number that can fit across the screen, and wasting a lot of screen real estate because most lines are not that long. Alternatively, they can have more windows across the screen, with long lines wrapping (or worse, requiring scrolling to see in their entirety), which is harder to read. Similar issues exist for side-by-side code reviews.</p></li>
|
||||
<li><p>Tabs are not allowed in code. Set your editor accordingly.<br> (Emacs: <code>(setq-default indent-tabs-mode nil)</code>.)</p></li>
|
||||
<li><p>Use good taste to break lines and align corresponding tokens on adjacent lines.</p></li>
|
||||
<li><p>Use spaces around operators, especially comparisons and assignments. (Relaxable for boolean expressions and high-precedence operators in classic math-style formulas.)</p></li>
|
||||
<li><p>Put spaces on both sides of control flow keywords <code>if</code>, <code>else</code>, <code>for</code>, <code>switch</code>, etc. Don't add spaces around the associated <em>control</em> expressions. Examples:</p>
|
||||
<pre><code>while (test_foo(args...)) { // Yes
|
||||
while(test_foo(args...)) { // No, missing space after while
|
||||
while ( test_foo(args...) ) { // No, excess spaces around control</code></pre></li>
|
||||
<li><p>Use extra parentheses in expressions whenever operator precedence seems doubtful. Always use parentheses in shift/mask expressions (<code><<</code>, <code>&</code>, <code>|</code>). Don't add whitespace immediately inside parentheses.</p></li>
|
||||
<li><p>Use more spaces and blank lines between larger constructs, such as classes or function definitions.</p></li>
|
||||
<li><p>If the surrounding code has any sort of vertical organization, adjust new lines horizontally to be consistent with that organization. (E.g., trailing backslashes on long macro definitions often align.)</p></li>
|
||||
</ul>
|
||||
<h3 id="miscellaneous">Miscellaneous</h3>
|
||||
<ul>
|
||||
<li><p>Use the <a href="https://en.cppreference.com/w/cpp/language/raii" title="Resource Acquisition Is Initialization">Resource Acquisition Is Initialization</a> (RAII) design pattern to manage bracketed critical sections. See class <code>ResourceMark</code> for an example.</p></li>
|
||||
<li>Avoid implicit conversions to <code>bool</code>.
|
||||
<ul>
|
||||
<li>Use <code>bool</code> for boolean values.</li>
|
||||
<li>Do not use ints or pointers as (implicit) booleans with <code>&&</code>, <code>||</code>, <code>if</code>, <code>while</code>. Instead, compare explicitly, i.e. <code>if (x != 0)</code> or <code>if (ptr != nullptr)</code>, etc.</li>
|
||||
<li>Do not use declarations in <em>condition</em> forms, i.e. don't use <code>if (T v = value) { ... }</code>.</li>
|
||||
</ul></li>
|
||||
<li><p>Use functions from globalDefinitions.hpp and related files when performing bitwise operations on integers. Do not code directly as C operators, unless they are extremely simple. (Examples: <code>align_up</code>, <code>is_power_of_2</code>, <code>exact_log2</code>.)</p></li>
|
||||
<li><p>Use arrays with abstractions supporting range checks.</p></li>
|
||||
<li><p>Always enumerate all cases in a switch statement or provide a default case. It is ok to have an empty default with comment.</p></li>
|
||||
</ul>
|
||||
<h2 id="use-of-c-features">Use of C++ Features</h2>
|
||||
<p>HotSpot was originally written in a subset of the C++98/03 language. More recently, support for C++14 is provided, though again, HotSpot only uses a subset. (Backports to JDK versions lacking support for more recent Standards must of course stick with the original C++98/03 subset.)</p>
|
||||
<p>This section describes that subset. Features from the C++98/03 language may be used unless explicitly excluded here. Features from C++11 and C++14 may be explicitly permitted or explicitly excluded, and discussed accordingly here. There is a third category, undecided features, about which HotSpot developers have not yet reached a consensus, or perhaps have not discussed at all. Use of these features is also excluded.</p>
|
||||
<p>(The use of some features may not be immediately obvious and may slip in anyway, since the compiler will accept them. The code review process is the main defense against this.)</p>
|
||||
<p>Some features are discussed in their own subsection, typically to provide more extensive discussion or rationale for limitations. Features that don't have their own subsection are listed in omnibus feature sections for permitted, excluded, and undecided features.</p>
|
||||
<p>Lists of new features for C++11 and C++14, along with links to their descriptions, can be found in the online documentation for some of the compilers and libraries. The C++14 Standard is the definitive description.</p>
|
||||
<ul>
|
||||
<li><a href="https://gcc.gnu.org/projects/cxx-status.html">C++ Standards Support in GCC</a></li>
|
||||
<li><a href="https://clang.llvm.org/cxx_status.html">C++ Support in Clang</a></li>
|
||||
<li><a href="https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance">Visual C++ Language Conformance</a></li>
|
||||
<li><a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html">libstdc++ Status</a></li>
|
||||
<li><a href="https://libcxx.llvm.org/cxx1y_status.html">libc++ Status</a></li>
|
||||
</ul>
|
||||
<p>As a rule of thumb, permitting features which simplify writing code and, especially, reading code, is encouraged.</p>
|
||||
<p>Similar discussions for some other projects:</p>
|
||||
<ul>
|
||||
<li><p><a href="https://google.github.io/styleguide/cppguide.html">Google C++ Style Guide</a> — Currently (2020) targeting C++17.</p></li>
|
||||
<li><p><a href="https://chromium-cpp.appspot.com">C++11 and C++14 use in Chromium</a> — Categorizes features as allowed, banned, or to be discussed.</p></li>
|
||||
<li><p><a href="https://llvm.org/docs/CodingStandards.html">llvm Coding Standards</a> — Currently (2020) targeting C++14.</p></li>
|
||||
<li><p><a href="https://firefox-source-docs.mozilla.org/code-quality/coding-style/using_cxx_in_firefox_code.html">Using C++ in Mozilla code</a> — C++17 support is required for recent versions (2020).</p></li>
|
||||
</ul>
|
||||
<h3 id="error-handling">Error Handling</h3>
|
||||
<p>Do not use exceptions. Exceptions are disabled by the build configuration for some platforms.</p>
|
||||
<p>Rationale: There is significant concern over the performance cost of exceptions and their usage model and implications for maintainable code. That's not just a matter of history that has been fixed; there remain questions and problems even today (2019). See, for example, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf">Zero cost deterministic exceptions</a>. Because of this, HotSpot has always used a build configuration that disables exceptions where that is available. As a result, HotSpot code uses error handling mechanisms such as two-phase construction, factory functions, returning error codes, and immediate termination. Even if the cost of exceptions were not a concern, the existing body of code was not written with exception safety in mind. Making HotSpot exception safe would be a very large undertaking.</p>
|
||||
<p>In addition to the usual alternatives to exceptions, HotSpot provides its own exception mechanism. This is based on a set of macros defined in utilities/exceptions.hpp.</p>
|
||||
<h3 id="rtti-runtime-type-information">RTTI (Runtime Type Information)</h3>
|
||||
<p>Do not use <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">Runtime Type Information</a> (RTTI). <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">RTTI</a> is disabled by the build configuration for some platforms. Among other things, this means <code>dynamic_cast</code> cannot be used.</p>
|
||||
<p>Rationale: Other than to implement exceptions (which HotSpot doesn't use), most potential uses of <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">RTTI</a> are better done via virtual functions. Some of the remainder can be replaced by bespoke mechanisms. The cost of the additional runtime data structures needed to support <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">RTTI</a> are deemed not worthwhile, given the alternatives.</p>
|
||||
<h3 id="memory-allocation">Memory Allocation</h3>
|
||||
<p>Do not use the standard global allocation and deallocation functions (operator new and related functions). Use of these functions by HotSpot code is disabled for some platforms.</p>
|
||||
<p>Rationale: HotSpot often uses "resource" or "arena" allocation. Even where heap allocation is used, the standard global functions are avoided in favor of wrappers around malloc and free that support the VM's Native Memory Tracking (NMT) feature.</p>
|
||||
<p>Native memory allocation failures are often treated as non-recoverable. The place where "out of memory" is (first) detected may be an innocent bystander, unrelated to the actual culprit.</p>
|
||||
<h3 id="class-inheritance">Class Inheritance</h3>
|
||||
<p>Use public single inheritance.</p>
|
||||
<p>Prefer composition rather than non-public inheritance.</p>
|
||||
<p>Restrict inheritance to the "is-a" case; use composition rather than non-is-a related inheritance.</p>
|
||||
<p>Avoid multiple inheritance. Never use virtual inheritance.</p>
|
||||
<h3 id="namespaces">Namespaces</h3>
|
||||
<p>Avoid using namespaces. HotSpot code normally uses "all static" classes rather than namespaces for grouping. An "all static" class is not instantiable, has only static members, and is normally derived (possibly indirectly) from the helper class <code>AllStatic</code>.</p>
|
||||
<p>Benefits of using such classes include:</p>
|
||||
<ul>
|
||||
<li><p>Provides access control for members, which is unavailable with namespaces.</p></li>
|
||||
<li><p>Avoids <a href="https://en.cppreference.com/w/cpp/language/adl" title="Argument Dependent Lookup">Argument Dependent Lookup</a> (ADL).</p></li>
|
||||
<li><p>Closed for additional members. Namespaces allow names to be added in multiple contexts, making it harder to see the complete API.</p></li>
|
||||
</ul>
|
||||
<p>Namespaces should be used only in cases where one of those "benefits" is actually a hindrance.</p>
|
||||
<p>In particular, don't use anonymous namespaces. They seem like they should be useful, and indeed have some real benefits for naming and generated code size on some platforms. Unfortunately, debuggers don't seem to like them at all.</p>
|
||||
<p><a href="https://groups.google.com/forum/#!topic/mozilla.dev.platform/KsaG3lEEaRM" class="uri">https://groups.google.com/forum/#!topic/mozilla.dev.platform/KsaG3lEEaRM</a><br> Suggests Visual Studio debugger might not be able to refer to anonymous namespace symbols, so can't set breakpoints in them. Though the discussion seems to go back and forth on that.</p>
|
||||
<p><a href="https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html" class="uri">https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html</a><br> Search for "Anonymous namespaces" Suggests preferring "static" to anonymous namespaces where applicable, because of poor debugger support for anonymous namespaces.</p>
|
||||
<p><a href="https://sourceware.org/bugzilla/show_bug.cgi?id=16874" class="uri">https://sourceware.org/bugzilla/show_bug.cgi?id=16874</a><br> Bug for similar gdb problems.</p>
|
||||
<h3 id="c-standard-library">C++ Standard Library</h3>
|
||||
<p>Avoid using the C++ Standard Library.</p>
|
||||
<p>Historically, HotSpot has mostly avoided use of the Standard Library.</p>
|
||||
<p>(It used to be impossible to use most of it in shared code, because the build configuration for Solaris with Solaris Studio made all but a couple of pieces inaccessible. Support for header-only parts was added in mid-2017. Support for Solaris was removed in 2020.)</p>
|
||||
<p>Some reasons for this include</p>
|
||||
<ul>
|
||||
<li><p>Exceptions. Perhaps the largest core issue with adopting the use of Standard Library facilities is exceptions. HotSpot does not use exceptions and, for platforms which allow doing so, builds with them turned off. Many Standard Library facilities implicitly or explicitly use exceptions.</p></li>
|
||||
<li><p><code>assert</code>. An issue that is quickly encountered is the <code>assert</code> macro name collision (<a href="https://bugs.openjdk.java.net/browse/JDK-8007770">JDK-8007770</a>). Some mechanism for addressing this would be needed before much of the Standard Library could be used. (Not all Standard Library implementations use assert in header files, but some do.)</p></li>
|
||||
<li><p>Memory allocation. HotSpot requires explicit control over where allocations occur. The C++98/03 <code>std::allocator</code> class is too limited to support our usage. (Changes in more recent Standards may remove this limitation.)</p></li>
|
||||
<li><p>Implementation vagaries. Bugs, or simply different implementation choices, can lead to different behaviors among the various Standard Libraries we need to deal with.</p></li>
|
||||
<li><p>Inconsistent naming conventions. HotSpot and the C++ Standard use different naming conventions. The coexistence of those different conventions might appear jarring and reduce readability.</p></li>
|
||||
</ul>
|
||||
<p>There are a few exceptions to this rule.</p>
|
||||
<ul>
|
||||
<li><code>#include <new></code> to use placement <code>new</code>, <code>std::nothrow</code>, and <code>std::nothrow_t</code>.</li>
|
||||
<li><code>#include <limits></code> to use <code>std::numeric_limits</code>.</li>
|
||||
<li><code>#include <type_traits></code>.</li>
|
||||
<li><code>#include <cstddef></code> to use <code>std::nullptr_t</code>.</li>
|
||||
</ul>
|
||||
<p>TODO: Rather than directly #including (permitted) Standard Library headers, use a convention of #including wrapper headers (in some location like hotspot/shared/stdcpp). This provides a single place for dealing with issues we might have for any given header, esp. platform-specific issues.</p>
|
||||
<h3 id="type-deduction">Type Deduction</h3>
|
||||
<p>Use type deduction only if it makes the code clearer or safer. Do not use it merely to avoid the inconvenience of writing an explicit type, unless that type is itself difficult to write. An example of the latter is a function template return type that depends on template parameters in a non-trivial way.</p>
|
||||
<p>There are several contexts where types are deduced.</p>
|
||||
<ul>
|
||||
<li><p>Function argument deduction. This is always permitted, and indeed encouraged. It is nearly always better to allow the type of a function template argument to be deduced rather than explicitly specified.</p></li>
|
||||
<li><p><code>auto</code> variable declarations (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf">n1984</a>)<br> For local variables, this can be used to make the code clearer by eliminating type information that is obvious or irrelevant. Excessive use can make code much harder to understand.</p></li>
|
||||
<li><p>Function return type deduction (<a href="https://isocpp.org/files/papers/N3638.html">n3638</a>)<br> Only use if the function body has a very small number of <code>return</code> statements, and generally relatively little other code.</p></li>
|
||||
<li><p>Generic lambdas. Lambdas are not (yet) permitted.</p></li>
|
||||
<li><p>Lambda init captures. Lambdas are not (yet) permitted.</p></li>
|
||||
</ul>
|
||||
<h3 id="expression-sfinae">Expression SFINAE</h3>
|
||||
<p><a href="https://en.cppreference.com/w/cpp/language/sfinae" title="Substitution Failure Is Not An Error">Substitution Failure Is Not An Error</a> (SFINAE) is a template metaprogramming technique that makes use of template parameter substitution failures to make compile-time decisions.</p>
|
||||
<p>C++11 relaxed the rules for what constitutes a hard-error when attempting to substitute template parameters with template arguments, making most deduction errors be substitution errors; see (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html">n2634</a>). This makes <a href="https://en.cppreference.com/w/cpp/language/sfinae" title="Substitution Failure Is Not An Error">SFINAE</a> more powerful and easier to use. However, the implementation complexity for this change is significant, and this seems to be a place where obscure corner-case bugs in various compilers can be found. So while this feature can (and indeed should) be used (and would be difficult to avoid), caution should be used when pushing to extremes.</p>
|
||||
<p>Here are a few closely related example bugs:<br> <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95468" class="uri">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95468</a><br> <a href="https://developercommunity.visualstudio.com/content/problem/396562/sizeof-deduced-type-is-sometimes-not-a-constant-ex.html" class="uri">https://developercommunity.visualstudio.com/content/problem/396562/sizeof-deduced-type-is-sometimes-not-a-constant-ex.html</a></p>
|
||||
<h3 id="enum">enum</h3>
|
||||
<p>Where appropriate, <em>scoped-enums</em> should be used. (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf">n2347</a>)</p>
|
||||
<p>Use of <em>unscoped-enums</em> is permitted, though ordinary constants may be preferable when the automatic initializer feature isn't used.</p>
|
||||
<p>The underlying type (the <em>enum-base</em>) of an unscoped enum type should always be specified explicitly. When unspecified, the underlying type is dependent on the range of the enumerator values and the platform.</p>
|
||||
<p>The underlying type of a <em>scoped-enum</em> should also be specified explicitly if conversions may be applied to values of that type.</p>
|
||||
<p>Due to bugs in certain (very old) compilers, there is widespread use of enums and avoidance of in-class initialization of static integral constant members. Compilers having such bugs are no longer supported. Except where an enum is semantically appropriate, new code should use integral constants.</p>
|
||||
<h3 id="thread_local">thread_local</h3>
|
||||
<p>Do not use <code>thread_local</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm">n2659</a>); instead, use the HotSpot macro <code>THREAD_LOCAL</code>. The initializer must be a constant expression.</p>
|
||||
<p>As was discussed in the review for <a href="https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-September/039487.html">JDK-8230877</a>, <code>thread_local</code> allows dynamic initialization and destruction semantics. However, that support requires a run-time penalty for references to non-function-local <code>thread_local</code> variables defined in a different translation unit, even if they don't need dynamic initialization. Dynamic initialization and destruction of namespace-scoped thread local variables also has the same ordering problems as for ordinary namespace-scoped variables.</p>
|
||||
<h3 id="nullptr">nullptr</h3>
|
||||
<p>Prefer <code>nullptr</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">n2431</a>) to <code>NULL</code>. Don't use (constexpr or literal) 0 for pointers.</p>
|
||||
<p>For historical reasons there are widespread uses of both <code>NULL</code> and of integer 0 as a pointer value.</p>
|
||||
<h3 id="atomic"><atomic></h3>
|
||||
<p>Do not use facilities provided by the <code><atomic></code> header (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html">n2427</a>), (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm">n2752</a>); instead, use the HotSpot <code>Atomic</code> class and related facilities.</p>
|
||||
<p>Atomic operations in HotSpot code must have semantics which are consistent with those provided by the JDK's compilers for Java. There are platform-specific implementation choices that a C++ compiler might make or change that are outside the scope of the C++ Standard, and might differ from what the Java compilers implement.</p>
|
||||
<p>In addition, HotSpot <code>Atomic</code> has a concept of "conservative" memory ordering, which may differ from (may be stronger than) sequentially consistent. There are algorithms in HotSpot that are believed to rely on that ordering.</p>
|
||||
<h3 id="additional-permitted-features">Additional Permitted Features</h3>
|
||||
<ul>
|
||||
<li><p><code>constexpr</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">n2235</a>) (<a href="https://isocpp.org/files/papers/N3652.html">n3652</a>)</p></li>
|
||||
<li><p>Sized deallocation (<a href="https://isocpp.org/files/papers/n3778.html">n3778</a>)</p></li>
|
||||
<li><p>Variadic templates (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf">n2242</a>) (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">n2555</a>)</p></li>
|
||||
<li><p>Static assertions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html">n1720</a>)</p></li>
|
||||
<li><p><code>decltype</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">n2343</a>) (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf">n3276</a>)</p></li>
|
||||
<li><p>Right angle brackets (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">n1757</a>)</p></li>
|
||||
<li><p>Default template arguments for function templates (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226">CWG D226</a>)</p></li>
|
||||
<li><p>Template aliases (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf">n2258</a>)</p></li>
|
||||
<li><p>Delegating constructors (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf">n1986</a>)</p></li>
|
||||
<li><p>Explicit conversion operators (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">n2437</a>)</p></li>
|
||||
<li><p>Standard Layout Types (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm">n2342</a>)</p></li>
|
||||
<li><p>Defaulted and deleted functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">n2346</a>)</p></li>
|
||||
<li><p>Dynamic initialization and destruction with concurrency (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm">n2660</a>)</p></li>
|
||||
<li><p><code>final</code> virtual specifiers for classes and virtual functions (<a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm">n2928</a>), (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm">n3206</a>), (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">n3272</a>)</p></li>
|
||||
<li><p>Local and unnamed types as template parameters (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm">n2657</a>)</p></li>
|
||||
</ul>
|
||||
<h3 id="excluded-features">Excluded Features</h3>
|
||||
<ul>
|
||||
<li>New string and character literals
|
||||
<ul>
|
||||
<li>New character types (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html">n2249</a>)</li>
|
||||
<li>Unicode string literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">n2442</a>)</li>
|
||||
<li>Raw string literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">n2442</a>)</li>
|
||||
<li>Universal character name literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html">n2170</a>)</li>
|
||||
</ul>
|
||||
<p>HotSpot doesn't need any of the new character and string literal types.</p></li>
|
||||
<li><p>User-defined literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf">n2765</a>) — User-defined literals should not be added casually, but only through a proposal to add a specific UDL.</p></li>
|
||||
<li><p>Inline namespaces (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">n2535</a>) — HotSpot makes very limited use of namespaces.</p></li>
|
||||
<li><p><code>using namespace</code> directives. In particular, don't use <code>using namespace std;</code> to avoid needing to qualify Standard Library names.</p></li>
|
||||
<li><p>Propagating exceptions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">n2179</a>) — HotSpot does not permit the use of exceptions, so this feature isn't useful.</p></li>
|
||||
<li><p>Avoid namespace-scoped variables with non-constexpr initialization. In particular, avoid variables with types requiring non-trivial initialization or destruction. Initialization order problems can be difficult to deal with and lead to surprises, as can destruction ordering. HotSpot doesn't generally try to cleanup on exit, and running destructors at exit can also lead to problems.</p></li>
|
||||
<li><p><code>[[deprecated]]</code> attribute (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html">n3760</a>) — Not relevant in HotSpot code.</p></li>
|
||||
<li><p>Avoid most operator overloading, preferring named functions. When operator overloading is used, ensure the semantics conform to the normal expected behavior of the operation.</p></li>
|
||||
<li><p>Avoid most implicit conversion constructors and (implicit or explicit) conversion operators. (Note that conversion to <code>bool</code> isn't needed in HotSpot code because of the "no implicit boolean" guideline.)</p></li>
|
||||
<li><p>Avoid covariant return types.</p></li>
|
||||
<li><p>Avoid <code>goto</code> statements.</p></li>
|
||||
</ul>
|
||||
<h3 id="undecided-features">Undecided Features</h3>
|
||||
<p>This list is incomplete; it serves to explicitly call out some features that have not yet been discussed.</p>
|
||||
<ul>
|
||||
<li><p><code>overrides</code> virtual specifiers for virtual functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">n3272</a>)</p></li>
|
||||
<li><p>Trailing return type syntax for functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm">n2541</a>)</p></li>
|
||||
<li><p>Variable templates (<a href="https://isocpp.org/files/papers/N3651.pdf">n3651</a>)</p></li>
|
||||
<li><p>Member initializers and aggregates (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html">n3653</a>)</p></li>
|
||||
<li><p><code>[[noreturn]]</code> attribute (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf">n2761</a>)</p></li>
|
||||
<li><p>Rvalue references and move semantics</p></li>
|
||||
<li><p>Lambdas</p></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
828
doc/hotspot-style.md
Normal file
828
doc/hotspot-style.md
Normal file
@@ -0,0 +1,828 @@
|
||||
% HotSpot Coding Style
|
||||
|
||||
## Introduction
|
||||
|
||||
This is a collection of rules, guidelines, and suggestions for writing
|
||||
HotSpot code. Following these will help new code fit in with existing
|
||||
HotSpot code, making it easier to read and maintain. Failure to
|
||||
follow these guidelines may lead to discussion during code reviews, if
|
||||
not outright rejection of a change.
|
||||
|
||||
### Why Care About Style?
|
||||
|
||||
Some programmers seem to have lexers and even C preprocessors
|
||||
installed directly behind their eyeballs. The rest of us require code
|
||||
that is not only functionally correct but also easy to read. More than
|
||||
that, since there is no one style for easy-to-read code, and since a
|
||||
mashup of many styles is just as confusing as no style at all, it is
|
||||
important for coders to be conscious of the many implicit stylistic
|
||||
choices that historically have gone into the HotSpot code base.
|
||||
|
||||
Some of these guidelines are driven by the cross-platform requirements
|
||||
for HotSpot. Shared code must work on a variety of platforms, and may
|
||||
encounter deficiencies in some. Using platform conditionalization in
|
||||
shared code is usually avoided, while shared code is strongly
|
||||
preferred to multiple platform-dependent implementations, so some
|
||||
language features may be recommended against.
|
||||
|
||||
Some of the guidelines here are relatively arbitrary choices among
|
||||
equally plausible alternatives. The purpose of stating and enforcing
|
||||
these rules is largely to provide a consistent look to the code. That
|
||||
consistency makes the code more readable by avoiding non-functional
|
||||
distractions from the interesting functionality.
|
||||
|
||||
When changing pre-existing code, it is reasonable to adjust it to
|
||||
match these conventions. Exception: If the pre-existing code clearly
|
||||
conforms locally to its own peculiar conventions, it is not worth
|
||||
reformatting the whole thing. Also consider separating changes that
|
||||
make extensive stylistic updates from those which make functional
|
||||
changes.
|
||||
|
||||
### Counterexamples and Updates
|
||||
|
||||
Many of the guidelines mentioned here have (sometimes widespread)
|
||||
counterexamples in the HotSpot code base. Finding a counterexample is
|
||||
not sufficient justification for new code to follow the counterexample
|
||||
as a precedent, since readers of your code will rightfully expect your
|
||||
code to follow the greater bulk of precedents documented here.
|
||||
|
||||
Occasionally a guideline mentioned here may be just out of synch with
|
||||
the actual HotSpot code base. If you find that a guideline is
|
||||
consistently contradicted by a large number of counterexamples, please
|
||||
bring it up for discussion and possible change. The architectural
|
||||
rule, of course, is "When in Rome do as the Romans". Sometimes in the
|
||||
suburbs of Rome the rules are a little different; these differences
|
||||
can be pointed out here.
|
||||
|
||||
Proposed changes should be discussed on the
|
||||
[HotSpot Developers](mailto:hotspot-dev@openjdk.java.net) mailing
|
||||
list, and approved by
|
||||
[rough consensus](https://en.wikipedia.org/wiki/Rough_consensus) of
|
||||
the [HotSpot Group](https://openjdk.java.net/census#hotspot) Members.
|
||||
The Group Lead determines whether consensus has been reached.
|
||||
Changes are likely to be cautious and incremental, since HotSpot
|
||||
coders have been using these guidelines for years.
|
||||
|
||||
## Structure and Formatting
|
||||
|
||||
### Factoring and Class Design
|
||||
|
||||
* Group related code together, so readers can concentrate on one
|
||||
section of one file.
|
||||
|
||||
* Classes are the primary code structuring mechanism. Place related
|
||||
functionality in a class, or a set of related classes. Use of either
|
||||
namespaces or public non-member functions is rare in HotSpot code.
|
||||
Static non-member functions are not uncommon.
|
||||
|
||||
* If a class `FooBar` is going to be used in more than one place, put it
|
||||
a file named fooBar.hpp and fooBar.cpp. If the class is a sidekick
|
||||
to a more important class `BazBat`, it can go in bazBat.hpp.
|
||||
|
||||
* Put a member function `FooBar::bang` into the same file that defined
|
||||
`FooBar`, or its associated *.inline.hpp or *.cpp file.
|
||||
|
||||
* Use public accessor functions for member variables accessed
|
||||
outside the class.
|
||||
|
||||
* Assign names to constant literals and use the names instead.
|
||||
|
||||
* Keep functions small, a screenful at most. Split out chunks of
|
||||
logic into file-local classes or static functions if needed.
|
||||
|
||||
* Factor away nonessential complexity into local inline helper
|
||||
functions and helper classes.
|
||||
|
||||
* Think clearly about internal invariants that apply to each class,
|
||||
and document them in the form of asserts within member functions.
|
||||
|
||||
* Make simple, self-evident contracts for member functions. If you cannot
|
||||
communicate a simple contract, redesign the class.
|
||||
|
||||
* Implement classes as if expecting rough usage by clients. Check for
|
||||
incorrect usage of a class using `assert(...)`, `guarantee(...)`,
|
||||
`ShouldNotReachHere()` and comments wherever needed. Performance is
|
||||
almost never a reason to omit asserts.
|
||||
|
||||
* When possible, design as if for reusability. This forces a clear
|
||||
design of the class's externals, and clean hiding of its internals.
|
||||
|
||||
* Initialize all variables and data structures to a known state. If a
|
||||
class has a constructor, initialize it there.
|
||||
|
||||
* Do no optimization before its time. Prove the need to optimize.
|
||||
|
||||
* When you must defactor to optimize, preserve as much structure as
|
||||
possible. If you must hand-inline some name, label the local copy with
|
||||
the original name.
|
||||
|
||||
* If you need to use a hidden detail (e.g., a structure offset), name
|
||||
it (as a constant or function) in the class that owns it.
|
||||
|
||||
* Don't use the Copy and Paste keys to replicate more than a couple
|
||||
lines of code. Name what you must repeat.
|
||||
|
||||
* If a class needs a member function to change a user-visible attribute, the
|
||||
change should be done with a "setter" accessor matched to the simple
|
||||
"getter".
|
||||
|
||||
### Source Files
|
||||
|
||||
* All source files must have a globally unique basename. The build
|
||||
system depends on this uniqueness.
|
||||
|
||||
* Do not put non-trivial function implementations in .hpp files. If
|
||||
the implementation depends on other .hpp files, put it in a .cpp or
|
||||
a .inline.hpp file.
|
||||
|
||||
* .inline.hpp files should only be included in .cpp or .inline.hpp
|
||||
files.
|
||||
|
||||
* All .cpp files include precompiled.hpp as the first include line.
|
||||
|
||||
* precompiled.hpp is just a build time optimization, so don't rely on
|
||||
it to resolve include problems.
|
||||
|
||||
* Keep the include lines alphabetically sorted.
|
||||
|
||||
* Put conditional inclusions (`#if ...`) at the end of the include list.
|
||||
|
||||
### JTReg Tests
|
||||
|
||||
* JTReg tests should have meaningful names.
|
||||
|
||||
* JTReg tests associated with specific bugs should be tagged with the
|
||||
`@bug` keyword in the test description.
|
||||
|
||||
* JTReg tests should be organized by component or feature under
|
||||
`test/`, in a directory hierarchy that generally follows that of the
|
||||
`src/` directory. There may be additional subdirectories to further
|
||||
categorize tests by feature. This structure makes it easy to run a
|
||||
collection of tests associated with a specific feature by specifying
|
||||
the associated directory as the source of the tests to run.
|
||||
|
||||
* Some (older) tests use the associated bug number in the directory
|
||||
name, the test name, or both. That naming style should no longer be
|
||||
used, with existing tests using that style being candidates for migration.
|
||||
|
||||
### Naming
|
||||
|
||||
* The length of a name may be correlated to the size of its scope. In
|
||||
particular, short names (even single letter names) may be fine in a
|
||||
small scope, but are usually inappropriate for larger scopes.
|
||||
|
||||
* Prefer whole words rather than abbreviations, unless the
|
||||
abbreviation is more widely used than the long form in the code's
|
||||
domain.
|
||||
|
||||
* Choose names consistently. Do not introduce spurious
|
||||
variations. Abbreviate corresponding terms to a consistent length.
|
||||
|
||||
* Global names must be unique, to avoid [One Definition Rule][ODR] (ODR)
|
||||
violations. A common prefixing scheme for related global names is
|
||||
often used. (This is instead of using namespaces, which are mostly
|
||||
avoided in HotSpot.)
|
||||
|
||||
* Don't give two names to the semantically same thing. But use
|
||||
different names for semantically different things, even if they are
|
||||
representationally the same. (So use meaningful `typedef` or template
|
||||
alias names where appropriate.)
|
||||
|
||||
* When choosing names, avoid categorical nouns like "variable",
|
||||
"field", "parameter", "value", and verbs like "compute", "get".
|
||||
(`storeValue(int param)` is bad.)
|
||||
|
||||
* Type names and global names should use mixed-case with the first
|
||||
letter of each word capitalized (`FooBar`).
|
||||
|
||||
* Embedded abbreviations in
|
||||
otherwise mixed-case names are usually capitalized entirely rather
|
||||
than being treated as a single word with only the initial letter
|
||||
capitalized, e.g. "HTML" rather than "Html".
|
||||
|
||||
* Function and local variable names use lowercase with words separated
|
||||
by a single underscore (`foo_bar`).
|
||||
|
||||
* Class data member names have a leading underscore, and use lowercase
|
||||
with words separated by a single underscore (`_foo_bar`).
|
||||
|
||||
* Constant names may be upper-case or mixed-case, according to
|
||||
historical necessity. (Note: There are many examples of constants
|
||||
with lowercase names.)
|
||||
|
||||
* Constant names should follow an existing pattern, and must have a
|
||||
distinct appearance from other names in related APIs.
|
||||
|
||||
* Class and type names should be noun phrases. Consider an "er" suffix
|
||||
for a class that represents an action.
|
||||
|
||||
* Function names should be verb phrases that reflect changes of state
|
||||
known to a class's user, or else noun phrases if they cause no change
|
||||
of state visible to the class's user.
|
||||
|
||||
* Getter accessor names are noun phrases, with no "`get_`" noise
|
||||
word. Boolean getters can also begin with "`is_`" or "`has_`". Member
|
||||
function for reading data members usually have the same name as the
|
||||
data member, exclusive of the leading underscore.
|
||||
|
||||
* Setter accessor names prepend "`set_`" to the getter name.
|
||||
|
||||
* Other member function names are verb phrases, as if commands to the receiver.
|
||||
|
||||
* Avoid leading underscores (as "`_oop`") except in cases required
|
||||
above. (Names with leading underscores can cause portability
|
||||
problems.)
|
||||
|
||||
### Commenting
|
||||
|
||||
* Clearly comment subtle fixes.
|
||||
|
||||
* Clearly comment tricky classes and functions.
|
||||
|
||||
* If you have to choose between commenting code and writing wiki
|
||||
content, comment the code. Link from the wiki to the source file if
|
||||
it makes sense.
|
||||
|
||||
* As a general rule don't add bug numbers to comments (they would soon
|
||||
overwhelm the code). But if the bug report contains significant
|
||||
information that can't reasonably be added as a comment, then refer to
|
||||
the bug report.
|
||||
|
||||
* Personal names are discouraged in the source code, which is a team
|
||||
product.
|
||||
|
||||
### Macros
|
||||
|
||||
* You can almost always use an inline function or class instead of a
|
||||
macro. Use a macro only when you really need it.
|
||||
|
||||
* Templates may be preferable to multi-line macros. (There may be
|
||||
subtle performance effects with templates on some platforms; revert
|
||||
to macros if absolutely necessary.)
|
||||
|
||||
* `#ifdef`s should not be used to introduce platform-specific code
|
||||
into shared code (except for `_LP64`). They must be used to manage
|
||||
header files, in the pattern found at the top of every source
|
||||
file. They should be used mainly for major build features, including
|
||||
`PRODUCT`, `ASSERT`, `_LP64`, `INCLUDE_SERIALGC`, `COMPILER1`, etc.
|
||||
|
||||
* For build features such as `PRODUCT`, use `#ifdef PRODUCT` for
|
||||
multiple-line inclusions or exclusions.
|
||||
|
||||
* For short inclusions or exclusions based on build features, use
|
||||
macros like `PRODUCT_ONLY` and `NOT_PRODUCT`. But avoid using them
|
||||
with multiple-line arguments, since debuggers do not handle that
|
||||
well.
|
||||
|
||||
* Use `CATCH`, `THROW`, etc. for HotSpot-specific exception processing.
|
||||
|
||||
### Whitespace
|
||||
|
||||
* In general, don't change whitespace unless it improves readability
|
||||
or consistency. Gratuitous whitespace changes will make integrations
|
||||
and backports more difficult.
|
||||
|
||||
* Use One-True-Brace-Style. The opening brace for a function or class
|
||||
is normally at the end of the line; it is sometimes moved to the
|
||||
beginning of the next line for emphasis. Substatements are enclosed
|
||||
in braces, even if there is only a single statement. Extremely simple
|
||||
one-line statements may drop braces around a substatement.
|
||||
|
||||
* Indentation levels are two columns.
|
||||
|
||||
* There is no hard line length limit. That said, bear in mind that
|
||||
excessively long lines can cause difficulties. Some people like to
|
||||
have multiple side-by-side windows in their editors, and long lines
|
||||
may force them to choose among unpleasant options. They can use wide
|
||||
windows, reducing the number that can fit across the screen, and
|
||||
wasting a lot of screen real estate because most lines are not that
|
||||
long. Alternatively, they can have more windows across the screen,
|
||||
with long lines wrapping (or worse, requiring scrolling to see in
|
||||
their entirety), which is harder to read. Similar issues exist for
|
||||
side-by-side code reviews.
|
||||
|
||||
* Tabs are not allowed in code. Set your editor accordingly.<br>
|
||||
(Emacs: `(setq-default indent-tabs-mode nil)`.)
|
||||
|
||||
* Use good taste to break lines and align corresponding tokens on
|
||||
adjacent lines.
|
||||
|
||||
* Use spaces around operators, especially comparisons and
|
||||
assignments. (Relaxable for boolean expressions and high-precedence
|
||||
operators in classic math-style formulas.)
|
||||
|
||||
* Put spaces on both sides of control flow keywords `if`, `else`,
|
||||
`for`, `switch`, etc. Don't add spaces around the associated
|
||||
_control_ expressions. Examples:
|
||||
|
||||
```
|
||||
while (test_foo(args...)) { // Yes
|
||||
while(test_foo(args...)) { // No, missing space after while
|
||||
while ( test_foo(args...) ) { // No, excess spaces around control
|
||||
```
|
||||
|
||||
* Use extra parentheses in expressions whenever operator precedence
|
||||
seems doubtful. Always use parentheses in shift/mask expressions
|
||||
(`<<`, `&`, `|`). Don't add whitespace immediately inside
|
||||
parentheses.
|
||||
|
||||
* Use more spaces and blank lines between larger constructs, such as
|
||||
classes or function definitions.
|
||||
|
||||
* If the surrounding code has any sort of vertical organization,
|
||||
adjust new lines horizontally to be consistent with that
|
||||
organization. (E.g., trailing backslashes on long macro definitions
|
||||
often align.)
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
* Use the [Resource Acquisition Is Initialization][RAII] (RAII)
|
||||
design pattern to manage bracketed critical
|
||||
sections. See class `ResourceMark` for an example.
|
||||
|
||||
* Avoid implicit conversions to `bool`.
|
||||
* Use `bool` for boolean values.
|
||||
* Do not use ints or pointers as (implicit) booleans with `&&`, `||`,
|
||||
`if`, `while`. Instead, compare explicitly, i.e. `if (x != 0)` or
|
||||
`if (ptr != nullptr)`, etc.
|
||||
* Do not use declarations in _condition_ forms, i.e. don't use
|
||||
`if (T v = value) { ... }`.
|
||||
|
||||
* Use functions from globalDefinitions.hpp and related files when
|
||||
performing bitwise
|
||||
operations on integers. Do not code directly as C operators, unless
|
||||
they are extremely simple. (Examples: `align_up`, `is_power_of_2`,
|
||||
`exact_log2`.)
|
||||
|
||||
* Use arrays with abstractions supporting range checks.
|
||||
|
||||
* Always enumerate all cases in a switch statement or provide a default
|
||||
case. It is ok to have an empty default with comment.
|
||||
|
||||
|
||||
## Use of C++ Features
|
||||
|
||||
HotSpot was originally written in a subset of the C++98/03 language.
|
||||
More recently, support for C++14 is provided, though again,
|
||||
HotSpot only uses a subset. (Backports to JDK versions lacking
|
||||
support for more recent Standards must of course stick with the
|
||||
original C++98/03 subset.)
|
||||
|
||||
This section describes that subset. Features from the C++98/03
|
||||
language may be used unless explicitly excluded here. Features from
|
||||
C++11 and C++14 may be explicitly permitted or explicitly excluded,
|
||||
and discussed accordingly here. There is a third category, undecided
|
||||
features, about which HotSpot developers have not yet reached a
|
||||
consensus, or perhaps have not discussed at all. Use of these
|
||||
features is also excluded.
|
||||
|
||||
(The use of some features may not be immediately obvious and may slip
|
||||
in anyway, since the compiler will accept them. The code review
|
||||
process is the main defense against this.)
|
||||
|
||||
Some features are discussed in their own subsection, typically to provide
|
||||
more extensive discussion or rationale for limitations. Features that
|
||||
don't have their own subsection are listed in omnibus feature sections
|
||||
for permitted, excluded, and undecided features.
|
||||
|
||||
Lists of new features for C++11 and C++14, along with links to their
|
||||
descriptions, can be found in the online documentation for some of the
|
||||
compilers and libraries. The C++14 Standard is the definitive
|
||||
description.
|
||||
|
||||
* [C++ Standards Support in GCC](https://gcc.gnu.org/projects/cxx-status.html)
|
||||
* [C++ Support in Clang](https://clang.llvm.org/cxx_status.html)
|
||||
* [Visual C++ Language Conformance](https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance)
|
||||
* [libstdc++ Status](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html)
|
||||
* [libc++ Status](https://libcxx.llvm.org/cxx1y_status.html)
|
||||
|
||||
As a rule of thumb, permitting features which simplify writing code
|
||||
and, especially, reading code, is encouraged.
|
||||
|
||||
Similar discussions for some other projects:
|
||||
|
||||
* [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) —
|
||||
Currently (2020) targeting C++17.
|
||||
|
||||
* [C++11 and C++14 use in Chromium](https://chromium-cpp.appspot.com) —
|
||||
Categorizes features as allowed, banned, or to be discussed.
|
||||
|
||||
* [llvm Coding Standards](https://llvm.org/docs/CodingStandards.html) —
|
||||
Currently (2020) targeting C++14.
|
||||
|
||||
* [Using C++ in Mozilla code](https://firefox-source-docs.mozilla.org/code-quality/coding-style/using_cxx_in_firefox_code.html) —
|
||||
C++17 support is required for recent versions (2020).
|
||||
|
||||
### Error Handling
|
||||
|
||||
Do not use exceptions. Exceptions are disabled by the build configuration
|
||||
for some platforms.
|
||||
|
||||
Rationale: There is significant concern over the performance cost of
|
||||
exceptions and their usage model and implications for maintainable code.
|
||||
That's not just a matter of history that has been fixed; there remain
|
||||
questions and problems even today (2019). See, for example, [Zero cost
|
||||
deterministic
|
||||
exceptions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf).
|
||||
Because of this, HotSpot has always used a build configuration that disables
|
||||
exceptions where that is available. As a result, HotSpot code uses error
|
||||
handling mechanisms such as two-phase construction, factory functions,
|
||||
returning error codes, and immediate termination. Even if the cost of
|
||||
exceptions were not a concern, the existing body of code was not written with
|
||||
exception safety in mind. Making HotSpot exception safe would be a very large
|
||||
undertaking.
|
||||
|
||||
In addition to the usual alternatives to exceptions, HotSpot provides its
|
||||
own exception mechanism. This is based on a set of macros defined in
|
||||
utilities/exceptions.hpp.
|
||||
|
||||
### RTTI (Runtime Type Information)
|
||||
|
||||
Do not use [Runtime Type Information][RTTI] (RTTI).
|
||||
[RTTI][] is disabled by the build configuration for some
|
||||
platforms. Among other things, this means `dynamic_cast` cannot be used.
|
||||
|
||||
Rationale: Other than to implement exceptions (which HotSpot doesn't use),
|
||||
most potential uses of [RTTI][] are better done via virtual functions. Some of
|
||||
the remainder can be replaced by bespoke mechanisms. The cost of the
|
||||
additional runtime data structures needed to support [RTTI][] are deemed not
|
||||
worthwhile, given the alternatives.
|
||||
|
||||
### Memory Allocation
|
||||
|
||||
Do not use the standard global allocation and deallocation functions
|
||||
(operator new and related functions). Use of these functions by HotSpot
|
||||
code is disabled for some platforms.
|
||||
|
||||
Rationale: HotSpot often uses "resource" or "arena" allocation. Even
|
||||
where heap allocation is used, the standard global functions are
|
||||
avoided in favor of wrappers around malloc and free that support the
|
||||
VM's Native Memory Tracking (NMT) feature.
|
||||
|
||||
Native memory allocation failures are often treated as non-recoverable.
|
||||
The place where "out of memory" is (first) detected may be an innocent
|
||||
bystander, unrelated to the actual culprit.
|
||||
|
||||
### Class Inheritance
|
||||
|
||||
Use public single inheritance.
|
||||
|
||||
Prefer composition rather than non-public inheritance.
|
||||
|
||||
Restrict inheritance to the "is-a" case; use composition rather than
|
||||
non-is-a related inheritance.
|
||||
|
||||
Avoid multiple inheritance. Never use virtual inheritance.
|
||||
|
||||
### Namespaces
|
||||
|
||||
Avoid using namespaces. HotSpot code normally uses "all static"
|
||||
classes rather than namespaces for grouping. An "all static" class is
|
||||
not instantiable, has only static members, and is normally derived
|
||||
(possibly indirectly) from the helper class `AllStatic`.
|
||||
|
||||
Benefits of using such classes include:
|
||||
|
||||
* Provides access control for members, which is unavailable with
|
||||
namespaces.
|
||||
|
||||
* Avoids [Argument Dependent Lookup][ADL] (ADL).
|
||||
|
||||
* Closed for additional members. Namespaces allow names to be added in
|
||||
multiple contexts, making it harder to see the complete API.
|
||||
|
||||
Namespaces should be used only in cases where one of those "benefits"
|
||||
is actually a hindrance.
|
||||
|
||||
In particular, don't use anonymous namespaces. They seem like they should
|
||||
be useful, and indeed have some real benefits for naming and generated code
|
||||
size on some platforms. Unfortunately, debuggers don't seem to like them at
|
||||
all.
|
||||
|
||||
<https://groups.google.com/forum/#!topic/mozilla.dev.platform/KsaG3lEEaRM><br>
|
||||
Suggests Visual Studio debugger might not be able to refer to
|
||||
anonymous namespace symbols, so can't set breakpoints in them.
|
||||
Though the discussion seems to go back and forth on that.
|
||||
|
||||
<https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html><br>
|
||||
Search for "Anonymous namespaces"
|
||||
Suggests preferring "static" to anonymous namespaces where applicable,
|
||||
because of poor debugger support for anonymous namespaces.
|
||||
|
||||
<https://sourceware.org/bugzilla/show_bug.cgi?id=16874><br>
|
||||
Bug for similar gdb problems.
|
||||
|
||||
### C++ Standard Library
|
||||
|
||||
Avoid using the C++ Standard Library.
|
||||
|
||||
Historically, HotSpot has mostly avoided use of the Standard
|
||||
Library.
|
||||
|
||||
(It used to be impossible to use most of it in shared code,
|
||||
because the build configuration for Solaris with Solaris Studio made
|
||||
all but a couple of pieces inaccessible. Support for header-only
|
||||
parts was added in mid-2017. Support for Solaris was removed
|
||||
in 2020.)
|
||||
|
||||
Some reasons for this include
|
||||
|
||||
* Exceptions. Perhaps the largest core issue with adopting the use of
|
||||
Standard Library facilities is exceptions. HotSpot does not use
|
||||
exceptions and, for platforms which allow doing so, builds with them
|
||||
turned off. Many Standard Library facilities implicitly or explicitly
|
||||
use exceptions.
|
||||
|
||||
* `assert`. An issue that is quickly encountered is the `assert` macro name
|
||||
collision ([JDK-8007770](https://bugs.openjdk.java.net/browse/JDK-8007770)).
|
||||
Some mechanism for addressing this would be needed before much of the
|
||||
Standard Library could be used. (Not all Standard Library implementations
|
||||
use assert in header files, but some do.)
|
||||
|
||||
* Memory allocation. HotSpot requires explicit control over where
|
||||
allocations occur. The C++98/03 `std::allocator` class is too limited
|
||||
to support our usage. (Changes in more recent Standards may remove
|
||||
this limitation.)
|
||||
|
||||
* Implementation vagaries. Bugs, or simply different implementation choices,
|
||||
can lead to different behaviors among the various Standard Libraries we need
|
||||
to deal with.
|
||||
|
||||
* Inconsistent naming conventions. HotSpot and the C++ Standard use
|
||||
different naming conventions. The coexistence of those different conventions
|
||||
might appear jarring and reduce readability.
|
||||
|
||||
There are a few exceptions to this rule.
|
||||
|
||||
* `#include <new>` to use placement `new`, `std::nothrow`, and `std::nothrow_t`.
|
||||
* `#include <limits>` to use `std::numeric_limits`.
|
||||
* `#include <type_traits>`.
|
||||
* `#include <cstddef>` to use `std::nullptr_t`.
|
||||
|
||||
TODO: Rather than directly \#including (permitted) Standard Library
|
||||
headers, use a convention of \#including wrapper headers (in some
|
||||
location like hotspot/shared/stdcpp). This provides a single place
|
||||
for dealing with issues we might have for any given header, esp.
|
||||
platform-specific issues.
|
||||
|
||||
### Type Deduction
|
||||
|
||||
Use type deduction only if it makes the code clearer or safer. Do not
|
||||
use it merely to avoid the inconvenience of writing an explicit type,
|
||||
unless that type is itself difficult to write. An example of the
|
||||
latter is a function template return type that depends on template
|
||||
parameters in a non-trivial way.
|
||||
|
||||
There are several contexts where types are deduced.
|
||||
|
||||
* Function argument deduction. This is always permitted, and indeed
|
||||
encouraged. It is nearly always better to allow the type of a
|
||||
function template argument to be deduced rather than explicitly
|
||||
specified.
|
||||
|
||||
* `auto` variable declarations
|
||||
([n1984](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf))<br>
|
||||
For local variables, this can be used to make the code clearer by
|
||||
eliminating type information that is obvious or irrelevant. Excessive
|
||||
use can make code much harder to understand.
|
||||
|
||||
* Function return type deduction
|
||||
([n3638](https://isocpp.org/files/papers/N3638.html))<br>
|
||||
Only use if the function body has a very small number of `return`
|
||||
statements, and generally relatively little other code.
|
||||
|
||||
* Generic lambdas. Lambdas are not (yet) permitted.
|
||||
|
||||
* Lambda init captures. Lambdas are not (yet) permitted.
|
||||
|
||||
### Expression SFINAE
|
||||
|
||||
[Substitution Failure Is Not An Error][SFINAE] (SFINAE)
|
||||
is a template metaprogramming technique that makes use of
|
||||
template parameter substitution failures to make compile-time decisions.
|
||||
|
||||
C++11 relaxed the rules for what constitutes a hard-error when
|
||||
attempting to substitute template parameters with template arguments,
|
||||
making most deduction errors be substitution errors; see
|
||||
([n2634](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html)).
|
||||
This makes [SFINAE][] more powerful and easier to use. However, the
|
||||
implementation complexity for this change is significant, and this
|
||||
seems to be a place where obscure corner-case bugs in various
|
||||
compilers can be found. So while this feature can (and indeed should)
|
||||
be used (and would be difficult to avoid), caution should be used when
|
||||
pushing to extremes.
|
||||
|
||||
Here are a few closely related example bugs:<br>
|
||||
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95468><br>
|
||||
<https://developercommunity.visualstudio.com/content/problem/396562/sizeof-deduced-type-is-sometimes-not-a-constant-ex.html>
|
||||
|
||||
### enum
|
||||
|
||||
Where appropriate, _scoped-enums_ should be used.
|
||||
([n2347](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf))
|
||||
|
||||
Use of _unscoped-enums_ is permitted, though ordinary constants may be
|
||||
preferable when the automatic initializer feature isn't used.
|
||||
|
||||
The underlying type (the _enum-base_) of an unscoped enum type should
|
||||
always be specified explicitly. When unspecified, the underlying type
|
||||
is dependent on the range of the enumerator values and the platform.
|
||||
|
||||
The underlying type of a _scoped-enum_ should also be specified
|
||||
explicitly if conversions may be applied to values of that type.
|
||||
|
||||
Due to bugs in certain (very old) compilers, there is widespread use
|
||||
of enums and avoidance of in-class initialization of static integral
|
||||
constant members. Compilers having such bugs are no longer supported.
|
||||
Except where an enum is semantically appropriate, new code should use
|
||||
integral constants.
|
||||
|
||||
### thread_local
|
||||
|
||||
Do not use `thread_local`
|
||||
([n2659](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm));
|
||||
instead, use the HotSpot macro `THREAD_LOCAL`. The initializer must
|
||||
be a constant expression.
|
||||
|
||||
As was discussed in the review for
|
||||
[JDK-8230877](https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-September/039487.html),
|
||||
`thread_local` allows dynamic initialization and destruction
|
||||
semantics. However, that support requires a run-time penalty for
|
||||
references to non-function-local `thread_local` variables defined in a
|
||||
different translation unit, even if they don't need dynamic
|
||||
initialization. Dynamic initialization and destruction of
|
||||
namespace-scoped thread local variables also has the same ordering
|
||||
problems as for ordinary namespace-scoped variables.
|
||||
|
||||
### nullptr
|
||||
|
||||
Prefer `nullptr`
|
||||
([n2431](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf))
|
||||
to `NULL`. Don't use (constexpr or literal) 0 for pointers.
|
||||
|
||||
For historical reasons there are widespread uses of both `NULL` and of
|
||||
integer 0 as a pointer value.
|
||||
|
||||
### <atomic>
|
||||
|
||||
Do not use facilities provided by the `<atomic>` header
|
||||
([n2427](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html)),
|
||||
([n2752](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm));
|
||||
instead, use the HotSpot `Atomic` class and related facilities.
|
||||
|
||||
Atomic operations in HotSpot code must have semantics which are
|
||||
consistent with those provided by the JDK's compilers for Java. There
|
||||
are platform-specific implementation choices that a C++ compiler might
|
||||
make or change that are outside the scope of the C++ Standard, and
|
||||
might differ from what the Java compilers implement.
|
||||
|
||||
In addition, HotSpot `Atomic` has a concept of "conservative" memory
|
||||
ordering, which may differ from (may be stronger than) sequentially
|
||||
consistent. There are algorithms in HotSpot that are believed to rely
|
||||
on that ordering.
|
||||
|
||||
### Additional Permitted Features
|
||||
|
||||
* `constexpr`
|
||||
([n2235](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf))
|
||||
([n3652](https://isocpp.org/files/papers/N3652.html))
|
||||
|
||||
* Sized deallocation
|
||||
([n3778](https://isocpp.org/files/papers/n3778.html))
|
||||
|
||||
* Variadic templates
|
||||
([n2242](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf))
|
||||
([n2555](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf))
|
||||
|
||||
* Static assertions
|
||||
([n1720](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html))
|
||||
|
||||
* `decltype`
|
||||
([n2343](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf))
|
||||
([n3276](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf))
|
||||
|
||||
* Right angle brackets
|
||||
([n1757](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html))
|
||||
|
||||
* Default template arguments for function templates
|
||||
([CWG D226](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226))
|
||||
|
||||
* Template aliases
|
||||
([n2258](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf))
|
||||
|
||||
* Delegating constructors
|
||||
([n1986](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf))
|
||||
|
||||
* Explicit conversion operators
|
||||
([n2437](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf))
|
||||
|
||||
* Standard Layout Types
|
||||
([n2342](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm))
|
||||
|
||||
* Defaulted and deleted functions
|
||||
([n2346](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm))
|
||||
|
||||
* Dynamic initialization and destruction with concurrency
|
||||
([n2660](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm))
|
||||
|
||||
* `final` virtual specifiers for classes and virtual functions
|
||||
([n2928](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm)),
|
||||
([n3206](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm)),
|
||||
([n3272](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm))
|
||||
|
||||
* Local and unnamed types as template parameters
|
||||
([n2657](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm))
|
||||
|
||||
### Excluded Features
|
||||
|
||||
* New string and character literals
|
||||
* New character types
|
||||
([n2249](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html))
|
||||
* Unicode string literals
|
||||
([n2442](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm))
|
||||
* Raw string literals
|
||||
([n2442](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm))
|
||||
* Universal character name literals
|
||||
([n2170](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html))
|
||||
|
||||
HotSpot doesn't need any of the new character and string literal
|
||||
types.
|
||||
|
||||
* User-defined literals
|
||||
([n2765](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf)) —
|
||||
User-defined literals should not be added casually, but only
|
||||
through a proposal to add a specific UDL.
|
||||
|
||||
* Inline namespaces
|
||||
([n2535](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm)) —
|
||||
HotSpot makes very limited use of namespaces.
|
||||
|
||||
* `using namespace` directives. In particular, don't use `using
|
||||
namespace std;` to avoid needing to qualify Standard Library names.
|
||||
|
||||
* Propagating exceptions
|
||||
([n2179](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html)) —
|
||||
HotSpot does not permit the use of exceptions, so this feature isn't useful.
|
||||
|
||||
* Avoid namespace-scoped variables with non-constexpr initialization.
|
||||
In particular, avoid variables with types requiring non-trivial
|
||||
initialization or destruction. Initialization order problems can be
|
||||
difficult to deal with and lead to surprises, as can destruction
|
||||
ordering. HotSpot doesn't generally try to cleanup on exit, and
|
||||
running destructors at exit can also lead to problems.
|
||||
|
||||
* `[[deprecated]]` attribute
|
||||
([n3760](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html)) —
|
||||
Not relevant in HotSpot code.
|
||||
|
||||
* Avoid most operator overloading, preferring named functions. When
|
||||
operator overloading is used, ensure the semantics conform to the
|
||||
normal expected behavior of the operation.
|
||||
|
||||
* Avoid most implicit conversion constructors and (implicit or explicit)
|
||||
conversion operators. (Note that conversion to `bool` isn't needed
|
||||
in HotSpot code because of the "no implicit boolean" guideline.)
|
||||
|
||||
* Avoid covariant return types.
|
||||
|
||||
* Avoid `goto` statements.
|
||||
|
||||
### Undecided Features
|
||||
|
||||
This list is incomplete; it serves to explicitly call out some
|
||||
features that have not yet been discussed.
|
||||
|
||||
* `overrides` virtual specifiers for virtual functions
|
||||
([n3272](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm))
|
||||
|
||||
* Trailing return type syntax for functions
|
||||
([n2541](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm))
|
||||
|
||||
* Variable templates
|
||||
([n3651](https://isocpp.org/files/papers/N3651.pdf))
|
||||
|
||||
* Member initializers and aggregates
|
||||
([n3653](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html))
|
||||
|
||||
* `[[noreturn]]` attribute
|
||||
([n2761](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf))
|
||||
|
||||
* Rvalue references and move semantics
|
||||
|
||||
* Lambdas
|
||||
|
||||
|
||||
[ADL]: https://en.cppreference.com/w/cpp/language/adl
|
||||
"Argument Dependent Lookup"
|
||||
|
||||
[ODR]: https://en.cppreference.com/w/cpp/language/definition
|
||||
"One Definition Rule"
|
||||
|
||||
[RAII]: https://en.cppreference.com/w/cpp/language/raii
|
||||
"Resource Acquisition Is Initialization"
|
||||
|
||||
[RTTI]: https://en.wikipedia.org/wiki/Run-time_type_information
|
||||
"Runtime Type Information"
|
||||
|
||||
[SFINAE]: https://en.cppreference.com/w/cpp/language/sfinae
|
||||
"Substitution Failure Is Not An Error"
|
||||
223
doc/hotspot-unit-tests.html
Normal file
223
doc/hotspot-unit-tests.html
Normal file
@@ -0,0 +1,223 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Native/Unit Test Development Guidelines</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">Native/Unit Test Development Guidelines</h1>
|
||||
</header>
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#good-test-properties">Good test properties</a><ul>
|
||||
<li><a href="#lightness">Lightness</a></li>
|
||||
<li><a href="#isolation">Isolation</a></li>
|
||||
<li><a href="#atomicity-and-self-containment">Atomicity and self-containment</a></li>
|
||||
<li><a href="#repeatability">Repeatability</a></li>
|
||||
<li><a href="#informativeness">Informativeness</a></li>
|
||||
<li><a href="#testing-instead-of-visiting">Testing instead of visiting</a></li>
|
||||
<li><a href="#nearness">Nearness</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#asserts">Asserts</a><ul>
|
||||
<li><a href="#several-checks">Several checks</a></li>
|
||||
<li><a href="#first-parameter-is-expected-value">First parameter is expected value</a></li>
|
||||
<li><a href="#floating-point-comparison">Floating-point comparison</a></li>
|
||||
<li><a href="#c-string-comparison">C string comparison</a></li>
|
||||
<li><a href="#error-messages">Error messages</a></li>
|
||||
<li><a href="#uncluttered-output">Uncluttered output</a></li>
|
||||
<li><a href="#failures-propagation">Failures propagation</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#naming-and-grouping">Naming and Grouping</a><ul>
|
||||
<li><a href="#test-group-names">Test group names</a></li>
|
||||
<li><a href="#filename">Filename</a></li>
|
||||
<li><a href="#file-location">File location</a></li>
|
||||
<li><a href="#test-names">Test names</a></li>
|
||||
<li><a href="#fixture-classes">Fixture classes</a></li>
|
||||
<li><a href="#friend-classes">Friend classes</a></li>
|
||||
<li><a href="#oscpu-specific-tests">OS/CPU specific tests</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#miscellaneous">Miscellaneous</a><ul>
|
||||
<li><a href="#hotspot-style">Hotspot style</a></li>
|
||||
<li><a href="#codetest-metrics">Code/test metrics</a></li>
|
||||
<li><a href="#access-to-non-public-members">Access to non-public members</a></li>
|
||||
<li><a href="#death-tests">Death tests</a></li>
|
||||
<li><a href="#external-flags">External flags</a></li>
|
||||
<li><a href="#test-specific-flags">Test-specific flags</a></li>
|
||||
<li><a href="#flag-restoring">Flag restoring</a></li>
|
||||
<li><a href="#googletest-documentation">GoogleTest documentation</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#todo">TODO</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<p>The purpose of these guidelines is to establish a shared vision on what kind of native tests and how we want to develop them for Hotspot using GoogleTest. Hence these guidelines include style items as well as test approach items.</p>
|
||||
<p>First section of this document describes properties of good tests which are common for almost all types of test regardless of language, framework, etc. Further sections provide recommendations to achieve those properties and other HotSpot and/or GoogleTest specific guidelines.</p>
|
||||
<h2 id="good-test-properties">Good test properties</h2>
|
||||
<h3 id="lightness">Lightness</h3>
|
||||
<p>Use the most lightweight type of tests.</p>
|
||||
<p>In Hotspot, there are 3 different types of tests regarding their dependency on a JVM, each next level is slower than previous</p>
|
||||
<ul>
|
||||
<li><p><code>TEST</code> : a test does not depend on a JVM</p></li>
|
||||
<li><p><code>TEST_VM</code> : a test does depend on an initialized JVM, but are supposed not to break a JVM, i.e. leave it in a workable state.</p></li>
|
||||
<li><p><code>TEST_OTHER_VM</code> : a test depends on a JVM and requires a freshly initialized JVM or leaves a JVM in non-workable state</p></li>
|
||||
</ul>
|
||||
<h3 id="isolation">Isolation</h3>
|
||||
<p>Tests have to be isolated: not to have visible side-effects, influences on other tests results.</p>
|
||||
<p>Results of one test should not depend on test execution order, other tests, otherwise it is becoming almost impossible to find out why a test failed. Due to hotspot-specific, it is not so easy to get a full isolation, e.g. we share an initialized JVM between all <code>TEST_VM</code> tests, so if your test changes JVM's state too drastically and does not change it back, you had better consider <code>TEST_OTHER_VM</code>.</p>
|
||||
<h3 id="atomicity-and-self-containment">Atomicity and self-containment</h3>
|
||||
<p>Tests should be <em>atomic</em> and <em>self-contained</em> at the same time.</p>
|
||||
<p>One test should check a particular part of a class, subsystem, functionality, etc. Then it is quite easy to determine what parts of a product are broken basing on test failures. On the other hand, a test should test that part more-or-less entirely, because when one sees a test <code>FooTest::bar</code>, they assume all aspects of bar from <code>Foo</code> are tested.</p>
|
||||
<p>However, it is impossible to cover all aspects even of a method, not to mention a subsystem. In such cases, it is recommended to have several tests, one for each aspect of a thing under test. For example one test to tests how <code>Foo::bar</code> works if an argument is <code>null</code>, another test to test how it works if an argument is acceptable but <code>Foo</code> is not in the right state to accept it and so on. This helps not only to make tests atomic, self-contained but also makes test name self-descriptive (discussed in more details in <a href="#test-names">Test names</a>).</p>
|
||||
<h3 id="repeatability">Repeatability</h3>
|
||||
<p>Tests have to be repeatable.</p>
|
||||
<p>Reproducibility is very crucial for a test. No one likes sporadic test failures, they are hard to investigate, fix and verify a fix.</p>
|
||||
<p>In some cases, it is quite hard to write a 100% repeatable test, since besides a test there can be other moving parts, e.g. in case of <code>TEST_VM</code> there are several concurrently running threads. Despite this, we should try to make a test as reproducible as possible.</p>
|
||||
<h3 id="informativeness">Informativeness</h3>
|
||||
<p>In case of a failure, a test should be as <em>informative</em> as possible.</p>
|
||||
<p>Having more information about a test failure than just compared values can be very useful for failure troubleshooting, it can reduce or even completely eliminate debugging hours. This is even more important in case of not 100% reproducible failures.</p>
|
||||
<p>Achieving this property, one can easily make a test too verbose, so it will be really hard to find useful information in the ocean of useless information. Hence they should not only think about how to provide <a href="#error-messages">good information</a>, but also <a href="#uncluttered-output">when to do it</a>.</p>
|
||||
<h3 id="testing-instead-of-visiting">Testing instead of visiting</h3>
|
||||
<p>Tests should <em>test</em>.</p>
|
||||
<p>It is not enough just to "visit" some code, a test should check that code does that it has to do, compare return values with expected values, check that desired side effects are done, and undesired are not, and so on. In other words, a test should contain at least one GoogleTest assertion and do not rely on JVM asserts.</p>
|
||||
<p>Generally speaking to write a good test, one should create a model of the system under tests, a model of possible bugs (or bugs which one wants to find) and design tests using those models.</p>
|
||||
<h3 id="nearness">Nearness</h3>
|
||||
<p>Prefer having checks inside test code.</p>
|
||||
<p>Not only does having test logic outside, e.g. verification method, depending on asserts in product code contradict with several items above but also decreases test’s readability and stability. It is much easier to understand that a test is testing when all testing logic is located inside a test or nearby in shared test libraries. As a rule of thumb, the closer a check to a test, the better.</p>
|
||||
<h2 id="asserts">Asserts</h2>
|
||||
<h3 id="several-checks">Several checks</h3>
|
||||
<p>Prefer <code>EXPECT</code> over <code>ASSERT</code> if possible.</p>
|
||||
<p>This is related to the <a href="#informativeness">informativeness</a> property of tests, information for other checks can help to better localize a defect’s root-cause. One should use <code>ASSERT</code> if it is impossible to continue test execution or if it does not make much sense. Later in the text, <code>EXPECT</code> forms will be used to refer to both <code>ASSERT/EXPECT</code>.</p>
|
||||
<p>When it is possible to make several different checks, but impossible to continue test execution if at least one check fails, you can use <code>::testing::Test::HasNonfatalFailure()</code> function. The recommended way to express that is <code>ASSERT_FALSE(::testing::Test::HasNonfatalFailure())</code>. Besides making it clear why a test is aborted, it also allows you to provide more information about a failure.</p>
|
||||
<h3 id="first-parameter-is-expected-value">First parameter is expected value</h3>
|
||||
<p>In all equality assertions, expected values should be passed as the first parameter.</p>
|
||||
<p>This convention is adopted by GoogleTest, and there is a slight difference in how GoogleTest treats parameters, the most important one is <code>null</code> detection. Due to different reasons, <code>null</code> detection is enabled only for the first parameter, that is to said <code>EXPECT_EQ(NULL, object)</code> checks that object is <code>null</code>, while <code>EXPECT_EQ(object, NULL)</code> checks that object equals to <code>NULL</code>, GoogleTest is very strict regarding types of compared values so the latter will generates a compile-time error.</p>
|
||||
<h3 id="floating-point-comparison">Floating-point comparison</h3>
|
||||
<p>Use floating-point special macros to compare <code>float/double</code> values.</p>
|
||||
<p>Because of floating-point number representations and round-off errors, regular equality comparison will not return true in most cases. There are special <code>EXPECT_FLOAT_EQ/EXPECT_DOUBLE_EQ</code> assertions which check that the distance between compared values is not more than 4 ULPs, there is also <code>EXPECT_NEAR(v1, v2, eps)</code> which checks that the absolute value of the difference between <code>v1</code> and <code>v2</code> is not greater than <code>eps</code>.</p>
|
||||
<h3 id="c-string-comparison">C string comparison</h3>
|
||||
<p>Use string special macros for C strings comparisons.</p>
|
||||
<p><code>EXPECT_EQ</code> just compares pointers’ values, which is hardly what one wants comparing C strings. GoogleTest provides <code>EXPECT_STREQ</code> and <code>EXPECT_STRNE</code> macros to compare C string contents. There are also case-insensitive versions <code>EXPECT_STRCASEEQ</code>, <code>EXPECT_STRCASENE</code>.</p>
|
||||
<h3 id="error-messages">Error messages</h3>
|
||||
<p>Provide informative, but not too verbose error messages.</p>
|
||||
<p>All GoogleTest asserts print compared expressions and their values, so there is no need to have them in error messages. Asserts print only compared values, they do not print any of interim variables, e.g. <code>ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)</code> prints only one value. If you use some complex predicates, please consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code> assertions family, they check that a predicate returns true/success and print out all parameters values.</p>
|
||||
<p>However in some cases, default information is not enough, a commonly used example is an assert inside a loop, GoogleTest will not print iteration values (unless it is an assert's parameter). Other demonstrative examples are printing error code and a corresponding error message; printing internal states which might have an impact on results. One should add this information to assert message using <code><<</code> operator.</p>
|
||||
<h3 id="uncluttered-output">Uncluttered output</h3>
|
||||
<p>Print information only if it is needed.</p>
|
||||
<p>Too verbose tests which print all information even if they pass are very bad practice. They just pollute output, so it becomes harder to find useful information. In order not print information till it is really needed, one should consider saving it to a temporary buffer and pass to an assert. <a href="https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp" class="uri">https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp</a> has a good example how to do that.</p>
|
||||
<h3 id="failures-propagation">Failures propagation</h3>
|
||||
<p>Wrap a subroutine call into <code>EXPECT_NO_FATAL_FAILURE</code> macro to propagate failures.</p>
|
||||
<p><code>ASSERT</code> and <code>FAIL</code> abort only the current function, so if you have them in a subroutine, a test will not be aborted after the subroutine even if <code>ASSERT</code> or <code>FAIL</code> fails. You should call such subroutines in <code>ASSERT_NO_FATAL_FAILURE</code> macro to propagate fatal failures and abort a test. <code>(EXPECT|ASSERT)_NO_FATAL_FAILURE</code> can also be used to provide more information.</p>
|
||||
<p>Due to obvious reasons, there are no <code>(EXPECT|ASSERT)_NO_NONFATAL_FAILURE</code> macros. However, if you need to check if a subroutine generated a nonfatal failure (failed an <code>EXPECT</code>), you can use <code>::testing::Test::HasNonfatalFailure</code> function, or <code>::testing::Test::HasFailure</code> function to check if a subroutine generated any failures, see <a href="#several-checks">Several checks</a>.</p>
|
||||
<h2 id="naming-and-grouping">Naming and Grouping</h2>
|
||||
<h3 id="test-group-names">Test group names</h3>
|
||||
<p>Test group names should be in CamelCase, start and end with a letter. A test group should be named after tested class, functionality, subsystem, etc.</p>
|
||||
<p>This naming scheme helps to find tests, filter them and simplifies test failure analysis. For example, class <code>Foo</code> - test group <code>Foo</code>, compiler logging subsystem - test group <code>CompilerLogging</code>, G1 GC — test group <code>G1GC</code>, and so forth.</p>
|
||||
<h3 id="filename">Filename</h3>
|
||||
<p>A test file must have <code>test_</code> prefix and <code>.cpp</code> suffix.</p>
|
||||
<p>Both are actually requirements from the current build system to recognize your tests.</p>
|
||||
<h3 id="file-location">File location</h3>
|
||||
<p>Test file location should reflect a location of the tested part of the product.</p>
|
||||
<ul>
|
||||
<li><p>All unit tests for a class from <code>foo/bar/baz.cpp</code> should be placed <code>foo/bar/test_baz.cpp</code> in <code>hotspot/test/native/</code> directory. Having all tests for a class in one file is a common practice for unit tests, it helps to see all existing tests at once, share functions and/or resources without losing encapsulation.</p></li>
|
||||
<li><p>For tests which test more than one class, directory hierarchy should be the same as product hierarchy, and file name should reflect the name of the tested subsystem/functionality. For example, if a sub-system under tests belongs to <code>gc/g1</code>, tests should be placed in <code>gc/g1</code> directory.</p></li>
|
||||
</ul>
|
||||
<p>Please note that framework prepends directory name to a test group name. For example, if <code>TEST(foo, check_this)</code> and <code>TEST(bar, check_that)</code> are defined in <code>hotspot/test/native/gc/shared/test_foo.cpp</code> file, they will be reported as <code>gc/shared/foo::check_this</code> and <code>gc/shared/bar::check_that</code>.</p>
|
||||
<h3 id="test-names">Test names</h3>
|
||||
<p>Test names should be in small_snake_case, start and end with a letter. A test name should reflect that a test checks.</p>
|
||||
<p>Such naming makes tests self-descriptive and helps a lot during the whole test life cycle. It is easy to do test planning, test inventory, to see what things are not tested, to review tests, to analyze test failures, to evolve a test, etc. For example <code>foo_return_0_if_name_is_null</code> is better than <code>foo_sanity</code> or <code>foo_basic</code> or just <code>foo</code>, <code>humongous_objects_can_not_be_moved_by_young_gc</code> is better than <code>ho_young_gc</code>.</p>
|
||||
<p>Actually using underscore is against GoogleTest project convention, because it can lead to illegal identifiers, however, this is too strict. Restricting usage of underscore for test names only and prohibiting test name starts or ends with an underscore are enough to be safe.</p>
|
||||
<h3 id="fixture-classes">Fixture classes</h3>
|
||||
<p>Fixture classes should be named after tested classes, subsystems, etc (follow <a href="#test-group-names">Test group names rule</a>) and have <code>Test</code> suffix to prevent class name conflicts.</p>
|
||||
<h3 id="friend-classes">Friend classes</h3>
|
||||
<p>All test purpose friends should have either <code>Test</code> or <code>Testable</code> suffix.</p>
|
||||
<p>It greatly simplifies understanding of friendship’s purpose and allows statically check that private members are not exposed unexpectedly. Having <code>FooTest</code> as a friend of <code>Foo</code> without any comments will be understood as a necessary evil to get testability.</p>
|
||||
<h3 id="oscpu-specific-tests">OS/CPU specific tests</h3>
|
||||
<p>Guard OS/CPU specific tests by <code>#ifdef</code> and have OS/CPU name in filename.</p>
|
||||
<p>For the time being, we do not support separate directories for OS, CPU, OS-CPU specific tests, in case we will have lots of such tests, we will change directory layout and build system to support that in the same way it is done in hotspot.</p>
|
||||
<h2 id="miscellaneous">Miscellaneous</h2>
|
||||
<h3 id="hotspot-style">Hotspot style</h3>
|
||||
<p>Abide the norms and rules accepted in Hotspot style guide.</p>
|
||||
<p>Tests are a part of Hotspot, so everything (if applicable) we use for Hotspot, should be used for tests as well. Those guidelines cover test-specific things.</p>
|
||||
<h3 id="codetest-metrics">Code/test metrics</h3>
|
||||
<p>Coverage information and other code/test metrics are quite useful to decide what tests should be written, what tests should be improved and what can be removed.</p>
|
||||
<p>For unit tests, widely used and well-known coverage metric is branch coverage, which provides good quality of tests with relatively easy test development process. For other levels of testing, branch coverage is not as good, and one should consider others metrics, e.g. transaction flow coverage, data flow coverage.</p>
|
||||
<h3 id="access-to-non-public-members">Access to non-public members</h3>
|
||||
<p>Use explicit friend class to get access to non-public members.</p>
|
||||
<p>We do not use GoogleTest macro to declare friendship relation, because, from our point of view, it is less clear than an explicit declaration.</p>
|
||||
<p>Declaring a test fixture class as a friend class of a tested test is the easiest and the clearest way to get access. However, it has some disadvantages, here is some of them:</p>
|
||||
<ul>
|
||||
<li>Each test has to be declared as a friend</li>
|
||||
<li>Subclasses do not inheritance friendship relation</li>
|
||||
</ul>
|
||||
<p>In other words, it is harder to share code between tests. Hence if you want to share code or expect it to be useful in other tests, you should consider making members in a tested class protected and introduce a shared test-only class which expose those members via public functions, or even making members publicly accessible right away in a product class. If it is not an option to change members visibility, one can create a friend class which exposes members.</p>
|
||||
<h3 id="death-tests">Death tests</h3>
|
||||
<p>You can not use death tests inside <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code>.</p>
|
||||
<p>We tried to make Hotspot-GoogleTest integration as transparent as possible, however, due to the current implementation of <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> tests, you cannot use death test functionality in them. These tests are implemented as GoogleTest death tests, and GoogleTest does not allow to have a death test inside another death test.</p>
|
||||
<h3 id="external-flags">External flags</h3>
|
||||
<p>Passing external flags to a tested JVM is not supported.</p>
|
||||
<p>The rationality of such design decision is to simplify both tests and a test framework and to avoid failures related to incompatible flags combination till there is a good solution for that. However there are cases when one wants to test a JVM with specific flags combination, <code>_JAVA_OPTIONS</code> environment variable can be used to do that. Flags from <code>_JAVA_OPTIONS</code> will be used in <code>TEST_VM</code>, <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> tests.</p>
|
||||
<h3 id="test-specific-flags">Test-specific flags</h3>
|
||||
<p>Passing flags to a tested JVM in <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> should be possible, but is not implemented yet.</p>
|
||||
<p>Facility to pass test-specific flags is needed for system, regression or other types of tests which require a fully initialized JVM in some particular configuration, e.g. with Serial GC selected. There is no support for such tests now, however, there is a plan to add that in upcoming releases.</p>
|
||||
<p>For now, if a test depends on flags values, it should have <code>if (!<flag>) { return }</code> guards in the very beginning and <code>@requires</code> comment similar to jtreg <code>@requires</code> directive right before test macros. <a href="https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp" class="uri">https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp</a> ha an example of this temporary workaround. It is important to follow that pattern as it allows us to easily find all such tests and update them as soon as there is an implementation of flag passing facility.</p>
|
||||
<p>In long-term, we expect jtreg to support GoogleTest tests as first class citizens, that is to say, jtreg will parse <span class="citation" data-cites="requires">@requires</span> comments and filter out inapplicable tests.</p>
|
||||
<h3 id="flag-restoring">Flag restoring</h3>
|
||||
<p>Restore changed flags.</p>
|
||||
<p>It is quite common for tests to configure JVM in a certain way changing flags’ values. GoogleTest provides two ways to set up environment before a test and restore it afterward: using either constructor and destructor or <code>SetUp</code> and <code>TearDown</code> functions. Both ways require to use a test fixture class, which sometimes is too wordy. The simpler facilities like <code>FLAG_GUARD</code> macro or <code>*FlagSetting</code> classes could be used in such cases to restore/set values.</p>
|
||||
<p>Caveats:</p>
|
||||
<ul>
|
||||
<li><p>Changing a flag’s value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.</p></li>
|
||||
<li><p><code>FLAG_SET_*</code> macros can change more than one flag (in order to maintain invariants) so it is hard to predict what flags will be changed and it makes restoring all changed flags a nontrivial task. Thus in case one uses <code>FLAG_SET_*</code> macros, they should use <code>TEST_OTHER_VM</code> test type.</p></li>
|
||||
</ul>
|
||||
<h3 id="googletest-documentation">GoogleTest documentation</h3>
|
||||
<p>In case you have any questions regarding GoogleTest itself, its asserts, test declaration macros, other macros, etc, please consult its documentation.</p>
|
||||
<h2 id="todo">TODO</h2>
|
||||
<p>Although this document provides guidelines on the most important parts of test development using GTest, it still misses a few items:</p>
|
||||
<ul>
|
||||
<li><p>Examples, esp for <a href="#access-to-non-public-members">access to non-public members</a></p></li>
|
||||
<li>test types: purpose, drawbacks, limitation
|
||||
<ul>
|
||||
<li><code>TEST_VM</code></li>
|
||||
<li><code>TEST_VM_F</code></li>
|
||||
<li><code>TEST_OTHER_VM</code></li>
|
||||
<li><code>TEST_VM_ASSERT</code></li>
|
||||
<li><code>TEST_VM_ASSERT_MSG</code></li>
|
||||
</ul></li>
|
||||
<li>Miscellaneous
|
||||
<ul>
|
||||
<li>Test libraries
|
||||
<ul>
|
||||
<li>where to place</li>
|
||||
<li>how to write</li>
|
||||
<li>how to use</li>
|
||||
</ul></li>
|
||||
<li>test your tests
|
||||
<ul>
|
||||
<li>how to run tests in random order</li>
|
||||
<li>how to run only specific tests</li>
|
||||
<li>how to run each test separately</li>
|
||||
<li>check that a test can find bugs it is supposed to by introducing them</li>
|
||||
</ul></li>
|
||||
<li>mocks/stubs/dependency injection</li>
|
||||
<li>setUp/tearDown
|
||||
<ul>
|
||||
<li>vs c-tor/d-tor</li>
|
||||
<li>empty test to test them</li>
|
||||
</ul></li>
|
||||
<li>internal (declared in .cpp) struct/classes</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
451
doc/hotspot-unit-tests.md
Normal file
451
doc/hotspot-unit-tests.md
Normal file
@@ -0,0 +1,451 @@
|
||||
% Native/Unit Test Development Guidelines
|
||||
|
||||
The purpose of these guidelines is to establish a shared vision on
|
||||
what kind of native tests and how we want to develop them for Hotspot
|
||||
using GoogleTest. Hence these guidelines include style items as well
|
||||
as test approach items.
|
||||
|
||||
First section of this document describes properties of good tests
|
||||
which are common for almost all types of test regardless of language,
|
||||
framework, etc. Further sections provide recommendations to achieve
|
||||
those properties and other HotSpot and/or GoogleTest specific
|
||||
guidelines.
|
||||
|
||||
## Good test properties
|
||||
|
||||
### Lightness
|
||||
|
||||
Use the most lightweight type of tests.
|
||||
|
||||
In Hotspot, there are 3 different types of tests regarding their
|
||||
dependency on a JVM, each next level is slower than previous
|
||||
|
||||
* `TEST` : a test does not depend on a JVM
|
||||
|
||||
* `TEST_VM` : a test does depend on an initialized JVM, but are
|
||||
supposed not to break a JVM, i.e. leave it in a workable state.
|
||||
|
||||
* `TEST_OTHER_VM` : a test depends on a JVM and requires a freshly
|
||||
initialized JVM or leaves a JVM in non-workable state
|
||||
|
||||
### Isolation
|
||||
|
||||
Tests have to be isolated: not to have visible side-effects,
|
||||
influences on other tests results.
|
||||
|
||||
Results of one test should not depend on test execution order, other
|
||||
tests, otherwise it is becoming almost impossible to find out why a
|
||||
test failed. Due to hotspot-specific, it is not so easy to get a full
|
||||
isolation, e.g. we share an initialized JVM between all `TEST_VM` tests,
|
||||
so if your test changes JVM's state too drastically and does not
|
||||
change it back, you had better consider `TEST_OTHER_VM`.
|
||||
|
||||
### Atomicity and self-containment
|
||||
|
||||
Tests should be *atomic* and *self-contained* at the same time.
|
||||
|
||||
One test should check a particular part of a class, subsystem,
|
||||
functionality, etc. Then it is quite easy to determine what parts of a
|
||||
product are broken basing on test failures. On the other hand, a test
|
||||
should test that part more-or-less entirely, because when one sees a
|
||||
test `FooTest::bar`, they assume all aspects of bar from `Foo` are tested.
|
||||
|
||||
However, it is impossible to cover all aspects even of a method, not
|
||||
to mention a subsystem. In such cases, it is recommended to have
|
||||
several tests, one for each aspect of a thing under test. For example
|
||||
one test to tests how `Foo::bar` works if an argument is `null`, another
|
||||
test to test how it works if an argument is acceptable but `Foo` is not
|
||||
in the right state to accept it and so on. This helps not only to make
|
||||
tests atomic, self-contained but also makes test name self-descriptive
|
||||
(discussed in more details in [Test names](#test-names)).
|
||||
|
||||
### Repeatability
|
||||
|
||||
Tests have to be repeatable.
|
||||
|
||||
Reproducibility is very crucial for a test. No one likes sporadic test
|
||||
failures, they are hard to investigate, fix and verify a fix.
|
||||
|
||||
In some cases, it is quite hard to write a 100% repeatable test, since
|
||||
besides a test there can be other moving parts, e.g. in case of
|
||||
`TEST_VM` there are several concurrently running threads. Despite this,
|
||||
we should try to make a test as reproducible as possible.
|
||||
|
||||
### Informativeness
|
||||
|
||||
In case of a failure, a test should be as *informative* as possible.
|
||||
|
||||
Having more information about a test failure than just compared values
|
||||
can be very useful for failure troubleshooting, it can reduce or even
|
||||
completely eliminate debugging hours. This is even more important in
|
||||
case of not 100% reproducible failures.
|
||||
|
||||
Achieving this property, one can easily make a test too verbose, so it
|
||||
will be really hard to find useful information in the ocean of useless
|
||||
information. Hence they should not only think about how to provide
|
||||
[good information](#error-messages), but also
|
||||
[when to do it](#uncluttered-output).
|
||||
|
||||
### Testing instead of visiting
|
||||
|
||||
Tests should *test*.
|
||||
|
||||
It is not enough just to "visit" some code, a test should check that
|
||||
code does that it has to do, compare return values with expected
|
||||
values, check that desired side effects are done, and undesired are
|
||||
not, and so on. In other words, a test should contain at least one
|
||||
GoogleTest assertion and do not rely on JVM asserts.
|
||||
|
||||
Generally speaking to write a good test, one should create a model of
|
||||
the system under tests, a model of possible bugs (or bugs which one
|
||||
wants to find) and design tests using those models.
|
||||
|
||||
### Nearness
|
||||
|
||||
Prefer having checks inside test code.
|
||||
|
||||
Not only does having test logic outside, e.g. verification method,
|
||||
depending on asserts in product code contradict with several items
|
||||
above but also decreases test’s readability and stability. It is much
|
||||
easier to understand that a test is testing when all testing logic is
|
||||
located inside a test or nearby in shared test libraries. As a rule of
|
||||
thumb, the closer a check to a test, the better.
|
||||
|
||||
## Asserts
|
||||
|
||||
### Several checks
|
||||
|
||||
Prefer `EXPECT` over `ASSERT` if possible.
|
||||
|
||||
This is related to the [informativeness](#informativeness) property of
|
||||
tests, information for other checks can help to better localize a
|
||||
defect’s root-cause. One should use `ASSERT` if it is impossible to
|
||||
continue test execution or if it does not make much sense. Later in
|
||||
the text, `EXPECT` forms will be used to refer to both
|
||||
`ASSERT/EXPECT`.
|
||||
|
||||
When it is possible to make several different checks, but impossible
|
||||
to continue test execution if at least one check fails, you can
|
||||
use `::testing::Test::HasNonfatalFailure()` function. The recommended
|
||||
way to express that is
|
||||
`ASSERT_FALSE(::testing::Test::HasNonfatalFailure())`. Besides making it
|
||||
clear why a test is aborted, it also allows you to provide more
|
||||
information about a failure.
|
||||
|
||||
### First parameter is expected value
|
||||
|
||||
In all equality assertions, expected values should be passed as the
|
||||
first parameter.
|
||||
|
||||
This convention is adopted by GoogleTest, and there is a slight
|
||||
difference in how GoogleTest treats parameters, the most important one
|
||||
is `null` detection. Due to different reasons, `null` detection is enabled
|
||||
only for the first parameter, that is to said `EXPECT_EQ(NULL, object)`
|
||||
checks that object is `null`, while `EXPECT_EQ(object, NULL)` checks that
|
||||
object equals to `NULL`, GoogleTest is very strict regarding types of
|
||||
compared values so the latter will generates a compile-time error.
|
||||
|
||||
### Floating-point comparison
|
||||
|
||||
Use floating-point special macros to compare `float/double` values.
|
||||
|
||||
Because of floating-point number representations and round-off errors,
|
||||
regular equality comparison will not return true in most cases. There
|
||||
are special `EXPECT_FLOAT_EQ/EXPECT_DOUBLE_EQ` assertions which check
|
||||
that the distance between compared values is not more than 4 ULPs,
|
||||
there is also `EXPECT_NEAR(v1, v2, eps)` which checks that the absolute
|
||||
value of the difference between `v1` and `v2` is not greater than `eps`.
|
||||
|
||||
### C string comparison
|
||||
|
||||
Use string special macros for C strings comparisons.
|
||||
|
||||
`EXPECT_EQ` just compares pointers’ values, which is hardly what one
|
||||
wants comparing C strings. GoogleTest provides `EXPECT_STREQ` and
|
||||
`EXPECT_STRNE` macros to compare C string contents. There are also
|
||||
case-insensitive versions `EXPECT_STRCASEEQ`, `EXPECT_STRCASENE`.
|
||||
|
||||
### Error messages
|
||||
|
||||
Provide informative, but not too verbose error messages.
|
||||
|
||||
All GoogleTest asserts print compared expressions and their values, so
|
||||
there is no need to have them in error messages. Asserts print only
|
||||
compared values, they do not print any of interim variables, e.g.
|
||||
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
|
||||
one value. If you use some complex predicates, please consider
|
||||
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
|
||||
a predicate returns true/success and print out all parameters values.
|
||||
|
||||
However in some cases, default information is not enough, a commonly
|
||||
used example is an assert inside a loop, GoogleTest will not print
|
||||
iteration values (unless it is an assert's parameter). Other
|
||||
demonstrative examples are printing error code and a corresponding
|
||||
error message; printing internal states which might have an impact on
|
||||
results. One should add this information to assert message using `<<`
|
||||
operator.
|
||||
|
||||
### Uncluttered output
|
||||
|
||||
Print information only if it is needed.
|
||||
|
||||
Too verbose tests which print all information even if they pass are
|
||||
very bad practice. They just pollute output, so it becomes harder to
|
||||
find useful information. In order not print information till it is
|
||||
really needed, one should consider saving it to a temporary buffer and
|
||||
pass to an assert.
|
||||
<https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp>
|
||||
has a good example how to do that.
|
||||
|
||||
### Failures propagation
|
||||
|
||||
Wrap a subroutine call into `EXPECT_NO_FATAL_FAILURE` macro to
|
||||
propagate failures.
|
||||
|
||||
`ASSERT` and `FAIL` abort only the current function, so if you have them
|
||||
in a subroutine, a test will not be aborted after the subroutine even
|
||||
if `ASSERT` or `FAIL` fails. You should call such subroutines in
|
||||
`ASSERT_NO_FATAL_FAILURE` macro to propagate fatal failures and abort a
|
||||
test. `(EXPECT|ASSERT)_NO_FATAL_FAILURE` can also be used to provide
|
||||
more information.
|
||||
|
||||
Due to obvious reasons, there are no
|
||||
`(EXPECT|ASSERT)_NO_NONFATAL_FAILURE` macros. However, if you need to
|
||||
check if a subroutine generated a nonfatal failure (failed an `EXPECT`),
|
||||
you can use `::testing::Test::HasNonfatalFailure` function,
|
||||
or `::testing::Test::HasFailure` function to check if a subroutine
|
||||
generated any failures, see [Several checks](#several-checks).
|
||||
|
||||
## Naming and Grouping
|
||||
|
||||
### Test group names
|
||||
|
||||
Test group names should be in CamelCase, start and end with a letter.
|
||||
A test group should be named after tested class, functionality,
|
||||
subsystem, etc.
|
||||
|
||||
This naming scheme helps to find tests, filter them and simplifies
|
||||
test failure analysis. For example, class `Foo` - test group `Foo`,
|
||||
compiler logging subsystem - test group `CompilerLogging`, G1 GC — test
|
||||
group `G1GC`, and so forth.
|
||||
|
||||
### Filename
|
||||
|
||||
A test file must have `test_` prefix and `.cpp` suffix.
|
||||
|
||||
Both are actually requirements from the current build system to
|
||||
recognize your tests.
|
||||
|
||||
### File location
|
||||
|
||||
Test file location should reflect a location of the tested part of the product.
|
||||
|
||||
* All unit tests for a class from `foo/bar/baz.cpp` should be placed
|
||||
`foo/bar/test_baz.cpp` in `hotspot/test/native/` directory. Having all
|
||||
tests for a class in one file is a common practice for unit tests, it
|
||||
helps to see all existing tests at once, share functions and/or
|
||||
resources without losing encapsulation.
|
||||
|
||||
* For tests which test more than one class, directory hierarchy should
|
||||
be the same as product hierarchy, and file name should reflect the
|
||||
name of the tested subsystem/functionality. For example, if a
|
||||
sub-system under tests belongs to `gc/g1`, tests should be placed in
|
||||
`gc/g1` directory.
|
||||
|
||||
Please note that framework prepends directory name to a test group
|
||||
name. For example, if `TEST(foo, check_this)` and `TEST(bar, check_that)`
|
||||
are defined in `hotspot/test/native/gc/shared/test_foo.cpp` file, they
|
||||
will be reported as `gc/shared/foo::check_this` and
|
||||
`gc/shared/bar::check_that`.
|
||||
|
||||
### Test names
|
||||
|
||||
Test names should be in small_snake_case, start and end with a letter.
|
||||
A test name should reflect that a test checks.
|
||||
|
||||
Such naming makes tests self-descriptive and helps a lot during the
|
||||
whole test life cycle. It is easy to do test planning, test inventory,
|
||||
to see what things are not tested, to review tests, to analyze test
|
||||
failures, to evolve a test, etc. For example
|
||||
`foo_return_0_if_name_is_null` is better than `foo_sanity` or `foo_basic` or
|
||||
just `foo`, `humongous_objects_can_not_be_moved_by_young_gc` is better
|
||||
than `ho_young_gc`.
|
||||
|
||||
Actually using underscore is against GoogleTest project convention,
|
||||
because it can lead to illegal identifiers, however, this is too
|
||||
strict. Restricting usage of underscore for test names only and
|
||||
prohibiting test name starts or ends with an underscore are enough to
|
||||
be safe.
|
||||
|
||||
### Fixture classes
|
||||
|
||||
Fixture classes should be named after tested classes, subsystems, etc
|
||||
(follow [Test group names rule](#test-group-names)) and have
|
||||
`Test` suffix to prevent class name conflicts.
|
||||
|
||||
### Friend classes
|
||||
|
||||
All test purpose friends should have either `Test` or `Testable` suffix.
|
||||
|
||||
It greatly simplifies understanding of friendship’s purpose and allows
|
||||
statically check that private members are not exposed unexpectedly.
|
||||
Having `FooTest` as a friend of `Foo` without any comments will be
|
||||
understood as a necessary evil to get testability.
|
||||
|
||||
### OS/CPU specific tests
|
||||
|
||||
Guard OS/CPU specific tests by `#ifdef` and have OS/CPU name in filename.
|
||||
|
||||
For the time being, we do not support separate directories for OS,
|
||||
CPU, OS-CPU specific tests, in case we will have lots of such tests,
|
||||
we will change directory layout and build system to support that in
|
||||
the same way it is done in hotspot.
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
### Hotspot style
|
||||
|
||||
Abide the norms and rules accepted in Hotspot style guide.
|
||||
|
||||
Tests are a part of Hotspot, so everything (if applicable) we use for
|
||||
Hotspot, should be used for tests as well. Those guidelines cover
|
||||
test-specific things.
|
||||
|
||||
### Code/test metrics
|
||||
|
||||
Coverage information and other code/test metrics are quite useful to
|
||||
decide what tests should be written, what tests should be improved and
|
||||
what can be removed.
|
||||
|
||||
For unit tests, widely used and well-known coverage metric is branch
|
||||
coverage, which provides good quality of tests with relatively easy
|
||||
test development process. For other levels of testing, branch coverage
|
||||
is not as good, and one should consider others metrics, e.g.
|
||||
transaction flow coverage, data flow coverage.
|
||||
|
||||
### Access to non-public members
|
||||
|
||||
Use explicit friend class to get access to non-public members.
|
||||
|
||||
We do not use GoogleTest macro to declare friendship relation,
|
||||
because, from our point of view, it is less clear than an explicit
|
||||
declaration.
|
||||
|
||||
Declaring a test fixture class as a friend class of a tested test is
|
||||
the easiest and the clearest way to get access. However, it has some
|
||||
disadvantages, here is some of them:
|
||||
|
||||
* Each test has to be declared as a friend
|
||||
* Subclasses do not inheritance friendship relation
|
||||
|
||||
In other words, it is harder to share code between tests. Hence if you
|
||||
want to share code or expect it to be useful in other tests, you
|
||||
should consider making members in a tested class protected and
|
||||
introduce a shared test-only class which expose those members via
|
||||
public functions, or even making members publicly accessible right
|
||||
away in a product class. If it is not an option to change members
|
||||
visibility, one can create a friend class which exposes members.
|
||||
|
||||
### Death tests
|
||||
|
||||
You can not use death tests inside `TEST_OTHER_VM` and `TEST_VM_ASSERT*`.
|
||||
|
||||
We tried to make Hotspot-GoogleTest integration as transparent as
|
||||
possible, however, due to the current implementation of `TEST_OTHER_VM`
|
||||
and `TEST_VM_ASSERT*` tests, you cannot use death test functionality in
|
||||
them. These tests are implemented as GoogleTest death tests, and
|
||||
GoogleTest does not allow to have a death test inside another death
|
||||
test.
|
||||
|
||||
### External flags
|
||||
|
||||
Passing external flags to a tested JVM is not supported.
|
||||
|
||||
The rationality of such design decision is to simplify both tests and
|
||||
a test framework and to avoid failures related to incompatible flags
|
||||
combination till there is a good solution for that. However there are
|
||||
cases when one wants to test a JVM with specific flags combination,
|
||||
`_JAVA_OPTIONS` environment variable can be used to do that. Flags from
|
||||
`_JAVA_OPTIONS` will be used in `TEST_VM`, `TEST_OTHER_VM` and
|
||||
`TEST_VM_ASSERT*` tests.
|
||||
|
||||
### Test-specific flags
|
||||
|
||||
Passing flags to a tested JVM in `TEST_OTHER_VM` and `TEST_VM_ASSERT*`
|
||||
should be possible, but is not implemented yet.
|
||||
|
||||
Facility to pass test-specific flags is needed for system, regression
|
||||
or other types of tests which require a fully initialized JVM in some
|
||||
particular configuration, e.g. with Serial GC selected. There is no
|
||||
support for such tests now, however, there is a plan to add that in
|
||||
upcoming releases.
|
||||
|
||||
For now, if a test depends on flags values, it should have `if
|
||||
(!<flag>) { return }` guards in the very beginning and `@requires`
|
||||
comment similar to jtreg `@requires` directive right before test macros.
|
||||
<https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp>
|
||||
ha an example of this temporary workaround. It is important to follow
|
||||
that pattern as it allows us to easily find all such tests and update
|
||||
them as soon as there is an implementation of flag passing facility.
|
||||
|
||||
In long-term, we expect jtreg to support GoogleTest tests as first
|
||||
class citizens, that is to say, jtreg will parse @requires comments
|
||||
and filter out inapplicable tests.
|
||||
|
||||
### Flag restoring
|
||||
|
||||
Restore changed flags.
|
||||
|
||||
It is quite common for tests to configure JVM in a certain way
|
||||
changing flags’ values. GoogleTest provides two ways to set up
|
||||
environment before a test and restore it afterward: using either
|
||||
constructor and destructor or `SetUp` and `TearDown` functions. Both ways
|
||||
require to use a test fixture class, which sometimes is too wordy. The
|
||||
simpler facilities like `FLAG_GUARD` macro or `*FlagSetting` classes could
|
||||
be used in such cases to restore/set values.
|
||||
|
||||
Caveats:
|
||||
|
||||
* Changing a flag’s value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
|
||||
|
||||
* `FLAG_SET_*` macros can change more than one flag (in order to
|
||||
maintain invariants) so it is hard to predict what flags will be
|
||||
changed and it makes restoring all changed flags a nontrivial task.
|
||||
Thus in case one uses `FLAG_SET_*` macros, they should use `TEST_OTHER_VM`
|
||||
test type.
|
||||
|
||||
### GoogleTest documentation
|
||||
|
||||
In case you have any questions regarding GoogleTest itself, its
|
||||
asserts, test declaration macros, other macros, etc, please consult
|
||||
its documentation.
|
||||
|
||||
## TODO
|
||||
|
||||
Although this document provides guidelines on the most important parts
|
||||
of test development using GTest, it still misses a few items:
|
||||
|
||||
* Examples, esp for [access to non-public members](#access-to-non-public-members)
|
||||
|
||||
* test types: purpose, drawbacks, limitation
|
||||
* `TEST_VM`
|
||||
* `TEST_VM_F`
|
||||
* `TEST_OTHER_VM`
|
||||
* `TEST_VM_ASSERT`
|
||||
* `TEST_VM_ASSERT_MSG`
|
||||
|
||||
* Miscellaneous
|
||||
* Test libraries
|
||||
* where to place
|
||||
* how to write
|
||||
* how to use
|
||||
* test your tests
|
||||
* how to run tests in random order
|
||||
* how to run only specific tests
|
||||
* how to run each test separately
|
||||
* check that a test can find bugs it is supposed to by introducing them
|
||||
* mocks/stubs/dependency injection
|
||||
* setUp/tearDown
|
||||
* vs c-tor/d-tor
|
||||
* empty test to test them
|
||||
* internal (declared in .cpp) struct/classes
|
||||
@@ -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");
|
||||
@@ -137,6 +137,8 @@ TEST FAILURE</code></pre>
|
||||
<h4 id="timeout_factor-1">TIMEOUT_FACTOR</h4>
|
||||
<p>The timeout factor (<code>-timeoutFactor</code>).</p>
|
||||
<p>Defaults to 4.</p>
|
||||
<h4 id="failure_handler_timeout">FAILURE_HANDLER_TIMEOUT</h4>
|
||||
<p>Sets the argument <code>-timeoutHandlerTimeout</code> for JTReg. The default value is 0. This is only valid if the failure handler is built.</p>
|
||||
<h4 id="test_mode">TEST_MODE</h4>
|
||||
<p>The test mode (<code>agentvm</code> or <code>othervm</code>).</p>
|
||||
<p>Defaults to <code>agentvm</code>.</p>
|
||||
@@ -153,8 +155,10 @@ TEST FAILURE</code></pre>
|
||||
<p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p>
|
||||
<p>Limit memory consumption for JTReg test framework and VM under test. Set to 0 to disable the limits.</p>
|
||||
<p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p>
|
||||
<h4 id="max_output">MAX_OUTPUT</h4>
|
||||
<p>Set the property <code>javatest.maxOutputSize</code> for the launcher, to change the default JTReg log limit.</p>
|
||||
<h4 id="keywords">KEYWORDS</h4>
|
||||
<p>JTReg kewords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
|
||||
<p>JTReg keywords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
|
||||
<h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
|
||||
<p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
|
||||
<p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
@@ -170,6 +174,8 @@ TEST FAILURE</code></pre>
|
||||
<h4 id="vm_options-1">VM_OPTIONS</h4>
|
||||
<p>Additional Java options to be used when compiling and running classes (sent to JTReg as <code>-vmoption</code>).</p>
|
||||
<p>This option is only needed in special circumstances. To pass Java options to your test classes, use <code>JAVA_OPTIONS</code>.</p>
|
||||
<h4 id="launcher_options">LAUNCHER_OPTIONS</h4>
|
||||
<p>Additional Java options that are sent to the java launcher that starts the JTReg harness.</p>
|
||||
<h4 id="aot_modules-1">AOT_MODULES</h4>
|
||||
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
<h4 id="retry_count">RETRY_COUNT</h4>
|
||||
@@ -205,14 +211,19 @@ TEST FAILURE</code></pre>
|
||||
<p>Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:</p>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"</code></pre>
|
||||
<p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest"</code></pre>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" \
|
||||
JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu
|
||||
-Djdk.test.docker.image.version=latest"</code></pre>
|
||||
<h3 id="non-us-locale">Non-US locale</h3>
|
||||
<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases. For example:</p>
|
||||
<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code>$ export LANG="en_US" && make test TEST=...
|
||||
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...</code></pre>
|
||||
<h3 id="pkcs11-tests">PKCS11 Tests</h3>
|
||||
<p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories. For example:</p>
|
||||
<pre><code>$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"</code></pre>
|
||||
<p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code>$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
|
||||
JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"</code></pre>
|
||||
<p>For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.</p>
|
||||
<h3 id="client-ui-tests">Client UI Tests</h3>
|
||||
<p>Some Client UI tests use key sequences which may be reserved by the operating system. Usually that causes the test failure. So it is highly recommended to disable system key shortcuts prior testing. The steps to access and disable system key shortcuts for various platforms are provided below.</p>
|
||||
|
||||
158
doc/testing.md
158
doc/testing.md
@@ -37,11 +37,11 @@ Note that this option should point to the JTReg home, i.e. the top directory,
|
||||
containing `lib/jtreg.jar` etc. (An alternative is to set the `JT_HOME`
|
||||
environment variable to point to the JTReg home before running `configure`.)
|
||||
|
||||
To be able to run microbenchmarks, `configure` needs to know where to find
|
||||
the JMH dependency. Use `--with-jmh=<path to JMH jars>` to point to a directory
|
||||
containing the core JMH and transitive dependencies. The recommended dependencies
|
||||
can be retrieved by running `sh make/devkit/createJMHBundle.sh`, after which
|
||||
`--with-jmh=build/jmh/jars` should work.
|
||||
To be able to run microbenchmarks, `configure` needs to know where to find the
|
||||
JMH dependency. Use `--with-jmh=<path to JMH jars>` to point to a directory
|
||||
containing the core JMH and transitive dependencies. The recommended
|
||||
dependencies can be retrieved by running `sh make/devkit/createJMHBundle.sh`,
|
||||
after which `--with-jmh=build/jmh/jars` should work.
|
||||
|
||||
## Test selection
|
||||
|
||||
@@ -182,10 +182,10 @@ variables.
|
||||
These variables use a keyword=value approach to allow multiple values to be
|
||||
set. So, for instance, `JTREG="JOBS=1;TIMEOUT_FACTOR=8"` will set the JTReg
|
||||
concurrency level to 1 and the timeout factor to 8. This is equivalent to
|
||||
setting `JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8`, but using the keyword format means that
|
||||
the `JTREG` variable is parsed and verified for correctness, so
|
||||
`JTREG="TMIEOUT_FACTOR=8"` would give an error, while `JTREG_TMIEOUT_FACTOR=8` would just
|
||||
pass unnoticed.
|
||||
setting `JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8`, but using the keyword format
|
||||
means that the `JTREG` variable is parsed and verified for correctness, so
|
||||
`JTREG="TMIEOUT_FACTOR=8"` would give an error, while `JTREG_TMIEOUT_FACTOR=8`
|
||||
would just pass unnoticed.
|
||||
|
||||
To separate multiple keyword=value pairs, use `;` (semicolon). Since the shell
|
||||
normally eats `;`, the recommended usage is to write the assignment inside
|
||||
@@ -203,9 +203,10 @@ test suites.
|
||||
|
||||
### General keywords (TEST_OPTS)
|
||||
|
||||
Some keywords are valid across different test suites. If you want to run
|
||||
tests from multiple test suites, or just don't want to care which test suite specific
|
||||
control variable to use, then you can use the general TEST_OPTS control variable.
|
||||
Some keywords are valid across different test suites. If you want to run tests
|
||||
from multiple test suites, or just don't want to care which test suite specific
|
||||
control variable to use, then you can use the general TEST_OPTS control
|
||||
variable.
|
||||
|
||||
There are also some keywords that applies globally to the test runner system,
|
||||
not to any specific test suites. These are also available as TEST_OPTS keywords.
|
||||
@@ -252,12 +253,13 @@ for only recently changed code. JCOV_DIFF_CHANGESET specifies a source
|
||||
revision. A textual report will be generated showing coverage of the diff
|
||||
between the specified revision and the repository tip.
|
||||
|
||||
The report is stored in `build/$BUILD/test-results/jcov-output/diff_coverage_report`
|
||||
file.
|
||||
The report is stored in
|
||||
`build/$BUILD/test-results/jcov-output/diff_coverage_report` file.
|
||||
|
||||
### JTReg keywords
|
||||
|
||||
#### JOBS
|
||||
|
||||
The test concurrency (`-concurrency`).
|
||||
|
||||
Defaults to TEST_JOBS (if set by `--with-test-jobs=`), otherwise it defaults to
|
||||
@@ -265,32 +267,43 @@ JOBS, except for Hotspot, where the default is *number of CPU cores/2*,
|
||||
but never more than *memory size in GB/2*.
|
||||
|
||||
#### TIMEOUT_FACTOR
|
||||
|
||||
The timeout factor (`-timeoutFactor`).
|
||||
|
||||
Defaults to 4.
|
||||
|
||||
#### FAILURE_HANDLER_TIMEOUT
|
||||
|
||||
Sets the argument `-timeoutHandlerTimeout` for JTReg. The default value is 0.
|
||||
This is only valid if the failure handler is built.
|
||||
|
||||
#### TEST_MODE
|
||||
|
||||
The test mode (`agentvm` or `othervm`).
|
||||
|
||||
Defaults to `agentvm`.
|
||||
|
||||
#### ASSERT
|
||||
|
||||
Enable asserts (`-ea -esa`, or none).
|
||||
|
||||
Set to `true` or `false`. If true, adds `-ea -esa`. Defaults to true, except
|
||||
for hotspot.
|
||||
|
||||
#### VERBOSE
|
||||
|
||||
The verbosity level (`-verbose`).
|
||||
|
||||
Defaults to `fail,error,summary`.
|
||||
|
||||
#### RETAIN
|
||||
|
||||
What test data to retain (`-retain`).
|
||||
|
||||
Defaults to `fail,error`.
|
||||
|
||||
#### MAX_MEM
|
||||
|
||||
Limit memory consumption (`-Xmx` and `-vmoption:-Xmx`, or none).
|
||||
|
||||
Limit memory consumption for JTReg test framework and VM under test. Set to 0
|
||||
@@ -298,9 +311,14 @@ to disable the limits.
|
||||
|
||||
Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).
|
||||
|
||||
#### MAX_OUTPUT
|
||||
|
||||
Set the property `javatest.maxOutputSize` for the launcher, to change the
|
||||
default JTReg log limit.
|
||||
|
||||
#### KEYWORDS
|
||||
|
||||
JTReg kewords sent to JTReg using `-k`. Please be careful in making sure that
|
||||
JTReg keywords sent to JTReg using `-k`. Please be careful in making sure that
|
||||
spaces and special characters (like `!`) are properly quoted. To avoid some
|
||||
issues, the special value `%20` can be used instead of space.
|
||||
|
||||
@@ -323,23 +341,30 @@ Set to `true` or `false`.
|
||||
If `true`, JTReg will use `-match:` option, otherwise `-exclude:` will be used.
|
||||
Default is `false`.
|
||||
|
||||
|
||||
#### OPTIONS
|
||||
|
||||
Additional options to the JTReg test framework.
|
||||
|
||||
Use `JTREG="OPTIONS=--help all"` to see all available JTReg options.
|
||||
|
||||
#### JAVA_OPTIONS
|
||||
|
||||
Additional Java options for running test classes (sent to JTReg as
|
||||
`-javaoption`).
|
||||
|
||||
#### VM_OPTIONS
|
||||
|
||||
Additional Java options to be used when compiling and running classes (sent to
|
||||
JTReg as `-vmoption`).
|
||||
|
||||
This option is only needed in special circumstances. To pass Java options to
|
||||
your test classes, use `JAVA_OPTIONS`.
|
||||
|
||||
#### LAUNCHER_OPTIONS
|
||||
|
||||
Additional Java options that are sent to the java launcher that starts the
|
||||
JTReg harness.
|
||||
|
||||
#### AOT_MODULES
|
||||
|
||||
Generate AOT modules before testing for the specified module, or set of
|
||||
@@ -353,6 +378,7 @@ Retry failed tests up to a set number of times. Defaults to 0.
|
||||
### Gtest keywords
|
||||
|
||||
#### REPEAT
|
||||
|
||||
The number of times to repeat the tests (`--gtest_repeat`).
|
||||
|
||||
Default is 1. Set to -1 to repeat indefinitely. This can be especially useful
|
||||
@@ -360,6 +386,7 @@ combined with `OPTIONS=--gtest_break_on_failure` to reproduce an intermittent
|
||||
problem.
|
||||
|
||||
#### OPTIONS
|
||||
|
||||
Additional options to the Gtest test framework.
|
||||
|
||||
Use `GTEST="OPTIONS=--help"` to see all available Gtest options.
|
||||
@@ -373,98 +400,127 @@ modules. If multiple modules are specified, they should be separated by space
|
||||
### Microbenchmark keywords
|
||||
|
||||
#### FORK
|
||||
|
||||
Override the number of benchmark forks to spawn. Same as specifying `-f <num>`.
|
||||
|
||||
#### ITER
|
||||
|
||||
Number of measurement iterations per fork. Same as specifying `-i <num>`.
|
||||
|
||||
#### TIME
|
||||
|
||||
Amount of time to spend in each measurement iteration, in seconds. Same as
|
||||
specifying `-r <num>`
|
||||
|
||||
#### WARMUP_ITER
|
||||
|
||||
Number of warmup iterations to run before the measurement phase in each fork.
|
||||
Same as specifying `-wi <num>`.
|
||||
|
||||
#### WARMUP_TIME
|
||||
|
||||
Amount of time to spend in each warmup iteration. Same as specifying `-w <num>`.
|
||||
|
||||
#### RESULTS_FORMAT
|
||||
|
||||
Specify to have the test run save a log of the values. Accepts the same values
|
||||
as `-rff`, i.e., `text`, `csv`, `scsv`, `json`, or `latex`.
|
||||
|
||||
#### VM_OPTIONS
|
||||
|
||||
Additional VM arguments to provide to forked off VMs. Same as `-jvmArgs <args>`
|
||||
|
||||
#### OPTIONS
|
||||
|
||||
Additional arguments to send to JMH.
|
||||
|
||||
## Notes for Specific Tests
|
||||
|
||||
### Docker Tests
|
||||
|
||||
Docker tests with default parameters may fail on systems with glibc versions not
|
||||
compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86).
|
||||
For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:
|
||||
Docker tests with default parameters may fail on systems with glibc versions
|
||||
not compatible with the one used in the default docker image (e.g., Oracle
|
||||
Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu
|
||||
18.04 if run like this on x86:
|
||||
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"
|
||||
```
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"
|
||||
```
|
||||
|
||||
To run these tests correctly, additional parameters for the correct docker image are
|
||||
required on Ubuntu 18.04 by using `JAVA_OPTIONS`.
|
||||
To run these tests correctly, additional parameters for the correct docker
|
||||
image are required on Ubuntu 18.04 by using `JAVA_OPTIONS`.
|
||||
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest"
|
||||
```
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" \
|
||||
JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu
|
||||
-Djdk.test.docker.image.version=latest"
|
||||
```
|
||||
|
||||
### Non-US locale
|
||||
|
||||
If your locale is non-US, some tests are likely to fail. To work around this you can
|
||||
set the locale to US. On Unix platforms simply setting `LANG="en_US"` in the
|
||||
environment before running tests should work. On Windows, setting
|
||||
`JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"` helps for most, but not all test cases.
|
||||
If your locale is non-US, some tests are likely to fail. To work around this
|
||||
you can set the locale to US. On Unix platforms simply setting `LANG="en_US"`
|
||||
in the environment before running tests should work. On Windows, setting
|
||||
`JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"` helps for most, but
|
||||
not all test cases.
|
||||
|
||||
For example:
|
||||
|
||||
$ export LANG="en_US" && make test TEST=...
|
||||
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...
|
||||
```
|
||||
$ export LANG="en_US" && make test TEST=...
|
||||
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...
|
||||
```
|
||||
|
||||
### PKCS11 Tests
|
||||
|
||||
It is highly recommended to use the latest NSS version when running PKCS11 tests.
|
||||
Improper NSS version may lead to unexpected failures which are hard to diagnose.
|
||||
For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu
|
||||
18.04 with the default NSS version in the system.
|
||||
To run these tests correctly, the system property `test.nss.lib.paths` is required
|
||||
on Ubuntu 18.04 to specify the alternative NSS lib directories.
|
||||
It is highly recommended to use the latest NSS version when running PKCS11
|
||||
tests. Improper NSS version may lead to unexpected failures which are hard to
|
||||
diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail
|
||||
on Ubuntu 18.04 with the default NSS version in the system. To run these tests
|
||||
correctly, the system property `test.nss.lib.paths` is required on Ubuntu 18.04
|
||||
to specify the alternative NSS lib directories.
|
||||
|
||||
For example:
|
||||
|
||||
$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"
|
||||
```
|
||||
$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
|
||||
JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"
|
||||
```
|
||||
|
||||
For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.
|
||||
For more notes about the PKCS11 tests, please refer to
|
||||
test/jdk/sun/security/pkcs11/README.
|
||||
|
||||
### Client UI Tests
|
||||
|
||||
Some Client UI tests use key sequences which may be reserved by the operating
|
||||
system. Usually that causes the test failure. So it is highly recommended to disable
|
||||
system key shortcuts prior testing. The steps to access and disable system key shortcuts
|
||||
for various platforms are provided below.
|
||||
system. Usually that causes the test failure. So it is highly recommended to
|
||||
disable system key shortcuts prior testing. The steps to access and disable
|
||||
system key shortcuts for various platforms are provided below.
|
||||
|
||||
#### MacOS
|
||||
|
||||
Choose Apple menu; System Preferences, click Keyboard, then click Shortcuts;
|
||||
select or deselect desired shortcut.
|
||||
|
||||
For example, test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java fails
|
||||
on MacOS because it uses `CTRL + F1` key sequence to show or hide tooltip message
|
||||
but the key combination is reserved by the operating system. To run the test correctly
|
||||
the default global key shortcut should be disabled using the steps described above, and then deselect
|
||||
"Turn keyboard access on or off" option which is responsible for `CTRL + F1` combination.
|
||||
For example,
|
||||
test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java
|
||||
fails on MacOS because it uses `CTRL + F1` key sequence to show or hide tooltip
|
||||
message but the key combination is reserved by the operating system. To run the
|
||||
test correctly the default global key shortcut should be disabled using the
|
||||
steps described above, and then deselect "Turn keyboard access on or off"
|
||||
option which is responsible for `CTRL + F1` combination.
|
||||
|
||||
#### Linux
|
||||
Open the Activities overview and start typing Settings; Choose Settings, click Devices,
|
||||
then click Keyboard; set or override desired shortcut.
|
||||
|
||||
Open the Activities overview and start typing Settings; Choose Settings, click
|
||||
Devices, then click Keyboard; set or override desired shortcut.
|
||||
|
||||
#### Windows
|
||||
Type `gpedit` in the Search and then click Edit group policy; navigate to
|
||||
User Configuration -> Administrative Templates -> Windows Components -> File Explorer;
|
||||
in the right-side pane look for "Turn off Windows key hotkeys" and double click on it;
|
||||
enable or disable hotkeys.
|
||||
|
||||
Type `gpedit` in the Search and then click Edit group policy; navigate to User
|
||||
Configuration -> Administrative Templates -> Windows Components -> File
|
||||
Explorer; in the right-side pane look for "Turn off Windows key hotkeys" and
|
||||
double click on it; enable or disable hotkeys.
|
||||
|
||||
Note: restart is required to make the settings take effect.
|
||||
|
||||
|
||||
@@ -242,16 +242,6 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
|
||||
)
|
||||
|
||||
JDK_SYMBOLS_BUNDLE_FILES := \
|
||||
$(filter \
|
||||
$(JDK_SYMBOLS_EXCLUDE_PATTERN) \
|
||||
$(SYMBOLS_EXCLUDE_PATTERN) \
|
||||
, \
|
||||
$(filter-out \
|
||||
$(JDK_IMAGE_HOMEDIR)/demo/% %.stripped.pdb \
|
||||
, \
|
||||
$(ALL_JDK_SYMBOLS_FILES) \
|
||||
) \
|
||||
) \
|
||||
$(call FindFiles, $(SYMBOLS_IMAGE_DIR))
|
||||
|
||||
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
|
||||
@@ -383,7 +373,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
|
||||
$(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
|
||||
BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
|
||||
FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
|
||||
BASE_DIRS := $(JDK_SYMBOLS_IMAGE_DIR) $(wildcard $(SYMBOLS_IMAGE_DIR)), \
|
||||
BASE_DIRS := $(SYMBOLS_IMAGE_DIR), \
|
||||
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
||||
UNZIP_DEBUGINFO := true, \
|
||||
))
|
||||
|
||||
@@ -52,7 +52,6 @@ TARGETS =
|
||||
# READMEs and other files.
|
||||
|
||||
DEMO_SHARE_SRC := $(TOPDIR)/src/demo/share
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
|
||||
DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ define SetupInterimModule
|
||||
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
|
||||
Standard.java, \
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
|
||||
COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
|
||||
COPY := .gif .png .xml .css .js .txt javax.tools.JavaCompilerTool, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
|
||||
DISABLED_WARNINGS := module options, \
|
||||
JAVAC_FLAGS := \
|
||||
|
||||
@@ -76,6 +76,7 @@ java.datatransfer_COPY += flavormap.properties
|
||||
|
||||
################################################################################
|
||||
|
||||
java.desktop_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
java.desktop_DOCLINT += -Xdoclint:all/protected,-reference \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
|
||||
@@ -298,6 +299,10 @@ java.xml.crypto_CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.accessibility_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.charsets_COPY += .dat
|
||||
|
||||
################################################################################
|
||||
@@ -343,14 +348,23 @@ jdk.dynalink_CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.javadoc_COPY += .xml .css .js .png
|
||||
jdk.javadoc_COPY += .xml .css .js .png .txt
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.jartool_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
jdk.jartool_JAVAC_FLAGS += -XDstringConcat=inline
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.httpserver_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.unsupported.desktop_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
|
||||
################################################################################
|
||||
|
||||
# No SCTP implementation on Mac OS X or AIX. These classes should be excluded.
|
||||
SCTP_IMPL_CLASSES = \
|
||||
$(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java \
|
||||
@@ -477,6 +491,7 @@ jdk.internal.vm.compiler_EXCLUDES += \
|
||||
org.graalvm.compiler.options.test \
|
||||
org.graalvm.compiler.phases.common.test \
|
||||
org.graalvm.compiler.processor \
|
||||
org.graalvm.compiler.replacements.jdk10.test \
|
||||
org.graalvm.compiler.replacements.jdk12.test \
|
||||
org.graalvm.compiler.replacements.jdk9.test \
|
||||
org.graalvm.compiler.replacements.processor \
|
||||
|
||||
@@ -36,6 +36,24 @@ TARGETS :=
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, hotspot/CompileTools.gmk))
|
||||
|
||||
################################################################################
|
||||
# Build tools needed for the JFR source code generation
|
||||
|
||||
HOTSPOT_TOOLS_SRCDIR := $(TOPDIR)/make/src/classes
|
||||
|
||||
HOTSPOT_TOOLS_OUTPUTDIR := $(BUILDTOOLS_OUTPUTDIR)/buildtools/hotspot_tools_classes
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_TOOLS_HOTSPOT, \
|
||||
COMPILER := bootjdk, \
|
||||
SRC := $(HOTSPOT_TOOLS_SRCDIR), \
|
||||
BIN := $(HOTSPOT_TOOLS_OUTPUTDIR), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_TOOLS_HOTSPOT)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Graal build tools
|
||||
ifeq ($(INCLUDE_GRAAL), true)
|
||||
VM_CI_SRC_DIR := $(TOPDIR)/src/jdk.internal.vm.ci/share/classes
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -63,7 +63,7 @@ MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) )
|
||||
JAVADOC_BASE_URL := https://docs.oracle.com/pls/topic/lookup?ctx=javase$(VERSION_NUMBER)&id=homepage
|
||||
BUG_SUBMIT_URL := https://bugreport.java.com/bugreport/
|
||||
COPYRIGHT_URL := legal/copyright.html
|
||||
LICENSE_URL := https://www.oracle.com/technetwork/java/javase/terms/license/java$(VERSION_NUMBER)speclicense.html
|
||||
LICENSE_URL := https://www.oracle.com/java/javase/terms/license/java$(VERSION_NUMBER)speclicense.html
|
||||
REDISTRIBUTION_URL := https://www.oracle.com/technetwork/java/redist-137594.html
|
||||
|
||||
# In order to get a specific ordering it's necessary to specify the total
|
||||
@@ -298,6 +298,8 @@ define SetupApiDocsGenerationBody
|
||||
# Create a string like "-Xdoclint:all,-syntax,-html,..."
|
||||
$1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
|
||||
$$(JAVADOC_DISABLED_DOCLINT)))
|
||||
# Ignore the doclint warnings in the W3C DOM package
|
||||
$1_OPTIONS += -Xdoclint/package:-org.w3c.*
|
||||
|
||||
$1_DOC_TITLE := $$($1_LONG_NAME)<br>Version $$(VERSION_SPECIFICATION) API \
|
||||
Specification
|
||||
@@ -610,9 +612,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 +634,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
|
||||
|
||||
@@ -101,9 +101,9 @@ help:
|
||||
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
|
||||
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
|
||||
$(info $(_) # make test TEST="jdk_lang gtest:all")
|
||||
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness)
|
||||
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness)
|
||||
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness)
|
||||
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'help' to list)
|
||||
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'help' to list)
|
||||
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'help' to list)
|
||||
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
|
||||
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
|
||||
$(info )
|
||||
|
||||
@@ -238,6 +238,7 @@ endif
|
||||
ALL_JDK_MODULES := $(JDK_MODULES)
|
||||
ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \
|
||||
$(call FindTransitiveDepsForModule, $m)))
|
||||
ALL_SYMBOLS_MODULES := $(JDK_MODULES)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBS_TARGET_SUBDIR := bin
|
||||
@@ -293,6 +294,7 @@ SetupCopyDebuginfo = \
|
||||
# implementation above.
|
||||
$(call SetupCopyDebuginfo,JDK)
|
||||
$(call SetupCopyDebuginfo,JRE)
|
||||
$(call SetupCopyDebuginfo,SYMBOLS)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ ifeq ($(HAS_SPEC),)
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" main && \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" main && \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" post-compare-build && \
|
||||
|
||||
@@ -350,6 +350,9 @@ else # $(HAS_SPEC)=true
|
||||
$$(if $$(filter FAIL=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_FAIL=$$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter NODRYRUN=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_NODRYRUN=$$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
|
||||
) \
|
||||
)
|
||||
else
|
||||
# Separate handling for single field case, to allow for spaces in values.
|
||||
@@ -372,6 +375,12 @@ else # $(HAS_SPEC)=true
|
||||
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
|
||||
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
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_FAIL), true)
|
||||
COMPARE_BUILD_IGNORE_RESULT := || true
|
||||
|
||||
@@ -38,11 +38,8 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
|
||||
MACOSX_PLIST_SRC := $(TOPDIR)/make/data/bundle
|
||||
|
||||
BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT)
|
||||
BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT)
|
||||
BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_STRING)
|
||||
BUNDLE_PLATFORM_VERSION := $(VERSION_FEATURE).$(VERSION_INTERIM)
|
||||
BUNDLE_VERSION := $(VERSION_NUMBER)
|
||||
ifeq ($(COMPANY_NAME), N/A)
|
||||
BUNDLE_VENDOR := UNDEFINED
|
||||
else
|
||||
@@ -75,24 +72,26 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
|
||||
OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(BUNDLE_ID).jdk ; \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jdk ; \
|
||||
@@NAME@@ => $(BUNDLE_NAME) ; \
|
||||
@@INFO@@ => $(BUNDLE_INFO) ; \
|
||||
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
|
||||
@@VERSION@@ => $(BUNDLE_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
|
||||
@@VERSION@@ => $(VERSION_NUMBER) ; \
|
||||
@@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) ; \
|
||||
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
|
||||
OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(BUNDLE_ID).jre ; \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jre ; \
|
||||
@@NAME@@ => $(BUNDLE_NAME) ; \
|
||||
@@INFO@@ => $(BUNDLE_INFO) ; \
|
||||
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
|
||||
@@VERSION@@ => $(BUNDLE_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
|
||||
@@VERSION@@ => $(VERSION_NUMBER) ; \
|
||||
@@BUILD_VERSION@@ => $(BUNDLE_BUILD_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) ; \
|
||||
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
|
||||
))
|
||||
|
||||
$(SUPPORT_OUTPUTDIR)/images/_jdk_bundle_attribute_set: $(COPY_JDK_IMAGE)
|
||||
|
||||
@@ -112,7 +112,6 @@ $(eval $(call SetupTarget, generate-exported-symbols, \
|
||||
$(eval $(call DeclareRecipesForPhase, GENSRC, \
|
||||
TARGET_SUFFIX := gensrc-src, \
|
||||
FILE_PREFIX := Gensrc, \
|
||||
MAKE_SUBDIR := gensrc, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
))
|
||||
|
||||
@@ -150,7 +149,6 @@ ALL_TARGETS += $(GENSRC_TARGETS)
|
||||
$(eval $(call DeclareRecipesForPhase, GENDATA, \
|
||||
TARGET_SUFFIX := gendata, \
|
||||
FILE_PREFIX := Gendata, \
|
||||
MAKE_SUBDIR := gendata, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
))
|
||||
|
||||
@@ -161,7 +159,6 @@ ALL_TARGETS += $(GENDATA_TARGETS)
|
||||
$(eval $(call DeclareRecipesForPhase, COPY, \
|
||||
TARGET_SUFFIX := copy, \
|
||||
FILE_PREFIX := Copy, \
|
||||
MAKE_SUBDIR := copy, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
))
|
||||
|
||||
@@ -203,7 +200,6 @@ ALL_TARGETS += $(JAVA_TARGETS)
|
||||
$(eval $(call DeclareRecipesForPhase, LIBS, \
|
||||
TARGET_SUFFIX := libs, \
|
||||
FILE_PREFIX := Lib, \
|
||||
MAKE_SUBDIR := lib, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
))
|
||||
|
||||
@@ -216,8 +212,7 @@ ALL_TARGETS += $(LIBS_TARGETS)
|
||||
$(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, \
|
||||
))
|
||||
|
||||
@@ -228,7 +223,6 @@ ALL_TARGETS += $(STATIC_LIBS_TARGETS)
|
||||
$(eval $(call DeclareRecipesForPhase, LAUNCHER, \
|
||||
TARGET_SUFFIX := launchers, \
|
||||
FILE_PREFIX := Launcher, \
|
||||
MAKE_SUBDIR := launcher, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
))
|
||||
|
||||
@@ -640,6 +634,32 @@ $(eval $(call SetupTarget, test-image-jdk-jtreg-native, \
|
||||
DEPS := build-test-jdk-jtreg-native, \
|
||||
))
|
||||
|
||||
# Native files needed by the testlib
|
||||
$(eval $(call SetupTarget, build-test-lib-native, \
|
||||
MAKEFILE := test/BuildTestLibNative, \
|
||||
TARGET := build-test-lib-native, \
|
||||
DEPS := buildtools-jdk java.base-libs, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, test-image-lib-native, \
|
||||
MAKEFILE := test/BuildTestLibNative, \
|
||||
TARGET := test-image-lib-native, \
|
||||
DEPS := build-test-lib-native, \
|
||||
))
|
||||
|
||||
# Native files needed when testing the testlib itself
|
||||
$(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 +672,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, \
|
||||
@@ -792,16 +812,20 @@ else
|
||||
|
||||
# Declare dependencies between hotspot-<variant>* targets
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval hotspot-$v-gensrc: java.base-copy) \
|
||||
$(eval hotspot-$v-gensrc: java.base-copy buildtools-hotspot) \
|
||||
$(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \
|
||||
)
|
||||
|
||||
# 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 +1002,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 +1126,9 @@ 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 \
|
||||
test-image-lib-native
|
||||
|
||||
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
|
||||
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the
|
||||
|
||||
@@ -185,7 +185,6 @@ endef
|
||||
# Param 1: Name of list to add targets to
|
||||
# Named params:
|
||||
# TARGET_SUFFIX : Suffix of target to create for recipe
|
||||
# MAKE_SUBDIR : Subdir for this build phase
|
||||
# FILE_PREFIX : File prefix for this build phase
|
||||
# CHECK_MODULES : List of modules to try
|
||||
# MULTIPLE_MAKEFILES : Set to true to handle makefiles for the same module and
|
||||
|
||||
@@ -39,7 +39,7 @@ include MakeBase.gmk
|
||||
TARGETS :=
|
||||
|
||||
# Include the file being wrapped.
|
||||
include modules/$(MODULE)/$(MAKEFILE_PREFIX).gmk
|
||||
include $(MAKEFILE_PREFIX).gmk
|
||||
|
||||
# Setup copy rules from the modules directories to the jdk image directory.
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
@@ -143,9 +143,6 @@ endif
|
||||
# Optionally create AOT libraries for specified modules before running tests.
|
||||
# Note, this could not be done during JDK build time.
|
||||
################################################################################
|
||||
|
||||
# Note, this could not be done during JDK build time.
|
||||
|
||||
# Parameter 1 is the name of the rule.
|
||||
#
|
||||
# Remaining parameters are named arguments.
|
||||
@@ -175,6 +172,10 @@ define SetupAotModuleBody
|
||||
$1_JAOTC_OPTS += --compile-with-assertions
|
||||
endif
|
||||
|
||||
ifneq ($$(filter -XX:+VerifyOops, $$($1_VM_OPTIONS)), )
|
||||
$1_JAOTC_OPTS += -J-Dgraal.AOTVerifyOops=true
|
||||
endif
|
||||
|
||||
$$($1_AOT_LIB): $$(JDK_UNDER_TEST)/release \
|
||||
$$(call DependOnVariable, $1_JAOTC_OPTS) \
|
||||
$$(call DependOnVariable, JDK_UNDER_TEST)
|
||||
@@ -198,6 +199,10 @@ define SetupAotModuleBody
|
||||
$1_AOT_TARGETS += $$($1_AOT_LIB)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Optionally create AOT libraries before running tests.
|
||||
# Note, this could not be done during JDK build time.
|
||||
################################################################################
|
||||
# Parameter 1 is the name of the rule.
|
||||
#
|
||||
# Remaining parameters are named arguments.
|
||||
@@ -291,9 +296,9 @@ $(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
|
||||
$(eval $(call ParseKeywordVariable, JTREG, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
|
||||
TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \
|
||||
RETRY_COUNT, \
|
||||
RETRY_COUNT MAX_OUTPUT, \
|
||||
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
|
||||
EXTRA_PROBLEM_LISTS AOT_MODULES, \
|
||||
EXTRA_PROBLEM_LISTS AOT_MODULES LAUNCHER_OPTIONS, \
|
||||
))
|
||||
|
||||
ifneq ($(JTREG), )
|
||||
@@ -342,11 +347,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
|
||||
|
||||
@@ -602,6 +609,7 @@ define SetupRunGtestTestBody
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, ( \
|
||||
$$(CD) $$($1_TEST_SUPPORT_DIR) && \
|
||||
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
|
||||
-jdk $(JDK_UNDER_TEST) $$($1_GTEST_FILTER) \
|
||||
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
|
||||
@@ -687,13 +695,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
|
||||
@@ -840,15 +850,27 @@ define SetupRunJtregTestBody
|
||||
JTREG_RUN_PROBLEM_LISTS ?= false
|
||||
JTREG_RETRY_COUNT ?= 0
|
||||
|
||||
ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
|
||||
$1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
|
||||
endif
|
||||
|
||||
ifneq ($$(JTREG_MAX_OUTPUT), )
|
||||
$1_JTREG_LAUNCHER_OPTIONS += -Djavatest.maxOutputSize=$$(JTREG_MAX_OUTPUT)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_JTREG_MAX_MEM), 0)
|
||||
$1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
|
||||
$1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
|
||||
endif
|
||||
|
||||
# Make sure the tmp dir is normalized as some tests will react badly otherwise
|
||||
$1_TEST_TMP_DIR := $$(abspath $$($1_TEST_SUPPORT_DIR)/tmp)
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
|
||||
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
|
||||
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
|
||||
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
|
||||
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \
|
||||
-vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)"
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
|
||||
|
||||
@@ -964,7 +986,8 @@ define SetupRunJtregTestBody
|
||||
run-test-$1: pre-run-test clean-workdir-$1 $$($1_AOT_TARGETS)
|
||||
$$(call LogWarn)
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
|
||||
$$($1_TEST_TMP_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, ( \
|
||||
$$(COV_ENVIRONMENT) $$($1_COMMAND_LINE) \
|
||||
))
|
||||
|
||||
@@ -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, \
|
||||
|
||||
47
make/ToolsHotspot.gmk
Normal file
47
make/ToolsHotspot.gmk
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Copyright (c) 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
|
||||
# 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.
|
||||
#
|
||||
|
||||
ifndef _TOOLS_HOTSPOT_GMK
|
||||
_TOOLS_HOTSPOT_GMK := 1
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
HOTSPOT_TOOLS_OUTPUTDIR := $(BUILDTOOLS_OUTPUTDIR)/buildtools/hotspot_tools_classes
|
||||
|
||||
################################################################################
|
||||
# To avoid reevaluating the compilation setup for the tools each time this file
|
||||
# is included, the actual compilation is handled by CompileToolsHotspot.gmk. The
|
||||
# following trick is used to be able to declare a dependency on the built tools.
|
||||
BUILD_TOOLS_HOTSPOT := $(call SetupJavaCompilationCompileTarget, \
|
||||
BUILD_TOOLS_HOTSPOT, $(HOTSPOT_TOOLS_OUTPUTDIR))
|
||||
|
||||
################################################################################
|
||||
|
||||
TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(HOTSPOT_TOOLS_OUTPUTDIR) \
|
||||
build.tools.jfr.GenerateJfrFiles
|
||||
|
||||
##########################################################################################
|
||||
|
||||
endif # _TOOLS_HOTSPOT_GMK
|
||||
@@ -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
|
||||
|
||||
@@ -116,6 +117,16 @@ AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Evaluates platform specific overrides for build devkit variables.
|
||||
# $1: Name of variable
|
||||
AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
|
||||
[
|
||||
if test "x[$]$1" = x; then
|
||||
eval $1="\${$1_${OPENJDK_BUILD_CPU}}"
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
|
||||
[
|
||||
|
||||
@@ -72,7 +72,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
UTIL_REQUIRE_PROGS(UNAME, uname)
|
||||
UTIL_REQUIRE_PROGS(UNIQ, uniq)
|
||||
UTIL_REQUIRE_PROGS(WC, wc)
|
||||
UTIL_REQUIRE_PROGS(WHICH, which)
|
||||
UTIL_REQUIRE_PROGS(XARGS, xargs)
|
||||
|
||||
# Then required tools that require some special treatment.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -150,10 +150,10 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
|
||||
fi
|
||||
FIXPATH_SRC_W="$FIXPATH_SRC"
|
||||
FIXPATH_BIN_W="$FIXPATH_BIN"
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_SRC_W])
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_BIN_W])
|
||||
$RM -rf $FIXPATH_BIN $FIXPATH_DIR
|
||||
$MKDIR -p $FIXPATH_DIR $CONFIGURESUPPORT_OUTPUTDIR/bin
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_SRC_W])
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_BIN_W])
|
||||
cd $FIXPATH_DIR
|
||||
$CC $FIXPATH_SRC_W -Fe$FIXPATH_BIN_W > $FIXPATH_DIR/fixpath1.log 2>&1
|
||||
cd $CONFIGURE_START_DIR
|
||||
|
||||
@@ -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],
|
||||
|
||||
12
make/autoconf/configure
vendored
12
make/autoconf/configure
vendored
@@ -78,11 +78,11 @@ generated_script="$build_support_dir/generated-configure.sh"
|
||||
###
|
||||
|
||||
autoconf_missing_help() {
|
||||
APT_GET="`which apt-get 2> /dev/null | grep -v '^no apt-get in'`"
|
||||
YUM="`which yum 2> /dev/null | grep -v '^no yum in'`"
|
||||
BREW="`which brew 2> /dev/null | grep -v '^no brew in'`"
|
||||
ZYPPER="`which zypper 2> /dev/null | grep -v '^no zypper in'`"
|
||||
CYGWIN="`which cygpath 2> /dev/null | grep -v '^no cygpath in'`"
|
||||
APT_GET="`type -p apt-get 2> /dev/null`"
|
||||
YUM="`type -p yum 2> /dev/null`"
|
||||
BREW="`type -p brew 2> /dev/null`"
|
||||
ZYPPER="`type -p zypper 2> /dev/null`"
|
||||
CYGWIN="`type -p cygpath 2> /dev/null`"
|
||||
|
||||
if test "x$ZYPPER" != x; then
|
||||
PKGHANDLER_COMMAND="sudo zypper install autoconf"
|
||||
@@ -111,7 +111,7 @@ generate_configure_script() {
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
AUTOCONF="`which autoconf 2> /dev/null | grep -v '^no autoconf in'`"
|
||||
AUTOCONF="`type -p autoconf 2> /dev/null`"
|
||||
if test "x$AUTOCONF" = x; then
|
||||
echo
|
||||
echo "Autoconf is not found on the PATH, and AUTOCONF is not set."
|
||||
|
||||
@@ -242,7 +242,6 @@ HOTSPOT_SETUP_MISC
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
JDKOPT_DETECT_INTREE_EC
|
||||
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
|
||||
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
|
||||
JDKOPT_EXCLUDE_TRANSLATIONS
|
||||
|
||||
@@ -134,6 +134,10 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
|
||||
WARNINGS_ENABLE_ALL="-W3"
|
||||
DISABLED_WARNINGS="4800"
|
||||
if test "x$TOOLCHAIN_VERSION" = x2017; then
|
||||
# VS2017 incorrectly triggers this warning for constexpr
|
||||
DISABLED_WARNINGS+=" 4307"
|
||||
fi
|
||||
;;
|
||||
|
||||
gcc)
|
||||
@@ -239,21 +243,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"
|
||||
@@ -522,6 +516,18 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
fi
|
||||
TOOLCHAIN_CFLAGS_JDK_CONLY="$LANGSTD_CFLAGS $TOOLCHAIN_CFLAGS_JDK_CONLY"
|
||||
|
||||
# CXXFLAGS C++ language level for all of JDK, including Hotspot.
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
LANGSTD_CXXFLAGS="-std=c++14"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
LANGSTD_CXXFLAGS="-std:c++14"
|
||||
else
|
||||
AC_MSG_ERROR([Don't know how to enable C++14 for this toolchain])
|
||||
fi
|
||||
TOOLCHAIN_CFLAGS_JDK_CXXONLY="$TOOLCHAIN_CFLAGS_JDK_CXXONLY $LANGSTD_CXXFLAGS"
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $LANGSTD_CXXFLAGS"
|
||||
ADLC_LANGSTD_CXXFLAGS="$LANGSTD_CXXFLAGS"
|
||||
|
||||
# CFLAGS WARNINGS STUFF
|
||||
# Set JVM_CFLAGS warning handling
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
@@ -660,7 +666,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
|
||||
# toolchain dependend, per-cpu
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if test "x$FLAGS_CPU" = xx86_64; then
|
||||
if test "x$FLAGS_CPU" = xaarch64; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_ARM64_ -Darm64"
|
||||
elif test "x$FLAGS_CPU" = xx86_64; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_AMD64_ -Damd64"
|
||||
else
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_X86_ -Dx86"
|
||||
@@ -704,13 +712,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
|
||||
fi
|
||||
|
||||
$1_CXXSTD_CXXFLAG="-std=gnu++98"
|
||||
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${$1_CXXSTD_CXXFLAG}],
|
||||
PREFIX: $3, IF_FALSE: [$1_CXXSTD_CXXFLAG=""])
|
||||
$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY="${$1_CXXSTD_CXXFLAG}"
|
||||
$1_TOOLCHAIN_CFLAGS_JVM="${$1_TOOLCHAIN_CFLAGS_JVM} ${$1_CXXSTD_CXXFLAG}"
|
||||
$2ADLC_CXXFLAG="${$1_CXXSTD_CXXFLAG}"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$FLAGS_OS" = xlinux; then
|
||||
# ppc test not really needed for clang
|
||||
@@ -805,7 +806,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
AC_SUBST($2CFLAGS_JDKEXE)
|
||||
AC_SUBST($2CXXFLAGS_JDKLIB)
|
||||
AC_SUBST($2CXXFLAGS_JDKEXE)
|
||||
AC_SUBST($2ADLC_CXXFLAG)
|
||||
AC_SUBST($2ADLC_LANGSTD_CXXFLAGS)
|
||||
|
||||
COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off"
|
||||
# Check that the compiler supports -ffp-contract=off flag
|
||||
|
||||
@@ -53,6 +53,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
|
||||
|
||||
LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}"
|
||||
AC_SUBST(LDFLAGS_TESTEXE)
|
||||
AC_SUBST(ADLC_LDFLAGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -62,17 +63,10 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
[
|
||||
# Setup basic LDFLAGS
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both, why?
|
||||
# We have previously set HAS_GNU_HASH if this is the case
|
||||
if test -n "$HAS_GNU_HASH"; then
|
||||
BASIC_LDFLAGS="-Wl,--hash-style=both"
|
||||
LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both"
|
||||
fi
|
||||
|
||||
# Add -z,defs, to forbid undefined symbols in object files.
|
||||
# add -z,relro (mark relocations read only) for all libs
|
||||
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
|
||||
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
|
||||
BASIC_LDFLAGS="-Wl,--hash-style=gnu -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
|
||||
# Linux : remove unused code+data in link step
|
||||
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
|
||||
@@ -152,8 +146,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
# Export some intermediate variables for compatibility
|
||||
LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY"
|
||||
AC_SUBST(LDFLAGS_CXX_JDK)
|
||||
AC_SUBST(LIBJSIG_HASHSTYLE_LDFLAGS)
|
||||
AC_SUBST(LIBJSIG_NOEXECSTACK_LDFLAGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -173,14 +165,13 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if test "x${OPENJDK_$1_CPU_BITS}" = "x32"; then
|
||||
$1_CPU_EXECUTABLE_LDFLAGS="-stack:327680"
|
||||
elif test "x${OPENJDK_$1_CPU_BITS}" = "x64"; then
|
||||
$1_CPU_EXECUTABLE_LDFLAGS="-stack:1048576"
|
||||
fi
|
||||
if test "x${OPENJDK_$1_CPU}" = "xx86"; then
|
||||
$1_CPU_LDFLAGS="-safeseh"
|
||||
# NOTE: Old build added -machine. Probably not needed.
|
||||
$1_CPU_LDFLAGS_JVM_ONLY="-machine:I386"
|
||||
$1_CPU_EXECUTABLE_LDFLAGS="-stack:327680"
|
||||
else
|
||||
$1_CPU_LDFLAGS_JVM_ONLY="-machine:AMD64"
|
||||
$1_CPU_EXECUTABLE_LDFLAGS="-stack:1048576"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -64,39 +64,12 @@ AC_DEFUN([FLAGS_SETUP_RCFLAGS],
|
||||
[
|
||||
# On Windows, we need to set RC flags.
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
RC_FLAGS="-nologo -l0x409"
|
||||
JVM_RCFLAGS="-nologo"
|
||||
RCFLAGS="-nologo"
|
||||
if test "x$DEBUG_LEVEL" = xrelease; then
|
||||
RC_FLAGS="$RC_FLAGS -DNDEBUG"
|
||||
JVM_RCFLAGS="$JVM_RCFLAGS -DNDEBUG"
|
||||
RCFLAGS="$RCFLAGS -DNDEBUG"
|
||||
fi
|
||||
|
||||
# The version variables used to create RC_FLAGS may be overridden
|
||||
# in a custom configure script, or possibly the command line.
|
||||
# Let those variables be expanded at make time in spec.gmk.
|
||||
# The \$ are escaped to the shell, and the $(...) variables
|
||||
# are evaluated by make.
|
||||
RC_FLAGS="$RC_FLAGS \
|
||||
-D\"JDK_VERSION_STRING=\$(VERSION_STRING)\" \
|
||||
-D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
|
||||
-D\"JDK_FILEDESC=\$(JDK_RC_NAME) binary\" \
|
||||
-D\"JDK_VER=\$(VERSION_NUMBER)\" \
|
||||
-D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
|
||||
-D\"JDK_NAME=\$(JDK_RC_NAME) \$(VERSION_FEATURE)\" \
|
||||
-D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
|
||||
|
||||
JVM_RCFLAGS="$JVM_RCFLAGS \
|
||||
-D\"HS_VERSION_STRING=\$(VERSION_STRING)\" \
|
||||
-D\"HS_COMPANY=\$(COMPANY_NAME)\" \
|
||||
-D\"HS_VER=\$(VERSION_NUMBER_FOUR_POSITIONS)\" \
|
||||
-D\"HS_INTERNAL_NAME=jvm\" \
|
||||
-D\"HS_COPYRIGHT=Copyright $COPYRIGHT_YEAR\" \
|
||||
-D\"HS_FNAME=jvm.dll\" \
|
||||
-D\"HS_NAME=\$(PRODUCT_NAME) \$(VERSION_SHORT)\" \
|
||||
-D\"HS_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
|
||||
fi
|
||||
AC_SUBST(RC_FLAGS)
|
||||
AC_SUBST(JVM_RCFLAGS)
|
||||
AC_SUBST(RCFLAGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -101,6 +101,8 @@ apt_help() {
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libharfbuzz-dev" ;;
|
||||
ffi)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
|
||||
x11)
|
||||
@@ -124,6 +126,8 @@ zypper_help() {
|
||||
PKGHANDLER_COMMAND="sudo zypper install fontconfig-devel" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo zypper install freetype-devel" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo zypper install harfbuzz-devel" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo zypper install libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel" ;;
|
||||
ccache)
|
||||
@@ -143,6 +147,8 @@ yum_help() {
|
||||
PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo yum install harfbuzz-devel" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel" ;;
|
||||
ccache)
|
||||
|
||||
@@ -228,23 +228,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Enable or disable the elliptic curve crypto implementation
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
|
||||
[
|
||||
AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
|
||||
|
||||
if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
|
||||
ENABLE_INTREE_EC=true
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
ENABLE_INTREE_EC=false
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_SUBST(ENABLE_INTREE_EC)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
[
|
||||
|
||||
@@ -67,34 +67,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
AC_SUBST(JDK_RC_PLATFORM_NAME)
|
||||
AC_SUBST(HOTSPOT_VM_DISTRO)
|
||||
|
||||
# Set the MACOSX Bundle Name base
|
||||
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
|
||||
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_name_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
|
||||
elif test "x$with_macosx_bundle_name_base" != x; then
|
||||
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
|
||||
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
|
||||
|
||||
# Set the MACOSX Bundle ID base
|
||||
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
|
||||
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_id_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
|
||||
elif test "x$with_macosx_bundle_id_base" != x; then
|
||||
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
|
||||
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
|
||||
|
||||
# Set the JDK RC name
|
||||
AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name],
|
||||
[Set JDK RC name. This is used for FileDescription and ProductName properties
|
||||
@@ -179,7 +151,7 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
AC_MSG_ERROR([--with-version-string must have a value])
|
||||
elif test "x$with_version_string" != x; then
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
|
||||
if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z0-9]+))?(((\+)([0-9]*))?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
|
||||
VERSION_FEATURE=${BASH_REMATCH[[1]]}
|
||||
VERSION_INTERIM=${BASH_REMATCH[[3]]}
|
||||
VERSION_UPDATE=${BASH_REMATCH[[5]]}
|
||||
@@ -188,9 +160,9 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
VERSION_EXTRA2=${BASH_REMATCH[[11]]}
|
||||
VERSION_EXTRA3=${BASH_REMATCH[[13]]}
|
||||
VERSION_PRE=${BASH_REMATCH[[15]]}
|
||||
version_plus_separator=${BASH_REMATCH[[17]]}
|
||||
VERSION_BUILD=${BASH_REMATCH[[18]]}
|
||||
VERSION_OPT=${BASH_REMATCH[[20]]}
|
||||
version_plus_separator=${BASH_REMATCH[[18]]}
|
||||
VERSION_BUILD=${BASH_REMATCH[[19]]}
|
||||
VERSION_OPT=${BASH_REMATCH[[21]]}
|
||||
# Unspecified numerical fields are interpreted as 0.
|
||||
if test "x$VERSION_INTERIM" = x; then
|
||||
VERSION_INTERIM=0
|
||||
@@ -233,8 +205,8 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
# Interpret --without-* as empty string instead of the literal "no"
|
||||
VERSION_PRE=
|
||||
else
|
||||
# Only [a-zA-Z] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
|
||||
[ VERSION_PRE=`$ECHO "$with_version_pre" | $TR -c -d '[a-z][A-Z]'` ]
|
||||
# Only [a-zA-Z0-9] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
|
||||
[ VERSION_PRE=`$ECHO "$with_version_pre" | $TR -c -d '[a-zA-Z0-9]'` ]
|
||||
if test "x$VERSION_PRE" != "x$with_version_pre"; then
|
||||
AC_MSG_WARN([--with-version-pre value has been sanitized from '$with_version_pre' to '$VERSION_PRE'])
|
||||
fi
|
||||
@@ -502,6 +474,60 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
VENDOR_VERSION_STRING="$with_vendor_version_string"
|
||||
fi
|
||||
|
||||
# Set the MACOSX Bundle Name base
|
||||
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
|
||||
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_name_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
|
||||
elif test "x$with_macosx_bundle_name_base" != x; then
|
||||
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
|
||||
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
|
||||
|
||||
# Set the MACOSX Bundle ID base
|
||||
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
|
||||
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_id_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
|
||||
elif test "x$with_macosx_bundle_id_base" != x; then
|
||||
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
|
||||
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
|
||||
else
|
||||
# If using the default value, append the VERSION_PRE if there is one
|
||||
# to make it possible to tell official builds apart from developer builds
|
||||
if test "x$VERSION_PRE" != x; then
|
||||
MACOSX_BUNDLE_ID_BASE="$MACOSX_BUNDLE_ID_BASE-$VERSION_PRE"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
|
||||
|
||||
# Set the MACOSX CFBundleVersion field
|
||||
AC_ARG_WITH(macosx-bundle-build-version, [AS_HELP_STRING([--with-macosx-bundle-build-version],
|
||||
[Set the MacOSX Bundle CFBundleVersion field. This key is a machine-readable
|
||||
string composed of one to three period-separated integers and should represent the
|
||||
build version. Defaults to the build number.])])
|
||||
if test "x$with_macosx_bundle_build_version" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-build-version must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_build_version =~ ^[0-9\.]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-build-version contains non numbers and periods: $with_macosx_bundle_build_version])
|
||||
elif test "x$with_macosx_bundle_build_version" != x; then
|
||||
MACOSX_BUNDLE_BUILD_VERSION="$with_macosx_bundle_build_version"
|
||||
else
|
||||
MACOSX_BUNDLE_BUILD_VERSION="$VERSION_BUILD"
|
||||
# If VERSION_OPT consists of only numbers and periods, add it.
|
||||
if [ [[ $VERSION_OPT =~ ^[0-9\.]+$ ]] ]; then
|
||||
MACOSX_BUNDLE_BUILD_VERSION+=".$VERSION_OPT"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_BUILD_VERSION)
|
||||
|
||||
# We could define --with flags for these, if really needed
|
||||
VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
|
||||
VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"
|
||||
|
||||
@@ -237,8 +237,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_AOT],
|
||||
JVM_FEATURES_CHECK_AVAILABILITY(aot, [
|
||||
AC_MSG_CHECKING([if platform is supported by AOT])
|
||||
# AOT is only available where JVMCI is available since it requires JVMCI.
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
||||
@@ -303,8 +304,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_GRAAL],
|
||||
JVM_FEATURES_CHECK_AVAILABILITY(graal, [
|
||||
AC_MSG_CHECKING([if platform is supported by Graal])
|
||||
# Graal is only available where JVMCI is available since it requires JVMCI.
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
||||
@@ -336,8 +338,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI],
|
||||
[
|
||||
JVM_FEATURES_CHECK_AVAILABILITY(jvmci, [
|
||||
AC_MSG_CHECKING([if platform is supported by JVMCI])
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
||||
@@ -395,8 +398,14 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_ZGC],
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux" || \
|
||||
test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
|
||||
AVAILABLE=false
|
||||
|
||||
@@ -40,6 +40,7 @@ AC_DEFUN_ONCE([LIB_SETUP_BUNDLED_LIBS],
|
||||
LIB_SETUP_LIBPNG
|
||||
LIB_SETUP_ZLIB
|
||||
LIB_SETUP_LCMS
|
||||
LIB_SETUP_HARFBUZZ
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -263,3 +264,43 @@ AC_DEFUN_ONCE([LIB_SETUP_LCMS],
|
||||
AC_SUBST(LCMS_CFLAGS)
|
||||
AC_SUBST(LCMS_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup harfbuzz
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_HARFBUZZ],
|
||||
[
|
||||
AC_ARG_WITH(harfbuzz, [AS_HELP_STRING([--with-harfbuzz],
|
||||
[use harfbuzz from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for which harfbuzz to use])
|
||||
|
||||
DEFAULT_HARFBUZZ=bundled
|
||||
# If user didn't specify, use DEFAULT_HARFBUZZ
|
||||
if test "x${with_harfbuzz}" = "x"; then
|
||||
with_harfbuzz=${DEFAULT_HARFBUZZ}
|
||||
fi
|
||||
|
||||
if test "x${with_harfbuzz}" = "xbundled"; then
|
||||
USE_EXTERNAL_HARFBUZZ=false
|
||||
HARFBUZZ_CFLAGS=""
|
||||
HARFBUZZ_LIBS=""
|
||||
AC_MSG_RESULT([bundled])
|
||||
elif test "x${with_harfbuzz}" = "xsystem"; then
|
||||
AC_MSG_RESULT([system])
|
||||
PKG_CHECK_MODULES([HARFBUZZ], [harfbuzz], [HARFBUZZ_FOUND=yes], [HARFBUZZ_FOUND=no])
|
||||
if test "x${HARFBUZZ_FOUND}" = "xyes"; then
|
||||
# PKG_CHECK_MODULES will set HARFBUZZ_CFLAGS and HARFBUZZ_LIBS
|
||||
USE_EXTERNAL_HARFBUZZ=true
|
||||
else
|
||||
HELP_MSG_MISSING_DEPENDENCY([harfbuzz])
|
||||
AC_MSG_ERROR([--with-harfbuzz=system specified, but no harfbuzz found! $HELP_MSG])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --with-harfbuzz: ${with_harfbuzz}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_HARFBUZZ)
|
||||
AC_SUBST(HARFBUZZ_CFLAGS)
|
||||
AC_SUBST(HARFBUZZ_LIBS)
|
||||
])
|
||||
|
||||
@@ -87,6 +87,20 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
|
||||
[LIBFFI_FOUND=no]
|
||||
)
|
||||
fi
|
||||
# on macos we need a special case for system's libffi as
|
||||
# headers are located only in sdk in $SYSROOT and in ffi subfolder
|
||||
if test "x$LIBFFI_FOUND" = xno; then
|
||||
if test "x$SYSROOT" != "x"; then
|
||||
AC_CHECK_HEADER([$SYSROOT/usr/include/ffi/ffi.h],
|
||||
[
|
||||
LIBFFI_FOUND=yes
|
||||
LIBFFI_CFLAGS="-I${SYSROOT}/usr/include/ffi"
|
||||
LIBFFI_LIBS=-lffi
|
||||
],
|
||||
[LIBFFI_FOUND=no]
|
||||
)
|
||||
fi
|
||||
fi
|
||||
if test "x$LIBFFI_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([ffi])
|
||||
AC_MSG_ERROR([Could not find libffi! $HELP_MSG])
|
||||
|
||||
@@ -70,6 +70,7 @@ AC_DEFUN_ONCE([LIB_SETUP_STD_LIBS],
|
||||
else
|
||||
LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
|
||||
JVM_LDFLAGS="$JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
|
||||
ADLC_LDFLAGS="$ADLC_LDFLAGS $STATIC_STDCXX_FLAGS"
|
||||
# Ideally, we should test stdc++ for the BUILD toolchain separately. For now
|
||||
# just use the same setting as for the TARGET toolchain.
|
||||
OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
|
||||
|
||||
@@ -170,6 +170,7 @@ COMPANY_NAME:=@COMPANY_NAME@
|
||||
HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@
|
||||
MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
|
||||
MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@
|
||||
MACOSX_BUNDLE_BUILD_VERSION=@MACOSX_BUNDLE_BUILD_VERSION@
|
||||
USERNAME:=@USERNAME@
|
||||
VENDOR_URL:=@VENDOR_URL@
|
||||
VENDOR_URL_BUG:=@VENDOR_URL_BUG@
|
||||
@@ -476,7 +477,8 @@ DISABLED_WARNINGS_CXX := @DISABLED_WARNINGS_CXX@
|
||||
WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
|
||||
|
||||
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
|
||||
ADLC_CXXFLAG=@ADLC_CXXFLAG@
|
||||
ADLC_LANGSTD_CXXFLAGS=@ADLC_LANGSTD_CXXFLAGS@
|
||||
ADLC_LDFLAGS=@ADLC_LDFLAGS@
|
||||
|
||||
# Tools that potentially need to be cross compilation aware.
|
||||
CC:=@FIXPATH@ @CCACHE@ @ICECC@ @CC@
|
||||
@@ -489,15 +491,11 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
|
||||
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
|
||||
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
|
||||
|
||||
LIBJSIG_HASHSTYLE_LDFLAGS := @LIBJSIG_HASHSTYLE_LDFLAGS@
|
||||
LIBJSIG_NOEXECSTACK_LDFLAGS := @LIBJSIG_NOEXECSTACK_LDFLAGS@
|
||||
|
||||
FDLIBM_CFLAGS := @FDLIBM_CFLAGS@
|
||||
JVM_CFLAGS := @JVM_CFLAGS@
|
||||
JVM_LDFLAGS := @JVM_LDFLAGS@
|
||||
JVM_ASFLAGS := @JVM_ASFLAGS@
|
||||
JVM_LIBS := @JVM_LIBS@
|
||||
JVM_RCFLAGS := @JVM_RCFLAGS@
|
||||
|
||||
# These flags might contain variables set by a custom extension that is included later.
|
||||
EXTRA_CFLAGS = @EXTRA_CFLAGS@
|
||||
@@ -625,7 +623,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 +634,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 +646,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))))
|
||||
@@ -669,12 +666,7 @@ NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)
|
||||
|
||||
JLINK_KEEP_PACKAGED_MODULES:=@JLINK_KEEP_PACKAGED_MODULES@
|
||||
|
||||
# Base flags for RC
|
||||
# Guarding this against resetting value. Legacy make files include spec multiple
|
||||
# times.
|
||||
ifndef RC_FLAGS
|
||||
RC_FLAGS:=@RC_FLAGS@
|
||||
endif
|
||||
RCFLAGS := @RCFLAGS@
|
||||
|
||||
# Tools adhering to a minimal and common standard of posix compliance.
|
||||
AWK:=@AWK@
|
||||
@@ -833,6 +825,10 @@ USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
|
||||
LCMS_CFLAGS:=@LCMS_CFLAGS@
|
||||
LCMS_LIBS:=@LCMS_LIBS@
|
||||
|
||||
USE_EXTERNAL_HARFBUZZ:=@USE_EXTERNAL_HARFBUZZ@
|
||||
HARFBUZZ_CFLAGS:=@HARFBUZZ_CFLAGS@
|
||||
HARFBUZZ_LIBS:=@HARFBUZZ_LIBS@
|
||||
|
||||
USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
|
||||
PNG_LIBS:=@PNG_LIBS@
|
||||
PNG_CFLAGS:=@PNG_CFLAGS@
|
||||
|
||||
@@ -50,9 +50,9 @@ TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio"
|
||||
TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
|
||||
|
||||
# Minimum supported versions, empty means unspecified
|
||||
TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
|
||||
TOOLCHAIN_MINIMUM_VERSION_clang="3.5"
|
||||
TOOLCHAIN_MINIMUM_VERSION_gcc="5.0"
|
||||
TOOLCHAIN_MINIMUM_VERSION_microsoft="16.00.30319.01" # VS2010
|
||||
TOOLCHAIN_MINIMUM_VERSION_microsoft="19.10.0.0" # VS2017
|
||||
TOOLCHAIN_MINIMUM_VERSION_xlc=""
|
||||
|
||||
# Minimum supported linker versions, empty means unspecified
|
||||
@@ -872,14 +872,18 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
. $CONFIGURESUPPORT_OUTPUTDIR/build-devkit.info
|
||||
# This potentially sets the following:
|
||||
# A descriptive name of the devkit
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_NAME])
|
||||
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_NAME])
|
||||
# Corresponds to --with-extra-path
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_EXTRA_PATH])
|
||||
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_EXTRA_PATH])
|
||||
# Corresponds to --with-toolchain-path
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_TOOLCHAIN_PATH])
|
||||
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_TOOLCHAIN_PATH])
|
||||
# Corresponds to --with-sysroot
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_SYSROOT])
|
||||
# Skip the Window specific parts
|
||||
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_SYSROOT])
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_VS_INCLUDE])
|
||||
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_VS_LIB])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for build platform devkit])
|
||||
@@ -889,22 +893,34 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
AC_MSG_RESULT([$BUILD_DEVKIT_ROOT])
|
||||
fi
|
||||
|
||||
BUILD_SYSROOT="$BUILD_DEVKIT_SYSROOT"
|
||||
|
||||
# Fallback default of just /bin if DEVKIT_PATH is not defined
|
||||
# Fallback default of just /bin if DEVKIT_PATH is not defined
|
||||
if test "x$BUILD_DEVKIT_TOOLCHAIN_PATH" = x; then
|
||||
BUILD_DEVKIT_TOOLCHAIN_PATH="$BUILD_DEVKIT_ROOT/bin"
|
||||
fi
|
||||
PATH="$BUILD_DEVKIT_TOOLCHAIN_PATH:$BUILD_DEVKIT_EXTRA_PATH"
|
||||
|
||||
BUILD_SYSROOT="$BUILD_DEVKIT_SYSROOT"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
BUILD_VS_INCLUDE="$BUILD_DEVKIT_VS_INCLUDE"
|
||||
BUILD_VS_LIB="$BUILD_DEVKIT_VS_LIB"
|
||||
|
||||
TOOLCHAIN_SETUP_VISUAL_STUDIO_SYSROOT_FLAGS([BUILD_])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# FIXME: we should list the discovered compilers as an exclude pattern!
|
||||
# If we do that, we can do this detection before POST_DETECTION, and still
|
||||
# find the build compilers in the tools dir, if needed.
|
||||
UTIL_REQUIRE_PROGS(BUILD_CC, [cl cc gcc])
|
||||
if test "x$OPENJDK_BUILD_OS" = xmacosx; then
|
||||
UTIL_REQUIRE_PROGS(BUILD_CC, [clang cl cc gcc])
|
||||
UTIL_REQUIRE_PROGS(BUILD_CXX, [clang++ cl CC g++])
|
||||
else
|
||||
UTIL_REQUIRE_PROGS(BUILD_CC, [cl cc gcc])
|
||||
UTIL_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
|
||||
fi
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_CC)
|
||||
UTIL_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_CXX)
|
||||
UTIL_PATH_PROGS(BUILD_NM, nm gcc-nm)
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_NM)
|
||||
@@ -916,9 +932,37 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_STRIP)
|
||||
# Assume the C compiler is the assembler
|
||||
BUILD_AS="$BUILD_CC -c"
|
||||
# Just like for the target compiler, use the compiler as linker
|
||||
BUILD_LD="$BUILD_CC"
|
||||
BUILD_LDCXX="$BUILD_CXX"
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# In the Microsoft toolchain we have a separate LD command "link".
|
||||
# Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is
|
||||
# a cygwin program for something completely different.
|
||||
AC_CHECK_PROG([BUILD_LD], [link$EXE_SUFFIX],[link$EXE_SUFFIX],,, [$CYGWIN_LINK])
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_LD)
|
||||
# Verify that we indeed succeeded with this trick.
|
||||
AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker])
|
||||
|
||||
# Reset PATH since it can contain a mix of WSL/linux paths and Windows paths from VS,
|
||||
# which, in combination with WSLENV, will make the WSL layer complain
|
||||
old_path="$PATH"
|
||||
PATH=
|
||||
|
||||
"$BUILD_LD" --version > /dev/null
|
||||
|
||||
if test $? -eq 0 ; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
PATH="$old_path"
|
||||
|
||||
BUILD_LDCXX="$BUILD_LD"
|
||||
else
|
||||
# Just like for the target compiler, use the compiler as linker
|
||||
BUILD_LD="$BUILD_CC"
|
||||
BUILD_LDCXX="$BUILD_CXX"
|
||||
fi
|
||||
|
||||
PATH="$OLDPATH"
|
||||
|
||||
@@ -969,15 +1013,13 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
||||
if test "x$COMPILER_CPU_TEST" != "xx64"; then
|
||||
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".])
|
||||
fi
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
if test "x$COMPILER_CPU_TEST" != "xARM64"; then
|
||||
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "arm64".])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both, why?
|
||||
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
|
||||
# This is later checked when setting flags.
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# Check if linker has -z noexecstack.
|
||||
HAS_NOEXECSTACK=`$CC -Wl,--help 2>/dev/null | $GREP 'z noexecstack'`
|
||||
@@ -1005,8 +1047,27 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
|
||||
AC_MSG_CHECKING([for jtreg test harness])
|
||||
AC_MSG_RESULT([no, disabled])
|
||||
elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then
|
||||
# An explicit path is specified, use it.
|
||||
JT_HOME="$with_jtreg"
|
||||
if test -d "$with_jtreg"; then
|
||||
# An explicit path is specified, use it.
|
||||
JT_HOME="$with_jtreg"
|
||||
else
|
||||
case "$with_jtreg" in
|
||||
*.zip )
|
||||
JTREG_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/jtreg
|
||||
$RM -rf $JTREG_SUPPORT_DIR
|
||||
$MKDIR -p $JTREG_SUPPORT_DIR
|
||||
$UNZIP -qq -d $JTREG_SUPPORT_DIR $with_jtreg
|
||||
|
||||
# Try to find jtreg to determine JT_HOME path
|
||||
JTREG_PATH=`$FIND $JTREG_SUPPORT_DIR | $GREP "/bin/jtreg"`
|
||||
if test "x$JTREG_PATH" != x; then
|
||||
JT_HOME=$($DIRNAME $($DIRNAME $JTREG_PATH))
|
||||
fi
|
||||
;;
|
||||
* )
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
UTIL_FIXUP_PATH([JT_HOME])
|
||||
if test ! -d "$JT_HOME"; then
|
||||
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist])
|
||||
|
||||
@@ -25,55 +25,7 @@
|
||||
|
||||
################################################################################
|
||||
# The order of these defines the priority by which we try to find them.
|
||||
VALID_VS_VERSIONS="2019 2017 2013 2015 2012 2010"
|
||||
|
||||
VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
|
||||
VS_VERSION_INTERNAL_2010=100
|
||||
VS_MSVCR_2010=msvcr100.dll
|
||||
# We don't use msvcp on Visual Studio 2010
|
||||
#VS_MSVCP_2010=msvcp100.dll
|
||||
VS_ENVVAR_2010="VS100COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0"
|
||||
VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1"
|
||||
VS_VS_PLATFORM_NAME_2010="v100"
|
||||
VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK"
|
||||
VS_SUPPORTED_2010=false
|
||||
|
||||
VS_DESCRIPTION_2012="Microsoft Visual Studio 2012"
|
||||
VS_VERSION_INTERNAL_2012=110
|
||||
VS_MSVCR_2012=msvcr110.dll
|
||||
VS_MSVCP_2012=msvcp110.dll
|
||||
VS_ENVVAR_2012="VS110COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0"
|
||||
VS_SDK_INSTALLDIR_2012=
|
||||
VS_VS_PLATFORM_NAME_2012="v110"
|
||||
VS_SDK_PLATFORM_NAME_2012=
|
||||
VS_SUPPORTED_2012=false
|
||||
|
||||
VS_DESCRIPTION_2013="Microsoft Visual Studio 2013"
|
||||
VS_VERSION_INTERNAL_2013=120
|
||||
VS_MSVCR_2013=msvcr120.dll
|
||||
VS_MSVCP_2013=msvcp120.dll
|
||||
VS_ENVVAR_2013="VS120COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0"
|
||||
VS_SDK_INSTALLDIR_2013=
|
||||
VS_VS_PLATFORM_NAME_2013="v120"
|
||||
VS_SDK_PLATFORM_NAME_2013=
|
||||
VS_SUPPORTED_2013=false
|
||||
|
||||
VS_DESCRIPTION_2015="Microsoft Visual Studio 2015"
|
||||
VS_VERSION_INTERNAL_2015=140
|
||||
VS_MSVCR_2015=vcruntime140.dll
|
||||
VS_MSVCP_2015=msvcp140.dll
|
||||
VS_ENVVAR_2015="VS140COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2015="Microsoft Visual Studio 14.0"
|
||||
VS_SDK_INSTALLDIR_2015=
|
||||
VS_VS_PLATFORM_NAME_2015="v140"
|
||||
VS_SDK_PLATFORM_NAME_2015=
|
||||
# The vcvars of 2015 breaks if 2017 is also installed. Work around this by
|
||||
# explicitly specifying Windows Kit 8.1 to be used.
|
||||
VS_ENV_ARGS_2015="8.1"
|
||||
VS_SUPPORTED_2015=false
|
||||
VALID_VS_VERSIONS="2019 2017"
|
||||
|
||||
VS_DESCRIPTION_2017="Microsoft Visual Studio 2017"
|
||||
VS_VERSION_INTERNAL_2017=141
|
||||
@@ -127,11 +79,15 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
|
||||
|
||||
if test -d "$VS_BASE"; then
|
||||
AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||
VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
|
||||
else
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
|
||||
VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
|
||||
VC/Auxiliary/Build/vcvarsx86_amd64.bat VC/Auxiliary/Build/vcvars64.bat"
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
# for host x86-64, target aarch64
|
||||
VCVARSFILES="vc/auxiliary/build/vcvarsamd64_arm64.bat \
|
||||
vc/auxiliary/build/vcvarsx86_arm64.bat"
|
||||
fi
|
||||
|
||||
for VCVARSFILE in $VCVARSFILES; do
|
||||
@@ -171,10 +127,12 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT],
|
||||
elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
|
||||
AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
|
||||
VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||
VS_ENV_ARGS="/x86"
|
||||
else
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
|
||||
VS_ENV_ARGS="/x64"
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
VS_ENV_ARGS="/arm64"
|
||||
fi
|
||||
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
|
||||
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
|
||||
@@ -568,41 +526,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
|
||||
AC_SUBST(VS_INCLUDE)
|
||||
AC_SUBST(VS_LIB)
|
||||
|
||||
# Convert VS_INCLUDE into SYSROOT_CFLAGS
|
||||
OLDIFS="$IFS"
|
||||
IFS=";"
|
||||
for i in $VS_INCLUDE; do
|
||||
ipath=$i
|
||||
# Only process non-empty elements
|
||||
if test "x$ipath" != x; then
|
||||
IFS="$OLDIFS"
|
||||
# Check that directory exists before calling fixup_path
|
||||
testpath=$ipath
|
||||
UTIL_REWRITE_AS_UNIX_PATH([testpath])
|
||||
if test -d "$testpath"; then
|
||||
UTIL_FIXUP_PATH([ipath])
|
||||
SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
|
||||
fi
|
||||
IFS=";"
|
||||
fi
|
||||
done
|
||||
# Convert VS_LIB into SYSROOT_LDFLAGS
|
||||
for i in $VS_LIB; do
|
||||
libpath=$i
|
||||
# Only process non-empty elements
|
||||
if test "x$libpath" != x; then
|
||||
IFS="$OLDIFS"
|
||||
# Check that directory exists before calling fixup_path
|
||||
testpath=$libpath
|
||||
UTIL_REWRITE_AS_UNIX_PATH([testpath])
|
||||
if test -d "$testpath"; then
|
||||
UTIL_FIXUP_PATH([libpath])
|
||||
SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
|
||||
fi
|
||||
IFS=";"
|
||||
fi
|
||||
done
|
||||
IFS="$OLDIFS"
|
||||
TOOLCHAIN_SETUP_VISUAL_STUDIO_SYSROOT_FLAGS
|
||||
|
||||
AC_SUBST(VS_PATH_WINDOWS)
|
||||
fi
|
||||
@@ -641,10 +565,15 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL],
|
||||
CORRECT_MSVCR_ARCH="PE32+ executable"
|
||||
fi
|
||||
else
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||
CORRECT_MSVCR_ARCH=386
|
||||
else
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
|
||||
CORRECT_MSVCR_ARCH=x86-64
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
# The cygwin 'file' command only returns "PE32+ executable (DLL) (console), for MS Windows",
|
||||
# without specifying which architecture it is for specifically. This has been fixed upstream.
|
||||
# https://github.com/file/file/commit/b849b1af098ddd530094bf779b58431395db2e10#diff-ff2eced09e6860de75057dd731d092aeR142
|
||||
CORRECT_MSVCR_ARCH="PE32+ executable"
|
||||
fi
|
||||
fi
|
||||
if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
|
||||
@@ -664,26 +593,26 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
|
||||
DLL_NAME="$1"
|
||||
MSVC_DLL=
|
||||
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||
vs_target_cpu=x86
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
|
||||
vs_target_cpu=x64
|
||||
elif test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
vs_target_cpu=arm64
|
||||
fi
|
||||
|
||||
if test "x$MSVC_DLL" = x; then
|
||||
if test "x$VCINSTALLDIR" != x; then
|
||||
CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
|
||||
UTIL_FIXUP_PATH(CYGWIN_VC_INSTALL_DIR)
|
||||
if test "$VS_VERSION" -lt 2017; then
|
||||
# Probe: Using well-known location from Visual Studio 12.0 and older
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
|
||||
else
|
||||
POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
|
||||
fi
|
||||
POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/$vs_target_cpu/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
|
||||
else
|
||||
CYGWIN_VC_TOOLS_REDIST_DIR="$VCToolsRedistDir"
|
||||
UTIL_FIXUP_PATH(CYGWIN_VC_TOOLS_REDIST_DIR)
|
||||
# Probe: Using well-known location from VS 2017 and VS 2019
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_TOOLS_REDIST_DIR/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
|
||||
else
|
||||
POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_TOOLS_REDIST_DIR/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
|
||||
fi
|
||||
POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_TOOLS_REDIST_DIR/$vs_target_cpu/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
|
||||
fi
|
||||
# In case any of the above finds more than one file, loop over them.
|
||||
for possible_msvc_dll in $POSSIBLE_MSVC_DLL; do
|
||||
@@ -715,13 +644,8 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
|
||||
if test "x$VS100COMNTOOLS" != x; then
|
||||
CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
|
||||
UTIL_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR)
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
|
||||
| $GREP -i /x64/ | $HEAD --lines 1`
|
||||
else
|
||||
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
|
||||
| $GREP -i /x86/ | $HEAD --lines 1`
|
||||
fi
|
||||
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
|
||||
| $GREP -i /$vs_target_cpu/ | $HEAD --lines 1`
|
||||
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
|
||||
[search of VS100COMNTOOLS])
|
||||
fi
|
||||
@@ -731,17 +655,17 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
|
||||
# Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
|
||||
# (This was the original behaviour; kept since it might turn something up)
|
||||
if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
|
||||
| $GREP x64 | $HEAD --lines 1`
|
||||
else
|
||||
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
|
||||
| $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
|
||||
| $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $GREP -v arm64 | $HEAD --lines 1`
|
||||
if test "x$POSSIBLE_MSVC_DLL" = x; then
|
||||
# We're grasping at straws now...
|
||||
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
|
||||
| $HEAD --lines 1`
|
||||
fi
|
||||
else
|
||||
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
|
||||
| $GREP $vs_target_cpu | $HEAD --lines 1`
|
||||
fi
|
||||
|
||||
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
|
||||
@@ -805,9 +729,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(vcruntime-1-dll, [AS_HELP_STRING([--with-vcruntime-1-dll],
|
||||
[path to microsoft C++ runtime dll (vcruntime*_1.dll) (Windows only) @<:@probed@:>@])])
|
||||
[path to microsoft C++ runtime dll (vcruntime*_1.dll) (Windows 64-bits only) @<:@probed@:>@])])
|
||||
|
||||
if test "x$VCRUNTIME_1_NAME" != "x"; then
|
||||
if test "x$VCRUNTIME_1_NAME" != "x" -a "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
if test "x$with_vcruntime_1_dll" != x; then
|
||||
# If given explicitly by user, do not probe. If not present, fail directly.
|
||||
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($VCRUNTIME_1_NAME, [$with_vcruntime_1_dll],
|
||||
@@ -849,9 +773,12 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
|
||||
else
|
||||
CYGWIN_WINDOWSSDKDIR="${WINDOWSSDKDIR}"
|
||||
UTIL_FIXUP_PATH([CYGWIN_WINDOWSSDKDIR])
|
||||
dll_subdir=$OPENJDK_TARGET_CPU
|
||||
if test "x$dll_subdir" = "xx86_64"; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
dll_subdir="arm64"
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
dll_subdir="x64"
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xx86"; then
|
||||
dll_subdir="x86"
|
||||
fi
|
||||
UCRT_DLL_DIR="$CYGWIN_WINDOWSSDKDIR/Redist/ucrt/DLLs/$dll_subdir"
|
||||
if test -z "$(ls -d "$UCRT_DLL_DIR/"*.dll 2> /dev/null)"; then
|
||||
@@ -874,3 +801,49 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
|
||||
fi
|
||||
AC_SUBST(UCRT_DLL_DIR)
|
||||
])
|
||||
|
||||
# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
|
||||
# that configure can use them while detecting compilers.
|
||||
# TOOLCHAIN_TYPE is available here.
|
||||
# Param 1 - Optional prefix to all variables. (e.g BUILD_)
|
||||
AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_SYSROOT_FLAGS],
|
||||
[
|
||||
OLDIFS="$IFS"
|
||||
IFS=";"
|
||||
# Convert $1VS_INCLUDE into $1SYSROOT_CFLAGS
|
||||
for i in [$]$1VS_INCLUDE; do
|
||||
ipath=$i
|
||||
# Only process non-empty elements
|
||||
if test "x$ipath" != x; then
|
||||
IFS="$OLDIFS"
|
||||
# Check that directory exists before calling fixup_path
|
||||
testpath=$ipath
|
||||
UTIL_REWRITE_AS_UNIX_PATH([testpath])
|
||||
if test -d "$testpath"; then
|
||||
UTIL_FIXUP_PATH([ipath])
|
||||
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -I$ipath"
|
||||
fi
|
||||
IFS=";"
|
||||
fi
|
||||
done
|
||||
# Convert $1VS_LIB into $1SYSROOT_LDFLAGS
|
||||
for i in [$]$1VS_LIB; do
|
||||
libpath=$i
|
||||
# Only process non-empty elements
|
||||
if test "x$libpath" != x; then
|
||||
IFS="$OLDIFS"
|
||||
# Check that directory exists before calling fixup_path
|
||||
testpath=$libpath
|
||||
UTIL_REWRITE_AS_UNIX_PATH([testpath])
|
||||
if test -d "$testpath"; then
|
||||
UTIL_FIXUP_PATH([libpath])
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -libpath:$libpath"
|
||||
fi
|
||||
IFS=";"
|
||||
fi
|
||||
done
|
||||
IFS="$OLDIFS"
|
||||
|
||||
AC_SUBST($1SYSROOT_CFLAGS)
|
||||
AC_SUBST($1SYSROOT_LDFLAGS)
|
||||
])
|
||||
|
||||
@@ -601,7 +601,7 @@ AC_DEFUN([UTIL_REQUIRE_BUILTIN_PROGS],
|
||||
UTIL_SETUP_TOOL($1, [AC_PATH_PROGS($1, $2, , $3)])
|
||||
if test "x[$]$1" = x; then
|
||||
AC_MSG_NOTICE([Required tool $2 not found in PATH, checking built-in])
|
||||
if command -v $2 > /dev/null 2>&1; then
|
||||
if type -p $2 > /dev/null 2>&1; then
|
||||
AC_MSG_NOTICE([Found $2 as shell built-in. Using it])
|
||||
$1="$2"
|
||||
else
|
||||
|
||||
@@ -52,7 +52,15 @@ AC_DEFUN([UTIL_REWRITE_AS_WINDOWS_MIXED_PATH],
|
||||
windows_path=`cmd //c echo $unix_path`
|
||||
$1="$windows_path"
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
|
||||
windows_path=`$WSLPATH -m "$unix_path"`
|
||||
windows_path=`$WSLPATH -m "$unix_path" 2>/dev/null`
|
||||
if test $? -ne 0; then
|
||||
dir=`dirname "$unix_path"`
|
||||
base=`basename "$unix_path"`
|
||||
windows_path=`$WSLPATH -m "$dir"`/"$base"
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_ERROR([Cannot convert "$unix_path" to Windows path])
|
||||
fi
|
||||
fi
|
||||
$1="$windows_path"
|
||||
fi
|
||||
])
|
||||
@@ -234,7 +242,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_CYGWIN],
|
||||
new_path=`$CYGPATH -u "$path"`
|
||||
|
||||
# Now try to locate executable using which
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not always considered executable in cygwin causing which
|
||||
# to not find them
|
||||
if test "x$new_path" = x \
|
||||
@@ -250,7 +258,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_CYGWIN],
|
||||
path="$complete"
|
||||
arguments="EOL"
|
||||
new_path=`$CYGPATH -u "$path"`
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not always considered executable in cygwin causing which
|
||||
# to not find them
|
||||
if test "x$new_path" = x \
|
||||
@@ -316,7 +324,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_MSYS],
|
||||
UTIL_REWRITE_AS_UNIX_PATH(new_path)
|
||||
|
||||
# Now try to locate executable using which
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
|
||||
if test "x$new_path" = x; then
|
||||
# Oops. Which didn't find the executable.
|
||||
@@ -328,7 +336,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_MSYS],
|
||||
new_path="$path"
|
||||
UTIL_REWRITE_AS_UNIX_PATH(new_path)
|
||||
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not always considered executable in MSYS causing which
|
||||
# to not find them
|
||||
if test "x$new_path" = x \
|
||||
@@ -384,7 +392,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_WSL],
|
||||
|
||||
# Now try to locate executable using which
|
||||
new_path_bak="$new_path"
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not considered executable in WSL
|
||||
if test "x$new_path" = x \
|
||||
&& test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
|
||||
@@ -401,7 +409,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_WSL],
|
||||
new_path="$path"
|
||||
UTIL_REWRITE_AS_UNIX_PATH([new_path])
|
||||
new_path_bak="$new_path"
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not considered executable in WSL
|
||||
if test "x$new_path" = x \
|
||||
&& test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -26,18 +26,18 @@
|
||||
# Default version, product, and vendor information to use,
|
||||
# unless overridden by configure
|
||||
|
||||
DEFAULT_VERSION_FEATURE=15
|
||||
DEFAULT_VERSION_FEATURE=16
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=0
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_EXTRA1=0
|
||||
DEFAULT_VERSION_EXTRA2=0
|
||||
DEFAULT_VERSION_EXTRA3=0
|
||||
DEFAULT_VERSION_DATE=2020-09-15
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=59 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_DATE=2021-03-16
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=60 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="14 15"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=15
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="15 16"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=16
|
||||
DEFAULT_PROMOTED_VERSION_PRE=ea
|
||||
|
||||
LAUNCHER_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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 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
|
||||
@@ -92,6 +92,16 @@ ProcessDir = \
|
||||
) \
|
||||
)
|
||||
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
|
||||
JDK_RCFLAGS=$(RCFLAGS) \
|
||||
-D"JDK_VERSION_STRING=$(VERSION_STRING)" \
|
||||
-D"JDK_COMPANY=$(COMPANY_NAME)" \
|
||||
-D"JDK_VER=$(VERSION_NUMBER_FOUR_POSITIONS)" \
|
||||
-D"JDK_COPYRIGHT=Copyright \xA9 $(COPYRIGHT_YEAR)" \
|
||||
-D"JDK_NAME=$(JDK_RC_NAME) $(VERSION_SHORT)" \
|
||||
-D"JDK_FVER=$(subst .,$(COMMA),$(VERSION_NUMBER_FOUR_POSITIONS))"
|
||||
|
||||
# Setup make rules for creating a native shared library with suitable defaults
|
||||
# for the OpenJDK project.
|
||||
#
|
||||
@@ -100,7 +110,7 @@ ProcessDir = \
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
# EXTRA_HEADER_DIRS -- additional directories to look for headers in
|
||||
# EXTRA_SRC -- additional directories to look for source in
|
||||
# EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from
|
||||
@@ -108,6 +118,7 @@ ProcessDir = \
|
||||
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
|
||||
# header include dirs. (Defaults to true.)
|
||||
# SRC -- this is passed on, but preprocessed to accept source dir designations
|
||||
# RC_FILEDESC -- override the default FILEDESC for Windows version.rc
|
||||
# such as "java.base:headers".
|
||||
SetupJdkLibrary = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkLibraryBody
|
||||
@@ -137,19 +148,20 @@ define SetupJdkLibraryBody
|
||||
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
|
||||
$1_VERSIONINFO_RESOURCE :=
|
||||
endif
|
||||
|
||||
ifeq ($$($1_RC_FLAGS), )
|
||||
$1_RC_FLAGS := $(RC_FLAGS) \
|
||||
-D "JDK_FNAME=$$($1_NAME).dll" \
|
||||
-D "JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D "JDK_FTYPE=0x2L"
|
||||
else ifeq ($$($1_RC_FLAGS), DISABLE)
|
||||
$1_RC_FLAGS :=
|
||||
ifeq ($$($1_RC_FILEDESC), )
|
||||
$1_RC_FILEDESC := $(JDK_RC_NAME) binary
|
||||
endif
|
||||
|
||||
$1_RCFLAGS := $(JDK_RCFLAGS) \
|
||||
-D"JDK_FILEDESC=$$(strip $$($1_RC_FILEDESC))" \
|
||||
-D"JDK_FNAME=$$($1_NAME).dll" \
|
||||
-D"JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D"JDK_FTYPE=0x2L" \
|
||||
-I$(TOPDIR)/src/java.base/windows/native/common \
|
||||
$$($1_EXTRA_RCFLAGS)
|
||||
|
||||
ifneq ($$($1_HEADERS_FROM_SRC), false)
|
||||
$1_SRC_HEADER_FLAGS := $$(addprefix -I, $$(wildcard $$($1_SRC)))
|
||||
endif
|
||||
@@ -171,7 +183,6 @@ define SetupJdkLibraryBody
|
||||
ifeq ($$($1_CFLAGS)$$($1_CXXFLAGS), )
|
||||
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
|
||||
endif
|
||||
$1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
@@ -186,7 +197,7 @@ endef
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
SetupJdkExecutable = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkExecutableBody
|
||||
$1_TYPE := EXECUTABLE
|
||||
@@ -201,20 +212,15 @@ define SetupJdkExecutableBody
|
||||
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
|
||||
$1_VERSIONINFO_RESOURCE :=
|
||||
endif
|
||||
|
||||
ifeq ($$($1_RC_FLAGS), )
|
||||
$1_RC_FLAGS := $(RC_FLAGS) \
|
||||
-D "JDK_FNAME=$$($1_NAME).exe" \
|
||||
-D "JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D "JDK_FTYPE=0x01L"
|
||||
else ifeq ($$($1_RC_FLAGS), DISABLE)
|
||||
$1_RC_FLAGS :=
|
||||
endif
|
||||
|
||||
$1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
|
||||
$1_RCFLAGS := $(JDK_RCFLAGS) \
|
||||
-D"JDK_FILEDESC=$(JDK_RC_NAME) binary" \
|
||||
-D"JDK_FNAME=$$($1_NAME).exe" \
|
||||
-D"JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D"JDK_FTYPE=0x1L" \
|
||||
-I$(TOPDIR)/src/java.base/windows/native/common \
|
||||
$$($1_EXTRA_RCFLAGS)
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
|
||||
@@ -484,7 +484,7 @@ endif
|
||||
# Defines the sub directory structure to store variable value file in
|
||||
DependOnVariableDirName = \
|
||||
$(strip $(addsuffix $(if $(MODULE),/$(MODULE)), \
|
||||
$(subst $(TOPDIR)/,, $(if $(filter /%, $(firstword $(MAKEFILE_LIST))), \
|
||||
$(subst $(WORKSPACE_ROOT)/,, $(if $(filter /%, $(firstword $(MAKEFILE_LIST))), \
|
||||
$(firstword $(MAKEFILE_LIST)), \
|
||||
$(CURDIR)/$(firstword $(MAKEFILE_LIST))))))
|
||||
|
||||
@@ -496,6 +496,13 @@ DependOnVariableFileName = \
|
||||
$(strip $(if $(strip $2), $2, \
|
||||
$(MAKESUPPORT_OUTPUTDIR)/vardeps/$(DependOnVariableDirName)/$(strip $1).vardeps))
|
||||
|
||||
# Writes the vardeps file. Assumes $1_filename has been setup
|
||||
# Param 1 - Name of variable
|
||||
DependOnVariableWriteFile = \
|
||||
$(call MakeDir, $(dir $($1_filename))) \
|
||||
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
|
||||
$($1_filename)) \
|
||||
|
||||
# Does the actual work with parameters stripped.
|
||||
# If the file exists AND the contents is the same as the variable, do nothing
|
||||
# else print a new file.
|
||||
@@ -505,14 +512,18 @@ DependOnVariableFileName = \
|
||||
DependOnVariableHelper = \
|
||||
$(strip \
|
||||
$(eval $1_filename := $(call DependOnVariableFileName, $1, $2)) \
|
||||
$(if $(wildcard $($1_filename)), $(eval include $($1_filename))) \
|
||||
$(if $(call equals, $(strip $($1)), $(strip $($1_old))),,\
|
||||
$(call MakeDir, $(dir $($1_filename))) \
|
||||
$(if $(findstring $(LOG_LEVEL), trace), \
|
||||
$(info NewVariable $1: >$(strip $($1))<) \
|
||||
$(info OldVariable $1: >$(strip $($1_old))<)) \
|
||||
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
|
||||
$($1_filename))) \
|
||||
$(if $(wildcard $($1_filename)), \
|
||||
$(eval include $($1_filename)) \
|
||||
$(if $(call equals, $(strip $($1)), $(strip $($1_old))),,\
|
||||
$(if $(findstring $(LOG_LEVEL), trace), \
|
||||
$(info NewVariable $1: >$(strip $($1))<) \
|
||||
$(info OldVariable $1: >$(strip $($1_old))<) \
|
||||
) \
|
||||
$(call DependOnVariableWriteFile,$1) \
|
||||
) \
|
||||
, \
|
||||
$(call DependOnVariableWriteFile,$1) \
|
||||
) \
|
||||
$($1_filename) \
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -361,6 +346,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
|
||||
sub(/\/\*.*\*\//, ""); \
|
||||
gsub(/^ +\*.*/, ""); \
|
||||
gsub(/ /, ""); \
|
||||
gsub(/\r/, ""); \
|
||||
printf(" %s", $$0) } \
|
||||
END { printf("\n") }' $m && \
|
||||
$(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) :=" && \
|
||||
@@ -374,6 +360,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
|
||||
sub(/\/\*.*\*\//, ""); \
|
||||
gsub(/^ +\*.*/, ""); \
|
||||
gsub(/ /, ""); \
|
||||
gsub(/\r/, ""); \
|
||||
printf(" %s", $$0) } \
|
||||
END { printf("\n") }' $m \
|
||||
) >> $@ $(NEWLINE))
|
||||
|
||||
@@ -457,7 +457,7 @@ endef
|
||||
# EXTRA_OBJECT_FILES List of extra object files to include when linking
|
||||
# EXTRA_DEPS List of extra dependencies to be added to each compiled file
|
||||
# VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
|
||||
# RC_FLAGS flags for RC.
|
||||
# RCFLAGS flags for RC.
|
||||
# EMBED_MANIFEST if true, embed manifest on Windows.
|
||||
# MAPFILE mapfile
|
||||
# USE_MAPFILE_FOR_SYMBOLS if true and this is a STATIC_BUILD, just copy the
|
||||
@@ -860,7 +860,7 @@ define SetupNativeCompilationBody
|
||||
-include $$($1_RES_DEPS_FILE)
|
||||
-include $$($1_RES_DEPS_TARGETS_FILE)
|
||||
|
||||
$1_RES_VARDEPS := $$($1_RC) $$($1_RC_FLAGS)
|
||||
$1_RES_VARDEPS := $$($1_RC) $$($1_RCFLAGS)
|
||||
$1_RES_VARDEPS_FILE := $$(call DependOnVariable, $1_RES_VARDEPS, \
|
||||
$$($1_RES).vardeps)
|
||||
|
||||
@@ -868,7 +868,7 @@ define SetupNativeCompilationBody
|
||||
$$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$($1_BASENAME)))
|
||||
$$(call MakeDir, $$(@D) $$($1_OBJECT_DIR))
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
|
||||
$$($1_RC) $$($1_RCFLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
|
||||
$$($1_VERSIONINFO_RESOURCE) 2>&1 ))
|
||||
# Windows RC compiler does not support -showIncludes, so we mis-use CL
|
||||
# for this. Filter out RC specific arguments that are unknown to CL.
|
||||
@@ -876,7 +876,7 @@ define SetupNativeCompilationBody
|
||||
# includes to stderr so need to redirect it to hide the output from the
|
||||
# main log.
|
||||
$$(call ExecuteWithLog, $$($1_RES_DEPS_FILE).obj, \
|
||||
$$($1_CC) $$(filter-out -l%, $$($1_RC_FLAGS)) \
|
||||
$$($1_CC) $$(filter-out -l%, $$($1_RCFLAGS)) \
|
||||
$$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \
|
||||
$(CC_OUT_OPTION)$$($1_RES_DEPS_FILE).obj -P -Fi$$($1_RES_DEPS_FILE).pp \
|
||||
$$($1_VERSIONINFO_RESOURCE)) 2>&1 \
|
||||
|
||||
@@ -62,7 +62,11 @@ define SetupTestFilesCompilationBody
|
||||
$1_OUTPUT_SUBDIR := lib
|
||||
$1_BASE_CFLAGS := $(CFLAGS_JDKLIB)
|
||||
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB)
|
||||
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN)
|
||||
ifeq ($(call isTargetOs, windows), false)
|
||||
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN) -pthread
|
||||
else
|
||||
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN)
|
||||
endif
|
||||
$1_COMPILATION_TYPE := LIBRARY
|
||||
else ifeq ($$($1_TYPE), PROGRAM)
|
||||
$1_PREFIX = exe
|
||||
|
||||
@@ -220,6 +220,10 @@ define ParseKeywordVariableBody
|
||||
$$(eval mangled_part_eval := $$(call DoubleDollar, $$(mangled_part))) \
|
||||
$$(eval part := $$$$(subst ||||,$$$$(SPACE),$$$$(mangled_part_eval))) \
|
||||
$$(eval $1_NO_MATCH := true) \
|
||||
$$(if $$(filter help, $$(part)), \
|
||||
$$(info Valid keywords for $1:) \
|
||||
$$(info $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS).) \
|
||||
$$(error Re-run without 'help' to continue)) \
|
||||
$$(foreach keyword, $$($1_SINGLE_KEYWORDS), \
|
||||
$$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
|
||||
$$(if $$(filter $$(keyword)=%, $$(part)), \
|
||||
|
||||
@@ -48,7 +48,6 @@ LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
|
||||
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
|
||||
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
|
||||
#
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
MACOSX_PLIST_DIR := $(TOPDIR)/src/java.base/macosx/native/launcher
|
||||
JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
|
||||
|
||||
@@ -71,7 +70,7 @@ JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
|
||||
# compile time defines exceeding Visual Studio 2013 limitations.
|
||||
# CFLAGS Additional CFLAGS
|
||||
# CFLAGS_windows Additional CFLAGS_windows
|
||||
# EXTRA_RC_FLAGS Additional EXTRA_RC_FLAGS
|
||||
# EXTRA_RCFLAGS Additional EXTRA_RCFLAGS
|
||||
# MACOSX_PRIVILEGED On macosx, allow to access other processes
|
||||
# OPTIMIZATION Override default optimization level (LOW)
|
||||
# OUTPUT_DIR Override default output directory
|
||||
@@ -103,12 +102,22 @@ define SetupBuildLauncherBody
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
ifeq ($$($1_MACOSX_PRIVILEGED), true)
|
||||
$1_PLIST_FILE := Info-privileged.plist
|
||||
else
|
||||
$1_PLIST_FILE := Info-cmdline.plist
|
||||
$1_PLIST_EXTRA := <key>SecTaskAccess</key><string>allowed</string>
|
||||
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)/make/data/bundle/cmdline-Info.plist, \
|
||||
OUTPUT_FILE := $$($1_PLIST_FILE), \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$1 ; \
|
||||
@@VERSION@@ => $(VERSION_NUMBER) ; \
|
||||
@@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
|
||||
@@EXTRA@@ => $$($1_PLIST_EXTRA), \
|
||||
))
|
||||
|
||||
$1_LDFLAGS += -sectcreate __TEXT __info_plist $$($1_PLIST_FILE)
|
||||
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$1_LDFLAGS += -exported_symbols_list \
|
||||
@@ -160,7 +169,7 @@ define SetupBuildLauncherBody
|
||||
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
|
||||
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
|
||||
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
|
||||
EXTRA_RC_FLAGS := $$($1_EXTRA_RC_FLAGS), \
|
||||
EXTRA_RCFLAGS := $$($1_EXTRA_RCFLAGS), \
|
||||
MANIFEST := $(JAVA_MANIFEST), \
|
||||
MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
|
||||
))
|
||||
@@ -168,6 +177,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
|
||||
@@ -176,6 +187,10 @@ define SetupBuildLauncherBody
|
||||
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
|
||||
$$($1_WINDOWS_JLI_LIB)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE)
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
@@ -199,9 +214,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 +246,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)
|
||||
|
||||
@@ -27,8 +27,6 @@ include JdkNativeCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
|
||||
# Absolute paths to lib files on windows for use in LIBS. Should figure out a more
|
||||
# elegant solution to this.
|
||||
WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
|
||||
|
||||
@@ -381,7 +381,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
};
|
||||
};
|
||||
|
||||
common.boot_jdk_version = "14";
|
||||
common.boot_jdk_version = "15";
|
||||
common.boot_jdk_build_number = "36";
|
||||
common.boot_jdk_home = input.get("boot_jdk", "install_path") + "/jdk-"
|
||||
+ common.boot_jdk_version
|
||||
@@ -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;
|
||||
@@ -960,10 +959,10 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
var getJibProfilesDependencies = function (input, common) {
|
||||
|
||||
var devkit_platform_revisions = {
|
||||
linux_x64: "gcc9.2.0-OL6.4+1.0",
|
||||
macosx_x64: "Xcode10.1-MacOSX10.14+1.0",
|
||||
windows_x64: "VS2019-16.5.3+1.0",
|
||||
linux_aarch64: "gcc9.2.0-OL7.6+1.0",
|
||||
linux_x64: "gcc10.2.0-OL6.4+1.0",
|
||||
macosx_x64: "Xcode11.3.1-MacOSX10.15+1.0",
|
||||
windows_x64: "VS2019-16.7.2+1.0",
|
||||
linux_aarch64: "gcc10.2.0-OL7.6+1.0",
|
||||
linux_arm: "gcc8.2.0-Fedora27+1.0",
|
||||
linux_ppc64le: "gcc8.2.0-Fedora27+1.0",
|
||||
linux_s390x: "gcc8.2.0-Fedora27+1.0"
|
||||
@@ -995,17 +994,8 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
? input.get("gnumake", "install_path") + "/cygwin/bin"
|
||||
: input.get("gnumake", "install_path") + "/bin");
|
||||
|
||||
if (input.build_cpu == 'aarch64') {
|
||||
boot_jdk = {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
module: "jdk-linux_aarch64",
|
||||
revision: "14+1.0",
|
||||
configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
|
||||
environment_path: common.boot_jdk_home + "/bin"
|
||||
}
|
||||
} else {
|
||||
boot_jdk = {
|
||||
var dependencies = {
|
||||
boot_jdk: {
|
||||
server: "jpg",
|
||||
product: "jdk",
|
||||
version: common.boot_jdk_version,
|
||||
@@ -1014,11 +1004,7 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
+ boot_jdk_platform + "_bin" + boot_jdk_ext,
|
||||
configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
|
||||
environment_path: common.boot_jdk_home + "/bin"
|
||||
}
|
||||
}
|
||||
|
||||
var dependencies = {
|
||||
boot_jdk: boot_jdk,
|
||||
},
|
||||
|
||||
devkit: {
|
||||
organization: common.organization,
|
||||
@@ -1046,10 +1032,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"),
|
||||
@@ -1063,15 +1049,15 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
|
||||
jcov: {
|
||||
// Until an official build of JCov is available, use custom
|
||||
// build to support classfile version 57.
|
||||
// See CODETOOLS-7902358 for more info.
|
||||
// build to support classfile version 60.
|
||||
// See CODETOOLS-7902734 for more info.
|
||||
// server: "jpg",
|
||||
// product: "jcov",
|
||||
// version: "3.0",
|
||||
// build_number: "b07",
|
||||
// file: "bundles/jcov-3_0.zip",
|
||||
organization: common.organization,
|
||||
revision: "3.0-59-support+1.0",
|
||||
revision: "3.0-60-support+1.0",
|
||||
ext: "zip",
|
||||
environment_name: "JCOV_HOME",
|
||||
},
|
||||
@@ -1340,13 +1326,17 @@ var versionArgs = function(input, common) {
|
||||
"--with-version-pre=" + version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE"),
|
||||
"--without-version-opt");
|
||||
} else if (input.build_type == "ci") {
|
||||
var optString = input.build_id_data.ciBuildNumber;
|
||||
var ciBuildNumber = input.build_id_data.ciBuildNumber;
|
||||
var preString = input.build_id_data.projectName;
|
||||
if (preString == "jdk") {
|
||||
preString = version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE");
|
||||
}
|
||||
args = concat(args, "--with-version-pre=" + preString,
|
||||
"--with-version-opt=" + optString);
|
||||
"--with-version-opt=" + ciBuildNumber);
|
||||
if (input.target_os == "macosx") {
|
||||
args = concat(args, "--with-macosx-bundle-build-version="
|
||||
+ common.build_number + "." + ciBuildNumber);
|
||||
}
|
||||
} else {
|
||||
args = concat(args, "--with-version-opt=" + common.build_id);
|
||||
}
|
||||
|
||||
43
make/conf/test-dependencies
Normal file
43
make/conf/test-dependencies
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright (c) 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
|
||||
# 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.
|
||||
#
|
||||
|
||||
# Versions and download locations for dependencies used by pre-submit testing.
|
||||
|
||||
BOOT_JDK_VERSION=15
|
||||
JTREG_VERSION=5.1
|
||||
JTREG_BUILD=b01
|
||||
GTEST_VERSION=1.8.1
|
||||
|
||||
LINUX_X64_BOOT_JDK_FILENAME=openjdk-15_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=bb67cadee687d7b486583d03c9850342afea4593be4f436044d785fba9508fb7
|
||||
|
||||
WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-15_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=764e39a71252a9791118a31ae56a4247c049463bda5eb72497122ec50b1d07f8
|
||||
|
||||
MACOS_X64_BOOT_JDK_FILENAME=openjdk-115_osx-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_osx-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=ab842c8c0953b816be308c098c1a021177a4776bef24da85b6bafbbd657c7e1a
|
||||
@@ -17,11 +17,13 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<string>@@BUILD_VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
<key>JavaVM</key>
|
||||
<dict>
|
||||
<key>JVMCapabilities</key>
|
||||
@@ -31,9 +33,9 @@
|
||||
<key>JVMMinimumFrameworkVersion</key>
|
||||
<string>13.2.9</string>
|
||||
<key>JVMMinimumSystemVersion</key>
|
||||
<string>10.6.0</string>
|
||||
<string>@@MACOSX_VERSION_MIN@@</string>
|
||||
<key>JVMPlatformVersion</key>
|
||||
<string>@@PLATFORM_VERSION@@</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>JVMVendor</key>
|
||||
<string>@@VENDOR@@</string>
|
||||
<key>JVMVersion</key>
|
||||
|
||||
@@ -17,19 +17,21 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<string>@@BUILD_VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
<key>JavaVM</key>
|
||||
<dict>
|
||||
<key>JVMMinimumFrameworkVersion</key>
|
||||
<string>13.2.9</string>
|
||||
<key>JVMMinimumSystemVersion</key>
|
||||
<string>10.6.0</string>
|
||||
<string>@@MACOSX_VERSION_MIN@@</string>
|
||||
<key>JVMPlatformVersion</key>
|
||||
<string>@@PLATFORM_VERSION@@</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>JVMVendor</key>
|
||||
<string>@@VENDOR@@</string>
|
||||
<key>JVMVersion</key>
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>net.java.openjdk.cmd</string>
|
||||
<string>@@ID@@</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<string>@@BUILD_VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
@@EXTRA@@
|
||||
</dict>
|
||||
</plist>
|
||||
43
make/data/cacerts/entrustrootcag4
Normal file
43
make/data/cacerts/entrustrootcag4
Normal file
@@ -0,0 +1,43 @@
|
||||
Owner: CN=Entrust Root Certification Authority - G4, OU="(c) 2015 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US
|
||||
Issuer: CN=Entrust Root Certification Authority - G4, OU="(c) 2015 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US
|
||||
Serial number: d9b5437fafa9390f000000005565ad58
|
||||
Valid from: Wed May 27 11:11:16 GMT 2015 until: Sun Dec 27 11:41:16 GMT 2037
|
||||
Signature algorithm name: SHA256withRSA
|
||||
Subject Public Key Algorithm: 4096-bit RSA key
|
||||
Version: 3
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAw
|
||||
gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL
|
||||
Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg
|
||||
MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw
|
||||
BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0
|
||||
MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDExNlowgb4xCzAJBgNVBAYTAlVT
|
||||
MRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1
|
||||
c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJ
|
||||
bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3Qg
|
||||
Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0MIICIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAg8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3DumSXbcr3DbVZwbPLqGgZ
|
||||
2K+EbTBwXX7zLtJTmeH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV3imz/f3E
|
||||
T+iq4qA7ec2/a0My3dl0ELn39GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j
|
||||
5pds8ELl3FFLFUHtSUrJ3hCX1nbB76W1NhSXNdh4IjVS70O92yfbYVaCNNzLiGAM
|
||||
C1rlLAHGVK/XqsEQe9IFWrhAnoanw5CGAlZSCXqc0ieCU0plUmr1POeo8pyvi73T
|
||||
DtTUXm6Hnmo9RR3RXRv06QqsYJn7ibT/mCzPfB3pAqoEmh643IhuJbNsZvc8kPNX
|
||||
wbMv9W3y+8qh+CmdRouzavbmZwe+LGcKKh9asj5XxNMhIWNlUpEbsZmOeX7m640A
|
||||
2Vqq6nPopIICR5b+W45UYaPrL0swsIsjdXJ8ITzI9vF01Bx7owVV7rtNOzK+mndm
|
||||
nqxpkCIHH2E6lr7lmk/MBTwoWdPBDFSoWWG9yHJM6Nyfh3+9nEg2XpWjDrk4JFX8
|
||||
dWbrAuMINClKxuMrLzOg2qOGpRKX/YAr2hRC45K9PvJdXmd0LhyIRyk0X+IyqJwl
|
||||
N4y6mACXi0mWHv0liqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNj
|
||||
c0kCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD
|
||||
VR0OBBYEFJ84xFYjwznooHFs6FRM5Og6sb9nMA0GCSqGSIb3DQEBCwUAA4ICAQAS
|
||||
5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ9POrYs4QjbRaZIxowLByQzTS
|
||||
Gwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5ZDIBf9PD3Vht7LGr
|
||||
hFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0gkLpHZPt/
|
||||
B7NTeLUKYvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uI
|
||||
AeV8KEsD+UmDfLJ/fOPtjqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbw
|
||||
H5Lk6rWS02FREAutp9lfx1/cH6NcjKF+m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+
|
||||
b7DUUH8i119lAg2m9IUe2K4GS0qn0jFmwvjO5QimpAKWRGhXxNUzzxkvFMSUHHuk
|
||||
2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjAJOgc47Ol
|
||||
IQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk
|
||||
5F6G+TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuY
|
||||
n/PIjhs4ViFqUZPTkcpG2om3PVODLAgfi49T3f+sHw==
|
||||
-----END CERTIFICATE-----
|
||||
23
make/data/cacerts/sslrooteccca
Normal file
23
make/data/cacerts/sslrooteccca
Normal file
@@ -0,0 +1,23 @@
|
||||
Owner: CN=SSL.com Root Certification Authority ECC, O=SSL Corporation, L=Houston, ST=Texas, C=US
|
||||
Issuer: CN=SSL.com Root Certification Authority ECC, O=SSL Corporation, L=Houston, ST=Texas, C=US
|
||||
Serial number: 75e6dfcbc1685ba8
|
||||
Valid from: Fri Feb 12 18:14:03 GMT 2016 until: Tue Feb 12 18:14:03 GMT 2041
|
||||
Signature algorithm name: SHA256withECDSA
|
||||
Subject Public Key Algorithm: 384-bit EC key
|
||||
Version: 3
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMC
|
||||
VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T
|
||||
U0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0
|
||||
aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNDAzWhcNNDEwMjEyMTgxNDAz
|
||||
WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0
|
||||
b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBS
|
||||
b290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB
|
||||
BAAiA2IABEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI
|
||||
7Z4INcgn64mMU1jrYor+8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPg
|
||||
CemB+vNH06NjMGEwHQYDVR0OBBYEFILRhXMw5zUE044CkvvlpNHEIejNMA8GA1Ud
|
||||
EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTTjgKS++Wk0cQh6M0wDgYD
|
||||
VR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCWe+0F+S8T
|
||||
kdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+
|
||||
gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl
|
||||
-----END CERTIFICATE-----
|
||||
41
make/data/cacerts/sslrootevrsaca
Normal file
41
make/data/cacerts/sslrootevrsaca
Normal file
@@ -0,0 +1,41 @@
|
||||
Owner: CN=SSL.com EV Root Certification Authority RSA R2, O=SSL Corporation, L=Houston, ST=Texas, C=US
|
||||
Issuer: CN=SSL.com EV Root Certification Authority RSA R2, O=SSL Corporation, L=Houston, ST=Texas, C=US
|
||||
Serial number: 56b629cd34bc78f6
|
||||
Valid from: Wed May 31 18:14:37 GMT 2017 until: Fri May 30 18:14:37 GMT 2042
|
||||
Signature algorithm name: SHA256withRSA
|
||||
Subject Public Key Algorithm: 4096-bit RSA key
|
||||
Version: 3
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNV
|
||||
BAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UE
|
||||
CgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2Vy
|
||||
dGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMB4XDTE3MDUzMTE4MTQzN1oXDTQy
|
||||
MDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4G
|
||||
A1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQD
|
||||
DC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy
|
||||
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvq
|
||||
M0fNTPl9fb69LT3w23jhhqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssuf
|
||||
OePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7wcXHswxzpY6IXFJ3vG2fThVUCAtZJycxa
|
||||
4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTOZw+oz12WGQvE43LrrdF9
|
||||
HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+B6KjBSYR
|
||||
aZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcA
|
||||
b9ZhCBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQ
|
||||
Gp8hLH94t2S42Oim9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQV
|
||||
PWKchjgGAGYS5Fl2WlPAApiiECtoRHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMO
|
||||
pgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+SlmJuwgUHfbSguPvuUCYHBBXtSu
|
||||
UDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48+qvWBkofZ6aY
|
||||
MBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV
|
||||
HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa4
|
||||
9QaAJadz20ZpqJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBW
|
||||
s47LCp1Jjr+kxJG7ZhcFUZh1++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5
|
||||
Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nxY/hoLVUE0fKNsKTPvDxeH3jnpaAg
|
||||
cLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2GguDKBAdRUNf/ktUM
|
||||
79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDzOFSz
|
||||
/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXt
|
||||
ll9ldDz7CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEm
|
||||
Kf7GUmG6sXP/wwyc5WxqlD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKK
|
||||
QbNmC1r7fSOl8hqw/96bg5Qu0T/fkreRrwU7ZcegbLHNYhLDkBvjJc40vG93drEQ
|
||||
w/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1hlMYegouCRw2n5H9gooi
|
||||
S9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX9hwJ1C07
|
||||
mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w==
|
||||
-----END CERTIFICATE-----
|
||||
41
make/data/cacerts/sslrootrsaca
Normal file
41
make/data/cacerts/sslrootrsaca
Normal file
@@ -0,0 +1,41 @@
|
||||
Owner: CN=SSL.com Root Certification Authority RSA, O=SSL Corporation, L=Houston, ST=Texas, C=US
|
||||
Issuer: CN=SSL.com Root Certification Authority RSA, O=SSL Corporation, L=Houston, ST=Texas, C=US
|
||||
Serial number: 7b2c9bd316803299
|
||||
Valid from: Fri Feb 12 17:39:39 GMT 2016 until: Tue Feb 12 17:39:39 GMT 2041
|
||||
Signature algorithm name: SHA256withRSA
|
||||
Subject Public Key Algorithm: 4096-bit RSA key
|
||||
Version: 3
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE
|
||||
BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK
|
||||
DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTczOTM5WhcNNDEwMjEyMTcz
|
||||
OTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv
|
||||
dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv
|
||||
bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcN
|
||||
AQEBBQADggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2R
|
||||
xFdHaxh3a3by/ZPkPQ/CFp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aX
|
||||
qhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcC
|
||||
C52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/geoeOy3ZExqysdBP+lSgQ3
|
||||
6YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkpk8zruFvh
|
||||
/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrF
|
||||
YD3ZfBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93E
|
||||
JNyAKoFBbZQ+yODJgUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVc
|
||||
US4cK38acijnALXRdMbX5J+tB5O2UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8
|
||||
ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi81xtZPCvM8hnIk2snYxnP/Okm
|
||||
+Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4sbE6x/c+cCbqi
|
||||
M+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV
|
||||
HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4G
|
||||
A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGV
|
||||
cpNxJK1ok1iOMq8bs3AD/CUrdIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBc
|
||||
Hadm47GUBwwyOabqG7B52B2ccETjit3E+ZUfijhDPwGFpUenPUayvOUiaPd7nNgs
|
||||
PgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAslu1OJD7OAUN5F7kR/
|
||||
q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjqerQ0
|
||||
cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jr
|
||||
a6x+3uxjMxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90I
|
||||
H37hVZkLId6Tngr75qNJvTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/Y
|
||||
K9f1JmzJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu
|
||||
nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf
|
||||
oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY
|
||||
Ic2wBlX7Jz9TkHCpBB5XJ7k=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
package java.lang;
|
||||
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
import jdk.internal.vm.annotation.IntrinsicCandidate;
|
||||
|
||||
/** The CharacterData class encapsulates the large tables found in
|
||||
Java.lang.Character. */
|
||||
@@ -80,18 +80,18 @@ class CharacterDataLatin1 extends CharacterData {
|
||||
return props;
|
||||
}
|
||||
|
||||
@HotSpotIntrinsicCandidate
|
||||
@IntrinsicCandidate
|
||||
boolean isDigit(int ch) {
|
||||
return '0' <= ch && ch <= '9';
|
||||
}
|
||||
|
||||
@HotSpotIntrinsicCandidate
|
||||
@IntrinsicCandidate
|
||||
boolean isLowerCase(int ch) {
|
||||
int props = getProperties(ch);
|
||||
return (props & $$maskType) == Character.LOWERCASE_LETTER;
|
||||
}
|
||||
|
||||
@HotSpotIntrinsicCandidate
|
||||
@IntrinsicCandidate
|
||||
boolean isUpperCase(int ch) {
|
||||
int props = getProperties(ch);
|
||||
return (props & $$maskType) == Character.UPPERCASE_LETTER;
|
||||
@@ -232,7 +232,7 @@ class CharacterDataLatin1 extends CharacterData {
|
||||
return retval;
|
||||
}
|
||||
|
||||
@HotSpotIntrinsicCandidate
|
||||
@IntrinsicCandidate
|
||||
boolean isWhitespace(int ch) {
|
||||
int props = getProperties(ch);
|
||||
return ((props & $$maskIdentifierInfo) == $$valueJavaWhitespace);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 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
|
||||
@@ -50,7 +50,7 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036
|
||||
LVL428-LYD434-MAD504-MDL498-MGA969-MGF450-MKD807-MMK104-MNT496-MOP446-MRO478-MRU929-\
|
||||
MTL470-MUR480-MVR462-MWK454-MXN484-MXV979-MYR458-MZM508-MZN943-NAD516-NGN566-\
|
||||
NIO558-NLG528-NOK578-NPR524-NZD554-OMR512-PAB590-PEN604-PGK598-PHP608-\
|
||||
PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
|
||||
PKR586-PLN985-PTE620-PYG600-QAR634-ROL642-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
|
||||
SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\
|
||||
SRD968-SRG740-SSP728-STD678-STN930-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
|
||||
TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
|
||||
@@ -588,7 +588,7 @@ ZW=ZWL
|
||||
|
||||
minor0=\
|
||||
ADP-BEF-BIF-BYB-BYR-CLP-DJF-ESP-GNF-\
|
||||
GRD-ISK-ITL-JPY-KMF-KRW-LUF-MGF-PYG-PTE-RWF-\
|
||||
GRD-ISK-ITL-JPY-KMF-KRW-LUF-MGF-PYG-PTE-ROL-RWF-\
|
||||
TPE-TRL-UGX-UYI-VND-VUV-XAF-XOF-XPF
|
||||
minor3=\
|
||||
BHD-IQD-JOD-KWD-LYD-OMR-TND
|
||||
|
||||
@@ -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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user