0.pre7.129:
[sbcl.git] / src / compiler / generic / genesis.lisp
index 4960357..fa0dc2f 100644 (file)
                                     (ash (descriptor-low des)
                                          (- 1 sb!vm:n-lowtag-bits)))))
               (format stream
-                      "for fixnum: ~D"
+                      "for fixnum: ~W"
                       (if (> unsigned #x1FFFFFFF)
                           (- unsigned #x40000000)
                           unsigned))))
 (defun make-fixnum-descriptor (num)
   (when (>= (integer-length num)
            (1+ (- sb!vm:n-word-bits sb!vm:n-lowtag-bits)))
-    (error "~D is too big for a fixnum." num))
+    (error "~W is too big for a fixnum." num))
   (make-random-descriptor (ash num (1- sb!vm:n-lowtag-bits))))
 
 (defun make-other-immediate-descriptor (data type)
        ((> index words)
         (unless (zerop (integer-length remainder))
           ;; FIXME: Shouldn't this be a fatal error?
-          (warn "~D words of ~D were written, but ~D bits were left over."
+          (warn "~W words of ~W were written, but ~W bits were left over."
                 words n remainder)))
       (let ((word (ldb (byte sb!vm:n-word-bits 0) remainder)))
        (write-wordindexed handle index
                              (descriptor-low *nil-descriptor*))))
        (unless (= offset-wanted offset-found)
          ;; FIXME: should be fatal
-         (warn "Offset from ~S to ~S is ~D, not ~D"
+         (warn "Offset from ~S to ~S is ~W, not ~W"
                symbol
                nil
                offset-found
                                   sb!vm:word-shift))))
                         (#.sb!vm:closure-header-widetag
                          (make-random-descriptor
-                          (cold-foreign-symbol-address-as-integer "closure_tramp")))))
+                          (cold-foreign-symbol-address-as-integer
+                           "closure_tramp")))))
     fdefn))
 
 (defun initialize-static-fns ()
             (desired (sb!vm:static-fun-offset sym)))
        (unless (= offset desired)
          ;; FIXME: should be fatal
-         (warn "Offset from FDEFN ~S to ~S is ~D, not ~D."
+         (warn "Offset from FDEFN ~S to ~S is ~W, not ~W."
                sym nil offset desired))))))
 
 (defun list-all-fdefn-objects ()
   (let ((result *nil-descriptor*))
-    (maphash #'(lambda (key value)
-                (declare (ignore key))
-                (cold-push value result))
+    (maphash (lambda (key value)
+              (declare (ignore key))
+              (cold-push value result))
             *cold-fdefn-objects*)
     result))
 \f
 ;;;; general machinery for cold-loading FASL files
 
 ;;; FOP functions for cold loading
-(defvar *cold-fop-functions*
-  ;; We start out with a copy of the ordinary *FOP-FUNCTIONS*. The
-  ;; ones which aren't appropriate for cold load will be destructively
+(defvar *cold-fop-funs*
+  ;; We start out with a copy of the ordinary *FOP-FUNS*. The ones
+  ;; which aren't appropriate for cold load will be destructively
   ;; modified.
-  (copy-seq *fop-functions*))
+  (copy-seq *fop-funs*))
 
-(defvar *normal-fop-functions*)
+(defvar *normal-fop-funs*)
 
 ;;; Cause a fop to have a special definition for cold load.
 ;;; 
 ;;; This is similar to DEFINE-FOP, but unlike DEFINE-FOP, this version
 ;;;   (1) looks up the code for this name (created by a previous
 ;;        DEFINE-FOP) instead of creating a code, and
-;;;   (2) stores its definition in the *COLD-FOP-FUNCTIONS* vector,
-;;;       instead of storing in the *FOP-FUNCTIONS* vector.
+;;;   (2) stores its definition in the *COLD-FOP-FUNS* vector,
+;;;       instead of storing in the *FOP-FUNS* vector.
 (defmacro define-cold-fop ((name &optional (pushp t)) &rest forms)
   (aver (member pushp '(nil t :nope)))
   (let ((code (get name 'fop-code))
         ,@(if (eq pushp :nope)
             forms
             `((with-fop-stack ,pushp ,@forms))))
-       (setf (svref *cold-fop-functions* ,code) #',fname))))
+       (setf (svref *cold-fop-funs* ,code) #',fname))))
 
 (defmacro clone-cold-fop ((name &optional (pushp t)) (small-name) &rest forms)
   (aver (member pushp '(nil t :nope)))
 (defun cold-load (filename)
   #!+sb-doc
   "Load the file named by FILENAME into the cold load image being built."
-  (let* ((*normal-fop-functions* *fop-functions*)
-        (*fop-functions* *cold-fop-functions*)
+  (let* ((*normal-fop-funs* *fop-funs*)
+        (*fop-funs* *cold-fop-funs*)
         (*cold-load-filename* (etypecase filename
                                 (string filename)
                                 (pathname (namestring filename)))))
 (define-cold-fop (fop-truth) (cold-intern t))
 
 (define-cold-fop (fop-normal-load :nope)
-  (setq *fop-functions* *normal-fop-functions*))
+  (setq *fop-funs* *normal-fop-funs*))
 
 (define-fop (fop-maybe-cold-load 82 :nope)
   (when *cold-load-filename*
-    (setq *fop-functions* *cold-fop-functions*)))
+    (setq *fop-funs* *cold-fop-funs*)))
 
 (define-cold-fop (fop-maybe-cold-load :nope))
 
                 (8 sb!vm:simple-array-unsigned-byte-8-widetag)
                 (16 sb!vm:simple-array-unsigned-byte-16-widetag)
                 (32 sb!vm:simple-array-unsigned-byte-32-widetag)
-                (t (error "losing element size: ~D" sizebits))))
+                (t (error "losing element size: ~W" sizebits))))
         (result (allocate-vector-object *dynamic* sizebits len type))
         (start (+ (descriptor-byte-offset result)
                   (ash sb!vm:vector-data-offset sb!vm:word-shift)))
         #!+sb-show
         (when *show-pre-fixup-code-p*
           (format *trace-output*
-                  "~&/raw code from code-fop ~D ~D:~%"
+                  "~&/raw code from code-fop ~W ~W:~%"
                   nconst
                   code-size)
           (do ((i start (+ i sb!vm:n-word-bytes)))
        (code (pop-stack)))
     (write-wordindexed code slot value)))
 
-(define-cold-fop (fop-function-entry)
+(define-cold-fop (fop-fun-entry)
   (let* ((type (pop-stack))
         (arglist (pop-stack))
         (name (pop-stack))
            (maybe-record-with-translated-name '("-START" "-END") 6)))))
     (setf constants
          (sort constants
-               #'(lambda (const1 const2)
-                   (if (= (second const1) (second const2))
+               (lambda (const1 const2)
+                 (if (= (second const1) (second const2))
                      (< (third const1) (third const2))
                      (< (second const1) (second const2))))))
     (let ((prev-priority (second (car constants))))
 
   ;; writing primitive object layouts
   (let ((structs (sort (copy-list sb!vm:*primitive-objects*) #'string<
-                      :key #'(lambda (obj)
-                               (symbol-name
-                                (sb!vm:primitive-object-name obj))))))
+                      :key (lambda (obj)
+                             (symbol-name
+                              (sb!vm:primitive-object-name obj))))))
     (format t "#ifndef LANGUAGE_ASSEMBLY~2%")
     (format t "#define LISPOBJ(x) ((lispobj)x)~2%")
     (dolist (obj structs)
     ;; in #define statements.
     (format t "#define ~A LISPOBJ(0x~X)~%"
            (nsubstitute #\_ #\-
-                        (remove-if #'(lambda (char)
-                                       (member char '(#\% #\* #\. #\!)))
+                        (remove-if (lambda (char)
+                                     (member char '(#\% #\* #\. #\!)))
                                    (symbol-name symbol)))
            (if *static*                ; if we ran GENESIS
              ;; We actually ran GENESIS, use the real value.
       (format t "#X~8,'0X: ~S~%" (cdr routine) (car routine)))
     (let ((funs nil)
          (undefs nil))
-      (maphash #'(lambda (name fdefn)
-                  (let ((fun (read-wordindexed fdefn
-                                               sb!vm:fdefn-fun-slot)))
-                    (if (= (descriptor-bits fun)
-                           (descriptor-bits *nil-descriptor*))
-                        (push name undefs)
-                        (let ((addr (read-wordindexed
-                                     fdefn sb!vm:fdefn-raw-addr-slot)))
-                          (push (cons name (descriptor-bits addr))
-                                funs)))))
+      (maphash (lambda (name fdefn)
+                (let ((fun (read-wordindexed fdefn
+                                             sb!vm:fdefn-fun-slot)))
+                  (if (= (descriptor-bits fun)
+                         (descriptor-bits *nil-descriptor*))
+                      (push name undefs)
+                      (let ((addr (read-wordindexed
+                                   fdefn sb!vm:fdefn-raw-addr-slot)))
+                        (push (cons name (descriptor-bits addr))
+                              funs)))))
               *cold-fdefn-objects*)
       (format t "~%~|~%initially defined functions:~2%")
       (setf funs (sort funs #'< :key #'cdr))
@@ -2715,10 +2716,10 @@ initially undefined function references:~2%")
 
     (format t "~%~|~%layout names:~2%")
     (collect ((stuff))
-      (maphash #'(lambda (name gorp)
-                   (declare (ignore name))
-                   (stuff (cons (descriptor-bits (car gorp))
-                                (cdr gorp))))
+      (maphash (lambda (name gorp)
+                 (declare (ignore name))
+                 (stuff (cons (descriptor-bits (car gorp))
+                              (cdr gorp))))
                *cold-layouts*)
       (dolist (x (sort (stuff) #'< :key #'car))
         (apply #'format t "~8,'0X: ~S[~D]~%~10T~S~%" x))))
@@ -2737,7 +2738,7 @@ initially undefined function references:~2%")
 (defparameter validate-entry-type-code 3845)
 (defparameter directory-entry-type-code 3841)
 (defparameter new-directory-entry-type-code 3861)
-(defparameter initial-function-entry-type-code 3863)
+(defparameter initial-fun-entry-type-code 3863)
 (defparameter end-entry-type-code 3840)
 
 (declaim (ftype (function (sb!vm:word) sb!vm:word) write-long))
@@ -2837,16 +2838,16 @@ initially undefined function references:~2%")
       (output-gspace *dynamic*)
 
       ;; Write the initial function.
-      (write-long initial-function-entry-type-code)
+      (write-long initial-fun-entry-type-code)
       (write-long 3)
       (let* ((cold-name (cold-intern '!cold-init))
             (cold-fdefn (cold-fdefinition-object cold-name))
-            (initial-function (read-wordindexed cold-fdefn
-                                                sb!vm:fdefn-fun-slot)))
+            (initial-fun (read-wordindexed cold-fdefn
+                                           sb!vm:fdefn-fun-slot)))
        (format t
-               "~&/(DESCRIPTOR-BITS INITIAL-FUNCTION)=#X~X~%"
-               (descriptor-bits initial-function))
-       (write-long (descriptor-bits initial-function)))
+               "~&/(DESCRIPTOR-BITS INITIAL-FUN)=#X~X~%"
+               (descriptor-bits initial-fun))
+       (write-long (descriptor-bits initial-fun)))
 
       ;; Write the End entry.
       (write-long end-entry-type-code)