src/share/vm/c1/c1_Runtime1.cpp

Print this page




 484   if (nm->is_deopt_pc(pc)) {
 485     RegisterMap map(thread, false);
 486     frame exception_frame = thread->last_frame().sender(&map);
 487     // if the frame isn't deopted then pc must not correspond to the caller of last_frame
 488     assert(exception_frame.is_deoptimized_frame(), "must be deopted");
 489     pc = exception_frame.pc();
 490   }
 491 #ifdef ASSERT
 492   assert(exception.not_null(), "NULL exceptions should be handled by throw_exception");
 493   assert(exception->is_oop(), "just checking");
 494   // Check that exception is a subclass of Throwable, otherwise we have a VerifyError
 495   if (!(exception->is_a(SystemDictionary::Throwable_klass()))) {
 496     if (ExitVMOnVerifyError) vm_exit(-1);
 497     ShouldNotReachHere();
 498   }
 499 #endif
 500 
 501   // Check the stack guard pages and reenable them if necessary and there is
 502   // enough space on the stack to do so.  Use fast exceptions only if the guard
 503   // pages are enabled.
 504   bool guard_pages_enabled = thread->stack_yellow_zone_enabled();
 505   if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack();
 506 
 507   if (JvmtiExport::can_post_on_exceptions()) {
 508     // To ensure correct notification of exception catches and throws
 509     // we have to deoptimize here.  If we attempted to notify the
 510     // catches and throws during this exception lookup it's possible
 511     // we could deoptimize on the way out of the VM and end back in
 512     // the interpreter at the throw site.  This would result in double
 513     // notifications since the interpreter would also notify about
 514     // these same catches and throws as it unwound the frame.
 515 
 516     RegisterMap reg_map(thread);
 517     frame stub_frame = thread->last_frame();
 518     frame caller_frame = stub_frame.sender(&reg_map);
 519 
 520     // We don't really want to deoptimize the nmethod itself since we
 521     // can actually continue in the exception handler ourselves but I
 522     // don't see an easy way to have the desired effect.
 523     Deoptimization::deoptimize_frame(thread, caller_frame.id());
 524     assert(caller_is_deopted(), "Must be deoptimized");




 484   if (nm->is_deopt_pc(pc)) {
 485     RegisterMap map(thread, false);
 486     frame exception_frame = thread->last_frame().sender(&map);
 487     // if the frame isn't deopted then pc must not correspond to the caller of last_frame
 488     assert(exception_frame.is_deoptimized_frame(), "must be deopted");
 489     pc = exception_frame.pc();
 490   }
 491 #ifdef ASSERT
 492   assert(exception.not_null(), "NULL exceptions should be handled by throw_exception");
 493   assert(exception->is_oop(), "just checking");
 494   // Check that exception is a subclass of Throwable, otherwise we have a VerifyError
 495   if (!(exception->is_a(SystemDictionary::Throwable_klass()))) {
 496     if (ExitVMOnVerifyError) vm_exit(-1);
 497     ShouldNotReachHere();
 498   }
 499 #endif
 500 
 501   // Check the stack guard pages and reenable them if necessary and there is
 502   // enough space on the stack to do so.  Use fast exceptions only if the guard
 503   // pages are enabled.
 504   bool guard_pages_enabled = thread->stack_guards_enabled();
 505   if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack();
 506 
 507   if (JvmtiExport::can_post_on_exceptions()) {
 508     // To ensure correct notification of exception catches and throws
 509     // we have to deoptimize here.  If we attempted to notify the
 510     // catches and throws during this exception lookup it's possible
 511     // we could deoptimize on the way out of the VM and end back in
 512     // the interpreter at the throw site.  This would result in double
 513     // notifications since the interpreter would also notify about
 514     // these same catches and throws as it unwound the frame.
 515 
 516     RegisterMap reg_map(thread);
 517     frame stub_frame = thread->last_frame();
 518     frame caller_frame = stub_frame.sender(&reg_map);
 519 
 520     // We don't really want to deoptimize the nmethod itself since we
 521     // can actually continue in the exception handler ourselves but I
 522     // don't see an easy way to have the desired effect.
 523     Deoptimization::deoptimize_frame(thread, caller_frame.id());
 524     assert(caller_is_deopted(), "Must be deoptimized");