1.0.9.11: even faster SLOT-VALUE &co
[sbcl.git] / src / pcl / slots-boot.lisp
index 36b70d9..fce40c0 100644 (file)
 ;;;   FUNCALLABLE-STANDARD-CLASS.
 
 (defun find-slot-definition (class slot-name)
-  (declare (symbol slot-name))
-  (let* ((vector (class-slot-vector class))
-         (index (rem (sxhash slot-name) (length vector))))
-    (declare (simple-vector vector) (index index)
-             (optimize (sb-c::insert-array-bounds-checks 0)))
-    (do ((plist (the list (svref vector index)) (cdr plist)))
-        ((not (consp plist)))
-      (let ((key (car plist)))
-        (setf plist (cdr plist))
-        (when (eq key slot-name)
-          (return (cddar plist)))))))
+  (dolist (slotd (class-slots class))
+    (when (eq slot-name (slot-definition-name slotd))
+      (return slotd))))
 
-(defun find-slot-cell (class slot-name)
+(defun find-slot-cell (wrapper slot-name)
   (declare (symbol slot-name))
-  (let* ((vector (class-slot-vector class))
+  (let* ((vector (layout-slot-table wrapper))
          (index (rem (sxhash slot-name) (length vector))))
     (declare (simple-vector vector) (index index)
              (optimize (sb-c::insert-array-bounds-checks 0)))
         (when (eq key slot-name)
           (return (car plist)))))))
 
-(defun make-slot-vector (class slots)
+(defun make-slot-table (class slots)
   (let* ((n (+ (length slots) 2))
          (vector (make-array n :initial-element nil))
          (save-slot-location-p