7 (define-vop (length/list)
9 (:args (object :scs (descriptor-reg) :target ptr))
11 (:temporary (:scs (descriptor-reg) :from (:argument 0)) ptr)
12 (:temporary (:scs (non-descriptor-reg)) temp)
13 (:temporary (:scs (any-reg) :type fixnum :to (:result 0) :target result)
15 (:results (result :scs (any-reg descriptor-reg)))
18 (:save-p :compute-only)
25 (inst beq ptr null-tn done)
28 (inst and temp ptr lowtag-mask)
29 (inst xor temp list-pointer-lowtag)
30 (inst bne temp zero-tn not-list)
33 (loadw ptr ptr cons-cdr-slot list-pointer-lowtag)
35 (inst addu count count (fixnumize 1))
38 (cerror-call vop done object-not-list-error ptr)
44 (define-static-fun length (object) :translate length)