X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ffndb.lisp;h=151d30c499b51cae173dc6e1c981d20c3293bf98;hb=94ea2b2082deaa0331dfb66fa6af6ca12dd8dc83;hp=671ba33250dc83a02ec06dd5c83e0d3898bb2adc;hpb=7b384da95e6a30e1434523213aeeed3a90448c78;p=sbcl.git diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 671ba33..151d30c 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -17,24 +17,8 @@ (defknown coerce (t type-specifier) t ;; Note: - ;; (1) This is not FLUSHABLE because it's defined to signal errors. - ;; (2) It's not worth trying to make this FOLDABLE in the - ;; cross-compiler,because - ;; (a) it would probably be really hard to make all the - ;; tricky issues (e.g. which specialized array types are - ;; supported) match between cross-compiler and target - ;; compiler, and besides - ;; (b) leaving it not FOLDABLE lets us use the idiom - ;; (COERCE FOO 'SOME-SPECIALIZED-ARRAY-TYPE-OR-ANOTHER) - ;; as a way of delaying the generation of specialized - ;; array types until runtime, which helps us keep the - ;; cross-compiler's dumper relatively simple and which - ;; lets us preserve distinctions which might not even exist - ;; on the cross-compilation host (because ANSI doesn't - ;; guarantee that specialized array types exist there). - ;; FIXME: It's actually not clear that COERCE on non-NUMBER types - ;; is FOLDABLE at all. Check this. - (movable #-sb-xc-host foldable) + ;; This is not FLUSHABLE because it's defined to signal errors. + (movable) ;; :DERIVE-TYPE RESULT-TYPE-SPEC-NTH-ARG 2 ? Nope... (COERCE 1 'COMPLEX) ;; returns REAL/INTEGER, not COMPLEX. ) @@ -44,7 +28,7 @@ (defknown type-of (t) t (foldable flushable)) ;;; These can be affected by type definitions, so they're not FOLDABLE. -(defknown (upgraded-complex-part-type sb!xc:upgraded-array-element-type) +(defknown (sb!xc:upgraded-complex-part-type sb!xc:upgraded-array-element-type) (type-specifier &optional lexenv-designator) type-specifier (unsafely-flushable)) @@ -340,7 +324,7 @@ (defknown decode-float (float) (values float float-exponent float) (movable foldable flushable explicit-check)) -(defknown scale-float (float float-exponent) float +(defknown scale-float (float integer) float (movable foldable unsafely-flushable explicit-check)) (defknown float-radix (float) float-radix (movable foldable flushable)) @@ -421,7 +405,7 @@ (movable foldable flushable)) (defknown name-char (string-designator) (or character null) (movable foldable flushable)) -(defknown code-char (char-code) base-char +(defknown code-char (char-code) character ;; By suppressing constant folding on CODE-CHAR when the ;; cross-compiler is running in the cross-compilation host vanilla ;; ANSI Common Lisp, we can use CODE-CHAR expressions to delay until @@ -787,7 +771,7 @@ (defknown hash-table-size (hash-table) index (flushable)) (defknown hash-table-test (hash-table) symbol (foldable flushable)) (defknown sxhash (t) (integer 0 #.sb!xc:most-positive-fixnum) - (foldable flushable)) + (#-sb-xc-host foldable flushable)) ;;;; from the "Arrays" chapter @@ -827,12 +811,12 @@ bit-orc1 bit-orc2) ((array bit) (array bit) &optional (or (array bit) (member t nil))) (array bit) - (foldable) + () #|:derive-type #'result-type-last-arg|#) (defknown bit-not ((array bit) &optional (or (array bit) (member t nil))) (array bit) - (foldable) + () #|:derive-type #'result-type-last-arg|#) (defknown bit-vector-= (bit-vector bit-vector) boolean @@ -1058,7 +1042,8 @@ :derive-type #'result-type-first-arg) ;;; xxx-TO-STRING functions are not foldable because they depend on -;;; the dynamic environment. +;;; the dynamic environment, the state of the pretty printer dispatch +;;; table, and probably other run-time factors. (defknown write-to-string (t &key (:escape t) (:radix t) (:base (integer 2 36)) (:readably t) (:circle t) (:pretty t) (:level (or unsigned-byte null)) @@ -1066,7 +1051,7 @@ (:lines (or unsigned-byte null)) (:right-margin (or unsigned-byte null)) (:miser-width (or unsigned-byte null)) (:pprint-dispatch t)) simple-string - (foldable flushable explicit-check)) + (flushable explicit-check)) (defknown (prin1-to-string princ-to-string) (t) simple-string (flushable)) @@ -1191,7 +1176,7 @@ :rename-and-delete :overwrite :append :supersede nil)) (:if-does-not-exist (member :error :create nil)) - (:external-format (member :default))) + (:external-format keyword)) (or stream null)) (defknown rename-file (pathname-designator filename) @@ -1214,7 +1199,7 @@ (:verbose t) (:print t) (:if-does-not-exist (member :error :create nil)) - (:external-format (member :default))) + (:external-format keyword)) t) (defknown directory (pathname-designator &key) @@ -1256,17 +1241,17 @@ (values (or function symbol cons) boolean boolean)) (defknown compile-file - (filename + (pathname-designator &key ;; ANSI options - (:output-file (or filename + (:output-file (or pathname-designator null ;; FIXME: This last case is a non-ANSI hack. (member t))) (:verbose t) (:print t) - (:external-format t) + (:external-format keyword) ;; extensions (:trace-file t) @@ -1286,7 +1271,7 @@ (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)) +(defknown ed (&optional (or symbol cons filename)) t) (defknown dribble (&optional filename &key (:if-exists t)) (values)) @@ -1342,6 +1327,8 @@ ;;;; miscellaneous extensions (defknown get-bytes-consed () unsigned-byte (flushable)) +(defknown mask-signed-field ((integer 0 *) integer) integer + (movable flushable foldable)) ;;; PCOUNTERs (defknown incf-pcounter (pcounter unsigned-byte) pcounter) @@ -1362,9 +1349,7 @@ (defknown %cleanup-point () t) (defknown %special-bind (t t) t) (defknown %special-unbind (t) t) -(defknown %dynamic-extent-start () t) -(defknown %dynamic-extent-end () t) -(defknown %listify-rest-args (t index t) list (flushable)) +(defknown %listify-rest-args (t index) list (flushable)) (defknown %more-arg-context (t t) (values t index) (flushable)) (defknown %more-arg (t index) t) (defknown %more-arg-values (t index index) * (flushable)) @@ -1381,6 +1366,7 @@ (defknown %%primitive (t t &rest t) *) (defknown %pop-values (t) t) (defknown %nip-values (t t &rest t) (values)) +(defknown %allocate-closures (t) *) (defknown %type-check-error (t t) nil) ;; FIXME: This function does not return, but due to the implementation @@ -1467,6 +1453,19 @@ (defknown sb!vm::push-word-on-c-stack (system-area-pointer) (values) (unsafe)) (defknown sb!vm::pop-words-from-c-stack (index) (values) ()) +#!+linkage-table +(defknown foreign-symbol-dataref-address (simple-string) + system-area-pointer + (movable flushable)) + +(defknown foreign-symbol-address (simple-string &optional boolean) + system-area-pointer + (movable flushable)) + +(defknown foreign-symbol-address-as-integer (simple-string &optional boolean) + integer + (movable flushable)) + ;;;; miscellaneous internal utilities (defknown %fun-name (function) t (flushable)) @@ -1481,3 +1480,4 @@ (values) ()) (defknown style-warn (string &rest t) null ()) +