X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fslots.lisp;h=e726ba4a8723eee37f9f64b64d9f81c437d7a406;hb=56f96e77ade913d6363a3068c94e60f44ae9b3e7;hp=6d82bcd22b2f567d0c22979a4d30a82a8fd2f42e;hpb=26b8ddda97fcfa2e2c0eae3bd2fdb19717c5fa40;p=sbcl.git diff --git a/src/pcl/slots.lisp b/src/pcl/slots.lisp index 6d82bcd..e726ba4 100644 --- a/src/pcl/slots.lisp +++ b/src/pcl/slots.lisp @@ -28,7 +28,7 @@ (define-condition unbound-slot (cell-error) ((instance :reader unbound-slot-instance :initarg :instance) (slot :reader unbound-slot-slot :initarg :slot)) - (:report (lambda(condition stream) + (:report (lambda (condition stream) (format stream "The slot ~S is unbound in the object ~S." (unbound-slot-slot condition) (unbound-slot-instance condition))))) @@ -144,8 +144,6 @@ `(accessor-set-slot-value ,object-form ,slot-name-form ,new-value-form) `(set-slot-value-normal ,object-form ,slot-name-form ,new-value-form))) -(defconstant +optimize-slot-boundp+ nil) - (defun slot-boundp (object slot-name) (let* ((class (class-of object)) (slot-definition (find-slot-definition class slot-name))) @@ -193,16 +191,14 @@ (value (typecase location (fixnum (cond ((std-instance-p object) - ;; FIXME: EQ T (WRAPPER-STATE ..) is better done - ;; through INVALID-WRAPPER-P (here and below). - (unless (eq t (wrapper-state (std-instance-wrapper - object))) + (when (invalid-wrapper-p (std-instance-wrapper + object)) (check-wrapper-validity object)) (clos-slots-ref (std-instance-slots object) location)) ((fsc-instance-p object) - (unless (eq t (wrapper-state (fsc-instance-wrapper - object))) + (when (invalid-wrapper-p (fsc-instance-wrapper + object)) (check-wrapper-validity object)) (clos-slots-ref (fsc-instance-slots object) location)) @@ -226,12 +222,12 @@ (typecase location (fixnum (cond ((std-instance-p object) - (unless (eq t (wrapper-state (std-instance-wrapper object))) + (when (invalid-wrapper-p (std-instance-wrapper object)) (check-wrapper-validity object)) (setf (clos-slots-ref (std-instance-slots object) location) new-value)) ((fsc-instance-p object) - (unless (eq t (wrapper-state (fsc-instance-wrapper object))) + (when (invalid-wrapper-p (fsc-instance-wrapper object)) (check-wrapper-validity object)) (setf (clos-slots-ref (fsc-instance-slots object) location) new-value)) @@ -251,14 +247,14 @@ (value (typecase location (fixnum (cond ((std-instance-p object) - (unless (eq t (wrapper-state (std-instance-wrapper - object))) + (when (invalid-wrapper-p (std-instance-wrapper + object)) (check-wrapper-validity object)) (clos-slots-ref (std-instance-slots object) location)) ((fsc-instance-p object) - (unless (eq t (wrapper-state (fsc-instance-wrapper - object))) + (when (invalid-wrapper-p (fsc-instance-wrapper + object)) (check-wrapper-validity object)) (clos-slots-ref (fsc-instance-slots object) location)) @@ -280,12 +276,12 @@ (typecase location (fixnum (cond ((std-instance-p object) - (unless (eq t (wrapper-state (std-instance-wrapper object))) + (when (invalid-wrapper-p (std-instance-wrapper object)) (check-wrapper-validity object)) (setf (clos-slots-ref (std-instance-slots object) location) +slot-unbound+)) ((fsc-instance-p object) - (unless (eq t (wrapper-state (fsc-instance-wrapper object))) + (when (invalid-wrapper-p (fsc-instance-wrapper object)) (check-wrapper-validity object)) (setf (clos-slots-ref (fsc-instance-slots object) location) +slot-unbound+))