X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Flocall.lisp;h=97372d3b18e9bf39601112402026b3cdd267dd5f;hb=de3bfc084239fa962ef001eaa68e5b6f4b9bbf81;hp=9e605c1e430d836f983b022c262483120f44040e;hpb=e8011f7c83587a9dc1b13281d0cc974bb0b054be;p=sbcl.git diff --git a/src/compiler/locall.lisp b/src/compiler/locall.lisp index 9e605c1..97372d3 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))))))))) @@ -685,7 +681,7 @@ (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 + ;; the ARG-INFO-DEFAULT. Supply 0 and 0 or ;; don't convert at all depending. (let ((more (arg-info-default info))) (when more @@ -696,7 +692,7 @@ ;; 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) (call-args 0) (setf (arg-info-default info) t))) (return)) @@ -716,7 +712,8 @@ (convert-hairy-fun-entry ref call (optional-dispatch-main-entry fun) (append temps more-temps) (ignores) (call-args) - more-temps)))) + (when (optional-rest-p fun) + more-temps))))) (values)) @@ -1032,7 +1029,13 @@ ;; with anonymous things, and suppressing inlining ;; for such things can easily give Python acute indigestion, so ;; we don't.) - (when (leaf-has-source-name-p clambda) + ;; + ;; A functional that is already inline-expanded in this componsne definitely + ;; deserves let-conversion -- and in case of main entry points for inline + ;; expanded optional dispatch, the main-etry isn't explicitly marked :INLINE + ;; even if the function really is. + (when (and (leaf-has-source-name-p clambda) + (not (functional-inline-expanded clambda))) ;; ANSI requires that explicit NOTINLINE be respected. (or (eq (lambda-inlinep clambda) :notinline) ;; If (= LET-CONVERSION 0) we can guess that inlining