1.1 --- a/src/share/vm/opto/runtime.cpp Tue Oct 04 10:07:07 2011 -0700 1.2 +++ b/src/share/vm/opto/runtime.cpp Tue Oct 04 14:30:04 2011 -0700 1.3 @@ -997,10 +997,13 @@ 1.4 force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc); 1.5 1.6 if (handler_address == NULL) { 1.7 + Handle original_exception(thread, exception()); 1.8 handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true); 1.9 assert (handler_address != NULL, "must have compiled handler"); 1.10 - // Update the exception cache only when the unwind was not forced. 1.11 - if (!force_unwind) { 1.12 + // Update the exception cache only when the unwind was not forced 1.13 + // and there didn't happen another exception during the computation of the 1.14 + // compiled exception handler. 1.15 + if (!force_unwind && original_exception() == exception()) { 1.16 nm->add_handler_for_exception_and_pc(exception,pc,handler_address); 1.17 } 1.18 } else {