exception handling and parseMethodTable() bugfixes

This commit is contained in:
Joel Dice 2007-07-24 19:56:05 -06:00
parent 97aaa419b4
commit 6b0792c881
5 changed files with 11 additions and 9 deletions

View File

@ -16,7 +16,7 @@ src = src
classpath = classpath classpath = classpath
test = test test = test
input = $(cls)/Hello.class input = $(cls)/Threads.class
cxx = g++ cxx = g++
cc = gcc cc = gcc

View File

@ -967,7 +967,7 @@ parseMethodTable(Thread* t, Stream& s, object class_, object pool)
if (p) { if (p) {
set(t, tripleSecond(t, p), method); set(t, tripleSecond(t, p), method);
} else { } else {
hashMapInsert(t, virtualMap, method, 0, methodHash); hashMapInsert(t, nativeMap, method, 0, methodHash);
} }
} }

View File

@ -22,7 +22,7 @@
namespace vm { namespace vm {
const bool Verbose = false; const bool Verbose = false;
const bool DebugRun = true; const bool DebugRun = false;
const bool DebugStack = false; const bool DebugStack = false;
const bool DebugMonitors = false; const bool DebugMonitors = false;

View File

@ -2131,11 +2131,7 @@ run(Thread* t)
} }
pokeInt(t, t->frame + FrameIpOffset, t->ip); pokeInt(t, t->frame + FrameIpOffset, t->ip);
for (; frame >= 0; frame = frameNext(t, frame)) { for (; frame >= base; popFrame(t)) {
if (frame < base) {
return 0;
}
code = methodCode(t, frameMethod(t, frame)); code = methodCode(t, frameMethod(t, frame));
object eht = codeExceptionHandlerTable(t, code); object eht = codeExceptionHandlerTable(t, code);
if (eht) { if (eht) {
@ -2152,9 +2148,15 @@ run(Thread* t)
} }
if (catchType) { if (catchType) {
object e = exception;
exception = 0;
PROTECT(t, e);
PROTECT(t, eht); PROTECT(t, eht);
catchType = resolveClass(t, catchType); catchType = resolveClass(t, catchType);
eh = exceptionHandlerTableBody(t, eht, i); eh = exceptionHandlerTableBody(t, eht, i);
exception = e;
} }
if (catchType == 0 or instanceOf(t, catchType, exception)) { if (catchType == 0 or instanceOf(t, catchType, exception)) {

View File

@ -212,7 +212,7 @@ class MySystem: public System {
} }
virtual void dispose() { virtual void dispose() {
//assert(s, context == 0); assert(s, context == 0);
pthread_mutex_destroy(&mutex); pthread_mutex_destroy(&mutex);
pthread_cond_destroy(&condition); pthread_cond_destroy(&condition);
s->free(this); s->free(this);