Changeset 13364
- Timestamp:
- Jan 4, 2010, 8:44:17 AM (15 years ago)
- Location:
- branches/working-0711/ccl
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
level-1/l1-clos-boot.lisp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl
- Property svn:mergeinfo changed
/trunk/source merged: 13351
- Property svn:mergeinfo changed
-
branches/working-0711/ccl/level-1/l1-clos-boot.lisp
r13070 r13364 3111 3111 3112 3112 (defun exchange-slot-vectors-and-wrappers (a b) 3113 (if (typep a ' generic-function)3113 (if (typep a 'funcallable-standard-object) 3114 3114 (let* ((temp-wrapper (gf.instance.class-wrapper a)) 3115 3115 (orig-a-slots (gf.slots a)) … … 3158 3158 (let* ((old-wrapper (standard-object-p instance))) 3159 3159 (unless old-wrapper 3160 (when ( standard-generic-function-p instance)3160 (when (typep instance 'funcallable-standard-object) 3161 3161 (setq old-wrapper (gf.instance.class-wrapper instance))) 3162 3162 (unless old-wrapper 3163 (report-bad-arg instance '(or standard-instance standard-generic-function))))3164 (when (eql 0 (%wrapper-instance-slots old-wrapper)) ; is it really obsolete?3163 (report-bad-arg instance '(or standard-instance funcallable-standard-object)))) 3164 (when (eql 0 (%wrapper-instance-slots old-wrapper)) ; is it really obsolete? 3165 3165 (let* ((class (%wrapper-class old-wrapper)) 3166 3166 (new-wrapper (or (%class.own-wrapper class) … … 3174 3174 (new-class-slots (%wrapper-class-slots new-wrapper)) 3175 3175 (new-instance (allocate-instance class)) 3176 (old-slot-vector (instance .slots instance))3177 (new-slot-vector (instance .slots new-instance)))3178 ;; Lots to do. Hold onto your hat.3179 (let* ((old-size (uvsize old-instance-slots))3180 (new-size (uvsize new-instance-slots)))3181 (declare (fixnum old-size new-size))3182 (dotimes (i old-size)3183 (declare (fixnum i))3184 (let* ((slot-name (%svref old-instance-slots i))3185 (pos (%vector-member slot-name new-instance-slots))3186 (val (%svref old-slot-vector (%i+ i 1))))3187 (if pos3188 (setf (%svref new-slot-vector (%i+ pos 1)) val)3189 (progn3190 (push slot-name discarded)3191 (unless (eq val (%slot-unbound-marker))3192 (setf (getf plist slot-name) val))))))3193 ;; Go through old class slots3194 (dolist (pair old-class-slots)3195 (let* ((slot-name (%car pair))3196 (val (%cdr pair))3197 (pos (%vector-member slot-name new-instance-slots)))3198 (if pos3199 (setf (%svref new-slot-vector (%i+ pos 1)) val)3200 (progn3201 (push slot-name discarded)3202 (unless (eq val (%slot-unbound-marker))3203 (setf (getf plist slot-name) val))))))3204 ; Go through new instance slots3205 (dotimes (i new-size)3206 (declare (fixnum i))3207 (let* ((slot-name (%svref new-instance-slots i)))3208 (unless (or (%vector-member slot-name old-instance-slots)3209 (assoc slot-name old-class-slots))3210 (push slot-name added))))3211 ;; Go through new class slots3212 (dolist (pair new-class-slots)3213 (let ((slot-name (%car pair)))3214 (unless (or (%vector-member slot-name old-instance-slots)3215 (assoc slot-name old-class-slots))3216 (push slot-name added))))3217 (exchange-slot-vectors-and-wrappers new-instance instance))))))3176 (old-slot-vector (instance-slots instance)) 3177 (new-slot-vector (instance-slots new-instance))) 3178 ;; Lots to do. Hold onto your hat. 3179 (let* ((old-size (uvsize old-instance-slots)) 3180 (new-size (uvsize new-instance-slots))) 3181 (declare (fixnum old-size new-size)) 3182 (dotimes (i old-size) 3183 (declare (fixnum i)) 3184 (let* ((slot-name (%svref old-instance-slots i)) 3185 (pos (%vector-member slot-name new-instance-slots)) 3186 (val (%svref old-slot-vector (%i+ i 1)))) 3187 (if pos 3188 (setf (%svref new-slot-vector (%i+ pos 1)) val) 3189 (progn 3190 (push slot-name discarded) 3191 (unless (eq val (%slot-unbound-marker)) 3192 (setf (getf plist slot-name) val)))))) 3193 ;; Go through old class slots 3194 (dolist (pair old-class-slots) 3195 (let* ((slot-name (%car pair)) 3196 (val (%cdr pair)) 3197 (pos (%vector-member slot-name new-instance-slots))) 3198 (if pos 3199 (setf (%svref new-slot-vector (%i+ pos 1)) val) 3200 (progn 3201 (push slot-name discarded) 3202 (unless (eq val (%slot-unbound-marker)) 3203 (setf (getf plist slot-name) val)))))) 3204 ; Go through new instance slots 3205 (dotimes (i new-size) 3206 (declare (fixnum i)) 3207 (let* ((slot-name (%svref new-instance-slots i))) 3208 (unless (or (%vector-member slot-name old-instance-slots) 3209 (assoc slot-name old-class-slots)) 3210 (push slot-name added)))) 3211 ;; Go through new class slots 3212 (dolist (pair new-class-slots) 3213 (let ((slot-name (%car pair))) 3214 (unless (or (%vector-member slot-name old-instance-slots) 3215 (assoc slot-name old-class-slots)) 3216 (push slot-name added)))) 3217 (exchange-slot-vectors-and-wrappers new-instance instance)))))) 3218 3218 ;; run user code with interrupts enabled. 3219 3219 (update-instance-for-redefined-class instance added discarded plist))
Note:
See TracChangeset
for help on using the changeset viewer.
