mirror of
https://github.com/corda/corda.git
synced 2025-01-01 02:36:44 +00:00
snapshot
This commit is contained in:
parent
68e382ca8d
commit
f7058f8fd6
712
src/compile.cpp
712
src/compile.cpp
File diff suppressed because it is too large
Load Diff
@ -682,6 +682,47 @@ populateMultiArray(Thread* t, object array, int32_t* counts,
|
||||
}
|
||||
}
|
||||
|
||||
ExceptionHandler*
|
||||
findExceptionHandler(Thread* t, object method)
|
||||
{
|
||||
object eht = codeExceptionHandlerTable(t, methodCode(t, method));
|
||||
|
||||
if (eht) {
|
||||
for (unsigned i = 0; i < exceptionHandlerTableLength(t, eht); ++i) {
|
||||
ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i);
|
||||
|
||||
if (frameIp(t, frame) - 1 >= exceptionHandlerStart(eh)
|
||||
and frameIp(t, frame) - 1 < exceptionHandlerEnd(eh))
|
||||
{
|
||||
object catchType = 0;
|
||||
if (exceptionHandlerCatchType(eh)) {
|
||||
object e = t->exception;
|
||||
exception = 0;
|
||||
PROTECT(t, e);
|
||||
|
||||
PROTECT(t, eht);
|
||||
catchType = resolveClass
|
||||
(t, codePool(t, code), exceptionHandlerCatchType(eh) - 1);
|
||||
|
||||
if (catchType) {
|
||||
eh = exceptionHandlerTableBody(t, eht, i);
|
||||
exception = e;
|
||||
} else {
|
||||
// can't find what we're supposed to catch - move on.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (catchType == 0 or instanceOf(t, catchType, t->exception)) {
|
||||
return eh;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
object
|
||||
interpret(Thread* t)
|
||||
{
|
||||
|
@ -145,48 +145,6 @@ resolveNativeMethod(Thread* t, object method)
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline ExceptionHandler*
|
||||
findExceptionHandler(Thread* t, object method)
|
||||
{
|
||||
object code = methodCode(t, method);
|
||||
object eht = codeExceptionHandlerTable(t, code);
|
||||
|
||||
if (eht) {
|
||||
for (unsigned i = 0; i < exceptionHandlerTableLength(t, eht); ++i) {
|
||||
ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i);
|
||||
|
||||
if (frameIp(t, frame) - 1 >= exceptionHandlerStart(eh)
|
||||
and frameIp(t, frame) - 1 < exceptionHandlerEnd(eh))
|
||||
{
|
||||
object catchType = 0;
|
||||
if (exceptionHandlerCatchType(eh)) {
|
||||
object e = t->exception;
|
||||
exception = 0;
|
||||
PROTECT(t, e);
|
||||
|
||||
PROTECT(t, eht);
|
||||
catchType = resolveClass
|
||||
(t, codePool(t, code), exceptionHandlerCatchType(eh) - 1);
|
||||
|
||||
if (catchType) {
|
||||
eh = exceptionHandlerTableBody(t, eht, i);
|
||||
exception = e;
|
||||
} else {
|
||||
// can't find what we're supposed to catch - move on.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (catchType == 0 or instanceOf(t, catchType, t->exception)) {
|
||||
return eh;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace vm
|
||||
|
||||
#endif//PROCESS_H
|
||||
|
@ -50,9 +50,12 @@
|
||||
(object spec)
|
||||
(object class)
|
||||
(object code)
|
||||
(object compiled))
|
||||
(void* compiled))
|
||||
|
||||
(type compiled
|
||||
(nogc object pool)
|
||||
(uint32_t lineNumbers)
|
||||
(uint32_t exceptionHandlers)
|
||||
(array uint8_t body))
|
||||
|
||||
(type nativeMethodData
|
||||
|
Loading…
Reference in New Issue
Block a user