From 141862470b307decb5920d21a1f691044a6f18f6 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 25 Apr 2009 17:33:42 -0600 Subject: [PATCH] fix stack pointer adjustment in invokeNative2; pad frame size using Architecture::frameFootprint in MyProcessor::invoke to conform to new calling convention --- src/compile.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); }