support JIT compiling methods with unsorted exception handler tables

This commit is contained in:
Joel Dice 2008-01-25 17:17:27 -07:00
parent aa081089ce
commit 8150b957c9

View File

@ -3807,11 +3807,21 @@ compile(MyThread* t, Context* context)
if (eht) {
PROTECT(t, eht);
unsigned visitCount = exceptionHandlerTableLength(t, eht);
bool visited[visitCount];
memset(visited, 0, visitCount);
while (visitCount) {
bool progress = false;
for (unsigned i = 0; i < exceptionHandlerTableLength(t, eht); ++i) {
ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i);
unsigned start = exceptionHandlerStart(eh);
assert(t, context->visitTable[start]);
if (not visited[i] and context->visitTable[start]) {
-- visitCount;
visited[i] = true;
progress = true;
uintptr_t stackMap[stackMapSizeInWords(t, context->method)];
Frame frame2(&frame, stackMap);
@ -3843,6 +3853,10 @@ compile(MyThread* t, Context* context)
}
}
assert(t, progress);
}
}
updateTraceElements(t, context, 0, 0);
return finish(t, context, 0);