src/share/vm/opto/runtime.cpp

Print this page




 913     if (nm->is_deopt_pc(pc)) {
 914       deopting = true;
 915       RegisterMap map(thread, false);
 916       frame deoptee = thread->last_frame().sender(&map);
 917       assert(deoptee.is_deoptimized_frame(), "must be deopted");
 918       // Adjust the pc back to the original throwing pc
 919       pc = deoptee.pc();
 920     }
 921 
 922     // If we are forcing an unwind because of stack overflow then deopt is
 923     // irrelevant sice we are throwing the frame away anyway.
 924 
 925     if (deopting && !force_unwind) {
 926       handler_address = SharedRuntime::deopt_blob()->unpack_with_exception();
 927     } else {
 928 
 929       handler_address =
 930         force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
 931 
 932       if (handler_address == NULL) {

 933         handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
 934         assert (handler_address != NULL, "must have compiled handler");
 935         // Update the exception cache only when the unwind was not forced.
 936         if (!force_unwind) {


 937           nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
 938         }
 939       } else {
 940         assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
 941       }
 942     }
 943 
 944     thread->set_exception_pc(pc);
 945     thread->set_exception_handler_pc(handler_address);
 946     thread->set_exception_stack_size(0);
 947 
 948     // Check if the exception PC is a MethodHandle call site.
 949     thread->set_is_method_handle_return(nm->is_method_handle_return(pc));
 950   }
 951 
 952   // Restore correct return pc.  Was saved above.
 953   thread->set_exception_oop(exception());
 954   return handler_address;
 955 
 956 JRT_END




 913     if (nm->is_deopt_pc(pc)) {
 914       deopting = true;
 915       RegisterMap map(thread, false);
 916       frame deoptee = thread->last_frame().sender(&map);
 917       assert(deoptee.is_deoptimized_frame(), "must be deopted");
 918       // Adjust the pc back to the original throwing pc
 919       pc = deoptee.pc();
 920     }
 921 
 922     // If we are forcing an unwind because of stack overflow then deopt is
 923     // irrelevant sice we are throwing the frame away anyway.
 924 
 925     if (deopting && !force_unwind) {
 926       handler_address = SharedRuntime::deopt_blob()->unpack_with_exception();
 927     } else {
 928 
 929       handler_address =
 930         force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
 931 
 932       if (handler_address == NULL) {
 933         Handle original_exception(thread, exception());
 934         handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
 935         assert (handler_address != NULL, "must have compiled handler");
 936         // Update the exception cache only when the unwind was not forced
 937         // and there didn't happen another exception during the computation of the 
 938         // compiled exception handler.
 939         if (!force_unwind && original_exception() == exception()) {
 940           nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
 941         }
 942       } else {
 943         assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
 944       }
 945     }
 946 
 947     thread->set_exception_pc(pc);
 948     thread->set_exception_handler_pc(handler_address);
 949     thread->set_exception_stack_size(0);
 950 
 951     // Check if the exception PC is a MethodHandle call site.
 952     thread->set_is_method_handle_return(nm->is_method_handle_return(pc));
 953   }
 954 
 955   // Restore correct return pc.  Was saved above.
 956   thread->set_exception_oop(exception());
 957   return handler_address;
 958 
 959 JRT_END