Cold-print accidentally didn't print the recursed-into object in its
fallback case, but instead the outer argument. Hexstr didn't work on
64-bit. Both for "hapless wretches" [sic].
Re my prior submittal:
- Yes I know I forgot an (IN-PACKAGE) at the top of the test file. And I
have some tests which bash on it a little harder now.
- Some improvements, pending, make the code less aesthetically displeasing.
- If the volatile-env/compact-env distinction is to be kept, that's fine,
but we can reduce the memory used by ~3x. Volatile env entries cost 4 words
each - a cons for the entry and a cons to push it. Vectors cost 4 words
plus ~1.2 words per entry in my packing. Breakeven = one entry. So replace
the cdr of the name's cell with a vector and it's an immediate win-
Ok, this leads to my question:
Given a patched Lisp, _that_ won't build itself. I think I need another
piece of voodoo somewhere and so to find if I accidentally depended on
something in the host Lisp, I tried building on CCL.
This turns out not to work, mostly often because CCL considers it an error
when a TYPECASE expression contains an unmatchable clause. These arise in
many places: 'compiler/dump.lisp' forgets the idiom of "#-sb-xc-host" in
front of the branches that might not have a specialization. (see "KLUDGE:
This isn't the best way of expressing that the host may not have
specializations") So this merits fixing at least for consistency's sake.
Also this applies universally to Paul's apparently favored approach of:
#-sb-xc-host (simd-pack double-float)
which says that if the target wants the simd-pack feature but we're
building the xc the whole clause is nil.
I'm not sure if this is a bug in CCL that it rejects those.
Anyway does it sound plausible that I might need to add another
Patch to the cold print for your enjoyment.
@@ -370,20 +370,21 @@ process to continue normally."
(defun hexstr (thing)
(/noshow0 "entering HEXSTR")
- (let ((addr (get-lisp-obj-address thing))
- (str (make-string 10 :element-type 'base-char)))
+ (let* ((addr (get-lisp-obj-address thing))
+ (nchars (* sb!vm:n-word-bytes 2))
+ (str (make-string (+ nchars 2) :element-type 'base-char)))
(/noshow0 "ADDR and STR calculated")
(setf (char str 0) #\0
(char str 1) #\x)
(/noshow0 "CHARs 0 and 1 set")
- (dotimes (i 8)
+ (dotimes (i nchars)
(/noshow0 "at head of DOTIMES loop")
(let* ((nibble (ldb (byte 4 0) addr))
(chr (char "0123456789abcdef" nibble)))
(declare (type (unsigned-byte 4) nibble)
(/noshow0 "NIBBLE and CHR calculated")
- (setf (char str (- 9 i)) chr
+ (setf (char str (- (+ nchars 1) i)) chr
addr (ash addr -4))))
@@ -403,6 +404,6 @@ process to continue normally."
(%cold-print (car obj) d)
(%cold-print (cdr obj) d)))
- (sb!sys:%primitive print (hexstr x)))))))
+ (sb!sys:%primitive print (hexstr obj)))))))