X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ffndb.lisp;h=4d78a8b7e1e9a2b47c859d25f1746c82b9306b66;hb=4e3b57699314dbd3883470d9b196287b178f3e6d;hp=67288ae09b3db6a337660a68c41034a4c2b021d2;hpb=334af30b26555f0bf706f7157b399bdbd4fad548;p=sbcl.git diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 67288ae..4d78a8b 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -38,9 +38,9 @@ :derive-type (result-type-specifier-nth-arg 2)) (defknown list-to-simple-string* (list) simple-string) (defknown list-to-bit-vector* (list) bit-vector) -(defknown list-to-vector* (list type) vector) +(defknown list-to-vector* (list type-specifier) vector) (defknown list-to-simple-vector* (list) simple-vector) -(defknown vector-to-vector* (vector type) vector) +(defknown vector-to-vector* (vector type-specifier) vector) (defknown vector-to-simple-string* (vector) vector) (defknown type-of (t) t (foldable flushable)) @@ -97,7 +97,7 @@ ;;;; classes -(sb!xc:deftype name-for-class () 't) +(sb!xc:deftype name-for-class () t) (defknown class-name (sb!xc:class) name-for-class (flushable)) (defknown find-class (name-for-class &optional t lexenv) (or sb!xc:class null) ()) @@ -249,12 +249,12 @@ (defknown lcm (&rest integer) unsigned-byte (movable foldable flushable explicit-check)) -#!-sb-propagate-fun-type +#+sb-xc-host ; (See CROSS-FLOAT-INFINITY-KLUDGE.) (defknown exp (number) irrational (movable foldable flushable explicit-check recursive) :derive-type #'result-type-float-contagion) -#!+sb-propagate-fun-type +#-sb-xc-host ; (See CROSS-FLOAT-INFINITY-KLUDGE.) (defknown exp (number) irrational (movable foldable flushable explicit-check recursive)) @@ -272,7 +272,7 @@ (defknown cis (real) (complex float) (movable foldable flushable explicit-check)) -#!-sb-propagate-fun-type +#+sb-xc-host ; (See CROSS-FLOAT-INFINITY-KLUDGE.) (progn (defknown (sin cos) (number) (or (float -1.0 1.0) (complex float)) @@ -289,7 +289,7 @@ :derive-type #'result-type-float-contagion) ) ; PROGN -#!+sb-propagate-fun-type +#-sb-xc-host ; (See CROSS-FLOAT-INFINITY-KLUDGE.) (progn (defknown (sin cos) (number) (or (float -1.0 1.0) (complex float)) @@ -756,7 +756,7 @@ (foldable flushable)) (defknown hash-table-size (hash-table) index (flushable)) (defknown hash-table-test (hash-table) symbol (foldable flushable)) -(defknown sxhash (t) (integer 0 #.sb!vm:*target-most-positive-fixnum*) +(defknown sxhash (t) (integer 0 #.sb!xc:most-positive-fixnum) (foldable flushable)) ;;;; from the "Arrays" chapter @@ -893,7 +893,7 @@ (movable foldable flushable)) (defknown (output-stream-p input-stream-p) (stream) boolean (movable foldable flushable)) -(defknown close (stream &key (:abort t)) stream ()) +(defknown close (stream &key (:abort t)) (eql t) ()) ;;;; from the "Input/Output" chapter: @@ -919,11 +919,11 @@ (defknown make-dispatch-macro-character (character &optional t readtable) (eql t) ()) (defknown set-dispatch-macro-character - (character character callable &optional readtable) (eql t) + (character character callable &optional readtable) function (unsafe)) (defknown get-dispatch-macro-character - (character character &optional (or readtable null)) callable - (flushable)) + (character character &optional (or readtable null)) (or callable null) + ()) ;;; may return any type due to eof-value... (defknown (read read-preserving-whitespace read-char-no-hang read-char) @@ -1058,7 +1058,7 @@ (:start index) (:end sequence-end) (:junk-allowed t)) - (values (or pathname null) index) + (values (or pathname null) sequence-end) ()) (defknown merge-pathnames @@ -1137,22 +1137,21 @@ (:verbose t) (:print t) (:if-does-not-exist (member :error :create nil)) - ;; FIXME: ANSI specifies an :EXTERNAL-FORMAT keyword too. - ) + (:external-format (member :default))) t) -(defknown directory (pathname-designator &key - (:check-for-subdirs t) - (:all t) - (:follow-links t)) +(defknown directory (pathname-designator &key) list (flushable)) ;;;; from the "Errors" chapter: -(defknown error (t &rest t) nil) ; never returns... +(defknown error (t &rest t) nil) ; never returns (defknown cerror (string t &rest t) null) (defknown warn (t &rest t) null) (defknown break (&optional t &rest t) null) + +;;; and analogous SBCL extension: +(defknown bug (t &rest t) nil) ; never returns ;;;; from the "Miscellaneous" Chapter: @@ -1162,6 +1161,8 @@ (defknown compile-file (filename &key + + ;; ANSI options (:output-file (or filename null ;; FIXME: This last case is a non-ANSI hack. @@ -1169,9 +1170,10 @@ (:verbose t) (:print t) (:external-format t) - (:block-compile t) - (:entry-points list) - (:byte-compile (member t nil :maybe))) + + ;; extensions + (:trace-file t) + (:block-compile t)) (values (or pathname null) boolean boolean)) (defknown disassemble (callable &key @@ -1185,11 +1187,10 @@ (defknown describe (t &optional (or stream (member t nil))) (values)) (defknown inspect (t) (values)) - (defknown room (&optional (member t nil :default)) (values)) (defknown ed (&optional (or symbol cons filename) &key (:init t) (:display t)) t) -(defknown dribble (&optional filename &key (:if-exists t)) t) +(defknown dribble (&optional filename &key (:if-exists t)) (values)) (defknown apropos (stringable &optional package-designator t) (values)) (defknown apropos-list (stringable &optional package-designator t) list @@ -1240,6 +1241,17 @@ (defknown constantly (t) function (movable flushable)) (defknown complement (function) function (movable flushable)) +;;;; miscellaneous extensions + +(defknown get-bytes-consed () unsigned-byte (flushable)) + +;;; PCOUNTERs +(defknown incf-pcounter (pcounter unsigned-byte) pcounter) +(defknown pcounter->integer (pcounter) unsigned-byte) +(defknown %incf-pcounter-or-fixnum ((or pcounter fixnum) unsigned-byte) + (or pcounter fixnum)) +(defknown pcounter-or-fixnum->integer ((or pcounter fixnum)) unsigned-byte) + ;;;; magical compiler frobs ;;; We can't fold this in general because of SATISFIES. There is a @@ -1256,8 +1268,8 @@ (defknown %more-arg-context (t t) (values t index) (flushable)) (defknown %more-arg (t index) t) (defknown %more-arg-values (t index index) * (flushable)) -(defknown %verify-argument-count (index index) (values)) -(defknown %argument-count-error (t) nil) +(defknown %verify-arg-count (index index) (values)) +(defknown %arg-count-error (t) nil) (defknown %unknown-values () *) (defknown %catch (t t) t) (defknown %unwind-protect (t t) t) @@ -1269,8 +1281,8 @@ (defknown %%primitive (t t &rest t) *) (defknown %pop-values (t) t) (defknown %type-check-error (t t) nil) -(defknown %odd-key-arguments-error () nil) -(defknown %unknown-key-argument-error (t) nil) +(defknown %odd-key-args-error () nil) +(defknown %unknown-key-arg-error (t) nil) (defknown (%ldb %mask-field) (bit-index bit-index integer) unsigned-byte (movable foldable flushable explicit-check)) (defknown (%dpb %deposit-field) (integer bit-index bit-index integer) integer @@ -1288,17 +1300,19 @@ (values (simple-array * (*)) index index index) (foldable flushable)) (defknown %set-symbol-package (symbol t) t (unsafe)) -(defknown %coerce-name-to-function ((or symbol cons)) function (flushable)) -(defknown %coerce-callable-to-function (callable) function (flushable)) - -;;; Structure slot accessors or setters are magically "known" to be -;;; these functions, although the var remains the Slot-Accessor -;;; describing the actual function called. -;;; -;;; FIXME: It would be nice to make structure slot accessors be -;;; ordinary functions. -(defknown %slot-accessor (t) t (flushable)) -(defknown %slot-setter (t t) t (unsafe)) +(defknown %coerce-name-to-fun ((or symbol cons)) function (flushable)) +(defknown %coerce-callable-to-fun (callable) function (flushable)) +(defknown failed-%with-array-data (t t t) nil) +(defknown %find-position + (t sequence t index sequence-end function function) + (values t (or index null)) + (flushable call)) +(defknown (%find-position-if %find-position-if-not) + (function sequence t index sequence-end function) + (values t (or index null)) + (call)) + +(defknown sb!kernel::arg-count-error (t t t t t t) nil (unsafe)) ;;;; SETF inverses @@ -1314,7 +1328,7 @@ (defknown %charset (string index character) character (unsafe)) (defknown %scharset (simple-string index character) character (unsafe)) (defknown %set-symbol-value (symbol t) t (unsafe)) -(defknown fset (symbol function) function (unsafe)) +(defknown (setf symbol-function) (function symbol) function (unsafe)) (defknown %set-symbol-plist (symbol t) t (unsafe)) (defknown (setf fdocumentation) ((or string null) t symbol) (or string null) @@ -1322,18 +1336,7 @@ (defknown %setnth (index list t) t (unsafe)) (defknown %set-fill-pointer (vector index) index (unsafe)) -;;;; internal type predicates - -;;; Simple TYPEP uses that don't have any standard predicate are -;;; translated into non-standard unary predicates. -(defknown (fixnump bignump ratiop short-float-p single-float-p double-float-p - long-float-p base-char-p %standard-char-p %instancep - array-header-p) - (t) boolean (movable foldable flushable)) - -;;;; miscellaneous "sub-primitives" +;;;; miscellaneous internal utilities -(defknown %sp-string-compare - (simple-string index index simple-string index index) - (or index null) - (foldable flushable)) +(defknown %fun-name (function) t (flushable)) +(defknown (setf %fun-name) (t function) t (unsafe))