1.0.18.24: lift node-insertion logic from RECOGNIZE-DYNAMIC-EXTENT-LVARS
authorNikodemus Siivola <nikodemus@random-state.net>
Sat, 19 Jul 2008 11:32:53 +0000 (11:32 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Sat, 19 Jul 2008 11:32:53 +0000 (11:32 +0000)
 * New function INSERT-NODE-BEFORE, makes the action easier to
   understand by separating out the entry/cleanup creation from the
   flow-graph hacking.

src/compiler/ir1tran.lisp
src/compiler/locall.lisp
version.lisp-expr

index eddc909..2497c06 100644 (file)
       (error "~S is already a predecessor of ~S." node-block block))
     (push node-block (block-pred block))))
 
+;;; Insert NEW before OLD in the flow-graph.
+(defun insert-node-before (old new)
+  (let ((prev (node-prev old))
+        (temp (make-ctran)))
+    (ensure-block-start prev)
+    (setf (ctran-next prev) nil)
+    (link-node-to-previous-ctran new prev)
+    (use-ctran new temp)
+    (link-node-to-previous-ctran old temp))
+  (values))
+
 ;;; This function is used to set the ctran for a node, and thus
 ;;; determine what receives the value.
 (defun use-lvar (node lvar)
index 0a463c3..66538ae 100644 (file)
                   ;; Stack analysis requires that the CALL ends the block, so
                   ;; that MAP-BLOCK-NLXES sees the cleanup we insert here.
                   (node-ends-block call)
-                  (binding* ((before-ctran (node-prev call))
-                             (nil (ensure-block-start before-ctran))
-                             (block (ctran-block before-ctran))
-                             (new-call-ctran (make-ctran :kind :inside-block
-                                                         :next call
-                                                         :block block))
-                             (entry (with-ir1-environment-from-node call
-                                      (make-entry :prev before-ctran
-                                                  :next new-call-ctran)))
-                             (cleanup (make-cleanup :kind :dynamic-extent
-                                                    :mess-up entry
-                                                    :info dx-lvars)))
-                    (setf (node-prev call) new-call-ctran)
-                    (setf (ctran-next before-ctran) entry)
-                    (setf (ctran-use new-call-ctran) entry)
+                  (let* ((entry (with-ir1-environment-from-node call
+                                  (make-entry)))
+                         (cleanup (make-cleanup :kind :dynamic-extent
+                                                :mess-up entry
+                                                :info dx-lvars)))
                     (setf (entry-cleanup entry) cleanup)
+                    (insert-node-before call entry)
                     (setf (node-lexenv call)
                           (make-lexenv :default (node-lexenv call)
                                        :cleanup cleanup))
index 07f3a23..0ef7ba1 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.18.23"
+"1.0.18.24"