[kaffe] CVS kaffe (guilhem): Important fix for sysdepCallMethod.
Kaffe CVS
cvs-commits at kaffe.org
Fri Jun 17 05:29:50 PDT 2005
PatchSet 6647
Date: 2005/06/17 12:24:19
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
Important fix for sysdepCallMethod.
* kaffe/kaffevm/support.c
(KaffeVM_callMethodA, KaffeVM_callMethodV):
Allocate the argument array following the real slot allocation given
by methodSigInfo. This may not be sufficient for architecture which
needs alignment of the slots.
Define NEED_sysdepCallMethod to get specific argument reordering
except if we use ffi.
Members:
ChangeLog:1.4173->1.4174
kaffe/kaffevm/support.c:1.85->1.86
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4173 kaffe/ChangeLog:1.4174
--- kaffe/ChangeLog:1.4173 Wed Jun 15 15:35:24 2005
+++ kaffe/ChangeLog Fri Jun 17 12:24:19 2005
@@ -1,3 +1,14 @@
+2005-06-17 Guilhem Lavaux <guilhem at kaffe.org>
+
+ * kaffe/kaffevm/support.c
+ (KaffeVM_callMethodA, KaffeVM_callMethodV):
+ Allocate the argument array following the real slot allocation given
+ by methodSigInfo. This may not be sufficient for architecture which
+ needs alignment of the slots.
+
+ Define NEED_sysdepCallMethod to get specific argument reordering
+ except if we use ffi.
+
2005-06-15 Guilhem Lavaux <guilhem at kaffe.org>
* test/regression/Makefile.am: Added DoubleIEEE.
Index: kaffe/kaffe/kaffevm/support.c
diff -u kaffe/kaffe/kaffevm/support.c:1.85 kaffe/kaffe/kaffevm/support.c:1.86
--- kaffe/kaffe/kaffevm/support.c:1.85 Wed Jun 1 20:14:52 2005
+++ kaffe/kaffe/kaffevm/support.c Fri Jun 17 12:24:23 2005
@@ -11,6 +11,11 @@
#include "debug.h"
#include "config.h"
+
+#if !defined(HAVE_LIBFFI)
+#define NEED_sysdepCallMethod 1
+#endif
+
#include "config-std.h"
#include "config-mem.h"
#include "jni.h"
@@ -372,18 +377,24 @@
int i;
int j;
int s;
+ int numArgs;
callMethodInfo call;
jvalue tmp;
if (ret == 0) {
ret = &tmp;
}
+ if (!NO_HOLES)
+ numArgs = sizeofSigMethod(meth, false);
+ else
+ numArgs = METHOD_NARGS(meth);
+
i = engine_reservedArgs(meth);
s = 0;
- call.args = (jvalue *)alloca((METHOD_NARGS(meth)+engine_reservedArgs(meth)+2)*(sizeof(jvalue)+2));
- call.callsize = (char *)&call.args[METHOD_NARGS(meth)+engine_reservedArgs(meth)+2];
- call.calltype = (char *)&call.callsize[METHOD_NARGS(meth)+engine_reservedArgs(meth)+2];
+ call.args = (jvalue *)alloca((numArgs+engine_reservedArgs(meth)+2)*(sizeof(jvalue)+2));
+ call.callsize = (char *)&call.args[numArgs+engine_reservedArgs(meth)+2];
+ call.calltype = (char *)&call.callsize[numArgs+engine_reservedArgs(meth)+2];
/* If this method isn't static, we must insert the object as
* an argument.
@@ -551,16 +562,22 @@
int j;
callMethodInfo call;
jvalue tmp;
+ int numArgs;
if (ret == 0) {
ret = &tmp;
}
i = engine_reservedArgs(meth);
s = 0;
-
- call.args = (jvalue *)alloca((METHOD_NARGS(meth)+engine_reservedArgs(meth)+2)*(sizeof(jvalue)+2));
- call.callsize = (char *)&call.args[METHOD_NARGS(meth)+engine_reservedArgs(meth)+2];
- call.calltype = (char *)&call.callsize[METHOD_NARGS(meth)+engine_reservedArgs(meth)+2];
+
+ if (!NO_HOLES)
+ numArgs = sizeofSigMethod(meth, false);
+ else
+ numArgs = METHOD_NARGS(meth);
+
+ call.args = (jvalue *)alloca((numArgs+engine_reservedArgs(meth)+2)*(sizeof(jvalue)+2));
+ call.callsize = (char *)&call.args[numArgs+engine_reservedArgs(meth)+2];
+ call.calltype = (char *)&call.callsize[numArgs+engine_reservedArgs(meth)+2];
/* If this method isn't static, we must insert the object as
* the first argument and get the function code.
@@ -606,6 +623,7 @@
call.args[i+1].i = (&call.args[i].i)[1];
i++;
call.callsize[i] = 0;
+ call.calltype[i] = 0;
}
break;
case '[':
More information about the kaffe
mailing list