[Ecls-list] experimental patch for review (unboxed functions and some misc socket fixes)

Brian Spilsbury brian.spilsbury at gmail.com
Sat Aug 25 19:55:28 UTC 2007


Second Draft

This replaces the previous, except for the file/tcp stuff.

This is closer to what I think should happen, but not perfect.

It only unboxed required arguments, and the boxed version doesn't call
the unboxed version unless recursive.

It gets the difference between lisp and representation types
right, though -- so you could potentially have the lisp type
as fixnum and the representation type as :object, or so on.

What do you think?

Regards,
Brian.

----

(declaim (ftype (function (fixnum fixnum) fixnum) test3)
         (si::c-unboxed ("test3" (:fixnum :fixnum) :fixnum) test3))

(defun test3 (a b)
  (declare (si::c-unboxed ("test3" (:fixnum :fixnum) :fixnum))
           (type fixnum a b))
  (the fixnum (+ a b)))

(defun test4 ()
  (test3 1 2))

---- produces

/*      function definition for TEST3                                 */
static cl_object L1test3(cl_object V1, cl_object V2)
{ VT2 VLEX2 CLSR2
        cl_object value0;
        {
        cl_fixnum V3;
        cl_fixnum V4;
        V3= ecl_to_fixnum(V1);
        V4= ecl_to_fixnum(V2);
TTL:
        value0=ecl_plus(MAKE_FIXNUM(V3),MAKE_FIXNUM(V4)); NVALUES=1;
        return value0;
        }
}
/*      function definition for TEST3                                 */
cl_fixnum test3(cl_fixnum V1, cl_fixnum V2)
{ VT3 VLEX3 CLSR3
        cl_object value0;
        {
        cl_fixnum V3;
        cl_fixnum V4;
        V3= V1;
        V4= V2;
TTL:
        NVALUES = 1; return((V3)+(V4));
        }
}
/*      function definition for TEST4                                 */
static cl_object L2test4()
{ VT4 VLEX4 CLSR4
        cl_object value0;
        {
TTL:
        value0=MAKE_FIXNUM(test3(1,2)             /*  TEST3
                */);
        return value0;
        }
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unboxed-v2.patch
Type: application/octet-stream
Size: 19397 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20070826/999bf4cc/attachment.obj>


More information about the ecl-devel mailing list