move local reference cleanup from invoke() to invokeNative2(), where it belonged all along

This commit is contained in:
Joel Dice 2008-02-01 14:17:54 -07:00
parent 55e3e8871d
commit 2346714d60

View File

@ -4015,6 +4015,8 @@ invokeNative2(MyThread* t, object method)
} }
} }
Reference* reference = t->reference;
{ ENTER(t, Thread::IdleState); { ENTER(t, Thread::IdleState);
result = t->m->system->call result = t->m->system->call
@ -4044,34 +4046,47 @@ invokeNative2(MyThread* t, object method)
switch (returnCode) { switch (returnCode) {
case ByteField: case ByteField:
case BooleanField: case BooleanField:
return static_cast<int8_t>(result); result = static_cast<int8_t>(result);
break;
case CharField: case CharField:
return static_cast<uint16_t>(result); result = static_cast<uint16_t>(result);
break;
case ShortField: case ShortField:
return static_cast<int16_t>(result); result = static_cast<int16_t>(result);
break;
case FloatField: case FloatField:
case IntField: case IntField:
return static_cast<int32_t>(result); result = static_cast<int32_t>(result);
break;
case LongField: case LongField:
case DoubleField: case DoubleField:
return result; result = result;
break;
case ObjectField: case ObjectField:
return static_cast<uintptr_t>(result) ? *reinterpret_cast<uintptr_t*> result = static_cast<uintptr_t>(result) ? *reinterpret_cast<uintptr_t*>
(static_cast<uintptr_t>(result)) : 0; (static_cast<uintptr_t>(result)) : 0;
break;
case VoidField: case VoidField:
return 0; result = 0;
break;
default: abort(t); default: abort(t);
} }
} else { } else {
return 0; result = 0;
} }
while (t->reference != reference) {
dispose(t, t->reference);
}
return result;
} }
uint64_t FORCE_ALIGN uint64_t FORCE_ALIGN
@ -4330,7 +4345,6 @@ invoke(Thread* thread, object method, ArgumentList* arguments)
unsigned returnCode = methodReturnCode(t, method); unsigned returnCode = methodReturnCode(t, method);
unsigned returnType = fieldType(t, returnCode); unsigned returnType = fieldType(t, returnCode);
Reference* reference = t->reference;
uint64_t result; uint64_t result;
{ MyThread::CallTrace trace(t); { MyThread::CallTrace trace(t);
@ -4340,10 +4354,6 @@ invoke(Thread* thread, object method, ArgumentList* arguments)
arguments->position, returnType); arguments->position, returnType);
} }
while (t->reference != reference) {
dispose(t, t->reference);
}
object r; object r;
switch (returnCode) { switch (returnCode) {
case ByteField: case ByteField: