src/cpu/zero/vm/cppInterpreter_zero.cpp

Fri, 15 Aug 2014 15:25:24 -0400

author
coleenp
date
Fri, 15 Aug 2014 15:25:24 -0400
changeset 7675
6d13c17668d1
parent 6911
ce8f6bb717c9
child 7994
04ff2f6cd0eb
child 8368
32b682649973
permissions
-rw-r--r--

8055231: ZERO variant build is broken
Summary: Fix zero build.
Reviewed-by: coleenp
Contributed-by: Severin Gehwolf <sgehwolf@redhat.com>

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

mercurial