commit | author | age
|
c448de
|
1 |
diff -ur -N /tmp/g/atomic_solaris_zero.hpp b/src/hotspot/os_cpu/solaris_zero/atomic_solaris_zero.hpp |
NP |
2 |
--- /tmp/g/atomic_solaris_zero.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
3 |
+++ b/src/hotspot/os_cpu/solaris_zero/atomic_solaris_zero.hpp 2020-08-27 09:48:36.864797068 +0000 |
|
4 |
@@ -0,0 +1,182 @@ |
|
5 |
+/* |
|
6 |
+ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. |
|
7 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
8 |
+ * |
|
9 |
+ * This code is free software; you can redistribute it and/or modify it |
|
10 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
11 |
+ * published by the Free Software Foundation. |
|
12 |
+ * |
|
13 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
14 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
17 |
+ * accompanied this code). |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU General Public License version |
|
20 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
21 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
22 |
+ * |
|
23 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
24 |
+ * or visit www.oracle.com if you need additional information or have any |
|
25 |
+ * questions. |
|
26 |
+ * |
|
27 |
+ */ |
|
28 |
+ |
|
29 |
+#ifndef OS_CPU_SOLARIS_X86_ATOMIC_SOLARIS_X86_HPP |
|
30 |
+#define OS_CPU_SOLARIS_X86_ATOMIC_SOLARIS_X86_HPP |
|
31 |
+ |
|
32 |
+inline int32_t _Atomic_add(int32_t add_value, volatile int32_t* dest) { |
|
33 |
+ int32_t rv = add_value; |
|
34 |
+ __asm__ volatile ("lock xaddl %0,(%2)" |
|
35 |
+ : "=r" (rv) |
|
36 |
+ : "0" (rv), "r" (dest) |
|
37 |
+ : "cc", "memory"); |
|
38 |
+ return rv + add_value; |
|
39 |
+} |
|
40 |
+inline int64_t _Atomic_add_long(int64_t add_value, volatile int64_t* dest) { |
|
41 |
+ int64_t rv = add_value; |
|
42 |
+ __asm__ volatile ("lock xaddq %0,(%2)" |
|
43 |
+ : "=r" (rv) |
|
44 |
+ : "0" (rv), "r" (dest) |
|
45 |
+ : "cc", "memory"); |
|
46 |
+ return rv + add_value; |
|
47 |
+} |
|
48 |
+inline int32_t _Atomic_xchg(int32_t exchange_value, volatile int32_t* dest) { |
|
49 |
+ __asm__ __volatile__ ("xchgl (%2),%0" |
|
50 |
+ : "=r" (exchange_value) |
|
51 |
+ : "0" (exchange_value), "r" (dest) |
|
52 |
+ : "memory"); |
|
53 |
+ return exchange_value; |
|
54 |
+} |
|
55 |
+inline int64_t _Atomic_xchg_long(int64_t exchange_value, volatile int64_t* dest) { |
|
56 |
+ __asm__ __volatile__ ("xchgq (%2),%0" |
|
57 |
+ : "=r" (exchange_value) |
|
58 |
+ : "0" (exchange_value), "r" (dest) |
|
59 |
+ : "memory"); |
|
60 |
+ return exchange_value; |
|
61 |
+} |
|
62 |
+inline int8_t _Atomic_cmpxchg_byte(int8_t exchange_value, volatile int8_t* dest, int8_t compare_value) { |
|
63 |
+ __asm__ volatile ("lock cmpxchgb %1,(%3)" |
|
64 |
+ : "=a" (exchange_value) |
|
65 |
+ : "q" (exchange_value), "a" (compare_value), "r" (dest) |
|
66 |
+ : "cc", "memory"); |
|
67 |
+ return exchange_value; |
|
68 |
+} |
|
69 |
+inline int32_t _Atomic_cmpxchg(int32_t exchange_value, volatile int32_t* dest, int32_t compare_value) { |
|
70 |
+ __asm__ volatile ("lock cmpxchgl %1,(%3)" |
|
71 |
+ : "=a" (exchange_value) |
|
72 |
+ : "q" (exchange_value), "a" (compare_value), "r" (dest) |
|
73 |
+ : "cc", "memory"); |
|
74 |
+ return exchange_value; |
|
75 |
+} |
|
76 |
+inline int64_t _Atomic_cmpxchg_long(int64_t exchange_value, volatile int64_t* dest, int64_t compare_value) { |
|
77 |
+ __asm__ volatile ("lock cmpxchgq %1,(%3)" |
|
78 |
+ : "=a" (exchange_value) |
|
79 |
+ : "q" (exchange_value), "a" (compare_value), "r" (dest) |
|
80 |
+ : "cc", "memory"); |
|
81 |
+ return exchange_value; |
|
82 |
+} |
|
83 |
+ |
|
84 |
+template<size_t byte_size> |
|
85 |
+struct Atomic::PlatformAdd { |
|
86 |
+ template<typename D, typename I> |
|
87 |
+ D add_then_fetch(D volatile* dest, I add_value, atomic_memory_order order) const; |
|
88 |
+ |
|
89 |
+ template<typename D, typename I> |
|
90 |
+ D fetch_then_add(D volatile* dest, I add_value, atomic_memory_order order) const { |
|
91 |
+ return add_then_fetch(dest, add_value, order) - add_value; |
|
92 |
+ } |
|
93 |
+}; |
|
94 |
+ |
|
95 |
+// Not using add_using_helper; see comment for cmpxchg. |
|
96 |
+template<> |
|
97 |
+template<typename D, typename I> |
|
98 |
+inline D Atomic::PlatformAdd<4>::add_then_fetch(D volatile* dest, I add_value, |
|
99 |
+ atomic_memory_order order) const { |
|
100 |
+ STATIC_ASSERT(4 == sizeof(I)); |
|
101 |
+ STATIC_ASSERT(4 == sizeof(D)); |
|
102 |
+ return PrimitiveConversions::cast<D>( |
|
103 |
+ _Atomic_add(PrimitiveConversions::cast<int32_t>(add_value), |
|
104 |
+ reinterpret_cast<int32_t volatile*>(dest))); |
|
105 |
+} |
|
106 |
+ |
|
107 |
+// Not using add_using_helper; see comment for cmpxchg. |
|
108 |
+template<> |
|
109 |
+template<typename D, typename I> |
|
110 |
+inline D Atomic::PlatformAdd<8>::add_then_fetch(D volatile* dest, I add_value, |
|
111 |
+ atomic_memory_order order) const { |
|
112 |
+ STATIC_ASSERT(8 == sizeof(I)); |
|
113 |
+ STATIC_ASSERT(8 == sizeof(D)); |
|
114 |
+ return PrimitiveConversions::cast<D>( |
|
115 |
+ _Atomic_add_long(PrimitiveConversions::cast<int64_t>(add_value), |
|
116 |
+ reinterpret_cast<int64_t volatile*>(dest))); |
|
117 |
+} |
|
118 |
+ |
|
119 |
+template<> |
|
120 |
+template<typename T> |
|
121 |
+inline T Atomic::PlatformXchg<4>::operator()(T volatile* dest, |
|
122 |
+ T exchange_value, |
|
123 |
+ atomic_memory_order order) const { |
|
124 |
+ STATIC_ASSERT(4 == sizeof(T)); |
|
125 |
+ return PrimitiveConversions::cast<T>( |
|
126 |
+ _Atomic_xchg(PrimitiveConversions::cast<int32_t>(exchange_value), |
|
127 |
+ reinterpret_cast<int32_t volatile*>(dest))); |
|
128 |
+} |
|
129 |
+ |
|
130 |
+template<> |
|
131 |
+template<typename T> |
|
132 |
+inline T Atomic::PlatformXchg<8>::operator()(T volatile* dest, |
|
133 |
+ T exchange_value, |
|
134 |
+ atomic_memory_order order) const { |
|
135 |
+ STATIC_ASSERT(8 == sizeof(T)); |
|
136 |
+ return PrimitiveConversions::cast<T>( |
|
137 |
+ _Atomic_xchg_long(PrimitiveConversions::cast<int64_t>(exchange_value), |
|
138 |
+ reinterpret_cast<int64_t volatile*>(dest))); |
|
139 |
+} |
|
140 |
+ |
|
141 |
+// Not using cmpxchg_using_helper here, because some configurations of |
|
142 |
+// Solaris compiler don't deal well with passing a "defined in .il" |
|
143 |
+// function as an argument. We *should* switch to using gcc-style |
|
144 |
+// inline assembly, but attempting to do so with Studio 12.4 ran into |
|
145 |
+// segfaults. |
|
146 |
+ |
|
147 |
+template<> |
|
148 |
+template<typename T> |
|
149 |
+inline T Atomic::PlatformCmpxchg<1>::operator()(T volatile* dest, |
|
150 |
+ T compare_value, |
|
151 |
+ T exchange_value, |
|
152 |
+ atomic_memory_order order) const { |
|
153 |
+ STATIC_ASSERT(1 == sizeof(T)); |
|
154 |
+ return PrimitiveConversions::cast<T>( |
|
155 |
+ _Atomic_cmpxchg_byte(PrimitiveConversions::cast<int8_t>(exchange_value), |
|
156 |
+ reinterpret_cast<int8_t volatile*>(dest), |
|
157 |
+ PrimitiveConversions::cast<int8_t>(compare_value))); |
|
158 |
+} |
|
159 |
+ |
|
160 |
+template<> |
|
161 |
+template<typename T> |
|
162 |
+inline T Atomic::PlatformCmpxchg<4>::operator()(T volatile* dest, |
|
163 |
+ T compare_value, |
|
164 |
+ T exchange_value, |
|
165 |
+ atomic_memory_order order) const { |
|
166 |
+ STATIC_ASSERT(4 == sizeof(T)); |
|
167 |
+ return PrimitiveConversions::cast<T>( |
|
168 |
+ _Atomic_cmpxchg(PrimitiveConversions::cast<int32_t>(exchange_value), |
|
169 |
+ reinterpret_cast<int32_t volatile*>(dest), |
|
170 |
+ PrimitiveConversions::cast<int32_t>(compare_value))); |
|
171 |
+} |
|
172 |
+ |
|
173 |
+template<> |
|
174 |
+template<typename T> |
|
175 |
+inline T Atomic::PlatformCmpxchg<8>::operator()(T volatile* dest, |
|
176 |
+ T compare_value, |
|
177 |
+ T exchange_value, |
|
178 |
+ atomic_memory_order order) const { |
|
179 |
+ STATIC_ASSERT(8 == sizeof(T)); |
|
180 |
+ return PrimitiveConversions::cast<T>( |
|
181 |
+ _Atomic_cmpxchg_long(PrimitiveConversions::cast<int64_t>(exchange_value), |
|
182 |
+ reinterpret_cast<int64_t volatile*>(dest), |
|
183 |
+ PrimitiveConversions::cast<int64_t>(compare_value))); |
|
184 |
+} |
|
185 |
+ |
|
186 |
+#endif // OS_CPU_SOLARIS_X86_ATOMIC_SOLARIS_X86_HPP |
|
187 |
diff -ur -N /tmp/g/bytes_solaris_zero.inline.hpp b/src/hotspot/os_cpu/solaris_zero/bytes_solaris_zero.inline.hpp |
|
188 |
--- /tmp/g/bytes_solaris_zero.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
189 |
+++ b/src/hotspot/os_cpu/solaris_zero/bytes_solaris_zero.hpp 2020-08-31 18:20:25.351780484 +0000 |
|
190 |
@@ -0,0 +1,45 @@ |
|
191 |
+/* |
|
192 |
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
|
193 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
194 |
+ * |
|
195 |
+ * This code is free software; you can redistribute it and/or modify it |
|
196 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
197 |
+ * published by the Free Software Foundation. |
|
198 |
+ * |
|
199 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
200 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
201 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
202 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
203 |
+ * accompanied this code). |
|
204 |
+ * |
|
205 |
+ * You should have received a copy of the GNU General Public License version |
|
206 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
207 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
208 |
+ * |
|
209 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
210 |
+ * or visit www.oracle.com if you need additional information or have any |
|
211 |
+ * questions. |
|
212 |
+ * |
|
213 |
+ */ |
|
214 |
+ |
|
215 |
+#ifndef OS_CPU_SOLARIS_ZERO_BYTES_SOLARIS_ZERO_HPP |
|
216 |
+#define OS_CPU_SOLARIS_ZERO_BYTES_SOLARIS_ZERO_HPP |
|
217 |
+ |
|
218 |
+// Efficient swapping of data bytes from Java byte |
|
219 |
+// ordering to native byte ordering and vice versa. |
|
220 |
+ |
|
221 |
+#include <sys/byteorder.h> |
|
222 |
+ |
|
223 |
+inline u2 Bytes::swap_u2(u2 x) { |
|
224 |
+ return BSWAP_16(x); |
|
225 |
+} |
|
226 |
+ |
|
227 |
+inline u4 Bytes::swap_u4(u4 x) { |
|
228 |
+ return BSWAP_32(x); |
|
229 |
+} |
|
230 |
+ |
|
231 |
+inline u8 Bytes::swap_u8(u8 x) { |
|
232 |
+ return BSWAP_64(x); |
|
233 |
+} |
|
234 |
+ |
|
235 |
+#endif // OS_CPU_SOLARIS_ZERO_BYTES_SOLARIS_ZERO_HPP |
|
236 |
diff -ur -N /tmp/g/globals_solaris_zero.hpp b/src/hotspot/os_cpu/solaris_zero/globals_solaris_zero.hpp |
|
237 |
--- /tmp/g/globals_solaris_zero.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
238 |
+++ b/src/hotspot/os_cpu/solaris_zero/globals_solaris_zero.hpp 2020-08-31 18:03:16.351225683 +0000 |
|
239 |
@@ -0,0 +1,40 @@ |
|
240 |
+/* |
|
241 |
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. |
|
242 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
243 |
+ * |
|
244 |
+ * This code is free software; you can redistribute it and/or modify it |
|
245 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
246 |
+ * published by the Free Software Foundation. |
|
247 |
+ * |
|
248 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
249 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
250 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
251 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
252 |
+ * accompanied this code). |
|
253 |
+ * |
|
254 |
+ * You should have received a copy of the GNU General Public License version |
|
255 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
256 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
257 |
+ * |
|
258 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
259 |
+ * or visit www.oracle.com if you need additional information or have any |
|
260 |
+ * questions. |
|
261 |
+ * |
|
262 |
+ */ |
|
263 |
+ |
|
264 |
+#ifndef OS_CPU_SOLARIS_ZERO_GLOBALS_SOLARIS_ZERO_HPP |
|
265 |
+#define OS_CPU_SOLARIS_ZERO_GLOBALS_SOLARIS_ZERO_HPP |
|
266 |
+ |
|
267 |
+// Sets the default values for platform dependent flags used by the runtime system. |
|
268 |
+// (see globals.hpp) |
|
269 |
+ |
|
270 |
+define_pd_global(bool, DontYieldALot, true); // Determined in the design center |
|
271 |
+define_pd_global(intx, CompilerThreadStackSize, 1024); |
|
272 |
+define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default |
|
273 |
+define_pd_global(intx, VMThreadStackSize, 1024); |
|
274 |
+define_pd_global(size_t, JVMInvokeMethodSlack, 8*K); |
|
275 |
+ |
|
276 |
+// Used on 64 bit platforms for UseCompressedOops base address |
|
277 |
+define_pd_global(size_t, HeapBaseMinAddress, 2*G); |
|
278 |
+ |
|
279 |
+#endif // OS_CPU_SOLARIS_ZERO_GLOBALS_SOLARIS_ZERO_HPP |
|
280 |
diff -ur -N /tmp/g/orderAccess_solaris_zero.hpp b/src/hotspot/os_cpu/solaris_zero/orderAccess_solaris_zero.hpp |
|
281 |
--- /tmp/g/orderAccess_solaris_zero.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
282 |
+++ b/src/hotspot/os_cpu/solaris_zero/orderAccess_solaris_zero.hpp 2020-08-31 18:13:46.830570494 +0000 |
|
283 |
@@ -0,0 +1,78 @@ |
|
284 |
+/* |
|
285 |
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
|
286 |
+ * Copyright 2007, 2008, 2009 Red Hat, Inc. |
|
287 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
288 |
+ * |
|
289 |
+ * This code is free software; you can redistribute it and/or modify it |
|
290 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
291 |
+ * published by the Free Software Foundation. |
|
292 |
+ * |
|
293 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
294 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
295 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
296 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
297 |
+ * accompanied this code). |
|
298 |
+ * |
|
299 |
+ * You should have received a copy of the GNU General Public License version |
|
300 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
301 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
302 |
+ * |
|
303 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
304 |
+ * or visit www.oracle.com if you need additional information or have any |
|
305 |
+ * questions. |
|
306 |
+ * |
|
307 |
+ */ |
|
308 |
+ |
|
309 |
+#ifndef OS_CPU_SOLARIS_ZERO_ORDERACCESS_SOLARIS_ZERO_HPP |
|
310 |
+#define OS_CPU_SOLARIS_ZERO_ORDERACCESS_SOLARIS_ZERO_HPP |
|
311 |
+ |
|
312 |
+// Included in orderAccess.hpp header file. |
|
313 |
+ |
|
314 |
+#ifdef ARM |
|
315 |
+ |
|
316 |
+/* |
|
317 |
+ * ARM Kernel helper for memory barrier. |
|
318 |
+ * Using __asm __volatile ("":::"memory") does not work reliable on ARM |
|
319 |
+ * and gcc __sync_synchronize(); implementation does not use the kernel |
|
320 |
+ * helper for all gcc versions so it is unreliable to use as well. |
|
321 |
+ */ |
|
322 |
+typedef void (__kernel_dmb_t) (void); |
|
323 |
+#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) |
|
324 |
+ |
|
325 |
+#define FULL_MEM_BARRIER __kernel_dmb() |
|
326 |
+#define LIGHT_MEM_BARRIER __kernel_dmb() |
|
327 |
+ |
|
328 |
+#else // ARM |
|
329 |
+ |
|
330 |
+#define FULL_MEM_BARRIER __sync_synchronize() |
|
331 |
+ |
|
332 |
+#ifdef PPC |
|
333 |
+ |
|
334 |
+#ifdef __NO_LWSYNC__ |
|
335 |
+#define LIGHT_MEM_BARRIER __asm __volatile ("sync":::"memory") |
|
336 |
+#else |
|
337 |
+#define LIGHT_MEM_BARRIER __asm __volatile ("lwsync":::"memory") |
|
338 |
+#endif |
|
339 |
+ |
|
340 |
+#else // PPC |
|
341 |
+ |
|
342 |
+#define LIGHT_MEM_BARRIER __asm __volatile ("":::"memory") |
|
343 |
+ |
|
344 |
+#endif // PPC |
|
345 |
+ |
|
346 |
+#endif // ARM |
|
347 |
+ |
|
348 |
+// Note: What is meant by LIGHT_MEM_BARRIER is a barrier which is sufficient |
|
349 |
+// to provide TSO semantics, i.e. StoreStore | LoadLoad | LoadStore. |
|
350 |
+ |
|
351 |
+inline void OrderAccess::loadload() { LIGHT_MEM_BARRIER; } |
|
352 |
+inline void OrderAccess::storestore() { LIGHT_MEM_BARRIER; } |
|
353 |
+inline void OrderAccess::loadstore() { LIGHT_MEM_BARRIER; } |
|
354 |
+inline void OrderAccess::storeload() { FULL_MEM_BARRIER; } |
|
355 |
+ |
|
356 |
+inline void OrderAccess::acquire() { LIGHT_MEM_BARRIER; } |
|
357 |
+inline void OrderAccess::release() { LIGHT_MEM_BARRIER; } |
|
358 |
+inline void OrderAccess::fence() { FULL_MEM_BARRIER; } |
|
359 |
+inline void OrderAccess::cross_modify_fence_impl() { } |
|
360 |
+ |
|
361 |
+#endif // OS_CPU_SOLARIS_ZERO_ORDERACCESS_SOLARIS_ZERO_HPP |
|
362 |
diff -ur -N /tmp/g/os_solaris_zero.cpp b/src/hotspot/os_cpu/solaris_zero/os_solaris_zero.cpp |
|
363 |
--- /tmp/g/os_solaris_zero.cpp 1970-01-01 01:00:00.000000000 +0000 |
|
364 |
+++ b/src/hotspot/os_cpu/solaris_zero/os_solaris_zero.cpp 2020-09-02 13:28:22.493092922 +0000 |
|
365 |
@@ -0,0 +1,299 @@ |
|
366 |
+/* |
|
367 |
+ * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. |
|
368 |
+ * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. |
|
369 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
370 |
+ * |
|
371 |
+ * This code is free software; you can redistribute it and/or modify it |
|
372 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
373 |
+ * published by the Free Software Foundation. |
|
374 |
+ * |
|
375 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
376 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
377 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
378 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
379 |
+ * accompanied this code). |
|
380 |
+ * |
|
381 |
+ * You should have received a copy of the GNU General Public License version |
|
382 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
383 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
384 |
+ * |
|
385 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
386 |
+ * or visit www.oracle.com if you need additional information or have any |
|
387 |
+ * questions. |
|
388 |
+ * |
|
389 |
+ */ |
|
390 |
+ |
|
391 |
+#include <pthread.h> /* For pthread_attr_get_np */ |
|
392 |
+ |
|
393 |
+// no precompiled headers |
|
394 |
+#include "jvm.h" |
|
395 |
+#include "assembler_zero.inline.hpp" |
|
396 |
+#include "classfile/classLoader.hpp" |
|
397 |
+#include "classfile/systemDictionary.hpp" |
|
398 |
+#include "classfile/vmSymbols.hpp" |
|
399 |
+#include "code/icBuffer.hpp" |
|
400 |
+#include "code/vtableStubs.hpp" |
|
401 |
+#include "interpreter/interpreter.hpp" |
|
402 |
+#include "memory/allocation.inline.hpp" |
|
403 |
+#include "os_solaris.hpp" |
|
404 |
+#include "os_posix.hpp" |
|
405 |
+#include "nativeInst_zero.hpp" |
|
406 |
+#include "prims/jniFastGetField.hpp" |
|
407 |
+#include "prims/jvm_misc.hpp" |
|
408 |
+#include "runtime/arguments.hpp" |
|
409 |
+#include "runtime/frame.inline.hpp" |
|
410 |
+#include "runtime/interfaceSupport.inline.hpp" |
|
411 |
+#include "runtime/java.hpp" |
|
412 |
+#include "runtime/javaCalls.hpp" |
|
413 |
+#include "runtime/mutexLocker.hpp" |
|
414 |
+#include "runtime/osThread.hpp" |
|
415 |
+#include "runtime/sharedRuntime.hpp" |
|
416 |
+#include "runtime/stubRoutines.hpp" |
|
417 |
+#include "runtime/thread.inline.hpp" |
|
418 |
+#include "runtime/timer.hpp" |
|
419 |
+#include "signals_posix.hpp" |
|
420 |
+#include "utilities/events.hpp" |
|
421 |
+#include "utilities/vmError.hpp" |
|
422 |
+ |
|
423 |
+// See stubGenerator_zero.cpp |
|
424 |
+#include <setjmp.h> |
|
425 |
+extern sigjmp_buf* get_jmp_buf_for_continuation(); |
|
426 |
+ |
|
427 |
+address os::current_stack_pointer() { |
|
428 |
+ // return the address of the current function |
|
429 |
+ return (address)__builtin_frame_address(0); |
|
430 |
+} |
|
431 |
+ |
|
432 |
+frame os::get_sender_for_C_frame(frame* fr) { |
|
433 |
+ ShouldNotCallThis(); |
|
434 |
+ return frame(); |
|
435 |
+} |
|
436 |
+ |
|
437 |
+frame os::current_frame() { |
|
438 |
+ // The only thing that calls this is the stack printing code in |
|
439 |
+ // VMError::report: |
|
440 |
+ // - Step 110 (printing stack bounds) uses the sp in the frame |
|
441 |
+ // to determine the amount of free space on the stack. We |
|
442 |
+ // set the sp to a close approximation of the real value in |
|
443 |
+ // order to allow this step to complete. |
|
444 |
+ // - Step 120 (printing native stack) tries to walk the stack. |
|
445 |
+ // The frame we create has a NULL pc, which is ignored as an |
|
446 |
+ // invalid frame. |
|
447 |
+ frame dummy = frame(); |
|
448 |
+ dummy.set_sp((intptr_t *) current_stack_pointer()); |
|
449 |
+ return dummy; |
|
450 |
+} |
|
451 |
+ |
|
452 |
+char* os::non_memory_address_word() { |
|
453 |
+ // Must never look like an address returned by reserve_memory, |
|
454 |
+ // even in its subfields (as defined by the CPU immediate fields, |
|
455 |
+ // if the CPU splits constants across multiple instructions). |
|
456 |
+ // This is the value for x86; works pretty well for PPC too. |
|
457 |
+ return (char *) -1; |
|
458 |
+} |
|
459 |
+ |
|
460 |
+address os::Posix::ucontext_get_pc(const ucontext_t* uc) { |
|
461 |
+ ShouldNotCallThis(); |
|
462 |
+ return NULL; |
|
463 |
+} |
|
464 |
+ |
|
465 |
+void os::Posix::ucontext_set_pc(ucontext_t * uc, address pc) { |
|
466 |
+ ShouldNotCallThis(); |
|
467 |
+} |
|
468 |
+ |
|
469 |
+address os::fetch_frame_from_context(const void* ucVoid, |
|
470 |
+ intptr_t** ret_sp, |
|
471 |
+ intptr_t** ret_fp) { |
|
472 |
+ ShouldNotCallThis(); |
|
473 |
+ return NULL; |
|
474 |
+} |
|
475 |
+ |
|
476 |
+frame os::fetch_frame_from_context(const void* ucVoid) { |
|
477 |
+ ShouldNotCallThis(); |
|
478 |
+ return frame(); |
|
479 |
+} |
|
480 |
+ |
|
481 |
+bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, |
|
482 |
+ ucontext_t* uc, JavaThread* thread) { |
|
483 |
+ |
|
484 |
+ if (info != NULL && thread != NULL) { |
|
485 |
+ // Handle ALL stack overflow variations here |
|
486 |
+ if (sig == SIGSEGV || sig == SIGBUS) { |
|
487 |
+ address addr = (address) info->si_addr; |
|
488 |
+ |
|
489 |
+ // check if fault address is within thread stack |
|
490 |
+ if (thread->is_in_full_stack(addr)) { |
|
491 |
+ StackOverflow* overflow_state = thread->stack_overflow_state(); |
|
492 |
+ // stack overflow |
|
493 |
+ if (overflow_state->in_stack_yellow_reserved_zone(addr)) { |
|
494 |
+ overflow_state->disable_stack_yellow_reserved_zone(); |
|
495 |
+ ShouldNotCallThis(); |
|
496 |
+ } |
|
497 |
+ else if (overflow_state->in_stack_red_zone(addr)) { |
|
498 |
+ overflow_state->disable_stack_red_zone(); |
|
499 |
+ ShouldNotCallThis(); |
|
500 |
+ } |
|
501 |
+ } |
|
502 |
+ } |
|
503 |
+ |
|
504 |
+ /*if (thread->thread_state() == _thread_in_Java) { |
|
505 |
+ ShouldNotCallThis(); |
|
506 |
+ } |
|
507 |
+ else*/ if ((thread->thread_state() == _thread_in_vm || |
|
508 |
+ thread->thread_state() == _thread_in_native) && |
|
509 |
+ sig == SIGBUS && thread->doing_unsafe_access()) { |
|
510 |
+ ShouldNotCallThis(); |
|
511 |
+ } |
|
512 |
+ |
|
513 |
+ // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC |
|
514 |
+ // kicks in and the heap gets shrunk before the field access. |
|
515 |
+ /*if (sig == SIGSEGV || sig == SIGBUS) { |
|
516 |
+ address addr = JNI_FastGetField::find_slowcase_pc(pc); |
|
517 |
+ if (addr != (address)-1) { |
|
518 |
+ stub = addr; |
|
519 |
+ } |
|
520 |
+ }*/ |
|
521 |
+ } |
|
522 |
+ |
|
523 |
+ return false; |
|
524 |
+} |
|
525 |
+ |
|
526 |
+void os::Solaris::init_thread_fpu_state(void) { |
|
527 |
+ // Nothing to do |
|
528 |
+} |
|
529 |
+ |
|
530 |
+// Minimum usable stack sizes required to get to user code. Space for |
|
531 |
+// HotSpot guard pages is added later. |
|
532 |
+#ifdef _LP64 |
|
533 |
+// The adlc generated method 'State::MachNodeGenerator(int)' used by the C2 compiler |
|
534 |
+// threads requires a large stack with the Solaris Studio C++ compiler version 5.13 |
|
535 |
+// and product VM builds (debug builds require significantly less stack space). |
|
536 |
+size_t os::_compiler_thread_min_stack_allowed = 325 * K; |
|
537 |
+size_t os::_java_thread_min_stack_allowed = 48 * K; |
|
538 |
+size_t os::_vm_internal_thread_min_stack_allowed = 224 * K; |
|
539 |
+#else |
|
540 |
+size_t os::_compiler_thread_min_stack_allowed = 32 * K; |
|
541 |
+size_t os::_java_thread_min_stack_allowed = 32 * K; |
|
542 |
+size_t os::_vm_internal_thread_min_stack_allowed = 64 * K; |
|
543 |
+#endif // _LP64 |
|
544 |
+ |
|
545 |
+///////////////////////////////////////////////////////////////////////////// |
|
546 |
+// helper functions for fatal error handler |
|
547 |
+ |
|
548 |
+void os::print_context(outputStream* st, const void* context) { |
|
549 |
+ ShouldNotCallThis(); |
|
550 |
+} |
|
551 |
+ |
|
552 |
+void os::print_tos_pc(outputStream* st, const void* context) { |
|
553 |
+ ShouldNotCallThis(); |
|
554 |
+} |
|
555 |
+ |
|
556 |
+void os::print_register_info(outputStream *st, const void *context, int& continuation) { |
|
557 |
+ st->print_cr("No register info."); |
|
558 |
+} |
|
559 |
+ |
|
560 |
+// Atomically copy 64 bits of data |
|
561 |
+static inline void atomic_copy64(const volatile void *src, volatile void *dst) { |
|
562 |
+ *(jlong *) dst = *(const jlong *) src; |
|
563 |
+} |
|
564 |
+ |
|
565 |
+///////////////////////////////////////////////////////////////////////////// |
7184c7
|
566 |
+// Stubs for things that would be in solaris_zero.s if it existed. |
c448de
|
567 |
+// You probably want to disassemble these monkeys to check they're ok. |
NP |
568 |
+ |
|
569 |
+extern "C" { |
|
570 |
+ int SpinPause() { |
|
571 |
+ return 1; |
|
572 |
+ } |
|
573 |
+ |
|
574 |
+ void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) { |
|
575 |
+ if (from > to) { |
|
576 |
+ const jshort *end = from + count; |
|
577 |
+ while (from < end) |
|
578 |
+ *(to++) = *(from++); |
|
579 |
+ } |
|
580 |
+ else if (from < to) { |
|
581 |
+ const jshort *end = from; |
|
582 |
+ from += count - 1; |
|
583 |
+ to += count - 1; |
|
584 |
+ while (from >= end) |
|
585 |
+ *(to--) = *(from--); |
|
586 |
+ } |
|
587 |
+ } |
|
588 |
+ void _Copy_conjoint_jints_atomic(const jint* from, jint* to, size_t count) { |
|
589 |
+ if (from > to) { |
|
590 |
+ const jint *end = from + count; |
|
591 |
+ while (from < end) |
|
592 |
+ *(to++) = *(from++); |
|
593 |
+ } |
|
594 |
+ else if (from < to) { |
|
595 |
+ const jint *end = from; |
|
596 |
+ from += count - 1; |
|
597 |
+ to += count - 1; |
|
598 |
+ while (from >= end) |
|
599 |
+ *(to--) = *(from--); |
|
600 |
+ } |
|
601 |
+ } |
|
602 |
+ void _Copy_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) { |
|
603 |
+ if (from > to) { |
|
604 |
+ const jlong *end = from + count; |
|
605 |
+ while (from < end) |
|
606 |
+ atomic_copy64(from++, to++); |
|
607 |
+ } |
|
608 |
+ else if (from < to) { |
|
609 |
+ const jlong *end = from; |
|
610 |
+ from += count - 1; |
|
611 |
+ to += count - 1; |
|
612 |
+ while (from >= end) |
|
613 |
+ atomic_copy64(from--, to--); |
|
614 |
+ } |
|
615 |
+ } |
|
616 |
+ |
|
617 |
+ void _Copy_arrayof_conjoint_bytes(const HeapWord* from, |
|
618 |
+ HeapWord* to, |
|
619 |
+ size_t count) { |
|
620 |
+ memmove(to, from, count); |
|
621 |
+ } |
|
622 |
+ void _Copy_arrayof_conjoint_jshorts(const HeapWord* from, |
|
623 |
+ HeapWord* to, |
|
624 |
+ size_t count) { |
|
625 |
+ memmove(to, from, count * 2); |
|
626 |
+ } |
|
627 |
+ void _Copy_arrayof_conjoint_jints(const HeapWord* from, |
|
628 |
+ HeapWord* to, |
|
629 |
+ size_t count) { |
|
630 |
+ memmove(to, from, count * 4); |
|
631 |
+ } |
|
632 |
+ void _Copy_arrayof_conjoint_jlongs(const HeapWord* from, |
|
633 |
+ HeapWord* to, |
|
634 |
+ size_t count) { |
|
635 |
+ memmove(to, from, count * 8); |
|
636 |
+ } |
|
637 |
+}; |
|
638 |
+ |
|
639 |
+///////////////////////////////////////////////////////////////////////////// |
|
640 |
+// Implementations of atomic operations not supported by processors. |
|
641 |
+// -- http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Atomic-Builtins.html |
|
642 |
+ |
|
643 |
+#ifndef _LP64 |
|
644 |
+extern "C" { |
|
645 |
+ long long unsigned int __sync_val_compare_and_swap_8( |
|
646 |
+ volatile void *ptr, |
|
647 |
+ long long unsigned int oldval, |
|
648 |
+ long long unsigned int newval) { |
|
649 |
+ ShouldNotCallThis(); |
|
650 |
+ } |
|
651 |
+}; |
|
652 |
+#endif // !_LP64 |
|
653 |
+ |
|
654 |
+void os::setup_fpu() {} |
|
655 |
+ |
|
656 |
+#ifndef PRODUCT |
|
657 |
+void os::verify_stack_alignment() { |
|
658 |
+} |
|
659 |
+#endif |
|
660 |
+ |
|
661 |
+int os::extra_bang_size_in_bytes() { |
|
662 |
+ // Zero does not require an additional stack bang. |
|
663 |
+ return 0; |
|
664 |
+} |
|
665 |
diff -ur -N /tmp/g/os_solaris_zero.hpp b/src/hotspot/os_cpu/solaris_zero/os_solaris_zero.hpp |
|
666 |
--- /tmp/g/os_solaris_zero.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
667 |
+++ b/src/hotspot/os_cpu/solaris_zero/os_solaris_zero.hpp 2020-09-01 22:01:25.502220121 +0000 |
|
668 |
@@ -0,0 +1,62 @@ |
|
669 |
+/* |
|
670 |
+ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. |
|
671 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
672 |
+ * |
|
673 |
+ * This code is free software; you can redistribute it and/or modify it |
|
674 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
675 |
+ * published by the Free Software Foundation. |
|
676 |
+ * |
|
677 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
678 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
679 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
680 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
681 |
+ * accompanied this code). |
|
682 |
+ * |
|
683 |
+ * You should have received a copy of the GNU General Public License version |
|
684 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
685 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
686 |
+ * |
|
687 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
688 |
+ * or visit www.oracle.com if you need additional information or have any |
|
689 |
+ * questions. |
|
690 |
+ * |
|
691 |
+ */ |
|
692 |
+ |
|
693 |
+#ifndef OS_CPU_SOLARIS_ZERO_OS_SOLARIS_ZERO_HPP |
|
694 |
+#define OS_CPU_SOLARIS_ZERO_OS_SOLARIS_ZERO_HPP |
|
695 |
+ |
|
696 |
+ // |
|
697 |
+ // NOTE: we are back in class os here, not Solaris |
|
698 |
+ // |
|
699 |
+#ifdef AMD64 |
|
700 |
+ static void setup_fpu() {} |
|
701 |
+#else |
|
702 |
+ static int32_t (*atomic_xchg_func) (int32_t, volatile int32_t*); |
|
703 |
+ static int32_t (*atomic_cmpxchg_func) (int32_t, volatile int32_t*, int32_t); |
|
704 |
+ static int64_t (*atomic_cmpxchg_long_func)(int64_t, volatile int64_t*, int64_t); |
|
705 |
+ static int32_t (*atomic_add_func) (int32_t, volatile int32_t*); |
|
706 |
+ |
|
707 |
+ static int32_t atomic_xchg_bootstrap (int32_t, volatile int32_t*); |
|
708 |
+ static int32_t atomic_cmpxchg_bootstrap (int32_t, volatile int32_t*, int32_t); |
|
709 |
+ static int64_t atomic_cmpxchg_long_bootstrap(int64_t, volatile int64_t*, int64_t); |
|
710 |
+ static int32_t atomic_add_bootstrap (int32_t, volatile int32_t*); |
|
711 |
+ |
|
712 |
+ static void setup_fpu() {} |
|
713 |
+#endif // AMD64 |
|
714 |
+ |
|
715 |
+ static juint cpu_microcode_revision(); |
|
716 |
+ |
|
717 |
+ static jlong rdtsc(); |
|
718 |
+ |
|
719 |
+ static bool is_allocatable(size_t bytes); |
|
720 |
+ |
|
721 |
+ // Used to register dynamic code cache area with the OS |
|
722 |
+ // Note: Currently only used in 64 bit Windows implementations |
|
723 |
+ static bool register_code_area(char *low, char *high) { return true; } |
|
724 |
+ |
|
725 |
+ // Atomically copy 64 bits of data |
|
726 |
+ static void atomic_copy64(const volatile void *src, volatile void *dst) { |
|
727 |
+ *(jlong *) dst = *(const jlong *) src; |
|
728 |
+ } |
|
729 |
+ |
|
730 |
+#endif // OS_CPU_SOLARIS_ZERO_OS_SOLARIS_ZERO_HPP |
|
731 |
diff -ur -N /tmp/g/prefetch_solaris_zero.inline.hpp b/src/hotspot/os_cpu/solaris_zero/prefetch_solaris_zero.inline.hpp |
|
732 |
--- /tmp/g/prefetch_solaris_zero.inline.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
733 |
+++ b/src/hotspot/os_cpu/solaris_zero/prefetch_solaris_zero.inline.hpp 2020-09-01 21:42:41.412265130 +0000 |
|
734 |
@@ -0,0 +1,37 @@ |
|
735 |
+/* |
|
736 |
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
|
737 |
+ * Copyright 2007, 2008 Red Hat, Inc. |
|
738 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
739 |
+ * |
|
740 |
+ * This code is free software; you can redistribute it and/or modify it |
|
741 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
742 |
+ * published by the Free Software Foundation. |
|
743 |
+ * |
|
744 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
745 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
746 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
747 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
748 |
+ * accompanied this code). |
|
749 |
+ * |
|
750 |
+ * You should have received a copy of the GNU General Public License version |
|
751 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
752 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
753 |
+ * |
|
754 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
755 |
+ * or visit www.oracle.com if you need additional information or have any |
|
756 |
+ * questions. |
|
757 |
+ * |
|
758 |
+ */ |
|
759 |
+ |
|
760 |
+#ifndef OS_CPU_SOLARIS_ZERO_PREFETCH_SOLARIS_ZERO_INLINE_HPP |
|
761 |
+#define OS_CPU_SOLARIS_ZERO_PREFETCH_SOLARIS_ZERO_INLINE_HPP |
|
762 |
+ |
|
763 |
+#include "runtime/prefetch.hpp" |
|
764 |
+ |
|
765 |
+inline void Prefetch::read(const void *loc, intx interval) { |
|
766 |
+} |
|
767 |
+ |
|
768 |
+inline void Prefetch::write(void *loc, intx interval) { |
|
769 |
+} |
|
770 |
+ |
|
771 |
+#endif // OS_CPU_SOLARIS_ZERO_PREFETCH_SOLARIS_ZERO_INLINE_HPP |
|
772 |
diff -ur -N /tmp/g/javaThread_solaris_zero.cpp b/src/hotspot/os_cpu/solaris_zero/javaThread_solaris_zero.cpp |
|
773 |
--- /tmp/g/javaThread_solaris_zero.cpp 1970-01-01 01:00:00.000000000 +0000 |
|
774 |
+++ b/src/hotspot/os_cpu/solaris_zero/javaThread_solaris_zero.cpp 2020-09-01 21:40:25.604734766 +0000 |
|
775 |
@@ -0,0 +1,37 @@ |
|
776 |
+/* |
|
777 |
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
|
778 |
+ * Copyright 2009, 2010 Red Hat, Inc. |
|
779 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
780 |
+ * |
|
781 |
+ * This code is free software; you can redistribute it and/or modify it |
|
782 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
783 |
+ * published by the Free Software Foundation. |
|
784 |
+ * |
|
785 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
786 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
787 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
788 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
789 |
+ * accompanied this code). |
|
790 |
+ * |
|
791 |
+ * You should have received a copy of the GNU General Public License version |
|
792 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
793 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
794 |
+ * |
|
795 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
796 |
+ * or visit www.oracle.com if you need additional information or have any |
|
797 |
+ * questions. |
|
798 |
+ * |
|
799 |
+ */ |
|
800 |
+ |
|
801 |
+#include "precompiled.hpp" |
|
802 |
+#include "runtime/frame.inline.hpp" |
|
803 |
+#include "runtime/javaThread.hpp" |
|
804 |
+ |
|
805 |
+frame JavaThread::pd_last_frame() { |
|
806 |
+ assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); |
|
807 |
+ return frame(last_Java_fp(), last_Java_sp()); |
|
808 |
+} |
|
809 |
+ |
|
810 |
+void JavaThread::cache_global_variables() { |
|
811 |
+ // nothing to do |
|
812 |
+} |
|
813 |
diff -ur -N /tmp/g/javaThread_solaris_zero.hpp b/src/hotspot/os_cpu/solaris_zero/javaThread_solaris_zero.hpp |
|
814 |
--- /tmp/g/javaThread_solaris_zero.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
815 |
+++ b/src/hotspot/os_cpu/solaris_zero/javaThread_solaris_zero.hpp 2020-09-01 21:39:59.895910869 +0000 |
|
816 |
@@ -0,0 +1,104 @@ |
|
817 |
+/* |
|
818 |
+ * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. |
|
819 |
+ * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. |
|
820 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
821 |
+ * |
|
822 |
+ * This code is free software; you can redistribute it and/or modify it |
|
823 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
824 |
+ * published by the Free Software Foundation. |
|
825 |
+ * |
|
826 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
827 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
828 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
829 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
830 |
+ * accompanied this code). |
|
831 |
+ * |
|
832 |
+ * You should have received a copy of the GNU General Public License version |
|
833 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
834 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
835 |
+ * |
|
836 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
837 |
+ * or visit www.oracle.com if you need additional information or have any |
|
838 |
+ * questions. |
|
839 |
+ * |
|
840 |
+ */ |
|
841 |
+ |
|
842 |
+#ifndef OS_CPU_SOLARIS_ZERO_JAVATHREAD_SOLARIS_ZERO_HPP |
|
843 |
+#define OS_CPU_SOLARIS_ZERO_JAVATHREAD_SOLARIS_ZERO_HPP |
|
844 |
+ |
|
845 |
+ private: |
|
846 |
+ ZeroStack _zero_stack; |
|
847 |
+ ZeroFrame* _top_zero_frame; |
|
848 |
+ |
|
849 |
+ void pd_initialize() { |
|
850 |
+ _top_zero_frame = NULL; |
|
851 |
+ } |
|
852 |
+ |
|
853 |
+ public: |
|
854 |
+ ZeroStack *zero_stack() { |
|
855 |
+ return &_zero_stack; |
|
856 |
+ } |
|
857 |
+ |
|
858 |
+ public: |
|
859 |
+ ZeroFrame *top_zero_frame() { |
|
860 |
+ return _top_zero_frame; |
|
861 |
+ } |
|
862 |
+ void push_zero_frame(ZeroFrame *frame) { |
|
863 |
+ *(ZeroFrame **) frame = _top_zero_frame; |
|
864 |
+ _top_zero_frame = frame; |
|
865 |
+ } |
|
866 |
+ void pop_zero_frame() { |
|
867 |
+ zero_stack()->set_sp((intptr_t *) _top_zero_frame + 1); |
|
868 |
+ _top_zero_frame = *(ZeroFrame **) _top_zero_frame; |
|
869 |
+ } |
|
870 |
+ |
|
871 |
+ public: |
|
872 |
+ static ByteSize zero_stack_offset() { |
|
873 |
+ return byte_offset_of(JavaThread, _zero_stack); |
|
874 |
+ } |
|
875 |
+ static ByteSize top_zero_frame_offset() { |
|
876 |
+ return byte_offset_of(JavaThread, _top_zero_frame); |
|
877 |
+ } |
|
878 |
+ |
|
879 |
+ public: |
|
880 |
+ void set_last_Java_frame() { |
|
881 |
+ set_last_Java_frame(top_zero_frame(), zero_stack()->sp()); |
|
882 |
+ } |
|
883 |
+ void reset_last_Java_frame() { |
|
884 |
+ frame_anchor()->zap(); |
|
885 |
+ } |
|
886 |
+ void set_last_Java_frame(ZeroFrame* fp, intptr_t* sp) { |
|
887 |
+ frame_anchor()->set(sp, NULL, fp); |
|
888 |
+ } |
|
889 |
+ |
|
890 |
+ public: |
|
891 |
+ ZeroFrame* last_Java_fp() { |
|
892 |
+ return frame_anchor()->last_Java_fp(); |
|
893 |
+ } |
|
894 |
+ |
|
895 |
+ private: |
|
896 |
+ frame pd_last_frame(); |
|
897 |
+ |
|
898 |
+ public: |
|
899 |
+ static ByteSize last_Java_fp_offset() { |
|
900 |
+ return byte_offset_of(JavaThread, _anchor) + |
|
901 |
+ JavaFrameAnchor::last_Java_fp_offset(); |
|
902 |
+ } |
|
903 |
+ |
|
904 |
+ public: |
|
905 |
+ // Check for pending suspend requests and pending asynchronous |
|
906 |
+ // exceptions. There are separate accessors for these, but |
|
907 |
+ // _suspend_flags is volatile so using them would be unsafe. |
|
908 |
+ bool has_special_condition_for_native_trans() { |
|
909 |
+ return _suspend_flags != 0; |
|
910 |
+ } |
|
911 |
+ |
|
912 |
+ public: |
|
913 |
+ bool pd_get_top_frame_for_signal_handler(frame* fr_addr, |
|
914 |
+ void* ucontext, |
|
915 |
+ bool isInJava) { |
|
916 |
+ ShouldNotCallThis(); |
|
917 |
+ return false; |
|
918 |
+ } |
|
919 |
+ |
|
920 |
+#endif // OS_CPU_SOLARIS_ZERO_JAVATHREAD_SOLARIS_ZERO_HPP |
|
921 |
diff -ur -N /tmp/g/vmStructs_solaris_zero.hpp b/src/hotspot/os_cpu/solaris_zero/vmStructs_solaris_zero.hpp |
|
922 |
--- /tmp/g/vmStructs_solaris_zero.hpp 1970-01-01 01:00:00.000000000 +0000 |
|
923 |
+++ b/src/hotspot/os_cpu/solaris_zero/vmStructs_solaris_zero.hpp 2020-09-01 21:48:37.312847065 +0000 |
|
924 |
@@ -0,0 +1,42 @@ |
|
925 |
+/* |
|
926 |
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
|
927 |
+ * Copyright 2007 Red Hat, Inc. |
|
928 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
929 |
+ * |
|
930 |
+ * This code is free software; you can redistribute it and/or modify it |
|
931 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
932 |
+ * published by the Free Software Foundation. |
|
933 |
+ * |
|
934 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
935 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
936 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
937 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
938 |
+ * accompanied this code). |
|
939 |
+ * |
|
940 |
+ * You should have received a copy of the GNU General Public License version |
|
941 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
942 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
943 |
+ * |
|
944 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
945 |
+ * or visit www.oracle.com if you need additional information or have any |
|
946 |
+ * questions. |
|
947 |
+ * |
|
948 |
+ */ |
|
949 |
+ |
|
950 |
+#ifndef OS_CPU_SOLARIS_ZERO_VMSTRUCTS_SOLARIS_ZERO_HPP |
|
951 |
+#define OS_CPU_SOLARIS_ZERO_VMSTRUCTS_SOLARIS_ZERO_HPP |
|
952 |
+ |
|
953 |
+// These are the OS and CPU-specific fields, types and integer |
|
954 |
+// constants required by the Serviceability Agent. This file is |
|
955 |
+// referenced by vmStructs.cpp. |
|
956 |
+ |
|
957 |
+#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) |
|
958 |
+ |
|
959 |
+ |
|
960 |
+#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) |
|
961 |
+ |
|
962 |
+#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) |
|
963 |
+ |
|
964 |
+#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) |
|
965 |
+ |
|
966 |
+#endif // OS_CPU_SOLARIS_ZERO_VMSTRUCTS_SOLARIS_ZERO_HPP |
|
967 |
--- /dev/null 2022-08-12 13:25:23.000000000 +0000 |
|
968 |
+++ b/src/hotspot/os_cpu/solaris_zero/os_solaris_zero.inline.hpp 2022-08-12 08:53:34.279529742 +0000 |
|
969 |
@@ -0,0 +1,30 @@ |
|
970 |
+/* |
|
971 |
+ * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. |
|
972 |
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
973 |
+ * |
|
974 |
+ * This code is free software; you can redistribute it and/or modify it |
|
975 |
+ * under the terms of the GNU General Public License version 2 only, as |
|
976 |
+ * published by the Free Software Foundation. |
|
977 |
+ * |
|
978 |
+ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
979 |
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
980 |
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
981 |
+ * version 2 for more details (a copy is included in the LICENSE file that |
|
982 |
+ * accompanied this code). |
|
983 |
+ * |
|
984 |
+ * You should have received a copy of the GNU General Public License version |
|
985 |
+ * 2 along with this work; if not, write to the Free Software Foundation, |
|
986 |
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
987 |
+ * |
|
988 |
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
989 |
+ * or visit www.oracle.com if you need additional information or have any |
|
990 |
+ * questions. |
|
991 |
+ * |
|
992 |
+ */ |
|
993 |
+ |
|
994 |
+#ifndef OS_CPU_SOLARIS_ZERO_OS_SOLARIS_ZERO_INLINE_HPP |
|
995 |
+#define OS_CPU_SOLARIS_ZERO_OS_SOLARIS_ZERO_INLINE_HPP |
|
996 |
+ |
|
997 |
+ |
|
998 |
+ |
|
999 |
+#endif // OS_CPU_SOLARIS_ZERO_OS_SOLARIS_ZERO_INLINE_HPP |