Use SCHWARTZIAN-STABLE-SORT-LIST in SELECT-LOCATION
authorPaul Khuong <pvk@pvk.ca>
Wed, 13 Nov 2013 18:16:27 +0000 (13:16 -0500)
committerPaul Khuong <pvk@pvk.ca>
Mon, 2 Dec 2013 03:44:43 +0000 (22:44 -0500)
LOOP in a :KEY function may not be the best idea.

src/compiler/pack.lisp

index 3e5a57d..451f83e 100644 (file)
           (let ((locations (sc-locations sc)))
             (when optimize
               (setf locations
-                    (stable-sort (copy-list locations) #'>
-                                 :key (lambda (location-offset)
-                                        (loop for offset from location-offset
-                                              repeat element-size
-                                              maximize (svref
-                                                        (finite-sb-always-live-count sb)
-                                                        offset))))))
+                    (schwartzian-stable-sort-list
+                     locations '>
+                     :key (lambda (location-offset)
+                            (loop for offset from location-offset
+                                  repeat element-size
+                                  maximize (svref
+                                            (finite-sb-always-live-count sb)
+                                            offset))))))
             (dolist (offset locations)
               (when (or use-reserved-locs
                         (not (member offset