[kaffe] inlining sysdepCallMethod for m68k-linux (was: Re: NEED_sysdepCallMethod)

Kiyo Inaba inaba at src.ricoh.co.jp
Mon Apr 19 21:23:03 PDT 2004


According to Dalibor's suggestion, I modified to use inline but still

---------------------------------------------------------------------
../../../config/../../kaffe-snap-040408/config/m68k/linux/md.h: In function `sysdepCallMethod':
In file included from ../../../config/md.h:1,
                 from ../../../../kaffe-snap-040408/kaffe/kaffevm/jit/../classMethod.h:18,
                 from ../../../../kaffe-snap-040408/kaffe/kaffevm/jit/labels.c:15:
../../../config/../../kaffe-snap-040408/config/m68k/linux/md.h:55: warning: function using alloca cannot be inline
---------------------------------------------------------------------

with the patch
---------------------------------------------------------------------
diff -Naur kaffe-snap-040408.orig/config/m68k/linux/md.h kaffe-snap-040408/config/m68k/linux/md.h
--- kaffe-snap-040408.orig/config/m68k/linux/md.h       2004-03-10 00:15:35.000000000 +0900
+++ kaffe-snap-040408/config/m68k/linux/md.h    2004-04-20 10:53:04.000000000 +0900
@@ -53,14 +53,16 @@
 //     Linux version
 static inline void sysdepCallMethod(callMethodInfo *call)
 {
-       int extraargs[(call)->nrargs];
        register int d0 asm ("d0");
        register int d1 asm ("d1");
        register double f0d asm ("fp0");
        register float f0f asm ("fp0");
        int *res;
-       int *args = extraargs;
+       int *args;
        int argidx;
+
+       args = __builtin_alloca (sizeof(int) * ((call)->nrargs));
+
        for(argidx = 0; argidx < (call)->nrargs; ++argidx) {
                if ((call)->callsize[argidx])
                        *args++ = (call)->args[argidx].i;
---------------------------------------------------------------------

I am wondering this comes from relatively old compiler like
---------------------------------------------------------------------
$ gcc -v
Reading specs from /usr/lib/gcc-lib/m68k-linux/2.7.2.3/specs
gcc version 2.7.2.3
---------------------------------------------------------------------

But this is the default for Debian Slink (at least for m68k).

Kiyo






More information about the kaffe mailing list