X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fsubprim.lisp;h=44fa889cef69fc13dce4b0656a240326671e6338;hb=9c510b74eca61bbcc2014dc2b1d02049dff50508;hp=a69d208dcb318cabd2f5cac5114450a0ea68de6e;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/compiler/x86/subprim.lisp b/src/compiler/x86/subprim.lisp index a69d208..44fa889 100644 --- a/src/compiler/x86/subprim.lisp +++ b/src/compiler/x86/subprim.lisp @@ -11,9 +11,6 @@ ;;;; files for more information. (in-package "SB!VM") - -(file-comment - "$Header$") ;;;; LENGTH @@ -32,26 +29,26 @@ ;; Move OBJECT into a temp we can bash on, and initialize the count. (move ptr object) (inst xor count count) - ;; If we are starting with NIL, then it's real easy. - (inst cmp ptr *nil-value*) + ;; If we are starting with NIL, then it's really easy. + (inst cmp ptr nil-value) (inst jmp :e done) ;; Note: we don't have to test to see whether the original argument is a ;; list, because this is a :fast-safe vop. LOOP ;; Get the CDR and boost the count. - (loadw ptr ptr cons-cdr-slot list-pointer-type) + (loadw ptr ptr cons-cdr-slot list-pointer-lowtag) (inst add count (fixnumize 1)) ;; If we hit NIL, then we are done. - (inst cmp ptr *nil-value*) + (inst cmp ptr nil-value) (inst jmp :e done) ;; Otherwise, check to see whether we hit the end of a dotted list. If ;; not, loop back for more. (move eax ptr) (inst and al-tn lowtag-mask) - (inst cmp al-tn list-pointer-type) + (inst cmp al-tn list-pointer-lowtag) (inst jmp :e loop) ;; It's dotted all right. Flame out. - (error-call vop object-not-list-error ptr) + (error-call vop 'object-not-list-error ptr) ;; We be done. DONE)) @@ -71,15 +68,17 @@ (move ptr object) (inst xor count count) ;; If we are starting with NIL, we be done. - (inst cmp ptr *nil-value*) + (inst cmp ptr nil-value) (inst jmp :e done) ;; Indirect the next cons cell, and boost the count. LOOP - (loadw ptr ptr cons-cdr-slot list-pointer-type) + (loadw ptr ptr cons-cdr-slot list-pointer-lowtag) (inst add count (fixnumize 1)) ;; If we aren't done, go back for more. - (inst cmp ptr *nil-value*) + (inst cmp ptr nil-value) (inst jmp :ne loop) DONE)) -(define-static-function length (object) :translate length) +(define-static-fun length (object) :translate length) +(define-static-fun %coerce-callable-to-fun (callable) + :translate %coerce-callable-to-fun)