X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fcache.lisp;h=766e7e7f70f2b69eba7d9c8ea3741add3e29133f;hb=3a618201c9f2370bb8784217a866d000371769e5;hp=d53c6741f64581eefb6165cd0700b6a186eec9eb;hpb=015c86a5eaaa3d2490d221ae56ffec36d2007529;p=sbcl.git diff --git a/src/pcl/cache.lisp b/src/pcl/cache.lisp index d53c674..766e7e7 100644 --- a/src/pcl/cache.lisp +++ b/src/pcl/cache.lisp @@ -204,6 +204,7 @@ (defmacro wrapper-no-of-instance-slots (wrapper) `(layout-length ,wrapper)) +;;; FIXME: Why are these macros? (defmacro wrapper-instance-slots-layout (wrapper) `(%wrapper-instance-slots-layout ,wrapper)) (defmacro wrapper-class-slots (wrapper) @@ -353,13 +354,28 @@ (defun check-wrapper-validity (instance) (let* ((owrapper (wrapper-of instance)) (state (layout-invalid owrapper))) - (if (null state) - owrapper - (ecase (car state) - (:flush - (flush-cache-trap owrapper (cadr state) instance)) - (:obsolete - (obsolete-instance-trap owrapper (cadr state) instance)))))) + (aver (not (eq state :uninitialized))) + (etypecase state + (null owrapper) + ;; FIXME: I can't help thinking that, while this does cure the + ;; symptoms observed from some class redefinitions, this isn't + ;; the place to be doing this flushing. Nevertheless... -- + ;; CSR, 2003-05-31 + ;; + ;; CMUCL comment: + ;; We assume in this case, that the :INVALID is from a + ;; previous call to REGISTER-LAYOUT for a superclass of + ;; INSTANCE's class. See also the comment above + ;; FORCE-CACHE-FLUSHES. Paul Dietz has test cases for this. + ((member t) + (force-cache-flushes (class-of instance)) + (check-wrapper-validity instance)) + (cons + (ecase (car state) + (:flush + (flush-cache-trap owrapper (cadr state) instance)) + (:obsolete + (obsolete-instance-trap owrapper (cadr state) instance))))))) (declaim (inline check-obsolete-instance)) (defun check-obsolete-instance (instance)