542 // exception handler can cause class loading, which might throw an |
542 // exception handler can cause class loading, which might throw an |
543 // exception and those fields are expected to be clear during |
543 // exception and those fields are expected to be clear during |
544 // normal bytecode execution. |
544 // normal bytecode execution. |
545 thread->clear_exception_oop_and_pc(); |
545 thread->clear_exception_oop_and_pc(); |
546 |
546 |
|
547 Handle original_exception(thread, exception()); |
|
548 |
547 continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false); |
549 continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false); |
548 // If an exception was thrown during exception dispatch, the exception oop may have changed |
550 // If an exception was thrown during exception dispatch, the exception oop may have changed |
549 thread->set_exception_oop(exception()); |
551 thread->set_exception_oop(exception()); |
550 thread->set_exception_pc(pc); |
552 thread->set_exception_pc(pc); |
551 |
553 |
552 // the exception cache is used only by non-implicit exceptions |
554 // the exception cache is used only by non-implicit exceptions |
553 if (continuation != NULL) { |
555 // Update the exception cache only when there didn't happen |
|
556 // another exception during the computation of the compiled |
|
557 // exception handler. |
|
558 if (continuation != NULL && original_exception() == exception()) { |
554 nm->add_handler_for_exception_and_pc(exception, pc, continuation); |
559 nm->add_handler_for_exception_and_pc(exception, pc, continuation); |
555 } |
560 } |
556 } |
561 } |
557 |
562 |
558 thread->set_vm_result(exception()); |
563 thread->set_vm_result(exception()); |