# HG changeset patch # User Tom Rodriguez # Date 1501785019 25200 # Node ID 04c0ef7ca6bfa7f25a81dd902e214f89524fb935 # Parent 830c3424c0e5683135b4fcc056e40e51249c3d22 JDK-8185736: Add missing unwind exception handler in C2 diff -r 830c3424c0e5 -r 04c0ef7ca6bf src/share/vm/opto/doCall.cpp --- a/src/share/vm/opto/doCall.cpp Thu Aug 03 12:01:05 2017 +0200 +++ b/src/share/vm/opto/doCall.cpp Thu Aug 03 11:30:19 2017 -0700 @@ -672,6 +672,7 @@ GrowableArray* extypes = new (C->node_arena()) GrowableArray(C->node_arena(), 8, 0, NULL); GrowableArray* saw_unloaded = new (C->node_arena()) GrowableArray(C->node_arena(), 8, 0, 0); + bool default_handler = false; for (; !handlers.is_done(); handlers.next()) { ciExceptionHandler* h = handlers.handler(); int h_bci = h->handler_bci(); @@ -694,6 +695,14 @@ // Note: It's OK if the BCIs repeat themselves. bcis->append(h_bci); extypes->append(h_extype); + if (h_bci == -1) { + default_handler = true; + } + } + + if (!default_handler) { + bcis->append(-1); + extypes->append(TypeOopPtr::make_from_klass(env()->Throwable_klass())->is_instptr()); } int len = bcis->length(); diff -r 830c3424c0e5 -r 04c0ef7ca6bf src/share/vm/opto/output.cpp --- a/src/share/vm/opto/output.cpp Thu Aug 03 12:01:05 2017 +0200 +++ b/src/share/vm/opto/output.cpp Thu Aug 03 11:30:19 2017 -0700 @@ -1752,6 +1752,7 @@ } // Set the offset of the return from the call + assert(handler_bcis.find(-1) != -1, "must have default handler"); _handler_table.add_subtable(call_return, &handler_bcis, NULL, &handler_pcos); continue; }