X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fphysenvanal.lisp;h=e006827a52e7ffbd56c2a695d663b88706fbf344;hb=816c50a5589bcf756f67119e657ae348e4858357;hp=481ce2e35a38618d288933e83433fc1550d753e3;hpb=6dac5c9af52b4538b412b2e7c22b78863d85557a;p=sbcl.git diff --git a/src/compiler/physenvanal.lisp b/src/compiler/physenvanal.lisp index 481ce2e..e006827 100644 --- a/src/compiler/physenvanal.lisp +++ b/src/compiler/physenvanal.lisp @@ -334,15 +334,11 @@ (loop for what in (cleanup-info cleanup) do (etypecase what (lvar - (let* ((lvar what) - (use (lvar-uses lvar))) - (if (and (combination-p use) - (eq (basic-combination-kind use) :known) - (awhen (fun-info-stack-allocate-result - (basic-combination-fun-info use)) - (funcall it use))) - (real-dx-lvars lvar) - (setf (lvar-dynamic-extent lvar) nil)))) + (if (lvar-good-for-dx-p what t component) + (let ((real (principal-lvar what))) + (setf (lvar-dynamic-extent real) cleanup) + (real-dx-lvars real)) + (setf (lvar-dynamic-extent what) nil))) (node ; DX closure (let* ((call what) (arg (first (basic-combination-args call))) @@ -350,9 +346,9 @@ (dx nil)) (dolist (fun funs) (binding* ((() (leaf-dynamic-extent fun) - :exit-if-null) + :exit-if-null) (xep (functional-entry-fun fun) - :exit-if-null) + :exit-if-null) (closure (physenv-closure (get-lambda-physenv xep)))) (cond (closure @@ -362,9 +358,10 @@ (when dx (setf (lvar-dynamic-extent arg) cleanup) (real-dx-lvars arg)))))) - (setf (cleanup-info cleanup) (real-dx-lvars)) - (setf (component-dx-lvars component) - (append (real-dx-lvars) (component-dx-lvars component))))))) + (let ((real-dx-lvars (delete-duplicates (real-dx-lvars)))) + (setf (cleanup-info cleanup) real-dx-lvars) + (setf (component-dx-lvars component) + (append real-dx-lvars (component-dx-lvars component)))))))) (values)) ;;;; cleanup emission