0.7.5.8:
authorWilliam Harold Newman <william.newman@airmail.net>
Thu, 11 Jul 2002 00:59:30 +0000 (00:59 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Thu, 11 Jul 2002 00:59:30 +0000 (00:59 +0000)
tweaked MAKE-XEP so that its output is compiled with tail call
elimination
(I'll probably revisit this later to do similar tricks on
other machinery like "varargs entry for ...", but even
without that this little hack seems to be worth
checking in.)

src/compiler/locall.lisp
src/compiler/physenvanal.lisp
version.lisp-expr

index d796d01..9846de7 100644 (file)
          ,(if (policy *lexenv* (zerop safety))
               `(declare (ignore ,n-supplied))
               `(%verify-arg-count ,n-supplied ,nargs))
-         (%funcall ,fun ,@temps))))
+         (locally
+           ;; KLUDGE: The intent here is to enable tail recursion
+           ;; optimization, since leaving frames for wrapper
+           ;; functions like this on the stack is actually more
+           ;; annoying than helpful for debugging. Unfortunately
+           ;; trying to express this by messing with the
+           ;; ANSI-standard declarations is a little awkward, since
+           ;; no matter how we do it we'll tend to have side-effects
+           ;; on things like SPEED-vs.-SAFETY comparisons. Perhaps
+           ;; it'd be better to define a new SB-EXT:TAIL-RECURSIVELY
+           ;; declaration and use that? -- WHN 2002-07-08
+           (declare (optimize (speed 2) (debug 1)))
+           (%funcall ,fun ,@temps)))))
     (optional-dispatch
      (let* ((min (optional-dispatch-min-args fun))
            (max (optional-dispatch-max-args fun))
                           (n-count (gensym)))
                       `(multiple-value-bind (,n-context ,n-count)
                            (%more-arg-context ,n-supplied ,max)
-                         (%funcall ,more ,@temps ,n-context ,n-count))))))
+                         (locally
+                           ;; KLUDGE: As above, we're trying to
+                           ;; enable tail recursion optimization and
+                           ;; any other effects of this declaration
+                           ;; are accidental. -- WHN 2002-07-08
+                           (declare (optimize (speed 2) (debug 1)))
+                           (%funcall ,more ,@temps ,n-context ,n-count)))))))
             (t
              (%arg-count-error ,n-supplied)))))))))
 
index 120133f..ca8d927 100644 (file)
              (emit-cleanups block1 block2)))))))
   (values))
 
-;;; Mark optimizable tail-recursive uses of function result continuations with
-;;; the corresponding TAIL-SET. 
+;;; Mark optimizable tail-recursive uses of function result
+;;; continuations with the corresponding TAIL-SET.
 (defun tail-annotate (component)
   (declare (type component component))
   (dolist (fun (component-lambdas component))
index ac502fc..5519d70 100644 (file)
@@ -18,4 +18,4 @@
 ;;; for internal versions, especially for internal versions off the
 ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.5.7"
+"0.7.5.8"