gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: serveral bugs in codebase


From: Camm Maguire
Subject: [Gcl-devel] Re: serveral bugs in codebase
Date: 27 Jul 2003 21:44:13 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi Tim!  Are you perhaps referring to the email on this issue I sent
earlier?

In any case, I've made some progress here (compiling with safety 3).
Two issues:

1) There is still some large call to (apply #'append ....) somewhere
   that is exceeding the 63 maximum argument limit david noted
   earlier.  Just experimenting, axiom appears to need more than twice
   this value, but 4x appears to work.  The portable way to fix this
   is just to write out the large switch statement in c_apply_n in
   eval.c.  

   Until I make up my mind on the best thing to do here, you can
   'play' if you like with what I'm running at the moment.  3 of the
   11 Debian platforms support the cdecl calling convention, which
   allows for generic unlimited argument passing.  This won't work on
   the others, but maybe there is an answer there too.  Sure is better
   than the enormous switch statement.  Here is a patch which will
   allow unlimited argument passing in c_apply_n, and 4x space in
   apply (this latter can easily be made unlimited too.):

--- ../../../../../../../gcl-2.5.4/o/funlink.c  Sat Mar  1 17:37:37 2003
+++ funlink.c   Sun Jul 27 20:13:39 2003
@@ -243,9 +243,19 @@
 #define LCAST(a) (*a)
 /*  #endif */
 
+#define ELLIPTIC_CALL
+
 object
 c_apply_n(object (*fn)(), int n, object *x)
 {object res=Cnil;
+#ifdef ELLIPTIC_CALL
+ object *stack;
+
+ if (!(stack=alloca(n*sizeof(*stack))))
+   FEerror("Cannot alloca stack for elliptic call", 0);
+ memcpy(stack,x,n*sizeof(*stack));
+ res=fn();
+#else
  switch(n){
     case 0:  res=LCAST(fn)();break;
     case 1:  res=LCAST(fn)(x[0]);break;
@@ -566,6 +576,7 @@
          x[57],x[58],x[59],x[60],x[61],x[62],x[63]);break;
   default: FEerror("Exceeded call-arguments-limit ",0);
   } 
+#endif
 
  return res;
 }
--- ../../../../../../../gcl-2.5.4/o/eval.c     Fri Feb 14 19:38:28 2003
+++ eval.c      Sun Jul 27 20:13:51 2003
@@ -1147,7 +1147,7 @@
        ,2,MAX_ARGS,NONE,OO,OO,OO,OO,void,Lapply,(object fun,...),"")
 {      int m,n=VFUN_NARGS;
        object list;
-       object buf[MAX_ARGS];
+       object buf[4*MAX_ARGS];
        object *base=buf;
        va_list ap;
        va_start(ap,fun);
@@ -1159,7 +1159,7 @@
        list = va_arg(ap,object);
        va_end(ap);
        while (!endp(list))
-         { if (m >= MAX_ARGS) FEerror(" Lisps arglist maximum surpassed",0);
+         { if (m >= 4*MAX_ARGS) FEerror(" Lisps arglist maximum surpassed",0);
            *base++ = Mcar(list);
            list = Mcdr(list);
            m++;}


2) |data| is unbound in compCapsuleItems in define.boot.pamphlet.  I'm
         assuming Juergen is right here and you need

--- ../../../../../axiom2/new/new/src/interp/define.boot.pamphlet       Sat Dec 
21 17:14:36 2002
+++ define.boot.pamphlet        Sun Jul 27 20:23:03 2003
@@ -1193,7 +1193,7 @@
  
 compCapsuleItems(itemlist,$predl,$e) ==
   $TOP__LEVEL: local
-  $myFunctorBody :local := data    ---needed for translator
+  $myFunctorBody :local -- := data    ---needed for translator
   $signatureOfForm: local
   $suffix: local:= 0
   for item in itemlist repeat $e:= compSingleCapsuleItem(item,$predl,$e)

3) Is the 'set' command you supplied supposed to be invoked in
   interpsys?  What is the exact simpler 'one?' command referred to by
   Juergen?

take care,



root <address@hidden> writes:

> Juergen,
> 
> The safety 3 idea is a good one. I'll look further into how Axiom
> manipulates that. It should help up clean up the code quite a bit.
> 
> Tim
> address@hidden
> address@hidden
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]