comparison src/share/vm/opto/runtime.cpp @ 3998:ec5ce9326985

6865265: JVM crashes with "missing exception handler" error Summary: Retry the call to fast_exception_handler_bci_for() after it returned with a pending exception. Don't cache the exception handler pc computed by compute_compiled_exc_handler() if the handler is for another (nested) exception. Reviewed-by: kamg, kvn Contributed-by: volker.simonis@gmail.com
author kvn
date Tue, 04 Oct 2011 14:30:04 -0700
parents a92cdbac8b9e
children cec1757a0134
comparison
equal deleted inserted replaced
3997:940513efe83a 3998:ec5ce9326985
995 995
996 handler_address = 996 handler_address =
997 force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc); 997 force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
998 998
999 if (handler_address == NULL) { 999 if (handler_address == NULL) {
1000 Handle original_exception(thread, exception());
1000 handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true); 1001 handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
1001 assert (handler_address != NULL, "must have compiled handler"); 1002 assert (handler_address != NULL, "must have compiled handler");
1002 // Update the exception cache only when the unwind was not forced. 1003 // Update the exception cache only when the unwind was not forced
1003 if (!force_unwind) { 1004 // and there didn't happen another exception during the computation of the
1005 // compiled exception handler.
1006 if (!force_unwind && original_exception() == exception()) {
1004 nm->add_handler_for_exception_and_pc(exception,pc,handler_address); 1007 nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
1005 } 1008 }
1006 } else { 1009 } else {
1007 assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same"); 1010 assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
1008 } 1011 }