;;; If FUN has no physical environment, assign one, otherwise clean up
;;; the old physical environment, removing/flagging variables that
;;; have no sets or refs. If a var has no references, we remove it
-;;; from the closure. If it has no sets, we clear the INDIRECT flag.
-;;; This is necessary because pre-analysis is done before
-;;; optimization.
+;;; from the closure. We always clear the INDIRECT flag. This is
+;;; necessary because pre-analysis is done before optimization.
(defun reinit-lambda-physenv (fun)
(let ((old (lambda-physenv (lambda-home fun))))
(cond (old
(physenv-closure old)))
(flet ((clear (fun)
(dolist (var (lambda-vars fun))
- (unless (lambda-var-sets var)
- (setf (lambda-var-indirect var) nil)))))
+ (setf (lambda-var-indirect var) nil))))
(clear fun)
(map nil #'clear (lambda-lets fun))))
(t
(let ((set-physenv (get-node-physenv set)))
(unless (eq set-physenv physenv)
- (setf did-something t
+ (setf did-something t
(lambda-var-indirect var) t)
(close-over var set-physenv physenv))))))
did-something))
;;; the component tail.
;;; -- Close over the NLX-INFO in the exit environment.
;;; -- If the exit is from an :ESCAPE function, then substitute a
-;;; constant reference to NLX-Info structure for the escape
+;;; constant reference to NLX-INFO structure for the escape
;;; function reference. This will cause the escape function to
;;; be deleted (although not removed from the DFO.) The escape
;;; function is no longer needed, and we don't want to emit code
(when ret
(let ((result (return-result ret)))
(do-uses (use result)
- (when (and (policy use
- (or (> space debug)
- (> speed debug)))
+ (when (and (policy use merge-tail-calls)
(immediately-used-p result use)
(or (not (eq (node-derived-type use) *empty-type*))
(not (basic-combination-p use))