X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Flocall.lisp;h=4e18af7caf0b5e02a1904c33ec332fd3921c6d80;hb=2ad50715571eb8ccfb9ab55c13b8c038c89f2dfd;hp=b6d52c2e9c986bd2ea210a725c387429d2609ff9;hpb=edb7acf8d242c0398ec33924e21c85dc54bc768d;p=sbcl.git diff --git a/src/compiler/locall.lisp b/src/compiler/locall.lisp index b6d52c2..4e18af7 100644 --- a/src/compiler/locall.lisp +++ b/src/compiler/locall.lisp @@ -163,9 +163,7 @@ ,(if (policy *lexenv* (zerop verify-arg-count)) `(declare (ignore ,n-supplied)) `(%verify-arg-count ,n-supplied ,nargs)) - (locally - (declare (optimize (merge-tail-calls 3))) - (%funcall ,fun ,@temps))))) + (%funcall ,fun ,@temps)))) (optional-dispatch (let* ((min (optional-dispatch-min-args fun)) (max (optional-dispatch-max-args fun)) @@ -190,9 +188,7 @@ ,(with-unique-names (n-context n-count) `(multiple-value-bind (,n-context ,n-count) (%more-arg-context ,n-supplied ,max) - (locally - (declare (optimize (merge-tail-calls 3))) - (%funcall ,more ,@temps ,n-context ,n-count))))))) + (%funcall ,more ,@temps ,n-context ,n-count)))))) (t (%arg-count-error ,n-supplied))))))))) @@ -683,6 +679,22 @@ (call-args t))) (:rest (call-args `(list ,@more-temps)) + ;; &REST arguments may be accompanied by extra + ;; context and count arguments. We know this by + ;; the ARG-INFO-DEFAULT. Supply NIL and 0 or + ;; don't convert at all depending. + (let ((more (arg-info-default info))) + (when more + (unless (eq t more) + (destructuring-bind (context count &optional used) more + (declare (ignore context count)) + (when used + ;; We've already converted to use the more context + ;; instead of the rest list. + (return-from convert-more-call)))) + (call-args nil) + (call-args 0) + (setf (arg-info-default info) t))) (return)) (:keyword (return)))