1.0.9.12: inform genesis about FOR-STD-CLASS-P slot in LAYOUT
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 29 Aug 2007 17:14:45 +0000 (17:14 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 29 Aug 2007 17:14:45 +0000 (17:14 +0000)
* It was left uninitialized by genesis, resulting in bogus results
  from LAYOUT-FOR-STD-CLASS-P.

* Poke at it in tests.

src/code/class.lisp
src/compiler/generic/genesis.lisp
tests/clos.impure.lisp
version.lisp-expr

index 6f8b8ca..c1ece12 100644 (file)
 ;;; type checking and garbage collection. Whenever a class is
 ;;; incompatibly redefined, a new layout is allocated. If two object's
 ;;; layouts are EQ, then they are exactly the same type.
+;;;
+;;; *** IMPORTANT ***
+;;;
+;;; If you change the slots of LAYOUT, you need to alter genesis as
+;;; well, since the initialization of layout slots is hardcoded there.
+;;;
+;;; FIXME: ...it would be better to automate this, of course...
 (def!struct (layout
              ;; KLUDGE: A special hack keeps this from being
              ;; called when building code for the
index a8a454e..a4ea9d5 100644 (file)
@@ -959,6 +959,7 @@ core and return a descriptor to it."
     (cold-set-layout-slot result 'info *nil-descriptor*)
     (cold-set-layout-slot result 'pure *nil-descriptor*)
     (cold-set-layout-slot result 'n-untagged-slots nuntagged)
+    (cold-set-layout-slot result 'for-std-class-p *nil-descriptor*)
 
     (setf (gethash name *cold-layouts*)
           (list result
index e923afc..3fa764a 100644 (file)
 (assert (eql 13 (setf (slot-value 123 *magic-symbol*) 13)))
 (assert (eql 13 (slot-value 'foobar *magic-symbol*)))
 
+;;;; Built-in structure and condition layouts should have NIL in
+;;;; LAYOUT-FOR-STD-CLASS-P, and classes should have T.
+
+(assert (not (sb-pcl::layout-for-std-class-p (sb-pcl::find-layout 'warning))))
+(assert (not (sb-pcl::layout-for-std-class-p (sb-pcl::find-layout 'hash-table))))
+(assert (eq t (sb-pcl::layout-for-std-class-p (sb-pcl::find-layout 'standard-object))))
 \f
 ;;;; success
index 050f6db..f6845dd 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.9.11"
+"1.0.9.12"