Changeset 5126


Ignore:
Timestamp:
Sep 5, 2006, 4:18:59 AM (18 years ago)
Author:
Gary Byers
Message:

Deal with 32-bit lisp strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/xdump/xfasload.lisp

    r5056 r5126  
    6363(defparameter *xload-target-fulltag-for-symbols* nil)
    6464(defparameter *xload-target-fulltag-for-functions* nil)
     65(defparameter *xload-target-char-code-limit* nil)
    6566
    6667
     
    148149          (if (arch::target-function-tag-is-subtag arch)
    149150            (arch::target-fulltag-misc arch)
    150             (arch::target-function-tag arch)))))
     151            (arch::target-function-tag arch)))
     152    (setq *xload-target-char-code-limit*
     153          (arch::target-char-code-limit arch))))
    151154
    152155
     
    785788  (let* ((subtag (type-keyword-code :simple-string)))
    786789    (multiple-value-bind (addr v offset) (xload-make-ivector *xload-readonly-space* subtag n)
    787       (do* ((p (+ offset *xload-target-misc-data-offset*)
    788                (1+ p))
    789               (i 0 (1+ i)))
    790              ((= i n) str)
    791           (declare (fixnum i p))
    792           (setf (u8-ref v p) (char-code (schar str i))))
     790      (case *xload-target-char-code-limit*
     791        (256 (do* ((p (+ offset *xload-target-misc-data-offset*)
     792                      (1+ p))
     793                   (i 0 (1+ i)))
     794                  ((= i n) str)
     795               (declare (fixnum i p))
     796               (setf (u8-ref v p) (char-code (schar str i)))))
     797        (t
     798         (do* ((p (+ offset *xload-target-misc-data-offset*)
     799                      (+ p 4))
     800                   (i 0 (1+ i)))
     801                  ((= i n) str)
     802               (declare (fixnum i p))
     803               (setf (u32-ref v p) (char-code (schar str i))))))
    793804        addr)))
    794805
     
    911922
    912923(defun xload-get-string (address)
    913     (multiple-value-bind (v o) (xload-lookup-address address)
    914       (let* ((header (natural-ref v (+ o *xload-target-misc-header-offset*)))
    915              (len (ash header (- target::num-subtag-bits)))
    916              (str (make-string len))
    917              (p (+ o *xload-target-misc-data-offset*)))
    918         (dotimes (i len str)
    919           (setf (schar str i) (code-char (u8-ref v (+ p i))))))))
     924  (multiple-value-bind (v o) (xload-lookup-address address)
     925    (let* ((header (natural-ref v (+ o *xload-target-misc-header-offset*)))
     926           (len (ash header (- target::num-subtag-bits)))
     927           (str (make-string len))
     928           (p (+ o *xload-target-misc-data-offset*)))
     929      (case *xload-target-char-code-limit*
     930        (256
     931         (dotimes (i len str)
     932           (setf (schar str i) (code-char (u8-ref v (+ p i))))))
     933        (t
     934         (dotimes (i len str)
     935           (setf (schar str i) (code-char (u32-ref v (+ p (* i 4)))))))))))
    920936
    921937               
     
    11111127    (multiple-value-bind (str v o) (xload-make-ivector *xload-readonly-space* :simple-string n)
    11121128      (%epushval s str)
    1113       (dotimes (i n)
    1114         (setf (u8-ref v (+ o i *xload-target-misc-data-offset*))
    1115               (%fasl-read-count s)))
     1129      (case *xload-target-char-code-limit*
     1130        (256
     1131         (dotimes (i n)
     1132           (setf (u8-ref v (+ o i *xload-target-misc-data-offset*))
     1133                 (%fasl-read-count s))))
     1134        (t
     1135         (dotimes (i n)
     1136           (setf (u32-ref v (+ o (* i 4) *xload-target-misc-data-offset*))
     1137                 (%fasl-read-count s)))))
    11161138      str)))
    11171139
     
    17201742            (*xload-target-use-code-vectors* *xload-target-use-code-vectors*)
    17211743            (*xload-target-fulltag-for-symbols* *xload-target-fulltag-for-symbols*)
    1722             (*xload-target-fulltag-for-functions* *xload-target-fulltag-for-functions*))
     1744            (*xload-target-fulltag-for-functions* *xload-target-fulltag-for-functions*)
     1745            (*xload-target-char-code-limit* *xload-target-char-code-limit*))
    17231746       (setup-xload-target-parameters)
    17241747       (let* ((*load-verbose* t)
Note: See TracChangeset for help on using the changeset viewer.