This commit is contained in:
Tom Rodriguez 2017-08-16 20:57:00 +00:00
commit 57ff1b2897
2 changed files with 10 additions and 0 deletions

View File

@ -719,6 +719,7 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) {
GrowableArray<const Type*>* extypes = new (C->node_arena()) GrowableArray<const Type*>(C->node_arena(), 8, 0, NULL);
GrowableArray<int>* saw_unloaded = new (C->node_arena()) GrowableArray<int>(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();
@ -741,6 +742,14 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) {
// 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();

View File

@ -1636,6 +1636,7 @@ void Compile::FillExceptionTables(uint cnt, uint *call_returns, uint *inct_start
}
// 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;
}