diff --git a/src/compile.cpp b/src/compile.cpp index 3d2457869a..3bd85c34fa 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -4836,16 +4836,17 @@ invokeNative2(MyThread* t, object method) default: abort(t); } - if (t->arch->argumentFootprint(footprint) + unsigned parameterFootprint = methodParameterFootprint(t, method); + if (t->arch->argumentFootprint(parameterFootprint) > t->arch->stackAlignmentInWords()) { t->stack = static_cast(t->stack) - + (t->arch->argumentFootprint(footprint) + + (t->arch->argumentFootprint(parameterFootprint) - t->arch->stackAlignmentInWords()); } t->stack = static_cast(t->stack) - - t->arch->frameReturnAddressSize(); + + t->arch->frameReturnAddressSize(); } else { result = 0; } @@ -5139,7 +5140,8 @@ invoke(Thread* thread, object method, ArgumentList* arguments) (t, reinterpret_cast(methodAddress(t, method)), arguments->array + arguments->position, count * BytesPerWord, - t->arch->alignFrameSize(count) * BytesPerWord, + t->arch->alignFrameSize(count + t->arch->frameFootprint(0)) + * BytesPerWord, returnType); }