1.0.8.25: refactor CAN-OPTIMIZE-ACCESS usage and interface
[sbcl.git] / src / pcl / braid.lisp
index 00b4adc..5fcad4d 100644 (file)
     (set-slot 'name name)
     (set-slot 'finalized-p t)
     (set-slot 'source source)
+    (set-slot 'safe-p nil)
     (set-slot '%type (if (eq class (find-class t))
                          t
                          ;; FIXME: Could this just be CLASS instead
                                  structure-class condition-class
                                  slot-class))
       (set-slot 'direct-slots direct-slots)
-      (set-slot 'slots slots))
+      (set-slot 'slots slots)
+      (set-slot 'slot-vector (make-slot-vector slots)))
 
     ;; For all direct superclasses SUPER of CLASS, make sure CLASS is
     ;; a direct subclass of SUPER.  Note that METACLASS-NAME doesn't
       (set-val 'writers      (get-val :writers))
       (set-val 'allocation   :instance)
       (set-val '%type        (or (get-val :type) t))
+      (set-val '%type-check-function (get-val 'type-check-function))
       (set-val '%documentation (or (get-val :documentation) ""))
       (set-val '%class   class)
       (when effective-p
                         (list class-name)
                         (list class-name)
                         "automatically generated boundp method")))
-    (let ((gf (ensure-generic-function accessor-name
-                                       :lambda-list arglist)))
+    (let ((gf (ensure-generic-function accessor-name :lambda-list arglist)))
       (if (find specls (early-gf-methods gf)
                 :key #'early-method-specializers
                 :test 'equal)
                                        (cons name cpl)
                                        wrapper prototype))))))
 \f
-(defmacro wrapper-of-macro (x)
-  `(layout-of ,x))
-
-(defun class-of (x)
-  (wrapper-class* (wrapper-of-macro x)))
-
-;;; FIXME: We probably don't need both WRAPPER-OF and WRAPPER-OF-MACRO.
 #-sb-fluid (declaim (inline wrapper-of))
 (defun wrapper-of (x)
-  (wrapper-of-macro x))
+  (layout-of x))
+
+(defun class-of (x)
+  (wrapper-class* (wrapper-of x)))
 
 (defun eval-form (form)
   (lambda () (eval form)))
 (pushnew 'ensure-deffoo-class sb-kernel::*defstruct-hooks*)
 (pushnew 'ensure-deffoo-class sb-kernel::*define-condition-hooks*)
 \f
+;;; FIXME: only needed during bootstrap
 (defun make-class-predicate (class name)
   (let* ((gf (ensure-generic-function name :lambda-list '(object)))
          (mlist (if (eq *boot-state* 'complete)