Mercurial > hg > graal-compiler
annotate src/cpu/zero/vm/cppInterpreter_zero.cpp @ 11014:4b52137b07c9
Merge
author | chegar |
---|---|
date | Wed, 01 May 2013 14:11:01 +0100 |
parents | 0094485b46c7 |
children | e60b3fce2b02 |
rev | line source |
---|---|
1010 | 1 /* |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
2480 | 3 * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. |
1010 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1514
diff
changeset
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1514
diff
changeset
|
21 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1514
diff
changeset
|
22 * questions. |
1010 | 23 * |
24 */ | |
25 | |
1972 | 26 #include "precompiled.hpp" |
27 #include "asm/assembler.hpp" | |
28 #include "interpreter/bytecodeHistogram.hpp" | |
29 #include "interpreter/cppInterpreter.hpp" | |
30 #include "interpreter/interpreter.hpp" | |
31 #include "interpreter/interpreterGenerator.hpp" | |
32 #include "interpreter/interpreterRuntime.hpp" | |
33 #include "oops/arrayOop.hpp" | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
34 #include "oops/methodData.hpp" |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
35 #include "oops/method.hpp" |
1972 | 36 #include "oops/oop.inline.hpp" |
37 #include "prims/jvmtiExport.hpp" | |
38 #include "prims/jvmtiThreadState.hpp" | |
39 #include "runtime/arguments.hpp" | |
40 #include "runtime/deoptimization.hpp" | |
41 #include "runtime/frame.inline.hpp" | |
42 #include "runtime/interfaceSupport.hpp" | |
43 #include "runtime/sharedRuntime.hpp" | |
44 #include "runtime/stubRoutines.hpp" | |
45 #include "runtime/synchronizer.hpp" | |
46 #include "runtime/timer.hpp" | |
47 #include "runtime/vframeArray.hpp" | |
48 #include "stack_zero.inline.hpp" | |
49 #include "utilities/debug.hpp" | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7195
diff
changeset
|
50 #include "utilities/macros.hpp" |
1972 | 51 #ifdef SHARK |
52 #include "shark/shark_globals.hpp" | |
53 #endif | |
1010 | 54 |
55 #ifdef CC_INTERP | |
56 | |
57 #define fixup_after_potential_safepoint() \ | |
58 method = istate->method() | |
59 | |
2480 | 60 #define CALL_VM_NOCHECK_NOFIX(func) \ |
1010 | 61 thread->set_last_Java_frame(); \ |
62 func; \ | |
2480 | 63 thread->reset_last_Java_frame(); |
64 | |
65 #define CALL_VM_NOCHECK(func) \ | |
66 CALL_VM_NOCHECK_NOFIX(func) \ | |
1010 | 67 fixup_after_potential_safepoint() |
68 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
69 int CppInterpreter::normal_entry(Method* method, intptr_t UNUSED, TRAPS) { |
1010 | 70 JavaThread *thread = (JavaThread *) THREAD; |
71 | |
72 // Allocate and initialize our frame. | |
1514 | 73 InterpreterFrame *frame = InterpreterFrame::build(method, CHECK_0); |
1010 | 74 thread->push_zero_frame(frame); |
75 | |
76 // Execute those bytecodes! | |
77 main_loop(0, THREAD); | |
1514 | 78 |
79 // No deoptimized frames on the stack | |
80 return 0; | |
1010 | 81 } |
82 | |
83 void CppInterpreter::main_loop(int recurse, TRAPS) { | |
84 JavaThread *thread = (JavaThread *) THREAD; | |
85 ZeroStack *stack = thread->zero_stack(); | |
86 | |
87 // If we are entering from a deopt we may need to call | |
88 // ourself a few times in order to get to our frame. | |
89 if (recurse) | |
90 main_loop(recurse - 1, THREAD); | |
91 | |
92 InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); | |
93 interpreterState istate = frame->interpreter_state(); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
94 Method* method = istate->method(); |
1010 | 95 |
96 intptr_t *result = NULL; | |
97 int result_slots = 0; | |
98 | |
99 while (true) { | |
100 // We can set up the frame anchor with everything we want at | |
101 // this point as we are thread_in_Java and no safepoints can | |
102 // occur until we go to vm mode. We do have to clear flags | |
103 // on return from vm but that is it. | |
104 thread->set_last_Java_frame(); | |
105 | |
106 // Call the interpreter | |
107 if (JvmtiExport::can_post_interpreter_events()) | |
108 BytecodeInterpreter::runWithChecks(istate); | |
109 else | |
110 BytecodeInterpreter::run(istate); | |
111 fixup_after_potential_safepoint(); | |
112 | |
113 // Clear the frame anchor | |
114 thread->reset_last_Java_frame(); | |
115 | |
116 // Examine the message from the interpreter to decide what to do | |
117 if (istate->msg() == BytecodeInterpreter::call_method) { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
118 Method* callee = istate->callee(); |
1010 | 119 |
120 // Trim back the stack to put the parameters at the top | |
121 stack->set_sp(istate->stack() + 1); | |
122 | |
123 // Make the call | |
124 Interpreter::invoke_method(callee, istate->callee_entry_point(), THREAD); | |
125 fixup_after_potential_safepoint(); | |
126 | |
127 // Convert the result | |
128 istate->set_stack(stack->sp() - 1); | |
129 | |
130 // Restore the stack | |
131 stack->set_sp(istate->stack_limit() + 1); | |
132 | |
133 // Resume the interpreter | |
134 istate->set_msg(BytecodeInterpreter::method_resume); | |
135 } | |
136 else if (istate->msg() == BytecodeInterpreter::more_monitors) { | |
137 int monitor_words = frame::interpreter_frame_monitor_size(); | |
138 | |
139 // Allocate the space | |
1379 | 140 stack->overflow_check(monitor_words, THREAD); |
141 if (HAS_PENDING_EXCEPTION) | |
142 break; | |
1010 | 143 stack->alloc(monitor_words * wordSize); |
144 | |
145 // Move the expression stack contents | |
146 for (intptr_t *p = istate->stack() + 1; p < istate->stack_base(); p++) | |
147 *(p - monitor_words) = *p; | |
148 | |
149 // Move the expression stack pointers | |
150 istate->set_stack_limit(istate->stack_limit() - monitor_words); | |
151 istate->set_stack(istate->stack() - monitor_words); | |
152 istate->set_stack_base(istate->stack_base() - monitor_words); | |
153 | |
154 // Zero the new monitor so the interpreter can find it. | |
155 ((BasicObjectLock *) istate->stack_base())->set_obj(NULL); | |
156 | |
157 // Resume the interpreter | |
158 istate->set_msg(BytecodeInterpreter::got_monitors); | |
159 } | |
160 else if (istate->msg() == BytecodeInterpreter::return_from_method) { | |
161 // Copy the result into the caller's frame | |
1256 | 162 result_slots = type2size[result_type_of(method)]; |
1010 | 163 assert(result_slots >= 0 && result_slots <= 2, "what?"); |
164 result = istate->stack() + result_slots; | |
165 break; | |
166 } | |
167 else if (istate->msg() == BytecodeInterpreter::throwing_exception) { | |
168 assert(HAS_PENDING_EXCEPTION, "should do"); | |
169 break; | |
170 } | |
171 else if (istate->msg() == BytecodeInterpreter::do_osr) { | |
172 // Unwind the current frame | |
173 thread->pop_zero_frame(); | |
174 | |
175 // Remove any extension of the previous frame | |
176 int extra_locals = method->max_locals() - method->size_of_parameters(); | |
177 stack->set_sp(stack->sp() + extra_locals); | |
178 | |
179 // Jump into the OSR method | |
180 Interpreter::invoke_osr( | |
181 method, istate->osr_entry(), istate->osr_buf(), THREAD); | |
182 return; | |
183 } | |
184 else { | |
185 ShouldNotReachHere(); | |
186 } | |
187 } | |
188 | |
189 // Unwind the current frame | |
190 thread->pop_zero_frame(); | |
191 | |
192 // Pop our local variables | |
193 stack->set_sp(stack->sp() + method->max_locals()); | |
194 | |
195 // Push our result | |
196 for (int i = 0; i < result_slots; i++) | |
197 stack->push(result[-i]); | |
198 } | |
199 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
200 int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) { |
1010 | 201 // Make sure method is native and not abstract |
202 assert(method->is_native() && !method->is_abstract(), "should be"); | |
203 | |
204 JavaThread *thread = (JavaThread *) THREAD; | |
205 ZeroStack *stack = thread->zero_stack(); | |
206 | |
207 // Allocate and initialize our frame | |
1514 | 208 InterpreterFrame *frame = InterpreterFrame::build(method, CHECK_0); |
1010 | 209 thread->push_zero_frame(frame); |
210 interpreterState istate = frame->interpreter_state(); | |
211 intptr_t *locals = istate->locals(); | |
212 | |
1078 | 213 // Update the invocation counter |
214 if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) { | |
215 InvocationCounter *counter = method->invocation_counter(); | |
216 counter->increment(); | |
217 if (counter->reached_InvocationLimit()) { | |
218 CALL_VM_NOCHECK( | |
219 InterpreterRuntime::frequency_counter_overflow(thread, NULL)); | |
220 if (HAS_PENDING_EXCEPTION) | |
221 goto unwind_and_return; | |
222 } | |
223 } | |
224 | |
1010 | 225 // Lock if necessary |
226 BasicObjectLock *monitor; | |
227 monitor = NULL; | |
228 if (method->is_synchronized()) { | |
229 monitor = (BasicObjectLock*) istate->stack_base(); | |
230 oop lockee = monitor->obj(); | |
231 markOop disp = lockee->mark()->set_unlocked(); | |
232 | |
233 monitor->lock()->set_displaced_header(disp); | |
234 if (Atomic::cmpxchg_ptr(monitor, lockee->mark_addr(), disp) != disp) { | |
235 if (thread->is_lock_owned((address) disp->clear_lock_bits())) { | |
236 monitor->lock()->set_displaced_header(NULL); | |
237 } | |
238 else { | |
239 CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor)); | |
240 if (HAS_PENDING_EXCEPTION) | |
241 goto unwind_and_return; | |
242 } | |
243 } | |
244 } | |
245 | |
246 // Get the signature handler | |
247 InterpreterRuntime::SignatureHandler *handler; { | |
248 address handlerAddr = method->signature_handler(); | |
249 if (handlerAddr == NULL) { | |
250 CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method)); | |
251 if (HAS_PENDING_EXCEPTION) | |
1139
b6f06e395428
6908267: Zero fails to unlock synchronized native methods on exception
never
parents:
1078
diff
changeset
|
252 goto unlock_unwind_and_return; |
1010 | 253 |
254 handlerAddr = method->signature_handler(); | |
255 assert(handlerAddr != NULL, "eh?"); | |
256 } | |
257 if (handlerAddr == (address) InterpreterRuntime::slow_signature_handler) { | |
258 CALL_VM_NOCHECK(handlerAddr = | |
259 InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL)); | |
260 if (HAS_PENDING_EXCEPTION) | |
1139
b6f06e395428
6908267: Zero fails to unlock synchronized native methods on exception
never
parents:
1078
diff
changeset
|
261 goto unlock_unwind_and_return; |
1010 | 262 } |
263 handler = \ | |
264 InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr); | |
265 } | |
266 | |
267 // Get the native function entry point | |
268 address function; | |
269 function = method->native_function(); | |
270 assert(function != NULL, "should be set if signature handler is"); | |
271 | |
272 // Build the argument list | |
1379 | 273 stack->overflow_check(handler->argument_count() * 2, THREAD); |
274 if (HAS_PENDING_EXCEPTION) | |
275 goto unlock_unwind_and_return; | |
276 | |
1010 | 277 void **arguments; |
278 void *mirror; { | |
279 arguments = | |
280 (void **) stack->alloc(handler->argument_count() * sizeof(void **)); | |
281 void **dst = arguments; | |
282 | |
283 void *env = thread->jni_environment(); | |
284 *(dst++) = &env; | |
285 | |
286 if (method->is_static()) { | |
287 istate->set_oop_temp( | |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
1972
diff
changeset
|
288 method->constants()->pool_holder()->java_mirror()); |
1010 | 289 mirror = istate->oop_temp_addr(); |
290 *(dst++) = &mirror; | |
291 } | |
292 | |
293 intptr_t *src = locals; | |
294 for (int i = dst - arguments; i < handler->argument_count(); i++) { | |
295 ffi_type *type = handler->argument_type(i); | |
296 if (type == &ffi_type_pointer) { | |
297 if (*src) { | |
298 stack->push((intptr_t) src); | |
299 *(dst++) = stack->sp(); | |
300 } | |
301 else { | |
302 *(dst++) = src; | |
303 } | |
304 src--; | |
305 } | |
306 else if (type->size == 4) { | |
307 *(dst++) = src--; | |
308 } | |
309 else if (type->size == 8) { | |
310 src--; | |
311 *(dst++) = src--; | |
312 } | |
313 else { | |
314 ShouldNotReachHere(); | |
315 } | |
316 } | |
317 } | |
318 | |
319 // Set up the Java frame anchor | |
320 thread->set_last_Java_frame(); | |
321 | |
322 // Change the thread state to _thread_in_native | |
323 ThreadStateTransition::transition_from_java(thread, _thread_in_native); | |
324 | |
325 // Make the call | |
326 intptr_t result[4 - LogBytesPerWord]; | |
327 ffi_call(handler->cif(), (void (*)()) function, result, arguments); | |
328 | |
329 // Change the thread state back to _thread_in_Java. | |
330 // ThreadStateTransition::transition_from_native() cannot be used | |
331 // here because it does not check for asynchronous exceptions. | |
332 // We have to manage the transition ourself. | |
333 thread->set_thread_state(_thread_in_native_trans); | |
334 | |
335 // Make sure new state is visible in the GC thread | |
336 if (os::is_MP()) { | |
337 if (UseMembar) { | |
338 OrderAccess::fence(); | |
339 } | |
340 else { | |
341 InterfaceSupport::serialize_memory(thread); | |
342 } | |
343 } | |
344 | |
345 // Handle safepoint operations, pending suspend requests, | |
346 // and pending asynchronous exceptions. | |
347 if (SafepointSynchronize::do_call_back() || | |
348 thread->has_special_condition_for_native_trans()) { | |
349 JavaThread::check_special_condition_for_native_trans(thread); | |
350 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops()); | |
351 } | |
352 | |
353 // Finally we can change the thread state to _thread_in_Java. | |
354 thread->set_thread_state(_thread_in_Java); | |
355 fixup_after_potential_safepoint(); | |
356 | |
357 // Clear the frame anchor | |
358 thread->reset_last_Java_frame(); | |
359 | |
360 // If the result was an oop then unbox it and store it in | |
361 // oop_temp where the garbage collector can see it before | |
362 // we release the handle it might be protected by. | |
363 if (handler->result_type() == &ffi_type_pointer) { | |
364 if (result[0]) | |
365 istate->set_oop_temp(*(oop *) result[0]); | |
366 else | |
367 istate->set_oop_temp(NULL); | |
368 } | |
369 | |
370 // Reset handle block | |
371 thread->active_handles()->clear(); | |
372 | |
1139
b6f06e395428
6908267: Zero fails to unlock synchronized native methods on exception
never
parents:
1078
diff
changeset
|
373 unlock_unwind_and_return: |
b6f06e395428
6908267: Zero fails to unlock synchronized native methods on exception
never
parents:
1078
diff
changeset
|
374 |
b6f06e395428
6908267: Zero fails to unlock synchronized native methods on exception
never
parents:
1078
diff
changeset
|
375 // Unlock if necessary |
b6f06e395428
6908267: Zero fails to unlock synchronized native methods on exception
never
parents:
1078
diff
changeset
|
376 if (monitor) { |
1010 | 377 BasicLock *lock = monitor->lock(); |
378 markOop header = lock->displaced_header(); | |
379 oop rcvr = monitor->obj(); | |
380 monitor->set_obj(NULL); | |
381 | |
382 if (header != NULL) { | |
383 if (Atomic::cmpxchg_ptr(header, rcvr->mark_addr(), lock) != lock) { | |
384 monitor->set_obj(rcvr); { | |
385 HandleMark hm(thread); | |
386 CALL_VM_NOCHECK(InterpreterRuntime::monitorexit(thread, monitor)); | |
387 } | |
388 } | |
389 } | |
390 } | |
391 | |
392 unwind_and_return: | |
393 | |
394 // Unwind the current activation | |
395 thread->pop_zero_frame(); | |
396 | |
397 // Pop our parameters | |
398 stack->set_sp(stack->sp() + method->size_of_parameters()); | |
399 | |
400 // Push our result | |
401 if (!HAS_PENDING_EXCEPTION) { | |
1256 | 402 BasicType type = result_type_of(method); |
403 stack->set_sp(stack->sp() - type2size[type]); | |
1010 | 404 |
1256 | 405 switch (type) { |
1010 | 406 case T_VOID: |
407 break; | |
408 | |
409 case T_BOOLEAN: | |
410 #ifndef VM_LITTLE_ENDIAN | |
411 result[0] <<= (BitsPerWord - BitsPerByte); | |
412 #endif | |
413 SET_LOCALS_INT(*(jboolean *) result != 0, 0); | |
414 break; | |
415 | |
416 case T_CHAR: | |
417 #ifndef VM_LITTLE_ENDIAN | |
418 result[0] <<= (BitsPerWord - BitsPerShort); | |
419 #endif | |
420 SET_LOCALS_INT(*(jchar *) result, 0); | |
421 break; | |
422 | |
423 case T_BYTE: | |
424 #ifndef VM_LITTLE_ENDIAN | |
425 result[0] <<= (BitsPerWord - BitsPerByte); | |
426 #endif | |
427 SET_LOCALS_INT(*(jbyte *) result, 0); | |
428 break; | |
429 | |
430 case T_SHORT: | |
431 #ifndef VM_LITTLE_ENDIAN | |
432 result[0] <<= (BitsPerWord - BitsPerShort); | |
433 #endif | |
434 SET_LOCALS_INT(*(jshort *) result, 0); | |
435 break; | |
436 | |
437 case T_INT: | |
438 #ifndef VM_LITTLE_ENDIAN | |
439 result[0] <<= (BitsPerWord - BitsPerInt); | |
440 #endif | |
441 SET_LOCALS_INT(*(jint *) result, 0); | |
442 break; | |
443 | |
444 case T_LONG: | |
445 SET_LOCALS_LONG(*(jlong *) result, 0); | |
446 break; | |
447 | |
448 case T_FLOAT: | |
449 SET_LOCALS_FLOAT(*(jfloat *) result, 0); | |
450 break; | |
451 | |
452 case T_DOUBLE: | |
453 SET_LOCALS_DOUBLE(*(jdouble *) result, 0); | |
454 break; | |
455 | |
456 case T_OBJECT: | |
457 case T_ARRAY: | |
458 SET_LOCALS_OBJECT(istate->oop_temp(), 0); | |
459 break; | |
460 | |
461 default: | |
462 ShouldNotReachHere(); | |
463 } | |
464 } | |
1514 | 465 |
466 // No deoptimized frames on the stack | |
467 return 0; | |
1010 | 468 } |
469 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
470 int CppInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) { |
1010 | 471 JavaThread *thread = (JavaThread *) THREAD; |
472 ZeroStack *stack = thread->zero_stack(); | |
473 intptr_t *locals = stack->sp(); | |
474 | |
475 // Drop into the slow path if we need a safepoint check | |
476 if (SafepointSynchronize::do_call_back()) { | |
1514 | 477 return normal_entry(method, 0, THREAD); |
1010 | 478 } |
479 | |
480 // Load the object pointer and drop into the slow path | |
481 // if we have a NullPointerException | |
482 oop object = LOCALS_OBJECT(0); | |
483 if (object == NULL) { | |
1514 | 484 return normal_entry(method, 0, THREAD); |
1010 | 485 } |
486 | |
487 // Read the field index from the bytecode, which looks like this: | |
488 // 0: aload_0 | |
489 // 1: getfield | |
490 // 2: index | |
491 // 3: index | |
492 // 4: ireturn/areturn | |
493 // NB this is not raw bytecode: index is in machine order | |
494 u1 *code = method->code_base(); | |
495 assert(code[0] == Bytecodes::_aload_0 && | |
496 code[1] == Bytecodes::_getfield && | |
497 (code[4] == Bytecodes::_ireturn || | |
498 code[4] == Bytecodes::_areturn), "should do"); | |
499 u2 index = Bytes::get_native_u2(&code[2]); | |
500 | |
501 // Get the entry from the constant pool cache, and drop into | |
502 // the slow path if it has not been resolved | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
503 ConstantPoolCache* cache = method->constants()->cache(); |
1010 | 504 ConstantPoolCacheEntry* entry = cache->entry_at(index); |
505 if (!entry->is_resolved(Bytecodes::_getfield)) { | |
1514 | 506 return normal_entry(method, 0, THREAD); |
1010 | 507 } |
508 | |
509 // Get the result and push it onto the stack | |
510 switch (entry->flag_state()) { | |
511 case ltos: | |
512 case dtos: | |
1514 | 513 stack->overflow_check(1, CHECK_0); |
1010 | 514 stack->alloc(wordSize); |
515 break; | |
516 } | |
517 if (entry->is_volatile()) { | |
518 switch (entry->flag_state()) { | |
519 case ctos: | |
6926 | 520 SET_LOCALS_INT(object->char_field_acquire(entry->f2_as_index()), 0); |
1010 | 521 break; |
522 | |
523 case btos: | |
6926 | 524 SET_LOCALS_INT(object->byte_field_acquire(entry->f2_as_index()), 0); |
1010 | 525 break; |
526 | |
527 case stos: | |
6926 | 528 SET_LOCALS_INT(object->short_field_acquire(entry->f2_as_index()), 0); |
1010 | 529 break; |
530 | |
531 case itos: | |
6926 | 532 SET_LOCALS_INT(object->int_field_acquire(entry->f2_as_index()), 0); |
1010 | 533 break; |
534 | |
535 case ltos: | |
6926 | 536 SET_LOCALS_LONG(object->long_field_acquire(entry->f2_as_index()), 0); |
1010 | 537 break; |
538 | |
539 case ftos: | |
6926 | 540 SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2_as_index()), 0); |
1010 | 541 break; |
542 | |
543 case dtos: | |
6926 | 544 SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2_as_index()), 0); |
1010 | 545 break; |
546 | |
547 case atos: | |
6926 | 548 SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2_as_index()), 0); |
1010 | 549 break; |
550 | |
551 default: | |
552 ShouldNotReachHere(); | |
553 } | |
554 } | |
555 else { | |
556 switch (entry->flag_state()) { | |
557 case ctos: | |
6926 | 558 SET_LOCALS_INT(object->char_field(entry->f2_as_index()), 0); |
1010 | 559 break; |
560 | |
561 case btos: | |
6926 | 562 SET_LOCALS_INT(object->byte_field(entry->f2_as_index()), 0); |
1010 | 563 break; |
564 | |
565 case stos: | |
6926 | 566 SET_LOCALS_INT(object->short_field(entry->f2_as_index()), 0); |
1010 | 567 break; |
568 | |
569 case itos: | |
6926 | 570 SET_LOCALS_INT(object->int_field(entry->f2_as_index()), 0); |
1010 | 571 break; |
572 | |
573 case ltos: | |
6926 | 574 SET_LOCALS_LONG(object->long_field(entry->f2_as_index()), 0); |
1010 | 575 break; |
576 | |
577 case ftos: | |
6926 | 578 SET_LOCALS_FLOAT(object->float_field(entry->f2_as_index()), 0); |
1010 | 579 break; |
580 | |
581 case dtos: | |
6926 | 582 SET_LOCALS_DOUBLE(object->double_field(entry->f2_as_index()), 0); |
1010 | 583 break; |
584 | |
585 case atos: | |
6926 | 586 SET_LOCALS_OBJECT(object->obj_field(entry->f2_as_index()), 0); |
1010 | 587 break; |
588 | |
589 default: | |
590 ShouldNotReachHere(); | |
591 } | |
592 } | |
1514 | 593 |
594 // No deoptimized frames on the stack | |
595 return 0; | |
1010 | 596 } |
597 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
598 int CppInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) { |
1010 | 599 JavaThread *thread = (JavaThread *) THREAD; |
600 ZeroStack *stack = thread->zero_stack(); | |
601 | |
602 // Drop into the slow path if we need a safepoint check | |
603 if (SafepointSynchronize::do_call_back()) { | |
1514 | 604 return normal_entry(method, 0, THREAD); |
1010 | 605 } |
606 | |
607 // Pop our parameters | |
608 stack->set_sp(stack->sp() + method->size_of_parameters()); | |
1514 | 609 |
610 // No deoptimized frames on the stack | |
611 return 0; | |
1010 | 612 } |
613 | |
2480 | 614 // The new slots will be inserted before slot insert_before. |
615 // Slots < insert_before will have the same slot number after the insert. | |
616 // Slots >= insert_before will become old_slot + num_slots. | |
617 void CppInterpreter::insert_vmslots(int insert_before, int num_slots, TRAPS) { | |
618 JavaThread *thread = (JavaThread *) THREAD; | |
619 ZeroStack *stack = thread->zero_stack(); | |
620 | |
621 // Allocate the space | |
622 stack->overflow_check(num_slots, CHECK); | |
623 stack->alloc(num_slots * wordSize); | |
624 intptr_t *vmslots = stack->sp(); | |
625 | |
626 // Shuffle everything up | |
627 for (int i = 0; i < insert_before; i++) | |
628 SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i + num_slots), i); | |
629 } | |
630 | |
631 void CppInterpreter::remove_vmslots(int first_slot, int num_slots, TRAPS) { | |
632 JavaThread *thread = (JavaThread *) THREAD; | |
633 ZeroStack *stack = thread->zero_stack(); | |
634 intptr_t *vmslots = stack->sp(); | |
635 | |
636 // Move everything down | |
637 for (int i = first_slot - 1; i >= 0; i--) | |
638 SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i), i + num_slots); | |
639 | |
640 // Deallocate the space | |
641 stack->set_sp(stack->sp() + num_slots); | |
642 } | |
643 | |
644 BasicType CppInterpreter::result_type_of_handle(oop method_handle) { | |
645 oop method_type = java_lang_invoke_MethodHandle::type(method_handle); | |
646 oop return_type = java_lang_invoke_MethodType::rtype(method_type); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
647 return java_lang_Class::as_BasicType(return_type, (Klass* *) NULL); |
2480 | 648 } |
649 | |
650 intptr_t* CppInterpreter::calculate_unwind_sp(ZeroStack* stack, | |
651 oop method_handle) { | |
652 oop method_type = java_lang_invoke_MethodHandle::type(method_handle); | |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6071
diff
changeset
|
653 int argument_slots = java_lang_invoke_MethodType::ptype_slot_count(method_type); |
2480 | 654 |
655 return stack->sp() + argument_slots; | |
656 } | |
657 | |
658 IRT_ENTRY(void, CppInterpreter::throw_exception(JavaThread* thread, | |
659 Symbol* name, | |
660 char* message)) | |
661 THROW_MSG(name, message); | |
662 IRT_END | |
663 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
664 InterpreterFrame *InterpreterFrame::build(Method* const method, TRAPS) { |
1379 | 665 JavaThread *thread = (JavaThread *) THREAD; |
666 ZeroStack *stack = thread->zero_stack(); | |
667 | |
668 // Calculate the size of the frame we'll build, including | |
669 // any adjustments to the caller's frame that we'll make. | |
670 int extra_locals = 0; | |
671 int monitor_words = 0; | |
672 int stack_words = 0; | |
1010 | 673 |
1379 | 674 if (!method->is_native()) { |
675 extra_locals = method->max_locals() - method->size_of_parameters(); | |
676 stack_words = method->max_stack(); | |
1010 | 677 } |
1379 | 678 if (method->is_synchronized()) { |
679 monitor_words = frame::interpreter_frame_monitor_size(); | |
680 } | |
681 stack->overflow_check( | |
682 extra_locals + header_words + monitor_words + stack_words, CHECK_NULL); | |
1010 | 683 |
1379 | 684 // Adjust the caller's stack frame to accomodate any additional |
685 // local variables we have contiguously with our parameters. | |
686 for (int i = 0; i < extra_locals; i++) | |
687 stack->push(0); | |
1010 | 688 |
689 intptr_t *locals; | |
690 if (method->is_native()) | |
691 locals = stack->sp() + (method->size_of_parameters() - 1); | |
692 else | |
693 locals = stack->sp() + (method->max_locals() - 1); | |
694 | |
695 stack->push(0); // next_frame, filled in later | |
696 intptr_t *fp = stack->sp(); | |
697 assert(fp - stack->sp() == next_frame_off, "should be"); | |
698 | |
699 stack->push(INTERPRETER_FRAME); | |
700 assert(fp - stack->sp() == frame_type_off, "should be"); | |
701 | |
702 interpreterState istate = | |
703 (interpreterState) stack->alloc(sizeof(BytecodeInterpreter)); | |
704 assert(fp - stack->sp() == istate_off, "should be"); | |
705 | |
706 istate->set_locals(locals); | |
707 istate->set_method(method); | |
708 istate->set_self_link(istate); | |
709 istate->set_prev_link(NULL); | |
710 istate->set_thread(thread); | |
711 istate->set_bcp(method->is_native() ? NULL : method->code_base()); | |
712 istate->set_constants(method->constants()->cache()); | |
713 istate->set_msg(BytecodeInterpreter::method_entry); | |
714 istate->set_oop_temp(NULL); | |
715 istate->set_mdx(NULL); | |
716 istate->set_callee(NULL); | |
717 | |
718 istate->set_monitor_base((BasicObjectLock *) stack->sp()); | |
719 if (method->is_synchronized()) { | |
720 BasicObjectLock *monitor = | |
721 (BasicObjectLock *) stack->alloc(monitor_words * wordSize); | |
722 oop object; | |
723 if (method->is_static()) | |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
1972
diff
changeset
|
724 object = method->constants()->pool_holder()->java_mirror(); |
1010 | 725 else |
726 object = (oop) locals[0]; | |
727 monitor->set_obj(object); | |
728 } | |
729 | |
730 istate->set_stack_base(stack->sp()); | |
731 istate->set_stack(stack->sp() - 1); | |
732 if (stack_words) | |
733 stack->alloc(stack_words * wordSize); | |
734 istate->set_stack_limit(stack->sp() - 1); | |
735 | |
736 return (InterpreterFrame *) fp; | |
737 } | |
738 | |
739 int AbstractInterpreter::BasicType_as_index(BasicType type) { | |
740 int i = 0; | |
741 switch (type) { | |
742 case T_BOOLEAN: i = 0; break; | |
743 case T_CHAR : i = 1; break; | |
744 case T_BYTE : i = 2; break; | |
745 case T_SHORT : i = 3; break; | |
746 case T_INT : i = 4; break; | |
747 case T_LONG : i = 5; break; | |
748 case T_VOID : i = 6; break; | |
749 case T_FLOAT : i = 7; break; | |
750 case T_DOUBLE : i = 8; break; | |
751 case T_OBJECT : i = 9; break; | |
752 case T_ARRAY : i = 9; break; | |
753 default : ShouldNotReachHere(); | |
754 } | |
755 assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, | |
756 "index out of bounds"); | |
757 return i; | |
758 } | |
759 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
760 BasicType CppInterpreter::result_type_of(Method* method) { |
1256 | 761 BasicType t; |
762 switch (method->result_index()) { | |
763 case 0 : t = T_BOOLEAN; break; | |
764 case 1 : t = T_CHAR; break; | |
765 case 2 : t = T_BYTE; break; | |
766 case 3 : t = T_SHORT; break; | |
767 case 4 : t = T_INT; break; | |
768 case 5 : t = T_LONG; break; | |
769 case 6 : t = T_VOID; break; | |
770 case 7 : t = T_FLOAT; break; | |
771 case 8 : t = T_DOUBLE; break; | |
772 case 9 : t = T_OBJECT; break; | |
773 default: ShouldNotReachHere(); | |
774 } | |
775 assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(), | |
776 "out of step with AbstractInterpreter::BasicType_as_index"); | |
777 return t; | |
778 } | |
779 | |
1010 | 780 address InterpreterGenerator::generate_empty_entry() { |
781 if (!UseFastEmptyMethods) | |
782 return NULL; | |
783 | |
784 return generate_entry((address) CppInterpreter::empty_entry); | |
785 } | |
786 | |
787 address InterpreterGenerator::generate_accessor_entry() { | |
788 if (!UseFastAccessorMethods) | |
789 return NULL; | |
790 | |
791 return generate_entry((address) CppInterpreter::accessor_entry); | |
792 } | |
793 | |
3249
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
794 address InterpreterGenerator::generate_Reference_get_entry(void) { |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7195
diff
changeset
|
795 #if INCLUDE_ALL_GCS |
3249
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
796 if (UseG1GC) { |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
797 // We need to generate have a routine that generates code to: |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
798 // * load the value in the referent field |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
799 // * passes that value to the pre-barrier. |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
800 // |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
801 // In the case of G1 this will record the value of the |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
802 // referent in an SATB buffer if marking is active. |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
803 // This will cause concurrent marking to mark the referent |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
804 // field as live. |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
805 Unimplemented(); |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
806 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7195
diff
changeset
|
807 #endif // INCLUDE_ALL_GCS |
3249
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
808 |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
809 // If G1 is not enabled then attempt to go through the accessor entry point |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
810 // Reference.get is an accessor |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
811 return generate_accessor_entry(); |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
812 } |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
813 |
1010 | 814 address InterpreterGenerator::generate_native_entry(bool synchronized) { |
815 assert(synchronized == false, "should be"); | |
816 | |
817 return generate_entry((address) CppInterpreter::native_entry); | |
818 } | |
819 | |
820 address InterpreterGenerator::generate_normal_entry(bool synchronized) { | |
821 assert(synchronized == false, "should be"); | |
822 | |
823 return generate_entry((address) CppInterpreter::normal_entry); | |
824 } | |
825 | |
826 address AbstractInterpreterGenerator::generate_method_entry( | |
827 AbstractInterpreter::MethodKind kind) { | |
828 address entry_point = NULL; | |
829 | |
830 switch (kind) { | |
831 case Interpreter::zerolocals: | |
832 case Interpreter::zerolocals_synchronized: | |
833 break; | |
834 | |
835 case Interpreter::native: | |
836 entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false); | |
837 break; | |
838 | |
839 case Interpreter::native_synchronized: | |
840 entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false); | |
841 break; | |
842 | |
843 case Interpreter::empty: | |
844 entry_point = ((InterpreterGenerator*) this)->generate_empty_entry(); | |
845 break; | |
846 | |
847 case Interpreter::accessor: | |
848 entry_point = ((InterpreterGenerator*) this)->generate_accessor_entry(); | |
849 break; | |
850 | |
851 case Interpreter::abstract: | |
852 entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry(); | |
853 break; | |
854 | |
855 case Interpreter::java_lang_math_sin: | |
856 case Interpreter::java_lang_math_cos: | |
857 case Interpreter::java_lang_math_tan: | |
858 case Interpreter::java_lang_math_abs: | |
859 case Interpreter::java_lang_math_log: | |
860 case Interpreter::java_lang_math_log10: | |
861 case Interpreter::java_lang_math_sqrt: | |
6926 | 862 case Interpreter::java_lang_math_pow: |
863 case Interpreter::java_lang_math_exp: | |
1010 | 864 entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind); |
865 break; | |
866 | |
3249
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
867 case Interpreter::java_lang_ref_reference_get: |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
868 entry_point = ((InterpreterGenerator*)this)->generate_Reference_get_entry(); |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
869 break; |
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
2376
diff
changeset
|
870 |
1010 | 871 default: |
872 ShouldNotReachHere(); | |
873 } | |
874 | |
875 if (entry_point == NULL) | |
876 entry_point = ((InterpreterGenerator*) this)->generate_normal_entry(false); | |
877 | |
878 return entry_point; | |
879 } | |
880 | |
881 InterpreterGenerator::InterpreterGenerator(StubQueue* code) | |
882 : CppInterpreterGenerator(code) { | |
883 generate_all(); | |
884 } | |
885 | |
886 // Deoptimization helpers | |
887 | |
1379 | 888 InterpreterFrame *InterpreterFrame::build(int size, TRAPS) { |
889 ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack(); | |
890 | |
1010 | 891 int size_in_words = size >> LogBytesPerWord; |
892 assert(size_in_words * wordSize == size, "unaligned"); | |
893 assert(size_in_words >= header_words, "too small"); | |
1379 | 894 stack->overflow_check(size_in_words, CHECK_NULL); |
1010 | 895 |
896 stack->push(0); // next_frame, filled in later | |
897 intptr_t *fp = stack->sp(); | |
898 assert(fp - stack->sp() == next_frame_off, "should be"); | |
899 | |
900 stack->push(INTERPRETER_FRAME); | |
901 assert(fp - stack->sp() == frame_type_off, "should be"); | |
902 | |
903 interpreterState istate = | |
904 (interpreterState) stack->alloc(sizeof(BytecodeInterpreter)); | |
905 assert(fp - stack->sp() == istate_off, "should be"); | |
906 istate->set_self_link(NULL); // mark invalid | |
907 | |
908 stack->alloc((size_in_words - header_words) * wordSize); | |
909 | |
910 return (InterpreterFrame *) fp; | |
911 } | |
912 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
913 int AbstractInterpreter::layout_activation(Method* method, |
1010 | 914 int tempcount, |
915 int popframe_extra_args, | |
916 int moncount, | |
3369
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
3261
diff
changeset
|
917 int caller_actual_parameters, |
1010 | 918 int callee_param_count, |
919 int callee_locals, | |
920 frame* caller, | |
921 frame* interpreter_frame, | |
8727
0094485b46c7
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
8001
diff
changeset
|
922 bool is_top_frame, |
0094485b46c7
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
8001
diff
changeset
|
923 bool is_bottom_frame) { |
1010 | 924 assert(popframe_extra_args == 0, "what to do?"); |
925 assert(!is_top_frame || (!callee_locals && !callee_param_count), | |
1605 | 926 "top frame should have no caller"); |
1010 | 927 |
928 // This code must exactly match what InterpreterFrame::build | |
929 // does (the full InterpreterFrame::build, that is, not the | |
930 // one that creates empty frames for the deoptimizer). | |
931 // | |
932 // If interpreter_frame is not NULL then it will be filled in. | |
933 // It's size is determined by a previous call to this method, | |
934 // so it should be correct. | |
935 // | |
936 // Note that tempcount is the current size of the expression | |
937 // stack. For top most frames we will allocate a full sized | |
938 // expression stack and not the trimmed version that non-top | |
939 // frames have. | |
940 | |
941 int header_words = InterpreterFrame::header_words; | |
942 int monitor_words = moncount * frame::interpreter_frame_monitor_size(); | |
943 int stack_words = is_top_frame ? method->max_stack() : tempcount; | |
944 int callee_extra_locals = callee_locals - callee_param_count; | |
945 | |
946 if (interpreter_frame) { | |
1505 | 947 intptr_t *locals = interpreter_frame->fp() + method->max_locals(); |
1010 | 948 interpreterState istate = interpreter_frame->get_interpreterState(); |
949 intptr_t *monitor_base = (intptr_t*) istate; | |
950 intptr_t *stack_base = monitor_base - monitor_words; | |
951 intptr_t *stack = stack_base - tempcount - 1; | |
952 | |
953 BytecodeInterpreter::layout_interpreterState(istate, | |
954 caller, | |
955 NULL, | |
956 method, | |
957 locals, | |
958 stack, | |
959 stack_base, | |
960 monitor_base, | |
961 NULL, | |
962 is_top_frame); | |
963 } | |
964 return header_words + monitor_words + stack_words + callee_extra_locals; | |
965 } | |
966 | |
967 void BytecodeInterpreter::layout_interpreterState(interpreterState istate, | |
968 frame* caller, | |
969 frame* current, | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
970 Method* method, |
1010 | 971 intptr_t* locals, |
972 intptr_t* stack, | |
973 intptr_t* stack_base, | |
974 intptr_t* monitor_base, | |
975 intptr_t* frame_bottom, | |
976 bool is_top_frame) { | |
977 istate->set_locals(locals); | |
978 istate->set_method(method); | |
979 istate->set_self_link(istate); | |
980 istate->set_prev_link(NULL); | |
981 // thread will be set by a hacky repurposing of frame::patch_pc() | |
982 // bcp will be set by vframeArrayElement::unpack_on_stack() | |
983 istate->set_constants(method->constants()->cache()); | |
984 istate->set_msg(BytecodeInterpreter::method_resume); | |
985 istate->set_bcp_advance(0); | |
986 istate->set_oop_temp(NULL); | |
987 istate->set_mdx(NULL); | |
988 if (caller->is_interpreted_frame()) { | |
989 interpreterState prev = caller->get_interpreterState(); | |
990 prev->set_callee(method); | |
991 if (*prev->bcp() == Bytecodes::_invokeinterface) | |
992 prev->set_bcp_advance(5); | |
993 else | |
994 prev->set_bcp_advance(3); | |
995 } | |
996 istate->set_callee(NULL); | |
997 istate->set_monitor_base((BasicObjectLock *) monitor_base); | |
998 istate->set_stack_base(stack_base); | |
999 istate->set_stack(stack); | |
1000 istate->set_stack_limit(stack_base - method->max_stack() - 1); | |
1001 } | |
1002 | |
1003 address CppInterpreter::return_entry(TosState state, int length) { | |
1004 ShouldNotCallThis(); | |
1005 } | |
1006 | |
1007 address CppInterpreter::deopt_entry(TosState state, int length) { | |
1008 return NULL; | |
1009 } | |
1010 | |
1011 // Helper for (runtime) stack overflow checks | |
1012 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
1013 int AbstractInterpreter::size_top_interpreter_activation(Method* method) { |
1010 | 1014 return 0; |
1015 } | |
1016 | |
1017 // Helper for figuring out if frames are interpreter frames | |
1018 | |
1019 bool CppInterpreter::contains(address pc) { | |
1020 return false; // make frame::print_value_on work | |
1021 } | |
1022 | |
1023 // Result handlers and convertors | |
1024 | |
1025 address CppInterpreterGenerator::generate_result_handler_for( | |
1026 BasicType type) { | |
1027 assembler()->advance(1); | |
1028 return ShouldNotCallThisStub(); | |
1029 } | |
1030 | |
1031 address CppInterpreterGenerator::generate_tosca_to_stack_converter( | |
1032 BasicType type) { | |
1033 assembler()->advance(1); | |
1034 return ShouldNotCallThisStub(); | |
1035 } | |
1036 | |
1037 address CppInterpreterGenerator::generate_stack_to_stack_converter( | |
1038 BasicType type) { | |
1039 assembler()->advance(1); | |
1040 return ShouldNotCallThisStub(); | |
1041 } | |
1042 | |
1043 address CppInterpreterGenerator::generate_stack_to_native_abi_converter( | |
1044 BasicType type) { | |
1045 assembler()->advance(1); | |
1046 return ShouldNotCallThisStub(); | |
1047 } | |
1048 | |
1049 #endif // CC_INTERP |