0.pre7.137:
[sbcl.git] / src / compiler / vop.lisp
index 39c688a..457616b 100644 (file)
@@ -47,7 +47,7 @@
   (scs nil :type list)
   ;; the Lisp type equivalent to this type. If this type could never be
   ;; returned by PRIMITIVE-TYPE, then this is the NIL (or empty) type
-  (type (required-argument) :type ctype)
+  (type (missing-arg) :type ctype)
   ;; the template used to check that an object is of this type. This is a
   ;; template of one argument and one result, both of primitive-type T. If
   ;; the argument is of the correct type, then it is delivered into the
@@ -77,8 +77,8 @@
 ;;;    environment pointer should be saved after the binding is
 ;;;    instantiated.
 ;;;
-;;; Environment-Info
-;;;    Holds the IR2-Environment structure.
+;;; Physenv-Info
+;;;    Holds the Ir2-Physenv structure.
 ;;;
 ;;; Tail-Set-Info
 ;;;    Holds the Return-Info structure.
 (defstruct (ir2-block (:include block-annotation)
                      (:constructor make-ir2-block (block))
                      (:copier nil))
-  ;; the IR2-Block's number, which differs from Block's Block-Number
+  ;; the IR2-BLOCK's number, which differs from BLOCK's BLOCK-NUMBER
   ;; if any blocks are split. This is assigned by lifetime analysis.
   (number nil :type (or index null))
   ;; information about unknown-values continuations that is used by
   ;; the assembler label that points to the beginning of the code for
   ;; this block, or NIL when we haven't assigned a label yet
   (%label nil)
-  ;; list of Location-Info structures describing all the interesting
+  ;; list of LOCATION-INFO structures describing all the interesting
   ;; (to the debugger) locations in this block
   (locations nil :type list))
 
 ;;; IR2 conversion may need to compile a forward reference. In this
 ;;; case the slots aren't actually initialized until entry analysis runs.
 (defstruct (entry-info (:copier nil))
-  ;; true if this function has a non-null closure environment
+  ;; Does this function have a non-null closure environment?
   (closure-p nil :type boolean)
   ;; a label pointing to the entry vector for this function, or NIL
   ;; before ENTRY-ANALYZE runs
   ;; of the function, a symbol or (SETF <symbol>). Otherwise, this is
   ;; some string that is intended to be informative.
   (name "<not computed>" :type (or simple-string list symbol))
-  ;; a string representing the argument list that the function was
-  ;; defined with
-  (arguments nil :type (or simple-string null))
+  ;; the argument list that the function was defined with.
+  (arguments nil :type list)
   ;; a function type specifier representing the arguments and results
   ;; of this function
   (type 'function :type (or list (member function))))
 
-;;; An IR2-ENVIRONMENT is used to annotate non-LET LAMBDAs with their
-;;; passing locations. It is stored in the ENVIRONMENT-INFO.
-(defstruct (ir2-environment (:copier nil))
-  ;; the TNs that hold the passed environment within the function.
-  ;; This is an alist translating from the NLX-INFO or LAMBDA-VAR to
-  ;; the TN that holds the corresponding value within this function.
-  ;;
-  ;; The elements of this list correspond to the elements of the list
-  ;; in the CLOSURE slot of the ENVIRONMENT object that links to us:
-  ;; essentially this list is related to the CLOSURE list by MAPCAR.
-  (environment (required-argument) :type list :read-only t)
+;;; An IR2-PHYSENV is used to annotate non-LET LAMBDAs with their
+;;; passing locations. It is stored in the PHYSENV-INFO.
+(defstruct (ir2-physenv (:copier nil))
+  ;; TN info for closed-over things within the function: an alist
+  ;; mapping from NLX-INFOs and LAMBDA-VARs to TNs holding the
+  ;; corresponding thing within this function
+  ;;
+  ;; Elements of this list have a one-to-one correspondence with
+  ;; elements of the PHYSENV-CLOSURE list of the PHYSENV object that
+  ;; links to us.
+  (closure (missing-arg) :type list :read-only t)
   ;; the TNs that hold the OLD-FP and RETURN-PC within the function.
   ;; We always save these so that the debugger can do a backtrace,
   ;; even if the function has no return (and thus never uses them).
   ;; differently from the other arguments, since in some
   ;; implementations we may use a call instruction that requires the
   ;; return PC to be passed in a particular place.
-  (return-pc-pass (required-argument) :type tn :read-only t)
+  (return-pc-pass (missing-arg) :type tn :read-only t)
   ;; True if this function has a frame on the number stack. This is
   ;; set by representation selection whenever it is possible that some
   ;; function in our tail set will make use of the number stack.
   ;; from their passing locations, etc. This is the start of the
   ;; function as far as the debugger is concerned.
   (environment-start nil :type (or label null)))
-(defprinter (ir2-environment)
-  environment
+(defprinter (ir2-physenv)
+  closure
   old-fp
   return-pc
   return-pc-pass)
   ;; The return convention used:
   ;; -- If :UNKNOWN, we use the standard return convention.
   ;; -- If :FIXED, we use the known-values convention.
-  (kind (required-argument) :type (member :fixed :unknown))
+  (kind (missing-arg) :type (member :fixed :unknown))
   ;; the number of values returned, or :UNKNOWN if we don't know.
   ;; COUNT may be known when KIND is :UNKNOWN, since we may choose the
   ;; standard return convention for other reasons.
-  (count (required-argument) :type (or index (member :unknown)))
+  (count (missing-arg) :type (or index (member :unknown)))
   ;; If count isn't :UNKNOWN, then this is a list of the
   ;; primitive-types of each value.
   (types () :type list)
   ;; unwind-block, so we leave this slot null.
   (home nil :type (or tn null))
   ;; the saved control stack pointer
-  (save-sp (required-argument) :type tn)
+  (save-sp (missing-arg) :type tn)
   ;; the list of dynamic state save TNs
   (dynamic-state (list* (make-stack-pointer-tn)
                        (make-dynamic-state-tns))
   ;; VOP-Info structure containing static info about the operation
   (info nil :type (or vop-info null))
   ;; the IR2-Block this VOP is in
-  (block (required-argument) :type ir2-block)
+  (block (missing-arg) :type ir2-block)
   ;; VOPs evaluated after and before this one. Null at the
   ;; beginning/end of the block, and temporarily during IR2
   ;; translation.
 (defstruct (tn-ref (:constructor make-tn-ref (tn write-p))
                   (:copier nil))
   ;; the TN referenced
-  (tn (required-argument) :type tn)
+  (tn (missing-arg) :type tn)
   ;; Is this is a write reference? (as opposed to a read reference)
   (write-p nil :type boolean)
   ;; the link for a list running through all TN-Refs for this TN of
   ;; the arg/result type restrictions. We compute this from the
   ;; PRIMITIVE-TYPE restrictions to make life easier for IR1 phases
   ;; that need to anticipate LTN's template selection.
-  (type (required-argument) :type function-type)
+  (type (missing-arg) :type fun-type)
   ;; lists of restrictions on the argument and result types. A
   ;; restriction may take several forms:
   ;; -- The restriction * is no restriction at all.
   ;;    the type constraint as a Lisp function type.
   ;;
   ;; If RESULT-TYPES is :CONDITIONAL, then this is an IF-FOO style
-  ;; conditional that yeilds its result as a control transfer. The
+  ;; conditional that yields its result as a control transfer. The
   ;; emit function takes two info arguments: the target label and a
   ;; boolean flag indicating whether to negate the sense of the test.
   (arg-types nil :type list)
   ;; the policy under which this template is the best translation.
   ;; Note that LTN might use this template under other policies if it
   ;; can't figure out anything better to do.
-  (ltn-policy (required-argument) :type ltn-policy)
+  (ltn-policy (missing-arg) :type ltn-policy)
   ;; the base cost for this template, given optimistic assumptions
   ;; such as no operand loading, etc.
-  (cost (required-argument) :type index)
+  (cost (missing-arg) :type index)
   ;; If true, then this is a short noun-like phrase describing what
   ;; this VOP "does", i.e. the implementation strategy. This is for
   ;; use in efficiency notes.
   ;; Two values are returned: the first and last VOP emitted. This vop
   ;; sequence must be linked into the VOP Next/Prev chain for the
   ;; block. At least one VOP is always emitted.
-  (emit-function (required-argument) :type function))
+  (emit-function (missing-arg) :type function))
 (defprinter (template)
   name
   arg-types
             (:make-load-form-fun ignore-it))
   ;; side-effects of this VOP and side-effects that affect the value
   ;; of this VOP
-  (effects (required-argument) :type attributes)
-  (affected (required-argument) :type attributes)
+  (effects (missing-arg) :type attributes)
+  (affected (missing-arg) :type attributes)
   ;; If true, causes special casing of TNs live after this VOP that
   ;; aren't results:
   ;; -- If T, all such TNs that are allocated in a SC with a defined
   ;; info for automatic emission of move-arg VOPs by representation
   ;; selection. If NIL, then do nothing special. If non-null, then
   ;; there must be a more arg. Each more arg is moved to its passing
-  ;; location using the appropriate representation-specific
-  ;; move-argument VOP. The first (fixed) argument must be the
-  ;; control-stack frame pointer for the frame to move into. The first
-  ;; info arg is the list of passing locations.
+  ;; location using the appropriate representation-specific MOVE-ARG
+  ;; VOP. The first (fixed) argument must be the control-stack frame
+  ;; pointer for the frame to move into. The first info arg is the
+  ;; list of passing locations.
   ;;
   ;; Additional constraints depend on the value:
   ;;
   ;; if true, a function that is called with the VOP to do operand
   ;; targeting. This is done by modifying the TN-REF-TARGET slots in
   ;; the TN-REFS so that they point to other TN-REFS in the same VOP.
-  (target-function nil :type (or null function))
+  (target-fun nil :type (or null function))
   ;; a function that emits assembly code for a use of this VOP when it
   ;; is called with the VOP structure. This is null if this VOP has no
   ;; specified generator (i.e. if it exists only to be inherited by
   ;; true if the values in this SC needs to be saved across calls
   (save-p nil :type boolean)
   ;; vectors mapping from SC numbers to information about how to load
-  ;; from the index SC to this one. Move-Functions holds the names of
-  ;; the functions used to do loading, and Load-Costs holds the cost
-  ;; of the corresponding Move-Functions. If loading is impossible,
-  ;; then the entries are NIL. Load-Costs is initialized to have a 0
+  ;; from the index SC to this one. MOVE-FUNS holds the names of
+  ;; the functions used to do loading, and LOAD-COSTS holds the cost
+  ;; of the corresponding move functions. If loading is impossible,
+  ;; then the entries are NIL. LOAD-COSTS is initialized to have a 0
   ;; for this SC.
-  (move-functions (make-array sc-number-limit :initial-element nil)
-                 :type sc-vector)
+  (move-funs (make-array sc-number-limit :initial-element nil)
+            :type sc-vector)
   (load-costs (make-array sc-number-limit :initial-element nil)
              :type sc-vector)
   ;; a vector mapping from SC numbers to possibly
   ;;   as :NORMAL, but then at the end merges the conflict info into
   ;;   the original TN and replaces all uses of the alias with the
   ;;   original TN. SAVE-TN holds the aliased TN.
-  (kind (required-argument)
+  (kind (missing-arg)
        :type (member :normal :environment :debug-environment
                      :save :save-once :specified-save :load :constant
                      :component :alias))
   ;; some kind of info about how important this TN is
   (cost 0 :type fixnum)
   ;; If a :ENVIRONMENT or :DEBUG-ENVIRONMENT TN, this is the
-  ;; environment that the TN is live throughout.
-  (environment nil :type (or environment null)))
+  ;; physical environment that the TN is live throughout.
+  (physenv nil :type (or physenv null)))
 (def!method print-object ((tn tn) stream)
   (print-unreadable-object (tn stream :type t)
     ;; KLUDGE: The distinction between PRINT-TN and PRINT-OBJECT on TN is
            (:constructor make-global-conflicts (kind tn block number))
            (:copier nil))
   ;; the IR2-Block that this structure represents the conflicts for
-  (block (required-argument) :type ir2-block)
+  (block (missing-arg) :type ir2-block)
   ;; thread running through all the Global-Conflict for Block. This
   ;; thread is sorted by TN number
   (next nil :type (or global-conflicts null))
                         :initial-element 0)
             :type local-tn-bit-vector)
   ;; the TN we are recording conflicts for.
-  (tn (required-argument) :type tn)
+  (tn (missing-arg) :type tn)
   ;; thread through all the Global-Conflicts for TN
   (tn-next nil :type (or global-conflicts null))
   ;; TN's local TN number in Block. :Live TNs don't have local numbers.