]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "simplify comp-limplify-block"
authorAndrea Corallo <akrl@sdf.org>
Sun, 27 Oct 2019 15:57:29 +0000 (16:57 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:59 +0000 (11:37 +0100)
This reverts commit 31861f63a4b57e69cdcd247e48567242a05bd58e.

lisp/emacs-lisp/comp.el

index 7b77b4d87c9849df7d13f2d5b1b83352417824c2..1891398c1493328757e1b33288f246640fb8e47d 100644 (file)
@@ -1075,10 +1075,24 @@ The block name is returned."
   (setf (comp-limplify-pc comp-pass) (comp-block-addr bb))
   (puthash (comp-block-name bb) bb (comp-func-blocks comp-func))
   (cl-loop
-   for inst in (nthcdr (comp-limplify-pc comp-pass)
+   for inst-cell on (nthcdr (comp-limplify-pc comp-pass)
                             (comp-func-lap comp-func))
+   for inst = (car inst-cell)
+   for next-inst = (car-safe (cdr inst-cell))
    do (comp-limplify-lap-inst inst)
       (cl-incf (comp-limplify-pc comp-pass))
+   when (comp-lap-fall-through-p inst)
+   do (pcase next-inst
+        (`(TAG ,_label . ,label-sp)
+         (when label-sp
+           (cl-assert (= (1- label-sp) (comp-sp))))
+         (let* ((stack-depth (if label-sp
+                                 (1- label-sp)
+                               (comp-sp)))
+                (next-bb (comp-add-pending-block stack-depth)))
+           (unless (comp-block-closed bb)
+             (comp-emit `(jump ,next-bb))))
+         (cl-return)))
    until (comp-lap-eob-p inst)))
 
 (defun comp-limplify-function (func)