From b80843eb9c1a6acb15d477f855a6f9d0f1c0b15b Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Thu, 2 Aug 2001 14:18:09 +0000 Subject: [PATCH] 0.6.12.62: made DEFMACRO DEFKNOWN check for duplicate DEFKNOWNs (I want to remove the duplicate DEFKNOWNs, but currently doing that makes make.sh die in src/pcl/walk.lisp. So I've put the duplicate DEFKNOWNs back, and things work again. Since by now I have a strong conditioned reflex "working version"=>"CVS checkin", I'll check this in before going on to try to figure out which duplicate DEFKNOWNs are important and why.) --- src/compiler/knownfun.lisp | 15 ++++++++++++++- src/compiler/x86/system.lisp | 16 +++++++++++----- version.lisp-expr | 2 +- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/compiler/knownfun.lisp b/src/compiler/knownfun.lisp index 5a30ffc..839ab45 100644 --- a/src/compiler/knownfun.lisp +++ b/src/compiler/knownfun.lisp @@ -171,6 +171,19 @@ :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) @@ -178,7 +191,7 @@ 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. diff --git a/src/compiler/x86/system.lisp b/src/compiler/x86/system.lisp index edb3f8c..89cac6d 100644 --- a/src/compiler/x86/system.lisp +++ b/src/compiler/x86/system.lisp @@ -214,6 +214,7 @@ :disp (- function-pointer-type other-pointer-type))) (inst add func code))) +;;; REMOVEME (defknown %function-self (function) function (flushable)) (define-vop (%function-self) @@ -228,8 +229,8 @@ :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)) @@ -237,6 +238,7 @@ (def-source-transform %funcallable-instance-function (fin) `(%function-self ,fin)) +;;; REMOVEME (defknown (setf %function-self) (function function) function (unsafe)) (define-vop (%set-function-self) @@ -254,10 +256,14 @@ (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)) diff --git a/version.lisp-expr b/version.lisp-expr index 6ab2baf..8763fc4 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -16,4 +16,4 @@ ;;; four numeric fields, is used for versions which aren't released ;;; but correspond only to CVS tags or snapshots. -"0.6.12.61" +"0.6.12.62" -- 1.7.10.4