author | stefank |
Thu, 09 May 2019 14:28:30 +0200 | |
changeset 54786 | ebf733a324d4 |
parent 48468 | 7cc7de9bf4a4 |
child 55523 | 52ef2c940423 |
permissions | -rw-r--r-- |
4013 | 1 |
/* |
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
30110
20d4dc1409a6
8075533: Zero JVM segfaults for -version after JDK-8074552
sgehwolf
parents:
27691
diff
changeset
|
3 |
* Copyright 2007, 2008, 2010, 2015 Red Hat, Inc. |
4013 | 4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 |
* |
|
6 |
* This code is free software; you can redistribute it and/or modify it |
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
|
8 |
* published by the Free Software Foundation. |
|
9 |
* |
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
14 |
* accompanied this code). |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License version |
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5424
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5424
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5424
diff
changeset
|
22 |
* questions. |
4013 | 23 |
* |
24 |
*/ |
|
25 |
||
7397 | 26 |
#include "precompiled.hpp" |
27 |
#include "asm/assembler.hpp" |
|
28 |
#include "assembler_zero.inline.hpp" |
|
29 |
#include "interpreter/interpreter.hpp" |
|
30 |
#include "nativeInst_zero.hpp" |
|
31 |
#include "oops/instanceOop.hpp" |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
10565
diff
changeset
|
32 |
#include "oops/method.hpp" |
7397 | 33 |
#include "oops/objArrayKlass.hpp" |
34 |
#include "oops/oop.inline.hpp" |
|
35 |
#include "prims/methodHandles.hpp" |
|
36 |
#include "runtime/frame.inline.hpp" |
|
37 |
#include "runtime/handles.inline.hpp" |
|
38 |
#include "runtime/sharedRuntime.hpp" |
|
39 |
#include "runtime/stubCodeGenerator.hpp" |
|
40 |
#include "runtime/stubRoutines.hpp" |
|
14583
d70ee55535f4
8003935: Simplify the needed includes for using Thread::current()
stefank
parents:
13728
diff
changeset
|
41 |
#include "runtime/thread.inline.hpp" |
7397 | 42 |
#include "stack_zero.inline.hpp" |
43 |
#ifdef COMPILER2 |
|
44 |
#include "opto/runtime.hpp" |
|
45 |
#endif |
|
4013 | 46 |
|
30129
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
47 |
// For SafeFetch we need POSIX tls and setjmp |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
48 |
#include <setjmp.h> |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
49 |
#include <pthread.h> |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
50 |
static pthread_key_t g_jmpbuf_key; |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
51 |
|
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
52 |
// return the currently active jump buffer for this thread |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
53 |
// - if there is any, NULL otherwise. Called from |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
54 |
// zero signal handlers. |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
55 |
extern sigjmp_buf* get_jmp_buf_for_continuation() { |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
56 |
return (sigjmp_buf*) pthread_getspecific(g_jmpbuf_key); |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
57 |
} |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
58 |
|
4013 | 59 |
// Declaration and definition of StubGenerator (no .hpp file). |
60 |
// For a more detailed description of the stub routine structure |
|
61 |
// see the comment in stubRoutines.hpp |
|
62 |
||
63 |
class StubGenerator: public StubCodeGenerator { |
|
64 |
private: |
|
65 |
// The call stub is used to call Java from C |
|
66 |
static void call_stub( |
|
67 |
JavaCallWrapper *call_wrapper, |
|
68 |
intptr_t* result, |
|
69 |
BasicType result_type, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
10565
diff
changeset
|
70 |
Method* method, |
4013 | 71 |
address entry_point, |
72 |
intptr_t* parameters, |
|
73 |
int parameter_words, |
|
74 |
TRAPS) { |
|
75 |
JavaThread *thread = (JavaThread *) THREAD; |
|
76 |
ZeroStack *stack = thread->zero_stack(); |
|
77 |
||
78 |
// Make sure we have no pending exceptions |
|
79 |
assert(!HAS_PENDING_EXCEPTION, "call_stub called with pending exception"); |
|
80 |
||
81 |
// Set up the stack if necessary |
|
82 |
bool stack_needs_teardown = false; |
|
83 |
if (stack->needs_setup()) { |
|
5424 | 84 |
size_t zero_stack_size = stack->suggest_size(thread); |
4013 | 85 |
stack->setup(alloca(zero_stack_size), zero_stack_size); |
86 |
stack_needs_teardown = true; |
|
87 |
} |
|
88 |
||
89 |
// Allocate and initialize our frame |
|
5335 | 90 |
EntryFrame *frame = |
91 |
EntryFrame::build(parameters, parameter_words, call_wrapper, THREAD); |
|
4013 | 92 |
|
93 |
if (!HAS_PENDING_EXCEPTION) { |
|
5335 | 94 |
// Push the frame |
95 |
thread->push_zero_frame(frame); |
|
96 |
||
97 |
// Make the call |
|
98 |
Interpreter::invoke_method(method, entry_point, THREAD); |
|
99 |
||
100 |
// Store the result |
|
101 |
if (!HAS_PENDING_EXCEPTION) { |
|
102 |
switch (result_type) { |
|
103 |
case T_INT: |
|
104 |
*(jint *) result = *(jint *) stack->sp(); |
|
105 |
break; |
|
106 |
case T_LONG: |
|
107 |
*(jlong *) result = *(jlong *) stack->sp(); |
|
108 |
break; |
|
109 |
case T_FLOAT: |
|
110 |
*(jfloat *) result = *(jfloat *) stack->sp(); |
|
111 |
break; |
|
112 |
case T_DOUBLE: |
|
113 |
*(jdouble *) result = *(jdouble *) stack->sp(); |
|
114 |
break; |
|
115 |
case T_OBJECT: |
|
116 |
*(oop *) result = *(oop *) stack->sp(); |
|
117 |
break; |
|
118 |
default: |
|
119 |
ShouldNotReachHere(); |
|
120 |
} |
|
4013 | 121 |
} |
5335 | 122 |
|
123 |
// Unwind the frame |
|
124 |
thread->pop_zero_frame(); |
|
4013 | 125 |
} |
126 |
||
127 |
// Tear down the stack if necessary |
|
128 |
if (stack_needs_teardown) |
|
129 |
stack->teardown(); |
|
130 |
} |
|
131 |
||
132 |
// These stubs get called from some dumb test routine. |
|
133 |
// I'll write them properly when they're called from |
|
134 |
// something that's actually doing something. |
|
135 |
static void fake_arraycopy_stub(address src, address dst, int count) { |
|
136 |
assert(count == 0, "huh?"); |
|
137 |
} |
|
138 |
||
139 |
void generate_arraycopy_stubs() { |
|
140 |
// Call the conjoint generation methods immediately after |
|
141 |
// the disjoint ones so that short branches from the former |
|
142 |
// to the latter can be generated. |
|
143 |
StubRoutines::_jbyte_disjoint_arraycopy = (address) fake_arraycopy_stub; |
|
144 |
StubRoutines::_jbyte_arraycopy = (address) fake_arraycopy_stub; |
|
145 |
||
146 |
StubRoutines::_jshort_disjoint_arraycopy = (address) fake_arraycopy_stub; |
|
147 |
StubRoutines::_jshort_arraycopy = (address) fake_arraycopy_stub; |
|
148 |
||
149 |
StubRoutines::_jint_disjoint_arraycopy = (address) fake_arraycopy_stub; |
|
150 |
StubRoutines::_jint_arraycopy = (address) fake_arraycopy_stub; |
|
151 |
||
152 |
StubRoutines::_jlong_disjoint_arraycopy = (address) fake_arraycopy_stub; |
|
153 |
StubRoutines::_jlong_arraycopy = (address) fake_arraycopy_stub; |
|
154 |
||
155 |
StubRoutines::_oop_disjoint_arraycopy = ShouldNotCallThisStub(); |
|
156 |
StubRoutines::_oop_arraycopy = ShouldNotCallThisStub(); |
|
157 |
||
158 |
StubRoutines::_checkcast_arraycopy = ShouldNotCallThisStub(); |
|
159 |
StubRoutines::_unsafe_arraycopy = ShouldNotCallThisStub(); |
|
160 |
StubRoutines::_generic_arraycopy = ShouldNotCallThisStub(); |
|
161 |
||
162 |
// We don't generate specialized code for HeapWord-aligned source |
|
163 |
// arrays, so just use the code we've already generated |
|
164 |
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = |
|
165 |
StubRoutines::_jbyte_disjoint_arraycopy; |
|
166 |
StubRoutines::_arrayof_jbyte_arraycopy = |
|
167 |
StubRoutines::_jbyte_arraycopy; |
|
168 |
||
169 |
StubRoutines::_arrayof_jshort_disjoint_arraycopy = |
|
170 |
StubRoutines::_jshort_disjoint_arraycopy; |
|
171 |
StubRoutines::_arrayof_jshort_arraycopy = |
|
172 |
StubRoutines::_jshort_arraycopy; |
|
173 |
||
174 |
StubRoutines::_arrayof_jint_disjoint_arraycopy = |
|
175 |
StubRoutines::_jint_disjoint_arraycopy; |
|
176 |
StubRoutines::_arrayof_jint_arraycopy = |
|
177 |
StubRoutines::_jint_arraycopy; |
|
178 |
||
179 |
StubRoutines::_arrayof_jlong_disjoint_arraycopy = |
|
180 |
StubRoutines::_jlong_disjoint_arraycopy; |
|
181 |
StubRoutines::_arrayof_jlong_arraycopy = |
|
182 |
StubRoutines::_jlong_arraycopy; |
|
183 |
||
184 |
StubRoutines::_arrayof_oop_disjoint_arraycopy = |
|
185 |
StubRoutines::_oop_disjoint_arraycopy; |
|
186 |
StubRoutines::_arrayof_oop_arraycopy = |
|
187 |
StubRoutines::_oop_arraycopy; |
|
188 |
} |
|
189 |
||
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
190 |
static int SafeFetch32(int *adr, int errValue) { |
30129
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
191 |
|
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
192 |
// set up a jump buffer; anchor the pointer to the jump buffer in tls; then |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
193 |
// do the pointer access. If pointer is invalid, we crash; in signal |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
194 |
// handler, we retrieve pointer to jmp buffer from tls, and jump back. |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
195 |
// |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
196 |
// Note: the jump buffer itself - which can get pretty large depending on |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
197 |
// the architecture - lives on the stack and that is fine, because we will |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
198 |
// not rewind the stack: either we crash, in which case signal handler |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
199 |
// frame is below us, or we don't crash, in which case it does not matter. |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
200 |
sigjmp_buf jb; |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
201 |
if (sigsetjmp(jb, 1)) { |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
202 |
// we crashed. clean up tls and return default value. |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
203 |
pthread_setspecific(g_jmpbuf_key, NULL); |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
204 |
return errValue; |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
205 |
} else { |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
206 |
// preparation phase |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
207 |
pthread_setspecific(g_jmpbuf_key, &jb); |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
208 |
} |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
209 |
|
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
210 |
int value = errValue; |
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
211 |
value = *adr; |
30129
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
212 |
|
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
213 |
// all went well. clean tls. |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
214 |
pthread_setspecific(g_jmpbuf_key, NULL); |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
215 |
|
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
216 |
return value; |
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
217 |
} |
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
218 |
|
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
219 |
static intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) { |
30129
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
220 |
|
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
221 |
sigjmp_buf jb; |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
222 |
if (sigsetjmp(jb, 1)) { |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
223 |
// we crashed. clean up tls and return default value. |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
224 |
pthread_setspecific(g_jmpbuf_key, NULL); |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
225 |
return errValue; |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
226 |
} else { |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
227 |
// preparation phase |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
228 |
pthread_setspecific(g_jmpbuf_key, &jb); |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
229 |
} |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
230 |
|
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
231 |
intptr_t value = errValue; |
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
232 |
value = *adr; |
30129
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
233 |
|
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
234 |
// all went well. clean tls. |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
235 |
pthread_setspecific(g_jmpbuf_key, NULL); |
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
236 |
|
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
237 |
return value; |
30129
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
238 |
|
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
239 |
} |
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
240 |
|
4013 | 241 |
void generate_initial() { |
242 |
// Generates all stubs and initializes the entry points |
|
243 |
||
244 |
// entry points that exist in all platforms Note: This is code |
|
245 |
// that could be shared among different platforms - however the |
|
246 |
// benefit seems to be smaller than the disadvantage of having a |
|
247 |
// much more complicated generator structure. See also comment in |
|
248 |
// stubRoutines.hpp. |
|
249 |
||
250 |
StubRoutines::_forward_exception_entry = ShouldNotCallThisStub(); |
|
251 |
StubRoutines::_call_stub_entry = (address) call_stub; |
|
252 |
StubRoutines::_catch_exception_entry = ShouldNotCallThisStub(); |
|
253 |
||
254 |
// atomic calls |
|
255 |
StubRoutines::_atomic_xchg_entry = ShouldNotCallThisStub(); |
|
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47216
diff
changeset
|
256 |
StubRoutines::_atomic_xchg_long_entry = ShouldNotCallThisStub(); |
4013 | 257 |
StubRoutines::_atomic_cmpxchg_entry = ShouldNotCallThisStub(); |
27691
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
22234
diff
changeset
|
258 |
StubRoutines::_atomic_cmpxchg_byte_entry = ShouldNotCallThisStub(); |
4013 | 259 |
StubRoutines::_atomic_cmpxchg_long_entry = ShouldNotCallThisStub(); |
260 |
StubRoutines::_atomic_add_entry = ShouldNotCallThisStub(); |
|
48468 | 261 |
StubRoutines::_atomic_add_long_entry = ShouldNotCallThisStub(); |
4013 | 262 |
StubRoutines::_fence_entry = ShouldNotCallThisStub(); |
263 |
} |
|
264 |
||
265 |
void generate_all() { |
|
266 |
// Generates all stubs and initializes the entry points |
|
267 |
||
268 |
// These entry points require SharedInfo::stack0 to be set up in |
|
269 |
// non-core builds and need to be relocatable, so they each |
|
270 |
// fabricate a RuntimeStub internally. |
|
271 |
StubRoutines::_throw_AbstractMethodError_entry = |
|
272 |
ShouldNotCallThisStub(); |
|
273 |
||
274 |
StubRoutines::_throw_NullPointerException_at_call_entry = |
|
275 |
ShouldNotCallThisStub(); |
|
276 |
||
277 |
StubRoutines::_throw_StackOverflowError_entry = |
|
278 |
ShouldNotCallThisStub(); |
|
279 |
||
280 |
// support for verify_oop (must happen after universe_init) |
|
281 |
StubRoutines::_verify_oop_subroutine_entry = |
|
282 |
ShouldNotCallThisStub(); |
|
283 |
||
284 |
// arraycopy stubs used by compilers |
|
285 |
generate_arraycopy_stubs(); |
|
19267
058bf12be1e0
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
14583
diff
changeset
|
286 |
|
058bf12be1e0
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
14583
diff
changeset
|
287 |
// Safefetch stubs. |
30129
351788433103
8076185: Provide SafeFetchX implementation for zero
dholmes
parents:
30118
diff
changeset
|
288 |
pthread_key_create(&g_jmpbuf_key, NULL); |
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
289 |
StubRoutines::_safefetch32_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetch32); |
19267
058bf12be1e0
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
14583
diff
changeset
|
290 |
StubRoutines::_safefetch32_fault_pc = NULL; |
058bf12be1e0
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
14583
diff
changeset
|
291 |
StubRoutines::_safefetch32_continuation_pc = NULL; |
058bf12be1e0
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
14583
diff
changeset
|
292 |
|
30118
dadad0daaab4
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
coleenp
parents:
30110
diff
changeset
|
293 |
StubRoutines::_safefetchN_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetchN); |
19267
058bf12be1e0
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
14583
diff
changeset
|
294 |
StubRoutines::_safefetchN_fault_pc = NULL; |
058bf12be1e0
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
14583
diff
changeset
|
295 |
StubRoutines::_safefetchN_continuation_pc = NULL; |
4013 | 296 |
} |
297 |
||
298 |
public: |
|
299 |
StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) { |
|
300 |
if (all) { |
|
301 |
generate_all(); |
|
302 |
} else { |
|
303 |
generate_initial(); |
|
304 |
} |
|
305 |
} |
|
306 |
}; |
|
307 |
||
308 |
void StubGenerator_generate(CodeBuffer* code, bool all) { |
|
309 |
StubGenerator g(code, all); |
|
310 |
} |
|
311 |
||
5335 | 312 |
EntryFrame *EntryFrame::build(const intptr_t* parameters, |
4013 | 313 |
int parameter_words, |
5335 | 314 |
JavaCallWrapper* call_wrapper, |
315 |
TRAPS) { |
|
316 |
||
317 |
ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack(); |
|
318 |
stack->overflow_check(header_words + parameter_words, CHECK_NULL); |
|
4013 | 319 |
|
320 |
stack->push(0); // next_frame, filled in later |
|
321 |
intptr_t *fp = stack->sp(); |
|
322 |
assert(fp - stack->sp() == next_frame_off, "should be"); |
|
323 |
||
324 |
stack->push(ENTRY_FRAME); |
|
325 |
assert(fp - stack->sp() == frame_type_off, "should be"); |
|
326 |
||
327 |
stack->push((intptr_t) call_wrapper); |
|
328 |
assert(fp - stack->sp() == call_wrapper_off, "should be"); |
|
329 |
||
330 |
for (int i = 0; i < parameter_words; i++) |
|
331 |
stack->push(parameters[i]); |
|
332 |
||
333 |
return (EntryFrame *) fp; |
|
334 |
} |