[armedbear-cvs] r11614 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Jan 31 22:43:41 UTC 2009


Author: ehuelsmann
Date: Sat Jan 31 22:43:40 2009
New Revision: 11614

Log:
Inline all compiled subtractions instead of only the 2 and 3 argument cases.

Modified:
   trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp	Sat Jan 31 22:43:40 2009
@@ -6905,6 +6905,9 @@
 
 (defun p2-minus (form target representation)
   (case (length form)
+    (1
+     ;; generates "Insufficient arguments" error
+     (compile-function-call form target representation))
     (2
      (let* ((arg (%cadr form))
             (type (derive-compiler-type form))
@@ -6967,12 +6970,9 @@
               (emit-move-from-stack target representation))
              (t
               (compile-binary-operation "subtract" args target representation)))))
-    (4
-     ;; (- a b c) => (- (- a b) c)
-     (let ((new-form `(- (- ,(second form) ,(third form)) ,(fourth form))))
-       (p2-minus new-form target representation)))
     (t
-     (compile-function-call form target representation))))
+     (let ((new-form `(- (- ,(second form) ,(third form)) ,@(nthcdr 3 form))))
+       (p2-minus new-form target representation)))))
 
 ;; char/schar string index => character
 (defknown p2-char/schar (t t t) t)




More information about the armedbear-cvs mailing list