Mercurial > hg > graal-compiler
diff src/share/vm/runtime/sharedRuntime.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 | 0f34fdee809e |
children | 23a1c8de9d51 |
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.cpp Tue Oct 04 10:07:07 2011 -0700 +++ b/src/share/vm/runtime/sharedRuntime.cpp Tue Oct 04 14:30:04 2011 -0700 @@ -659,12 +659,14 @@ int scope_depth = 0; if (!force_unwind) { int bci = sd->bci(); + bool recursive_exception = false; do { bool skip_scope_increment = false; // exception handler lookup KlassHandle ek (THREAD, exception->klass()); handler_bci = sd->method()->fast_exception_handler_bci_for(ek, bci, THREAD); if (HAS_PENDING_EXCEPTION) { + recursive_exception = true; // We threw an exception while trying to find the exception handler. // Transfer the new exception to the exception handle which will // be set into thread local storage, and do another lookup for an @@ -680,6 +682,9 @@ skip_scope_increment = true; } } + else { + recursive_exception = false; + } if (!top_frame_only && handler_bci < 0 && !skip_scope_increment) { sd = sd->sender(); if (sd != NULL) { @@ -687,7 +692,7 @@ } ++scope_depth; } - } while (!top_frame_only && handler_bci < 0 && sd != NULL); + } while (recursive_exception || (!top_frame_only && handler_bci < 0 && sd != NULL)); } // found handling method => lookup exception handler