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) :type random) 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)
21 (inst comb := ptr null-tn done)
24 (inst extru ptr 31 3 temp)
25 (inst comib :<> list-pointer-lowtag temp loose :nullify t)
26 (loadw ptr ptr cons-cdr-slot list-pointer-lowtag)
29 (inst addi (fixnumize 1) count count)
30 (inst comb := ptr null-tn done :nullify t)
31 (inst extru ptr 31 3 temp)
32 (inst comib := list-pointer-lowtag temp loop :nullify t)
33 (loadw ptr ptr cons-cdr-slot list-pointer-lowtag)
36 (cerror-call vop done object-not-list-error ptr)
41 (define-static-fun length (object) :translate length)