src/share/vm/interpreter/templateInterpreter.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6833129 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/templateInterpreter.cpp

Print this page




 588     _notice_safepoints = true;
 589     copy_table((address*)&_safept_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address));
 590   }
 591 }
 592 
 593 // switch from the dispatch table which notices safepoints back to the
 594 // normal dispatch table.  So that we can notice single stepping points,
 595 // keep the safepoint dispatch table if we are single stepping in JVMTI.
 596 // Note that the should_post_single_step test is exactly as fast as the
 597 // JvmtiExport::_enabled test and covers both cases.
 598 void TemplateInterpreter::ignore_safepoints() {
 599   if (_notice_safepoints) {
 600     if (!JvmtiExport::should_post_single_step()) {
 601       // switch to normal dispatch table
 602       _notice_safepoints = false;
 603       copy_table((address*)&_normal_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address));
 604     }
 605   }
 606 }
 607 
 608 // If deoptimization happens, this method returns the point where to continue in
 609 // interpreter. For calls (invokexxxx, newxxxx) the continuation is at next
 610 // bci and the top of stack is in eax/edx/FPU tos.
 611 // For putfield/getfield, put/getstatic, the continuation is at the same
 612 // bci and the TOS is on stack.
 613 
 614 // Note: deopt_entry(type, 0) means reexecute bytecode
 615 //       deopt_entry(type, length) means continue at next bytecode


 616 
 617 address TemplateInterpreter::continuation_for(methodOop method, address bcp, int callee_parameters, bool is_top_frame, bool& use_next_mdp) {




 618   assert(method->contains(bcp), "just checkin'");
 619   Bytecodes::Code code   = Bytecodes::java_code_at(bcp);
 620   if (code == Bytecodes::_return) {
 621       // This is used for deopt during registration of finalizers
 622       // during Object.<init>.  We simply need to resume execution at
 623       // the standard return vtos bytecode to pop the frame normally.
 624       // reexecuting the real bytecode would cause double registration
 625       // of the finalizable object.
 626       assert(is_top_frame, "must be on top");
 627       return _normal_table.entry(Bytecodes::_return).entry(vtos);
 628   } else {
 629     return AbstractInterpreter::continuation_for(method, bcp, callee_parameters, is_top_frame, use_next_mdp);
 630   }
 631 }











 632 
 633 #endif // !CC_INTERP


 588     _notice_safepoints = true;
 589     copy_table((address*)&_safept_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address));
 590   }
 591 }
 592 
 593 // switch from the dispatch table which notices safepoints back to the
 594 // normal dispatch table.  So that we can notice single stepping points,
 595 // keep the safepoint dispatch table if we are single stepping in JVMTI.
 596 // Note that the should_post_single_step test is exactly as fast as the
 597 // JvmtiExport::_enabled test and covers both cases.
 598 void TemplateInterpreter::ignore_safepoints() {
 599   if (_notice_safepoints) {
 600     if (!JvmtiExport::should_post_single_step()) {
 601       // switch to normal dispatch table
 602       _notice_safepoints = false;
 603       copy_table((address*)&_normal_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address));
 604     }
 605   }
 606 }
 607 
 608 //------------------------------------------------------------------------------------------------------------------------
 609 // Deoptimization support



 610 
 611 // If deoptimization happens, this function returns the point of next bytecode to continue execution
 612 address TemplateInterpreter::deopt_continue_after_entry(methodOop method, address bcp, int callee_parameters, bool is_top_frame) {
 613   return AbstractInterpreter::deopt_continue_after_entry(method, bcp, callee_parameters, is_top_frame);
 614 }
 615 
 616 // If deoptimization happens, this function returns the point where the interpreter reexecutes
 617 // the bytecode.
 618 // Note: Bytecodes::_athrow (C1 only) and Bytecodes::_return are the special cases
 619 //       that do not return "Interpreter::deopt_entry(vtos, 0)"
 620 address TemplateInterpreter::deopt_reexecute_entry(methodOop method, address bcp) {
 621   assert(method->contains(bcp), "just checkin'");
 622   Bytecodes::Code code   = Bytecodes::java_code_at(bcp);
 623   if (code == Bytecodes::_return) {
 624     // This is used for deopt during registration of finalizers
 625     // during Object.<init>.  We simply need to resume execution at
 626     // the standard return vtos bytecode to pop the frame normally.
 627     // reexecuting the real bytecode would cause double registration
 628     // of the finalizable object.

 629     return _normal_table.entry(Bytecodes::_return).entry(vtos);
 630   } else {
 631     return AbstractInterpreter::deopt_reexecute_entry(method, bcp);
 632   }
 633 }
 634 
 635 // If deoptimization happens, the interpreter should reexecute this bytecode.
 636 // This function mainly helps the compilers to set up the reexecute bit.
 637 bool TemplateInterpreter::bytecode_should_reexecute(Bytecodes::Code code) {
 638   if (code == Bytecodes::_return) {
 639     //Yes, we consider Bytecodes::_return as a special case of reexecution
 640     return true;
 641   } else {
 642     return AbstractInterpreter::bytecode_should_reexecute(code);
 643   }
 644 }
 645 
 646 #endif // !CC_INTERP
src/share/vm/interpreter/templateInterpreter.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File