mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
support JIT compiling methods with unsorted exception handler tables
This commit is contained in:
parent
aa081089ce
commit
8150b957c9
@ -3807,11 +3807,21 @@ compile(MyThread* t, Context* context)
|
|||||||
if (eht) {
|
if (eht) {
|
||||||
PROTECT(t, 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) {
|
for (unsigned i = 0; i < exceptionHandlerTableLength(t, eht); ++i) {
|
||||||
ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i);
|
ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i);
|
||||||
unsigned start = exceptionHandlerStart(eh);
|
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)];
|
uintptr_t stackMap[stackMapSizeInWords(t, context->method)];
|
||||||
Frame frame2(&frame, stackMap);
|
Frame frame2(&frame, stackMap);
|
||||||
@ -3843,6 +3853,10 @@ compile(MyThread* t, Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(t, progress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateTraceElements(t, context, 0, 0);
|
updateTraceElements(t, context, 0, 0);
|
||||||
|
|
||||||
return finish(t, context, 0);
|
return finish(t, context, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user