#-sb-xc-host
(%primitive sb!c:make-other-immediate-type 0 sb!vm:unbound-marker-widetag))
-;;; CMU CL had FOP-CHARACTER as fop 68, but it's not needed in current
-;;; SBCL as we have no extended characters, only 1-byte characters.
-;;; (Ditto for CMU CL, actually: FOP-CHARACTER was speculative generality.)
-(define-fop (fop-short-character 69)
- (code-char (read-byte-arg)))
+(define-cloned-fops (fop-character 68) (fop-short-character 69)
+ (code-char (clone-arg)))
(define-cloned-fops (fop-struct 48) (fop-small-struct 49)
(let* ((size (clone-arg))
\f
;;;; fops for loading arrays
-(define-cloned-fops (fop-string 37) (fop-small-string 38)
+(define-cloned-fops (fop-base-string 37) (fop-small-base-string 38)
(let* ((arg (clone-arg))
- (res (make-string arg)))
+ (res (make-string arg :element-type 'base-char)))
(read-string-as-bytes *fasl-input-stream* res)
res))
(let* ((kind (pop-stack))
(code-object (pop-stack))
(len (read-byte-arg))
- (sym (make-string len)))
+ (sym (make-string len :element-type 'base-char)))
(read-n-bytes *fasl-input-stream* sym 0 len)
(sb!vm:fixup-code-object code-object
(read-word-arg)
(t
(unless *cold-load-dump*
(dump-fop 'fop-normal-load file))
- (dump-simple-string (package-name pkg) file)
+ (dump-simple-base-string
+ (coerce (package-name pkg) 'simple-base-string)
+ file)
(dump-fop 'fop-package file)
(unless *cold-load-dump*
(dump-fop 'fop-maybe-cold-load file))
(typecase simple-version
(simple-base-string
(unless (equal-check-table x file)
- (dump-simple-string simple-version file)
+ (dump-simple-base-string simple-version file)
(equal-save-object x file)))
(simple-vector
(dump-simple-vector simple-version file)
\f
;;; Dump characters and string-ish things.
-(defun dump-character (ch file)
+(defun dump-character (char file)
+ (let ((code (sb!xc:char-code char)))
+ (cond
+ ((< code 256)
(dump-fop 'fop-short-character file)
- (dump-byte (char-code ch) file))
+ (dump-byte code file))
+ (t
+ (dump-fop 'fop-character file)
+ (dump-word code file)))))
-;;; a helper function shared by DUMP-SIMPLE-STRING and DUMP-SYMBOL
-(defun dump-characters-of-string (s fasl-output)
- (declare (type string s) (type fasl-output fasl-output))
+(defun dump-base-chars-of-string (s fasl-output)
+ (declare #+sb-xc-host (type simple-string s)
+ #-sb-xc-host (type simple-base-string s)
+ (type fasl-output fasl-output))
(dovector (c s)
- (dump-byte (char-code c) fasl-output))
+ (dump-byte (sb!xc:char-code c) fasl-output))
(values))
+
;;; Dump a SIMPLE-BASE-STRING.
-;;; FIXME: should be called DUMP-SIMPLE-BASE-STRING then
-(defun dump-simple-string (s file)
- (declare (type simple-base-string s))
- (dump-fop* (length s) fop-small-string fop-string file)
- (dump-characters-of-string s file)
+(defun dump-simple-base-string (s file)
+ #+sb-xc-host (declare (type simple-string s))
+ #-sb-xc-host (declare (type simple-base-string s))
+ (dump-fop* (length s) fop-small-base-string fop-base-string file)
+ (dump-base-chars-of-string s file)
(values))
;;; If we get here, it is assumed that the symbol isn't in the table,
file)
(dump-word pname-length file)))
- (dump-characters-of-string pname file)
+ (dump-base-chars-of-string pname file)
(unless *cold-load-dump*
(setf (gethash s (fasl-output-eq-table file))