mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-10 03:19:40 +01:00
Compare commits
593 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a21b1cb078 | ||
|
|
072eaeffde | ||
|
|
f46969a88a | ||
|
|
3a7a4a49dd | ||
|
|
5f133e9976 | ||
|
|
24449c88f0 | ||
|
|
645bb04df4 | ||
|
|
a2f95c84ad | ||
|
|
177cf42321 | ||
|
|
1962df5a7e | ||
|
|
2ac80d572a | ||
|
|
964f8d0838 | ||
|
|
16905c3130 | ||
|
|
8c6857c011 | ||
|
|
5acb6f53b7 | ||
|
|
4a3224e3f8 | ||
|
|
2cf8d97660 | ||
|
|
e391edefea | ||
|
|
41525a23dc | ||
|
|
2fb0c88cd1 | ||
|
|
939f870704 | ||
|
|
39c8daacb9 | ||
|
|
3ccba1b06c | ||
|
|
ba0baca2b7 | ||
|
|
407e69737f | ||
|
|
6a3c52740c | ||
|
|
9a9c31a690 | ||
|
|
e9a2e84e45 | ||
|
|
acb6bd09b5 | ||
|
|
4a8e810dc9 | ||
|
|
6d881af71f | ||
|
|
a5f503e2fc | ||
|
|
59e29eb062 | ||
|
|
5cf821cd18 | ||
|
|
2856601ce5 | ||
|
|
30a5f497ce | ||
|
|
6412341d45 | ||
|
|
126fad314d | ||
|
|
90c2b0e3f3 | ||
|
|
30adf07dd2 | ||
|
|
ef0a162ad4 | ||
|
|
52bd6a643a | ||
|
|
e0e14796ee | ||
|
|
519b98ab23 | ||
|
|
eef5f7b088 | ||
|
|
4635118ccb | ||
|
|
28b7cdfb12 | ||
|
|
f771ef4ea2 | ||
|
|
76dbd59f19 | ||
|
|
83b39d45ac | ||
|
|
03e8d7b04d | ||
|
|
49d683bd93 | ||
|
|
decf403bf3 | ||
|
|
d35ecfaa15 | ||
|
|
f00f98f2cb | ||
|
|
2ef7b2abe3 | ||
|
|
4a2acff75d | ||
|
|
892e74a87e | ||
|
|
4cb52fc49d | ||
|
|
a758468eee | ||
|
|
f06b171fe2 | ||
|
|
4bbc8e3230 | ||
|
|
86b719e366 | ||
|
|
bcda5085af | ||
|
|
9276e491e8 | ||
|
|
080d427e34 | ||
|
|
2c440a8078 | ||
|
|
dd6c7270b6 | ||
|
|
2bf2c26103 | ||
|
|
403562720b | ||
|
|
262e9cab6c | ||
|
|
b2bcb29646 | ||
|
|
317c27e0d6 | ||
|
|
aa8a574989 | ||
|
|
17e815e5b8 | ||
|
|
c7b90c0ca4 | ||
|
|
f8295608fb | ||
|
|
de59aa8b3f | ||
|
|
c9f3cedbfa | ||
|
|
e951505eab | ||
|
|
557cb9c6b1 | ||
|
|
07d44a6520 | ||
|
|
7947e49ae3 | ||
|
|
ab53c30753 | ||
|
|
906bb894db | ||
|
|
e838e31768 | ||
|
|
9fab0cfa1b | ||
|
|
0c815d1360 | ||
|
|
073cd1d632 | ||
|
|
6d662d543e | ||
|
|
92f9b54cd3 | ||
|
|
2e2313ef87 | ||
|
|
259a710013 | ||
|
|
d2f2e6fd41 | ||
|
|
aa90f3b312 | ||
|
|
553b498f51 | ||
|
|
c2aba135c2 | ||
|
|
056fb53c83 | ||
|
|
7870f1a6dc | ||
|
|
23c1598214 | ||
|
|
a40e2a9236 | ||
|
|
67ca223959 | ||
|
|
1dd31aff63 | ||
|
|
30a0d25953 | ||
|
|
a29db3a5b8 | ||
|
|
88cb86076a | ||
|
|
2c28ff340a | ||
|
|
0b736d6f91 | ||
|
|
9de0661d63 | ||
|
|
8a03379c45 | ||
|
|
99a38df3ab | ||
|
|
79a458c3d4 | ||
|
|
90882f83e0 | ||
|
|
f09520a064 | ||
|
|
c5193485ad | ||
|
|
92e079eae1 | ||
|
|
c70766c84b | ||
|
|
5485bef44e | ||
|
|
2f90b28014 | ||
|
|
5075c7e128 | ||
|
|
4d91f4e69d | ||
|
|
d992a67102 | ||
|
|
59e0637339 | ||
|
|
746be81338 | ||
|
|
bce847b2be | ||
|
|
db0ec61ffd | ||
|
|
4d93dffa7b | ||
|
|
b6b9364384 | ||
|
|
9e1b038ef2 | ||
|
|
34c5c0e638 | ||
|
|
e50bff5642 | ||
|
|
d48217e612 | ||
|
|
034d08cfbd | ||
|
|
fd4983b254 | ||
|
|
c1b34fdc2c | ||
|
|
8db7a08b50 | ||
|
|
8250719f92 | ||
|
|
78ee0b6ff2 | ||
|
|
c144b8c30f | ||
|
|
0c6e63367d | ||
|
|
9354b09906 | ||
|
|
ae7845053f | ||
|
|
4fe3c66318 | ||
|
|
e5f563bfef | ||
|
|
b7f31f0375 | ||
|
|
8fc3bf8715 | ||
|
|
5e41090120 | ||
|
|
befd51708b | ||
|
|
f63547bf71 | ||
|
|
d91b6547d3 | ||
|
|
43991d588a | ||
|
|
9d372e7801 | ||
|
|
1aa32ce1d0 | ||
|
|
6b3b53caa1 | ||
|
|
20f7d1a82a | ||
|
|
a28b8a61dc | ||
|
|
ce4eb93249 | ||
|
|
f996af2115 | ||
|
|
6a28f9e6fb | ||
|
|
dab6bdc071 | ||
|
|
d36ef0edd0 | ||
|
|
253681b976 | ||
|
|
19ba466575 | ||
|
|
48a4d23548 | ||
|
|
b93ce53426 | ||
|
|
c24f5af8ad | ||
|
|
d2e96c4350 | ||
|
|
ffc0068a0c | ||
|
|
1e69f7c4c9 | ||
|
|
0081af7ad7 | ||
|
|
960cf1f362 | ||
|
|
b42a7171ab | ||
|
|
36197b96c2 | ||
|
|
a25f924de6 | ||
|
|
bf29c2ec49 | ||
|
|
58d92c516a | ||
|
|
4e85a5ae43 | ||
|
|
084c96bb71 | ||
|
|
7e85e9c196 | ||
|
|
cb2ec81051 | ||
|
|
76e9329e16 | ||
|
|
42d8f28181 | ||
|
|
71bd48d8e7 | ||
|
|
ec9506c0fe | ||
|
|
5189d350c9 | ||
|
|
190f9337b1 | ||
|
|
22652f5354 | ||
|
|
cee3c2853b | ||
|
|
ed4b026105 | ||
|
|
4d2ab5385c | ||
|
|
35e27fd594 | ||
|
|
15aa5e3a57 | ||
|
|
86ec979f23 | ||
|
|
5fab892391 | ||
|
|
cd450988cc | ||
|
|
8ee7468a8c | ||
|
|
ad02c635e3 | ||
|
|
7cea3820af | ||
|
|
c27859fdda | ||
|
|
247f25e3d1 | ||
|
|
bf788959b7 | ||
|
|
66bb3b1c47 | ||
|
|
418cc392cc | ||
|
|
3a7c3cc018 | ||
|
|
617a84061c | ||
|
|
a4ad7e3be8 | ||
|
|
18489ee44f | ||
|
|
66b349c32a | ||
|
|
12edd63408 | ||
|
|
06729a6505 | ||
|
|
9ac23677b2 | ||
|
|
5e33f2e6b4 | ||
|
|
f18216cb96 | ||
|
|
ae5b50414a | ||
|
|
8662010454 | ||
|
|
23ec0c1cc7 | ||
|
|
65115fab95 | ||
|
|
77e477eaea | ||
|
|
cecb5cc0ea | ||
|
|
1fa1e6d2ca | ||
|
|
db9bc87b0d | ||
|
|
fcca48f761 | ||
|
|
a231c31f38 | ||
|
|
9e056eedc4 | ||
|
|
9c2ac55d23 | ||
|
|
4ee53ef4e3 | ||
|
|
5ab8312aa5 | ||
|
|
a235ecb344 | ||
|
|
5467bc74f8 | ||
|
|
caa3d02130 | ||
|
|
f9cf9e88b8 | ||
|
|
0982c856e5 | ||
|
|
a8090b5024 | ||
|
|
69a3c42db7 | ||
|
|
f4de445e6a | ||
|
|
e395ecfccb | ||
|
|
d98a8a162f | ||
|
|
fc44cdf0ec | ||
|
|
5fe59d132c | ||
|
|
bfe8385fa9 | ||
|
|
5409730fde | ||
|
|
27f8eea2ea | ||
|
|
eede95c5cf | ||
|
|
3ea9481c2f | ||
|
|
65cc3fdc8a | ||
|
|
5c82273ab3 | ||
|
|
4cb22654f8 | ||
|
|
35fe257db9 | ||
|
|
7d97d75349 | ||
|
|
3103641be3 | ||
|
|
0fb4cd9d38 | ||
|
|
2093cb052d | ||
|
|
598af92521 | ||
|
|
67517a374c | ||
|
|
f387416fed | ||
|
|
b2cc9db8d8 | ||
|
|
8eb2082cfa | ||
|
|
7e65ce7648 | ||
|
|
753a6e3b0c | ||
|
|
f211cb81b9 | ||
|
|
630afb40c1 | ||
|
|
1d38cac0b6 | ||
|
|
ddf5fcb7c2 | ||
|
|
37487a9e38 | ||
|
|
0f4dfb63ae | ||
|
|
6fede334f9 | ||
|
|
4974d1aef2 | ||
|
|
70ac5c3a48 | ||
|
|
d75477b147 | ||
|
|
2ce2cb1e0d | ||
|
|
3b0bb47cdc | ||
|
|
9bc34baa1a | ||
|
|
996e25a950 | ||
|
|
30f9a71516 | ||
|
|
6e609cbc64 | ||
|
|
5f5b303d7e | ||
|
|
a932c3bf6b | ||
|
|
7647c6e6a1 | ||
|
|
5d38b44a3e | ||
|
|
3eae3a200c | ||
|
|
90a9913da7 | ||
|
|
6b503b6a09 | ||
|
|
2fb1ac860c | ||
|
|
06e0c4e161 | ||
|
|
b42c6fb241 | ||
|
|
63de7b9fd0 | ||
|
|
b23fa14820 | ||
|
|
a7ac24961a | ||
|
|
e77f64d8dd | ||
|
|
ea67b80891 | ||
|
|
772a828f73 | ||
|
|
3c90e54214 | ||
|
|
4030ed819b | ||
|
|
d2956c2e8d | ||
|
|
bcc5da3b77 | ||
|
|
05ecc7021a | ||
|
|
f8f33c852c | ||
|
|
bb69156c80 | ||
|
|
126c55f2cb | ||
|
|
fc8b2309b8 | ||
|
|
ad2505a669 | ||
|
|
d72491e426 | ||
|
|
ab37de55bf | ||
|
|
9aceb41d6d | ||
|
|
e87a2bddaf | ||
|
|
0ffa9efb22 | ||
|
|
10673cfe8c | ||
|
|
bc17f4b068 | ||
|
|
57b04c9183 | ||
|
|
ec7c598299 | ||
|
|
8609d34dbe | ||
|
|
d4db347ba0 | ||
|
|
c6247493d0 | ||
|
|
42953c89cf | ||
|
|
1130c56f81 | ||
|
|
24bf261e1c | ||
|
|
58783bd353 | ||
|
|
91e6f28796 | ||
|
|
10ba495eaf | ||
|
|
e3b61c033b | ||
|
|
f0836f6924 | ||
|
|
f537c82bab | ||
|
|
d12a32baab | ||
|
|
4f76f09719 | ||
|
|
7adae55d1d | ||
|
|
d0479145f3 | ||
|
|
4478af167f | ||
|
|
bb0b967894 | ||
|
|
01059bf88b | ||
|
|
1848c820d0 | ||
|
|
9db3bb4e9c | ||
|
|
8893824d47 | ||
|
|
b377e796f7 | ||
|
|
a446ab4d6b | ||
|
|
87efa706f1 | ||
|
|
22a9c24dcd | ||
|
|
0f81426896 | ||
|
|
ea03f7c91f | ||
|
|
dca36c08f3 | ||
|
|
dc14220ea6 | ||
|
|
ae9638f154 | ||
|
|
15c6717dac | ||
|
|
a1c16bf976 | ||
|
|
68198af05c | ||
|
|
2efc2b56a0 | ||
|
|
7107241178 | ||
|
|
82c3d36026 | ||
|
|
ae3b577a0e | ||
|
|
655fbf4cb1 | ||
|
|
1d5b67ee67 | ||
|
|
d31cb702e1 | ||
|
|
fb2554e3f3 | ||
|
|
5e4a34c49f | ||
|
|
cab1b96d23 | ||
|
|
8119c54cae | ||
|
|
a7ee7996cf | ||
|
|
af0b21a0ad | ||
|
|
0c24c1a1fc | ||
|
|
ac5648d33a | ||
|
|
820cd68d3f | ||
|
|
6f445df42a | ||
|
|
4ca00ef5a6 | ||
|
|
6596ca7512 | ||
|
|
00b23c2eb8 | ||
|
|
fd111e0d53 | ||
|
|
fbf4750c28 | ||
|
|
6fd08e08fc | ||
|
|
d7f1d887ba | ||
|
|
761794aa7c | ||
|
|
4b24961eb6 | ||
|
|
4c542c9b00 | ||
|
|
fb7619310c | ||
|
|
bba02437ae | ||
|
|
3ef55b6dcd | ||
|
|
a3886ccb30 | ||
|
|
530a91a3af | ||
|
|
24adb234a8 | ||
|
|
a1e1caf8ba | ||
|
|
5a10114616 | ||
|
|
e6a94c002a | ||
|
|
bc37e5f4ad | ||
|
|
10ffeaaadd | ||
|
|
0b0d97c2c0 | ||
|
|
da7f38703d | ||
|
|
c5c13b6ad7 | ||
|
|
5540c7cbe1 | ||
|
|
52112c7c19 | ||
|
|
7e63c7bb0f | ||
|
|
95d9a2533a | ||
|
|
07e26447a0 | ||
|
|
5807947c50 | ||
|
|
1cf74954ed | ||
|
|
5555a381fb | ||
|
|
eae349e914 | ||
|
|
820cebb6aa | ||
|
|
512135758b | ||
|
|
a854dc1181 | ||
|
|
c9efbba43f | ||
|
|
16b4f55129 | ||
|
|
95f14173b8 | ||
|
|
0847cbc403 | ||
|
|
21ab6d5558 | ||
|
|
eab4ed5adb | ||
|
|
dd364409e2 | ||
|
|
6a0da744f9 | ||
|
|
82abf9473e | ||
|
|
1619b516b6 | ||
|
|
288fefed14 | ||
|
|
219047ad65 | ||
|
|
f5da332e66 | ||
|
|
6c3d986602 | ||
|
|
5ce100bbd1 | ||
|
|
8e2181cb13 | ||
|
|
4a42ba3816 | ||
|
|
b4094e9fa8 | ||
|
|
010a7705a4 | ||
|
|
6ede7eb0ed | ||
|
|
b146ea38dd | ||
|
|
716045c405 | ||
|
|
77a2559593 | ||
|
|
31b3d4939e | ||
|
|
4180daed71 | ||
|
|
d92f0f1dc3 | ||
|
|
b3c95408b2 | ||
|
|
eac2213397 | ||
|
|
5bf75c1ff9 | ||
|
|
6060a2999c | ||
|
|
fdb4922746 | ||
|
|
7d582a33d1 | ||
|
|
da6bbaf42b | ||
|
|
663170c654 | ||
|
|
67362236e8 | ||
|
|
969c84555e | ||
|
|
fb82e775a7 | ||
|
|
a2fc898bfc | ||
|
|
b56fd2a459 | ||
|
|
0b8e11509d | ||
|
|
236ff41145 | ||
|
|
c8e70c6dcc | ||
|
|
be44477bb5 | ||
|
|
4821301ca1 | ||
|
|
55483aa548 | ||
|
|
2030148ec2 | ||
|
|
90fc477ac3 | ||
|
|
0c5c756933 | ||
|
|
6ade50a062 | ||
|
|
80b04bb48e | ||
|
|
a79be71e3a | ||
|
|
ae6e0e250d | ||
|
|
97f5b61172 | ||
|
|
67126cb8fb | ||
|
|
48c46af177 | ||
|
|
27a09545ef | ||
|
|
cf28b19245 | ||
|
|
85d68499be | ||
|
|
beb3d4af9f | ||
|
|
91e5fbd2e0 | ||
|
|
763f24fbb9 | ||
|
|
0aa76a2c72 | ||
|
|
ee1343b38a | ||
|
|
980e8cff6f | ||
|
|
e8e95eec3a | ||
|
|
b7c322c198 | ||
|
|
3e4d534e16 | ||
|
|
93e5db7033 | ||
|
|
7f14f4a628 | ||
|
|
be2ea6f949 | ||
|
|
2a95b6ac74 | ||
|
|
0840008f85 | ||
|
|
5c9dbad612 | ||
|
|
947610257d | ||
|
|
bb55b5cb23 | ||
|
|
34d2bae0b0 | ||
|
|
6983b4e9e3 | ||
|
|
e2975f94c6 | ||
|
|
a98d595162 | ||
|
|
aebaf1978d | ||
|
|
dd70c34130 | ||
|
|
19aa94ea70 | ||
|
|
54198bc15e | ||
|
|
bbd8917a4f | ||
|
|
3102612ca2 | ||
|
|
2bee4db29d | ||
|
|
30902b737d | ||
|
|
a7dbbbddcd | ||
|
|
ea8bc25763 | ||
|
|
9bfff4cae3 | ||
|
|
164f41212a | ||
|
|
7e692e2b86 | ||
|
|
4fe69c432f | ||
|
|
d59c1fac00 | ||
|
|
b9742daca7 | ||
|
|
ac26dd6009 | ||
|
|
26d9259db7 | ||
|
|
29041e2c4a | ||
|
|
76c5530392 | ||
|
|
7678cb95bc | ||
|
|
050d7f177b | ||
|
|
642a01253c | ||
|
|
04378414a1 | ||
|
|
59d8b774a8 | ||
|
|
60b519aaeb | ||
|
|
b1d650a6f8 | ||
|
|
f75ac88269 | ||
|
|
5c30826657 | ||
|
|
74a0cc9f37 | ||
|
|
4adcc57838 | ||
|
|
e01b8f673e | ||
|
|
28502e7c19 | ||
|
|
2f1e08ffec | ||
|
|
19ac28e61d | ||
|
|
5db8580b26 | ||
|
|
3392a6aecc | ||
|
|
e27ee62c84 | ||
|
|
38008f1a21 | ||
|
|
027e8fa7c9 | ||
|
|
da356310f4 | ||
|
|
e7cb3dfa22 | ||
|
|
44bf260d2d | ||
|
|
c6cbd09027 | ||
|
|
aa91e0674a | ||
|
|
c6c6fe7b5e | ||
|
|
7267320515 | ||
|
|
5cae1dc78f | ||
|
|
a58e25d0b4 | ||
|
|
1a1e83be6a | ||
|
|
c2c0ba529a | ||
|
|
c421e7a0d3 | ||
|
|
711f7a37e0 | ||
|
|
3c5d7e26d1 | ||
|
|
0c344951cc | ||
|
|
566991e98e | ||
|
|
3a0f1e0653 | ||
|
|
21be9aded6 | ||
|
|
71ca890b66 | ||
|
|
c42bcf4526 | ||
|
|
772640d4e8 | ||
|
|
89197f0946 | ||
|
|
3c7f50e9f2 | ||
|
|
3dfcb4125e | ||
|
|
ef70244a9a | ||
|
|
c4bea48ac1 | ||
|
|
2c90f36ca0 | ||
|
|
2d77390705 | ||
|
|
3485b7bc5c | ||
|
|
665bf36b6f | ||
|
|
bb62cf25ed | ||
|
|
1338c067aa | ||
|
|
2d3b117249 | ||
|
|
e11ec149ce | ||
|
|
10f964a324 | ||
|
|
bcf263eb10 | ||
|
|
6c4cb95171 | ||
|
|
6ecdd925d1 | ||
|
|
ebb9d2fb06 | ||
|
|
cd162a777d | ||
|
|
ae54a3c965 | ||
|
|
0f4a06a92a | ||
|
|
a3b4abc14b | ||
|
|
78255f5c55 | ||
|
|
04449cd1a9 | ||
|
|
b65847a206 | ||
|
|
c05c2330cf | ||
|
|
bdc36d78a1 | ||
|
|
2be7768ab0 | ||
|
|
aafacb6fa6 | ||
|
|
b661fb4e1a | ||
|
|
2c31d993a4 | ||
|
|
575679c789 | ||
|
|
b1a10b8ed7 | ||
|
|
7474815db8 | ||
|
|
0844d3e77b | ||
|
|
49fe3afa18 | ||
|
|
b456dfe629 | ||
|
|
9688bbb771 | ||
|
|
3e78508945 | ||
|
|
98fb15899e | ||
|
|
b431c6929d | ||
|
|
ebe38d6cdc | ||
|
|
e1b3c5b5ba | ||
|
|
8a710dcc7e | ||
|
|
9a67229e2f | ||
|
|
1859ec2556 | ||
|
|
a47de580e7 | ||
|
|
63912d82f0 | ||
|
|
2d5af88356 | ||
|
|
0f4447e6dd | ||
|
|
e67d425245 | ||
|
|
221308625d | ||
|
|
859de70b8a | ||
|
|
9ff3405151 | ||
|
|
c716fa083c | ||
|
|
70f22c649b |
5
.hgtags
5
.hgtags
@@ -221,3 +221,8 @@ ea73f01b9053e7165e7ba80f242bafecbc6af712 jdk8-b96
|
||||
0a85476a0b9cb876d5666d45097dac68bef3fce1 jdk8-b97
|
||||
711eb4aa87de68de78250e0549980936bab53d54 jdk8-b98
|
||||
2d3875b0d18b3ad1c2bebf385a697e309e4005a4 jdk8-b99
|
||||
3d34036aae4ea90b2ca59712d5a69db3221f0875 jdk8-b100
|
||||
edb01c460d4cab21ff0ff13512df7b746efaa0e7 jdk8-b101
|
||||
bbe43d712fe08e650808d774861b256ccb34e500 jdk8-b102
|
||||
30a1d677a20c6a95f98043d8f20ce570304e3818 jdk8-b103
|
||||
b5ed503c26ad38869c247c5e32debec217fd056b jdk8-b104
|
||||
|
||||
@@ -221,3 +221,8 @@ c156084add486f941c12d886a0b1b2854795d557 jdk8-b96
|
||||
a1c1e8bf71f354f3aec0214cf13d6668811e021d jdk8-b97
|
||||
0d0c983a817bbe8518a5ff201306334a8de267f2 jdk8-b98
|
||||
59dc9da813794c924a0383c2a6241af94defdfed jdk8-b99
|
||||
d2dcb110e9dbaf9903c05b211df800e78e4b394e jdk8-b100
|
||||
9f74a220677dc265a724515d8e2617548cef62f1 jdk8-b101
|
||||
5eb3c1dc348f72a7f84f7d9d07834e8bbe09a799 jdk8-b102
|
||||
b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103
|
||||
96c1b9b7524b52c3fcefc90ffad4c767396727c8 jdk8-b104
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
</code>
|
||||
</blockquote>
|
||||
Once you have all the repositories, keep in mind that each
|
||||
repository is it's own independent repository.
|
||||
repository is its own independent repository.
|
||||
You can also re-run <code>./get_source.sh</code> anytime to
|
||||
pull over all the latest changesets in all the repositories.
|
||||
This set of nested repositories has been given the term
|
||||
@@ -241,6 +241,14 @@
|
||||
source code for the OpenJDK Corba functionality
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
nashorn
|
||||
</td>
|
||||
<td>
|
||||
source code for the OpenJDK JavaScript implementation
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</blockquote>
|
||||
@@ -386,7 +394,7 @@
|
||||
<code>--with-boot-jdk</code>.
|
||||
</li>
|
||||
<li>
|
||||
Insure that GNU make, the Bootstrap JDK,
|
||||
Ensure that GNU make, the Bootstrap JDK,
|
||||
and the compilers are all
|
||||
in your PATH environment variable
|
||||
</li>
|
||||
@@ -1307,9 +1315,9 @@
|
||||
you will need to modify the makefiles. But for normal file
|
||||
additions or removals, no changes are needed. There are certan
|
||||
exceptions for some native libraries where the source files are spread
|
||||
over many directories which also contain courses for other
|
||||
over many directories which also contain sources for other
|
||||
libraries. In these cases it was simply easier to create include lists
|
||||
rather thane excludes.
|
||||
rather than excludes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -1327,14 +1335,14 @@
|
||||
<p>
|
||||
<b>Q:</b>
|
||||
<code>configure</code> provides OpenJDK-specific features such as
|
||||
<code>--enable-jigsaw</code> or <code>--with-builddeps-server</code>
|
||||
that are not described in this document. What about those?
|
||||
<code>--with-builddeps-server</code> that are not
|
||||
described in this document. What about those?
|
||||
<br>
|
||||
<b>A:</b>
|
||||
Try them out if you like! But be aware that most of these are
|
||||
experimental features.
|
||||
Many of them don't do anything at all at the moment; the option
|
||||
is just a placeholder. Other depends on
|
||||
is just a placeholder. Others depend on
|
||||
pieces of code or infrastructure that is currently
|
||||
not ready for prime time.
|
||||
</p>
|
||||
@@ -1385,24 +1393,6 @@
|
||||
system and some will need to wait until after.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Q:</b> What is @GenerateNativeHeaders?
|
||||
<br>
|
||||
<b>A:</b>
|
||||
To speed up compilation, we added a flag to javac which makes it
|
||||
do the job of javah as well, as a by-product; that is, generating
|
||||
native .h header files. These files are only generated
|
||||
if a class contains native methods. However, sometimes
|
||||
a class contains no native method,
|
||||
but still contains constants that native code needs to use.
|
||||
The new GenerateNativeHeaders annotation tells javac to
|
||||
force generation of a
|
||||
header file in these cases. (We don't want to generate
|
||||
native headers for all classes that contains constants
|
||||
but no native methods, since
|
||||
that would slow down the compilation process needlessly.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Q:</b>
|
||||
Is anything able to use the results of the new build's default make target?
|
||||
@@ -1429,10 +1419,9 @@
|
||||
What should I do?
|
||||
<br>
|
||||
<b>A:</b>
|
||||
It might very well be that we have missed to add support for
|
||||
It might very well be that we have neglected to add support for
|
||||
an option that was actually used from outside the build system.
|
||||
Email us and we will
|
||||
add support for it!
|
||||
Email us and we will add support for it!
|
||||
</p>
|
||||
|
||||
</blockquote>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -412,17 +412,16 @@ AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS],
|
||||
[
|
||||
# keep track of c/cxx flags that we added outselves...
|
||||
# to prevent emitting warning...
|
||||
ADDED_CFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
|
||||
ADDED_CXXFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
|
||||
ADDED_LDFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
|
||||
TARGET_BITS_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
|
||||
AC_SUBST(TARGET_BITS_FLAG)
|
||||
|
||||
CFLAGS="${CFLAGS}${ADDED_CFLAGS}"
|
||||
CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}"
|
||||
LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}"
|
||||
CFLAGS="${CFLAGS} ${TARGET_BITS_FLAG}"
|
||||
CXXFLAGS="${CXXFLAGS} ${TARGET_BITS_FLAG}"
|
||||
LDFLAGS="${LDFLAGS} ${TARGET_BITS_FLAG}"
|
||||
|
||||
CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}"
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}"
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}"
|
||||
CFLAGS_JDK="${CFLAGS_JDK} ${TARGET_BITS_FLAG}"
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} ${TARGET_BITS_FLAG}"
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} ${TARGET_BITS_FLAG}"
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
|
||||
|
||||
@@ -304,6 +304,7 @@ MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
|
||||
COMPILER_TYPE:=@COMPILER_TYPE@
|
||||
COMPILER_NAME:=@COMPILER_NAME@
|
||||
|
||||
TARGET_BITS_FLAG=@TARGET_BITS_FLAG@
|
||||
COMPILER_SUPPORTS_TARGET_BITS_FLAG=@COMPILER_SUPPORTS_TARGET_BITS_FLAG@
|
||||
|
||||
CC_OUT_OPTION:=@CC_OUT_OPTION@
|
||||
|
||||
@@ -905,7 +905,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
|
||||
# Setting these parameters makes it an error to link to macosx APIs that are
|
||||
# newer than the given OS version and makes the linked binaries compatible even
|
||||
# if built on a newer version of the OS.
|
||||
|
||||
@@ -83,9 +83,6 @@ $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NE
|
||||
$(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
|
||||
$(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
|
||||
|
||||
# Remove any relative addressing in the paths.
|
||||
$1_SRC := $$(abspath $$($1_SRC))
|
||||
$1_BIN := $$(abspath $$($1_BIN))
|
||||
# Find all existing java files and existing class files.
|
||||
$$(eval $$(call MakeDir,$$($1_BIN)))
|
||||
$1_SRCS := $$(shell find $$($1_SRC) -name "*.idl")
|
||||
|
||||
@@ -204,7 +204,7 @@ clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jd
|
||||
# If the output directory was created by configure and now becomes empty, remove it as well.
|
||||
# FIXME: tmp should not be here, fix ResetTimers instead. And remove spec.sh!
|
||||
dist-clean: clean
|
||||
@($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp)
|
||||
@($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp javacservers)
|
||||
@$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
|
||||
if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
|
||||
$(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ;\
|
||||
|
||||
@@ -221,3 +221,8 @@ c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90
|
||||
469995a8e97424f450c880606d689bf345277b19 jdk8-b97
|
||||
3370fb6146e47a6cc05a213fc213e12fc0a38d07 jdk8-b98
|
||||
3f67804ab61303782df57e54989ef5e0e4629beb jdk8-b99
|
||||
8d492f1dfd1b131a4c7886ee6b59528609f7e4fe jdk8-b100
|
||||
a013024b07475782f1fa8e196e950b34b4077663 jdk8-b101
|
||||
528c7e76eaeee022817ee085668459bc97cf5665 jdk8-b102
|
||||
49c4a777fdfd648d4c3fffc940fdb97a23108ca8 jdk8-b103
|
||||
d411c60a8c2fe8fdc572af907775e90f7eefd513 jdk8-b104
|
||||
|
||||
@@ -1,528 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package com.sun.corba.se.impl.encoding;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.omg.CORBA.TypeCode;
|
||||
import org.omg.CORBA.Principal;
|
||||
import org.omg.CORBA.Any;
|
||||
|
||||
import com.sun.org.omg.SendingContext.CodeBase;
|
||||
|
||||
import com.sun.corba.se.pept.protocol.MessageMediator;
|
||||
|
||||
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||
import com.sun.corba.se.spi.orb.ORB;
|
||||
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
|
||||
import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
|
||||
|
||||
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
|
||||
import com.sun.corba.se.impl.encoding.CodeSetConversion;
|
||||
import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
|
||||
|
||||
/**
|
||||
* This is delegates to the real implementation.
|
||||
*
|
||||
* NOTE:
|
||||
*
|
||||
* Before using the stream for valuetype unmarshaling, one must call
|
||||
* performORBVersionSpecificInit().
|
||||
*/
|
||||
public abstract class CDRInputStream
|
||||
extends org.omg.CORBA_2_3.portable.InputStream
|
||||
implements com.sun.corba.se.impl.encoding.MarshalInputStream,
|
||||
org.omg.CORBA.DataInputStream, org.omg.CORBA.portable.ValueInputStream
|
||||
{
|
||||
protected CorbaMessageMediator messageMediator;
|
||||
private CDRInputStreamBase impl;
|
||||
|
||||
// We can move this out somewhere later. For now, it serves its purpose
|
||||
// to create a concrete CDR delegate based on the GIOP version.
|
||||
private static class InputStreamFactory {
|
||||
|
||||
public static CDRInputStreamBase newInputStream(ORB orb, GIOPVersion version)
|
||||
{
|
||||
switch(version.intValue()) {
|
||||
case GIOPVersion.VERSION_1_0:
|
||||
return new CDRInputStream_1_0();
|
||||
case GIOPVersion.VERSION_1_1:
|
||||
return new CDRInputStream_1_1();
|
||||
case GIOPVersion.VERSION_1_2:
|
||||
return new CDRInputStream_1_2();
|
||||
default:
|
||||
ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
|
||||
CORBALogDomains.RPC_ENCODING ) ;
|
||||
throw wrapper.unsupportedGiopVersion( version ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Required for the case when a ClientResponseImpl is
|
||||
// created with a SystemException due to a dead server/closed
|
||||
// connection with no warning. Note that the stream will
|
||||
// not be initialized in this case.
|
||||
//
|
||||
// Probably also required by ServerRequestImpl.
|
||||
//
|
||||
// REVISIT.
|
||||
public CDRInputStream() {
|
||||
}
|
||||
|
||||
public CDRInputStream(CDRInputStream is) {
|
||||
impl = is.impl.dup();
|
||||
impl.setParent(this);
|
||||
}
|
||||
|
||||
public CDRInputStream(org.omg.CORBA.ORB orb,
|
||||
ByteBuffer byteBuffer,
|
||||
int size,
|
||||
boolean littleEndian,
|
||||
GIOPVersion version,
|
||||
BufferManagerRead bufMgr)
|
||||
{
|
||||
impl = InputStreamFactory.newInputStream( (ORB)orb, version);
|
||||
|
||||
impl.init(orb, byteBuffer, size, littleEndian, bufMgr);
|
||||
|
||||
impl.setParent(this);
|
||||
}
|
||||
|
||||
// org.omg.CORBA.portable.InputStream
|
||||
public final boolean read_boolean() {
|
||||
return impl.read_boolean();
|
||||
}
|
||||
|
||||
public final char read_char() {
|
||||
return impl.read_char();
|
||||
}
|
||||
|
||||
public final char read_wchar() {
|
||||
return impl.read_wchar();
|
||||
}
|
||||
|
||||
public final byte read_octet() {
|
||||
return impl.read_octet();
|
||||
}
|
||||
|
||||
public final short read_short() {
|
||||
return impl.read_short();
|
||||
}
|
||||
|
||||
public final short read_ushort() {
|
||||
return impl.read_ushort();
|
||||
}
|
||||
|
||||
public final int read_long() {
|
||||
return impl.read_long();
|
||||
}
|
||||
|
||||
public final int read_ulong() {
|
||||
return impl.read_ulong();
|
||||
}
|
||||
|
||||
public final long read_longlong() {
|
||||
return impl.read_longlong();
|
||||
}
|
||||
|
||||
public final long read_ulonglong() {
|
||||
return impl.read_ulonglong();
|
||||
}
|
||||
|
||||
public final float read_float() {
|
||||
return impl.read_float();
|
||||
}
|
||||
|
||||
public final double read_double() {
|
||||
return impl.read_double();
|
||||
}
|
||||
|
||||
public final String read_string() {
|
||||
return impl.read_string();
|
||||
}
|
||||
|
||||
public final String read_wstring() {
|
||||
return impl.read_wstring();
|
||||
}
|
||||
|
||||
public final void read_boolean_array(boolean[] value, int offset, int length) {
|
||||
impl.read_boolean_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_char_array(char[] value, int offset, int length) {
|
||||
impl.read_char_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_wchar_array(char[] value, int offset, int length) {
|
||||
impl.read_wchar_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_octet_array(byte[] value, int offset, int length) {
|
||||
impl.read_octet_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_short_array(short[] value, int offset, int length) {
|
||||
impl.read_short_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_ushort_array(short[] value, int offset, int length) {
|
||||
impl.read_ushort_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_long_array(int[] value, int offset, int length) {
|
||||
impl.read_long_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_ulong_array(int[] value, int offset, int length) {
|
||||
impl.read_ulong_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_longlong_array(long[] value, int offset, int length) {
|
||||
impl.read_longlong_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_ulonglong_array(long[] value, int offset, int length) {
|
||||
impl.read_ulonglong_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_float_array(float[] value, int offset, int length) {
|
||||
impl.read_float_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final void read_double_array(double[] value, int offset, int length) {
|
||||
impl.read_double_array(value, offset, length);
|
||||
}
|
||||
|
||||
public final org.omg.CORBA.Object read_Object() {
|
||||
return impl.read_Object();
|
||||
}
|
||||
|
||||
public final TypeCode read_TypeCode() {
|
||||
return impl.read_TypeCode();
|
||||
}
|
||||
public final Any read_any() {
|
||||
return impl.read_any();
|
||||
}
|
||||
|
||||
public final Principal read_Principal() {
|
||||
return impl.read_Principal();
|
||||
}
|
||||
|
||||
public final int read() throws java.io.IOException {
|
||||
return impl.read();
|
||||
}
|
||||
|
||||
public final java.math.BigDecimal read_fixed() {
|
||||
return impl.read_fixed();
|
||||
}
|
||||
|
||||
public final org.omg.CORBA.Context read_Context() {
|
||||
return impl.read_Context();
|
||||
}
|
||||
|
||||
public final org.omg.CORBA.Object read_Object(java.lang.Class clz) {
|
||||
return impl.read_Object(clz);
|
||||
}
|
||||
|
||||
public final org.omg.CORBA.ORB orb() {
|
||||
return impl.orb();
|
||||
}
|
||||
|
||||
// org.omg.CORBA_2_3.portable.InputStream
|
||||
public final java.io.Serializable read_value() {
|
||||
return impl.read_value();
|
||||
}
|
||||
|
||||
public final java.io.Serializable read_value(java.lang.Class clz) {
|
||||
return impl.read_value(clz);
|
||||
}
|
||||
|
||||
public final java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory) {
|
||||
return impl.read_value(factory);
|
||||
}
|
||||
|
||||
public final java.io.Serializable read_value(java.lang.String rep_id) {
|
||||
return impl.read_value(rep_id);
|
||||
}
|
||||
|
||||
public final java.io.Serializable read_value(java.io.Serializable value) {
|
||||
return impl.read_value(value);
|
||||
}
|
||||
|
||||
public final java.lang.Object read_abstract_interface() {
|
||||
return impl.read_abstract_interface();
|
||||
}
|
||||
|
||||
public final java.lang.Object read_abstract_interface(java.lang.Class clz) {
|
||||
return impl.read_abstract_interface(clz);
|
||||
}
|
||||
// com.sun.corba.se.impl.encoding.MarshalInputStream
|
||||
|
||||
public final void consumeEndian() {
|
||||
impl.consumeEndian();
|
||||
}
|
||||
|
||||
public final int getPosition() {
|
||||
return impl.getPosition();
|
||||
}
|
||||
|
||||
// org.omg.CORBA.DataInputStream
|
||||
|
||||
public final java.lang.Object read_Abstract () {
|
||||
return impl.read_Abstract();
|
||||
}
|
||||
|
||||
public final java.io.Serializable read_Value () {
|
||||
return impl.read_Value();
|
||||
}
|
||||
|
||||
public final void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length) {
|
||||
impl.read_any_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length) {
|
||||
impl.read_boolean_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length) {
|
||||
impl.read_char_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length) {
|
||||
impl.read_wchar_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length) {
|
||||
impl.read_octet_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length) {
|
||||
impl.read_short_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length) {
|
||||
impl.read_ushort_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length) {
|
||||
impl.read_long_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length) {
|
||||
impl.read_ulong_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length) {
|
||||
impl.read_ulonglong_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length) {
|
||||
impl.read_longlong_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length) {
|
||||
impl.read_float_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public final void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length) {
|
||||
impl.read_double_array(seq, offset, length);
|
||||
}
|
||||
|
||||
// org.omg.CORBA.portable.ValueBase
|
||||
public final String[] _truncatable_ids() {
|
||||
return impl._truncatable_ids();
|
||||
}
|
||||
|
||||
// java.io.InputStream
|
||||
public final int read(byte b[]) throws IOException {
|
||||
return impl.read(b);
|
||||
}
|
||||
|
||||
public final int read(byte b[], int off, int len) throws IOException {
|
||||
return impl.read(b, off, len);
|
||||
}
|
||||
|
||||
public final long skip(long n) throws IOException {
|
||||
return impl.skip(n);
|
||||
}
|
||||
|
||||
public final int available() throws IOException {
|
||||
return impl.available();
|
||||
}
|
||||
|
||||
public final void close() throws IOException {
|
||||
impl.close();
|
||||
}
|
||||
|
||||
public final void mark(int readlimit) {
|
||||
impl.mark(readlimit);
|
||||
}
|
||||
|
||||
public final void reset() {
|
||||
impl.reset();
|
||||
}
|
||||
|
||||
public final boolean markSupported() {
|
||||
return impl.markSupported();
|
||||
}
|
||||
|
||||
public abstract CDRInputStream dup();
|
||||
|
||||
// Needed by TCUtility
|
||||
public final java.math.BigDecimal read_fixed(short digits, short scale) {
|
||||
return impl.read_fixed(digits, scale);
|
||||
}
|
||||
|
||||
public final boolean isLittleEndian() {
|
||||
return impl.isLittleEndian();
|
||||
}
|
||||
|
||||
protected final ByteBuffer getByteBuffer() {
|
||||
return impl.getByteBuffer();
|
||||
}
|
||||
|
||||
protected final void setByteBuffer(ByteBuffer byteBuffer) {
|
||||
impl.setByteBuffer(byteBuffer);
|
||||
}
|
||||
|
||||
protected final void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
|
||||
impl.setByteBufferWithInfo(bbwi);
|
||||
}
|
||||
|
||||
public final int getBufferLength() {
|
||||
return impl.getBufferLength();
|
||||
}
|
||||
|
||||
protected final void setBufferLength(int value) {
|
||||
impl.setBufferLength(value);
|
||||
}
|
||||
|
||||
protected final int getIndex() {
|
||||
return impl.getIndex();
|
||||
}
|
||||
|
||||
protected final void setIndex(int value) {
|
||||
impl.setIndex(value);
|
||||
}
|
||||
|
||||
public final void orb(org.omg.CORBA.ORB orb) {
|
||||
impl.orb(orb);
|
||||
}
|
||||
|
||||
public final GIOPVersion getGIOPVersion() {
|
||||
return impl.getGIOPVersion();
|
||||
}
|
||||
|
||||
public final BufferManagerRead getBufferManager() {
|
||||
return impl.getBufferManager();
|
||||
}
|
||||
|
||||
// This should be overridden by any stream (ex: IIOPInputStream)
|
||||
// which wants to read values. Thus, TypeCodeInputStream doesn't
|
||||
// have to do this.
|
||||
public CodeBase getCodeBase() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Use Latin-1 for GIOP 1.0 or when code set negotiation was not
|
||||
// performed.
|
||||
protected CodeSetConversion.BTCConverter createCharBTCConverter() {
|
||||
return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.ISO_8859_1,
|
||||
impl.isLittleEndian());
|
||||
}
|
||||
|
||||
// Subclasses must decide what to do here. It's inconvenient to
|
||||
// make the class and this method abstract because of dup().
|
||||
protected abstract CodeSetConversion.BTCConverter createWCharBTCConverter();
|
||||
|
||||
// Prints the current buffer in a human readable form
|
||||
void printBuffer() {
|
||||
impl.printBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Aligns the current position on the given octet boundary
|
||||
* if there are enough bytes available to do so. Otherwise,
|
||||
* it just returns. This is used for some (but not all)
|
||||
* GIOP 1.2 message headers.
|
||||
*/
|
||||
public void alignOnBoundary(int octetBoundary) {
|
||||
impl.alignOnBoundary(octetBoundary);
|
||||
}
|
||||
|
||||
// Needed by request and reply messages for GIOP versions >= 1.2 only.
|
||||
public void setHeaderPadding(boolean headerPadding) {
|
||||
impl.setHeaderPadding(headerPadding);
|
||||
}
|
||||
|
||||
/**
|
||||
* This must be called after determining the proper ORB version,
|
||||
* and setting it on the stream's ORB instance. It can be called
|
||||
* after reading the service contexts, since that is the only place
|
||||
* we can get the ORB version info.
|
||||
*
|
||||
* Trying to unmarshal things requiring repository IDs before calling
|
||||
* this will result in NullPtrExceptions.
|
||||
*/
|
||||
public void performORBVersionSpecificInit() {
|
||||
// In the case of SystemExceptions, a stream is created
|
||||
// with its default constructor (and thus no impl is set).
|
||||
if (impl != null)
|
||||
impl.performORBVersionSpecificInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets any internal references to code set converters.
|
||||
* This is useful for forcing the CDR stream to reacquire
|
||||
* converters (probably from its subclasses) when state
|
||||
* has changed.
|
||||
*/
|
||||
public void resetCodeSetConverters() {
|
||||
impl.resetCodeSetConverters();
|
||||
}
|
||||
|
||||
public void setMessageMediator(MessageMediator messageMediator)
|
||||
{
|
||||
this.messageMediator = (CorbaMessageMediator) messageMediator;
|
||||
}
|
||||
|
||||
public MessageMediator getMessageMediator()
|
||||
{
|
||||
return messageMediator;
|
||||
}
|
||||
|
||||
// ValueInputStream -----------------------------
|
||||
|
||||
public void start_value() {
|
||||
impl.start_value();
|
||||
}
|
||||
|
||||
public void end_value() {
|
||||
impl.end_value();
|
||||
}
|
||||
}
|
||||
@@ -1,435 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package com.sun.corba.se.impl.encoding;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.omg.CORBA.TypeCode;
|
||||
import org.omg.CORBA.Principal;
|
||||
import org.omg.CORBA.Any;
|
||||
|
||||
import com.sun.corba.se.pept.protocol.MessageMediator;
|
||||
|
||||
import com.sun.corba.se.spi.orb.ORB;
|
||||
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
|
||||
import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
|
||||
|
||||
import com.sun.corba.se.impl.encoding.CodeSetConversion;
|
||||
import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
|
||||
import com.sun.corba.se.impl.orbutil.ORBConstants;
|
||||
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
|
||||
|
||||
/**
|
||||
* This is delegates to the real implementation.
|
||||
*/
|
||||
public abstract class CDROutputStream
|
||||
extends org.omg.CORBA_2_3.portable.OutputStream
|
||||
implements com.sun.corba.se.impl.encoding.MarshalOutputStream,
|
||||
org.omg.CORBA.DataOutputStream, org.omg.CORBA.portable.ValueOutputStream
|
||||
{
|
||||
/*
|
||||
private CDROutputStreamBase impl;
|
||||
protected ORB orb ;
|
||||
protected ORBUtilSystemException wrapper ;
|
||||
protected CorbaMessageMediator corbaMessageMediator;
|
||||
|
||||
|
||||
// We can move this out somewhere later. For now, it serves its purpose
|
||||
// to create a concrete CDR delegate based on the GIOP version.
|
||||
private static class OutputStreamFactory {
|
||||
|
||||
public static CDROutputStreamBase newOutputStream(ORB orb, GIOPVersion version)
|
||||
{
|
||||
switch(version.intValue()) {
|
||||
case GIOPVersion.VERSION_1_0:
|
||||
return new CDROutputStream_1_0();
|
||||
case GIOPVersion.VERSION_1_1:
|
||||
return new CDROutputStream_1_1();
|
||||
case GIOPVersion.VERSION_1_2:
|
||||
return new CDROutputStream_1_2();
|
||||
default:
|
||||
ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
|
||||
CORBALogDomains.RPC_ENCODING ) ;
|
||||
// REVISIT - what is appropriate? INTERNAL exceptions
|
||||
// are really hard to track later.
|
||||
throw wrapper.unsupportedGiopVersion( version ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// REVISIT - These two constructors should be re-factored to better hide
|
||||
// the fact that someone extending this class 'can' construct a CDROutputStream
|
||||
// that does not use pooled ByteBuffers. Right now, only EncapsOutputStream
|
||||
// does _not_ use pooled ByteBuffers, see EncapsOutputStream.
|
||||
|
||||
// NOTE: When a stream is constructed for non-channel-backed sockets
|
||||
// it notifies the constructor not to use pooled (i.e, direct)
|
||||
// ByteBuffers.
|
||||
|
||||
public CDROutputStream(ORB orb,
|
||||
GIOPVersion version,
|
||||
boolean littleEndian,
|
||||
BufferManagerWrite bufferManager,
|
||||
byte streamFormatVersion,
|
||||
boolean usePooledByteBuffers)
|
||||
{
|
||||
impl = OutputStreamFactory.newOutputStream(orb, version);
|
||||
impl.init(orb, littleEndian, bufferManager, streamFormatVersion, usePooledByteBuffers);
|
||||
|
||||
impl.setParent(this);
|
||||
this.orb = orb ;
|
||||
this.wrapper = ORBUtilSystemException.get( orb,
|
||||
CORBALogDomains.RPC_ENCODING ) ;
|
||||
}
|
||||
|
||||
public CDROutputStream(ORB orb,
|
||||
GIOPVersion version,
|
||||
boolean littleEndian,
|
||||
BufferManagerWrite bufferManager,
|
||||
byte streamFormatVersion)
|
||||
{
|
||||
this(orb, version, littleEndian, bufferManager, streamFormatVersion, true);
|
||||
}
|
||||
*/
|
||||
|
||||
private ByteArrayOutputStream bos ;
|
||||
private ObjectOutputStream oos ;
|
||||
|
||||
public JavaOutputStream()
|
||||
{
|
||||
bos = new ByteArrayOutputStream() ;
|
||||
oos = new ObjectOutputStream( bos ) ;
|
||||
}
|
||||
|
||||
// Provided by IIOPOutputStream and EncapsOutputStream
|
||||
public org.omg.CORBA.portable.InputStream create_input_stream()
|
||||
{
|
||||
ObjectInputStream ois = new ByteArrayInputStream( bos.toByteArray() ) ;
|
||||
|
||||
return new JavaInputStream( ois ) ;
|
||||
}
|
||||
|
||||
public final void write_boolean(boolean value) {
|
||||
impl.write_boolean(value);
|
||||
}
|
||||
public final void write_char(char value) {
|
||||
impl.write_char(value);
|
||||
}
|
||||
public final void write_wchar(char value) {
|
||||
impl.write_wchar(value);
|
||||
}
|
||||
public final void write_octet(byte value) {
|
||||
impl.write_octet(value);
|
||||
}
|
||||
public final void write_short(short value) {
|
||||
impl.write_short(value);
|
||||
}
|
||||
public final void write_ushort(short value) {
|
||||
impl.write_ushort(value);
|
||||
}
|
||||
public final void write_long(int value) {
|
||||
impl.write_long(value);
|
||||
}
|
||||
public final void write_ulong(int value) {
|
||||
impl.write_ulong(value);
|
||||
}
|
||||
public final void write_longlong(long value) {
|
||||
impl.write_longlong(value);
|
||||
}
|
||||
public final void write_ulonglong(long value) {
|
||||
impl.write_ulonglong(value);
|
||||
}
|
||||
public final void write_float(float value) {
|
||||
impl.write_float(value);
|
||||
}
|
||||
public final void write_double(double value) {
|
||||
impl.write_double(value);
|
||||
}
|
||||
public final void write_string(String value) {
|
||||
impl.write_string(value);
|
||||
}
|
||||
public final void write_wstring(String value) {
|
||||
impl.write_wstring(value);
|
||||
}
|
||||
|
||||
public final void write_boolean_array(boolean[] value, int offset, int length) {
|
||||
impl.write_boolean_array(value, offset, length);
|
||||
}
|
||||
public final void write_char_array(char[] value, int offset, int length) {
|
||||
impl.write_char_array(value, offset, length);
|
||||
}
|
||||
public final void write_wchar_array(char[] value, int offset, int length) {
|
||||
impl.write_wchar_array(value, offset, length);
|
||||
}
|
||||
public final void write_octet_array(byte[] value, int offset, int length) {
|
||||
impl.write_octet_array(value, offset, length);
|
||||
}
|
||||
public final void write_short_array(short[] value, int offset, int length) {
|
||||
impl.write_short_array(value, offset, length);
|
||||
}
|
||||
public final void write_ushort_array(short[] value, int offset, int length){
|
||||
impl.write_ushort_array(value, offset, length);
|
||||
}
|
||||
public final void write_long_array(int[] value, int offset, int length) {
|
||||
impl.write_long_array(value, offset, length);
|
||||
}
|
||||
public final void write_ulong_array(int[] value, int offset, int length) {
|
||||
impl.write_ulong_array(value, offset, length);
|
||||
}
|
||||
public final void write_longlong_array(long[] value, int offset, int length) {
|
||||
impl.write_longlong_array(value, offset, length);
|
||||
}
|
||||
public final void write_ulonglong_array(long[] value, int offset,int length) {
|
||||
impl.write_ulonglong_array(value, offset, length);
|
||||
}
|
||||
public final void write_float_array(float[] value, int offset, int length) {
|
||||
impl.write_float_array(value, offset, length);
|
||||
}
|
||||
public final void write_double_array(double[] value, int offset, int length) {
|
||||
impl.write_double_array(value, offset, length);
|
||||
}
|
||||
public final void write_Object(org.omg.CORBA.Object value) {
|
||||
impl.write_Object(value);
|
||||
}
|
||||
public final void write_TypeCode(TypeCode value) {
|
||||
impl.write_TypeCode(value);
|
||||
}
|
||||
public final void write_any(Any value) {
|
||||
impl.write_any(value);
|
||||
}
|
||||
|
||||
public final void write_Principal(Principal value) {
|
||||
impl.write_Principal(value);
|
||||
}
|
||||
|
||||
public final void write(int b) throws java.io.IOException {
|
||||
impl.write(b);
|
||||
}
|
||||
|
||||
public final void write_fixed(java.math.BigDecimal value) {
|
||||
impl.write_fixed(value);
|
||||
}
|
||||
|
||||
public final void write_Context(org.omg.CORBA.Context ctx,
|
||||
org.omg.CORBA.ContextList contexts) {
|
||||
impl.write_Context(ctx, contexts);
|
||||
}
|
||||
|
||||
public final org.omg.CORBA.ORB orb() {
|
||||
return impl.orb();
|
||||
}
|
||||
|
||||
// org.omg.CORBA_2_3.portable.OutputStream
|
||||
public final void write_value(java.io.Serializable value) {
|
||||
impl.write_value(value);
|
||||
}
|
||||
|
||||
public final void write_value(java.io.Serializable value, java.lang.Class clz) {
|
||||
impl.write_value(value, clz);
|
||||
}
|
||||
|
||||
public final void write_value(java.io.Serializable value, String repository_id) {
|
||||
impl.write_value(value, repository_id);
|
||||
}
|
||||
|
||||
public final void write_value(java.io.Serializable value,
|
||||
org.omg.CORBA.portable.BoxedValueHelper factory) {
|
||||
impl.write_value(value, factory);
|
||||
}
|
||||
|
||||
public final void write_abstract_interface(java.lang.Object obj) {
|
||||
impl.write_abstract_interface(obj);
|
||||
}
|
||||
|
||||
// java.io.OutputStream
|
||||
public final void write(byte b[]) throws IOException {
|
||||
impl.write(b);
|
||||
}
|
||||
|
||||
public final void write(byte b[], int off, int len) throws IOException {
|
||||
impl.write(b, off, len);
|
||||
}
|
||||
|
||||
public final void flush() throws IOException {
|
||||
impl.flush();
|
||||
}
|
||||
|
||||
public final void close() throws IOException {
|
||||
impl.close();
|
||||
}
|
||||
|
||||
// com.sun.corba.se.impl.encoding.MarshalOutputStream
|
||||
public final void start_block() {
|
||||
impl.start_block();
|
||||
}
|
||||
|
||||
public final void end_block() {
|
||||
impl.end_block();
|
||||
}
|
||||
|
||||
public final void putEndian() {
|
||||
impl.putEndian();
|
||||
}
|
||||
|
||||
public void writeTo(java.io.OutputStream s)
|
||||
throws IOException
|
||||
{
|
||||
impl.writeTo(s);
|
||||
}
|
||||
|
||||
public final byte[] toByteArray() {
|
||||
return impl.toByteArray();
|
||||
}
|
||||
|
||||
// org.omg.CORBA.DataOutputStream
|
||||
public final void write_Abstract (java.lang.Object value) {
|
||||
impl.write_Abstract(value);
|
||||
}
|
||||
|
||||
public final void write_Value (java.io.Serializable value) {
|
||||
impl.write_Value(value);
|
||||
}
|
||||
|
||||
public final void write_any_array(org.omg.CORBA.Any[] seq, int offset, int length) {
|
||||
impl.write_any_array(seq, offset, length);
|
||||
}
|
||||
|
||||
public void setMessageMediator(MessageMediator messageMediator)
|
||||
{
|
||||
this.corbaMessageMediator = (CorbaMessageMediator) messageMediator;
|
||||
}
|
||||
|
||||
public MessageMediator getMessageMediator()
|
||||
{
|
||||
return corbaMessageMediator;
|
||||
}
|
||||
|
||||
// org.omg.CORBA.portable.ValueBase
|
||||
public final String[] _truncatable_ids() {
|
||||
return impl._truncatable_ids();
|
||||
}
|
||||
|
||||
// Other
|
||||
protected final int getSize() {
|
||||
return impl.getSize();
|
||||
}
|
||||
|
||||
protected final int getIndex() {
|
||||
return impl.getIndex();
|
||||
}
|
||||
|
||||
protected int getRealIndex(int index) {
|
||||
// Used in indirections. Overridden by TypeCodeOutputStream.
|
||||
return index;
|
||||
}
|
||||
|
||||
protected final void setIndex(int value) {
|
||||
impl.setIndex(value);
|
||||
}
|
||||
|
||||
protected final ByteBuffer getByteBuffer() {
|
||||
return impl.getByteBuffer();
|
||||
}
|
||||
|
||||
protected final void setByteBuffer(ByteBuffer byteBuffer) {
|
||||
impl.setByteBuffer(byteBuffer);
|
||||
}
|
||||
|
||||
public final boolean isLittleEndian() {
|
||||
return impl.isLittleEndian();
|
||||
}
|
||||
|
||||
// XREVISIT - return to final if possible
|
||||
// REVISIT - was protected - need access from msgtypes test.
|
||||
public ByteBufferWithInfo getByteBufferWithInfo() {
|
||||
return impl.getByteBufferWithInfo();
|
||||
}
|
||||
|
||||
protected void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
|
||||
impl.setByteBufferWithInfo(bbwi);
|
||||
}
|
||||
|
||||
// REVISIT: was protected - but need to access from xgiop.
|
||||
public final BufferManagerWrite getBufferManager() {
|
||||
return impl.getBufferManager();
|
||||
}
|
||||
|
||||
public final void write_fixed(java.math.BigDecimal bigDecimal, short digits, short scale) {
|
||||
impl.write_fixed(bigDecimal, digits, scale);
|
||||
}
|
||||
|
||||
public final void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s) {
|
||||
impl.writeOctetSequenceTo(s);
|
||||
}
|
||||
|
||||
public final GIOPVersion getGIOPVersion() {
|
||||
return impl.getGIOPVersion();
|
||||
}
|
||||
|
||||
public final void writeIndirection(int tag, int posIndirectedTo) {
|
||||
impl.writeIndirection(tag, posIndirectedTo);
|
||||
}
|
||||
|
||||
// Use Latin-1 for GIOP 1.0 or when code set negotiation was not
|
||||
// performed.
|
||||
protected CodeSetConversion.CTBConverter createCharCTBConverter() {
|
||||
return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.ISO_8859_1);
|
||||
}
|
||||
|
||||
// Subclasses must decide what to do here. It's inconvenient to
|
||||
// make the class and this method abstract because of dup().
|
||||
protected abstract CodeSetConversion.CTBConverter createWCharCTBConverter();
|
||||
|
||||
protected final void freeInternalCaches() {
|
||||
impl.freeInternalCaches();
|
||||
}
|
||||
|
||||
void printBuffer() {
|
||||
impl.printBuffer();
|
||||
}
|
||||
|
||||
public void alignOnBoundary(int octetBoundary) {
|
||||
impl.alignOnBoundary(octetBoundary);
|
||||
}
|
||||
|
||||
// Needed by request and reply messages for GIOP versions >= 1.2 only.
|
||||
public void setHeaderPadding(boolean headerPadding) {
|
||||
impl.setHeaderPadding(headerPadding);
|
||||
}
|
||||
|
||||
// ValueOutputStream -----------------------------
|
||||
|
||||
public void start_value(String rep_id) {
|
||||
impl.start_value(rep_id);
|
||||
}
|
||||
|
||||
public void end_value() {
|
||||
impl.end_value();
|
||||
}
|
||||
}
|
||||
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.interceptors;
|
||||
|
||||
import com.sun.corba.se.impl.corba.AnyImpl;
|
||||
import org.omg.PortableInterceptor.Current;
|
||||
import org.omg.PortableInterceptor.InvalidSlot;
|
||||
|
||||
import com.sun.corba.se.impl.util.MinorCodes;
|
||||
import com.sun.corba.se.impl.core.ORB;
|
||||
|
||||
/**
|
||||
* ThreadCurrentStack is the container of PICurrent instances for each thread
|
||||
*/
|
||||
public class ThreadCurrentStack
|
||||
{
|
||||
// PICurrentPool is the container for reusable PICurrents
|
||||
private class PICurrentPool {
|
||||
|
||||
// Contains a list of reusable PICurrents
|
||||
private java.util.ArrayList pool;
|
||||
|
||||
// High water mark for the pool
|
||||
// If the pool size reaches this limit then putPICurrent will
|
||||
// not put PICurrent to the pool.
|
||||
private static final int HIGH_WATER_MARK = 5;
|
||||
|
||||
// currentIndex points to the last PICurrent in the list
|
||||
private int currentIndex;
|
||||
|
||||
PICurrentPool( ) {
|
||||
pool = new java.util.ArrayList( HIGH_WATER_MARK );
|
||||
currentIndex = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts PICurrent to the re-usable pool.
|
||||
*/
|
||||
void putPICurrent( PICurrent current ) {
|
||||
// If there are enough PICurrents in the pool, then don't add
|
||||
// this current to the pool.
|
||||
if( currentIndex >= HIGH_WATER_MARK ) {
|
||||
return;
|
||||
}
|
||||
pool.add(currentIndex , current);
|
||||
currentIndex++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets PICurrent from the re-usable pool.
|
||||
*/
|
||||
PICurrent getPICurrent( ) {
|
||||
// If there are no entries in the pool then return null
|
||||
if( currentIndex == 0 ) {
|
||||
return null;
|
||||
}
|
||||
// Works like a stack, Gets the last one added first
|
||||
currentIndex--;
|
||||
return (PICurrent) pool.get(currentIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// Contains all the active PICurrents for each thread.
|
||||
// The ArrayList is made to behave like a stack.
|
||||
private java.util.ArrayList currentContainer;
|
||||
|
||||
// Keeps track of number of PICurrents in the stack.
|
||||
private int currentIndex;
|
||||
|
||||
// For Every Thread there will be a pool of re-usable ThreadCurrent's
|
||||
// stored in PICurrentPool
|
||||
private PICurrentPool currentPool;
|
||||
|
||||
// The orb associated with this ThreadCurrentStack
|
||||
private ORB piOrb;
|
||||
|
||||
/**
|
||||
* Constructs the stack and and PICurrentPool
|
||||
*/
|
||||
ThreadCurrentStack( ORB piOrb, PICurrent current ) {
|
||||
this.piOrb = piOrb;
|
||||
currentIndex = 0;
|
||||
currentContainer = new java.util.ArrayList( );
|
||||
currentPool = new PICurrentPool( );
|
||||
currentContainer.add( currentIndex, current );
|
||||
currentIndex++;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pushPICurrent goes through the following steps
|
||||
* 1: Checks to see if there is any PICurrent in PICurrentPool
|
||||
* If present then use that instance to push into the ThreadCurrentStack
|
||||
*
|
||||
* 2:If there is no PICurrent in the pool, then creates a new one and pushes
|
||||
* that into the ThreadCurrentStack
|
||||
*/
|
||||
void pushPICurrent( ) {
|
||||
PICurrent current = currentPool.getPICurrent( );
|
||||
if( current == null ) {
|
||||
// get an existing PICurrent to get the slotSize
|
||||
PICurrent currentTemp = peekPICurrent();
|
||||
current = new PICurrent( piOrb, currentTemp.getSlotSize( ));
|
||||
}
|
||||
currentContainer.add( currentIndex, current );
|
||||
currentIndex++;
|
||||
}
|
||||
|
||||
/**
|
||||
* popPICurrent does the following
|
||||
* 1: pops the top PICurrent in the ThreadCurrentStack
|
||||
*
|
||||
* 2: resets the slots in the PICurrent which resets the slotvalues to
|
||||
* null if there are any previous sets.
|
||||
*
|
||||
* 3: pushes the reset PICurrent into the PICurrentPool to reuse
|
||||
*/
|
||||
void popPICurrent( ) {
|
||||
// Do not pop the PICurrent, If there is only one.
|
||||
// This should not happen, But an extra check for safety.
|
||||
if( currentIndex <= 1 ) {
|
||||
throw new org.omg.CORBA.INTERNAL(
|
||||
"Cannot pop the only PICurrent in the stack",
|
||||
MinorCodes.CANT_POP_ONLY_CURRENT_2,
|
||||
CompletionStatus.COMPLETED_NO );
|
||||
}
|
||||
currentIndex--;
|
||||
PICurrent current = (PICurrent)currentContainer.get( currentIndex );
|
||||
current.resetSlots( );
|
||||
currentPool.putPICurrent( current );
|
||||
}
|
||||
|
||||
/**
|
||||
* peekPICurrent gets the top PICurrent in the ThreadCurrentStack without
|
||||
* popping.
|
||||
*/
|
||||
PICurrent peekPICurrent( ) {
|
||||
return (PICurrent) currentContainer.get( currentIndex - 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orbutil ;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
/** This class provides just a main method. Its purpose is to allow -D arguments to
|
||||
* set up the system properties when starting programs with tools like OptimizeIt that
|
||||
* make this difficult or impossible.
|
||||
*
|
||||
* Invocation: {java launcher of some kind} DefineClass -Dxxx=yyy -Dxxx=yyy ... {class name} arg0, arg1, ...
|
||||
* Result: updates system properties with -D args, then uses reflection to invoke {class name}.main with the args
|
||||
*/
|
||||
|
||||
class DefineWrapper {
|
||||
public static void main( String[] args )
|
||||
{
|
||||
int numberDefines = args.length ;
|
||||
String className = null ;
|
||||
|
||||
for (int ctr=0; ctr<args.length; ctr++ ) {
|
||||
String arg = args[ctr] ;
|
||||
|
||||
if ((arg.charAt(0) == '-') && (arg.charAt(1) == 'D')) {
|
||||
int eqIndex = arg.indexOf( '=' ) ;
|
||||
if (eqIndex < 0)
|
||||
throw new Exception( arg + " is not a valid property assignment" ) ;
|
||||
|
||||
final String key = arg.subString( 2, eqIndex ) ;
|
||||
final String value = arg.subStrung( eqIndex + 1 ) ;
|
||||
|
||||
AccessController.doPrivileged( new PrivilegedAction() {
|
||||
public Object run() {
|
||||
System.setProperty( key, value ) ;
|
||||
return null ;
|
||||
}
|
||||
} ) ;
|
||||
} else {
|
||||
numberDefines = ctr ;
|
||||
className = arg ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
if (numberDefines < args.length) {
|
||||
Class cls = getMainClass( className ) ;
|
||||
Method mainMethod = getMainMethod( cls ) ;
|
||||
|
||||
String[] newArgs = new String[ args.length - numberDefines ] ;
|
||||
for (int ctr = numberDefines+1; ctr<args.length; ctr++ ) {
|
||||
newArgs[ ctr-numberDefines-1 ] = args[ ctr ] ;
|
||||
}
|
||||
|
||||
// build args to the main and call it
|
||||
Object params [] = new Object [1];
|
||||
params[0] = newArgs;
|
||||
mainMethod.invoke(null, params);
|
||||
} else {
|
||||
throw new Exception( "No class name given" ) ;
|
||||
}
|
||||
}
|
||||
|
||||
private static Class getMainClass( String name )
|
||||
{
|
||||
// determine the class loader to be used for loading the class
|
||||
// since ServerMain is going to be in JDK and we need to have this
|
||||
// class to load application classes, this is required here.
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
if (cl == null)
|
||||
cl = ClassLoader.getSystemClassLoader();
|
||||
|
||||
try {
|
||||
// determine the main class, try loading with current class loader
|
||||
cls = Class.forName( className ) ;
|
||||
} catch (ClassNotFoundException ex) {
|
||||
// eat the exception and try to load using SystemClassLoader
|
||||
cls = Class.forName( className, true, cl);
|
||||
}
|
||||
}
|
||||
|
||||
private static Method getMainMethod( Class serverClass )
|
||||
{
|
||||
Class argTypes[] = new Class[] { String[].class } ;
|
||||
Method method = null ;
|
||||
|
||||
try {
|
||||
method = serverClass.getDeclaredMethod( "main", argTypes ) ;
|
||||
} catch (Exception exc) {
|
||||
throw new Exception( "Could not get main() method: " + exc ) ;
|
||||
}
|
||||
|
||||
if (!isPublicStaticVoid( method ))
|
||||
throw new Exception( "Main method is not public static void" ) ;
|
||||
|
||||
return method ;
|
||||
}
|
||||
|
||||
private static boolean isPublicStaticVoid( Method method )
|
||||
{
|
||||
// check modifiers: public static
|
||||
int modifiers = method.getModifiers ();
|
||||
if (!Modifier.isPublic (modifiers) || !Modifier.isStatic (modifiers)) {
|
||||
logError( method.getName() + " is not public static" ) ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// check return type and exceptions
|
||||
if (method.getExceptionTypes ().length != 0) {
|
||||
logError( method.getName() + " declares exceptions" ) ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
if (!method.getReturnType().equals (Void.TYPE)) {
|
||||
logError( method.getName() + " does not have a void return type" ) ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
@@ -1,909 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.presentation.rmi ;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.HashMap;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator ;
|
||||
|
||||
import com.sun.corba.se.impl.presentation.rmi.IDLType ;
|
||||
import com.sun.corba.se.impl.presentation.rmi.IDLTypeException ;
|
||||
import com.sun.corba.se.impl.presentation.rmi.IDLTypesUtil ;
|
||||
import com.sun.corba.se.impl.orbutil.ObjectUtility ;
|
||||
|
||||
/**
|
||||
* Bidirectional translator between RMI-IIOP interface methods and
|
||||
* and IDL Names.
|
||||
*/
|
||||
public class IDLNameTranslatorImpl implements IDLNameTranslator {
|
||||
|
||||
// From CORBA Spec, Table 6 Keywords.
|
||||
// Note that since all IDL identifiers are case
|
||||
// insensitive, java identifier comparisons to these
|
||||
// will be case insensitive also.
|
||||
private static String[] IDL_KEYWORDS = {
|
||||
|
||||
"abstract", "any", "attribute", "boolean", "case", "char",
|
||||
"const", "context", "custom", "default", "double", "enum",
|
||||
"exception", "factory", "FALSE", "fixed", "float", "in", "inout",
|
||||
"interface", "long", "module", "native", "Object", "octet",
|
||||
"oneway", "out", "private", "public", "raises", "readonly", "sequence",
|
||||
"short", "string", "struct", "supports", "switch", "TRUE", "truncatable",
|
||||
"typedef", "unsigned", "union", "ValueBase", "valuetype", "void",
|
||||
"wchar", "wstring"
|
||||
|
||||
};
|
||||
|
||||
private static char[] HEX_DIGITS = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'A', 'B', 'C', 'D', 'E', 'F'
|
||||
};
|
||||
|
||||
private static final String UNDERSCORE = "_";
|
||||
|
||||
// used to mangle java inner class names
|
||||
private static final String INNER_CLASS_SEPARATOR =
|
||||
UNDERSCORE + UNDERSCORE;
|
||||
|
||||
// used to form IDL array type names
|
||||
private static final String[] BASE_IDL_ARRAY_MODULE_TYPE=
|
||||
new String[] { "org", "omg", "boxedRMI" } ;
|
||||
|
||||
private static final String BASE_IDL_ARRAY_ELEMENT_TYPE = "seq";
|
||||
|
||||
// used to mangling java identifiers that have a leading underscore
|
||||
private static final String LEADING_UNDERSCORE_CHAR = "J";
|
||||
private static final String ID_CONTAINER_CLASH_CHAR = UNDERSCORE;
|
||||
|
||||
// separator used between types in a mangled overloaded method name
|
||||
private static final String OVERLOADED_TYPE_SEPARATOR =
|
||||
UNDERSCORE + UNDERSCORE;
|
||||
|
||||
// string appended to attribute if it clashes with a method name
|
||||
private static final String ATTRIBUTE_METHOD_CLASH_MANGLE_CHARS =
|
||||
UNDERSCORE + UNDERSCORE;
|
||||
|
||||
private static Set idlKeywords_;
|
||||
|
||||
static {
|
||||
|
||||
idlKeywords_ = new HashSet();
|
||||
for(int i = 0; i < IDL_KEYWORDS.length; i++) {
|
||||
String next = (String) IDL_KEYWORDS[i];
|
||||
// Convert keyword to all caps to ease equality
|
||||
// check.
|
||||
String keywordAllCaps = next.toUpperCase();
|
||||
idlKeywords_.add(keywordAllCaps);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Instance state
|
||||
//
|
||||
|
||||
// Remote interface for name translation.
|
||||
private Class[] interf_;
|
||||
|
||||
// Maps used to hold name translations. These do not need to be
|
||||
// synchronized since the translation is never modified after
|
||||
// initialization.
|
||||
private Map methodToIDLNameMap_;
|
||||
private Map IDLNameToMethodMap_;
|
||||
private Method[] methods_;
|
||||
|
||||
/**
|
||||
* Return an IDLNameTranslator for the given interface.
|
||||
*
|
||||
* @throws IllegalStateException if given class is not a valid
|
||||
* RMI/IIOP Remote Interface
|
||||
*/
|
||||
public static IDLNameTranslator get( Class interf )
|
||||
{
|
||||
|
||||
return new IDLNameTranslatorImpl(new Class[] { interf } );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an IDLNameTranslator for the given interfacex.
|
||||
*
|
||||
* @throws IllegalStateException if given classes are not valid
|
||||
* RMI/IIOP Remote Interfaces
|
||||
*/
|
||||
public static IDLNameTranslator get( Class[] interfaces )
|
||||
{
|
||||
|
||||
return new IDLNameTranslatorImpl(interfaces );
|
||||
|
||||
}
|
||||
|
||||
public static String getExceptionId( Class cls )
|
||||
{
|
||||
// Requirements for this method:
|
||||
// 1. cls must be an exception but not a RemoteException.
|
||||
// 2. If cls has an IDL keyword name, an underscore is prepended (1.3.2.2).
|
||||
// 3. If cls jas a leading underscore, J is prepended (1.3.2.3).
|
||||
// 4. If cls has an illegal IDL ident char, it is mapped to UXXXX where
|
||||
// XXXX is the unicode value in hex of the char (1.3.2.4).
|
||||
// 5. double underscore for inner class (1.3.2.5).
|
||||
// 6. The ID is "IDL:" + name with / separators + ":1.0".
|
||||
IDLType itype = classToIDLType( cls ) ;
|
||||
return itype.getExceptionName() ;
|
||||
}
|
||||
|
||||
public Class[] getInterfaces()
|
||||
{
|
||||
return interf_;
|
||||
}
|
||||
|
||||
public Method[] getMethods()
|
||||
{
|
||||
return methods_ ;
|
||||
}
|
||||
|
||||
public Method getMethod( String idlName )
|
||||
{
|
||||
return (Method) IDLNameToMethodMap_.get(idlName);
|
||||
}
|
||||
|
||||
public String getIDLName( Method method )
|
||||
{
|
||||
return (String) methodToIDLNameMap_.get(method);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize an IDLNameTranslator for the given interface.
|
||||
*
|
||||
* @throws IllegalStateException if given class is not a valid
|
||||
* RMI/IIOP Remote Interface
|
||||
*/
|
||||
private IDLNameTranslatorImpl(Class[] interfaces)
|
||||
{
|
||||
|
||||
try {
|
||||
IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
|
||||
for (int ctr=0; ctr<interfaces.length; ctr++)
|
||||
idlTypesUtil.validateRemoteInterface(interfaces[ctr]);
|
||||
interf_ = interfaces;
|
||||
buildNameTranslation();
|
||||
} catch( IDLTypeException ite) {
|
||||
String msg = ite.getMessage();
|
||||
IllegalStateException ise = new IllegalStateException(msg);
|
||||
ise.initCause(ite);
|
||||
throw ise;
|
||||
}
|
||||
}
|
||||
|
||||
private void buildNameTranslation()
|
||||
{
|
||||
// holds method info, keyed by method
|
||||
Map allMethodInfo = new HashMap() ;
|
||||
|
||||
for (int ctr=0; ctr<interf_.length; ctr++) {
|
||||
Class interf = interf_[ctr] ;
|
||||
|
||||
IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
|
||||
Method[] methods = interf.getMethods();
|
||||
|
||||
// Take an initial pass through all the methods and create some
|
||||
// information that will be used to track the IDL name
|
||||
// transformation.
|
||||
for(int i = 0; i < methods.length; i++) {
|
||||
|
||||
Method nextMethod = methods[i];
|
||||
|
||||
IDLMethodInfo methodInfo = new IDLMethodInfo();
|
||||
|
||||
methodInfo.method = nextMethod;
|
||||
|
||||
methodInfo.propertyType =
|
||||
idlTypesUtil.propertyAccessorMethodType(
|
||||
nextMethod, interf ) ;
|
||||
|
||||
if (methodInfo.propertyType != null) {
|
||||
String attributeName = idlTypesUtil.
|
||||
getAttributeNameForProperty(nextMethod.getName());
|
||||
methodInfo.originalName = attributeName;
|
||||
methodInfo.mangledName = attributeName;
|
||||
} else {
|
||||
methodInfo.originalName = nextMethod.getName();
|
||||
methodInfo.mangledName = nextMethod.getName();
|
||||
}
|
||||
|
||||
allMethodInfo.put(nextMethod, methodInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// Check for having both is<NAME> and get<NAME> methods.
|
||||
|
||||
|
||||
//
|
||||
// Perform case sensitivity test first. This applies to all
|
||||
// method names AND attributes. Compare each method name and
|
||||
// attribute to all other method names and attributes. If names
|
||||
// differ only in case, apply mangling as defined in section 1.3.2.7
|
||||
// of Java2IDL spec. Note that we compare using the original names.
|
||||
//
|
||||
for(Iterator outerIter=allMethodInfo.values().iterator();
|
||||
outerIter.hasNext();) {
|
||||
IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
|
||||
for(Iterator innerIter = allMethodInfo.values().iterator();
|
||||
innerIter.hasNext();) {
|
||||
IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
|
||||
|
||||
if( (outer != inner) &&
|
||||
(!outer.originalName.equals(inner.originalName)) &&
|
||||
outer.originalName.equalsIgnoreCase(inner.originalName) ) {
|
||||
outer.mangledName =
|
||||
mangleCaseSensitiveCollision(outer.originalName);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for(Iterator iter = allMethodInfo.values().iterator();
|
||||
iter.hasNext();) {
|
||||
IDLMethodInfo next = (IDLMethodcurrentInfo) iter.next();
|
||||
next.mangledName =
|
||||
mangleIdentifier(next.mangledName,
|
||||
next.propertyType != null);
|
||||
}
|
||||
|
||||
//
|
||||
// Now check for overloaded method names and apply 1.3.2.6.
|
||||
//
|
||||
for(Iterator outerIter=allMethodInfo.values().iterator();
|
||||
outerIter.hasNext();) {
|
||||
IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
|
||||
if (outer.propertyType != null) {
|
||||
continue;
|
||||
}
|
||||
for(Iterator innerIter = allMethodInfo.values().iterator();
|
||||
innerIter.hasNext();) {
|
||||
IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
|
||||
|
||||
if( (outer != inner) &&
|
||||
(inner.propertyType == null) &&
|
||||
outer.originalName.equals(inner.originalName) ) {
|
||||
outer.mangledName = mangleOverloadedMethod
|
||||
(outer.mangledName, outer.method);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Now mangle any properties that clash with method names.
|
||||
//
|
||||
for(Iterator outerIter=allMethodInfo.values().iterator();
|
||||
outerIter.hasNext();) {
|
||||
IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
|
||||
if(outer.propertyType == null) {
|
||||
continue;
|
||||
}
|
||||
for(Iterator innerIter = allMethodInfo.values().iterator();
|
||||
innerIter.hasNext();) {
|
||||
IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
|
||||
if( (outer != inner) &&
|
||||
(inner.propertyType == null) &&
|
||||
outer.mangledName.equals(inner.mangledName) ) {
|
||||
outer.mangledName = outer.mangledName +
|
||||
ATTRIBUTE_METHOD_CLASH_MANGLE_CHARS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Ensure that no mapped method names clash with mapped name
|
||||
// of container(1.3.2.9). This is a case insensitive comparison.
|
||||
//
|
||||
for (int ctr=0; ctr<interf_.length; ctr++ ) {
|
||||
Class interf = interf_[ctr] ;
|
||||
String mappedContainerName = getMappedContainerName(interf);
|
||||
for(Iterator iter = allMethodInfo.values().iterator();
|
||||
iter.hasNext();) {
|
||||
IDLMethodInfo next = (IDLMethodInfo) iter.next();
|
||||
if( (next.propertyType == null) &&
|
||||
identifierClashesWithContainer(mappedContainerName,
|
||||
next.mangledName)) {
|
||||
next.mangledName = mangleContainerClash(next.mangledName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Populate name translation maps.
|
||||
//
|
||||
methodToIDLNameMap_ = new HashMap();
|
||||
IDLNameToMethodMap_ = new HashMap();
|
||||
methods_ = (Method[])allMethodInfo.keySet().toArray(
|
||||
new Method[0] ) ;
|
||||
|
||||
for(Iterator iter = allMethodInfo.values().iterator();
|
||||
iter.hasNext();) {
|
||||
IDLMethodInfo next = (IDLMethodInfo) iter.next();
|
||||
String idlName = next.mangledName;
|
||||
if (next.propertyType != null) {
|
||||
idlName = javaPropertyPrefixToIDL( next.propertyType ) +
|
||||
next.mangledName ;
|
||||
}
|
||||
|
||||
methodToIDLNameMap_.put(next.method, idlName);
|
||||
|
||||
// Final check to see if there are any clashes after all the
|
||||
// manglings have been applied. If so, this is treated as an
|
||||
// invalid interface. Currently, we do a CASE-SENSITIVE
|
||||
// comparison since that matches the rmic behavior.
|
||||
// @@@ Shouldn't this be a case-insensitive check?
|
||||
// If there is a collision between is<TYPE> and get<TYPE>,
|
||||
// map only is<TYPE> to an attribute, and leave the
|
||||
// get<TYPE> method alone.
|
||||
if( IDLNameToMethodMap_.containsKey(idlName) ) {
|
||||
// @@@ I18N
|
||||
Method clash = (Method) IDLNameToMethodMap_.get(idlName);
|
||||
MethodInfo clashMethodInfo =
|
||||
(MethodInfo)allMethodInfo.get( clash ) ;
|
||||
if (clashMethodInfo.isBooleanProperty() &&
|
||||
next.isReadProperty()) {
|
||||
// fix idlName
|
||||
} else if (clashMethodInfo.isReadProperty() &&
|
||||
next.isBooleanProperty()) {
|
||||
// Remove entry under idlName
|
||||
// put entry into table under correct name
|
||||
} else {
|
||||
throw new IllegalStateException("Error : methods " +
|
||||
clash + " and " + next.method +
|
||||
" both result in IDL name '" + idlName + "'");
|
||||
}
|
||||
}
|
||||
|
||||
IDLNameToMethodMap_.put(idlName, next.method);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform all necessary stand-alone identifier mangling operations
|
||||
* on a java identifier that is being transformed into an IDL name.
|
||||
* That is, mangling operations that don't require looking at anything
|
||||
* else but the identifier itself. This covers sections 1.3.2.2, 1.3.2.3,
|
||||
* and 1.3.2.4 of the Java2IDL spec. Method overloading and
|
||||
* case-sensitivity checks are handled elsewhere.
|
||||
*/
|
||||
|
||||
private static String mangleIdentifier(String identifier) {
|
||||
return mangleIdentifier(identifier, false);
|
||||
}
|
||||
|
||||
private static String mangleIdentifier(String identifier, boolean attribute) {
|
||||
|
||||
String mangledName = identifier;
|
||||
|
||||
//
|
||||
// Apply leading underscore test (1.3.2.3)
|
||||
// This should be done before IDL Keyword clash test, since clashing
|
||||
// IDL keywords are mangled by adding a leading underscore.
|
||||
//
|
||||
if( hasLeadingUnderscore(mangledName) ) {
|
||||
mangledName = mangleLeadingUnderscore(mangledName);
|
||||
}
|
||||
|
||||
//
|
||||
// Apply IDL keyword clash test (1.3.2.2).
|
||||
// This is not needed for attributes since when the full property
|
||||
// name is composed it cannot clash with an IDL keyword.
|
||||
// (Also, rmic doesn't do it.)
|
||||
//
|
||||
|
||||
if( !attribute && isIDLKeyword(mangledName) ) {
|
||||
mangledName = mangleIDLKeywordClash(mangledName);
|
||||
}
|
||||
|
||||
//
|
||||
// Replace illegal IDL identifier characters (1.3.2.4)
|
||||
// for all method names and attributes.
|
||||
//
|
||||
if( !isIDLIdentifier(mangledName) ) {
|
||||
mangledName = mangleUnicodeChars(mangledName);
|
||||
}
|
||||
|
||||
return mangledName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a java identifier clashes with an
|
||||
* IDL keyword. Note that this is a case-insensitive
|
||||
* comparison.
|
||||
*
|
||||
* Used to implement section 1.3.2.2 of Java2IDL spec.
|
||||
*/
|
||||
private static boolean isIDLKeyword(String identifier) {
|
||||
|
||||
String identifierAllCaps = identifier.toUpperCase();
|
||||
|
||||
return idlKeywords_.contains(identifierAllCaps);
|
||||
}
|
||||
|
||||
private static String mangleIDLKeywordClash(String identifier) {
|
||||
return UNDERSCORE + identifier;
|
||||
}
|
||||
|
||||
private static String mangleLeadingUnderscore(String identifier) {
|
||||
return LEADING_UNDERSCORE_CHAR + identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a java identifier starts with an underscore.
|
||||
* Used to implement section 1.3.2.3 of Java2IDL spec.
|
||||
*/
|
||||
private static boolean hasLeadingUnderscore(String identifier) {
|
||||
return identifier.startsWith(UNDERSCORE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Section 1.3.2.4 of Java2IDL Mapping.
|
||||
* All non-IDL identifier characters must be replaced
|
||||
* with their Unicode representation.
|
||||
*/
|
||||
static String mangleUnicodeChars(String identifier) {
|
||||
StringBuffer mangledIdentifier = new StringBuffer();
|
||||
|
||||
for(int i = 0; i < identifier.length(); i++) {
|
||||
char nextChar = identifier.charAt(i);
|
||||
if( isIDLIdentifierChar(nextChar) ) {
|
||||
mangledIdentifier.append(nextChar);
|
||||
} else {
|
||||
String unicode = charToUnicodeRepresentation(nextChar);
|
||||
mangledIdentifier.append(unicode);
|
||||
}
|
||||
}
|
||||
|
||||
return mangledIdentifier.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements mangling portion of Section 1.3.2.7 of Java2IDL spec.
|
||||
* This method only deals with the actual mangling. Decision about
|
||||
* whether case-sensitive collision mangling is required is made
|
||||
* elsewhere.
|
||||
*
|
||||
*
|
||||
* "...a mangled name is generated consisting of the original name
|
||||
* followed by an underscore separated list of decimal indices
|
||||
* into the string, where the indices identify all the upper case
|
||||
* characters in the original string. Indices are zero based."
|
||||
*
|
||||
*/
|
||||
String mangleCaseSensitiveCollision(String identifier) {
|
||||
|
||||
StringBuffer mangledIdentifier = new StringBuffer(identifier);
|
||||
|
||||
// There is always at least one trailing underscore, whether or
|
||||
// not the identifier has uppercase letters.
|
||||
mangledIdentifier.append(UNDERSCORE);
|
||||
|
||||
boolean needUnderscore = false;
|
||||
for(int i = 0; i < identifier.length(); i++) {
|
||||
char next = identifier.charAt(i);
|
||||
if( Character.isUpperCase(next) ) {
|
||||
// This bit of logic is needed to ensure that we have
|
||||
// an underscore separated list of indices but no
|
||||
// trailing underscores. Basically, after we have at least
|
||||
// one uppercase letter, we always put an undercore before
|
||||
// printing the next one.
|
||||
if( needUnderscore ) {
|
||||
mangledIdentifier.append(UNDERSCORE);
|
||||
}
|
||||
mangledIdentifier.append(i);
|
||||
needUnderscore = true;
|
||||
}
|
||||
}
|
||||
|
||||
return mangledIdentifier.toString();
|
||||
}
|
||||
|
||||
private static String mangleContainerClash(String identifier) {
|
||||
return identifier + ID_CONTAINER_CLASH_CHAR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Section 1.3.2.9 of Java2IDL Mapping. Container in this
|
||||
* context means the name of the java Class(excluding package) in which
|
||||
* the identifier is defined. Comparison is case-insensitive.
|
||||
*/
|
||||
private static boolean identifierClashesWithContainer
|
||||
(String mappedContainerName, String identifier) {
|
||||
|
||||
return identifier.equalsIgnoreCase(mappedContainerName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Unicode mangling as defined in Section 1.3.2.4 of
|
||||
* Java2IDL spec.
|
||||
*
|
||||
* "For Java identifiers that contain illegal OMG IDL identifier
|
||||
* characters such as '$' or Unicode characters outside of ISO Latin 1,
|
||||
* any such illegal characters are replaced by "U" followed by the
|
||||
* 4 hexadecimal characters(in upper case) representing the Unicode
|
||||
* value. So, the Java name a$b is mapped to aU0024b and
|
||||
* x\u03bCy is mapped to xU03BCy."
|
||||
*/
|
||||
public static String charToUnicodeRepresentation(char c) {
|
||||
|
||||
int orig = (int) c;
|
||||
StringBuffer hexString = new StringBuffer();
|
||||
|
||||
int value = orig;
|
||||
|
||||
while( value > 0 ) {
|
||||
int div = value / 16;
|
||||
int mod = value % 16;
|
||||
hexString.insert(0, HEX_DIGITS[mod]);
|
||||
value = div;
|
||||
}
|
||||
|
||||
int numZerosToAdd = 4 - hexString.length();
|
||||
for(int i = 0; i < numZerosToAdd; i++) {
|
||||
hexString.insert(0, "0");
|
||||
}
|
||||
|
||||
hexString.insert(0, "U");
|
||||
return hexString.toString();
|
||||
}
|
||||
|
||||
private static boolean isIDLIdentifier(String identifier) {
|
||||
|
||||
boolean isIdentifier = true;
|
||||
|
||||
for(int i = 0; i < identifier.length(); i++) {
|
||||
char nextChar = identifier.charAt(i);
|
||||
// 1st char must be alphbetic.
|
||||
isIdentifier = (i == 0) ?
|
||||
isIDLAlphabeticChar(nextChar) :
|
||||
isIDLIdentifierChar(nextChar);
|
||||
if( !isIdentifier ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return isIdentifier;
|
||||
|
||||
}
|
||||
|
||||
private static boolean isIDLIdentifierChar(char c) {
|
||||
return (isIDLAlphabeticChar(c) ||
|
||||
isIDLDecimalDigit(c) ||
|
||||
isUnderscore(c));
|
||||
}
|
||||
|
||||
/**
|
||||
* True if character is one of 114 Alphabetic characters as
|
||||
* specified in Table 2 of Chapter 3 in CORBA spec.
|
||||
*/
|
||||
private static boolean isIDLAlphabeticChar(char c) {
|
||||
|
||||
// NOTE that we can't use the java.lang.Character
|
||||
// isUpperCase, isLowerCase, etc. methods since they
|
||||
// include many characters other than the Alphabetic list in
|
||||
// the CORBA spec. Instead, we test for inclusion in the
|
||||
// Unicode value ranges for the corresponding legal characters.
|
||||
|
||||
boolean alphaChar =
|
||||
(
|
||||
// A - Z
|
||||
((c >= 0x0041) && (c <= 0x005A))
|
||||
|
||||
||
|
||||
|
||||
// a - z
|
||||
((c >= 0x0061) && (c <= 0x007A))
|
||||
|
||||
||
|
||||
|
||||
// other letter uppercase, other letter lowercase, which is
|
||||
// the entire upper half of C1 Controls except X and /
|
||||
((c >= 0x00C0) && (c <= 0x00FF)
|
||||
&& (c != 0x00D7) && (c != 0x00F7)));
|
||||
|
||||
return alphaChar;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if character is one of 10 Decimal Digits
|
||||
* specified in Table 3 of Chapter 3 in CORBA spec.
|
||||
*/
|
||||
private static boolean isIDLDecimalDigit(char c) {
|
||||
return ( (c >= 0x0030) && (c <= 0x0039) );
|
||||
}
|
||||
|
||||
private static boolean isUnderscore(char c) {
|
||||
return ( c == 0x005F );
|
||||
}
|
||||
|
||||
/**
|
||||
* Mangle an overloaded method name as defined in Section 1.3.2.6 of
|
||||
* Java2IDL spec. Current value of method name is passed in as argument.
|
||||
* We can't start from original method name since the name might have
|
||||
* been partially mangled as a result of the other rules.
|
||||
*/
|
||||
private static String mangleOverloadedMethod(String mangledName, Method m) {
|
||||
|
||||
IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
|
||||
|
||||
// Start by appending the separator string
|
||||
String newMangledName = mangledName + OVERLOADED_TYPE_SEPARATOR;
|
||||
|
||||
Class[] parameterTypes = m.getParameterTypes();
|
||||
|
||||
for(int i = 0; i < parameterTypes.length; i++) {
|
||||
Class nextParamType = parameterTypes[i];
|
||||
|
||||
if( i > 0 ) {
|
||||
newMangledName = newMangledName + OVERLOADED_TYPE_SEPARATOR;
|
||||
}
|
||||
IDLType idlType = classToIDLType(nextParamType);
|
||||
|
||||
String moduleName = idlType.getModuleName();
|
||||
String memberName = idlType.getMemberName();
|
||||
|
||||
String typeName = (moduleName.length() > 0) ?
|
||||
moduleName + UNDERSCORE + memberName : memberName;
|
||||
|
||||
if( !idlTypesUtil.isPrimitive(nextParamType) &&
|
||||
(idlTypesUtil.getSpecialCaseIDLTypeMapping(nextParamType)
|
||||
== null) &&
|
||||
isIDLKeyword(typeName) ) {
|
||||
typeName = mangleIDLKeywordClash(typeName);
|
||||
}
|
||||
|
||||
typeName = mangleUnicodeChars(typeName);
|
||||
|
||||
newMangledName = newMangledName + typeName;
|
||||
}
|
||||
|
||||
return newMangledName;
|
||||
}
|
||||
|
||||
|
||||
private static IDLType classToIDLType(Class c) {
|
||||
|
||||
IDLType idlType = null;
|
||||
IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
|
||||
|
||||
if( idlTypesUtil.isPrimitive(c) ) {
|
||||
|
||||
idlType = idlTypesUtil.getPrimitiveIDLTypeMapping(c);
|
||||
|
||||
} else if( c.isArray() ) {
|
||||
|
||||
// Calculate array depth, as well as base element type.
|
||||
Class componentType = c.getComponentType();
|
||||
int numArrayDimensions = 1;
|
||||
while(componentType.isArray()) {
|
||||
componentType = componentType.getComponentType();
|
||||
numArrayDimensions++;
|
||||
}
|
||||
IDLType componentIdlType = classToIDLType(componentType);
|
||||
|
||||
String[] modules = BASE_IDL_ARRAY_MODULE_TYPE;
|
||||
if( componentIdlType.hasModule() ) {
|
||||
modules = (String[])ObjectUtility.concatenateArrays( modules,
|
||||
componentIdlType.getModules() ) ;
|
||||
}
|
||||
|
||||
String memberName = BASE_IDL_ARRAY_ELEMENT_TYPE +
|
||||
numArrayDimensions + UNDERSCORE +
|
||||
componentIdlType.getMemberName();
|
||||
|
||||
idlType = new IDLType(c, modules, memberName);
|
||||
|
||||
} else {
|
||||
idlType = idlTypesUtil.getSpecialCaseIDLTypeMapping(c);
|
||||
|
||||
if (idlType == null) {
|
||||
// Section 1.3.2.5 of Java2IDL spec defines mangling rules for
|
||||
// inner classes.
|
||||
String memberName = getUnmappedContainerName(c);
|
||||
|
||||
// replace inner class separator with double underscore
|
||||
memberName = memberName.replaceAll("\\$",
|
||||
INNER_CLASS_SEPARATOR);
|
||||
|
||||
if( hasLeadingUnderscore(memberName) ) {
|
||||
memberName = mangleLeadingUnderscore(memberName);
|
||||
}
|
||||
|
||||
// Get raw package name. If there is a package, it
|
||||
// will still have the "." separators and none of the
|
||||
// mangling rules will have been applied.
|
||||
String packageName = getPackageName(c);
|
||||
|
||||
if (packageName == null) {
|
||||
idlType = new IDLType( c, memberName ) ;
|
||||
} else {
|
||||
// If this is a generated IDL Entity Type we need to
|
||||
// prepend org_omg_boxedIDL per sections 1.3.5 and 1.3.9
|
||||
if (idlTypesUtil.isEntity(c)) {
|
||||
packageName = "org.omg.boxedIDL." + packageName ;
|
||||
}
|
||||
|
||||
// Section 1.3.2.1 and 1.3.2.6 of Java2IDL spec defines
|
||||
// rules for mapping java packages to IDL modules and for
|
||||
// mangling module name portion of type name. NOTE that
|
||||
// of the individual identifier mangling rules,
|
||||
// only the leading underscore test is done here.
|
||||
// The other two(IDL Keyword, Illegal Unicode chars) are
|
||||
// done in mangleOverloadedMethodName.
|
||||
StringTokenizer tokenizer =
|
||||
new StringTokenizer(packageName, ".");
|
||||
|
||||
String[] modules = new String[ tokenizer.countTokens() ] ;
|
||||
int index = 0 ;
|
||||
while (tokenizer.hasMoreElements()) {
|
||||
String next = tokenizer.nextToken();
|
||||
String nextMangled = hasLeadingUnderscore(next) ?
|
||||
mangleLeadingUnderscore(next) : next;
|
||||
|
||||
modules[index++] = nextMangled ;
|
||||
}
|
||||
|
||||
idlType = new IDLType(c, modules, memberName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return idlType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Class' package name or null if there is no package.
|
||||
*/
|
||||
private static String getPackageName(Class c) {
|
||||
Package thePackage = c.getPackage();
|
||||
String packageName = null;
|
||||
|
||||
// Try to get package name by introspection. Some classloaders might
|
||||
// not provide this information, so check for null.
|
||||
if( thePackage != null ) {
|
||||
packageName = thePackage.getName();
|
||||
} else {
|
||||
// brute force method
|
||||
String fullyQualifiedClassName = c.getName();
|
||||
int lastDot = fullyQualifiedClassName.indexOf('.');
|
||||
packageName = (lastDot == -1) ? null :
|
||||
fullyQualifiedClassName.substring(0, lastDot);
|
||||
}
|
||||
return packageName;
|
||||
}
|
||||
|
||||
private static String getMappedContainerName(Class c) {
|
||||
String unmappedName = getUnmappedContainerName(c);
|
||||
|
||||
return mangleIdentifier(unmappedName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return portion of class name excluding package name.
|
||||
*/
|
||||
private static String getUnmappedContainerName(Class c) {
|
||||
|
||||
String memberName = null;
|
||||
String packageName = getPackageName(c);
|
||||
|
||||
String fullyQualifiedClassName = c.getName();
|
||||
|
||||
if( packageName != null ) {
|
||||
int packageLength = packageName.length();
|
||||
memberName = fullyQualifiedClassName.substring(packageLength + 1);
|
||||
} else {
|
||||
memberName = fullyQualifiedClassName;
|
||||
|
||||
}
|
||||
|
||||
return memberName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal helper class for tracking information related to each
|
||||
* interface method while we're building the name translation table.
|
||||
*/
|
||||
private static class IDLMethodInfo
|
||||
{
|
||||
public Method method;
|
||||
public String propertyType;
|
||||
|
||||
// If this is a property, originalName holds the original
|
||||
// attribute name. Otherwise, it holds the original method name.
|
||||
public String originalName;
|
||||
|
||||
// If this is a property, mangledName holds the mangled attribute
|
||||
// name. Otherwise, it holds the mangled method name.
|
||||
public String mangledName;
|
||||
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
StringBuffer contents = new StringBuffer();
|
||||
contents.append("IDLNameTranslator[" );
|
||||
for( int ctr=0; ctr<interf_.length; ctr++) {
|
||||
if (ctr != 0)
|
||||
contents.append( " " ) ;
|
||||
contents.append( interf_[ctr].getName() ) ;
|
||||
}
|
||||
contents.append("]\n");
|
||||
for(Iterator iter = methodToIDLNameMap_.keySet().iterator();
|
||||
iter.hasNext();) {
|
||||
|
||||
Method method = (Method) iter.next();
|
||||
String idlName = (String) methodToIDLNameMap_.get(method);
|
||||
|
||||
contents.append(idlName + ":" + method + "\n");
|
||||
|
||||
}
|
||||
|
||||
return contents.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Class remoteInterface = java.rmi.Remote.class;
|
||||
|
||||
if( args.length > 0 ) {
|
||||
String className = args[0];
|
||||
try {
|
||||
remoteInterface = Class.forName(className);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Building name translation for " + remoteInterface);
|
||||
try {
|
||||
IDLNameTranslator nameTranslator =
|
||||
IDLNameTranslatorImpl.get(remoteInterface);
|
||||
System.out.println(nameTranslator);
|
||||
} catch(IllegalStateException ise) {
|
||||
ise.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,544 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.presentation.rmi ;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* Utility class for testing RMI/IDL Types as defined in
|
||||
* Section 1.2 of The Java Language to IDL Mapping. Note that
|
||||
* these are static checks only. Runtime checks, such as those
|
||||
* described in Section 1.2.3, #3, are not covered.
|
||||
*/
|
||||
public class IDLTypesUtil {
|
||||
|
||||
public static final String JAVA_GET_PROPERTY_PREFIX = "get";
|
||||
public static final String JAVA_SET_PROPERTY_PREFIX = "set";
|
||||
public static final String JAVA_IS_PROPERTY_PREFIX = "is";
|
||||
|
||||
public static final int VALID_TYPE = 0;
|
||||
public static final int INVALID_TYPE = 1;
|
||||
|
||||
/**
|
||||
* Validate a class to ensure it conforms to the rules for a
|
||||
* Java RMI/IIOP interface.
|
||||
*
|
||||
* @throws IDLTypeException if not a valid RMI/IIOP interface.
|
||||
*/
|
||||
public void validateRemoteInterface(Class c) throws IDLTypeException
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
if( !c.isInterface() ) {
|
||||
String msg = "Class " + c + " must be a java interface.";
|
||||
throw new IDLTypeException(msg);
|
||||
}
|
||||
|
||||
if( !java.rmi.Remote.class.isAssignableFrom(c) ) {
|
||||
String msg = "Class " + c + " must extend java.rmi.Remote, " +
|
||||
"either directly or indirectly.";
|
||||
throw new IDLTypeException(msg);
|
||||
}
|
||||
|
||||
// Get all methods, including super-interface methods.
|
||||
Method[] methods = c.getMethods();
|
||||
|
||||
for(int i = 0; i < methods.length; i++) {
|
||||
Method next = methods[i];
|
||||
validateExceptions(next);
|
||||
}
|
||||
|
||||
// Removed because of bug 4989053
|
||||
// validateDirectInterfaces(c);
|
||||
validateConstants(c);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public boolean isRemoteInterface(Class c)
|
||||
{
|
||||
boolean remoteInterface = true;
|
||||
try {
|
||||
validateRemoteInterface(c);
|
||||
} catch(IDLTypeException ite) {
|
||||
remoteInterface = false;
|
||||
}
|
||||
|
||||
return remoteInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
* Section 1.2.2 Primitive Types
|
||||
*/
|
||||
public boolean isPrimitive(Class c)
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
return c.isPrimitive();
|
||||
}
|
||||
|
||||
/**
|
||||
* Section 1.2.4
|
||||
*/
|
||||
public boolean isValue(Class c)
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
return
|
||||
(!c.isInterface() &&
|
||||
java.io.Serializable.class.isAssignableFrom(c) &&
|
||||
!java.rmi.Remote.class.isAssignableFrom(c));
|
||||
}
|
||||
|
||||
/**
|
||||
* Section 1.2.5
|
||||
*/
|
||||
public boolean isArray(Class c)
|
||||
{
|
||||
boolean arrayType = false;
|
||||
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
if( c.isArray() ) {
|
||||
Class componentType = c.getComponentType();
|
||||
arrayType =
|
||||
(isPrimitive(componentType) || isRemoteInterface(componentType) ||
|
||||
isEntity(componentType) || isException(componentType) ||
|
||||
isValue(componentType) || isObjectReference(componentType) );
|
||||
}
|
||||
|
||||
return arrayType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Section 1.2.6
|
||||
*/
|
||||
public boolean isException(Class c)
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
// Must be a checked exception, not including RemoteException or
|
||||
// its subclasses.
|
||||
return isCheckedException(c) && !isRemoteException(c) && isValue(c);
|
||||
}
|
||||
|
||||
public boolean isRemoteException(Class c)
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
return java.rmi.RemoteException.class.isAssignableFrom(c) ;
|
||||
}
|
||||
|
||||
public boolean isCheckedException(Class c)
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
return Throwable.class.isAssignableFrom(c) &&
|
||||
!RuntimeException.class.isAssignableFrom(c) &&
|
||||
!Error.class.isAssignableFrom(c) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Section 1.2.7
|
||||
*/
|
||||
public boolean isObjectReference(Class c)
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
return (c.isInterface() &&
|
||||
org.omg.CORBA.Object.class.isAssignableFrom(c));
|
||||
}
|
||||
|
||||
/**
|
||||
* Section 1.2.8
|
||||
*/
|
||||
public boolean isEntity(Class c)
|
||||
{
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
Class superClass = c.getSuperclass();
|
||||
return (!c.isInterface() &&
|
||||
(superClass != null) &&
|
||||
(org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(c)));
|
||||
}
|
||||
|
||||
public String javaPropertyPrefixToIDL( String javaPrefix )
|
||||
{
|
||||
return "_" + javaPrefix + "_" ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the property type if given method is legal property accessor as defined in
|
||||
* Section 1.3.4.3 of Java2IDL spec. Result is one of: JAVA_GET_PROPERTY_PREFIX,
|
||||
* JAVA_SET_PROPERTY_PREFIX, JAVA_IS_PROPERTY_PREFIX.
|
||||
*/
|
||||
public String propertyAccessorMethodType(Method m, Class c) {
|
||||
|
||||
String methodName = m.getName();
|
||||
Class returnType = m.getReturnType();
|
||||
Class[] parameters = m.getParameterTypes();
|
||||
Class[] exceptionTypes = m.getExceptionTypes();
|
||||
String propertyType = null;
|
||||
|
||||
if( methodName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
|
||||
|
||||
if((parameters.length == 0) && (returnType != Void.TYPE) &&
|
||||
!hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX) {
|
||||
propertyType = JAVA_GET_PROPERTY_PREFIX;
|
||||
}
|
||||
|
||||
} else if( methodName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
|
||||
|
||||
if((returnType == Void.TYPE) && (parameters.length == 1)) {
|
||||
if (hasCorrespondingReadProperty(m, c, JAVA_GET_PROPERTY_PREFIX) ||
|
||||
hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX)) {
|
||||
propertyType = JAVA_SET_PROPERTY_PREFIX;
|
||||
}
|
||||
}
|
||||
|
||||
} else if( methodName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
|
||||
if((parameters.length == 0) && (returnType == Boolean.TYPE)) {
|
||||
propertyType = JAVA_IS_PROPERTY_PREFIX;
|
||||
}
|
||||
}
|
||||
|
||||
// Some final checks that apply to all properties.
|
||||
if( propertyType != null ) {
|
||||
if(!validPropertyExceptions(m) ||
|
||||
(methodName.length() <= propertyType.length())) {
|
||||
propertyType = null;
|
||||
}
|
||||
}
|
||||
|
||||
return propertyType ;
|
||||
}
|
||||
|
||||
private boolean hasCorrespondingReadProperty
|
||||
(Method writeProperty, Class c, String readPropertyPrefix) {
|
||||
|
||||
String writePropertyMethodName = writeProperty.getName();
|
||||
Class[] writePropertyParameters = writeProperty.getParameterTypes();
|
||||
boolean foundReadProperty = false;
|
||||
|
||||
try {
|
||||
// Look for a valid corresponding Read property
|
||||
String readPropertyMethodName =
|
||||
writePropertyMethodName.replaceFirst
|
||||
(JAVA_SET_PROPERTY_PREFIX, readPropertyPrefix);
|
||||
Method readPropertyMethod = c.getMethod(readPropertyMethodName,
|
||||
new Class[] {});
|
||||
foundReadProperty =
|
||||
((propertyAccessorMethodType(readPropertyMethod, c) != null) &&
|
||||
(readPropertyMethod.getReturnType() ==
|
||||
writePropertyParameters[0]));
|
||||
} catch(Exception e) {
|
||||
// ignore. this means we didn't find a corresponding get property.
|
||||
}
|
||||
|
||||
return foundReadProperty;
|
||||
}
|
||||
|
||||
public String getAttributeNameForProperty(String propertyName) {
|
||||
String attributeName = null;
|
||||
String prefix = null;
|
||||
|
||||
if( propertyName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
|
||||
prefix = JAVA_GET_PROPERTY_PREFIX;
|
||||
} else if( propertyName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
|
||||
prefix = JAVA_SET_PROPERTY_PREFIX;
|
||||
} else if( propertyName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
|
||||
prefix = JAVA_IS_PROPERTY_PREFIX;
|
||||
}
|
||||
|
||||
if( (prefix != null) && (prefix.length() < propertyName.length()) ) {
|
||||
String remainder = propertyName.substring(prefix.length());
|
||||
if( (remainder.length() >= 2) &&
|
||||
Character.isUpperCase(remainder.charAt(0)) &&
|
||||
Character.isUpperCase(remainder.charAt(1)) ) {
|
||||
// don't set the first letter to lower-case if the
|
||||
// first two are upper-case
|
||||
attributeName = remainder;
|
||||
} else {
|
||||
attributeName = Character.toLowerCase(remainder.charAt(0)) +
|
||||
remainder.substring(1);
|
||||
}
|
||||
}
|
||||
|
||||
return attributeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return IDL Type name for primitive types as defined in
|
||||
* Section 1.3.3 of Java2IDL spec or null if not a primitive type.
|
||||
*/
|
||||
public IDLType getPrimitiveIDLTypeMapping(Class c) {
|
||||
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
if( c.isPrimitive() ) {
|
||||
if( c == Void.TYPE ) {
|
||||
return new IDLType( c, "void" ) ;
|
||||
} else if( c == Boolean.TYPE ) {
|
||||
return new IDLType( c, "boolean" ) ;
|
||||
} else if( c == Character.TYPE ) {
|
||||
return new IDLType( c, "wchar" ) ;
|
||||
} else if( c == Byte.TYPE ) {
|
||||
return new IDLType( c, "octet" ) ;
|
||||
} else if( c == Short.TYPE ) {
|
||||
return new IDLType( c, "short" ) ;
|
||||
} else if( c == Integer.TYPE ) {
|
||||
return new IDLType( c, "long" ) ;
|
||||
} else if( c == Long.TYPE ) {
|
||||
return new IDLType( c, "long_long" ) ;
|
||||
} else if( c == Float.TYPE ) {
|
||||
return new IDLType( c, "float" ) ;
|
||||
} else if( c == Double.TYPE ) {
|
||||
return new IDLType( c, "double" ) ;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return IDL Type name for special case type mappings as defined in
|
||||
* Table 1-1 of Java2IDL spec or null if given class is not a special
|
||||
* type.
|
||||
*/
|
||||
public IDLType getSpecialCaseIDLTypeMapping(Class c) {
|
||||
|
||||
if( c == null ) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
if( c == java.lang.Object.class ) {
|
||||
return new IDLType( c, new String[] { "java", "lang" },
|
||||
"Object" ) ;
|
||||
} else if( c == java.lang.String.class ) {
|
||||
return new IDLType( c, new String[] { "CORBA" },
|
||||
"WStringValue" ) ;
|
||||
} else if( c == java.lang.Class.class ) {
|
||||
return new IDLType( c, new String[] { "javax", "rmi", "CORBA" },
|
||||
"ClassDesc" ) ;
|
||||
} else if( c == java.io.Serializable.class ) {
|
||||
return new IDLType( c, new String[] { "java", "io" },
|
||||
"Serializable" ) ;
|
||||
} else if( c == java.io.Externalizable.class ) {
|
||||
return new IDLType( c, new String[] { "java", "io" },
|
||||
"Externalizable" ) ;
|
||||
} else if( c == java.rmi.Remote.class ) {
|
||||
return new IDLType( c, new String[] { "java", "rmi" },
|
||||
"Remote" ) ;
|
||||
} else if( c == org.omg.CORBA.Object.class ) {
|
||||
return new IDLType( c, "Object" ) ;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements 1.2.3 #2 and #4
|
||||
*/
|
||||
private void validateExceptions(Method method) throws IDLTypeException {
|
||||
|
||||
Class[] exceptions = method.getExceptionTypes();
|
||||
|
||||
boolean declaresRemoteExceptionOrSuperClass = false;
|
||||
|
||||
// Section 1.2.3, #2
|
||||
for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
|
||||
Class exception = exceptions[eIndex];
|
||||
if( isRemoteExceptionOrSuperClass(exception) ) {
|
||||
declaresRemoteExceptionOrSuperClass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !declaresRemoteExceptionOrSuperClass ) {
|
||||
String msg = "Method '" + method + "' must throw at least one " +
|
||||
"exception of type java.rmi.RemoteException or one of its " +
|
||||
"super-classes";
|
||||
throw new IDLTypeException(msg);
|
||||
}
|
||||
|
||||
// Section 1.2.3, #4
|
||||
// See also bug 4972402
|
||||
// For all exceptions E in exceptions,
|
||||
// (isCheckedException(E) => (isValue(E) || RemoteException.isAssignableFrom( E ) )
|
||||
for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
|
||||
Class exception = exceptions[eIndex];
|
||||
|
||||
if (isCheckedException(exception) && !isValue(exception) &&
|
||||
!isRemoteException(exception))
|
||||
{
|
||||
String msg = "Exception '" + exception + "' on method '" +
|
||||
method + "' is not a allowed RMI/IIOP exception type";
|
||||
throw new IDLTypeException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the method's throw clause conforms to the exception
|
||||
* restrictions for properties as defined in Section 1.3.4.3 of
|
||||
* Java2IDL spec. This means that for all exceptions E declared on the
|
||||
* method, E isChecked => RemoteException.isAssignableFrom( E ).
|
||||
*/
|
||||
private boolean validPropertyExceptions(Method method)
|
||||
{
|
||||
Class[] exceptions = method.getExceptionTypes();
|
||||
|
||||
for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
|
||||
Class exception = exceptions[eIndex];
|
||||
|
||||
if (isCheckedException(exception) && !isRemoteException(exception))
|
||||
return false ;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Section 1.2.3, #2.
|
||||
*/
|
||||
private boolean isRemoteExceptionOrSuperClass(Class c) {
|
||||
return
|
||||
((c == java.rmi.RemoteException.class) ||
|
||||
(c == java.io.IOException.class) ||
|
||||
(c == java.lang.Exception.class) ||
|
||||
(c == java.lang.Throwable.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Section 1.2.3, #5.
|
||||
*/
|
||||
private void validateDirectInterfaces(Class c) throws IDLTypeException {
|
||||
|
||||
Class[] directInterfaces = c.getInterfaces();
|
||||
|
||||
if( directInterfaces.length < 2 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Set allMethodNames = new HashSet();
|
||||
Set currentMethodNames = new HashSet();
|
||||
|
||||
for(int i = 0; i < directInterfaces.length; i++) {
|
||||
Class next = directInterfaces[i];
|
||||
Method[] methods = next.getMethods();
|
||||
|
||||
// Comparison is based on method names only. First collect
|
||||
// all methods from current interface, eliminating duplicate
|
||||
// names.
|
||||
currentMethodNames.clear();
|
||||
for(int m = 0; m < methods.length; m++) {
|
||||
currentMethodNames.add(methods[m].getName());
|
||||
}
|
||||
|
||||
// Now check each method against list of all unique method
|
||||
// names processed so far.
|
||||
for(Iterator iter=currentMethodNames.iterator(); iter.hasNext();) {
|
||||
String methodName = (String) iter.next();
|
||||
if( allMethodNames.contains(methodName) ) {
|
||||
String msg = "Class " + c + " inherits method " +
|
||||
methodName + " from multiple direct interfaces.";
|
||||
throw new IDLTypeException(msg);
|
||||
} else {
|
||||
allMethodNames.add(methodName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements 1.2.3 #6
|
||||
*/
|
||||
private void validateConstants(final Class c)
|
||||
throws IDLTypeException {
|
||||
|
||||
Field[] fields = null;
|
||||
|
||||
try {
|
||||
fields = (Field[])
|
||||
java.security.AccessController.doPrivileged
|
||||
(new java.security.PrivilegedExceptionAction() {
|
||||
public java.lang.Object run() throws Exception {
|
||||
return c.getFields();
|
||||
}
|
||||
});
|
||||
} catch(java.security.PrivilegedActionException pae) {
|
||||
IDLTypeException ite = new IDLTypeException();
|
||||
ite.initCause(pae);
|
||||
throw ite;
|
||||
}
|
||||
|
||||
for(int i = 0; i < fields.length; i++) {
|
||||
Field next = fields[i];
|
||||
Class fieldType = next.getType();
|
||||
if( (fieldType != java.lang.String.class) &&
|
||||
!isPrimitive(fieldType) ) {
|
||||
String msg = "Constant field '" + next.getName() +
|
||||
"' in class '" + next.getDeclaringClass().getName() +
|
||||
"' has invalid type' " + next.getType() + "'. Constants" +
|
||||
" in RMI/IIOP interfaces can only have primitive" +
|
||||
" types and java.lang.String types.";
|
||||
throw new IDLTypeException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.iiop;
|
||||
|
||||
import com.sun.corba.se.impl.protocol.Request;
|
||||
import com.sun.corba.se.impl.core.ClientRequest;
|
||||
import com.sun.corba.se.impl.core.ServiceContext;
|
||||
import com.sun.corba.se.impl.core.ServiceContexts;
|
||||
import com.sun.corba.se.impl.core.ClientResponse;
|
||||
import com.sun.corba.se.impl.core.ServerRequest;
|
||||
import com.sun.corba.se.impl.core.ServerResponse;
|
||||
import com.sun.corba.se.impl.corba.IOR;
|
||||
import com.sun.corba.se.impl.corba.GIOPVersion;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
|
||||
import com.sun.corba.se.impl.orbutil.ORBConstants;
|
||||
import com.sun.corba.se.impl.core.ORBVersion;
|
||||
import com.sun.corba.se.impl.core.ORB;
|
||||
import com.sun.corba.se.impl.orbutil.ORBUtility;
|
||||
import com.sun.corba.se.impl.ior.ObjectKeyFactory ;
|
||||
import com.sun.corba.se.impl.ior.ObjectKey ;
|
||||
import com.sun.corba.se.impl.ior.ObjectKeyTemplate ;
|
||||
import com.sun.corba.se.impl.ior.IIOPProfile;
|
||||
|
||||
public class LocalClientRequestImpl extends IIOPOutputStream
|
||||
implements ClientRequest
|
||||
{
|
||||
public LocalClientRequestImpl( GIOPVersion gv,
|
||||
ORB orb, IOR ior, short addrDisposition,
|
||||
String operationName, boolean oneway, ServiceContexts svc,
|
||||
int requestId, byte streamFormatVersion)
|
||||
{
|
||||
super(gv,
|
||||
orb,
|
||||
null,
|
||||
BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
|
||||
streamFormatVersion);
|
||||
|
||||
this.isOneway = oneway;
|
||||
boolean responseExpected = !isOneway;
|
||||
|
||||
IIOPProfile iop = ior.getProfile();
|
||||
ObjectKey okey = iop.getObjectKey();
|
||||
ObjectKeyTemplate oktemp = okey.getTemplate() ;
|
||||
ORBVersion version = oktemp.getORBVersion() ;
|
||||
orb.setORBVersion( version ) ;
|
||||
|
||||
this.request = MessageBase.createRequest(orb, gv, requestId,
|
||||
responseExpected, ior, addrDisposition, operationName, svc, null);
|
||||
setMessage(request);
|
||||
request.write(this);
|
||||
|
||||
// mark beginning of msg body for possible later use
|
||||
bodyBegin = getSize();
|
||||
}
|
||||
|
||||
public int getRequestId() {
|
||||
return request.getRequestId();
|
||||
}
|
||||
|
||||
public boolean isOneWay() {
|
||||
return isOneway;
|
||||
}
|
||||
|
||||
public ServiceContexts getServiceContexts() {
|
||||
return request.getServiceContexts();
|
||||
}
|
||||
|
||||
public String getOperationName() {
|
||||
return request.getOperation();
|
||||
}
|
||||
|
||||
public ObjectKey getObjectKey() {
|
||||
return request.getObjectKey();
|
||||
}
|
||||
|
||||
public ServerRequest getServerRequest()
|
||||
{
|
||||
// Set the size of the marshalled data in the message header.
|
||||
getMessage().setSize( getByteBuffer(), getSize() ) ;
|
||||
|
||||
// Construct a new ServerRequest out of the buffer in this ClientRequest
|
||||
LocalServerRequestImpl serverRequest = new LocalServerRequestImpl(
|
||||
(ORB)orb(), toByteArray(), request ) ;
|
||||
|
||||
// Skip over all of the GIOP header information. This positions
|
||||
// the offset in the buffer so that the skeleton can correctly read
|
||||
// the marshalled arguments.
|
||||
serverRequest.setIndex( bodyBegin ) ;
|
||||
|
||||
return serverRequest ;
|
||||
}
|
||||
|
||||
public ClientResponse invoke()
|
||||
{
|
||||
ORB myORB = (ORB)orb() ;
|
||||
|
||||
ServerResponse serverResponse = myORB.process( getServerRequest() ) ;
|
||||
|
||||
LocalServerResponseImpl lsr = (LocalServerResponseImpl)serverResponse ;
|
||||
|
||||
return lsr.getClientResponse() ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the request is local.
|
||||
*/
|
||||
public boolean isLocal(){
|
||||
return true;
|
||||
}
|
||||
|
||||
private RequestMessage request;
|
||||
private int bodyBegin;
|
||||
private boolean isOneway;
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.iiop;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.omg.CORBA.SystemException;
|
||||
import org.omg.CORBA.CompletionStatus;
|
||||
|
||||
import com.sun.corba.se.impl.core.Response;
|
||||
import com.sun.corba.se.impl.core.ClientResponse;
|
||||
import com.sun.corba.se.impl.corba.IOR;
|
||||
import com.sun.corba.se.impl.core.ORB;
|
||||
import com.sun.corba.se.impl.core.ServiceContext;
|
||||
import com.sun.corba.se.impl.core.ServiceContexts;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
|
||||
import com.sun.corba.se.impl.orbutil.MinorCodes;
|
||||
|
||||
class LocalClientResponseImpl extends IIOPInputStream implements ClientResponse
|
||||
{
|
||||
LocalClientResponseImpl(ORB orb, byte[] buf, ReplyMessage header)
|
||||
{
|
||||
super(orb, buf, header.getSize(), header.isLittleEndian(), header, null);
|
||||
|
||||
this.reply = header;
|
||||
|
||||
// NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin)
|
||||
// in LocalServerResponse.getClientResponse(), then we do not need
|
||||
// to read the headers (done below) anymore.
|
||||
// This will be an optimisation which is can be done to speed up the
|
||||
// local invocation by avoiding reading the headers in the local cases.
|
||||
|
||||
// BUGFIX(Ram Jeyaraman) This has been moved from
|
||||
// LocalServerResponse.getClientResponse()
|
||||
// Skip over all of the GIOP header information. This positions
|
||||
// the offset in the buffer so that the skeleton can correctly read
|
||||
// the marshalled arguments.
|
||||
this.setIndex(Message.GIOPMessageHeaderLength);
|
||||
|
||||
// BUGFIX(Ram Jeyaraman) For local invocations, the reply mesg fields
|
||||
// needs to be set, by reading the response buffer contents
|
||||
// to correctly set the exception type and other info.
|
||||
this.reply.read(this);
|
||||
}
|
||||
|
||||
LocalClientResponseImpl(SystemException ex)
|
||||
{
|
||||
this.systemException = ex;
|
||||
}
|
||||
|
||||
public boolean isSystemException() {
|
||||
if ( reply != null )
|
||||
return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
|
||||
else
|
||||
return (systemException != null);
|
||||
}
|
||||
|
||||
public boolean isUserException() {
|
||||
if ( reply != null )
|
||||
return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isLocationForward() {
|
||||
if ( reply != null ) {
|
||||
return ( (reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD) ||
|
||||
(reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD_PERM) );
|
||||
//return reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDifferentAddrDispositionRequested() {
|
||||
if (reply != null) {
|
||||
return reply.getReplyStatus() == ReplyMessage.NEEDS_ADDRESSING_MODE;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public short getAddrDisposition() {
|
||||
if (reply != null) {
|
||||
return reply.getAddrDisposition();
|
||||
}
|
||||
|
||||
throw new org.omg.CORBA.INTERNAL(
|
||||
"Null reply in getAddrDisposition",
|
||||
MinorCodes.NULL_REPLY_IN_GET_ADDR_DISPOSITION,
|
||||
CompletionStatus.COMPLETED_MAYBE);
|
||||
}
|
||||
|
||||
public IOR getForwardedIOR() {
|
||||
if ( reply != null )
|
||||
return reply.getIOR();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getRequestId() {
|
||||
if ( reply != null )
|
||||
return reply.getRequestId();
|
||||
else
|
||||
throw new org.omg.CORBA.INTERNAL("Error in getRequestId");
|
||||
}
|
||||
|
||||
public ServiceContexts getServiceContexts() {
|
||||
if ( reply != null )
|
||||
return reply.getServiceContexts();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public SystemException getSystemException() {
|
||||
if ( reply != null )
|
||||
return reply.getSystemException();
|
||||
else
|
||||
return systemException;
|
||||
}
|
||||
|
||||
public java.lang.String peekUserExceptionId() {
|
||||
mark(Integer.MAX_VALUE);
|
||||
String result = read_string();
|
||||
reset();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the response is local.
|
||||
*/
|
||||
public boolean isLocal(){
|
||||
return true;
|
||||
}
|
||||
|
||||
private ReplyMessage reply;
|
||||
private SystemException systemException;
|
||||
}
|
||||
@@ -1,208 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.iiop;
|
||||
|
||||
import org.omg.CORBA.SystemException;
|
||||
|
||||
import com.sun.corba.se.impl.core.ServerRequest;
|
||||
import com.sun.corba.se.impl.core.ServiceContext;
|
||||
import com.sun.corba.se.impl.core.DuplicateServiceContext;
|
||||
import com.sun.corba.se.impl.core.UEInfoServiceContext;
|
||||
import com.sun.corba.se.impl.core.ServiceContexts;
|
||||
import com.sun.corba.se.impl.core.ServerResponse;
|
||||
import com.sun.corba.se.impl.corba.IOR;
|
||||
import com.sun.corba.se.impl.core.ORB;
|
||||
import com.sun.corba.se.impl.orbutil.ORBUtility; //d11638
|
||||
import org.omg.CORBA.portable.UnknownException;
|
||||
import org.omg.CORBA.UNKNOWN;
|
||||
import org.omg.CORBA.CompletionStatus;
|
||||
import com.sun.corba.se.impl.ior.ObjectKey;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
|
||||
|
||||
class LocalServerRequestImpl extends IIOPInputStream implements ServerRequest {
|
||||
org.omg.CORBA.portable.OutputStream replyStream;
|
||||
org.omg.CORBA.portable.OutputStream exceptionReplyStream;
|
||||
|
||||
LocalServerRequestImpl(ORB orb, byte[] buf, RequestMessage header)
|
||||
{
|
||||
super(orb, buf, header.getSize(), header.isLittleEndian(), header, null );
|
||||
|
||||
this.request = header;
|
||||
}
|
||||
|
||||
public int getRequestId() {
|
||||
return request.getRequestId();
|
||||
}
|
||||
|
||||
public boolean isOneWay() {
|
||||
return !request.isResponseExpected();
|
||||
}
|
||||
|
||||
public ServiceContexts getServiceContexts() {
|
||||
return request.getServiceContexts();
|
||||
}
|
||||
|
||||
public String getOperationName() {
|
||||
return request.getOperation();
|
||||
}
|
||||
|
||||
public ObjectKey getObjectKey() {
|
||||
return request.getObjectKey();
|
||||
}
|
||||
|
||||
public ServerResponse createResponse(ServiceContexts svc)
|
||||
{
|
||||
return new LocalServerResponseImpl(this, svc);
|
||||
}
|
||||
|
||||
public org.omg.CORBA.portable.OutputStream createReply() {
|
||||
if (replyStream == null) {
|
||||
replyStream = (org.omg.CORBA.portable.OutputStream)
|
||||
createResponse(null);
|
||||
}
|
||||
return replyStream;
|
||||
}
|
||||
|
||||
public org.omg.CORBA.portable.OutputStream createExceptionReply() {
|
||||
if (exceptionReplyStream == null) {
|
||||
exceptionReplyStream = (org.omg.CORBA.portable.OutputStream)
|
||||
createUserExceptionResponse(null);
|
||||
}
|
||||
return exceptionReplyStream;
|
||||
}
|
||||
|
||||
public ServerResponse createUserExceptionResponse(
|
||||
ServiceContexts svc)
|
||||
{
|
||||
return new LocalServerResponseImpl(this, svc, true);
|
||||
}
|
||||
|
||||
public ServerResponse createUnknownExceptionResponse(
|
||||
UnknownException ex) {
|
||||
ServiceContexts contexts = null;
|
||||
SystemException sys = new UNKNOWN( 0,
|
||||
CompletionStatus.COMPLETED_MAYBE);
|
||||
|
||||
try {
|
||||
contexts = new ServiceContexts( (ORB)orb() );
|
||||
UEInfoServiceContext uei = new UEInfoServiceContext(sys);
|
||||
contexts.put(uei) ;
|
||||
} catch (DuplicateServiceContext d) {
|
||||
// can't happen
|
||||
}
|
||||
|
||||
return createSystemExceptionResponse(sys,contexts);
|
||||
}
|
||||
|
||||
public ServerResponse createSystemExceptionResponse(
|
||||
SystemException ex, ServiceContexts svc) {
|
||||
|
||||
// Only do this if interceptors have been initialized on this request
|
||||
// and have not completed their lifecycle (otherwise the info stack
|
||||
// may be empty or have a different request's entry on top).
|
||||
if (executePIInResponseConstructor()) {
|
||||
// Inform Portable Interceptors of the SystemException. This is
|
||||
// required to be done here because the ending interception point
|
||||
// is called in the ServerResponseImpl constructor called below
|
||||
// but we do not currently write the SystemException into the
|
||||
// response until after the ending point is called.
|
||||
ORB orb = (ORB)orb();
|
||||
orb.getPIHandler().setServerPIInfo( ex );
|
||||
}
|
||||
|
||||
if (orb() != null && ((ORB)orb()).subcontractDebugFlag && ex != null)
|
||||
ORBUtility.dprint(this, "Sending SystemException:", ex);
|
||||
|
||||
LocalServerResponseImpl response =
|
||||
new LocalServerResponseImpl(this, svc, false);
|
||||
ORBUtility.writeSystemException(ex, response);
|
||||
return response;
|
||||
}
|
||||
|
||||
public ServerResponse createLocationForward(
|
||||
IOR ior, ServiceContexts svc) {
|
||||
ReplyMessage reply = MessageBase.createReply( (ORB)orb(),
|
||||
request.getGIOPVersion(), request.getRequestId(),
|
||||
ReplyMessage.LOCATION_FORWARD, svc, ior);
|
||||
LocalServerResponseImpl response =
|
||||
new LocalServerResponseImpl(this, reply, ior);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
private RequestMessage request;
|
||||
|
||||
/**
|
||||
* Check to see if the request is local.
|
||||
*/
|
||||
public boolean isLocal(){
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean _executeReturnServantInResponseConstructor = false;
|
||||
|
||||
public boolean executeReturnServantInResponseConstructor()
|
||||
{
|
||||
return _executeReturnServantInResponseConstructor;
|
||||
}
|
||||
|
||||
public void setExecuteReturnServantInResponseConstructor(boolean b)
|
||||
{
|
||||
_executeReturnServantInResponseConstructor = b;
|
||||
}
|
||||
|
||||
|
||||
private boolean _executeRemoveThreadInfoInResponseConstructor = false;
|
||||
|
||||
public boolean executeRemoveThreadInfoInResponseConstructor()
|
||||
{
|
||||
return _executeRemoveThreadInfoInResponseConstructor;
|
||||
}
|
||||
|
||||
public void setExecuteRemoveThreadInfoInResponseConstructor(boolean b)
|
||||
{
|
||||
_executeRemoveThreadInfoInResponseConstructor = b;
|
||||
}
|
||||
|
||||
|
||||
private boolean _executePIInResponseConstructor = false;
|
||||
|
||||
public boolean executePIInResponseConstructor() {
|
||||
return _executePIInResponseConstructor;
|
||||
}
|
||||
|
||||
public void setExecutePIInResponseConstructor( boolean b ) {
|
||||
_executePIInResponseConstructor = b;
|
||||
}
|
||||
|
||||
// We know that we're talking to the same ValueHandler, so
|
||||
// use the maximum version it supports.
|
||||
public byte getStreamFormatVersionForReply() {
|
||||
return ORBUtility.getMaxStreamFormatVersion();
|
||||
}
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.iiop;
|
||||
|
||||
import org.omg.CORBA.SystemException;
|
||||
|
||||
import com.sun.corba.se.impl.core.ServerResponse;
|
||||
import com.sun.corba.se.impl.core.ORB;
|
||||
import com.sun.corba.se.impl.corba.IOR;
|
||||
import com.sun.corba.se.impl.core.ServiceContext;
|
||||
import com.sun.corba.se.impl.core.ServiceContexts;
|
||||
import com.sun.corba.se.impl.core.ClientResponse;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
|
||||
|
||||
class LocalServerResponseImpl
|
||||
extends IIOPOutputStream
|
||||
implements ServerResponse
|
||||
{
|
||||
LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc)
|
||||
{
|
||||
this(request,
|
||||
MessageBase.createReply(
|
||||
(ORB)request.orb(),
|
||||
request.getGIOPVersion(),
|
||||
request.getRequestId(), ReplyMessage.NO_EXCEPTION,
|
||||
svc, null),
|
||||
null);
|
||||
}
|
||||
|
||||
LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc,
|
||||
boolean user)
|
||||
{
|
||||
this(request,
|
||||
MessageBase.createReply(
|
||||
(ORB)request.orb(),
|
||||
request.getGIOPVersion(), request.getRequestId(),
|
||||
user ? ReplyMessage.USER_EXCEPTION :
|
||||
ReplyMessage.SYSTEM_EXCEPTION,
|
||||
svc, null),
|
||||
null);
|
||||
}
|
||||
|
||||
LocalServerResponseImpl( LocalServerRequestImpl request, ReplyMessage reply,
|
||||
IOR ior)
|
||||
{
|
||||
super(request.getGIOPVersion(),
|
||||
(ORB)request.orb(),
|
||||
null,
|
||||
BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
|
||||
request.getStreamFormatVersionForReply());
|
||||
|
||||
setMessage(reply);
|
||||
|
||||
ORB orb = (ORB)request.orb();
|
||||
|
||||
ServerResponseImpl.runServantPostInvoke(orb, request);
|
||||
|
||||
if( request.executePIInResponseConstructor() ) {
|
||||
// Invoke server request ending interception points (send_*):
|
||||
// Note: this may end up with a SystemException or an internal
|
||||
// Runtime ForwardRequest.
|
||||
orb.getPIHandler().invokeServerPIEndingPoint( reply );
|
||||
|
||||
// Note this will be executed even if a ForwardRequest or
|
||||
// SystemException is thrown by a Portable Interceptors ending
|
||||
// point since we end up in this constructor again anyway.
|
||||
orb.getPIHandler().cleanupServerPIRequest();
|
||||
|
||||
// See (Local)ServerRequestImpl.createSystemExceptionResponse
|
||||
// for why this is necesary.
|
||||
request.setExecutePIInResponseConstructor(false);
|
||||
}
|
||||
|
||||
// Once you get here then the final reply is available (i.e.,
|
||||
// postinvoke and interceptors have completed.
|
||||
if (request.executeRemoveThreadInfoInResponseConstructor()) {
|
||||
ServerResponseImpl.removeThreadInfo(orb, request);
|
||||
}
|
||||
|
||||
reply.write(this);
|
||||
if (reply.getIOR() != null)
|
||||
reply.getIOR().write(this);
|
||||
|
||||
this.reply = reply;
|
||||
this.ior = reply.getIOR();
|
||||
}
|
||||
|
||||
public boolean isSystemException() {
|
||||
if (reply != null)
|
||||
return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUserException() {
|
||||
if (reply != null)
|
||||
return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isLocationForward() {
|
||||
if (ior != null)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public IOR getForwardedIOR() {
|
||||
return ior;
|
||||
}
|
||||
|
||||
public int getRequestId() {
|
||||
if (reply != null)
|
||||
return reply.getRequestId();
|
||||
return -1;
|
||||
}
|
||||
|
||||
public ServiceContexts getServiceContexts() {
|
||||
if (reply != null)
|
||||
return reply.getServiceContexts();
|
||||
return null;
|
||||
}
|
||||
|
||||
public SystemException getSystemException() {
|
||||
if (reply != null)
|
||||
return reply.getSystemException();
|
||||
return null;
|
||||
}
|
||||
|
||||
public ReplyMessage getReply()
|
||||
{
|
||||
return reply ;
|
||||
}
|
||||
|
||||
public ClientResponse getClientResponse()
|
||||
{
|
||||
// set the size of the marshalled data in the message header
|
||||
getMessage().setSize(getByteBuffer(), getSize());
|
||||
|
||||
// Construct a new ClientResponse out of the buffer in this ClientRequest
|
||||
LocalClientResponseImpl result =
|
||||
new LocalClientResponseImpl( (ORB)orb(), toByteArray(), reply);
|
||||
|
||||
// NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin) here
|
||||
// then the LocalClientResponse does not need to read the headers anymore.
|
||||
// This will be an optimisation which is can be done to speed up the
|
||||
// local invocation by avoiding reading the headers in the local cases.
|
||||
|
||||
// BUGFIX(Ram Jeyaraman) result.setOffset is now done in
|
||||
// LocalClientResponseImpl constructor.
|
||||
/*
|
||||
// Skip over all of the GIOP header information. This positions
|
||||
// the offset in the buffer so that the skeleton can correctly read
|
||||
// the marshalled arguments.
|
||||
result.setOffset( bodyBegin ) ;
|
||||
*/
|
||||
|
||||
return result ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the response is local.
|
||||
*/
|
||||
public boolean isLocal(){
|
||||
return true;
|
||||
}
|
||||
|
||||
private ReplyMessage reply;
|
||||
private IOR ior; // forwarded IOR
|
||||
}
|
||||
@@ -1,710 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.transport;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.SelectableChannel;
|
||||
import java.nio.channels.SelectionKey;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.Collections;
|
||||
import java.util.Hashtable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.omg.CORBA.COMM_FAILURE;
|
||||
import org.omg.CORBA.CompletionStatus;
|
||||
import org.omg.CORBA.DATA_CONVERSION;
|
||||
import org.omg.CORBA.INTERNAL;
|
||||
import org.omg.CORBA.MARSHAL;
|
||||
import org.omg.CORBA.OBJECT_NOT_EXIST;
|
||||
import org.omg.CORBA.SystemException;
|
||||
|
||||
import com.sun.org.omg.SendingContext.CodeBase;
|
||||
|
||||
import com.sun.corba.se.pept.broker.Broker;
|
||||
import com.sun.corba.se.pept.encoding.InputObject;
|
||||
import com.sun.corba.se.pept.encoding.OutputObject;
|
||||
import com.sun.corba.se.pept.protocol.MessageMediator;
|
||||
import com.sun.corba.se.pept.transport.Acceptor;
|
||||
import com.sun.corba.se.pept.transport.Connection;
|
||||
import com.sun.corba.se.pept.transport.ConnectionCache;
|
||||
import com.sun.corba.se.pept.transport.ContactInfo;
|
||||
import com.sun.corba.se.pept.transport.EventHandler;
|
||||
import com.sun.corba.se.pept.transport.InboundConnectionCache;
|
||||
import com.sun.corba.se.pept.transport.OutboundConnectionCache;
|
||||
import com.sun.corba.se.pept.transport.ResponseWaitingRoom;
|
||||
import com.sun.corba.se.pept.transport.Selector;
|
||||
|
||||
import com.sun.corba.se.spi.ior.IOR;
|
||||
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
|
||||
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||
import com.sun.corba.se.spi.orb.ORB ;
|
||||
import com.sun.corba.se.spi.orbutil.threadpool.Work;
|
||||
import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
|
||||
import com.sun.corba.se.spi.transport.CorbaContactInfo;
|
||||
import com.sun.corba.se.spi.transport.CorbaConnection;
|
||||
import com.sun.corba.se.spi.transport.CorbaResponseWaitingRoom;
|
||||
|
||||
import com.sun.corba.se.impl.encoding.CachedCodeBase;
|
||||
import com.sun.corba.se.impl.encoding.CDRInputStream_1_0;
|
||||
import com.sun.corba.se.impl.encoding.CDROutputObject;
|
||||
import com.sun.corba.se.impl.encoding.CDROutputStream_1_0;
|
||||
import com.sun.corba.se.impl.encoding.CodeSetComponentInfo;
|
||||
import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
|
||||
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
|
||||
import com.sun.corba.se.impl.orbutil.ORBConstants;
|
||||
import com.sun.corba.se.impl.orbutil.ORBUtility;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
|
||||
import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
|
||||
import com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl;
|
||||
|
||||
/**
|
||||
* @author Ken Cavanaugh
|
||||
*/
|
||||
public class BufferConnectionImpl
|
||||
extends
|
||||
EventHandlerBase
|
||||
implements
|
||||
CorbaConnection,
|
||||
Work
|
||||
{
|
||||
//
|
||||
// New transport.
|
||||
//
|
||||
|
||||
protected long enqueueTime;
|
||||
|
||||
public SocketChannel getSocketChannel()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// REVISIT:
|
||||
// protected for test: genericRPCMSGFramework.IIOPConnection constructor.
|
||||
|
||||
//
|
||||
// From iiop.Connection.java
|
||||
//
|
||||
|
||||
protected long timeStamp = 0;
|
||||
protected boolean isServer = false;
|
||||
|
||||
// Start at some value other than zero since this is a magic
|
||||
// value in some protocols.
|
||||
protected int requestId = 5;
|
||||
protected CorbaResponseWaitingRoom responseWaitingRoom;
|
||||
protected int state;
|
||||
protected java.lang.Object stateEvent = new java.lang.Object();
|
||||
protected java.lang.Object writeEvent = new java.lang.Object();
|
||||
protected boolean writeLocked;
|
||||
protected int serverRequestCount = 0;
|
||||
|
||||
// Server request map: used on the server side of Connection
|
||||
// Maps request ID to IIOPInputStream.
|
||||
Map serverRequestMap = new HashMap() ;
|
||||
|
||||
// This is a flag associated per connection telling us if the
|
||||
// initial set of sending contexts were sent to the receiver
|
||||
// already...
|
||||
protected boolean postInitialContexts = false;
|
||||
|
||||
// Remote reference to CodeBase server (supplies
|
||||
// FullValueDescription, among other things)
|
||||
protected IOR codeBaseServerIOR;
|
||||
|
||||
// CodeBase cache for this connection. This will cache remote operations,
|
||||
// handle connecting, and ensure we don't do any remote operations until
|
||||
// necessary.
|
||||
protected CachedCodeBase cachedCodeBase = new CachedCodeBase(this);
|
||||
|
||||
protected ORBUtilSystemException wrapper ;
|
||||
|
||||
List buffers ;
|
||||
|
||||
public BufferConnectionImpl(ORB orb, byte[][] data )
|
||||
{
|
||||
this.orb = orb;
|
||||
wrapper = ORBUtilSystemException.get( orb,
|
||||
CORBALogDomains.RPC_TRANSPORT ) ;
|
||||
buffers = new ArrayList() ;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//
|
||||
// framework.transport.Connection
|
||||
//
|
||||
|
||||
public boolean shouldRegisterReadEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldRegisterServerReadEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean read()
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
|
||||
protected CorbaMessageMediator readBits()
|
||||
{
|
||||
return null ;
|
||||
}
|
||||
|
||||
protected boolean dispatch(CorbaMessageMediator messageMediator)
|
||||
{
|
||||
}
|
||||
|
||||
public boolean shouldUseDirectByteBuffers()
|
||||
{
|
||||
return false ;
|
||||
}
|
||||
|
||||
// Only called from readGIOPMessage with (12, 0, 12) as arguments
|
||||
// size is size of buffer to create
|
||||
// offset is offset from start of message in buffer
|
||||
// length is length to read
|
||||
public ByteBuffer read(int size, int offset, int length)
|
||||
throws IOException
|
||||
{
|
||||
byte[] buf = new byte[size];
|
||||
readFully( buf, offset, length);
|
||||
ByteBuffer byteBuffer = ByteBuffer.wrap(buf);
|
||||
byteBuffer.limit(size);
|
||||
return byteBuffer;
|
||||
}
|
||||
|
||||
// Only called as read( buf, 12, msgsize-12 ) in readGIOPMessage
|
||||
// We can ignore the byteBuffer parameter
|
||||
// offset is the starting position to place data in the result
|
||||
// length is the length of the data to read
|
||||
public ByteBuffer read(ByteBuffer byteBuffer, int offset, int length)
|
||||
throws IOException
|
||||
{
|
||||
int size = offset + length;
|
||||
byte[] buf = new byte[size];
|
||||
readFully(buf, offset, length);
|
||||
return ByteBuffer.wrap(buf);
|
||||
}
|
||||
|
||||
// Read size bytes from buffer list and place the data
|
||||
// starting at offset in buf.
|
||||
public void readFully(byte[] buf, int offset, int size)
|
||||
throws IOException
|
||||
{
|
||||
int remaining = size ;
|
||||
int position = offset ;
|
||||
while (remaining > 0) {
|
||||
ByteBuffer buff = (ByteBuffer)buffers.get(0) ;
|
||||
int dataSize = buff.remaining() ;
|
||||
int xferSize = dataSize ;
|
||||
if (dataSize >= remaining) :
|
||||
xferSize = remaining ;
|
||||
buffers.remove(0) ;
|
||||
}
|
||||
|
||||
buff.get( buf, offset, xferSize ) ;
|
||||
|
||||
offset += xferSize ;
|
||||
remaining -= xferSize ;
|
||||
}
|
||||
}
|
||||
|
||||
public void write(ByteBuffer byteBuffer)
|
||||
throws IOException
|
||||
{
|
||||
buffers.add( byteBuffer ) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note:it is possible for this to be called more than once
|
||||
*/
|
||||
public synchronized void close()
|
||||
{
|
||||
}
|
||||
|
||||
public Acceptor getAcceptor()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public ContactInfo getContactInfo()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public EventHandler getEventHandler()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public OutputObject createOutputObject(MessageMediator messageMediator)
|
||||
{
|
||||
// REVISIT - remove this method from Connection and all it subclasses.
|
||||
throw new RuntimeException("*****SocketOrChannelConnectionImpl.createOutputObject - should not be called.");
|
||||
}
|
||||
|
||||
// This is used by the GIOPOutputObject in order to
|
||||
// throw the correct error when handling code sets.
|
||||
// Can we determine if we are on the server side by
|
||||
// other means? XREVISIT
|
||||
public boolean isServer()
|
||||
{
|
||||
return isServer;
|
||||
}
|
||||
|
||||
public boolean isBusy()
|
||||
{
|
||||
return false ;
|
||||
}
|
||||
|
||||
public long getTimeStamp()
|
||||
{
|
||||
return timeStamp;
|
||||
}
|
||||
|
||||
public void setTimeStamp(long time)
|
||||
{
|
||||
timeStamp = time;
|
||||
}
|
||||
|
||||
public void setState(String stateString)
|
||||
{
|
||||
synchronized (stateEvent) {
|
||||
if (stateString.equals("ESTABLISHED")) {
|
||||
state = ESTABLISHED;
|
||||
stateEvent.notifyAll();
|
||||
} else {
|
||||
// REVISIT: ASSERT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void writeLock()
|
||||
{
|
||||
}
|
||||
|
||||
public void writeUnlock()
|
||||
{
|
||||
}
|
||||
|
||||
public void sendWithoutLock(OutputObject outputObject)
|
||||
{
|
||||
}
|
||||
|
||||
public void registerWaiter(MessageMediator messageMediator)
|
||||
{
|
||||
}
|
||||
|
||||
public void unregisterWaiter(MessageMediator messageMediator)
|
||||
{
|
||||
}
|
||||
|
||||
public InputObject waitForResponse(MessageMediator messageMediator)
|
||||
{
|
||||
return null ;
|
||||
}
|
||||
|
||||
public void setConnectionCache(ConnectionCache connectionCache)
|
||||
{
|
||||
}
|
||||
|
||||
public ConnectionCache getConnectionCache()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//
|
||||
// EventHandler methods
|
||||
//
|
||||
|
||||
public SelectableChannel getChannel()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getInterestOps()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// public Acceptor getAcceptor() - already defined above.
|
||||
|
||||
public Connection getConnection()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//
|
||||
// Work methods.
|
||||
//
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
public void doWork()
|
||||
{
|
||||
}
|
||||
|
||||
public void setEnqueueTime(long timeInMillis)
|
||||
{
|
||||
enqueueTime = timeInMillis;
|
||||
}
|
||||
|
||||
public long getEnqueueTime()
|
||||
{
|
||||
return enqueueTime;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//
|
||||
// spi.transport.CorbaConnection.
|
||||
//
|
||||
|
||||
public ResponseWaitingRoom getResponseWaitingRoom()
|
||||
{
|
||||
return null ;
|
||||
}
|
||||
|
||||
// REVISIT - inteface defines isServer but already defined in
|
||||
// higher interface.
|
||||
|
||||
|
||||
public void serverRequestMapPut(int requestId,
|
||||
CorbaMessageMediator messageMediator)
|
||||
{
|
||||
serverRequestMap.put(new Integer(requestId), messageMediator);
|
||||
}
|
||||
|
||||
public CorbaMessageMediator serverRequestMapGet(int requestId)
|
||||
{
|
||||
return (CorbaMessageMediator)
|
||||
serverRequestMap.get(new Integer(requestId));
|
||||
}
|
||||
|
||||
public void serverRequestMapRemove(int requestId)
|
||||
{
|
||||
serverRequestMap.remove(new Integer(requestId));
|
||||
}
|
||||
|
||||
|
||||
// REVISIT: this is also defined in:
|
||||
// com.sun.corba.se.spi.legacy.connection.Connection
|
||||
public java.net.Socket getSocket()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/** It is possible for a Close Connection to have been
|
||||
** sent here, but we will not check for this. A "lazy"
|
||||
** Exception will be thrown in the Worker thread after the
|
||||
** incoming request has been processed even though the connection
|
||||
** is closed before the request is processed. This is o.k because
|
||||
** it is a boundary condition. To prevent it we would have to add
|
||||
** more locks which would reduce performance in the normal case.
|
||||
**/
|
||||
public synchronized void serverRequestProcessingBegins()
|
||||
{
|
||||
serverRequestCount++;
|
||||
}
|
||||
|
||||
public synchronized void serverRequestProcessingEnds()
|
||||
{
|
||||
serverRequestCount--;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
public synchronized int getNextRequestId()
|
||||
{
|
||||
return requestId++;
|
||||
}
|
||||
|
||||
// Negotiated code sets for char and wchar data
|
||||
protected CodeSetComponentInfo.CodeSetContext codeSetContext = null;
|
||||
|
||||
public ORB getBroker()
|
||||
{
|
||||
return orb;
|
||||
}
|
||||
|
||||
public CodeSetComponentInfo.CodeSetContext getCodeSetContext()
|
||||
{
|
||||
// Needs to be synchronized for the following case when the client
|
||||
// doesn't send the code set context twice, and we have two threads
|
||||
// in ServerRequestDispatcher processCodeSetContext.
|
||||
//
|
||||
// Thread A checks to see if there is a context, there is none, so
|
||||
// it calls setCodeSetContext, getting the synch lock.
|
||||
// Thread B checks to see if there is a context. If we didn't synch,
|
||||
// it might decide to outlaw wchar/wstring.
|
||||
if (codeSetContext == null) {
|
||||
synchronized(this) {
|
||||
return codeSetContext;
|
||||
}
|
||||
}
|
||||
|
||||
return codeSetContext;
|
||||
}
|
||||
|
||||
public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) {
|
||||
// Double check whether or not we need to do this
|
||||
if (codeSetContext == null) {
|
||||
|
||||
if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null ||
|
||||
OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) {
|
||||
// If the client says it's negotiated a code set that
|
||||
// isn't a fallback and we never said we support, then
|
||||
// it has a bug.
|
||||
throw wrapper.badCodesetsFromClient() ;
|
||||
}
|
||||
|
||||
codeSetContext = csc;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// from iiop.IIOPConnection.java
|
||||
//
|
||||
|
||||
// Map request ID to an InputObject.
|
||||
// This is so the client thread can start unmarshaling
|
||||
// the reply and remove it from the out_calls map while the
|
||||
// ReaderThread can still obtain the input stream to give
|
||||
// new fragments. Only the ReaderThread touches the clientReplyMap,
|
||||
// so it doesn't incur synchronization overhead.
|
||||
|
||||
public MessageMediator clientRequestMapGet(int requestId)
|
||||
{
|
||||
return null ;
|
||||
}
|
||||
|
||||
protected MessageMediator clientReply_1_1;
|
||||
|
||||
public void clientReply_1_1_Put(MessageMediator x)
|
||||
{
|
||||
clientReply_1_1 = x;
|
||||
}
|
||||
|
||||
public MessageMediator clientReply_1_1_Get()
|
||||
{
|
||||
return clientReply_1_1;
|
||||
}
|
||||
|
||||
public void clientReply_1_1_Remove()
|
||||
{
|
||||
clientReply_1_1 = null;
|
||||
}
|
||||
|
||||
protected MessageMediator serverRequest_1_1;
|
||||
|
||||
public void serverRequest_1_1_Put(MessageMediator x)
|
||||
{
|
||||
serverRequest_1_1 = x;
|
||||
}
|
||||
|
||||
public MessageMediator serverRequest_1_1_Get()
|
||||
{
|
||||
return serverRequest_1_1;
|
||||
}
|
||||
|
||||
public void serverRequest_1_1_Remove()
|
||||
{
|
||||
serverRequest_1_1 = null;
|
||||
}
|
||||
|
||||
protected String getStateString( int state )
|
||||
{
|
||||
synchronized ( stateEvent ){
|
||||
switch (state) {
|
||||
case OPENING : return "OPENING" ;
|
||||
case ESTABLISHED : return "ESTABLISHED" ;
|
||||
case CLOSE_SENT : return "CLOSE_SENT" ;
|
||||
case CLOSE_RECVD : return "CLOSE_RECVD" ;
|
||||
case ABORT : return "ABORT" ;
|
||||
default : return "???" ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized boolean isPostInitialContexts() {
|
||||
return postInitialContexts;
|
||||
}
|
||||
|
||||
// Can never be unset...
|
||||
public synchronized void setPostInitialContexts(){
|
||||
postInitialContexts = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wake up the outstanding requests on the connection, and hand them
|
||||
* COMM_FAILURE exception with a given minor code.
|
||||
*
|
||||
* Also, delete connection from connection table and
|
||||
* stop the reader thread.
|
||||
|
||||
* Note that this should only ever be called by the Reader thread for
|
||||
* this connection.
|
||||
*
|
||||
* @param minor_code The minor code for the COMM_FAILURE major code.
|
||||
* @param die Kill the reader thread (this thread) before exiting.
|
||||
*/
|
||||
public void purgeCalls(SystemException systemException,
|
||||
boolean die, boolean lockHeld)
|
||||
{
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* The following methods are for dealing with Connection cleaning for
|
||||
* better scalability of servers in high network load conditions.
|
||||
**************************************************************************/
|
||||
|
||||
public void sendCloseConnection(GIOPVersion giopVersion)
|
||||
throws IOException
|
||||
{
|
||||
Message msg = MessageBase.createCloseConnection(giopVersion);
|
||||
sendHelper(giopVersion, msg);
|
||||
}
|
||||
|
||||
public void sendMessageError(GIOPVersion giopVersion)
|
||||
throws IOException
|
||||
{
|
||||
Message msg = MessageBase.createMessageError(giopVersion);
|
||||
sendHelper(giopVersion, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a CancelRequest message. This does not lock the connection, so the
|
||||
* caller needs to ensure this method is called appropriately.
|
||||
* @exception IOException - could be due to abortive connection closure.
|
||||
*/
|
||||
public void sendCancelRequest(GIOPVersion giopVersion, int requestId)
|
||||
throws IOException
|
||||
{
|
||||
|
||||
Message msg = MessageBase.createCancelRequest(giopVersion, requestId);
|
||||
sendHelper(giopVersion, msg);
|
||||
}
|
||||
|
||||
protected void sendHelper(GIOPVersion giopVersion, Message msg)
|
||||
throws IOException
|
||||
{
|
||||
// REVISIT: See comments in CDROutputObject constructor.
|
||||
CDROutputObject outputObject =
|
||||
new CDROutputObject((ORB)orb, null, giopVersion, this, msg,
|
||||
ORBConstants.STREAM_FORMAT_VERSION_1);
|
||||
msg.write(outputObject);
|
||||
|
||||
outputObject.writeTo(this);
|
||||
}
|
||||
|
||||
public void sendCancelRequestWithLock(GIOPVersion giopVersion,
|
||||
int requestId)
|
||||
throws IOException
|
||||
{
|
||||
writeLock();
|
||||
try {
|
||||
sendCancelRequest(giopVersion, requestId);
|
||||
} finally {
|
||||
writeUnlock();
|
||||
}
|
||||
}
|
||||
|
||||
// Begin Code Base methods ---------------------------------------
|
||||
//
|
||||
// Set this connection's code base IOR. The IOR comes from the
|
||||
// SendingContext. This is an optional service context, but all
|
||||
// JavaSoft ORBs send it.
|
||||
//
|
||||
// The set and get methods don't need to be synchronized since the
|
||||
// first possible get would occur during reading a valuetype, and
|
||||
// that would be after the set.
|
||||
|
||||
// Sets this connection's code base IOR. This is done after
|
||||
// getting the IOR out of the SendingContext service context.
|
||||
// Our ORBs always send this, but it's optional in CORBA.
|
||||
|
||||
public final void setCodeBaseIOR(IOR ior) {
|
||||
codeBaseServerIOR = ior;
|
||||
}
|
||||
|
||||
public final IOR getCodeBaseIOR() {
|
||||
return codeBaseServerIOR;
|
||||
}
|
||||
|
||||
// Get a CodeBase stub to use in unmarshaling. The CachedCodeBase
|
||||
// won't connect to the remote codebase unless it's necessary.
|
||||
public final CodeBase getCodeBase() {
|
||||
return cachedCodeBase;
|
||||
}
|
||||
|
||||
// End Code Base methods -----------------------------------------
|
||||
|
||||
// Can be overridden in subclass for different options.
|
||||
protected void setSocketOptions(Socket socket)
|
||||
{
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
synchronized ( stateEvent ){
|
||||
return
|
||||
"BufferConnectionImpl[" + " "
|
||||
+ getStateString( state ) + " "
|
||||
+ shouldUseSelectThreadToWait() + " "
|
||||
+ shouldUseWorkerThreadForEvent()
|
||||
+ "]" ;
|
||||
}
|
||||
}
|
||||
|
||||
// Must be public - used in encoding.
|
||||
public void dprint(String msg)
|
||||
{
|
||||
ORBUtility.dprint("SocketOrChannelConnectionImpl", msg);
|
||||
}
|
||||
|
||||
protected void dprint(String msg, Throwable t)
|
||||
{
|
||||
dprint(msg);
|
||||
t.printStackTrace(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
// End of file.
|
||||
@@ -361,3 +361,13 @@ c9dd82da51ed34a28f7c6b3245163ee962e94572 hs25-b40
|
||||
2b9946e10587f74ef75ae8145bea484df4a2738b hs25-b41
|
||||
81b6cb70717c66375846b78bb174594ec3aa998e jdk8-b99
|
||||
9f71e36a471ae4a668e08827d33035963ed10c08 hs25-b42
|
||||
5787fac72e760c6a5fd9efa113b0c75caf554136 jdk8-b100
|
||||
46487ba40ff225654d0c51787ed3839bafcbd9f3 hs25-b43
|
||||
f6921c876db192bba389cec062855a66372da01c jdk8-b101
|
||||
530fe88b3b2c710f42810b3580d86a0d83ad6c1c hs25-b44
|
||||
c4697c1c448416108743b59118b4a2498b339d0c jdk8-b102
|
||||
7f55137d6aa81efc6eb0035813709f2cb6a26b8b hs25-b45
|
||||
6f9be7f87b9653e94fd8fb3070891a0cc91b15bf jdk8-b103
|
||||
580430d131ccd475e2f2ad4006531b8c4813d102 hs25-b46
|
||||
104743074675359cfbf7f4dcd9ab2a5974a16627 jdk8-b104
|
||||
c1604d5885a6f2adc0bcea2fa142a8f6bafad2f0 hs25-b47
|
||||
|
||||
@@ -29,11 +29,10 @@ public interface JVMTIThreadState {
|
||||
public static final int JVMTI_THREAD_STATE_ALIVE = 0x0001;
|
||||
public static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002;
|
||||
public static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004;
|
||||
public static final int JVMTI_THREAD_STATE_WAITING = 0x0008;
|
||||
public static final int JVMTI_THREAD_STATE_WAITING = 0x0080;
|
||||
public static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
|
||||
public static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
|
||||
public static final int JVMTI_THREAD_STATE_SLEEPING = 0x0040;
|
||||
public static final int JVMTI_THREAD_STATE_WAITING_FOR_NOTIFICATION = 0x0080;
|
||||
public static final int JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100;
|
||||
public static final int JVMTI_THREAD_STATE_PARKED = 0x0200;
|
||||
public static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400;
|
||||
|
||||
@@ -75,19 +75,19 @@ public class InstanceKlass extends Klass {
|
||||
javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0);
|
||||
constants = new MetadataField(type.getAddressField("_constants"), 0);
|
||||
classLoaderData = type.getAddressField("_class_loader_data");
|
||||
sourceFileName = type.getAddressField("_source_file_name");
|
||||
sourceDebugExtension = type.getAddressField("_source_debug_extension");
|
||||
innerClasses = type.getAddressField("_inner_classes");
|
||||
sourceFileNameIndex = new CIntField(type.getCIntegerField("_source_file_name_index"), 0);
|
||||
nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), 0);
|
||||
staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), 0);
|
||||
staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), 0);
|
||||
staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), 0);
|
||||
nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0);
|
||||
isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0);
|
||||
initState = new CIntField(type.getCIntegerField("_init_state"), 0);
|
||||
vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
|
||||
itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0);
|
||||
breakpoints = type.getAddressField("_breakpoints");
|
||||
genericSignature = type.getAddressField("_generic_signature");
|
||||
genericSignatureIndex = new CIntField(type.getCIntegerField("_generic_signature_index"), 0);
|
||||
majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0);
|
||||
minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0);
|
||||
headerSize = Oop.alignObjectOffset(type.getSize());
|
||||
@@ -134,9 +134,9 @@ public class InstanceKlass extends Klass {
|
||||
private static CIntField javaFieldsCount;
|
||||
private static MetadataField constants;
|
||||
private static AddressField classLoaderData;
|
||||
private static AddressField sourceFileName;
|
||||
private static AddressField sourceDebugExtension;
|
||||
private static AddressField innerClasses;
|
||||
private static CIntField sourceFileNameIndex;
|
||||
private static CIntField nonstaticFieldSize;
|
||||
private static CIntField staticFieldSize;
|
||||
private static CIntField staticOopFieldCount;
|
||||
@@ -146,7 +146,7 @@ public class InstanceKlass extends Klass {
|
||||
private static CIntField vtableLen;
|
||||
private static CIntField itableLen;
|
||||
private static AddressField breakpoints;
|
||||
private static AddressField genericSignature;
|
||||
private static CIntField genericSignatureIndex;
|
||||
private static CIntField majorVersion;
|
||||
private static CIntField minorVersion;
|
||||
|
||||
@@ -346,7 +346,7 @@ public class InstanceKlass extends Klass {
|
||||
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
|
||||
public ClassLoaderData getClassLoaderData() { return ClassLoaderData.instantiateWrapperFor(classLoaderData.getValue(getAddress())); }
|
||||
public Oop getClassLoader() { return getClassLoaderData().getClassLoader(); }
|
||||
public Symbol getSourceFileName() { return getSymbol(sourceFileName); }
|
||||
public Symbol getSourceFileName() { return getConstants().getSymbolAt(sourceFileNameIndex.getValue(this)); }
|
||||
public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getAddress())); }
|
||||
public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); }
|
||||
public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); }
|
||||
@@ -354,7 +354,7 @@ public class InstanceKlass extends Klass {
|
||||
public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; }
|
||||
public long getVtableLen() { return vtableLen.getValue(this); }
|
||||
public long getItableLen() { return itableLen.getValue(this); }
|
||||
public Symbol getGenericSignature() { return getSymbol(genericSignature); }
|
||||
public Symbol getGenericSignature() { return getConstants().getSymbolAt(genericSignatureIndex.getValue(this)); }
|
||||
public long majorVersion() { return majorVersion.getValue(this); }
|
||||
public long minorVersion() { return minorVersion.getValue(this); }
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PhaseCFG extends Phase {
|
||||
Type type = db.lookupType("PhaseCFG");
|
||||
numBlocksField = new CIntField(type.getCIntegerField("_num_blocks"), 0);
|
||||
blocksField = type.getAddressField("_blocks");
|
||||
bbsField = type.getAddressField("_bbs");
|
||||
bbsField = type.getAddressField("_node_to_block_mapping");
|
||||
brootField = type.getAddressField("_broot");
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import sun.jvm.hotspot.types.*;
|
||||
// to the sys_thread_t structure of the classic JVM implementation.
|
||||
public class OSThread extends VMObject {
|
||||
private static JIntField interruptedField;
|
||||
private static JIntField threadIdField;
|
||||
private static Field threadIdField;
|
||||
static {
|
||||
VM.registerVMInitializedObserver(new Observer() {
|
||||
public void update(Observable o, Object data) {
|
||||
@@ -44,7 +44,7 @@ public class OSThread extends VMObject {
|
||||
private static synchronized void initialize(TypeDataBase db) {
|
||||
Type type = db.lookupType("OSThread");
|
||||
interruptedField = type.getJIntField("_interrupted");
|
||||
threadIdField = type.getJIntField("_thread_id");
|
||||
threadIdField = type.getField("_thread_id");
|
||||
}
|
||||
|
||||
public OSThread(Address addr) {
|
||||
@@ -56,7 +56,7 @@ public class OSThread extends VMObject {
|
||||
}
|
||||
|
||||
public int threadId() {
|
||||
return (int)threadIdField.getValue(addr);
|
||||
return threadIdField.getJInt(addr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@@ -74,25 +74,31 @@ public class ClassDump extends Tool {
|
||||
public void run() {
|
||||
// Ready to go with the database...
|
||||
try {
|
||||
// The name of the filter always comes from a System property.
|
||||
// If we have a pkgList, pass it, otherwise let the filter read
|
||||
// its own System property for the list of classes.
|
||||
String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
|
||||
"sun.jvm.hotspot.tools.jcore.PackageNameFilter");
|
||||
try {
|
||||
Class filterClass = Class.forName(filterClassName);
|
||||
if (pkgList == null) {
|
||||
classFilter = (ClassFilter) filterClass.newInstance();
|
||||
} else {
|
||||
Constructor con = filterClass.getConstructor(String.class);
|
||||
classFilter = (ClassFilter) con.newInstance(pkgList);
|
||||
if (classFilter == null) {
|
||||
// If not already set, the name of the filter comes from a System property.
|
||||
// If we have a pkgList, pass it, otherwise let the filter read
|
||||
// its own System property for the list of classes.
|
||||
String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
|
||||
"sun.jvm.hotspot.tools.jcore.PackageNameFilter");
|
||||
try {
|
||||
Class filterClass = Class.forName(filterClassName);
|
||||
if (pkgList == null) {
|
||||
classFilter = (ClassFilter) filterClass.newInstance();
|
||||
} else {
|
||||
Constructor con = filterClass.getConstructor(String.class);
|
||||
classFilter = (ClassFilter) con.newInstance(pkgList);
|
||||
}
|
||||
} catch(Exception exp) {
|
||||
System.err.println("Warning: Can not create class filter!");
|
||||
}
|
||||
} catch(Exception exp) {
|
||||
System.err.println("Warning: Can not create class filter!");
|
||||
}
|
||||
|
||||
String outputDirectory = System.getProperty("sun.jvm.hotspot.tools.jcore.outputDir", ".");
|
||||
setOutputDirectory(outputDirectory);
|
||||
// outputDirectory and jarStream are alternatives: setting one closes the other.
|
||||
// If neither is set, use outputDirectory from the System property:
|
||||
if (outputDirectory == null && jarStream == null) {
|
||||
String dirName = System.getProperty("sun.jvm.hotspot.tools.jcore.outputDir", ".");
|
||||
setOutputDirectory(dirName);
|
||||
}
|
||||
|
||||
// walk through the system dictionary
|
||||
SystemDictionary dict = VM.getVM().getSystemDictionary();
|
||||
|
||||
@@ -41,13 +41,11 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
|
||||
|
||||
ifeq ("${Platform_arch_model}", "${Platform_arch}")
|
||||
SOURCES.AD = \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)
|
||||
else
|
||||
SOURCES.AD = \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)
|
||||
endif
|
||||
|
||||
EXEC = $(OUTDIR)/adlc
|
||||
|
||||
@@ -247,7 +247,7 @@ ifeq ($(USE_CLANG), true)
|
||||
# Not yet supported by clang in Xcode 4.6.2
|
||||
# WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
|
||||
WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
|
||||
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
||||
WARNINGS_ARE_ERRORS += -Wno-empty-body
|
||||
endif
|
||||
|
||||
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
|
||||
|
||||
@@ -24,16 +24,20 @@
|
||||
|
||||
TYPE=MINIMAL1
|
||||
|
||||
INCLUDE_JVMTI ?= false
|
||||
INCLUDE_FPROF ?= false
|
||||
INCLUDE_VM_STRUCTS ?= false
|
||||
INCLUDE_JNI_CHECK ?= false
|
||||
INCLUDE_SERVICES ?= false
|
||||
INCLUDE_MANAGEMENT ?= false
|
||||
INCLUDE_ALL_GCS ?= false
|
||||
INCLUDE_NMT ?= false
|
||||
INCLUDE_TRACE ?= false
|
||||
INCLUDE_CDS ?= false
|
||||
# Force all variables to false, overriding any other
|
||||
# setting that may have occurred in the makefiles. These
|
||||
# can still be overridden by passing the variable as an
|
||||
# argument to 'make'
|
||||
INCLUDE_JVMTI := false
|
||||
INCLUDE_FPROF := false
|
||||
INCLUDE_VM_STRUCTS := false
|
||||
INCLUDE_JNI_CHECK := false
|
||||
INCLUDE_SERVICES := false
|
||||
INCLUDE_MANAGEMENT := false
|
||||
INCLUDE_ALL_GCS := false
|
||||
INCLUDE_NMT := false
|
||||
INCLUDE_TRACE := false
|
||||
INCLUDE_CDS := false
|
||||
|
||||
CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
|
||||
CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
|
||||
|
||||
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
|
||||
|
||||
HS_MAJOR_VER=25
|
||||
HS_MINOR_VER=0
|
||||
HS_BUILD_NUMBER=42
|
||||
HS_BUILD_NUMBER=47
|
||||
|
||||
JDK_MAJOR_VER=1
|
||||
JDK_MINOR_VER=8
|
||||
|
||||
@@ -41,13 +41,11 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
|
||||
|
||||
ifeq ("${Platform_arch_model}", "${Platform_arch}")
|
||||
SOURCES.AD = \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)
|
||||
else
|
||||
SOURCES.AD = \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)
|
||||
endif
|
||||
|
||||
EXEC = $(OUTDIR)/adlc
|
||||
|
||||
@@ -24,16 +24,20 @@
|
||||
|
||||
TYPE=MINIMAL1
|
||||
|
||||
INCLUDE_JVMTI ?= false
|
||||
INCLUDE_FPROF ?= false
|
||||
INCLUDE_VM_STRUCTS ?= false
|
||||
INCLUDE_JNI_CHECK ?= false
|
||||
INCLUDE_SERVICES ?= false
|
||||
INCLUDE_MANAGEMENT ?= false
|
||||
INCLUDE_ALL_GCS ?= false
|
||||
INCLUDE_NMT ?= false
|
||||
INCLUDE_TRACE ?= false
|
||||
INCLUDE_CDS ?= false
|
||||
# Force all variables to false, overriding any other
|
||||
# setting that may have occurred in the makefiles. These
|
||||
# can still be overridden by passing the variable as an
|
||||
# argument to 'make'
|
||||
INCLUDE_JVMTI := false
|
||||
INCLUDE_FPROF := false
|
||||
INCLUDE_VM_STRUCTS := false
|
||||
INCLUDE_JNI_CHECK := false
|
||||
INCLUDE_SERVICES := false
|
||||
INCLUDE_MANAGEMENT := false
|
||||
INCLUDE_ALL_GCS := false
|
||||
INCLUDE_NMT := false
|
||||
INCLUDE_TRACE := false
|
||||
INCLUDE_CDS := false
|
||||
|
||||
CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
|
||||
CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
|
||||
|
||||
@@ -212,6 +212,12 @@ ifeq ($(Platform_arch_model), x86_64)
|
||||
Src_Files_EXCLUDE += \*x86_32\*
|
||||
endif
|
||||
|
||||
# Alternate vm.make
|
||||
# This has to be included here to allow changes to the source
|
||||
# directories and excluded files before they are expanded
|
||||
# by the definition of Src_Files.
|
||||
-include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make
|
||||
|
||||
# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
|
||||
define findsrc
|
||||
$(notdir $(shell find $(1)/. ! -name . -prune \
|
||||
@@ -381,4 +387,4 @@ build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceChe
|
||||
|
||||
install: install_jvm install_jsig install_saproc
|
||||
|
||||
.PHONY: default build install install_jvm $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
|
||||
.PHONY: default build install install_jvm $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make
|
||||
|
||||
@@ -42,13 +42,11 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
|
||||
|
||||
ifeq ("${Platform_arch_model}", "${Platform_arch}")
|
||||
SOURCES.AD = \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)
|
||||
else
|
||||
SOURCES.AD = \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad) \
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
|
||||
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)
|
||||
endif
|
||||
|
||||
EXEC = $(OUTDIR)/adlc
|
||||
|
||||
@@ -283,9 +283,9 @@ $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
|
||||
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
|
||||
$(DTraced_Files) ||\
|
||||
STATUS=$$?;\
|
||||
if [ x"$$STATUS" = x"1" -a \
|
||||
x`uname -r` = x"5.10" -a \
|
||||
x`uname -p` = x"sparc" ]; then\
|
||||
if [ x"$$STATUS" = x"1" ]; then \
|
||||
if [ x`uname -r` = x"5.10" -a \
|
||||
x`uname -p` = x"sparc" ]; then\
|
||||
echo "*****************************************************************";\
|
||||
echo "* If you are building server compiler, and the error message is ";\
|
||||
echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
|
||||
@@ -294,6 +294,20 @@ $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
|
||||
echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
|
||||
echo "* dtrace probes for this build.";\
|
||||
echo "*****************************************************************";\
|
||||
elif [ x`uname -r` = x"5.10" ]; then\
|
||||
echo "*****************************************************************";\
|
||||
echo "* If you are seeing 'syntax error near \"umpiconninfo_t\"' on Solaris";\
|
||||
echo "* 10, try doing 'cd /usr/lib/dtrace && gzip mpi.d' as root, ";\
|
||||
echo "* or set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
|
||||
echo "* to disable dtrace probes for this build.";\
|
||||
echo "*****************************************************************";\
|
||||
else \
|
||||
echo "*****************************************************************";\
|
||||
echo "* If you cannot fix dtrace build issues, try to ";\
|
||||
echo "* set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
|
||||
echo "* to disable dtrace probes for this build.";\
|
||||
echo "*****************************************************************";\
|
||||
fi; \
|
||||
fi;\
|
||||
exit $$STATUS
|
||||
# Since some DTraced_Files are in LIBJVM.o and they are touched by this
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
REM
|
||||
REM Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
REM Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
REM
|
||||
REM This code is free software; you can redistribute it and/or modify it
|
||||
@@ -148,7 +148,7 @@ echo HotSpotJDKDist=%HotSpotJDKDist%
|
||||
|
||||
REM This is now safe to do.
|
||||
:copyfiles
|
||||
for /D %%i in (compiler1, compiler2, tiered, core) do (
|
||||
for /D %%i in (compiler1, compiler2, tiered ) do (
|
||||
if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
|
||||
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
|
||||
)
|
||||
@@ -156,7 +156,7 @@ copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\
|
||||
REM force regneration of ProjectFile
|
||||
if exist %ProjectFile% del %ProjectFile%
|
||||
|
||||
for /D %%i in (compiler1, compiler2, tiered, core) do (
|
||||
for /D %%i in (compiler1, compiler2, tiered ) do (
|
||||
echo -- %%i --
|
||||
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
|
||||
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
|
||||
|
||||
@@ -73,19 +73,17 @@ done
|
||||
|
||||
BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles ${GENERATED}/tracefiles"
|
||||
|
||||
if [ -d "${ALTSRC}/share/vm/jfr" ]; then
|
||||
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr"
|
||||
if [ -d "${ALTSRC}/share/vm/jfr/buffers" ]; then
|
||||
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/buffers"
|
||||
fi
|
||||
|
||||
BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/prims/wbtestmethods"
|
||||
|
||||
CORE_PATHS="${BASE_PATHS}"
|
||||
# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
|
||||
if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then
|
||||
CORE_PATHS="${CORE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
|
||||
BASE_PATHS="${BASE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
|
||||
fi
|
||||
CORE_PATHS="${CORE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
|
||||
BASE_PATHS="${BASE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
|
||||
|
||||
if [ -d "${ALTSRC}/share/vm/c1" ]; then
|
||||
COMPILER1_PATHS="${ALTSRC}/share/vm/c1"
|
||||
@@ -104,12 +102,11 @@ COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"
|
||||
|
||||
# Include dirs per type.
|
||||
case "${TYPE}" in
|
||||
"core") Src_Dirs="${CORE_PATHS}" ;;
|
||||
"compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;;
|
||||
"compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;;
|
||||
"tiered") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
|
||||
"zero") Src_Dirs="${CORE_PATHS}" ;;
|
||||
"shark") Src_Dirs="${CORE_PATHS}" ;;
|
||||
"compiler1") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;
|
||||
"compiler2") Src_Dirs="${BASE_PATHS} ${COMPILER2_PATHS}" ;;
|
||||
"tiered") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
|
||||
"zero") Src_Dirs="${BASE_PATHS}" ;;
|
||||
"shark") Src_Dirs="${BASE_PATHS}" ;;
|
||||
esac
|
||||
|
||||
COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*"
|
||||
@@ -122,7 +119,6 @@ Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp"
|
||||
|
||||
# Exclude per type.
|
||||
case "${TYPE}" in
|
||||
"core") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
|
||||
"compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
|
||||
"compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
|
||||
"tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
|
||||
@@ -149,9 +145,17 @@ for e in ${Src_Dirs}; do
|
||||
Src_Files="${Src_Files}`findsrc ${e}` "
|
||||
done
|
||||
|
||||
Obj_Files=
|
||||
Obj_Files=" "
|
||||
for e in ${Src_Files}; do
|
||||
Obj_Files="${Obj_Files}${e%\.[!.]*}.obj "
|
||||
o="${e%\.[!.]*}.obj"
|
||||
set +e
|
||||
chk=`expr "${Obj_Files}" : ".* $o"`
|
||||
set -e
|
||||
if [ "$chk" != 0 ]; then
|
||||
echo "# INFO: skipping duplicate $o"
|
||||
continue
|
||||
fi
|
||||
Obj_Files="${Obj_Files}$o "
|
||||
done
|
||||
|
||||
echo Obj_Files=${Obj_Files}
|
||||
|
||||
@@ -55,13 +55,11 @@ CXX_INCLUDE_DIRS=\
|
||||
|
||||
!if "$(Platform_arch_model)" == "$(Platform_arch)"
|
||||
SOURCES_AD=\
|
||||
$(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad \
|
||||
$(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad
|
||||
$(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad
|
||||
!else
|
||||
SOURCES_AD=\
|
||||
$(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad \
|
||||
$(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad \
|
||||
$(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad
|
||||
$(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad
|
||||
!endif
|
||||
|
||||
# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 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
|
||||
@@ -110,6 +110,7 @@ CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP
|
||||
# 1400 is for VS2005
|
||||
# 1500 is for VS2008
|
||||
# 1600 is for VS2010
|
||||
# 1700 is for VS2012
|
||||
# Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
|
||||
# compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
|
||||
# Normally they are the same, but a pre-release of the VS2005 compilers
|
||||
@@ -142,6 +143,9 @@ COMPILER_NAME=VS2008
|
||||
!if "$(MSC_VER)" == "1600"
|
||||
COMPILER_NAME=VS2010
|
||||
!endif
|
||||
!if "$(MSC_VER)" == "1700"
|
||||
COMPILER_NAME=VS2012
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# By default, we do not want to use the debug version of the msvcrt.dll file
|
||||
@@ -151,9 +155,13 @@ MS_RUNTIME_OPTION = /MD
|
||||
MS_RUNTIME_OPTION = /MTd /D "_DEBUG"
|
||||
!endif
|
||||
|
||||
# VS2012 and later won't work with:
|
||||
# /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
|
||||
!if "$(MSC_VER)" < "1700"
|
||||
# Always add the _STATIC_CPPLIB flag
|
||||
STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
|
||||
MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)
|
||||
!endif
|
||||
CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
|
||||
|
||||
# How /GX option is spelled
|
||||
@@ -221,6 +229,22 @@ LD_FLAGS = /SAFESEH $(LD_FLAGS)
|
||||
!endif
|
||||
!endif
|
||||
|
||||
!if "$(COMPILER_NAME)" == "VS2012"
|
||||
PRODUCT_OPT_OPTION = /O2 /Oy-
|
||||
FASTDEBUG_OPT_OPTION = /O2 /Oy-
|
||||
DEBUG_OPT_OPTION = /Od
|
||||
GX_OPTION = /EHsc
|
||||
LD_FLAGS = /manifest $(LD_FLAGS)
|
||||
# Manifest Tool - used in VS2005 and later to adjust manifests stored
|
||||
# as resources inside build artifacts.
|
||||
!if "x$(MT)" == "x"
|
||||
MT=mt.exe
|
||||
!endif
|
||||
!if "$(BUILDARCH)" == "i486"
|
||||
LD_FLAGS = /SAFESEH $(LD_FLAGS)
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# If NO_OPTIMIZATIONS is defined in the environment, turn everything off
|
||||
!ifdef NO_OPTIMIZATIONS
|
||||
PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION)
|
||||
|
||||
@@ -44,10 +44,11 @@ ProjectCreatorSources=\
|
||||
|
||||
# This is only used internally
|
||||
ProjectCreatorIncludesPRIVATE=\
|
||||
-relativeInclude src\closed\share\vm \
|
||||
-relativeInclude src\closed\os\windows\vm \
|
||||
-relativeInclude src\closed\os_cpu\windows_$(Platform_arch)\vm \
|
||||
-relativeInclude src\closed\cpu\$(Platform_arch)\vm \
|
||||
-relativeAltSrcInclude src\closed \
|
||||
-altRelativeInclude share\vm \
|
||||
-altRelativeInclude os\windows\vm \
|
||||
-altRelativeInclude os_cpu\windows_$(Platform_arch)\vm \
|
||||
-altRelativeInclude cpu\$(Platform_arch)\vm \
|
||||
-relativeInclude src\share\vm \
|
||||
-relativeInclude src\share\vm\precompiled \
|
||||
-relativeInclude src\share\vm\prims\wbtestmethods \
|
||||
@@ -91,7 +92,7 @@ ProjectCreatorIDEOptions = \
|
||||
-disablePch getThread_windows_$(Platform_arch).cpp \
|
||||
-disablePch_compiler2 opcodes.cpp
|
||||
|
||||
# Common options for the IDE builds for core, c1, and c2
|
||||
# Common options for the IDE builds for c1, and c2
|
||||
ProjectCreatorIDEOptions=\
|
||||
$(ProjectCreatorIDEOptions) \
|
||||
-sourceBase $(HOTSPOTWORKSPACE) \
|
||||
@@ -157,19 +158,11 @@ ProjectCreatorIDEOptionsIgnoreCompiler2=\
|
||||
-ignoreFile_TARGET ciTypeFlow.hpp \
|
||||
-ignoreFile_TARGET $(Platform_arch_model).ad
|
||||
|
||||
##################################################
|
||||
# Without compiler(core) specific options
|
||||
##################################################
|
||||
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
|
||||
$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=core) \
|
||||
$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core)
|
||||
|
||||
##################################################
|
||||
# Client(C1) compiler specific options
|
||||
##################################################
|
||||
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
|
||||
-define_compiler1 COMPILER1 \
|
||||
-ignorePath_compiler1 core \
|
||||
$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
|
||||
|
||||
##################################################
|
||||
@@ -178,7 +171,6 @@ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
|
||||
#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
|
||||
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
|
||||
-define_compiler2 COMPILER2 \
|
||||
-ignorePath_compiler2 core \
|
||||
-additionalFile_compiler2 $(Platform_arch_model).ad \
|
||||
-additionalFile_compiler2 ad_$(Platform_arch_model).cpp \
|
||||
-additionalFile_compiler2 ad_$(Platform_arch_model).hpp \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2006, 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
|
||||
@@ -27,9 +27,9 @@
|
||||
all: checkCL checkLink
|
||||
|
||||
checkCL:
|
||||
@ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" \
|
||||
@ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" if "$(MSC_VER)" NEQ "1700" \
|
||||
echo *** WARNING *** unrecognized cl.exe version $(MSC_VER) ($(RAW_MSC_VER)). Use FORCE_MSC_VER to override automatic detection.
|
||||
|
||||
checkLink:
|
||||
@ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" \
|
||||
@ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" if "$(LD_VER)" NEQ "1100" \
|
||||
echo *** WARNING *** unrecognized link.exe version $(LD_VER) ($(RAW_LD_VER)). Use FORCE_LD_VER to override automatic detection.
|
||||
|
||||
@@ -90,25 +90,25 @@ $(TraceOutDir)/traceTypes.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceType
|
||||
!if "$(OPENJDK)" == "true"
|
||||
|
||||
$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventClasses.xsl $(XML_DEPS)
|
||||
@echo Generating $@
|
||||
@echo Generating OpenJDK $@
|
||||
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
|
||||
|
||||
!else
|
||||
|
||||
$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventClasses.xsl $(XML_DEPS)
|
||||
@echo Generating $@
|
||||
@echo Generating AltSrc $@
|
||||
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
|
||||
|
||||
$(TraceOutDir)/traceProducer.cpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceProducer.xsl $(XML_DEPS)
|
||||
@echo Generating $@
|
||||
@echo Generating AltSrc $@
|
||||
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceProducer.xsl -OUT $(TraceOutDir)/traceProducer.cpp
|
||||
|
||||
$(TraceOutDir)/traceRequestables.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceRequestables.xsl $(XML_DEPS)
|
||||
@echo Generating $@
|
||||
@echo Generating AltSrc $@
|
||||
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceRequestables.xsl -OUT $(TraceOutDir)/traceRequestables.hpp
|
||||
|
||||
$(TraceOutDir)/traceEventControl.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventControl.xsl $(XML_DEPS)
|
||||
@echo Generating $@
|
||||
@echo Generating AltSrc $@
|
||||
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventControl.xsl -OUT $(TraceOutDir)/traceEventControl.hpp
|
||||
|
||||
!endif
|
||||
|
||||
@@ -36,10 +36,6 @@ CXX_FLAGS=$(CXX_FLAGS) /D "PRODUCT"
|
||||
CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT"
|
||||
!endif
|
||||
|
||||
!if "$(Variant)" == "core"
|
||||
# No need to define anything, CORE is defined as !COMPILER1 && !COMPILER2
|
||||
!endif
|
||||
|
||||
!if "$(Variant)" == "compiler1"
|
||||
CXX_FLAGS=$(CXX_FLAGS) /D "COMPILER1"
|
||||
!endif
|
||||
@@ -132,6 +128,10 @@ CXX_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER
|
||||
|
||||
!if "$(USE_PRECOMPILED_HEADER)" != "0"
|
||||
CXX_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp"
|
||||
!if "$(COMPILER_NAME)" == "VS2012"
|
||||
# VS2012 requires this object file to be listed:
|
||||
LD_FLAGS=$(LD_FLAGS) _build_pch_file.obj
|
||||
!endif
|
||||
!else
|
||||
CXX_USE_PCH=$(CXX_DONT_USE_PCH)
|
||||
!endif
|
||||
|
||||
@@ -112,6 +112,7 @@ ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -def
|
||||
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
|
||||
|
||||
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
|
||||
@if "$(MSC_VER)"=="1500" echo Make sure you have VS2008 SP1 or later, or you may see 'expanded command line too long'
|
||||
@$(RUN_JAVA) -Djava.class.path="$(HOTSPOTBUILDSPACE)/classes" ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
|
||||
|
||||
clean:
|
||||
|
||||
@@ -42,7 +42,7 @@ define_pd_global(bool, ProfileInterpreter, false);
|
||||
#else
|
||||
define_pd_global(bool, ProfileInterpreter, true);
|
||||
#endif // CC_INTERP
|
||||
define_pd_global(bool, TieredCompilation, false);
|
||||
define_pd_global(bool, TieredCompilation, trueInTiered);
|
||||
define_pd_global(intx, CompileThreshold, 10000);
|
||||
define_pd_global(intx, BackEdgeThreshold, 140000);
|
||||
|
||||
|
||||
@@ -240,10 +240,10 @@ inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
|
||||
#endif // CC_INTERP
|
||||
|
||||
|
||||
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
|
||||
inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
|
||||
// note: adjust this code if the link argument in StubGenerator::call_stub() changes!
|
||||
const Argument link = Argument(0, false);
|
||||
return (JavaCallWrapper*)sp()[link.as_in().as_register()->sp_offset_in_saved_window()];
|
||||
return (JavaCallWrapper**)&sp()[link.as_in().as_register()->sp_offset_in_saved_window()];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/cardTableModRefBS.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/biasedLocking.hpp"
|
||||
#include "runtime/interfaceSupport.hpp"
|
||||
@@ -1145,7 +1146,7 @@ void MacroAssembler::set_narrow_klass(Klass* k, Register d) {
|
||||
assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
narrowOop encoded_k = oopDesc::encode_klass(k);
|
||||
narrowOop encoded_k = Klass::encode_klass(k);
|
||||
|
||||
assert_not_delayed();
|
||||
// Relocation with special format (see relocInfo_sparc.hpp).
|
||||
@@ -1419,7 +1420,6 @@ void MacroAssembler::verify_oop_subroutine() {
|
||||
load_klass(O0_obj, O0_obj);
|
||||
// assert((klass != NULL)
|
||||
br_null_short(O0_obj, pn, fail);
|
||||
// TODO: Future assert that klass is lower 4g memory for UseCompressedKlassPointers
|
||||
|
||||
wrccr( O5_save_flags ); // Restore CCR's
|
||||
|
||||
@@ -4089,52 +4089,91 @@ void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) {
|
||||
}
|
||||
|
||||
void MacroAssembler::encode_klass_not_null(Register r) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
if (Universe::narrow_klass_base() != NULL)
|
||||
sub(r, G6_heapbase, r);
|
||||
srlx(r, LogKlassAlignmentInBytes, r);
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
assert(r != G6_heapbase, "bad register choice");
|
||||
set((intptr_t)Universe::narrow_klass_base(), G6_heapbase);
|
||||
sub(r, G6_heapbase, r);
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
srlx(r, LogKlassAlignmentInBytes, r);
|
||||
}
|
||||
reinit_heapbase();
|
||||
}
|
||||
|
||||
void MacroAssembler::encode_klass_not_null(Register src, Register dst) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
if (Universe::narrow_klass_base() == NULL) {
|
||||
srlx(src, LogKlassAlignmentInBytes, dst);
|
||||
if (src == dst) {
|
||||
encode_klass_not_null(src);
|
||||
} else {
|
||||
sub(src, G6_heapbase, dst);
|
||||
srlx(dst, LogKlassAlignmentInBytes, dst);
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
set((intptr_t)Universe::narrow_klass_base(), dst);
|
||||
sub(src, dst, dst);
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
srlx(dst, LogKlassAlignmentInBytes, dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Function instr_size_for_decode_klass_not_null() counts the instructions
|
||||
// generated by decode_klass_not_null() and reinit_heapbase(). Hence, if
|
||||
// the instructions they generate change, then this method needs to be updated.
|
||||
int MacroAssembler::instr_size_for_decode_klass_not_null() {
|
||||
assert (UseCompressedKlassPointers, "only for compressed klass ptrs");
|
||||
// set + add + set
|
||||
int num_instrs = insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + 1 +
|
||||
insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base());
|
||||
if (Universe::narrow_klass_shift() == 0) {
|
||||
return num_instrs * BytesPerInstWord;
|
||||
} else { // sllx
|
||||
return (num_instrs + 1) * BytesPerInstWord;
|
||||
}
|
||||
}
|
||||
|
||||
// !!! If the instructions that get generated here change then function
|
||||
// instr_size_for_decode_klass_not_null() needs to get updated.
|
||||
void MacroAssembler::decode_klass_not_null(Register r) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
// Do not add assert code to this unless you change vtableStubs_sparc.cpp
|
||||
// pd_code_size_limit.
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
sllx(r, LogKlassAlignmentInBytes, r);
|
||||
if (Universe::narrow_klass_base() != NULL)
|
||||
add(r, G6_heapbase, r);
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
assert(r != G6_heapbase, "bad register choice");
|
||||
set((intptr_t)Universe::narrow_klass_base(), G6_heapbase);
|
||||
if (Universe::narrow_klass_shift() != 0)
|
||||
sllx(r, LogKlassAlignmentInBytes, r);
|
||||
add(r, G6_heapbase, r);
|
||||
reinit_heapbase();
|
||||
}
|
||||
|
||||
void MacroAssembler::decode_klass_not_null(Register src, Register dst) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
// Do not add assert code to this unless you change vtableStubs_sparc.cpp
|
||||
// pd_code_size_limit.
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
sllx(src, LogKlassAlignmentInBytes, dst);
|
||||
if (Universe::narrow_klass_base() != NULL)
|
||||
add(dst, G6_heapbase, dst);
|
||||
if (src == dst) {
|
||||
decode_klass_not_null(src);
|
||||
} else {
|
||||
// Do not add assert code to this unless you change vtableStubs_sparc.cpp
|
||||
// pd_code_size_limit.
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice");
|
||||
set((intptr_t)Universe::narrow_klass_base(), G6_heapbase);
|
||||
sllx(src, LogKlassAlignmentInBytes, dst);
|
||||
add(dst, G6_heapbase, dst);
|
||||
reinit_heapbase();
|
||||
} else {
|
||||
set((intptr_t)Universe::narrow_klass_base(), dst);
|
||||
add(src, dst, dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::reinit_heapbase() {
|
||||
if (UseCompressedOops || UseCompressedKlassPointers) {
|
||||
AddressLiteral base(Universe::narrow_ptrs_base_addr());
|
||||
load_ptr_contents(base, G6_heapbase);
|
||||
if (Universe::heap() != NULL) {
|
||||
set((intptr_t)Universe::narrow_ptrs_base(), G6_heapbase);
|
||||
} else {
|
||||
AddressLiteral base(Universe::narrow_ptrs_base_addr());
|
||||
load_ptr_contents(base, G6_heapbase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1177,6 +1177,9 @@ public:
|
||||
void push_CPU_state();
|
||||
void pop_CPU_state();
|
||||
|
||||
// Returns the byte size of the instructions generated by decode_klass_not_null().
|
||||
static int instr_size_for_decode_klass_not_null();
|
||||
|
||||
// if heap base register is used - reinit it with the correct value
|
||||
void reinit_heapbase();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@@ -97,7 +97,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
|
||||
guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
|
||||
if (format() != 0) {
|
||||
assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type, "only narrow oops or klasses case");
|
||||
jint np = type() == relocInfo::oop_type ? oopDesc::encode_heap_oop((oop)x) : oopDesc::encode_klass((Klass*)x);
|
||||
jint np = type() == relocInfo::oop_type ? oopDesc::encode_heap_oop((oop)x) : Klass::encode_klass((Klass*)x);
|
||||
inst &= ~Assembler::hi22(-1);
|
||||
inst |= Assembler::hi22((intptr_t)np);
|
||||
if (verify_only) {
|
||||
|
||||
@@ -559,10 +559,7 @@ int MachCallDynamicJavaNode::ret_addr_offset() {
|
||||
int klass_load_size;
|
||||
if (UseCompressedKlassPointers) {
|
||||
assert(Universe::heap() != NULL, "java heap should be initialized");
|
||||
if (Universe::narrow_klass_base() == NULL)
|
||||
klass_load_size = 2*BytesPerInstWord; // see MacroAssembler::load_klass()
|
||||
else
|
||||
klass_load_size = 3*BytesPerInstWord;
|
||||
klass_load_size = MacroAssembler::instr_size_for_decode_klass_not_null() + 1*BytesPerInstWord;
|
||||
} else {
|
||||
klass_load_size = 1*BytesPerInstWord;
|
||||
}
|
||||
@@ -1663,9 +1660,12 @@ void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
|
||||
if (UseCompressedKlassPointers) {
|
||||
assert(Universe::heap() != NULL, "java heap should be initialized");
|
||||
st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass");
|
||||
st->print_cr("\tSLL R_G5,3,R_G5");
|
||||
if (Universe::narrow_klass_base() != NULL)
|
||||
st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5");
|
||||
st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base");
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
st->print_cr("\tSLL R_G5,3,R_G5");
|
||||
}
|
||||
st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5");
|
||||
st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base");
|
||||
} else {
|
||||
st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check");
|
||||
}
|
||||
@@ -2563,10 +2563,7 @@ encode %{
|
||||
int klass_load_size;
|
||||
if (UseCompressedKlassPointers) {
|
||||
assert(Universe::heap() != NULL, "java heap should be initialized");
|
||||
if (Universe::narrow_klass_base() == NULL)
|
||||
klass_load_size = 2*BytesPerInstWord;
|
||||
else
|
||||
klass_load_size = 3*BytesPerInstWord;
|
||||
klass_load_size = MacroAssembler::instr_size_for_decode_klass_not_null() + 1*BytesPerInstWord;
|
||||
} else {
|
||||
klass_load_size = 1*BytesPerInstWord;
|
||||
}
|
||||
|
||||
@@ -1887,6 +1887,27 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
||||
if (ProfileInterpreter) {
|
||||
__ set_method_data_pointer_for_bcp();
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
if (EnableInvokeDynamic) {
|
||||
Label L_done;
|
||||
|
||||
__ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode
|
||||
__ cmp_and_br_short(G1_scratch, Bytecodes::_invokestatic, Assembler::notEqual, Assembler::pn, L_done);
|
||||
|
||||
// The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
|
||||
// Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
|
||||
|
||||
__ call_VM(G1_scratch, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), I0, Lmethod, Lbcp);
|
||||
|
||||
__ br_null(G1_scratch, false, Assembler::pn, L_done);
|
||||
__ delayed()->nop();
|
||||
|
||||
__ st_ptr(G1_scratch, Lesp, wordSize);
|
||||
__ bind(L_done);
|
||||
}
|
||||
#endif // INCLUDE_JVMTI
|
||||
|
||||
// Resume bytecode interpretation at the current bcp
|
||||
__ dispatch_next(vtos);
|
||||
// end of JVMTI PopFrame support
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@@ -219,13 +219,13 @@ int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
|
||||
const int basic = 5*BytesPerInstWord +
|
||||
// shift;add for load_klass (only shift with zero heap based)
|
||||
(UseCompressedKlassPointers ?
|
||||
((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
|
||||
MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
return basic + slop;
|
||||
} else {
|
||||
const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord +
|
||||
// shift;add for load_klass (only shift with zero heap based)
|
||||
(UseCompressedKlassPointers ?
|
||||
((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
|
||||
MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
return (basic + slop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ define_pd_global(bool, ProfileInterpreter, false);
|
||||
#else
|
||||
define_pd_global(bool, ProfileInterpreter, true);
|
||||
#endif // CC_INTERP
|
||||
define_pd_global(bool, TieredCompilation, false);
|
||||
define_pd_global(bool, TieredCompilation, trueInTiered);
|
||||
define_pd_global(intx, CompileThreshold, 10000);
|
||||
define_pd_global(intx, BackEdgeThreshold, 100000);
|
||||
|
||||
|
||||
@@ -272,11 +272,10 @@ inline jint frame::interpreter_frame_expression_stack_direction() { return -1; }
|
||||
|
||||
// Entry frames
|
||||
|
||||
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
|
||||
return (JavaCallWrapper*)at(entry_frame_call_wrapper_offset);
|
||||
inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
|
||||
return (JavaCallWrapper**)addr_at(entry_frame_call_wrapper_offset);
|
||||
}
|
||||
|
||||
|
||||
// Compiled frames
|
||||
|
||||
inline int frame::local_offset_for_compiler(int local_index, int nof_args, int max_nof_locals, int max_nof_monitors) {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/cardTableModRefBS.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/biasedLocking.hpp"
|
||||
#include "runtime/interfaceSupport.hpp"
|
||||
@@ -4810,23 +4811,8 @@ void MacroAssembler::load_klass(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void MacroAssembler::load_prototype_header(Register dst, Register src) {
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) {
|
||||
assert (Universe::heap() != NULL, "java heap should be initialized");
|
||||
movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
|
||||
movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset()));
|
||||
} else {
|
||||
movq(dst, Address(dst, Klass::prototype_header_offset()));
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
movptr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
movptr(dst, Address(dst, Klass::prototype_header_offset()));
|
||||
}
|
||||
load_klass(dst, src);
|
||||
movptr(dst, Address(dst, Klass::prototype_header_offset()));
|
||||
}
|
||||
|
||||
void MacroAssembler::store_klass(Register dst, Register src) {
|
||||
@@ -4914,7 +4900,7 @@ void MacroAssembler::store_klass_gap(Register dst, Register src) {
|
||||
|
||||
#ifdef ASSERT
|
||||
void MacroAssembler::verify_heapbase(const char* msg) {
|
||||
assert (UseCompressedOops || UseCompressedKlassPointers, "should be compressed");
|
||||
assert (UseCompressedOops, "should be compressed");
|
||||
assert (Universe::heap() != NULL, "java heap should be initialized");
|
||||
if (CheckCompressedOops) {
|
||||
Label ok;
|
||||
@@ -5058,69 +5044,80 @@ void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) {
|
||||
}
|
||||
|
||||
void MacroAssembler::encode_klass_not_null(Register r) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
#ifdef ASSERT
|
||||
verify_heapbase("MacroAssembler::encode_klass_not_null: heap base corrupted?");
|
||||
#endif
|
||||
if (Universe::narrow_klass_base() != NULL) {
|
||||
subq(r, r12_heapbase);
|
||||
}
|
||||
assert(Universe::narrow_klass_base() != NULL, "Base should be initialized");
|
||||
// Use r12 as a scratch register in which to temporarily load the narrow_klass_base.
|
||||
assert(r != r12_heapbase, "Encoding a klass in r12");
|
||||
mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base());
|
||||
subq(r, r12_heapbase);
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
shrq(r, LogKlassAlignmentInBytes);
|
||||
}
|
||||
reinit_heapbase();
|
||||
}
|
||||
|
||||
void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
#ifdef ASSERT
|
||||
verify_heapbase("MacroAssembler::encode_klass_not_null2: heap base corrupted?");
|
||||
#endif
|
||||
if (dst != src) {
|
||||
movq(dst, src);
|
||||
}
|
||||
if (Universe::narrow_klass_base() != NULL) {
|
||||
subq(dst, r12_heapbase);
|
||||
}
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
shrq(dst, LogKlassAlignmentInBytes);
|
||||
if (dst == src) {
|
||||
encode_klass_not_null(src);
|
||||
} else {
|
||||
mov64(dst, (int64_t)Universe::narrow_klass_base());
|
||||
negq(dst);
|
||||
addq(dst, src);
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
shrq(dst, LogKlassAlignmentInBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Function instr_size_for_decode_klass_not_null() counts the instructions
|
||||
// generated by decode_klass_not_null(register r) and reinit_heapbase(),
|
||||
// when (Universe::heap() != NULL). Hence, if the instructions they
|
||||
// generate change, then this method needs to be updated.
|
||||
int MacroAssembler::instr_size_for_decode_klass_not_null() {
|
||||
assert (UseCompressedKlassPointers, "only for compressed klass ptrs");
|
||||
// mov64 + addq + shlq? + mov64 (for reinit_heapbase()).
|
||||
return (Universe::narrow_klass_shift() == 0 ? 20 : 24);
|
||||
}
|
||||
|
||||
// !!! If the instructions that get generated here change then function
|
||||
// instr_size_for_decode_klass_not_null() needs to get updated.
|
||||
void MacroAssembler::decode_klass_not_null(Register r) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
// Note: it will change flags
|
||||
assert(Universe::narrow_klass_base() != NULL, "Base should be initialized");
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
assert(r != r12_heapbase, "Decoding a klass in r12");
|
||||
// Cannot assert, unverified entry point counts instructions (see .ad file)
|
||||
// vtableStubs also counts instructions in pd_code_size_limit.
|
||||
// Also do not verify_oop as this is called by verify_oop.
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
shlq(r, LogKlassAlignmentInBytes);
|
||||
if (Universe::narrow_klass_base() != NULL) {
|
||||
addq(r, r12_heapbase);
|
||||
}
|
||||
} else {
|
||||
assert (Universe::narrow_klass_base() == NULL, "sanity");
|
||||
}
|
||||
// Use r12 as a scratch register in which to temporarily load the narrow_klass_base.
|
||||
mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base());
|
||||
addq(r, r12_heapbase);
|
||||
reinit_heapbase();
|
||||
}
|
||||
|
||||
void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
|
||||
assert(Metaspace::is_initialized(), "metaspace should be initialized");
|
||||
// Note: it will change flags
|
||||
assert(Universe::narrow_klass_base() != NULL, "Base should be initialized");
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
// Cannot assert, unverified entry point counts instructions (see .ad file)
|
||||
// vtableStubs also counts instructions in pd_code_size_limit.
|
||||
// Also do not verify_oop as this is called by verify_oop.
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
|
||||
leaq(dst, Address(r12_heapbase, src, Address::times_8, 0));
|
||||
if (dst == src) {
|
||||
decode_klass_not_null(dst);
|
||||
} else {
|
||||
assert (Universe::narrow_klass_base() == NULL, "sanity");
|
||||
if (dst != src) {
|
||||
movq(dst, src);
|
||||
// Cannot assert, unverified entry point counts instructions (see .ad file)
|
||||
// vtableStubs also counts instructions in pd_code_size_limit.
|
||||
// Also do not verify_oop as this is called by verify_oop.
|
||||
|
||||
mov64(dst, (int64_t)Universe::narrow_klass_base());
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
|
||||
assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
|
||||
leaq(dst, Address(dst, src, Address::times_8, 0));
|
||||
} else {
|
||||
addq(dst, src);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5148,7 +5145,7 @@ void MacroAssembler::set_narrow_klass(Register dst, Klass* k) {
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
mov_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
|
||||
mov_narrow_oop(dst, Klass::encode_klass(k), rspec);
|
||||
}
|
||||
|
||||
void MacroAssembler::set_narrow_klass(Address dst, Klass* k) {
|
||||
@@ -5156,7 +5153,7 @@ void MacroAssembler::set_narrow_klass(Address dst, Klass* k) {
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
mov_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
|
||||
mov_narrow_oop(dst, Klass::encode_klass(k), rspec);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmp_narrow_oop(Register dst, jobject obj) {
|
||||
@@ -5182,7 +5179,7 @@ void MacroAssembler::cmp_narrow_klass(Register dst, Klass* k) {
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
Assembler::cmp_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
|
||||
Assembler::cmp_narrow_oop(dst, Klass::encode_klass(k), rspec);
|
||||
}
|
||||
|
||||
void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) {
|
||||
@@ -5190,14 +5187,23 @@ void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) {
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
Assembler::cmp_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
|
||||
Assembler::cmp_narrow_oop(dst, Klass::encode_klass(k), rspec);
|
||||
}
|
||||
|
||||
void MacroAssembler::reinit_heapbase() {
|
||||
if (UseCompressedOops || UseCompressedKlassPointers) {
|
||||
movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
|
||||
if (Universe::heap() != NULL) {
|
||||
if (Universe::narrow_oop_base() == NULL) {
|
||||
MacroAssembler::xorptr(r12_heapbase, r12_heapbase);
|
||||
} else {
|
||||
mov64(r12_heapbase, (int64_t)Universe::narrow_ptrs_base());
|
||||
}
|
||||
} else {
|
||||
movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LP64
|
||||
|
||||
|
||||
|
||||
@@ -371,6 +371,10 @@ class MacroAssembler: public Assembler {
|
||||
void cmp_narrow_klass(Register dst, Klass* k);
|
||||
void cmp_narrow_klass(Address dst, Klass* k);
|
||||
|
||||
// Returns the byte size of the instructions generated by decode_klass_not_null()
|
||||
// when compressed klass pointers are being used.
|
||||
static int instr_size_for_decode_klass_not_null();
|
||||
|
||||
// if heap base register is used - reinit it with the correct value
|
||||
void reinit_heapbase();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@@ -55,9 +55,9 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
|
||||
}
|
||||
} else {
|
||||
if (verify_only) {
|
||||
assert(*(uint32_t*) disp == oopDesc::encode_klass((Klass*)x), "instructions must match");
|
||||
assert(*(uint32_t*) disp == Klass::encode_klass((Klass*)x), "instructions must match");
|
||||
} else {
|
||||
*(int32_t*) disp = oopDesc::encode_klass((Klass*)x);
|
||||
*(int32_t*) disp = Klass::encode_klass((Klass*)x);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -675,7 +675,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ movptr(rax, Address(rax, oopDesc::klass_offset_in_bytes())); // get klass
|
||||
__ testptr(rax, rax);
|
||||
__ jcc(Assembler::zero, error); // if klass is NULL it is broken
|
||||
// TODO: Future assert that klass is lower 4g memory for UseCompressedKlassPointers
|
||||
|
||||
// return if everything seems ok
|
||||
__ bind(exit);
|
||||
|
||||
@@ -279,7 +279,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ stmxcsr(mxcsr_save);
|
||||
__ movl(rax, mxcsr_save);
|
||||
__ andl(rax, MXCSR_MASK); // Only check control and mask bits
|
||||
ExternalAddress mxcsr_std(StubRoutines::x86::mxcsr_std());
|
||||
ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std());
|
||||
__ cmp32(rax, mxcsr_std);
|
||||
__ jcc(Assembler::equal, skip_ldmx);
|
||||
__ ldmxcsr(mxcsr_std);
|
||||
@@ -729,17 +729,18 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
if (CheckJNICalls) {
|
||||
Label ok_ret;
|
||||
ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std());
|
||||
__ push(rax);
|
||||
__ subptr(rsp, wordSize); // allocate a temp location
|
||||
__ stmxcsr(mxcsr_save);
|
||||
__ movl(rax, mxcsr_save);
|
||||
__ andl(rax, MXCSR_MASK); // Only check control and mask bits
|
||||
__ cmpl(rax, *(int *)(StubRoutines::x86::mxcsr_std()));
|
||||
__ cmp32(rax, mxcsr_std);
|
||||
__ jcc(Assembler::equal, ok_ret);
|
||||
|
||||
__ warn("MXCSR changed by native JNI code, use -XX:+RestoreMXCSROnJNICall");
|
||||
|
||||
__ ldmxcsr(ExternalAddress(StubRoutines::x86::mxcsr_std()));
|
||||
__ ldmxcsr(mxcsr_std);
|
||||
|
||||
__ bind(ok_ret);
|
||||
__ addptr(rsp, wordSize);
|
||||
@@ -1020,7 +1021,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ load_klass(rax, rax); // get klass
|
||||
__ testptr(rax, rax);
|
||||
__ jcc(Assembler::zero, error); // if klass is NULL it is broken
|
||||
// TODO: Future assert that klass is lower 4g memory for UseCompressedKlassPointers
|
||||
|
||||
// return if everything seems ok
|
||||
__ bind(exit);
|
||||
@@ -3767,12 +3767,35 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return stub->entry_point();
|
||||
}
|
||||
|
||||
void create_control_words() {
|
||||
// Round to nearest, 53-bit mode, exceptions masked
|
||||
StubRoutines::_fpu_cntrl_wrd_std = 0x027F;
|
||||
// Round to zero, 53-bit mode, exception mased
|
||||
StubRoutines::_fpu_cntrl_wrd_trunc = 0x0D7F;
|
||||
// Round to nearest, 24-bit mode, exceptions masked
|
||||
StubRoutines::_fpu_cntrl_wrd_24 = 0x007F;
|
||||
// Round to nearest, 64-bit mode, exceptions masked
|
||||
StubRoutines::_fpu_cntrl_wrd_64 = 0x037F;
|
||||
// Round to nearest, 64-bit mode, exceptions masked
|
||||
StubRoutines::_mxcsr_std = 0x1F80;
|
||||
// Note: the following two constants are 80-bit values
|
||||
// layout is critical for correct loading by FPU.
|
||||
// Bias for strict fp multiply/divide
|
||||
StubRoutines::_fpu_subnormal_bias1[0]= 0x00000000; // 2^(-15360) == 0x03ff 8000 0000 0000 0000
|
||||
StubRoutines::_fpu_subnormal_bias1[1]= 0x80000000;
|
||||
StubRoutines::_fpu_subnormal_bias1[2]= 0x03ff;
|
||||
// Un-Bias for strict fp multiply/divide
|
||||
StubRoutines::_fpu_subnormal_bias2[0]= 0x00000000; // 2^(+15360) == 0x7bff 8000 0000 0000 0000
|
||||
StubRoutines::_fpu_subnormal_bias2[1]= 0x80000000;
|
||||
StubRoutines::_fpu_subnormal_bias2[2]= 0x7bff;
|
||||
}
|
||||
|
||||
// Initialization
|
||||
void generate_initial() {
|
||||
// Generates all stubs and initializes the entry points
|
||||
|
||||
// This platform-specific stub is needed by generate_call_stub()
|
||||
StubRoutines::x86::_mxcsr_std = generate_fp_mask("mxcsr_std", 0x0000000000001F80);
|
||||
// This platform-specific settings are needed by generate_call_stub()
|
||||
create_control_words();
|
||||
|
||||
// entry points that exist in all platforms Note: This is code
|
||||
// that could be shared among different platforms - however the
|
||||
|
||||
@@ -42,4 +42,3 @@ address StubRoutines::x86::_float_sign_mask = NULL;
|
||||
address StubRoutines::x86::_float_sign_flip = NULL;
|
||||
address StubRoutines::x86::_double_sign_mask = NULL;
|
||||
address StubRoutines::x86::_double_sign_flip = NULL;
|
||||
address StubRoutines::x86::_mxcsr_std = NULL;
|
||||
|
||||
@@ -52,7 +52,6 @@ class x86 {
|
||||
static address _float_sign_flip;
|
||||
static address _double_sign_mask;
|
||||
static address _double_sign_flip;
|
||||
static address _mxcsr_std;
|
||||
|
||||
public:
|
||||
|
||||
@@ -106,11 +105,6 @@ class x86 {
|
||||
return _double_sign_flip;
|
||||
}
|
||||
|
||||
static address mxcsr_std()
|
||||
{
|
||||
return _mxcsr_std;
|
||||
}
|
||||
|
||||
# include "stubRoutines_x86.hpp"
|
||||
|
||||
};
|
||||
|
||||
@@ -1920,6 +1920,29 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
||||
__ get_thread(thread);
|
||||
__ movl(Address(thread, JavaThread::popframe_condition_offset()), JavaThread::popframe_inactive);
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
if (EnableInvokeDynamic) {
|
||||
Label L_done;
|
||||
const Register local0 = rdi;
|
||||
|
||||
__ cmpb(Address(rsi, 0), Bytecodes::_invokestatic);
|
||||
__ jcc(Assembler::notEqual, L_done);
|
||||
|
||||
// The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
|
||||
// Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
|
||||
|
||||
__ get_method(rdx);
|
||||
__ movptr(rax, Address(local0, 0));
|
||||
__ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), rax, rdx, rsi);
|
||||
|
||||
__ testptr(rax, rax);
|
||||
__ jcc(Assembler::zero, L_done);
|
||||
|
||||
__ movptr(Address(rbx, 0), rax);
|
||||
__ bind(L_done);
|
||||
}
|
||||
#endif // INCLUDE_JVMTI
|
||||
|
||||
__ dispatch_next(vtos);
|
||||
// end of PopFrame support
|
||||
|
||||
|
||||
@@ -849,9 +849,9 @@ address InterpreterGenerator::generate_CRC32_update_entry() {
|
||||
address entry = __ pc();
|
||||
|
||||
// rbx,: Method*
|
||||
// rsi: senderSP must preserved for slow path, set SP to it on fast path
|
||||
// rdx: scratch
|
||||
// rdi: scratch
|
||||
// r13: senderSP must preserved for slow path, set SP to it on fast path
|
||||
// c_rarg0: scratch (rdi on non-Win64, rcx on Win64)
|
||||
// c_rarg1: scratch (rsi on non-Win64, rdx on Win64)
|
||||
|
||||
Label slow_path;
|
||||
// If we need a safepoint check, generate full interpreter entry.
|
||||
@@ -865,8 +865,8 @@ address InterpreterGenerator::generate_CRC32_update_entry() {
|
||||
|
||||
// Load parameters
|
||||
const Register crc = rax; // crc
|
||||
const Register val = rdx; // source java byte value
|
||||
const Register tbl = rdi; // scratch
|
||||
const Register val = c_rarg0; // source java byte value
|
||||
const Register tbl = c_rarg1; // scratch
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
__ movl(val, Address(rsp, wordSize)); // byte value
|
||||
@@ -880,7 +880,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() {
|
||||
|
||||
// _areturn
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set sp to sender sp
|
||||
__ mov(rsp, r13); // set sp to sender sp
|
||||
__ jmp(rdi);
|
||||
|
||||
// generate a vanilla native entry as the slow path
|
||||
@@ -919,20 +919,24 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret
|
||||
const Register crc = c_rarg0; // crc
|
||||
const Register buf = c_rarg1; // source java byte array address
|
||||
const Register len = c_rarg2; // length
|
||||
const Register off = len; // offset (never overlaps with 'len')
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
__ movl(len, Address(rsp, wordSize)); // Length
|
||||
// Calculate address of start element
|
||||
if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
|
||||
__ movptr(buf, Address(rsp, 3*wordSize)); // long buf
|
||||
__ addptr(buf, Address(rsp, 2*wordSize)); // + offset
|
||||
__ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
|
||||
__ addq(buf, off); // + offset
|
||||
__ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC
|
||||
} else {
|
||||
__ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array
|
||||
__ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
|
||||
__ addptr(buf, Address(rsp, 2*wordSize)); // + offset
|
||||
__ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
|
||||
__ addq(buf, off); // + offset
|
||||
__ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC
|
||||
}
|
||||
// Can now load 'len' since we're finished with 'off'
|
||||
__ movl(len, Address(rsp, wordSize)); // Length
|
||||
|
||||
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len);
|
||||
// result in rax
|
||||
@@ -1929,6 +1933,29 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
||||
__ movl(Address(r15_thread, JavaThread::popframe_condition_offset()),
|
||||
JavaThread::popframe_inactive);
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
if (EnableInvokeDynamic) {
|
||||
Label L_done;
|
||||
const Register local0 = r14;
|
||||
|
||||
__ cmpb(Address(r13, 0), Bytecodes::_invokestatic);
|
||||
__ jcc(Assembler::notEqual, L_done);
|
||||
|
||||
// The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
|
||||
// Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
|
||||
|
||||
__ get_method(rdx);
|
||||
__ movptr(rax, Address(local0, 0));
|
||||
__ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), rax, rdx, r13);
|
||||
|
||||
__ testptr(rax, rax);
|
||||
__ jcc(Assembler::zero, L_done);
|
||||
|
||||
__ movptr(Address(rbx, 0), rax);
|
||||
__ bind(L_done);
|
||||
}
|
||||
#endif // INCLUDE_JVMTI
|
||||
|
||||
__ dispatch_next(vtos);
|
||||
// end of PopFrame support
|
||||
|
||||
|
||||
@@ -211,11 +211,11 @@ int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
|
||||
if (is_vtable_stub) {
|
||||
// Vtable stub size
|
||||
return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0) +
|
||||
(UseCompressedKlassPointers ? 16 : 0); // 1 leaq can be 3 bytes + 1 long
|
||||
(UseCompressedKlassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
} else {
|
||||
// Itable stub size
|
||||
return (DebugVtables ? 512 : 74) + (CountCompiledCalls ? 13 : 0) +
|
||||
(UseCompressedKlassPointers ? 32 : 0); // 2 leaqs
|
||||
(UseCompressedKlassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
}
|
||||
// In order to tune these parameters, run the JVM with VM options
|
||||
// +PrintMiscellaneous and +WizardMode to see information about
|
||||
|
||||
@@ -1393,9 +1393,7 @@ void MachUEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
|
||||
{
|
||||
if (UseCompressedKlassPointers) {
|
||||
st->print_cr("movl rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
st->print_cr("\tdecode_klass_not_null rscratch1, rscratch1");
|
||||
}
|
||||
st->print_cr("\tdecode_klass_not_null rscratch1, rscratch1");
|
||||
st->print_cr("\tcmpq rax, rscratch1\t # Inline cache check");
|
||||
} else {
|
||||
st->print_cr("\tcmpq rax, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t"
|
||||
@@ -4035,146 +4033,6 @@ operand indPosIndexScaleOffsetNarrow(rRegN reg, immL32 off, rRegI idx, immI2 sca
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indirectNarrowKlass(rRegN reg)
|
||||
%{
|
||||
predicate(Universe::narrow_klass_shift() == 0);
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(DecodeNKlass reg);
|
||||
|
||||
format %{ "[$reg]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index(0x4);
|
||||
scale(0x0);
|
||||
disp(0x0);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indOffset8NarrowKlass(rRegN reg, immL8 off)
|
||||
%{
|
||||
predicate(Universe::narrow_klass_shift() == 0);
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(AddP (DecodeNKlass reg) off);
|
||||
|
||||
format %{ "[$reg + $off (8-bit)]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index(0x4);
|
||||
scale(0x0);
|
||||
disp($off);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indOffset32NarrowKlass(rRegN reg, immL32 off)
|
||||
%{
|
||||
predicate(Universe::narrow_klass_shift() == 0);
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(AddP (DecodeNKlass reg) off);
|
||||
|
||||
format %{ "[$reg + $off (32-bit)]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index(0x4);
|
||||
scale(0x0);
|
||||
disp($off);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indIndexOffsetNarrowKlass(rRegN reg, rRegL lreg, immL32 off)
|
||||
%{
|
||||
predicate(Universe::narrow_klass_shift() == 0);
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(AddP (AddP (DecodeNKlass reg) lreg) off);
|
||||
|
||||
op_cost(10);
|
||||
format %{"[$reg + $off + $lreg]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index($lreg);
|
||||
scale(0x0);
|
||||
disp($off);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indIndexNarrowKlass(rRegN reg, rRegL lreg)
|
||||
%{
|
||||
predicate(Universe::narrow_klass_shift() == 0);
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(AddP (DecodeNKlass reg) lreg);
|
||||
|
||||
op_cost(10);
|
||||
format %{"[$reg + $lreg]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index($lreg);
|
||||
scale(0x0);
|
||||
disp(0x0);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indIndexScaleNarrowKlass(rRegN reg, rRegL lreg, immI2 scale)
|
||||
%{
|
||||
predicate(Universe::narrow_klass_shift() == 0);
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(AddP (DecodeNKlass reg) (LShiftL lreg scale));
|
||||
|
||||
op_cost(10);
|
||||
format %{"[$reg + $lreg << $scale]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index($lreg);
|
||||
scale($scale);
|
||||
disp(0x0);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indIndexScaleOffsetNarrowKlass(rRegN reg, immL32 off, rRegL lreg, immI2 scale)
|
||||
%{
|
||||
predicate(Universe::narrow_klass_shift() == 0);
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(AddP (AddP (DecodeNKlass reg) (LShiftL lreg scale)) off);
|
||||
|
||||
op_cost(10);
|
||||
format %{"[$reg + $off + $lreg << $scale]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index($lreg);
|
||||
scale($scale);
|
||||
disp($off);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indCompressedKlassOffset(rRegN reg, immL32 off) %{
|
||||
predicate(UseCompressedKlassPointers && (Universe::narrow_klass_shift() == Address::times_8));
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
match(AddP (DecodeNKlass reg) off);
|
||||
|
||||
op_cost(10);
|
||||
format %{"[R12 + $reg << 3 + $off] (compressed klass addressing)" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base(0xc); // R12
|
||||
index($reg);
|
||||
scale(0x3);
|
||||
disp($off);
|
||||
%}
|
||||
%}
|
||||
|
||||
operand indPosIndexScaleOffsetNarrowKlass(rRegN reg, immL32 off, rRegI idx, immI2 scale)
|
||||
%{
|
||||
constraint(ALLOC_IN_RC(ptr_reg));
|
||||
predicate(Universe::narrow_klass_shift() == 0 && n->in(2)->in(3)->in(1)->as_Type()->type()->is_long()->_lo >= 0);
|
||||
match(AddP (AddP (DecodeNKlass reg) (LShiftL (ConvI2L idx) scale)) off);
|
||||
|
||||
op_cost(10);
|
||||
format %{"[$reg + $off + $idx << $scale]" %}
|
||||
interface(MEMORY_INTER) %{
|
||||
base($reg);
|
||||
index($idx);
|
||||
scale($scale);
|
||||
disp($off);
|
||||
%}
|
||||
%}
|
||||
|
||||
//----------Special Memory Operands--------------------------------------------
|
||||
// Stack Slot Operand - This operand is used for loading and storing temporary
|
||||
// values on the stack where a match requires a value to
|
||||
@@ -4345,11 +4203,7 @@ opclass memory(indirect, indOffset8, indOffset32, indIndexOffset, indIndex,
|
||||
indCompressedOopOffset,
|
||||
indirectNarrow, indOffset8Narrow, indOffset32Narrow,
|
||||
indIndexOffsetNarrow, indIndexNarrow, indIndexScaleNarrow,
|
||||
indIndexScaleOffsetNarrow, indPosIndexScaleOffsetNarrow,
|
||||
indCompressedKlassOffset,
|
||||
indirectNarrowKlass, indOffset8NarrowKlass, indOffset32NarrowKlass,
|
||||
indIndexOffsetNarrowKlass, indIndexNarrowKlass, indIndexScaleNarrowKlass,
|
||||
indIndexScaleOffsetNarrowKlass, indPosIndexScaleOffsetNarrowKlass);
|
||||
indIndexScaleOffsetNarrow, indPosIndexScaleOffsetNarrow);
|
||||
|
||||
//----------PIPELINE-----------------------------------------------------------
|
||||
// Rules which define the behavior of the target architectures pipeline.
|
||||
@@ -6665,7 +6519,7 @@ instruct decodeHeapOop_not_null(rRegP dst, rRegN src, rFlagsReg cr) %{
|
||||
instruct encodeKlass_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
|
||||
match(Set dst (EncodePKlass src));
|
||||
effect(KILL cr);
|
||||
format %{ "encode_heap_oop_not_null $dst,$src" %}
|
||||
format %{ "encode_klass_not_null $dst,$src" %}
|
||||
ins_encode %{
|
||||
__ encode_klass_not_null($dst$$Register, $src$$Register);
|
||||
%}
|
||||
@@ -6675,7 +6529,7 @@ instruct encodeKlass_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
|
||||
instruct decodeKlass_not_null(rRegP dst, rRegN src, rFlagsReg cr) %{
|
||||
match(Set dst (DecodeNKlass src));
|
||||
effect(KILL cr);
|
||||
format %{ "decode_heap_oop_not_null $dst,$src" %}
|
||||
format %{ "decode_klass_not_null $dst,$src" %}
|
||||
ins_encode %{
|
||||
Register s = $src$$Register;
|
||||
Register d = $dst$$Register;
|
||||
|
||||
@@ -50,6 +50,7 @@ int AbstractAssembler::code_fill_byte() {
|
||||
#ifdef ASSERT
|
||||
bool AbstractAssembler::pd_check_instruction_mark() {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -73,6 +74,7 @@ void MacroAssembler::advance(int bytes) {
|
||||
RegisterOrConstant MacroAssembler::delayed_value_impl(
|
||||
intptr_t* delayed_value_addr, Register tmpl, int offset) {
|
||||
ShouldNotCallThis();
|
||||
return RegisterOrConstant();
|
||||
}
|
||||
|
||||
void MacroAssembler::store_oop(jobject obj) {
|
||||
|
||||
@@ -1008,6 +1008,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
|
||||
|
||||
address CppInterpreter::return_entry(TosState state, int length) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address CppInterpreter::deopt_entry(TosState state, int length) {
|
||||
|
||||
@@ -58,8 +58,8 @@ class EntryFrame : public ZeroFrame {
|
||||
JavaCallWrapper* call_wrapper,
|
||||
TRAPS);
|
||||
public:
|
||||
JavaCallWrapper *call_wrapper() const {
|
||||
return (JavaCallWrapper *) value_of_word(call_wrapper_off);
|
||||
JavaCallWrapper **call_wrapper() const {
|
||||
return (JavaCallWrapper **) addr_of_word(call_wrapper_off);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -116,6 +116,7 @@ void frame::patch_pc(Thread* thread, address pc) {
|
||||
|
||||
bool frame::safe_for_sender(JavaThread *thread) {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
|
||||
void frame::pd_gc_epilog() {
|
||||
@@ -123,6 +124,7 @@ void frame::pd_gc_epilog() {
|
||||
|
||||
bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
|
||||
BasicType frame::interpreter_frame_result(oop* oop_result,
|
||||
@@ -184,9 +186,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result,
|
||||
int frame::frame_size(RegisterMap* map) const {
|
||||
#ifdef PRODUCT
|
||||
ShouldNotCallThis();
|
||||
#else
|
||||
return 0; // make javaVFrame::print_value work
|
||||
#endif // PRODUCT
|
||||
return 0; // make javaVFrame::print_value work
|
||||
}
|
||||
|
||||
intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
|
||||
|
||||
@@ -36,7 +36,7 @@ inline frame::frame() {
|
||||
_deopt_state = unknown;
|
||||
}
|
||||
|
||||
inline address frame::sender_pc() const { ShouldNotCallThis(); }
|
||||
inline address frame::sender_pc() const { ShouldNotCallThis(); return NULL; }
|
||||
|
||||
inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
|
||||
_zeroframe = zf;
|
||||
@@ -89,6 +89,7 @@ inline intptr_t* frame::real_fp() const {
|
||||
|
||||
inline intptr_t* frame::link() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
@@ -141,7 +142,7 @@ inline intptr_t* frame::id() const {
|
||||
return fp();
|
||||
}
|
||||
|
||||
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
|
||||
inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
|
||||
return zero_entryframe()->call_wrapper();
|
||||
}
|
||||
|
||||
@@ -151,14 +152,17 @@ inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
|
||||
|
||||
inline oop frame::saved_oop_result(RegisterMap* map) const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline bool frame::is_older(intptr_t* id) const {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
|
||||
inline intptr_t* frame::entry_frame_argument_at(int offset) const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline intptr_t* frame::unextended_sp() const {
|
||||
|
||||
@@ -49,8 +49,10 @@ void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin,
|
||||
address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
|
||||
// NB ic_stub_code_size() must return the size of the code we generate
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ class InterpreterMacroAssembler : public MacroAssembler {
|
||||
Register tmp,
|
||||
int offset) {
|
||||
ShouldNotCallThis();
|
||||
return RegisterOrConstant();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ address InterpreterGenerator::generate_math_entry(
|
||||
return NULL;
|
||||
|
||||
Unimplemented();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address InterpreterGenerator::generate_abstract_entry() {
|
||||
|
||||
@@ -51,15 +51,18 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC {
|
||||
public:
|
||||
bool is_jump() {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool is_safepoint_poll() {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
inline NativeInstruction* nativeInstruction_at(address address) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
class NativeCall : public NativeInstruction {
|
||||
@@ -70,18 +73,22 @@ class NativeCall : public NativeInstruction {
|
||||
|
||||
address instruction_address() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address next_instruction_address() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address return_address() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address destination() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void set_destination_mt_safe(address dest) {
|
||||
@@ -98,25 +105,30 @@ class NativeCall : public NativeInstruction {
|
||||
|
||||
static bool is_call_before(address return_address) {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
inline NativeCall* nativeCall_before(address return_address) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline NativeCall* nativeCall_at(address address) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
class NativeMovConstReg : public NativeInstruction {
|
||||
public:
|
||||
address next_instruction_address() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
intptr_t data() const {
|
||||
ShouldNotCallThis();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void set_data(intptr_t x) {
|
||||
@@ -126,12 +138,14 @@ class NativeMovConstReg : public NativeInstruction {
|
||||
|
||||
inline NativeMovConstReg* nativeMovConstReg_at(address address) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
class NativeMovRegMem : public NativeInstruction {
|
||||
public:
|
||||
int offset() const {
|
||||
ShouldNotCallThis();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void set_offset(intptr_t x) {
|
||||
@@ -145,6 +159,7 @@ class NativeMovRegMem : public NativeInstruction {
|
||||
|
||||
inline NativeMovRegMem* nativeMovRegMem_at(address address) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
class NativeJump : public NativeInstruction {
|
||||
@@ -155,6 +170,7 @@ class NativeJump : public NativeInstruction {
|
||||
|
||||
address jump_destination() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void set_jump_destination(address dest) {
|
||||
@@ -172,12 +188,14 @@ class NativeJump : public NativeInstruction {
|
||||
|
||||
inline NativeJump* nativeJump_at(address address) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
class NativeGeneralJump : public NativeInstruction {
|
||||
public:
|
||||
address jump_destination() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void insert_unconditional(address code_pos, address entry) {
|
||||
@@ -191,6 +209,7 @@ class NativeGeneralJump : public NativeInstruction {
|
||||
|
||||
inline NativeGeneralJump* nativeGeneralJump_at(address address) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP
|
||||
|
||||
@@ -32,8 +32,10 @@ const int ConcreteRegisterImpl::max_fpr =
|
||||
|
||||
const char* RegisterImpl::name() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* FloatRegisterImpl::name() const {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
|
||||
|
||||
address Relocation::pd_call_destination(address orig_addr) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Relocation::pd_set_call_destination(address x) {
|
||||
@@ -45,6 +46,7 @@ void Relocation::pd_set_call_destination(address x) {
|
||||
|
||||
address Relocation::pd_get_address_from_code() {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address* Relocation::pd_address_in_code() {
|
||||
|
||||
@@ -89,6 +89,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
ret_type);
|
||||
#else
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
#endif // SHARK
|
||||
}
|
||||
|
||||
@@ -99,6 +100,7 @@ int Deoptimization::last_frame_adjust(int callee_parameters,
|
||||
|
||||
uint SharedRuntime::out_preserve_stack_slots() {
|
||||
ShouldNotCallThis();
|
||||
return 0;
|
||||
}
|
||||
|
||||
JRT_LEAF(void, zero_stub())
|
||||
@@ -135,4 +137,5 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
|
||||
VMRegPair *regs,
|
||||
int total_args_passed) {
|
||||
ShouldNotCallThis();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -176,6 +176,19 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubRoutines::_oop_arraycopy;
|
||||
}
|
||||
|
||||
static int SafeFetch32(int *adr, int errValue) {
|
||||
int value = errValue;
|
||||
value = *adr;
|
||||
return value;
|
||||
}
|
||||
|
||||
static intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
|
||||
intptr_t value = errValue;
|
||||
value = *adr;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
void generate_initial() {
|
||||
// Generates all stubs and initializes the entry points
|
||||
|
||||
@@ -225,6 +238,15 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
// arraycopy stubs used by compilers
|
||||
generate_arraycopy_stubs();
|
||||
|
||||
// Safefetch stubs.
|
||||
StubRoutines::_safefetch32_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetch32);
|
||||
StubRoutines::_safefetch32_fault_pc = NULL;
|
||||
StubRoutines::_safefetch32_continuation_pc = NULL;
|
||||
|
||||
StubRoutines::_safefetchN_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetchN);
|
||||
StubRoutines::_safefetchN_fault_pc = NULL;
|
||||
StubRoutines::_safefetchN_continuation_pc = NULL;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -39,16 +39,20 @@
|
||||
|
||||
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VtableStub* VtableStubs::create_itable_stub(int vtable_index) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
|
||||
ShouldNotCallThis();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int VtableStub::pd_code_alignment() {
|
||||
ShouldNotCallThis();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 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
|
||||
@@ -437,6 +437,30 @@ AttachOperation* AttachListener::dequeue() {
|
||||
return op;
|
||||
}
|
||||
|
||||
|
||||
// Performs initialization at vm startup
|
||||
// For BSD we remove any stale .java_pid file which could cause
|
||||
// an attaching process to think we are ready to receive on the
|
||||
// domain socket before we are properly initialized
|
||||
|
||||
void AttachListener::vm_start() {
|
||||
char fn[UNIX_PATH_MAX];
|
||||
struct stat st;
|
||||
int ret;
|
||||
|
||||
int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
|
||||
os::get_temp_directory(), os::current_process_id());
|
||||
assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
|
||||
|
||||
RESTARTABLE(::stat(fn, &st), ret);
|
||||
if (ret == 0) {
|
||||
ret = ::unlink(fn);
|
||||
if (ret == -1) {
|
||||
debug_only(warning("failed to remove stale attach pid file at %s", fn));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int AttachListener::pd_init() {
|
||||
JavaThread* thread = JavaThread::current();
|
||||
ThreadBlockInVM tbivm(thread);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 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
|
||||
@@ -432,6 +432,30 @@ AttachOperation* AttachListener::dequeue() {
|
||||
return op;
|
||||
}
|
||||
|
||||
|
||||
// Performs initialization at vm startup
|
||||
// For Linux we remove any stale .java_pid file which could cause
|
||||
// an attaching process to think we are ready to receive on the
|
||||
// domain socket before we are properly initialized
|
||||
|
||||
void AttachListener::vm_start() {
|
||||
char fn[UNIX_PATH_MAX];
|
||||
struct stat64 st;
|
||||
int ret;
|
||||
|
||||
int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
|
||||
os::get_temp_directory(), os::current_process_id());
|
||||
assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
|
||||
|
||||
RESTARTABLE(::stat64(fn, &st), ret);
|
||||
if (ret == 0) {
|
||||
ret = ::unlink(fn);
|
||||
if (ret == -1) {
|
||||
debug_only(warning("failed to remove stale attach pid file at %s", fn));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int AttachListener::pd_init() {
|
||||
JavaThread* thread = JavaThread::current();
|
||||
ThreadBlockInVM tbivm(thread);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@@ -107,7 +107,7 @@ static sa_handler_t set_signal(int sig, sa_handler_t disp, bool is_sigset) {
|
||||
|
||||
signal_lock();
|
||||
|
||||
sigused = (MASK(sig) & jvmsigs) != 0;
|
||||
sigused = (sig < MAXSIGNUM) && ((MASK(sig) & jvmsigs) != 0);
|
||||
if (jvm_signal_installed && sigused) {
|
||||
/* jvm has installed its signal handler for this signal. */
|
||||
/* Save the handler. Don't really install it. */
|
||||
@@ -116,7 +116,7 @@ static sa_handler_t set_signal(int sig, sa_handler_t disp, bool is_sigset) {
|
||||
|
||||
signal_unlock();
|
||||
return oldhandler;
|
||||
} else if (jvm_signal_installing) {
|
||||
} else if (sig < MAXSIGNUM && jvm_signal_installing) {
|
||||
/* jvm is installing its signal handlers. Install the new
|
||||
* handlers and save the old ones. jvm uses sigaction().
|
||||
* Leave the piece here just in case. */
|
||||
@@ -165,7 +165,7 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) {
|
||||
|
||||
signal_lock();
|
||||
|
||||
sigused = (MASK(sig) & jvmsigs) != 0;
|
||||
sigused = (sig < MAXSIGNUM) && ((MASK(sig) & jvmsigs) != 0);
|
||||
if (jvm_signal_installed && sigused) {
|
||||
/* jvm has installed its signal handler for this signal. */
|
||||
/* Save the handler. Don't really install it. */
|
||||
@@ -178,7 +178,7 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) {
|
||||
|
||||
signal_unlock();
|
||||
return 0;
|
||||
} else if (jvm_signal_installing) {
|
||||
} else if (sig < MAXSIGNUM && jvm_signal_installing) {
|
||||
/* jvm is installing its signal handlers. Install the new
|
||||
* handlers and save the old ones. */
|
||||
res = call_os_sigaction(sig, act, &oldAct);
|
||||
|
||||
@@ -259,3 +259,52 @@ const char* os::get_current_directory(char *buf, size_t buflen) {
|
||||
FILE* os::open(int fd, const char* mode) {
|
||||
return ::fdopen(fd, mode);
|
||||
}
|
||||
|
||||
os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
|
||||
assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
|
||||
}
|
||||
|
||||
/*
|
||||
* See the caveats for this class in os_posix.hpp
|
||||
* Protects the callback call so that SIGSEGV / SIGBUS jumps back into this
|
||||
* method and returns false. If none of the signals are raised, returns true.
|
||||
* The callback is supposed to provide the method that should be protected.
|
||||
*/
|
||||
bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
|
||||
assert(Thread::current()->is_Watcher_thread(), "Only for WatcherThread");
|
||||
assert(!WatcherThread::watcher_thread()->has_crash_protection(),
|
||||
"crash_protection already set?");
|
||||
|
||||
if (sigsetjmp(_jmpbuf, 1) == 0) {
|
||||
// make sure we can see in the signal handler that we have crash protection
|
||||
// installed
|
||||
WatcherThread::watcher_thread()->set_crash_protection(this);
|
||||
cb.call();
|
||||
// and clear the crash protection
|
||||
WatcherThread::watcher_thread()->set_crash_protection(NULL);
|
||||
return true;
|
||||
}
|
||||
// this happens when we siglongjmp() back
|
||||
WatcherThread::watcher_thread()->set_crash_protection(NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
void os::WatcherThreadCrashProtection::restore() {
|
||||
assert(WatcherThread::watcher_thread()->has_crash_protection(),
|
||||
"must have crash protection");
|
||||
|
||||
siglongjmp(_jmpbuf, 1);
|
||||
}
|
||||
|
||||
void os::WatcherThreadCrashProtection::check_crash_protection(int sig,
|
||||
Thread* thread) {
|
||||
|
||||
if (thread != NULL &&
|
||||
thread->is_Watcher_thread() &&
|
||||
WatcherThread::watcher_thread()->has_crash_protection()) {
|
||||
|
||||
if (sig == SIGSEGV || sig == SIGBUS) {
|
||||
WatcherThread::watcher_thread()->crash_protection()->restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,5 +37,24 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Crash protection for the watcher thread. Wrap the callback
|
||||
* with a sigsetjmp and in case of a SIGSEGV/SIGBUS we siglongjmp
|
||||
* back.
|
||||
* To be able to use this - don't take locks, don't rely on destructors,
|
||||
* don't make OS library calls, don't allocate memory, don't print,
|
||||
* don't call code that could leave the heap / memory in an inconsistent state,
|
||||
* or anything else where we are not in control if we suddenly jump out.
|
||||
*/
|
||||
class WatcherThreadCrashProtection : public StackObj {
|
||||
public:
|
||||
WatcherThreadCrashProtection();
|
||||
bool call(os::CrashProtectionCallback& cb);
|
||||
|
||||
static void check_crash_protection(int signal, Thread* thread);
|
||||
private:
|
||||
void restore();
|
||||
sigjmp_buf _jmpbuf;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 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
|
||||
@@ -576,6 +576,30 @@ AttachOperation* AttachListener::dequeue() {
|
||||
return op;
|
||||
}
|
||||
|
||||
|
||||
// Performs initialization at vm startup
|
||||
// For Solaris we remove any stale .java_pid file which could cause
|
||||
// an attaching process to think we are ready to receive a door_call
|
||||
// before we are properly initialized
|
||||
|
||||
void AttachListener::vm_start() {
|
||||
char fn[PATH_MAX+1];
|
||||
struct stat64 st;
|
||||
int ret;
|
||||
|
||||
int n = snprintf(fn, sizeof(fn), "%s/.java_pid%d",
|
||||
os::get_temp_directory(), os::current_process_id());
|
||||
assert(n < sizeof(fn), "java_pid file name buffer overflow");
|
||||
|
||||
RESTARTABLE(::stat64(fn, &st), ret);
|
||||
if (ret == 0) {
|
||||
ret = ::unlink(fn);
|
||||
if (ret == -1) {
|
||||
debug_only(warning("failed to remove stale attach pid file at %s", fn));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int AttachListener::pd_init() {
|
||||
JavaThread* thread = JavaThread::current();
|
||||
ThreadBlockInVM tbivm(thread);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 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
|
||||
@@ -358,6 +358,10 @@ AttachOperation* AttachListener::dequeue() {
|
||||
return op;
|
||||
}
|
||||
|
||||
void AttachListener::vm_start() {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
int AttachListener::pd_init() {
|
||||
return Win32AttachListener::init();
|
||||
}
|
||||
|
||||
@@ -1642,6 +1642,8 @@ void os::print_os_info(outputStream* st) {
|
||||
|
||||
void os::win32::print_windows_version(outputStream* st) {
|
||||
OSVERSIONINFOEX osvi;
|
||||
SYSTEM_INFO si;
|
||||
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
|
||||
@@ -1651,6 +1653,18 @@ void os::win32::print_windows_version(outputStream* st) {
|
||||
}
|
||||
|
||||
int os_vers = osvi.dwMajorVersion * 1000 + osvi.dwMinorVersion;
|
||||
|
||||
ZeroMemory(&si, sizeof(SYSTEM_INFO));
|
||||
if (os_vers >= 5002) {
|
||||
// Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could
|
||||
// find out whether we are running on 64 bit processor or not.
|
||||
if (os::Kernel32Dll::GetNativeSystemInfoAvailable()) {
|
||||
os::Kernel32Dll::GetNativeSystemInfo(&si);
|
||||
} else {
|
||||
GetSystemInfo(&si);
|
||||
}
|
||||
}
|
||||
|
||||
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
|
||||
switch (os_vers) {
|
||||
case 3051: st->print(" Windows NT 3.51"); break;
|
||||
@@ -1658,57 +1672,48 @@ void os::win32::print_windows_version(outputStream* st) {
|
||||
case 5000: st->print(" Windows 2000"); break;
|
||||
case 5001: st->print(" Windows XP"); break;
|
||||
case 5002:
|
||||
case 6000:
|
||||
case 6001:
|
||||
case 6002: {
|
||||
// Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could
|
||||
// find out whether we are running on 64 bit processor or not.
|
||||
SYSTEM_INFO si;
|
||||
ZeroMemory(&si, sizeof(SYSTEM_INFO));
|
||||
if (!os::Kernel32Dll::GetNativeSystemInfoAvailable()){
|
||||
GetSystemInfo(&si);
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION &&
|
||||
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
|
||||
st->print(" Windows XP x64 Edition");
|
||||
} else {
|
||||
os::Kernel32Dll::GetNativeSystemInfo(&si);
|
||||
}
|
||||
if (os_vers == 5002) {
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION &&
|
||||
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||
st->print(" Windows XP x64 Edition");
|
||||
else
|
||||
st->print(" Windows Server 2003 family");
|
||||
} else if (os_vers == 6000) {
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
st->print(" Windows Vista");
|
||||
else
|
||||
st->print(" Windows Server 2008");
|
||||
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||
st->print(" , 64 bit");
|
||||
} else if (os_vers == 6001) {
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION) {
|
||||
st->print(" Windows 7");
|
||||
} else {
|
||||
// Unrecognized windows, print out its major and minor versions
|
||||
st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||
}
|
||||
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||
st->print(" , 64 bit");
|
||||
} else if (os_vers == 6002) {
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION) {
|
||||
st->print(" Windows 8");
|
||||
} else {
|
||||
st->print(" Windows Server 2012");
|
||||
}
|
||||
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||
st->print(" , 64 bit");
|
||||
} else { // future os
|
||||
// Unrecognized windows, print out its major and minor versions
|
||||
st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||
st->print(" , 64 bit");
|
||||
st->print(" Windows Server 2003 family");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: // future windows, print out its major and minor versions
|
||||
|
||||
case 6000:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION) {
|
||||
st->print(" Windows Vista");
|
||||
} else {
|
||||
st->print(" Windows Server 2008");
|
||||
}
|
||||
break;
|
||||
|
||||
case 6001:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION) {
|
||||
st->print(" Windows 7");
|
||||
} else {
|
||||
st->print(" Windows Server 2008 R2");
|
||||
}
|
||||
break;
|
||||
|
||||
case 6002:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION) {
|
||||
st->print(" Windows 8");
|
||||
} else {
|
||||
st->print(" Windows Server 2012");
|
||||
}
|
||||
break;
|
||||
|
||||
case 6003:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION) {
|
||||
st->print(" Windows 8.1");
|
||||
} else {
|
||||
st->print(" Windows Server 2012 R2");
|
||||
}
|
||||
break;
|
||||
|
||||
default: // future os
|
||||
// Unrecognized windows, print out its major and minor versions
|
||||
st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||
}
|
||||
} else {
|
||||
@@ -1720,6 +1725,11 @@ void os::win32::print_windows_version(outputStream* st) {
|
||||
st->print(" Windows %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||
}
|
||||
}
|
||||
|
||||
if (os_vers >= 6000 && si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
|
||||
st->print(" , 64 bit");
|
||||
}
|
||||
|
||||
st->print(" Build %d", osvi.dwBuildNumber);
|
||||
st->print(" %s", osvi.szCSDVersion); // service pack
|
||||
st->cr();
|
||||
@@ -4689,6 +4699,34 @@ void os::pause() {
|
||||
}
|
||||
}
|
||||
|
||||
os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
|
||||
assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
|
||||
}
|
||||
|
||||
/*
|
||||
* See the caveats for this class in os_windows.hpp
|
||||
* Protects the callback call so that raised OS EXCEPTIONS causes a jump back
|
||||
* into this method and returns false. If no OS EXCEPTION was raised, returns
|
||||
* true.
|
||||
* The callback is supposed to provide the method that should be protected.
|
||||
*/
|
||||
bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
|
||||
assert(Thread::current()->is_Watcher_thread(), "Only for WatcherThread");
|
||||
assert(!WatcherThread::watcher_thread()->has_crash_protection(),
|
||||
"crash_protection already set?");
|
||||
|
||||
bool success = true;
|
||||
__try {
|
||||
WatcherThread::watcher_thread()->set_crash_protection(this);
|
||||
cb.call();
|
||||
} __except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
// only for protection, nothing to do
|
||||
success = false;
|
||||
}
|
||||
WatcherThread::watcher_thread()->set_crash_protection(NULL);
|
||||
return success;
|
||||
}
|
||||
|
||||
// An Event wraps a win32 "CreateEvent" kernel handle.
|
||||
//
|
||||
// We have a number of choices regarding "CreateEvent" win32 handle leakage:
|
||||
|
||||
@@ -102,6 +102,20 @@ class win32 {
|
||||
static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e);
|
||||
};
|
||||
|
||||
/*
|
||||
* Crash protection for the watcher thread. Wrap the callback
|
||||
* with a __try { call() }
|
||||
* To be able to use this - don't take locks, don't rely on destructors,
|
||||
* don't make OS library calls, don't allocate memory, don't print,
|
||||
* don't call code that could leave the heap / memory in an inconsistent state,
|
||||
* or anything else where we are not in control if we suddenly jump out.
|
||||
*/
|
||||
class WatcherThreadCrashProtection : public StackObj {
|
||||
public:
|
||||
WatcherThreadCrashProtection();
|
||||
bool call(os::CrashProtectionCallback& cb);
|
||||
};
|
||||
|
||||
class PlatformEvent : public CHeapObj<mtInternal> {
|
||||
private:
|
||||
double CachePad [4] ; // increase odds that _Event is sole occupant of cache line
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 1999, 2012, 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.
|
||||
//
|
||||
//
|
||||
|
||||
// X86 Bsd Architecture Description File
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2003, 2012, 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.
|
||||
//
|
||||
//
|
||||
|
||||
// AMD64 Bsd Architecture Description File
|
||||
|
||||
//----------OS-DEPENDENT ENCODING BLOCK----------------------------------------
|
||||
// This block specifies the encoding classes used by the compiler to
|
||||
// output byte streams. Encoding classes generate functions which are
|
||||
// called by Machine Instruction Nodes in order to generate the bit
|
||||
// encoding of the instruction. Operands specify their base encoding
|
||||
// interface with the interface keyword. There are currently
|
||||
// supported four interfaces, REG_INTER, CONST_INTER, MEMORY_INTER, &
|
||||
// COND_INTER. REG_INTER causes an operand to generate a function
|
||||
// which returns its register number when queried. CONST_INTER causes
|
||||
// an operand to generate a function which returns the value of the
|
||||
// constant when queried. MEMORY_INTER causes an operand to generate
|
||||
// four functions which return the Base Register, the Index Register,
|
||||
// the Scale Value, and the Offset Value of the operand when queried.
|
||||
// COND_INTER causes an operand to generate six functions which return
|
||||
// the encoding code (ie - encoding bits for the instruction)
|
||||
// associated with each basic boolean condition for a conditional
|
||||
// instruction. Instructions specify two basic values for encoding.
|
||||
// They use the ins_encode keyword to specify their encoding class
|
||||
// (which must be one of the class names specified in the encoding
|
||||
// block), and they use the opcode keyword to specify, in order, their
|
||||
// primary, secondary, and tertiary opcode. Only the opcode sections
|
||||
// which a particular instruction needs for encoding need to be
|
||||
// specified.
|
||||
encode %{
|
||||
// Build emit functions for each basic byte or larger field in the intel
|
||||
// encoding scheme (opcode, rm, sib, immediate), and call them from C++
|
||||
// code in the enc_class source block. Emit functions will live in the
|
||||
// main source block for now. In future, we can generalize this by
|
||||
// adding a syntax that specifies the sizes of fields in an order,
|
||||
// so that the adlc can build the emit functions automagically
|
||||
|
||||
%}
|
||||
|
||||
|
||||
// Platform dependent source
|
||||
|
||||
source %{
|
||||
|
||||
%}
|
||||
@@ -72,7 +72,7 @@ inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; }
|
||||
inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; }
|
||||
inline julong OrderAccess::load_acquire(volatile julong* p) { return Atomic::load((volatile jlong*)p); }
|
||||
inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; }
|
||||
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
|
||||
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return jdouble_cast(Atomic::load((volatile jlong*)p)); }
|
||||
|
||||
inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t* p) { return *p; }
|
||||
inline void* OrderAccess::load_ptr_acquire(volatile void* p) { return *(void* volatile *)p; }
|
||||
@@ -87,7 +87,7 @@ inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p
|
||||
inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; }
|
||||
inline void OrderAccess::release_store(volatile julong* p, julong v) { Atomic::store((jlong)v, (volatile jlong*)p); }
|
||||
inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; }
|
||||
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
|
||||
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { release_store((volatile jlong*)p, jlong_cast(v)); }
|
||||
|
||||
inline void OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; }
|
||||
inline void OrderAccess::release_store_ptr(volatile void* p, void* v) { *(void* volatile *)p = v; }
|
||||
@@ -190,7 +190,7 @@ inline void OrderAccess::release_store_fence(volatile juint* p, juint v)
|
||||
inline void OrderAccess::release_store_fence(volatile julong* p, julong v) { release_store_fence((volatile jlong*)p, (jlong)v); }
|
||||
|
||||
inline void OrderAccess::release_store_fence(volatile jfloat* p, jfloat v) { *p = v; fence(); }
|
||||
inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
|
||||
inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { release_store_fence((volatile jlong*)p, jlong_cast(v)); }
|
||||
|
||||
inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) {
|
||||
#ifdef AMD64
|
||||
|
||||
@@ -394,6 +394,10 @@ JVM_handle_bsd_signal(int sig,
|
||||
|
||||
Thread* t = ThreadLocalStorage::get_thread_slow();
|
||||
|
||||
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
|
||||
// (no destructors can be run)
|
||||
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
|
||||
|
||||
SignalHandlerMark shm(t);
|
||||
|
||||
// Note: it's not uncommon that JNI code uses signal/sigset to install
|
||||
@@ -711,6 +715,7 @@ JVM_handle_bsd_signal(int sig,
|
||||
err.report_and_die();
|
||||
|
||||
ShouldNotReachHere();
|
||||
return false;
|
||||
}
|
||||
|
||||
// From solaris_i486.s ported to bsd_i486.s
|
||||
|
||||
@@ -66,6 +66,7 @@ address os::current_stack_pointer() {
|
||||
|
||||
frame os::get_sender_for_C_frame(frame* fr) {
|
||||
ShouldNotCallThis();
|
||||
return frame();
|
||||
}
|
||||
|
||||
frame os::current_frame() {
|
||||
@@ -103,16 +104,19 @@ void os::initialize_thread(Thread* thr) {
|
||||
|
||||
address os::Bsd::ucontext_get_pc(ucontext_t* uc) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ExtendedPC os::fetch_frame_from_context(void* ucVoid,
|
||||
intptr_t** ret_sp,
|
||||
intptr_t** ret_fp) {
|
||||
ShouldNotCallThis();
|
||||
return ExtendedPC();
|
||||
}
|
||||
|
||||
frame os::fetch_frame_from_context(void* ucVoid) {
|
||||
ShouldNotCallThis();
|
||||
return frame();
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT int
|
||||
@@ -240,6 +244,7 @@ JVM_handle_bsd_signal(int sig,
|
||||
|
||||
sprintf(buf, fmt, sig, info->si_addr);
|
||||
fatal(buf);
|
||||
return false;
|
||||
}
|
||||
|
||||
void os::Bsd::init_thread_fpu_state(void) {
|
||||
@@ -373,17 +378,7 @@ void os::print_register_info(outputStream *st, void *context) {
|
||||
|
||||
extern "C" {
|
||||
int SpinPause() {
|
||||
}
|
||||
|
||||
int SafeFetch32(int *adr, int errValue) {
|
||||
int value = errValue;
|
||||
value = *adr;
|
||||
return value;
|
||||
}
|
||||
intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
|
||||
intptr_t value = errValue;
|
||||
value = *adr;
|
||||
return value;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
|
||||
|
||||
@@ -110,6 +110,7 @@
|
||||
void* ucontext,
|
||||
bool isInJava) {
|
||||
ShouldNotCallThis();
|
||||
return false;
|
||||
}
|
||||
|
||||
// These routines are only used on cpu architectures that
|
||||
|
||||
@@ -544,6 +544,10 @@ JVM_handle_linux_signal(int sig,
|
||||
|
||||
Thread* t = ThreadLocalStorage::get_thread_slow();
|
||||
|
||||
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
|
||||
// (no destructors can be run)
|
||||
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
|
||||
|
||||
SignalHandlerMark shm(t);
|
||||
|
||||
// Note: it's not uncommon that JNI code uses signal/sigset to install
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 1999, 2012, 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.
|
||||
//
|
||||
//
|
||||
|
||||
// X86 Linux Architecture Description File
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2003, 2012, 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.
|
||||
//
|
||||
//
|
||||
|
||||
// AMD64 Linux Architecture Description File
|
||||
|
||||
//----------OS-DEPENDENT ENCODING BLOCK----------------------------------------
|
||||
// This block specifies the encoding classes used by the compiler to
|
||||
// output byte streams. Encoding classes generate functions which are
|
||||
// called by Machine Instruction Nodes in order to generate the bit
|
||||
// encoding of the instruction. Operands specify their base encoding
|
||||
// interface with the interface keyword. There are currently
|
||||
// supported four interfaces, REG_INTER, CONST_INTER, MEMORY_INTER, &
|
||||
// COND_INTER. REG_INTER causes an operand to generate a function
|
||||
// which returns its register number when queried. CONST_INTER causes
|
||||
// an operand to generate a function which returns the value of the
|
||||
// constant when queried. MEMORY_INTER causes an operand to generate
|
||||
// four functions which return the Base Register, the Index Register,
|
||||
// the Scale Value, and the Offset Value of the operand when queried.
|
||||
// COND_INTER causes an operand to generate six functions which return
|
||||
// the encoding code (ie - encoding bits for the instruction)
|
||||
// associated with each basic boolean condition for a conditional
|
||||
// instruction. Instructions specify two basic values for encoding.
|
||||
// They use the ins_encode keyword to specify their encoding class
|
||||
// (which must be one of the class names specified in the encoding
|
||||
// block), and they use the opcode keyword to specify, in order, their
|
||||
// primary, secondary, and tertiary opcode. Only the opcode sections
|
||||
// which a particular instruction needs for encoding need to be
|
||||
// specified.
|
||||
encode %{
|
||||
// Build emit functions for each basic byte or larger field in the intel
|
||||
// encoding scheme (opcode, rm, sib, immediate), and call them from C++
|
||||
// code in the enc_class source block. Emit functions will live in the
|
||||
// main source block for now. In future, we can generalize this by
|
||||
// adding a syntax that specifies the sizes of fields in an order,
|
||||
// so that the adlc can build the emit functions automagically
|
||||
|
||||
%}
|
||||
|
||||
|
||||
// Platform dependent source
|
||||
|
||||
source %{
|
||||
|
||||
%}
|
||||
@@ -72,7 +72,7 @@ inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; }
|
||||
inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; }
|
||||
inline julong OrderAccess::load_acquire(volatile julong* p) { return Atomic::load((volatile jlong*)p); }
|
||||
inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; }
|
||||
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
|
||||
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return jdouble_cast(Atomic::load((volatile jlong*)p)); }
|
||||
|
||||
inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t* p) { return *p; }
|
||||
inline void* OrderAccess::load_ptr_acquire(volatile void* p) { return *(void* volatile *)p; }
|
||||
@@ -87,7 +87,7 @@ inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p
|
||||
inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; }
|
||||
inline void OrderAccess::release_store(volatile julong* p, julong v) { Atomic::store((jlong)v, (volatile jlong*)p); }
|
||||
inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; }
|
||||
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
|
||||
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { release_store((volatile jlong *)p, jlong_cast(v)); }
|
||||
|
||||
inline void OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; }
|
||||
inline void OrderAccess::release_store_ptr(volatile void* p, void* v) { *(void* volatile *)p = v; }
|
||||
@@ -129,7 +129,7 @@ inline void OrderAccess::store_fence(jushort* p, jushort v) { store_fence((j
|
||||
inline void OrderAccess::store_fence(juint* p, juint v) { store_fence((jint*)p, (jint)v); }
|
||||
inline void OrderAccess::store_fence(julong* p, julong v) { store_fence((jlong*)p, (jlong)v); }
|
||||
inline void OrderAccess::store_fence(jfloat* p, jfloat v) { *p = v; fence(); }
|
||||
inline void OrderAccess::store_fence(jdouble* p, jdouble v) { *p = v; fence(); }
|
||||
inline void OrderAccess::store_fence(jdouble* p, jdouble v) { store_fence((jlong*)p, jlong_cast(v)); }
|
||||
|
||||
inline void OrderAccess::store_ptr_fence(intptr_t* p, intptr_t v) {
|
||||
#ifdef AMD64
|
||||
@@ -190,7 +190,7 @@ inline void OrderAccess::release_store_fence(volatile juint* p, juint v)
|
||||
inline void OrderAccess::release_store_fence(volatile julong* p, julong v) { release_store_fence((volatile jlong*)p, (jlong)v); }
|
||||
|
||||
inline void OrderAccess::release_store_fence(volatile jfloat* p, jfloat v) { *p = v; fence(); }
|
||||
inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
|
||||
inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { release_store_fence((volatile jlong*)p, jlong_cast(v)); }
|
||||
|
||||
inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) {
|
||||
#ifdef AMD64
|
||||
|
||||
@@ -218,6 +218,10 @@ JVM_handle_linux_signal(int sig,
|
||||
|
||||
Thread* t = ThreadLocalStorage::get_thread_slow();
|
||||
|
||||
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
|
||||
// (no destructors can be run)
|
||||
os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
|
||||
|
||||
SignalHandlerMark shm(t);
|
||||
|
||||
// Note: it's not uncommon that JNI code uses signal/sigset to install
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user