- ;; ordinary STRUCTURE-OBJECT case: Handle native
- ;; structures with LAYOUTs and (possibly) raw slots.
- (%native-slot-accessor-funs (dd-ref-fun-name)
- (let ((instance-type-check-form
- '(%check-structure-type-from-layout instance layout)))
- (/show "macroexpanding %NATIVE-SLOT-ACCESSOR-FUNS" dd-ref-fun-name instance-type-check-form)
- `(let ((layout (dd-layout-or-lose dd))
- (dsd-raw-type (dsd-raw-type dsd)))
- #+sb-xc (/show0 "in %NATIVE-SLOT-ACCESSOR-FUNS macroexpanded code")
- ;; Map over all the possible RAW-TYPEs, compiling
- ;; a different closure function for each one, so
- ;; that once the COND over RAW-TYPEs happens (at
- ;; the time closure is allocated) there are no
- ;; more decisions to be made and things execute
- ;; reasonably efficiently.
- (cond
- ;; nonraw slot case
- ((eql dsd-raw-type t)
- #+sb-xc (/show0 "in nonraw slot case")
- (%slotplace-accessor-funs
- (,dd-ref-fun-name instance dsd-index)
- ,instance-type-check-form))
- ;; raw slot cases
- ,@(mapcar (lambda (rtd)
- (let ((raw-type (raw-slot-data-raw-type rtd))
- (accessor-name
- (raw-slot-data-accessor-name rtd))
- (n-words (raw-slot-data-n-words rtd)))
- `((equal dsd-raw-type ',raw-type)
- #+sb-xc (/show0 "in raw slot case")
- (let ((raw-index (dd-raw-index dd)))
- (multiple-value-bind (scaled-dsd-index
- misalignment)
- (floor dsd-index ,n-words)
- (aver (zerop misalignment))
- (%slotplace-accessor-funs
- (,accessor-name (,dd-ref-fun-name
- instance
- raw-index)
- scaled-dsd-index)
- ,instance-type-check-form))))))
- *raw-slot-data-list*)
- ;; oops
- (t
- (bug "unexpected DSD-RAW-TYPE ~S" dsd-raw-type))))))
- ;; code shared between DEFSTRUCT :TYPE LIST and
- ;; DEFSTRUCT :TYPE VECTOR cases: Handle the "typed
- ;; structure" case, with no LAYOUTs and no raw slots.
- (%colontyped-slot-accessor-funs () (error "stub"))
- ;; the common structure of the raw-slot and not-raw-slot
- ;; cases, defined in terms of the writable SLOTPLACE. All
- ;; possible flavors of slot access should be able to pass
- ;; through here.
- (%slotplace-accessor-funs (slotplace instance-type-check-form)
- (/show "macroexpanding %SLOTPLACE-ACCESSOR-FUNS" slotplace instance-type-check-form)
- `(let ((typecheckfun (typespec-typecheckfun dsd-type)))
+ ;; ordinary STRUCTURE-OBJECT case: Handle native
+ ;; structures with LAYOUTs and (possibly) raw slots.
+ (%native-slot-accessor-funs (dd-ref-fun-name)
+ (let ((instance-type-check-form
+ '(%check-structure-type-from-layout instance layout)))
+ (/show "macroexpanding %NATIVE-SLOT-ACCESSOR-FUNS" dd-ref-fun-name instance-type-check-form)
+ `(let ((layout (dd-layout-or-lose dd))
+ (dsd-raw-type (dsd-raw-type dsd)))
+ #+sb-xc (/show0 "in %NATIVE-SLOT-ACCESSOR-FUNS macroexpanded code")
+ ;; Map over all the possible RAW-TYPEs, compiling
+ ;; a different closure function for each one, so
+ ;; that once the COND over RAW-TYPEs happens (at
+ ;; the time closure is allocated) there are no
+ ;; more decisions to be made and things execute
+ ;; reasonably efficiently.
+ (cond
+ ;; nonraw slot case
+ ((eql dsd-raw-type t)
+ #+sb-xc (/show0 "in nonraw slot case")
+ (%slotplace-accessor-funs
+ (,dd-ref-fun-name instance dsd-index)
+ ,instance-type-check-form))
+ ;; raw slot cases
+ ,@(mapcar (lambda (rtd)
+ (let ((raw-type (raw-slot-data-raw-type rtd))
+ (accessor-name
+ (raw-slot-data-accessor-name rtd)))
+ `((equal dsd-raw-type ',raw-type)
+ #+sb-xc (/show0 "in raw slot case")
+ (%slotplace-accessor-funs
+ (,accessor-name instance dsd-index)
+ ,instance-type-check-form))))
+ *raw-slot-data-list*)
+ ;; oops
+ (t
+ (bug "unexpected DSD-RAW-TYPE ~S" dsd-raw-type))))))
+ ;; code shared between DEFSTRUCT :TYPE LIST and
+ ;; DEFSTRUCT :TYPE VECTOR cases: Handle the "typed
+ ;; structure" case, with no LAYOUTs and no raw slots.
+ (%colontyped-slot-accessor-funs () (error "stub"))
+ ;; the common structure of the raw-slot and not-raw-slot
+ ;; cases, defined in terms of the writable SLOTPLACE. All
+ ;; possible flavors of slot access should be able to pass
+ ;; through here.
+ (%slotplace-accessor-funs (slotplace instance-type-check-form)
+ (/show "macroexpanding %SLOTPLACE-ACCESSOR-FUNS" slotplace instance-type-check-form)
+ `(let ((typecheckfun (typespec-typecheckfun dsd-type)))