Skip to content

Commit

Permalink
0.pre7.129:
Browse files Browse the repository at this point in the history
	s/function/fun in...
	...valid-function
	...seen-function
	...arg-function
	...cached-function
	...setf-function
	...escape-function
	...cleanup-function
	...propagate-function
	...really-function
	...free-function
	...apparent-function
	...extract-function
	...function-continuation
	...function-info
	...continuation-function
	...coerce-function
	...first-function
	...core-function
	...initial-function
	...function-entry
	...function-subtype
	...compute-function
	...function-epilogue
	...function-prologue
	s/set-up-function-translation/!set-up-fun-translation/
  • Loading branch information
William Harold Newman committed Jan 14, 2002
1 parent a92c91a commit 29a9ccc
Show file tree
Hide file tree
Showing 52 changed files with 331 additions and 327 deletions.
8 changes: 4 additions & 4 deletions package-data-list.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"*BACKEND-T-PRIMITIVE-TYPE*"

"*CODE-SEGMENT*"
"*COUNT-VOP-USAGES*" "*ELSEWHERE*" "*FREE-FUNCTIONS*"
"*COUNT-VOP-USAGES*" "*ELSEWHERE*" "*FREE-FUNS*"
"*SETF-ASSUMED-FBOUNDP*"
"*SUPPRESS-VALUES-DECLARATION*"

Expand All @@ -200,7 +200,7 @@
"COMPILE-LAMBDA-FOR-DEFUN"
"%COMPILER-DEFUN" "COMPILER-ERROR"
"COMPONENT" "COMPONENT-HEADER-LENGTH"
"COMPONENT-INFO" "COMPONENT-LIVE-TN" "COMPUTE-FUNCTION"
"COMPONENT-INFO" "COMPONENT-LIVE-TN" "COMPUTE-FUN"
"COMPUTE-OLD-NFP" "COPY-MORE-ARG"
"CURRENT-BINDING-POINTER" "CURRENT-NFP-TN"
"CURRENT-STACK-POINTER" "DEALLOC-ALIEN-STACK-SPACE"
Expand Down Expand Up @@ -1211,7 +1211,7 @@ is a good idea, but see SB-SYS re. blurring of boundaries."
"FDEFN-NAME" "FDEFN-FUN"
"FDEFN-MAKUNBOUND" "OUTER-FDEFN"
"%COERCE-CALLABLE-TO-FUN"
"FUNCTION-SUBTYPE" "*MAXIMUM-ERROR-DEPTH*"
"FUN-SUBTYPE" "*MAXIMUM-ERROR-DEPTH*"
"%SET-SYMBOL-PLIST" "INFINITE-ERROR-PROTECT"
"FIND-CALLER-NAME-AND-FRAME"
"%SET-SYMBOL-VALUE" "%SET-SYMBOL-PACKAGE"
Expand Down Expand Up @@ -1831,7 +1831,7 @@ structure representations"
"*TARGET-MOST-POSITIVE-FIXNUM*"
"STATIC-SPACE-START" "STATIC-SPACE-END"
"TRACE-TABLE-CALL-SITE"
"TRACE-TABLE-FUNCTION-EPILOGUE" "TRACE-TABLE-FUNCTION-PROLOGUE"
"TRACE-TABLE-FUN-EPILOGUE" "TRACE-TABLE-FUN-PROLOGUE"
"TRACE-TABLE-NORMAL" "N-WIDETAG-BITS" "WIDETAG-MASK"
"UNBOUND-MARKER-WIDETAG"
"UNSIGNED-IMMEDIATE-SC-NUMBER"
Expand Down
2 changes: 1 addition & 1 deletion src/code/debug-info.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@

;;; ### For functions with XEPs, name could be represented more simply
;;; and compactly as some sort of info about with how to find the
;;; FUNCTION-ENTRY that this is a function for. Actually, you really
;;; function entry that this is a function for. Actually, you really
;;; hardly need any info. You can just chain through the functions in
;;; the component until you find the right one. Well, I guess you need
;;; to at least know which function is an XEP for the real function
Expand Down
4 changes: 2 additions & 2 deletions src/code/early-setf.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ GET-SETF-EXPANSION directly."
`(funcall #'(setf ,(car form)))
t))))

(defun get-setf-method-inverse (form inverse setf-function)
(defun get-setf-method-inverse (form inverse setf-fun)
(let ((new-var (gensym))
(vars nil)
(vals nil))
Expand All @@ -110,7 +110,7 @@ GET-SETF-EXPANSION directly."
(push x vals))
(setq vals (nreverse vals))
(values vars vals (list new-var)
(if setf-function
(if setf-fun
`(,@inverse ,new-var ,@vars)
`(,@inverse ,@vars ,new-var))
`(,(car form) ,@vars))))
Expand Down
2 changes: 1 addition & 1 deletion src/code/fop.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ bug.~:@>")
(unless (zerop (logand offset sb!vm:lowtag-mask))
(error "internal error: unaligned function object, offset = #X~X"
offset))
(let ((fun (%primitive sb!c:compute-function code-object offset)))
(let ((fun (%primitive sb!c:compute-fun code-object offset)))
(setf (%simple-fun-self fun) fun)
(setf (%simple-fun-next fun) (%code-entry-points code-object))
(setf (%code-entry-points code-object) fun)
Expand Down
8 changes: 4 additions & 4 deletions src/code/kernel.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
(sb!c::control-stack-pointer-sap))

;;; Return the header typecode for FUNCTION. Can be set with SETF.
(defun function-subtype (function)
(function-subtype function))
(defun (setf function-subtype) (type function)
(setf (function-subtype function) type))
(defun fun-subtype (function)
(fun-subtype function))
(defun (setf fun-subtype) (type function)
(setf (fun-subtype function) type))

;;; Extract the arglist from the function header FUNC.
(defun %simple-fun-arglist (func)
Expand Down
2 changes: 1 addition & 1 deletion src/code/ntrace.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
;;;; internal state

;;; a hash table that maps each traced function to the TRACE-INFO. The
;;; entry for a closure is the shared function-entry object.
;;; entry for a closure is the shared function entry object.
(defvar *traced-funs* (make-hash-table :test 'eq))

;;; A TRACE-INFO object represents all the information we need to
Expand Down
2 changes: 1 addition & 1 deletion src/code/print.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@
(*print-level* 3) ; ..print an interpreted function definition
;; FIXME: This find-the-function-name idiom ought to be
;; encapsulated in a function somewhere.
(name (case (function-subtype object)
(name (case (fun-subtype object)
(#.sb!vm:closure-header-widetag "CLOSURE")
(#.sb!vm:simple-fun-header-widetag (%simple-fun-name object))
(t 'no-name-available)))
Expand Down
2 changes: 1 addition & 1 deletion src/code/save.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

(sb!alien:define-alien-routine "save" (sb!alien:boolean)
(file sb!c-call:c-string)
(initial-function (sb!alien:unsigned #.sb!vm:n-word-bits)))
(initial-fun (sb!alien:unsigned #.sb!vm:n-word-bits)))

;;; FIXME: When this is run without the PURIFY option,
;;; it seems to save memory all the way up to the high-water mark,
Expand Down
12 changes: 6 additions & 6 deletions src/code/seq.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -760,29 +760,29 @@
;;; length of the output sequence matches any length specified
;;; in RESULT-TYPE.
(defun %map (result-type function first-sequence &rest more-sequences)
(let ((really-function (%coerce-callable-to-fun function)))
(let ((really-fun (%coerce-callable-to-fun function)))
;; Handle one-argument MAP NIL specially, using ETYPECASE to turn
;; it into something which can be DEFTRANSFORMed away. (It's
;; fairly important to handle this case efficiently, since
;; quantifiers like SOME are transformed into this case, and since
;; there's no consing overhead to dwarf our inefficiency.)
(if (and (null more-sequences)
(null result-type))
(%map-for-effect-arity-1 really-function first-sequence)
(%map-for-effect-arity-1 really-fun first-sequence)
;; Otherwise, use the industrial-strength full-generality
;; approach, consing O(N-ARGS) temporary storage (which can have
;; DYNAMIC-EXTENT), then using O(N-ARGS * RESULT-LENGTH) time.
(let ((sequences (cons first-sequence more-sequences)))
(case (type-specifier-atom result-type)
((nil) (%map-for-effect really-function sequences))
(list (%map-to-list really-function sequences))
((nil) (%map-for-effect really-fun sequences))
(list (%map-to-list really-fun sequences))
((simple-vector simple-string vector string array simple-array
bit-vector simple-bit-vector base-string simple-base-string)
(%map-to-vector result-type really-function sequences))
(%map-to-vector result-type really-fun sequences))
(t
(apply #'map
(result-type-or-lose result-type t)
really-function
really-fun
sequences)))))))

(defun map (result-type function first-sequence &rest more-sequences)
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/aliencomp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
(let ((alien-node (continuation-use alien)))
(typecase alien-node
(combination
(extract-function-args alien '%sap-alien 2)
(extract-fun-args alien '%sap-alien 2)
'(lambda (sap type)
(declare (ignore type))
sap))
Expand Down Expand Up @@ -582,7 +582,7 @@
(unless (and (constant-continuation-p inside-amount)
(not (minusp (continuation-value inside-amount))))
(give-up-ir1-transform)))))
(extract-function-args value 'ash 2)
(extract-fun-args value 'ash 2)
'(lambda (value amount1 amount2)
(ash value (+ amount1 amount2))))

Expand Down
12 changes: 6 additions & 6 deletions src/compiler/alpha/call.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
;; Make sure the function is aligned, and drop a label pointing to
;; this function header.
(align n-lowtag-bits)
(trace-table-entry trace-table-function-prologue)
(trace-table-entry trace-table-fun-prologue)
(emit-label start-lab)
;; Allocate function header.
(inst simple-fun-header-word)
Expand Down Expand Up @@ -163,7 +163,7 @@
(nfp :scs (any-reg)))
(:info callee)
(:generator 2
(trace-table-entry trace-table-function-prologue)
(trace-table-entry trace-table-fun-prologue)
(move csp-tn res)
(inst lda
csp-tn
Expand Down Expand Up @@ -541,7 +541,7 @@ default-value-8
(:ignore val-locs vals)
(:vop-var vop)
(:generator 6
(trace-table-entry trace-table-function-epilogue)
(trace-table-entry trace-table-fun-epilogue)
(maybe-load-stack-tn ocfp-temp ocfp)
(maybe-load-stack-tn return-pc-temp return-pc)
(move cfp-tn csp-tn)
Expand Down Expand Up @@ -885,7 +885,7 @@ default-value-8
(:vop-var vop)
(:generator 6
;; Clear the number stack.
(trace-table-entry trace-table-function-epilogue)
(trace-table-entry trace-table-fun-epilogue)
(let ((cur-nfp (current-nfp-tn vop)))
(when cur-nfp
(inst addq cur-nfp (bytes-needed-for-non-descriptor-stack-frame)
Expand Down Expand Up @@ -936,7 +936,7 @@ default-value-8
(:vop-var vop)
(:generator 6
;; Clear the number stack.
(trace-table-entry trace-table-function-epilogue)
(trace-table-entry trace-table-fun-epilogue)
(let ((cur-nfp (current-nfp-tn vop)))
(when cur-nfp
(inst addq cur-nfp (bytes-needed-for-non-descriptor-stack-frame)
Expand Down Expand Up @@ -983,7 +983,7 @@ default-value-8
(:vop-var vop)

(:generator 13
(trace-table-entry trace-table-function-epilogue)
(trace-table-entry trace-table-fun-epilogue)
(let ((not-single (gen-label)))
;; Clear the number stack.
(let ((cur-nfp (current-nfp-tn vop)))
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/alpha/parms.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
(defenum (:prefix trace-table-)
normal
call-site
function-prologue
function-epilogue)
fun-prologue
fun-epilogue)

;;;; static symbols

Expand Down
10 changes: 5 additions & 5 deletions src/compiler/alpha/system.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@

DONE))

(define-vop (function-subtype)
(:translate function-subtype)
(define-vop (fun-subtype)
(:translate fun-subtype)
(:policy :fast-safe)
(:args (function :scs (descriptor-reg)))
(:results (result :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 6
(load-type result function (- fun-pointer-lowtag))))

(define-vop (set-function-subtype)
(:translate (setf function-subtype))
(define-vop (set-fun-subtype)
(:translate (setf fun-subtype))
(:policy :fast-safe)
(:args (type :scs (unsigned-reg) :target result)
(function :scs (descriptor-reg)))
Expand Down Expand Up @@ -199,7 +199,7 @@
(inst subq ndescr other-pointer-lowtag ndescr)
(inst addq code ndescr sap)))

(define-vop (compute-function)
(define-vop (compute-fun)
(:args (code :scs (descriptor-reg))
(offset :scs (signed-reg unsigned-reg)))
(:arg-types * positive-fixnum)
Expand Down
14 changes: 7 additions & 7 deletions src/compiler/checkgen.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(let ((info (info :function :info name))
(call-cost (template-cost (template-or-lose 'call-named))))
(if info
(let ((templates (function-info-templates info)))
(let ((templates (fun-info-templates info)))
(if templates
(template-cost (first templates))
(case name
Expand Down Expand Up @@ -276,12 +276,12 @@
(cond ((eq cont (basic-combination-fun dest)) t)
((eq kind :local) t)
((member kind '(:full :error)) nil)
((function-info-ir2-convert kind) t)
((fun-info-ir2-convert kind) t)
(t
(dolist (template (function-info-templates kind) nil)
(dolist (template (fun-info-templates kind) nil)
(when (eq (template-ltn-policy template) :fast-safe)
(multiple-value-bind (val win)
(valid-function-use dest (template-type template))
(valid-fun-use dest (template-type template))
(when (or val (not win)) (return t)))))))))
(t t))))

Expand Down Expand Up @@ -431,7 +431,7 @@
(values))

;;; Mark CONT as being a continuation with a manifest type error. We
;;; set the kind to :ERROR, and clear any FUNCTION-INFO if the
;;; set the kind to :ERROR, and clear any FUN-INFO if the
;;; continuation is an argument to a known call. The last is done so
;;; that the back end doesn't have to worry about type errors in
;;; arguments to known functions. This clearing is inhibited for
Expand All @@ -444,8 +444,8 @@
(when (and (combination-p dest)
(let ((kind (basic-combination-kind dest)))
(or (eq kind :full)
(and (function-info-p kind)
(not (function-info-ir2-convert kind))))))
(and (fun-info-p kind)
(not (fun-info-ir2-convert kind))))))
(setf (basic-combination-kind dest) :error)))
(values))

Expand Down
12 changes: 6 additions & 6 deletions src/compiler/ctype.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@
;;; explain the result. We bind *COMPILER-ERROR-CONTEXT* to the
;;; combination node so that COMPILER-WARNING and related functions
;;; will do the right thing if they are supplied.
(defun valid-function-use (call type &key
((:argument-test *ctype-test-fun*) #'csubtypep)
(result-test #'values-subtypep)
(strict-result nil)
((:lossage-fun *lossage-fun*))
((:unwinnage-fun *unwinnage-fun*)))
(defun valid-fun-use (call type &key
((:argument-test *ctype-test-fun*) #'csubtypep)
(result-test #'values-subtypep)
(strict-result nil)
((:lossage-fun *lossage-fun*))
((:unwinnage-fun *unwinnage-fun*)))
(declare (type function result-test) (type combination call)
(type fun-type type))
(let* ((*lossage-detected* nil)
Expand Down
Loading

0 comments on commit 29a9ccc

Please sign in to comment.