961 handler_address = SharedRuntime::deopt_blob()->unpack_with_exception();
962 } else {
963
964 handler_address =
965 force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
966
967 if (handler_address == NULL) {
968 handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
969 assert (handler_address != NULL, "must have compiled handler");
970 // Update the exception cache only when the unwind was not forced.
971 if (!force_unwind) {
972 nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
973 }
974 } else {
975 assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
976 }
977 }
978
979 thread->set_exception_pc(pc);
980 thread->set_exception_handler_pc(handler_address);
981 thread->set_exception_stack_size(0);
982
983 // Check if the exception PC is a MethodHandle call site.
984 thread->set_is_method_handle_return(nm->is_method_handle_return(pc));
985 }
986
987 // Restore correct return pc. Was saved above.
988 thread->set_exception_oop(exception());
989 return handler_address;
990
991 JRT_END
992
993 // We are entering here from exception_blob
994 // If there is a compiled exception handler in this method, we will continue there;
995 // otherwise we will unwind the stack and continue at the caller of top frame method
996 // Note we enter without the usual JRT wrapper. We will call a helper routine that
997 // will do the normal VM entry. We do it this way so that we can see if the nmethod
998 // we looked up the handler for has been deoptimized in the meantime. If it has been
999 // we must not use the handler and instread return the deopt blob.
1000 address OptoRuntime::handle_exception_C(JavaThread* thread) {
1001 //
|
961 handler_address = SharedRuntime::deopt_blob()->unpack_with_exception();
962 } else {
963
964 handler_address =
965 force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
966
967 if (handler_address == NULL) {
968 handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
969 assert (handler_address != NULL, "must have compiled handler");
970 // Update the exception cache only when the unwind was not forced.
971 if (!force_unwind) {
972 nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
973 }
974 } else {
975 assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
976 }
977 }
978
979 thread->set_exception_pc(pc);
980 thread->set_exception_handler_pc(handler_address);
981
982 // Check if the exception PC is a MethodHandle call site.
983 thread->set_is_method_handle_return(nm->is_method_handle_return(pc));
984 }
985
986 // Restore correct return pc. Was saved above.
987 thread->set_exception_oop(exception());
988 return handler_address;
989
990 JRT_END
991
992 // We are entering here from exception_blob
993 // If there is a compiled exception handler in this method, we will continue there;
994 // otherwise we will unwind the stack and continue at the caller of top frame method
995 // Note we enter without the usual JRT wrapper. We will call a helper routine that
996 // will do the normal VM entry. We do it this way so that we can see if the nmethod
997 // we looked up the handler for has been deoptimized in the meantime. If it has been
998 // we must not use the handler and instread return the deopt blob.
999 address OptoRuntime::handle_exception_C(JavaThread* thread) {
1000 //
|