X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fknownfun.lisp;h=4030b09016558903605d42f41bea53582abae48d;hb=ba7659c92f2b7fac7e9532a3db9114c5bdc4ab55;hp=84799f178a5ce5a3cad8af6c054d162913297466;hpb=5251267b300cb967cbf547e838037a616064bd58;p=sbcl.git diff --git a/src/compiler/knownfun.lisp b/src/compiler/knownfun.lisp index 84799f1..4030b09 100644 --- a/src/compiler/knownfun.lisp +++ b/src/compiler/knownfun.lisp @@ -66,7 +66,7 @@ (defstruct (function-info #-sb-xc-host (:pure t)) ;; Boolean attributes of this function. - (attributes (required-argument) :type attributes) + (attributes (missing-arg) :type attributes) ;; A list of Transform structures describing transforms for this function. (transforms () :type list) ;; A function which computes the derived type for a call to this function by @@ -99,11 +99,7 @@ (predicate-type nil :type (or ctype null)) ;; If non-null, use this function to annotate the known call for the byte ;; compiler. If it returns NIL, then change the call to :full. - (byte-annotate nil :type (or function null)) - ;; If non-null, use this function to generate the byte code for this known - ;; call. This function can only give up if there is a byte-annotate function - ;; that arranged for the functional to be pushed onto the stack. - (byte-compile nil :type (or function null))) + (byte-annotate nil :type (or function null))) (defprinter (function-info) (transforms :test transforms) @@ -113,23 +109,31 @@ (ir2-convert :test ir2-convert) (templates :test templates) (predicate-type :test predicate-type) - (byte-annotate :test byte-annotate) - (byte-compile :test byte-compile)) + (byte-annotate :test byte-annotate)) ;;;; interfaces to defining macros ;;; an IR1 transform (defstruct (transform (:copier nil)) - ;; the function-type which enables this transform - (type (required-argument) :type ctype) + ;; the function type which enables this transform. + ;; + ;; (Note that declaring this :TYPE FUN-TYPE probably wouldn't + ;; work because some function types, like (SPECIFIER-TYPE 'FUNCTION0 + ;; itself, are represented as BUILT-IN-TYPE, and at least as of + ;; sbcl-0.pre7.54 or so, that's inconsistent with being a + ;; FUN-TYPE.) + (type (missing-arg) :type ctype) ;; the transformation function. Takes the COMBINATION node and returns a ;; lambda, or throws out. - (function (required-argument) :type function) - ;; string used in efficency notes - (note (required-argument) :type string) + (function (missing-arg) :type function) + ;; string used in efficiency notes + (note (missing-arg) :type string) ;; T if we should emit a failure note even if SPEED=INHIBIT-WARNINGS. (important nil :type (member t nil)) - ;; usable for byte code, native code, or both + ;; usable for byte code, native code, or both? + ;; + ;; FIXME: Now that there's no byte compiler, this is stale and could + ;; all go away. (when :native :type (member :byte :native :both))) (defprinter (transform) type note important when) @@ -151,7 +155,8 @@ (eq (transform-when x) when))) (function-info-transforms info)))) (if old - (setf (transform-function old) fun (transform-note old) note) + (setf (transform-function old) fun + (transform-note old) note) (push (make-transform :type ctype :function fun :note note :important important :when when) (function-info-transforms info))) @@ -169,7 +174,7 @@ (info (make-function-info :attributes attributes :derive-type derive-type :optimizer optimizer)) - (target-env (or *backend-info-environment* *info-environment*))) + (target-env *info-environment*)) (dolist (name names) (let ((old-function-info (info :function :info name))) (when old-function-info @@ -198,8 +203,12 @@ ;;; through here. (declaim (ftype (function (t) function-info) function-info-or-lose)) (defun function-info-or-lose (name) - (let ((*info-environment* (or *backend-info-environment* - *info-environment*))) + (let (;; FIXME: Do we need this rebinding here? It's a literal + ;; translation of the old CMU CL rebinding to + ;; (OR *BACKEND-INFO-ENVIRONMENT* *INFO-ENVIRONMENT*), + ;; and it's not obvious whether the rebinding to itself is + ;; needed that SBCL doesn't need *BACKEND-INFO-ENVIRONMENT*. + (*info-environment* *info-environment*)) (let ((old (info :function :info name))) (unless old (error "~S is not a known function." name)) (setf (info :function :info name) (copy-function-info old)))))