From 14613193fa5a8b0887f771003638d90f86bd9d8c Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 28 May 2009 19:50:44 -0600 Subject: [PATCH] include return address size in frameSize passed to vmInvoke; fix printf warnings --- src/common.h | 2 +- src/compile.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/common.h b/src/common.h index 94d351d5d3..c3c03e89c4 100644 --- a/src/common.h +++ b/src/common.h @@ -288,7 +288,7 @@ bitsToFloat(uint32_t bits) return f; } -inline intptr_t +inline int difference(void* a, void* b) { return reinterpret_cast(a) - reinterpret_cast(b); diff --git a/src/compile.cpp b/src/compile.cpp index 8d51a80b5c..f43f2f5623 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -5412,7 +5412,8 @@ jumpAndInvoke(MyThread* t, object method, void* base, void* stack, ...) stack, argumentCount * BytesPerWord, arguments, - t->arch->alignFrameSize(t->arch->argumentFootprint(argumentCount)) + (t->arch->alignFrameSize(t->arch->argumentFootprint(argumentCount)) + + t->arch->frameReturnAddressSize()) * BytesPerWord); } @@ -5922,11 +5923,11 @@ class MyProcessor: public Processor { t->init(); if (false) { - fprintf(stderr, "%"LD"\n", difference(&(t->continuation), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exception), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exceptionStackAdjustment), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exceptionOffset), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exceptionHandler), t)); + fprintf(stderr, "%d\n", difference(&(t->continuation), t)); + fprintf(stderr, "%d\n", difference(&(t->exception), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionStackAdjustment), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionOffset), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionHandler), t)); exit(0); }