X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ftarget-dump.lisp;h=c0fa5da07fc563c1a392267fb354e8d6a4ac2400;hb=e2b33e0d99f0f93263defcd2e0dffe20c4e388f3;hp=0c9d4d35c1ea94dd8e54f3d003857ebe0b26ab0f;hpb=aa2dc9529460ea0d9c99998dc87283fc1a43e808;p=sbcl.git diff --git a/src/compiler/target-dump.lisp b/src/compiler/target-dump.lisp index 0c9d4d3..c0fa5da 100644 --- a/src/compiler/target-dump.lisp +++ b/src/compiler/target-dump.lisp @@ -46,39 +46,43 @@ (let ((length (length vec))) (dump-fop 'fop-single-float-vector file) (dump-unsigned-32 length file) - (dump-raw-bytes vec (* length sb!vm:word-bytes) file))) + (dump-raw-bytes vec (* length sb!vm:n-word-bytes) file))) (defun dump-double-float-vector (vec file) (let ((length (length vec))) (dump-fop 'fop-double-float-vector file) (dump-unsigned-32 length file) - (dump-raw-bytes vec (* length sb!vm:word-bytes 2) file))) + (dump-raw-bytes vec (* length sb!vm:n-word-bytes 2) file))) #!+long-float (defun dump-long-float-vector (vec file) (let ((length (length vec))) (dump-fop 'fop-long-float-vector file) (dump-unsigned-32 length file) - (dump-raw-bytes vec (* length sb!vm:word-bytes #!+x86 3 #!+sparc 4) file))) + (dump-raw-bytes vec + (* length sb!vm:n-word-bytes #!+x86 3 #!+sparc 4) + file))) (defun dump-complex-single-float-vector (vec file) (let ((length (length vec))) (dump-fop 'fop-complex-single-float-vector file) (dump-unsigned-32 length file) - (dump-raw-bytes vec (* length sb!vm:word-bytes 2) file))) + (dump-raw-bytes vec (* length sb!vm:n-word-bytes 2) file))) (defun dump-complex-double-float-vector (vec file) (let ((length (length vec))) (dump-fop 'fop-complex-double-float-vector file) (dump-unsigned-32 length file) - (dump-raw-bytes vec (* length sb!vm:word-bytes 2 2) file))) + (dump-raw-bytes vec (* length sb!vm:n-word-bytes 2 2) file))) #!+long-float (defun dump-complex-long-float-vector (vec file) (let ((length (length vec))) (dump-fop 'fop-complex-long-float-vector file) (dump-unsigned-32 length file) - (dump-raw-bytes vec (* length sb!vm:word-bytes #!+x86 3 #!+sparc 4 2) file))) + (dump-raw-bytes vec + (* length sb!vm:n-word-bytes #!+x86 3 #!+sparc 4 2) + file))) #!+(and long-float x86) (defun dump-long-float (float file) @@ -101,47 +105,3 @@ (dump-unsigned-32 mid-bits file) (dump-unsigned-32 high-bits file) (dump-integer-as-n-bytes exp-bits 4 file))) - -(defun dump-complex (x file) - (typecase x - ((complex single-float) - (dump-fop 'fop-complex-single-float file) - (dump-integer-as-n-bytes (single-float-bits (realpart x)) 4 file) - (dump-integer-as-n-bytes (single-float-bits (imagpart x)) 4 file)) - ((complex double-float) - (dump-fop 'fop-complex-double-float file) - (let ((re (realpart x))) - (declare (double-float re)) - (dump-unsigned-32 (double-float-low-bits re) file) - (dump-integer-as-n-bytes (double-float-high-bits re) 4 file)) - (let ((im (imagpart x))) - (declare (double-float im)) - (dump-unsigned-32 (double-float-low-bits im) file) - (dump-integer-as-n-bytes (double-float-high-bits im) 4 file))) - #!+long-float - ((complex long-float) - (dump-fop 'fop-complex-long-float file) - (dump-long-float (realpart x) file) - (dump-long-float (imagpart x) file)) - (t - (sub-dump-object (realpart x) file) - (sub-dump-object (imagpart x) file) - (dump-fop 'fop-complex file)))) - -;;;; dumping things which don't exist in portable ANSI Common Lisp - -;;; Dump a BYTE-FUNCTION object. We dump the layout and -;;; funcallable-instance info, but rely on the loader setting up the -;;; correct funcallable-instance-function. -(defun dump-byte-function (xep code-handle file) - (let ((nslots (- (get-closure-length xep) - ;; 1- for header - (1- sb!vm:funcallable-instance-info-offset)))) - (dotimes (i nslots) - (if (zerop i) - (dump-push code-handle file) - (dump-object (%funcallable-instance-info xep i) file))) - (dump-object (%funcallable-instance-layout xep) file) - (dump-fop 'fop-make-byte-compiled-function file) - (dump-byte nslots file)) - (values))