1.0.7.26: asymptotically faster FIND-SLOT-DEFINITION
[sbcl.git] / src / compiler / pack.lisp
index a911dbd..1673e94 100644 (file)
                        save tn before))
   (values))
 
-(eval-when (:compile-toplevel :execute)
-
-;;; Do stuff to note a read of TN, for OPTIMIZED-EMIT-SAVES-BLOCK.
-(defmacro save-note-read (tn)
-  `(let* ((tn ,tn)
-          (num (tn-number tn)))
-     (when (and (sc-save-p (tn-sc tn))
-                (zerop (sbit restores num))
-                (not (eq (tn-kind tn) :component)))
-       (setf (sbit restores num) 1)
-       (push tn restores-list))))
-
-) ; EVAL-WHEN
-
 ;;; Start scanning backward at the end of BLOCK, looking which TNs are
 ;;; live and looking for places where we have to save. We manipulate
 ;;; two sets: SAVES and RESTORES.
                   (setq saves-list
                         (delete tn saves-list :test #'eq))))))
 
-          (macrolet (;; Do stuff to note a read of TN, for
-                     ;; OPTIMIZED-EMIT-SAVES-BLOCK.
-                     (save-note-read (tn)
+          (macrolet ((save-note-read (tn)
                        `(let* ((tn ,tn)
                                (num (tn-number tn)))
                           (when (and (sc-save-p (tn-sc tn))
                   (do-ir2-blocks (block component)
                     (emit-saves block)
                     (pack-load-tns block))))
-           (when *repack-blocks*
-             (loop
-                 (when (zerop (hash-table-count *repack-blocks*)) (return))
-                 (maphash (lambda (block v)
-                            (declare (ignore v))
-                            (remhash block *repack-blocks*)
-                            (event repack-block)
-                            (pack-load-tns block))
-                          *repack-blocks*))))
+           (loop
+              (unless *repack-blocks* (return))
+              (let ((orpb *repack-blocks*))
+                (setq *repack-blocks* nil)
+                (maphash (lambda (block v)
+                           (declare (ignore v))
+                           (event repack-block)
+                           (pack-load-tns block))
+                         orpb))))
 
          (values))
     (clean-up-pack-structures)))