X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fnode.lisp;h=4439b79e1b9848a8658ebab9ff5a0bed017f8f42;hb=69d60b456b07a0256f08df0d02484f361ce5737c;hp=c885f7f9b9e7d955c387b98cfc04f0d5f21ac5aa;hpb=3d2929a8f013c3a35ea4fcf46426031cbb8b0953;p=sbcl.git diff --git a/src/compiler/node.lisp b/src/compiler/node.lisp index c885f7f..4439b79 100644 --- a/src/compiler/node.lisp +++ b/src/compiler/node.lisp @@ -283,7 +283,11 @@ ;;; component. (def!struct (component (:copier nil) (:constructor - make-component (head tail &aux (last-block tail)))) + make-component + (head + tail &aux + (last-block tail) + (outer-loop (make-loop :kind :outer :head head))))) ;; unique ID for debugging #!+sb-show (id (new-object-id) :read-only t) ;; the kind of component @@ -356,7 +360,7 @@ ;; messed up by IR1 optimizations, so the DFO should be recomputed. (reanalyze nil :type boolean) ;; some sort of name for the code in this component - (name "" :type simple-string) + (name "" :type t) ;; When I am a child, this is :NO-IR2-YET. ;; In my adulthood, IR2 stores notes to itself here. ;; After I have left the great wheel and am staring into the GC, this @@ -388,7 +392,7 @@ ;; this is filled by physical environment analysis (dx-lvars nil :type list) ;; The default LOOP in the component. - (outer-loop (make-loop :kind :outer :head head) :type cloop)) + (outer-loop (missing-arg) :type cloop)) (defprinter (component :identity t) name #!+sb-show id @@ -451,7 +455,9 @@ ;; For :DYNAMIC-EXTENT: a list of all DX LVARs, preserved by this ;; cleanup. This is filled when the cleanup is created (now by ;; locall call analysis) and is rechecked by physical environment - ;; analysis. + ;; analysis. (For closures this is a list of the allocating node - + ;; during IR1, and a list of the argument LVAR of the allocator - + ;; after physical environment analysis.) (info nil :type list)) (defprinter (cleanup :identity t) kind @@ -537,7 +543,9 @@ (def!struct (nlx-info (:constructor make-nlx-info (cleanup exit - &aux (lvar (node-lvar exit)))) + &aux + (block (first (block-succ + (node-block exit)))))) (:make-load-form-fun ignore-it)) ;; the cleanup associated with this exit. In a catch or ;; unwind-protect, this is the :CATCH or :UNWIND-PROTECT cleanup, @@ -545,28 +553,29 @@ ;; this thus provides a good indication of what kind of exit is ;; being done. (cleanup (missing-arg) :type cleanup) - ;; the continuation exited to (the CONT of the EXIT nodes). If this - ;; exit is from an escape function (CATCH or UNWIND-PROTECT), then - ;; physical environment analysis deletes the escape function and - ;; instead has the %NLX-ENTRY use this continuation. + ;; the ``continuation'' exited to (the block, succeeding the EXIT + ;; nodes). If this exit is from an escape function (CATCH or + ;; UNWIND-PROTECT), then physical environment analysis deletes the + ;; escape function and instead has the %NLX-ENTRY use this + ;; continuation. ;; - ;; This slot is primarily an indication of where this exit delivers - ;; its values to (if any), but it is also used as a sort of name to - ;; allow us to find the NLX-INFO that corresponds to a given exit. - ;; For this purpose, the ENTRY must also be used to disambiguate, - ;; since exits to different places may deliver their result to the - ;; same continuation. - (exit (missing-arg) :type exit) - (lvar (missing-arg) :type (or lvar null)) + ;; This slot is used as a sort of name to allow us to find the + ;; NLX-INFO that corresponds to a given exit. For this purpose, the + ;; ENTRY must also be used to disambiguate, since exits to different + ;; places may deliver their result to the same continuation. + (block (missing-arg) :type cblock) ;; the entry stub inserted by physical environment analysis. This is ;; a block containing a call to the %NLX-ENTRY funny function that ;; has the original exit destination as its successor. Null only ;; temporarily. (target nil :type (or cblock null)) + ;; for a lexical exit it determines whether tag existence check is + ;; needed + (safe-p nil :type boolean) ;; some kind of info used by the back end info) (defprinter (nlx-info :identity t) - exit + block target info) @@ -723,18 +732,6 @@ ;; or not, as if it is a valid function name then it can look for an ;; inline expansion. ;; - ;; The value of this slot can be anything, except that it shouldn't - ;; be a legal function name, since otherwise debugging gets - ;; confusing. (If a legal function name is a good name for the - ;; function, it should be in %SOURCE-NAME, and then we shouldn't - ;; need a %DEBUG-NAME.) In SBCL as of 0.pre7.87, it's always a - ;; string unless it's NIL, since that's how CMU CL represented debug - ;; names. However, eventually I (WHN) think it we should start using - ;; list values instead, since they have much nicer print properties - ;; (abbreviation, skipping package prefixes when unneeded, and - ;; renaming package prefixes when we do things like renaming SB!EXT - ;; to SB-EXT). - ;; ;; E.g. for the function which implements (DEFUN FOO ...), we could ;; have ;; %SOURCE-NAME=FOO @@ -742,17 +739,17 @@ ;; for the function which implements the top level form ;; (IN-PACKAGE :FOO) we could have ;; %SOURCE-NAME=NIL - ;; %DEBUG-NAME="top level form (IN-PACKAGE :FOO)" + ;; %DEBUG-NAME=(TOP-LEVEL-FORM (IN-PACKAGE :FOO) ;; for the function which implements FOO in ;; (DEFUN BAR (...) (FLET ((FOO (...) ...)) ...)) ;; we could have ;; %SOURCE-NAME=FOO - ;; %DEBUG-NAME="FLET FOO in BAR" + ;; %DEBUG-NAME=(FLET FOO) ;; and for the function which implements FOO in ;; (DEFMACRO FOO (...) ...) ;; we could have ;; %SOURCE-NAME=FOO (or maybe .ANONYMOUS.?) - ;; %DEBUG-NAME="DEFMACRO FOO" + ;; %DEBUG-NAME=(MACRO-FUNCTION FOO) (%debug-name nil :type (or null (not (satisfies legal-fun-name-p))) :read-only t) @@ -853,6 +850,9 @@ ;; the original function or macro lambda list, or :UNSPECIFIED if ;; this is a compiler created function (arg-documentation nil :type (or list (member :unspecified))) + ;; Node, allocating closure for this lambda. May be NIL when we are + ;; sure that no closure is needed. + (allocator nil :type (or null combination)) ;; various rare miscellaneous info that drives code generation & stuff (plist () :type list)) (defprinter (functional :identity t) @@ -1310,7 +1310,8 @@ (entry nil :type (or entry null)) ;; the lvar yielding the value we are to exit with. If NIL, then no ;; value is desired (as in GO). - (value nil :type (or lvar null))) + (value nil :type (or lvar null)) + (nlx-info nil :type (or nlx-info null))) (defprinter (exit :identity t) #!+sb-show id (entry :test entry)