From 2346714d607cc434201b473d28503a6c5b6b7e43 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 1 Feb 2008 14:17:54 -0700 Subject: [PATCH] move local reference cleanup from invoke() to invokeNative2(), where it belonged all along --- src/compile.cpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index 837b299b3d..91fe83ce81 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -4015,6 +4015,8 @@ invokeNative2(MyThread* t, object method) } } + Reference* reference = t->reference; + { ENTER(t, Thread::IdleState); result = t->m->system->call @@ -4044,34 +4046,47 @@ invokeNative2(MyThread* t, object method) switch (returnCode) { case ByteField: case BooleanField: - return static_cast(result); + result = static_cast(result); + break; case CharField: - return static_cast(result); + result = static_cast(result); + break; case ShortField: - return static_cast(result); + result = static_cast(result); + break; case FloatField: case IntField: - return static_cast(result); + result = static_cast(result); + break; case LongField: case DoubleField: - return result; + result = result; + break; case ObjectField: - return static_cast(result) ? *reinterpret_cast + result = static_cast(result) ? *reinterpret_cast (static_cast(result)) : 0; + break; case VoidField: - return 0; + result = 0; + break; default: abort(t); } } else { - return 0; + result = 0; } + + while (t->reference != reference) { + dispose(t, t->reference); + } + + return result; } uint64_t FORCE_ALIGN @@ -4330,7 +4345,6 @@ invoke(Thread* thread, object method, ArgumentList* arguments) unsigned returnCode = methodReturnCode(t, method); unsigned returnType = fieldType(t, returnCode); - Reference* reference = t->reference; uint64_t result; { MyThread::CallTrace trace(t); @@ -4340,10 +4354,6 @@ invoke(Thread* thread, object method, ArgumentList* arguments) arguments->position, returnType); } - while (t->reference != reference) { - dispose(t, t->reference); - } - object r; switch (returnCode) { case ByteField: