mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
support JIT compiling methods with unsorted exception handler tables
This commit is contained in:
parent
aa081089ce
commit
8150b957c9
@ -3807,39 +3807,53 @@ compile(MyThread* t, Context* context)
|
|||||||
if (eht) {
|
if (eht) {
|
||||||
PROTECT(t, eht);
|
PROTECT(t, eht);
|
||||||
|
|
||||||
for (unsigned i = 0; i < exceptionHandlerTableLength(t, eht); ++i) {
|
unsigned visitCount = exceptionHandlerTableLength(t, eht);
|
||||||
ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i);
|
bool visited[visitCount];
|
||||||
unsigned start = exceptionHandlerStart(eh);
|
memset(visited, 0, visitCount);
|
||||||
|
|
||||||
assert(t, context->visitTable[start]);
|
while (visitCount) {
|
||||||
|
bool progress = false;
|
||||||
uintptr_t stackMap[stackMapSizeInWords(t, context->method)];
|
|
||||||
Frame frame2(&frame, stackMap);
|
|
||||||
|
|
||||||
uintptr_t* roots = context->rootTable
|
for (unsigned i = 0; i < exceptionHandlerTableLength(t, eht); ++i) {
|
||||||
+ (start * frameMapSizeInWords(t, context->method));
|
ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i);
|
||||||
|
unsigned start = exceptionHandlerStart(eh);
|
||||||
|
|
||||||
for (unsigned i = 0; i < localSize(t, context->method); ++ i) {
|
if (not visited[i] and context->visitTable[start]) {
|
||||||
if (getBit(roots, i)) {
|
-- visitCount;
|
||||||
frame2.mark(i);
|
visited[i] = true;
|
||||||
} else {
|
progress = true;
|
||||||
frame2.clear(i);
|
|
||||||
|
uintptr_t stackMap[stackMapSizeInWords(t, context->method)];
|
||||||
|
Frame frame2(&frame, stackMap);
|
||||||
|
|
||||||
|
uintptr_t* roots = context->rootTable
|
||||||
|
+ (start * frameMapSizeInWords(t, context->method));
|
||||||
|
|
||||||
|
for (unsigned i = 0; i < localSize(t, context->method); ++ i) {
|
||||||
|
if (getBit(roots, i)) {
|
||||||
|
frame2.mark(i);
|
||||||
|
} else {
|
||||||
|
frame2.clear(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
frame2.pushObject();
|
||||||
|
|
||||||
|
for (unsigned i = 1;
|
||||||
|
i < codeMaxStack(t, methodCode(t, context->method));
|
||||||
|
++i)
|
||||||
|
{
|
||||||
|
frame2.clear(localSize(t, context->method) + i);
|
||||||
|
}
|
||||||
|
|
||||||
|
compile(t, &frame2, exceptionHandlerIp(eh));
|
||||||
|
if (UNLIKELY(t->exception)) return 0;
|
||||||
|
|
||||||
|
eventIndex = calculateFrameMaps(t, context, 0, eventIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
frame2.pushObject();
|
assert(t, progress);
|
||||||
|
|
||||||
for (unsigned i = 1;
|
|
||||||
i < codeMaxStack(t, methodCode(t, context->method));
|
|
||||||
++i)
|
|
||||||
{
|
|
||||||
frame2.clear(localSize(t, context->method) + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
compile(t, &frame2, exceptionHandlerIp(eh));
|
|
||||||
if (UNLIKELY(t->exception)) return 0;
|
|
||||||
|
|
||||||
eventIndex = calculateFrameMaps(t, context, 0, eventIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user