X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fdfo.lisp;h=6d5d6a7c733b38b7e10f9c70352c2e774d4a23fe;hb=61c18727668ff0c3263a3d363e609d4522d545cc;hp=41618103a5b7ace7c6dcda72153cd3177c33cd44;hpb=c25e4572f5505236faf126f38a74f32a80bf1e8c;p=sbcl.git diff --git a/src/compiler/dfo.lisp b/src/compiler/dfo.lisp index 4161810..6d5d6a7 100644 --- a/src/compiler/dfo.lisp +++ b/src/compiler/dfo.lisp @@ -32,7 +32,7 @@ (setf (block-number block) (incf num)) (setf (block-delete-p block) t))) (do-blocks (block component) - (unless (block-flag block) + (when (block-delete-p block) (delete-block block)))) (values)) @@ -59,7 +59,7 @@ (unless (eq old-next old-tail) (setf (block-next head) old-next) (setf (block-prev old-next) head) - + (setf (block-prev next) old-last) (setf (block-next old-last) next)) @@ -187,7 +187,7 @@ (res home)))) (res))) -;;; If CLAMBDA is not already in COMPONENT, just return that +;;; If CLAMBDA is already in COMPONENT, just return that ;;; component. Otherwise, move the code for CLAMBDA and all lambdas it ;;; physically depends on (either because of calls or because of ;;; closure relationships) into COMPONENT, or possibly into another @@ -445,7 +445,7 @@ ;; in the old LAMBDA into the new one (with LETs implicitly moved ;; by changing their home.) (do-blocks (block component) - (do-nodes (node cont block) + (do-nodes (node nil block) (let ((lexenv (node-lexenv node))) (when (eq (lexenv-lambda lexenv) lambda) (setf (lexenv-lambda lexenv) result-lambda)))) @@ -488,12 +488,9 @@ ;; is always a preceding REF NIL node in top level lambdas. (let ((return (lambda-return lambda))) (when return - (let ((return-block (node-block return)) - (result (return-result return))) - (setf (block-last return-block) (continuation-use result)) - (flush-dest result) - (delete-continuation result) - (link-blocks return-block result-return-block)))))) + (link-blocks (node-block return) result-return-block) + (flush-dest (return-result return)) + (unlink-node return))))) ;;; Given a non-empty list of top level LAMBDAs, smash them into a ;;; top level lambda and component, returning these as values. We use @@ -509,14 +506,9 @@ ;; Make sure the result's return node starts a block so that we ;; can splice code in before it. (let ((prev (node-prev - (continuation-use - (return-result result-return))))) - (when (continuation-use prev) - (node-ends-block (continuation-use prev))) - (do-uses (use prev) - (let ((new (make-continuation))) - (delete-continuation-use use) - (add-continuation-use use new)))) + (lvar-uses (return-result result-return))))) + (when (ctran-use prev) + (node-ends-block (ctran-use prev)))) (dolist (lambda (rest lambdas)) (merge-1-toplevel-lambda result-lambda lambda)))