fix merge fallout (take 2)

This commit is contained in:
Joel Dice 2013-02-22 14:54:13 -07:00
parent 5e65468fef
commit b32dfb674c

View File

@ -4656,86 +4656,6 @@ jvmInvokeMethod(Thread* t, uintptr_t* arguments)
(t, jclassVmClass(t, jmethodClazz(t, *method))),
jmethodSlot(t, *method));
<<<<<<< HEAD
=======
if (methodFlags(t, vmMethod) & ACC_STATIC) {
instance = 0;
}
if ((args == 0 ? 0 : objectArrayLength(t, *args))
!= methodParameterCount(t, vmMethod))
{
throwNew(t, Machine::IllegalArgumentExceptionType);
}
if (methodParameterCount(t, vmMethod)) {
PROTECT(t, vmMethod);
unsigned specLength = byteArrayLength(t, methodSpec(t, vmMethod));
THREAD_RUNTIME_ARRAY(t, char, spec, specLength);
memcpy(RUNTIME_ARRAY_BODY(spec),
&byteArrayBody(t, methodSpec(t, vmMethod), 0), specLength);
unsigned i = 0;
for (MethodSpecIterator it(t, RUNTIME_ARRAY_BODY(spec)); it.hasNext();) {
object type;
bool objectType = false;
const char* p = it.next();
switch (*p) {
case 'Z': type = vm::type(t, Machine::BooleanType); break;
case 'B': type = vm::type(t, Machine::ByteType); break;
case 'S': type = vm::type(t, Machine::ShortType); break;
case 'C': type = vm::type(t, Machine::CharType); break;
case 'I': type = vm::type(t, Machine::IntType); break;
case 'F': type = vm::type(t, Machine::FloatType); break;
case 'J': type = vm::type(t, Machine::LongType); break;
case 'D': type = vm::type(t, Machine::DoubleType); break;
case 'L': ++ p;
case '[': {
objectType = true;
unsigned nameLength = it.s - p;
THREAD_RUNTIME_ARRAY(t, char, name, nameLength);
memcpy(RUNTIME_ARRAY_BODY(name), p, nameLength - 1);
RUNTIME_ARRAY_BODY(name)[nameLength - 1] = 0;
type = resolveClass
(t, classLoader(t, methodClass(t, vmMethod)),
RUNTIME_ARRAY_BODY(name));
} break;
default:
abort();
}
object arg = objectArrayBody(t, *args, i++);
if ((arg == 0 and (not objectType))
or (arg and (not instanceOf(t, type, arg))))
{
// fprintf(stderr, "%s is not a %s\n", arg ? &byteArrayBody(t, className(t, objectClass(t, arg)), 0) : reinterpret_cast<const int8_t*>("<null>"), &byteArrayBody(t, className(t, type), 0));
throwNew(t, Machine::IllegalArgumentExceptionType);
}
}
}
unsigned returnCode = methodReturnCode(t, vmMethod);
THREAD_RESOURCE0(t, {
if (t->exception) {
object exception = t->exception;
t->exception = makeThrowable
(t, Machine::InvocationTargetExceptionType, 0, 0, exception);
}
});
object result;
if (args) {
result = t->m->processor->invokeArray
(t, vmMethod, instance ? *instance : 0, *args);
} else {
result = t->m->processor->invoke(t, vmMethod, instance ? *instance : 0);
}
>>>>>>> github/master
return reinterpret_cast<uint64_t>
(makeLocalReference
(t, invoke