Changeset 858


Ignore:
Timestamp:
Aug 10, 2004, 5:19:04 PM (20 years ago)
Author:
Gary Byers
Message:

late version of %MAKE-METHOD-INSTANCE, from HEL

File:
1 edited

Legend:

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

    r831 r858  
    280280
    281281(defun update-slots (class 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)))
     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))))
    305312
    306313
     
    12401247  (apply #'make-instance slotd-class initargs))
    12411248
     1249;;; Likewise, for methods
     1250(defun %make-method-instance (class &rest initargs)
     1251  (apply #'make-instance class initargs))
     1252
    12421253(defmethod initialize-instance :after ((slotd effective-slot-definition) &key name)
    12431254  (setf (standard-effective-slot-definition.slot-id slotd)
Note: See TracChangeset for help on using the changeset viewer.