Changeset 10376


Ignore:
Timestamp:
Aug 6, 2008, 11:40:25 AM (11 years ago)
Author:
gb
Message:

INSTANCE-CLASS-WRAPPER: non-generic, split into standard, non-standard
instance cases.

Location:
trunk/source/level-1
Files:
2 edited

Legend:

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

    r10309 r10376  
    11751175                       
    11761176;;;;;;;;;;;;;;;;;;;;;;;;  Instances and classes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     1177
     1178(declaim (inline non-standard-instance-class-wrapper))
     1179
     1180(defun non-standard-instance-class-wrapper (instance)
     1181  (let* ((typecode (typecode instance)))
     1182    (declare (type (unsigned-byte 8) typecode))
     1183    (cond ((eql typecode target::subtag-istruct)
     1184           (istruct-cell-info (%svref instance 0)))
     1185          ((eql typecode target::subtag-basic-stream)
     1186           (%class.own-wrapper (basic-stream.class instance)))
     1187          ((typep instance 'funcallable-standard-object)
     1188           (gf.instance.class-wrapper instance))
     1189          ((eql typecode target::subtag-macptr)
     1190           (foreign-instance-class-wrapper instance))
     1191          (t (%class.own-wrapper (class-of instance))))))
     1192
     1193(defun instance-class-wrapper (instance)
     1194  (if (= (typecode instance) target::subtag-instance)
     1195    (instance.class-wrapper instance)
     1196    (non-standard-instance-class-wrapper instance)))
     1197
    11771198
    11781199(defvar %find-classes% (make-hash-table :test 'eq))
     
    35403561(setf (fdefinition '%do-remove-direct-method) #'remove-direct-method)
    35413562
    3542 (defmethod instance-class-wrapper (x)
    3543   (%class.own-wrapper (class-of x)))
    3544 
    3545 (defmethod instance-class-wrapper ((instance standard-object))
    3546   (if (%standard-instance-p instance)
    3547     (instance.class-wrapper instance)
    3548     (if (typep instance 'macptr)
    3549       (foreign-instance-class-wrapper instance)
    3550       (%class.own-wrapper (class-of instance)))))
    3551 
    3552 (defmethod instance-class-wrapper ((instance standard-generic-function))
    3553   (gf.instance.class-wrapper  instance))
    3554 
    3555 
    3556                                    
     3563
    35573564
    35583565(defun generic-function-wrapper (gf)
  • trunk/source/level-1/l1-clos.lisp

    r10029 r10376  
    17151715
    17161716
    1717 (defmethod instance-class-wrapper ((instance funcallable-standard-object))
    1718   (gf.instance.class-wrapper  instance))
     1717
    17191718
    17201719(defun set-funcallable-instance-function (funcallable-instance function)
Note: See TracChangeset for help on using the changeset viewer.