1.1.13: will be tagged as "sbcl-1.1.13"
[sbcl.git] / src / compiler / codegen.lisp
index 0756176..b0107e1 100644 (file)
             ;; Align first emitted block of each loop: x86 and x86-64 both
             ;; like 16 byte alignment, however, since x86 aligns code objects
             ;; on 8 byte boundaries we cannot guarantee proper loop alignment
-            ;; there (yet.)
-            #!+x86-64
-            (let ((cloop (sb!c::block-loop 1block)))
-              (when (and cloop
-                         (sb!c::loop-tail cloop)
-                         (not (sb!c::loop-info cloop)))
-                (sb!assem:emit-alignment sb!vm:n-lowtag-bits #x90)
-                ;; Mark the loop as aligned by saving the IR1 block aligned.
-                (setf (sb!c::loop-info cloop) 1block)))
-            (sb!assem:emit-label (block-label 1block)))
+            ;; there (yet.)  Only x86-64 does something with ALIGNP, but
+            ;; it may be useful in the future.
+            (let ((alignp (let ((cloop (block-loop 1block)))
+                            (when (and cloop
+                                       (loop-tail cloop)
+                                       (not (loop-info cloop)))
+                              ;; Mark the loop as aligned by saving the IR1 block aligned.
+                              (setf (loop-info cloop) 1block)
+                              t))))
+              (emit-block-header (block-label 1block)
+                                 (ir2-block-%trampoline-label block)
+                                 (ir2-block-dropped-thru-to block)
+                                 alignp)))
           (let ((env (block-physenv 1block)))
             (unless (eq env prev-env)
               (let ((lab (gen-label)))
         (let ((constants (sb!vm:sort-inline-constants *constant-vector*)))
           (assemble (*constant-segment*)
             (sb!vm:emit-constant-segment-header
+             *constant-segment*
              constants
              (do-ir2-blocks (2block component nil)
                (when (policy (block-last (ir2-block-block 2block))