From af59c85deb02a6554cfa2114573f5edb207fdc4a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 24 May 2009 18:22:36 -0600 Subject: [PATCH] various bugfixes --- src/compile-x86.S | 8 ++++---- src/compile.cpp | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/compile-x86.S b/src/compile-x86.S index a16753d007..d52d3ac68f 100644 --- a/src/compile-x86.S +++ b/src/compile-x86.S @@ -255,9 +255,9 @@ vmInvoke_returnAddress: je LOCAL(vmInvoke_exit) movl CONTINUATION_LENGTH(%ecx),%esi - shll $3,%esi + shll $2,%esi subl %esi,%esp - subl $48,%esp + subl $16,%esp leal CONTINUATION_BODY(%ecx),%edi @@ -269,8 +269,8 @@ vmInvoke_returnAddress: LOCAL(vmInvoke_continuationLoop): movl (%edi,%edx,1),%eax - movl %eax,(%esp,%edx,1) - addl $8,%edx + movl %eax,8(%esp,%edx,1) + addl $4,%edx LOCAL(vmInvoke_continuationTest): cmpl %esi,%edx diff --git a/src/compile.cpp b/src/compile.cpp index 8ae1b2c020..29eaac78c1 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -5476,6 +5476,12 @@ callContinuation(MyThread* t, object continuation, object result, if (method) { rewindMethod(t) = method; + + compile(t, ::codeAllocator(t), 0, method); + + if (UNLIKELY(t->exception)) { + action = Throw; + } } else { object message = makeString (t, "%s %s not found in %s", @@ -5795,6 +5801,15 @@ class MyProcessor: public Processor { MyThread(m, javaThread, static_cast(parent)); t->init(); + if (false) { + fprintf(stderr, "%d\n", difference(&(t->continuation), t)); + fprintf(stderr, "%d\n", difference(&(t->exception), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionStack), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionOffset), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionHandler), t)); + exit(0); + } + return t; } @@ -6268,11 +6283,13 @@ class MyProcessor: public Processor { const char* const methodName = "wind"; const char* const methodSpec = "(Ljava/lang/Runnable;Ljava/util/concurrent/Callable;" - "Ljava/lang/Runnable;)Ljava/lang/Object;"; + "Ljava/lang/Runnable;)Lavian/Continuations$UnwindResult;"; windMethod = resolveMethod(t, className, methodName, methodSpec); - if (windMethod == 0) { + if (windMethod) { + compile(t, ::codeAllocator(t), 0, windMethod); + } else { object message = makeString (t, "%s %s not found in %s", methodName, methodSpec, className); t->exception = makeNoSuchMethodError(t, message);