Changeset 120


Ignore:
Timestamp:
Dec 12, 2003, 3:32:18 PM (21 years ago)
Author:
Gary Byers
Message:

SETUP-SLOT-LOOKUP does nothing if no slots.

File:
1 edited

Legend:

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

    r109 r120  
    306306 
    307307(defun setup-slot-lookup (wrapper eslotds)
    308   (let* ((nslots (length eslotds))
    309          (total-slot-ids (current-slot-index))
    310          (small (< nslots 255))
    311          (map
    312           (if small
    313             (make-array total-slot-ids :element-type '(unsigned-byte 8))
    314             (make-array total-slot-ids :element-type '(unsigned-byte 32))))
    315          (table (make-array (the fixnum (1+ nslots))))
    316          (i 0))
    317     (declare (fixnum nslots total-slot-ids i) (simple-vector table))
    318     (setf (svref table 0) nil)
    319     (dolist (slotd eslotds)
    320       (incf i)
    321       (setf (svref table i) slotd)
    322       (setf (aref map
    323                   (slot-id.index
    324                    (standard-effective-slot-definition.slot-id slotd)))
    325             i))
    326     (let* ((lookup-f (gvector :function
    327                               (%svref (if small
    328                                         #'%small-map-slot-id-lookup
    329                                         #'%large-map-slot-id-lookup) 0)
    330                               map
    331                               table
    332                               (dpb 1 $lfbits-numreq
    333                                    (ash -1 $lfbits-noname-bit))))
    334            (class (%wrapper-class wrapper))
    335            (get-f (gvector :function
    336                            (%svref (if small
    337                                      #'%small-slot-id-value
    338                                      #'%large-slot-id-value) 0)
    339                            map
    340                            table
    341                            class
    342                            #'%maybe-std-slot-value-using-class
    343                            #'%slot-id-ref-missing
    344                            (dpb 2 $lfbits-numreq
    345                                 (ash -1 $lfbits-noname-bit))))
    346            (set-f (gvector :function
    347                            (%svref (if small
    348                                      #'%small-set-slot-id-value
    349                                      #'%large-set-slot-id-value) 0)
    350                            map
    351                            table
    352                            class
    353                            #'%maybe-std-setf-slot-value-using-class
    354                            #'%slot-id-set-missing
    355                            (dpb 3 $lfbits-numreq
    356                                 (ash -1 $lfbits-noname-bit)))))
    357       (setf (%wrapper-slot-id->slotd wrapper) lookup-f
    358             (%wrapper-slot-id-value wrapper) get-f
    359             (%wrapper-set-slot-id-value wrapper) set-f
    360             (%wrapper-slot-id-map wrapper) map
    361             (%wrapper-slot-definition-table wrapper) table)
    362       wrapper)))
     308  (when eslotds
     309    (let* ((nslots (length eslotds))
     310           (total-slot-ids (current-slot-index))
     311           (small (< nslots 255))
     312           (map
     313            (if small
     314              (make-array total-slot-ids :element-type '(unsigned-byte 8))
     315              (make-array total-slot-ids :element-type '(unsigned-byte 32))))
     316           (table (make-array (the fixnum (1+ nslots))))
     317           (i 0))
     318      (declare (fixnum nslots total-slot-ids i) (simple-vector table))
     319      (setf (svref table 0) nil)
     320      (dolist (slotd eslotds)
     321        (incf i)
     322        (setf (svref table i) slotd)
     323        (setf (aref map
     324                    (slot-id.index
     325                     (standard-effective-slot-definition.slot-id slotd)))
     326              i))
     327      (let* ((lookup-f (gvector :function
     328                                (%svref (if small
     329                                          #'%small-map-slot-id-lookup
     330                                          #'%large-map-slot-id-lookup) 0)
     331                                map
     332                                table
     333                                (dpb 1 $lfbits-numreq
     334                                     (ash -1 $lfbits-noname-bit))))
     335             (class (%wrapper-class wrapper))
     336             (get-f (gvector :function
     337                             (%svref (if small
     338                                       #'%small-slot-id-value
     339                                       #'%large-slot-id-value) 0)
     340                             map
     341                             table
     342                             class
     343                             #'%maybe-std-slot-value-using-class
     344                             #'%slot-id-ref-missing
     345                             (dpb 2 $lfbits-numreq
     346                                  (ash -1 $lfbits-noname-bit))))
     347             (set-f (gvector :function
     348                             (%svref (if small
     349                                       #'%small-set-slot-id-value
     350                                       #'%large-set-slot-id-value) 0)
     351                             map
     352                             table
     353                             class
     354                             #'%maybe-std-setf-slot-value-using-class
     355                             #'%slot-id-set-missing
     356                             (dpb 3 $lfbits-numreq
     357                                  (ash -1 $lfbits-noname-bit)))))
     358        (setf (%wrapper-slot-id->slotd wrapper) lookup-f
     359              (%wrapper-slot-id-value wrapper) get-f
     360              (%wrapper-set-slot-id-value wrapper) set-f
     361              (%wrapper-slot-id-map wrapper) map
     362              (%wrapper-slot-definition-table wrapper) table))))
     363  wrapper)
    363364
    364365                       
Note: See TracChangeset for help on using the changeset viewer.