Changeset 831


Ignore:
Timestamp:
Jun 23, 2004, 10:29:26 AM (20 years ago)
Author:
Gary Byers
Message:

UPDATE-SLOTS fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-clos.lisp

    r812 r831  
    280280
    281281(defun update-slots (class eslotds)
    282   (multiple-value-bind (instance-slots class-slots)
    283       (extract-instance-and-class-slotds eslotds)
    284     (let* ((new-ordering
    285             (let* ((v (make-array (the fixnum (length instance-slots))))
    286                    (i 0))
    287               (declare (simple-vector v) (fixnum i))
    288               (dolist (e instance-slots v)
    289                 (setf (svref v i)
    290                       (%slot-definition-name e))
    291                 (incf i))))
    292            (old-wrapper (%class-own-wrapper class))
    293            (old-ordering (if old-wrapper (%wrapper-instance-slots old-wrapper)))
    294            (new-wrapper
    295             (cond ((null old-wrapper)
    296                    (%cons-wrapper class))
    297                   ((and old-wrapper *update-slots-preserve-existing-wrapper*)
    298                    old-wrapper)
    299                   ((and (equalp old-ordering new-ordering)
    300                         (null class-slots))
    301                    old-wrapper)
    302                   (t
    303                    (make-instances-obsolete class)
    304                    ;;; Is this right ?
    305                    #|(%class.own-wrapper class)|#
    306                    (%cons-wrapper class)))))
    307       (setf (%class-slots class) eslotds)
    308       (setf (%wrapper-instance-slots new-wrapper) new-ordering
    309             (%wrapper-class-slots new-wrapper) (%class-get class :class-slots)
    310             (%class-own-wrapper class) new-wrapper)
    311       (setup-slot-lookup new-wrapper eslotds))))
     282  (let* ((instance-slots (extract-slotds-with-allocation :instance eslotds))
     283         (new-ordering
     284          (let* ((v (make-array (the fixnum (length instance-slots))))
     285                 (i 0))
     286            (declare (simple-vector v) (fixnum i))
     287            (dolist (e instance-slots v)
     288              (setf (svref v i)
     289                    (%slot-definition-name e))
     290              (incf i))))
     291         (old-wrapper (%class-own-wrapper class))
     292         (new-wrapper
     293          (cond ((null old-wrapper)
     294                 (%cons-wrapper class))
     295                ((and old-wrapper *update-slots-preserve-existing-wrapper*)
     296                 old-wrapper)
     297                (t
     298                 (make-instances-obsolete class)
     299                 (%cons-wrapper class)))))
     300    (setf (%class-slots class) eslotds)
     301    (setf (%wrapper-instance-slots new-wrapper) new-ordering
     302          (%wrapper-class-slots new-wrapper) (%class-get class :class-slots)
     303          (%class-own-wrapper class) new-wrapper)
     304    (setup-slot-lookup new-wrapper eslotds)))
    312305
    313306
Note: See TracChangeset for help on using the changeset viewer.