src/cpu/zero/vm/cppInterpreter_zero.cpp

Tue, 20 Aug 2013 10:57:50 -0700

author
twisti
date
Tue, 20 Aug 2013 10:57:50 -0700
changeset 5545
e16282db4946
parent 5065
e60b3fce2b02
child 6039
bd3237e0e18d
child 6470
abe03600372a
permissions
-rw-r--r--

8022956: Clang: enable return type warnings on BSD
Reviewed-by: coleenp, sla

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

mercurial