< prev index next >

src/share/vm/interpreter/interpreterRuntime.cpp

Print this page




 506 
 507   // notify JVMTI of an exception throw; JVMTI will detect if this is a first
 508   // time throw or a stack unwinding throw and accordingly notify the debugger
 509   if (JvmtiExport::can_post_on_exceptions()) {
 510     JvmtiExport::post_exception_throw(thread, h_method(), bcp(thread), h_exception());
 511   }
 512 
 513 #ifdef CC_INTERP
 514   address continuation = (address)(intptr_t) handler_bci;
 515 #else
 516   address continuation = NULL;
 517 #endif
 518   address handler_pc = NULL;
 519   if (handler_bci < 0 || !thread->reguard_stack((address) &continuation)) {
 520     // Forward exception to callee (leaving bci/bcp untouched) because (a) no
 521     // handler in this method, or (b) after a stack overflow there is not yet
 522     // enough stack space available to reprotect the stack.
 523 #ifndef CC_INTERP
 524     continuation = Interpreter::remove_activation_entry();
 525 #endif

 526     // Count this for compilation purposes
 527     h_method->interpreter_throwout_increment(THREAD);

 528   } else {
 529     // handler in this method => change bci/bcp to handler bci/bcp and continue there
 530     handler_pc = h_method->code_base() + handler_bci;
 531 #ifndef CC_INTERP
 532     set_bcp_and_mdp(handler_pc, thread);
 533     continuation = Interpreter::dispatch_table(vtos)[*handler_pc];
 534 #endif
 535   }
 536   // notify debugger of an exception catch
 537   // (this is good for exceptions caught in native methods as well)
 538   if (JvmtiExport::can_post_on_exceptions()) {
 539     JvmtiExport::notice_unwind_due_to_exception(thread, h_method(), handler_pc, h_exception(), (handler_pc != NULL));
 540   }
 541 
 542   thread->set_vm_result(h_exception());
 543   return continuation;
 544 IRT_END
 545 
 546 
 547 IRT_ENTRY(void, InterpreterRuntime::throw_pending_exception(JavaThread* thread))




 506 
 507   // notify JVMTI of an exception throw; JVMTI will detect if this is a first
 508   // time throw or a stack unwinding throw and accordingly notify the debugger
 509   if (JvmtiExport::can_post_on_exceptions()) {
 510     JvmtiExport::post_exception_throw(thread, h_method(), bcp(thread), h_exception());
 511   }
 512 
 513 #ifdef CC_INTERP
 514   address continuation = (address)(intptr_t) handler_bci;
 515 #else
 516   address continuation = NULL;
 517 #endif
 518   address handler_pc = NULL;
 519   if (handler_bci < 0 || !thread->reguard_stack((address) &continuation)) {
 520     // Forward exception to callee (leaving bci/bcp untouched) because (a) no
 521     // handler in this method, or (b) after a stack overflow there is not yet
 522     // enough stack space available to reprotect the stack.
 523 #ifndef CC_INTERP
 524     continuation = Interpreter::remove_activation_entry();
 525 #endif
 526 #if COMPILER2_OR_JVMCI
 527     // Count this for compilation purposes
 528     h_method->interpreter_throwout_increment(THREAD);
 529 #endif
 530   } else {
 531     // handler in this method => change bci/bcp to handler bci/bcp and continue there
 532     handler_pc = h_method->code_base() + handler_bci;
 533 #ifndef CC_INTERP
 534     set_bcp_and_mdp(handler_pc, thread);
 535     continuation = Interpreter::dispatch_table(vtos)[*handler_pc];
 536 #endif
 537   }
 538   // notify debugger of an exception catch
 539   // (this is good for exceptions caught in native methods as well)
 540   if (JvmtiExport::can_post_on_exceptions()) {
 541     JvmtiExport::notice_unwind_due_to_exception(thread, h_method(), handler_pc, h_exception(), (handler_pc != NULL));
 542   }
 543 
 544   thread->set_vm_result(h_exception());
 545   return continuation;
 546 IRT_END
 547 
 548 
 549 IRT_ENTRY(void, InterpreterRuntime::throw_pending_exception(JavaThread* thread))


< prev index next >