:optimizer optimizer))
(target-env (or *backend-info-environment* *info-environment*)))
(dolist (name names)
+ (when (info :function :info name)
+ ;; This is an error because it's generally a bad thing to blow
+ ;; away all the old optimization stuff. It's also a potential
+ ;; source of sneaky bugs:
+ ;; DEFKNOWN FOO
+ ;; DEFTRANSFORM FOO
+ ;; DEFKNOWN FOO ; possibly hidden inside some macroexpansion
+ ;; ; Now the DEFTRANSFORM doesn't exist in the target Lisp.
+ ;; However, it's continuable because it might be useful to do
+ ;; it when testing new optimization stuff interactively.
+ #+nil (cerror "Go ahead, overwrite it."
+ "overwriting old FUNCTION-INFO for ~S" name)
+ (warn "overwriting old FUNCTION-INFO for ~S" name))
(setf (info :function :type name target-env) ctype)
(setf (info :function :where-from name target-env) :declared)
(setf (info :function :kind name target-env) :function)
names)
;;; Return the FUNCTION-INFO for NAME or die trying. Since this is
-;;; used by people who want to modify the info, and the info may be
+;;; used by callers who want to modify the info, and the info may be
;;; shared, we copy it. We don't have to copy the lists, since each
;;; function that has generators or transforms has already been
;;; through here.
:disp (- function-pointer-type other-pointer-type)))
(inst add func code)))
+;;; REMOVEME
(defknown %function-self (function) function (flushable))
(define-vop (%function-self)
:disp (- function-pointer-type
(* function-code-offset word-bytes))))))
-;;; The closure function slot is a pointer to raw code on X86 instead of
-;;; a pointer to the code function object itself. This VOP is used
+;;; The closure function slot is a pointer to raw code on X86 instead
+;;; of a pointer to the code function object itself. This VOP is used
;;; to reference the function object given the closure object.
(def-source-transform %closure-function (closure)
`(%function-self ,closure))
(def-source-transform %funcallable-instance-function (fin)
`(%function-self ,fin))
+;;; REMOVEME
(defknown (setf %function-self) (function function) function (unsafe))
(define-vop (%set-function-self)
(storew temp function function-self-slot function-pointer-type)
(move result new-self)))
-;; We would have really liked to use a source-transform for this, but
-;; they don't work with SETF functions.
+;;; REMOVEME
(defknown ((setf %funcallable-instance-function)) (function function) function
- (unsafe))
+ (unsafe))
+
+;;; CMU CL comment:
+;;; We would have really liked to use a source-transform for this, but
+;;; they don't work with SETF functions.
+;;; FIXME: Can't we just use DEFSETF or something?
(deftransform (setf %funcallable-instance-function) ((value fin))
'(setf (%function-self fin) value))
\f