Changeset 10378


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

Compiler-macros on INSTANCE-SLOTS, INSTANCE-CLASS-WRAPPER, %CLASS-OF-INSTANCE.
(All of this is from working-0711 branch.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/optimizers.lisp

    r10375 r10378  
    20952095           (eql (typecode instance) (nx-lookup-target-uvector-subtag :instance)))
    20962096    `(instance.slots ,instance)
    2097     w))
     2097    (let* ((itemp (gensym))
     2098           (typecode (gensym)))
     2099      `(let* ((,itemp ,instance)
     2100              (,typecode (typecode ,itemp)))
     2101        (declare (type (unsigned-byte 8) ,typecode))
     2102        (if (eql ,typecode ,(nx-lookup-target-uvector-subtag :instance))
     2103          (instance.slots ,itemp)
     2104          (%non-standard-instance-slots ,itemp ,typecode))))))
     2105
     2106
     2107(define-compiler-macro instance-class-wrapper (instance)
     2108  (let* ((itemp (gensym)))
     2109    `(let* ((,itemp ,instance))
     2110      (if (eql (the (unsigned-byte 8) (typecode ,itemp))
     2111               ,(nx-lookup-target-uvector-subtag :instance))
     2112        (instance.class-wrapper ,itemp)
     2113        (non-standard-instance-class-wrapper ,itemp)))))
     2114
     2115;; Instance must be a standard-instance.
     2116(define-compiler-macro %class-of-instance (instance)
     2117  `(%wrapper-class (instance.class-wrapper ,instance)))
    20982118
    20992119(define-compiler-macro unsigned-byte-p (x)
Note: See TracChangeset for help on using the changeset viewer.