X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ftn.lisp;h=d5e6f772b53b81038632b355516eb98a17547bd8;hb=b63c4fb9b98fa8188e17ba926e150ba417a74635;hp=11a833474d405dec89cf3540e3f3819810026cd0;hpb=581e3d62de8cb37e13ad9db63e5537c0f962be28;p=sbcl.git diff --git a/src/compiler/tn.lisp b/src/compiler/tn.lisp index 11a8334..d5e6f77 100644 --- a/src/compiler/tn.lisp +++ b/src/compiler/tn.lisp @@ -52,7 +52,7 @@ (setf (ir2-component-wired-tns instance) value)) ;;; Remove all TNs with no references from the lists of unpacked TNs. -;;; We null out the Offset so that nobody will mistake deleted wired +;;; We null out the OFFSET so that nobody will mistake deleted wired ;;; TNs for properly packed TNs. We mark non-deleted alias TNs so that ;;; aliased TNs aren't considered to be unreferenced. (defun delete-unreferenced-tns (component) @@ -154,24 +154,24 @@ (push-in tn-next res (ir2-component-restricted-tns component)) res)) -;;; Make TN be live throughout environment. Return TN. In the DEBUG -;;; case, the TN is treated normally in blocks in the environment -;;; which reference the TN, allowing targeting to/from the TN. This -;;; results in move efficient code, but may result in the TN sometimes -;;; not being live when you want it. -(defun physenv-live-tn (tn env) - (declare (type tn tn) (type physenv env)) +;;; Make TN be live throughout PHYSENV. Return TN. In the DEBUG case, +;;; the TN is treated normally in blocks in the environment which +;;; reference the TN, allowing targeting to/from the TN. This results +;;; in move efficient code, but may result in the TN sometimes not +;;; being live when you want it. +(defun physenv-live-tn (tn physenv) + (declare (type tn tn) (type physenv physenv)) (aver (eq (tn-kind tn) :normal)) (setf (tn-kind tn) :environment) - (setf (tn-physenv tn) env) - (push tn (ir2-physenv-live-tns (physenv-info env))) + (setf (tn-physenv tn) physenv) + (push tn (ir2-physenv-live-tns (physenv-info physenv))) tn) -(defun physenv-debug-live-tn (tn env) - (declare (type tn tn) (type physenv env)) +(defun physenv-debug-live-tn (tn physenv) + (declare (type tn tn) (type physenv physenv)) (aver (eq (tn-kind tn) :normal)) (setf (tn-kind tn) :debug-environment) - (setf (tn-physenv tn) env) - (push tn (ir2-physenv-debug-live-tns (physenv-info env))) + (setf (tn-physenv tn) physenv) + (push tn (ir2-physenv-debug-live-tns (physenv-info physenv))) tn) ;;; Make TN be live throughout the current component. Return TN. @@ -183,7 +183,7 @@ *component-being-compiled*))) tn) -;;; Specify that Save be used as the save location for TN. TN is returned. +;;; Specify that SAVE be used as the save location for TN. TN is returned. (defun specify-save-tn (tn save) (declare (type tn tn save)) (aver (eq (tn-kind save) :normal)) @@ -427,10 +427,8 @@ ;;; Return a list of N normal TNs of the specified primitive type. (defun make-n-tns (n ptype) (declare (type unsigned-byte n) (type primitive-type ptype)) - (collect ((res)) - (dotimes (i n) - (res (make-normal-tn ptype))) - (res))) + (loop repeat n + collect (make-normal-tn ptype))) ;;; Return true if X and Y are packed in the same location, false otherwise. ;;; This is false if either operand is constant. @@ -444,6 +442,7 @@ ;;; Return the value of an immediate constant TN. (defun tn-value (tn) (declare (type tn tn)) + ;; FIXME: What is :CACHED-CONSTANT? (aver (member (tn-kind tn) '(:constant :cached-constant))) (constant-value (tn-leaf tn))) @@ -457,7 +456,7 @@ (unless (and (not (sc-save-p sc)) (eq (sb-kind (sc-sb sc)) :unbounded)) (dolist (alt (sc-alternate-scs sc) - (error "SC ~S has no :unbounded :save-p NIL alternate SC." + (error "SC ~S has no :UNBOUNDED :SAVE-P NIL alternate SC." (sc-name sc))) (when (and (not (sc-save-p alt)) (eq (sb-kind (sc-sb alt)) :unbounded))