X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ftarget-dump.lisp;h=1ea911e82e6e521a9901e6a1fcaefb16534c921e;hb=fe5d3fcb66a417311359101a77da4a691e649622;hp=01eba241c73316628ddbf0e99a0a3e8ba7464198;hpb=d57319a52914c481d89415c0860dc6b7ad90ddce;p=sbcl.git diff --git a/src/compiler/target-dump.lisp b/src/compiler/target-dump.lisp index 01eba24..1ea911e 100644 --- a/src/compiler/target-dump.lisp +++ b/src/compiler/target-dump.lisp @@ -13,6 +13,22 @@ (in-package "SB!FASL") +;;; a helper function shared by DUMP-SIMPLE-CHARACTER-STRING and +;;; DUMP-SYMBOL (in the target compiler: the cross-compiler uses the +;;; portability knowledge and always dumps BASE-STRINGS). +#!+sb-unicode +(defun dump-characters-of-string (s fasl-output) + (declare (type string s) (type fasl-output fasl-output)) + (dovector (c s) + (dump-word (char-code c) fasl-output)) + (values)) +#!+sb-unicode +(defun dump-simple-character-string (s file) + (declare (type (simple-array character (*)) s)) + (dump-fop* (length s) fop-small-character-string fop-character-string file) + (dump-characters-of-string s file) + (values)) + ;;; Dump the first N bytes of VEC out to FILE. VEC is some sort of unboxed ;;; vector-like thing that we can BLT from. (defun dump-raw-bytes (vec n fasl-output) @@ -34,8 +50,8 @@ (dump-integer (array-dimension array i) file)) (with-array-data ((vector array) (start) (end)) (if (and (= start 0) (= end (length vector))) - (sub-dump-object vector file) - (sub-dump-object (subseq vector start end) file))) + (sub-dump-object vector file) + (sub-dump-object (subseq vector start end) file))) (dump-fop 'fop-array file) (dump-word rank file) (eq-save-object array file))) @@ -60,8 +76,8 @@ (dump-fop 'fop-long-float-vector file) (dump-word length file) (dump-raw-bytes vec - (* length sb!vm:n-word-bytes #!+x86 3 #!+sparc 4) - file))) + (* length sb!vm:n-word-bytes #!+x86 3 #!+sparc 4) + file))) (defun dump-complex-single-float-vector (vec file) (let ((length (length vec))) @@ -81,15 +97,15 @@ (dump-fop 'fop-complex-long-float-vector file) (dump-word length file) (dump-raw-bytes vec - (* length sb!vm:n-word-bytes #!+x86 3 #!+sparc 4 2) - file))) + (* length sb!vm:n-word-bytes #!+x86 3 #!+sparc 4 2) + file))) #!+(and long-float x86) (defun dump-long-float (float file) (declare (long-float float)) (let ((exp-bits (long-float-exp-bits float)) - (high-bits (long-float-high-bits float)) - (low-bits (long-float-low-bits float))) + (high-bits (long-float-high-bits float)) + (low-bits (long-float-low-bits float))) ;; We could get away with DUMP-WORD here, since the x86 has 4-byte words, ;; but we prefer to make things as explicit as possible. ;; --njf, 2004-08-16 @@ -101,9 +117,9 @@ (defun dump-long-float (float file) (declare (long-float float)) (let ((exp-bits (long-float-exp-bits float)) - (high-bits (long-float-high-bits float)) - (mid-bits (long-float-mid-bits float)) - (low-bits (long-float-low-bits float))) + (high-bits (long-float-high-bits float)) + (mid-bits (long-float-mid-bits float)) + (low-bits (long-float-low-bits float))) ;; We could get away with DUMP-WORD here, since the sparc has 4-byte ;; words, but we prefer to make things as explicit as possible. ;; --njf, 2004-08-16