<function>with-compilation-unit</> is used to delay undefined
warnings.</para></listitem>
<listitem><para><computeroutput>in: DEFUN FOO</> This is the
- definition top-level form responsible for the error. It is
+ definition top level form responsible for the error. It is
obtained by taking the first two elements of the enclosing form
whose first element is a symbol beginning with <quote><literal>def</></>.
If there is no such enclosing <quote><literal>def</></> form, then the
<emphasis>original source</> form responsible for the error.
Original source means that the form directly appeared in the
original input to the compiler, i.e. in the lambda passed to
- <function>compile</> or in the top-level form read from the
+ <function>compile</> or in the top level form read from the
source file. In this example, the expansion of the <function>zoq</>
macro was responsible for the error.</para></listitem>
<listitem><para><computeroutput>--> ROQ PLOQ +</> This is the
;; redefine our functions anyway; and developers can
;; fend for themselves.)
#!-sb-fluid (sb!ext:*derive-function-types* t)
- ;; FIXME: *TOP-LEVEL-LAMBDA-MAX* should go away altogether.
- (sb!c::*top-level-lambda-max* 1)
+ ;; FIXME: *TOPLEVEL-LAMBDA-MAX* should go away altogether.
+ (sb!c::*toplevel-lambda-max* 1)
;; Let the target know that we're the cross-compiler.
(*features* (cons :sb-xc *features*))
;; We need to tweak the readtable..
"BREAKPOINT-KIND" "BREAKPOINT-P" "BREAKPOINT-WHAT" "CODE-LOCATION"
"CODE-LOCATION-DEBUG-BLOCK" "CODE-LOCATION-DEBUG-FUN"
"CODE-LOCATION-DEBUG-SOURCE" "CODE-LOCATION-FORM-NUMBER"
- "CODE-LOCATION-P" "CODE-LOCATION-TOP-LEVEL-FORM-OFFSET"
+ "CODE-LOCATION-P" "CODE-LOCATION-TOPLEVEL-FORM-OFFSET"
"CODE-LOCATION-UNKNOWN-P" "CODE-LOCATION=" "DEACTIVATE-BREAKPOINT"
"DEBUG-BLOCK" "DEBUG-BLOCK-ELSEWHERE-P" "DEBUG-BLOCK-P"
"DEBUG-BLOCK-SUCCESSORS" "DEBUG-CONDITION" "DEBUG-ERROR"
"FASL-DUMP-COLD-LOAD-FORM" "FASL-DUMP-COMPONENT"
"FASL-DUMP-COLD-FSET"
"FASL-DUMP-LOAD-TIME-VALUE" "FASL-DUMP-LOAD-TIME-VALUE-LAMBDA"
- "FASL-DUMP-SOURCE-INFO" "FASL-DUMP-TOP-LEVEL-LAMBDA-CALL"
+ "FASL-DUMP-SOURCE-INFO" "FASL-DUMP-TOPLEVEL-LAMBDA-CALL"
"FASL-NOTE-HANDLE-FOR-CONSTANT"
"FASL-OUTPUT" "FASL-OUTPUT-P"
"FASL-OUTPUT-ENTRY-TABLE" "FASL-OUTPUT-STREAM"
;; ..and variables to control compiler policy
"*INLINE-EXPANSION-LIMIT*"
"*USE-IMPLEMENTATION-TYPES*"
- "*BYTE-COMPILE-TOP-LEVEL*"
+ "*BYTE-COMPILE-TOPLEVEL*"
"*BYTE-COMPILE-DEFAULT*"
"*DERIVE-FUNCTION-TYPES*"
;; renamed because some of us find it confusing to call something
;; a depth when it isn't quite.
(depthoid -1 :type layout-depthoid)
- ;; The number of top-level descriptor cells in each instance.
+ ;; the number of top level descriptor cells in each instance
(length 0 :type index)
;; If this layout has some kind of compiler meta-info, then this is
;; it. If a structure, then we store the DEFSTRUCT-DESCRIPTION here.
#+sb-xc-host nil)
;;; Note: Unlike the analogous COLD-INIT macro in CMU CL, this macro
-;;; makes no attempt to simulate a top-level situation by treating
+;;; makes no attempt to simulate a top level situation by treating
;;; EVAL-WHEN forms specially.
(defmacro !cold-init-forms (&rest forms)
;; In the target Lisp, stuff the forms into a named function which
;;;; number of locations in this block
;;;; kind of first location (single byte)
;;;; delta from previous PC (or from 0 if first location in function.)
-;;;; [offset of first top-level form, if no function TLF-NUMBER]
+;;;; [offset of first top level form, if no function TLF-NUMBER]
;;;; form number of first source form
;;;; first live mask (length in bytes determined by number of VARIABLES)
-;;;; ...more <kind, delta, top-level form offset, form-number, live-set>
+;;;; ...more <kind, delta, top level form offset, form-number, live-set>
;;;; tuples...
(defconstant-eqx compiled-debug-block-nsucc-byte (byte 2 0) #'equalp)
;; function name, otherwise it is a descriptive string.
(name (missing-arg) :type (or simple-string cons symbol))
;; The kind of function (same as FUNCTIONAL-KIND):
- (kind nil :type (member nil :optional :external :top-level :cleanup))
+ (kind nil :type (member nil :optional :external :toplevel :cleanup))
;; a description of variable locations for this function, in alphabetical
;; order by name; or NIL if no information is available
;;
- ;; The variable entries are alphabetically ordered. This ordering is used in
- ;; lifetime info to refer to variables: the first entry is 0, the second
- ;; entry is 1, etc. Variable numbers are *not* the byte index at which the
- ;; representation of the location starts.
+ ;; The variable entries are alphabetically ordered. This ordering is
+ ;; used in lifetime info to refer to variables: the first entry is
+ ;; 0, the second entry is 1, etc. Variable numbers are *not* the
+ ;; byte index at which the representation of the location starts.
;;
;; Each entry is:
;; * a FLAGS value, which is a FIXNUM with various
;; COMPILED-DEBUG-FUN-FOO bits set
- ;; * the symbol which names this variable, unless debug info is minimal
+ ;; * the symbol which names this variable, unless debug info
+ ;; is minimal
;; * the variable ID, when it has one
;; * SC-offset of primary location, if it has one
;; * SC-offset of save location, if it has one
;; transform correctly under package renaming). Check whether this slot's
;; data might have the same problem that that slot's data did.
(blocks nil :type (or (simple-array (unsigned-byte 8) (*)) null))
- ;; If all code locations in this function are in the same top-level form,
- ;; then this is the number of that form, otherwise NIL. If NIL, then each
- ;; code location represented in the BLOCKS specifies the TLF number.
+ ;; If all code locations in this function are in the same top level
+ ;; form, then this is the number of that form, otherwise NIL. If
+ ;; NIL, then each code location represented in the BLOCKS specifies
+ ;; the TLF number.
(tlf-number nil :type (or index null))
- ;; A vector describing the variables that the argument values are stored in
- ;; within this function. The locations are represented by the ordinal number
- ;; of the entry in the VARIABLES slot value. The locations are in the order
- ;; that the arguments are actually passed in, but special marker symbols can
- ;; be interspersed to indicate the original call syntax:
+ ;; a vector describing the variables that the argument values are
+ ;; stored in within this function. The locations are represented by
+ ;; the ordinal number of the entry in the VARIABLES slot value. The
+ ;; locations are in the order that the arguments are actually passed
+ ;; in, but special marker symbols can be interspersed to indicate
+ ;; the original call syntax:
;;
;; DELETED
;; There was an argument to the function in this position, but it was
;; :LISP - from Lisp (i.e. COMPILE)
(from (missing-arg) :type (member :file :lisp))
;; If :FILE, the file name, if :LISP or :STREAM, then a vector of
- ;; the top-level forms. When from COMPILE, form 0 is #'(LAMBDA ...).
+ ;; the top level forms. When from COMPILE, form 0 is #'(LAMBDA ...).
(name nil)
;; the universal time that the source was written, or NIL if
;; unavailable
;; source (i.e. the total number of forms converted previously in
;; this compilation)
(source-root 0 :type index)
- ;; The FILE-POSITIONs of the truly top-level forms read from this
+ ;; The FILE-POSITIONs of the truly top level forms read from this
;; file (if applicable). The vector element type will be chosen to
;; hold the largest element. May be null to save space, or if
;; :DEBUG-SOURCE-FORM is :LISP.
;; out and just find it in the blocks cache in DEBUG-FUN.
(%debug-block :unparsed :type (or debug-block (member :unparsed)))
;; This is the number of forms processed by the compiler or loader
- ;; before the top-level form containing this code-location.
+ ;; before the top level form containing this code-location.
(%tlf-offset :unparsed :type (or index (member :unparsed)))
;; This is the depth-first number of the node that begins
- ;; code-location within its top-level form.
+ ;; code-location within its top level form.
(%form-number :unparsed :type (or index (member :unparsed))))
(def!method print-object ((obj code-location) str)
(print-unreadable-object (obj str :type t)
\f
;;;; DEBUG-SOURCEs
-;;; Return the number of top-level forms processed by the compiler
+;;; Return the number of top level forms processed by the compiler
;;; before compiling this source. If this source is uncompiled, this
;;; is zero. This may be zero even if the source is compiled since the
;;; first form in the first file compiled in one compilation, for
;;; example, must have a root number of zero -- the compiler saw no
-;;; other top-level forms before it.
+;;; other top level forms before it.
(defun debug-source-root-number (debug-source)
(sb!c::debug-source-source-root debug-source))
\f
sb!vm:n-word-bytes)))))))
;;; Return the kind of the function, which is one of :OPTIONAL,
-;;; :EXTERNAL, TOP-level, :CLEANUP, or NIL.
+;;; :EXTERNAL, :TOPLEVEL, :CLEANUP, or NIL.
(defun debug-fun-kind (debug-fun)
;; FIXME: This "is one of" information should become part of the function
;; declamation, not just a doc string
(car sources)
(do ((prev sources src)
(src (cdr sources) (cdr src))
- (offset (code-location-top-level-form-offset code-location)))
+ (offset (code-location-toplevel-form-offset code-location)))
((null src) (car prev))
(when (< offset (sb!c::debug-source-source-root (car src)))
(return (car prev)))))))
;; did special tricks to debug the IR1 interpreter.)
))
-;;; Returns the number of top-level forms before the one containing
+;;; Returns the number of top level forms before the one containing
;;; CODE-LOCATION as seen by the compiler in some compilation unit. (A
;;; compilation unit is not necessarily a single file, see the section
;;; on debug-sources.)
-(defun code-location-top-level-form-offset (code-location)
+(defun code-location-toplevel-form-offset (code-location)
(when (code-location-unknown-p code-location)
(error 'unknown-code-location :code-location code-location))
(let ((tlf-offset (code-location-%tlf-offset code-location)))
(t tlf-offset))))
;;; Return the number of the form corresponding to CODE-LOCATION. The
-;;; form number is derived by a walking the subforms of a top-level
+;;; form number is derived by a walking the subforms of a top level
;;; form in depth-first order.
(defun code-location-form-number (code-location)
(when (code-location-unknown-p code-location)
;;; This code produces and uses what we call source-paths. A
;;; source-path is a list whose first element is a form number as
;;; returned by CODE-LOCATION-FORM-NUMBER and whose last element is a
-;;; top-level-form number as returned by
-;;; CODE-LOCATION-TOP-LEVEL-FORM-NUMBER. The elements from the last to
+;;; top level form number as returned by
+;;; CODE-LOCATION-TOPLEVEL-FORM-NUMBER. The elements from the last to
;;; the first, exclusively, are the numbered subforms into which to
;;; descend. For example:
;;; (defun foo (x)
;;; (let ((a (aref x 3)))
;;; (cons a 3)))
;;; The call to AREF in this example is form number 5. Assuming this
-;;; DEFUN is the 11'th top-level-form, the source-path for the AREF
+;;; DEFUN is the 11'th top level form, the source-path for the AREF
;;; call is as follows:
;;; (5 1 0 1 3 11)
;;; Given the DEFUN, 3 gets you the LET, 1 gets you the bindings, 0
;;; table used to detect CAR circularities in FORM-NUMBER-TRANSLATIONS
(defvar *form-number-circularity-table* (make-hash-table :test 'eq))
-;;; This returns a table mapping form numbers to source-paths. A source-path
-;;; indicates a descent into the top-level-form form, going directly to the
-;;; subform corressponding to the form number.
+;;; This returns a table mapping form numbers to source-paths. A
+;;; source-path indicates a descent into the TOPLEVEL-FORM form,
+;;; going directly to the subform corressponding to the form number.
;;;
;;; The vector elements are in the same format as the compiler's
;;; NODE-SOURCE-PATH; that is, the first element is the form number and
-;;; the last is the top-level-form number.
+;;; the last is the TOPLEVEL-FORM number.
(defun form-number-translations (form tlf-number)
(clrhash *form-number-circularity-table*)
(setf (fill-pointer *form-number-temp*) 0)
(frob)
(setq trail (cdr trail)))))))
-;;; FORM is a top-level form, and path is a source-path into it. This
+;;; FORM is a top level form, and path is a source-path into it. This
;;; returns the form indicated by the source-path. Context is the
;;; number of enclosing forms to return instead of directly returning
;;; the source-path form. When context is non-zero, the form returned
;;; and "terminate the Lisp system" as the SB-EXT:QUIT function.)
;;;
;;;(!def-debug-command "QUIT" ()
-;;; (throw 'sb!impl::top-level-catcher nil))
+;;; (throw 'sb!impl::toplevel-catcher nil))
;;; CMU CL supported this GO debug command, but SBCL doesn't -- in
;;; SBCL you just type the CONTINUE restart name instead (or "RESTART
*cached-readtable* nil))
*before-save-initializations*)
-;;; We also cache the last top-level form that we printed a source for
+;;; We also cache the last toplevel form that we printed a source for
;;; so that we don't have to do repeated reads and calls to
;;; FORM-NUMBER-TRANSLATIONS.
-(defvar *cached-top-level-form-offset* nil)
-(declaim (type (or index null) *cached-top-level-form-offset*))
-(defvar *cached-top-level-form*)
+(defvar *cached-toplevel-form-offset* nil)
+(declaim (type (or index null) *cached-toplevel-form-offset*))
+(defvar *cached-toplevel-form*)
(defvar *cached-form-number-translations*)
;;; Given a code location, return the associated form-number
-;;; translations and the actual top-level form. We check our cache ---
+;;; translations and the actual top level form. We check our cache ---
;;; if there is a miss, we dispatch on the kind of the debug source.
-(defun get-top-level-form (location)
+(defun get-toplevel-form (location)
(let ((d-source (sb!di:code-location-debug-source location)))
(if (and (eq d-source *cached-debug-source*)
- (eql (sb!di:code-location-top-level-form-offset location)
- *cached-top-level-form-offset*))
- (values *cached-form-number-translations* *cached-top-level-form*)
- (let* ((offset (sb!di:code-location-top-level-form-offset location))
+ (eql (sb!di:code-location-toplevel-form-offset location)
+ *cached-toplevel-form-offset*))
+ (values *cached-form-number-translations* *cached-toplevel-form*)
+ (let* ((offset (sb!di:code-location-toplevel-form-offset location))
(res
(ecase (sb!di:debug-source-from d-source)
- (:file (get-file-top-level-form location))
+ (:file (get-file-toplevel-form location))
(:lisp (svref (sb!di:debug-source-name d-source) offset)))))
- (setq *cached-top-level-form-offset* offset)
+ (setq *cached-toplevel-form-offset* offset)
(values (setq *cached-form-number-translations*
(sb!di:form-number-translations res offset))
- (setq *cached-top-level-form* res))))))
+ (setq *cached-toplevel-form* res))))))
-;;; Locate the source file (if it still exists) and grab the top-level
-;;; form. If the file is modified, we use the top-level-form offset
+;;; Locate the source file (if it still exists) and grab the top level
+;;; form. If the file is modified, we use the top level form offset
;;; instead of the recorded character offset.
-(defun get-file-top-level-form (location)
+(defun get-file-toplevel-form (location)
(let* ((d-source (sb!di:code-location-debug-source location))
- (tlf-offset (sb!di:code-location-top-level-form-offset location))
+ (tlf-offset (sb!di:code-location-toplevel-form-offset location))
(local-tlf-offset (- tlf-offset
(sb!di:debug-source-root-number d-source)))
(char-offset
(defun print-code-location-source-form (location context)
(let* ((location (maybe-block-start-location location))
(form-num (sb!di:code-location-form-number location)))
- (multiple-value-bind (translations form) (get-top-level-form location)
+ (multiple-value-bind (translations form) (get-toplevel-form location)
(unless (< form-num (length translations))
(error "The source path no longer exists."))
(prin1 (sb!di:source-path-context form
(not prev-location)
(not (eq (sb!di:code-location-debug-source code-location)
(sb!di:code-location-debug-source prev-location)))
- (not (eq (sb!di:code-location-top-level-form-offset
+ (not (eq (sb!di:code-location-toplevel-form-offset
code-location)
- (sb!di:code-location-top-level-form-offset
+ (sb!di:code-location-toplevel-form-offset
prev-location)))
(not (eq (sb!di:code-location-form-number code-location)
(sb!di:code-location-form-number prev-location))))
;;; The code for initializing the cache is wrapped in a form with
;;; the specified name. (:INIT-WRAPPER is set to COLD-INIT-FORMS
;;; in type system definitions so that caches will be created
-;;; before top-level forms run.)
+;;; before top level forms run.)
(defmacro define-hash-cache (name args &key hash-function hash-bits default
(init-wrapper 'progn)
(values 1))
(let ((*error-error-depth* (1+ *error-error-depth*)))
(when (> *error-throw-up-count* 50)
(%primitive sb!c:halt)
- (throw 'sb!impl::top-level-catcher nil))
+ (throw 'sb!impl::toplevel-catcher nil))
(case *error-error-depth*
(1)
(2
(stream-cold-init-or-reset))
(3
(incf *error-throw-up-count*)
- (throw 'sb!impl::top-level-catcher nil))
+ (throw 'sb!impl::toplevel-catcher nil))
(t
(%primitive sb!c:halt)
- (throw 'sb!impl::top-level-catcher nil)))
+ (throw 'sb!impl::toplevel-catcher nil)))
(with-standard-io-syntax
(let ((*print-readably* nil))
(eval (first i))
(return (eval (first i))))))
-;;; Pick off a few easy cases, and the various top-level EVAL-WHEN
+;;; Pick off a few easy cases, and the various top level EVAL-WHEN
;;; magical cases, and call %EVAL for the rest.
(defun eval (original-exp)
#!+sb-doc
(set (first args) (eval (second args)))))
(let ((symbol (first name)))
(case (info :variable :kind symbol)
- ;; FIXME: I took out the *TOP-LEVEL-AUTO-DECLARE*
- ;; test here, and removed the *TOP-LEVEL-AUTO-DECLARE*
+ ;; FIXME: I took out the *TOPLEVEL-AUTO-DECLARE*
+ ;; test here, and removed the *TOPLEVEL-AUTO-DECLARE*
;; variable; the code should now act as though that
;; variable is NIL. This should be tested..
(:special)
"Set NAME's global function definition."
(declare (type function new-value) (optimize (safety 1)))
(let ((fdefn (fdefinition-object name t)))
- ;; *SETF-FDEFINITION-HOOK* won't be bound when initially running top-level
- ;; forms in the kernel core startup.
+ ;; *SETF-FDEFINITION-HOOK* won't be bound when initially running
+ ;; top level forms in the kernel core startup.
(when (boundp '*setf-fdefinition-hook*)
(dolist (f *setf-fdefinition-hook*)
(funcall f name new-value)))
;;; We don't want to do these DEFCONSTANTs at cross-compilation time,
;;; because the cross-compilation host might not support floating
-;;; point infinities. Putting them inside a LET remove
-;;; top-level-formness, so that any EVAL-WHEN trickiness in the
+;;; point infinities. Putting them inside a LET removes
+;;; toplevel-formness, so that any EVAL-WHEN trickiness in the
;;; DEFCONSTANT forms is suppressed.
(let ()
(defconstant single-float-positive-infinity
maximum)))))
;;; partial reverse-engineered documentation:
-;;; TOP-LEVEL is true for calls through PARSE-DEFMACRO from DEFSETF and
+;;; TOPLEVEL is true for calls through PARSE-DEFMACRO from DEFSETF and
;;; DESTRUCTURING-BIND, false otherwise.
;;; -- WHN 19990620
(defun parse-defmacro-lambda-list (possibly-dotted-lambda-list
error-kind
error-fun
&optional
- top-level
+ toplevel
env-illegal
env-arg-name)
(let* (;; PATH is a sort of pointer into the part of the lambda list we're
;; considering at this point in the code. PATH-0 is the root of the
;; lambda list, which is the initial value of PATH.
- (path-0 (if top-level
+ (path-0 (if toplevel
`(cdr ,arg-list-name)
arg-list-name))
(path path-0) ; (will change below)
((eq var '&environment)
(cond (env-illegal
(error "&ENVIRONMENT is not valid with ~S." error-kind))
- ((not top-level)
+ ((not toplevel)
(error "&ENVIRONMENT is only valid at top level of ~
lambda-list.")))
(cond ((and (cdr rest-of-args) (symbolp (cadr rest-of-args)))
(setf (%instance-layout result) layout)
result))
\f
-;;;; target-only parts of the DEFSTRUCT top-level code
+;;;; target-only parts of the DEFSTRUCT top level code
;;; Catch attempts to mess up definitions of symbols in the CL package.
(defun protect-cl (symbol)
(defun sigquit-handler (signal code context)
(declare (ignore signal code context))
- (throw 'sb!impl::top-level-catcher nil))
+ (throw 'sb!impl::toplevel-catcher nil))
(defun sb!kernel:signal-cold-init-or-reinit ()
#!+sb-doc
(defvar / nil
#!+sb-doc
- "a list of all the values returned by the most recent top-level EVAL")
+ "a list of all the values returned by the most recent top level EVAL")
(defvar // nil #!+sb-doc "the previous value of /")
(defvar /// nil #!+sb-doc "the previous value of //")
-(defvar * nil #!+sb-doc "the value of the most recent top-level EVAL")
+(defvar * nil #!+sb-doc "the value of the most recent top level EVAL")
(defvar ** nil #!+sb-doc "the previous value of *")
(defvar *** nil #!+sb-doc "the previous value of **")
-(defvar + nil #!+sb-doc "the value of the most recent top-level READ")
+(defvar + nil #!+sb-doc "the value of the most recent top level READ")
(defvar ++ nil #!+sb-doc "the previous value of +")
(defvar +++ nil #!+sb-doc "the previous value of ++")
(defvar - nil #!+sb-doc "the form currently being evaluated")
-(defvar *prompt* "* "
- #!+sb-doc
- "The top-level prompt string. This also may be a function of no arguments
- that returns a simple-string.")
+
+;;; the top level prompt string, or a function of no arguments that
+;;; returns a simple-string
+(defvar *prompt* "* ")
(defun interactive-eval (form)
"Evaluate FORM, returning whatever it returns and adjusting ***, **, *,
(finish-output (symbol-value name)))
(values))
-;;; the default system top-level function
+;;; the default system top level function
(defun toplevel-init ()
(/show0 "entering TOPLEVEL-INIT")
;; get you out to here.
(with-simple-restart (abort
"Reduce debugger level (leaving debugger).")
- (catch 'top-level-catcher
- (sb!unix:unix-sigsetmask 0) ; FIXME: What is this for?
- (/show0 "about to enter inner LOOP in TOPLEVEL-REPL")
- (loop ; FIXME: Do we need this inner LOOP?
- ;; FIXME: It seems bad to have GC behavior depend on scrubbing
- ;; the control stack before each interactive command. Isn't
- ;; there some way we can convince the GC to just ignore
- ;; dead areas of the control stack, so that we don't need to
- ;; rely on this half-measure?
- (scrub-control-stack)
- (unless noprint
- (fresh-line)
- (princ (if (functionp *prompt*)
- (funcall *prompt*)
- *prompt*))
- (flush-standard-output-streams))
- (let ((form (read *standard-input* nil eof-marker)))
- (if (eq form eof-marker)
- (quit)
- (let ((results
- (multiple-value-list (interactive-eval form))))
- (unless noprint
- (dolist (result results)
- (fresh-line)
- (prin1 result)))))))))))))
+ (catch 'toplevel-catcher
+ (sb!unix:unix-sigsetmask 0) ; FIXME: What is this for?
+ (/show0 "about to enter inner LOOP in TOPLEVEL-REPL")
+ (loop ; FIXME: Do we need this inner LOOP?
+ ;; FIXME: It seems bad to have GC behavior depend on scrubbing
+ ;; the control stack before each interactive command. Isn't
+ ;; there some way we can convince the GC to just ignore
+ ;; dead areas of the control stack, so that we don't need to
+ ;; rely on this half-measure?
+ (scrub-control-stack)
+ (unless noprint
+ (fresh-line)
+ (princ (if (functionp *prompt*)
+ (funcall *prompt*)
+ *prompt*))
+ (flush-standard-output-streams))
+ (let ((form (read *standard-input* nil eof-marker)))
+ (if (eq form eof-marker)
+ (quit)
+ (let ((results
+ (multiple-value-list (interactive-eval form))))
+ (unless noprint
+ (dolist (result results)
+ (fresh-line)
+ (prin1 result)))))))))))))
(defun noprogrammer-debugger-hook-fun (condition old-debugger-hook)
(declare (ignore old-debugger-hook))
-;;;; When this file's top-level forms are run, it precomputes the
+;;;; When this file's top level forms are run, it precomputes the
;;;; translations for commonly used type specifiers. This stuff is
;;;; split off from the other type stuff to get around problems with
;;;; everything needing to be loaded before everything else. This is
(in-package "SB!VM")
-;;; a handy macro for defining top-level forms that depend on the
+;;; a handy macro for defining top level forms that depend on the
;;; compile environment
(defmacro expand (expr)
(let ((gensym (gensym)))
One of :WARN, :ERROR or :NONE.")
(declaim (type (member :warn :error :none) *burp-action*))
-;;; Called when something funny but possibly correct is noticed. Otherwise
-;;; similar to Barf.
+;;; Called when something funny but possibly correct is noticed.
+;;; Otherwise similar to BARF.
(declaim (ftype (function (string &rest t) (values)) burp))
(defun burp (string &rest *args*)
(ecase *burp-action*
(:none))
(values))
-;;; *Seen-Blocks* is a hashtable with true values for all blocks which appear
-;;; in the DFO for one of the specified components.
+;;; *SEEN-BLOCKS* is a hashtable with true values for all blocks which
+;;; appear in the DFO for one of the specified components.
+;;;
+;;; *SEEN-FUNCTIONS* is similar, but records all the lambdas we
+;;; reached by recursing on top level functions.
(defvar *seen-blocks* (make-hash-table :test 'eq))
-
-;;; *Seen-Functions* is similar, but records all the lambdas we reached by
-;;; recursing on top-level functions.
(defvar *seen-functions* (make-hash-table :test 'eq))
-;;; Barf if Node is in a block which wasn't reached during the graph walk.
+;;; Barf if NODE is in a block which wasn't reached during the graph
+;;; walk.
(declaim (ftype (function (node) (values)) check-node-reached))
(defun check-node-reached (node)
(unless (gethash (continuation-block (node-prev node)) *seen-blocks*)
(eq functional (optional-dispatch-main-entry ef)))
(barf ":OPTIONAL ~S is not an e-p for its OPTIONAL-DISPATCH ~S."
functional ef))))
- (:top-level
+ (:toplevel
(unless (eq (functional-entry-function functional) functional)
(barf "The ENTRY-FUNCTION in ~S isn't a self-pointer." functional)))
((nil :escape :cleanup)
(return-from check-function-stuff)))
(case (functional-kind functional)
- ((nil :optional :external :top-level :escape :cleanup)
+ ((nil :optional :external :toplevel :escape :cleanup)
(when (lambda-p functional)
(dolist (fun (lambda-lets functional))
(unless (eq (lambda-home fun) functional)
(ref
(let ((leaf (ref-leaf node)))
(when (functional-p leaf)
- (if (eq (functional-kind leaf) :top-level-xep)
+ (if (eq (functional-kind leaf) :toplevel-xep)
(unless (eq (component-kind (block-component (node-block node)))
- :top-level)
- (barf ":TOP-LEVEL-XEP ref in non-top-level component: ~S"
+ :toplevel)
+ (barf ":TOPLEVEL-XEP ref in non-top-level component: ~S"
node))
(check-function-reached leaf node)))))
(basic-combination
(optional-dispatch
(format stream "optional-dispatch ~S" (leaf-name leaf)))
(functional
- (aver (eq (functional-kind leaf) :top-level-xep))
+ (aver (eq (functional-kind leaf) :toplevel-xep))
(format stream "TL-XEP ~S"
(entry-info-name (leaf-info leaf))))))
;;; References to functions which local call analysis could not (or
;;; were chosen not) to local call convert will appear as references
;;; to XEP lambdas. We can ignore references to XEPs that appear in
-;;; :TOP-LEVEL components, since environment analysis goes to special
-;;; effort to allow closing over of values from a separate top-level
+;;; :TOPLEVEL components, since environment analysis goes to special
+;;; effort to allow closing over of values from a separate top level
;;; component. (And now that HAS-EXTERNAL-REFERENCES-P-ness
-;;; generalizes :TOP-LEVEL-ness, we ignore those too.) All other
+;;; generalizes :TOPLEVEL-ness, we ignore those too.) All other
;;; references must cause components to be joined.
;;;
;;; References in deleted functions are also ignored, since this code
(let* ((home (node-home-lambda ref))
(home-kind (functional-kind home))
(home-externally-visible-p
- (or (eq home-kind :top-level)
+ (or (eq home-kind :toplevel)
(functional-has-external-references-p home))))
(unless (or (and home-externally-visible-p
(eq (functional-kind fun) :external))
(find-if #'entry-exits entries)))))
;;; Compute the result of FIND-INITIAL-DFO given the list of all
-;;; resulting components. Components with a :TOP-LEVEL lambda, but no
-;;; normal XEPs or potential non-local exits are marked as :TOP-LEVEL.
-;;; If there is a :TOP-LEVEL lambda, and also a normal XEP, then we
+;;; resulting components. Components with a :TOPLEVEL lambda, but no
+;;; normal XEPs or potential non-local exits are marked as :TOPLEVEL.
+;;; If there is a :TOPLEVEL lambda, and also a normal XEP, then we
;;; treat the component as normal, but also return such components in
;;; a list as the third value. Components with no entry of any sort
;;; are deleted.
-(defun find-top-level-components (components)
+(defun find-toplevel-components (components)
(declare (list components))
(collect ((real)
(top)
(dolist (com components)
(unless (eq (block-next (component-head com)) (component-tail com))
(let* ((funs (component-lambdas com))
- (has-top (find :top-level funs :key #'functional-kind))
+ (has-top (find :toplevel funs :key #'functional-kind))
(has-external-references
(some #'functional-has-external-references-p funs)))
(cond (;; The FUNCTIONAL-HAS-EXTERNAL-REFERENCES-P concept
;; is newer than the rest of this function, and
;; doesn't really seem to fit into its mindset. Here
;; we mark components which contain such FUNCTIONs
- ;; them as :COMPLEX-TOP-LEVEL, since they do get
+ ;; them as :COMPLEX-TOPLEVEL, since they do get
;; executed at run time, and since it's not valid to
;; delete them just because they don't have any
- ;; references from pure :TOP-LEVEL components. -- WHN
+ ;; references from pure :TOPLEVEL components. -- WHN
has-external-references
- (setf (component-kind com) :complex-top-level)
+ (setf (component-kind com) :complex-toplevel)
(real com)
(real-top com))
((or (some #'has-xep-or-nlx funs)
(setf (component-name com) (find-component-name com))
(real com)
(when has-top
- (setf (component-kind com) :complex-top-level)
+ (setf (component-kind com) :complex-toplevel)
(real-top com)))
(has-top
- (setf (component-kind com) :top-level)
- (setf (component-name com) "top-level form")
+ (setf (component-kind com) :toplevel)
+ (setf (component-name com) "top level form")
(top com))
(t
(delete-component com))))))
(values (real) (top) (real-top))))
-;;; Given a list of top-level lambdas, return three lists of
+;;; Given a list of top level lambdas, return three lists of
;;; components representing the actual component division:
;;; 1. the non-top-level components,
-;;; 2. and the second is the top-level components, and
-;;; 3. Components in [1] that also have a top-level lambda.
+;;; 2. and the second is the top level components, and
+;;; 3. Components in [1] that also have a top level lambda.
;;;
;;; We assign the DFO for each component, and delete any unreachable
;;; blocks. We assume that the Flags have already been cleared.
;;; the appropriate newc component tail.
;;;
;;; When we are done, we assign DFNs and call
-;;; FIND-TOP-LEVEL-COMPONENTS to pull out top-level code.
+;;; FIND-TOPLEVEL-COMPONENTS to pull out top level code.
(defun find-initial-dfo (lambdas)
(declare (list lambdas))
(collect ((components))
(let ((component (block-component (node-block (lambda-bind tll)))))
(dolist (fun (component-lambdas component))
(aver (member (functional-kind fun)
- '(:optional :external :top-level nil :escape
+ '(:optional :external :toplevel nil :escape
:cleanup)))
(let ((res (dfo-walk-call-graph fun new)))
(when (eq res new)
(do-blocks-backwards (block com :both)
(setf (block-number block) (incf num)))))
- (find-top-level-components (components))))
+ (find-toplevel-components (components))))
\f
;;; Insert the code in LAMBDA at the end of RESULT-LAMBDA.
(defun merge-1-tl-lambda (result-lambda lambda)
;; If there is a return, then delete it (making the preceding node
;; the last node) and link the block to the result return. There
- ;; is always a preceding REF NIL node in top-level lambdas.
+ ;; is always a preceding REF NIL node in top level lambdas.
(let ((return (lambda-return lambda)))
(when return
(let ((return-block (node-block return))
(delete-continuation result)
(link-blocks return-block result-return-block))))))
-;;; Given a non-empty list of top-level LAMBDAs, smash them into a
-;;; top-level lambda and component, returning these as values. We use
+;;; Given a non-empty list of top level LAMBDAs, smash them into a
+;;; top level lambda and component, returning these as values. We use
;;; the first lambda and its component, putting the other code in that
;;; component and deleting the other lambdas.
-(defun merge-top-level-lambdas (lambdas)
+(defun merge-toplevel-lambdas (lambdas)
(declare (cons lambdas))
(let* ((result-lambda (first lambdas))
(result-return (lambda-return result-lambda)))
enclosing-object)
;;; a list of the CIRCULARITY structures for all of the circularities
-;;; detected in the current top-level call to DUMP-OBJECT. Setting
+;;; detected in the current top level call to DUMP-OBJECT. Setting
;;; this lobotomizes circularity detection as well, since circular
;;; dumping uses the table.
(defvar *circularities-detected*)
;;;
;;; This is the function used for recursive calls to the fasl dumper.
;;; We don't worry about creating circularities here, since it is
-;;; assumed that there is a top-level call to DUMP-OBJECT.
+;;; assumed that there is a top level call to DUMP-OBJECT.
(defun sub-dump-object (x file)
(cond ((listp x)
(if x
(dump-push handle fasl-output))
(values))
-;;; Dump a FOP-FUNCALL to call an already-dumped top-level lambda at
+;;; Dump a FOP-FUNCALL to call an already-dumped top level lambda at
;;; load time.
-(defun fasl-dump-top-level-lambda-call (fun fasl-output)
+(defun fasl-dump-toplevel-lambda-call (fun fasl-output)
(declare (type sb!c::clambda fun))
(dump-push-previously-dumped-fun fun fasl-output)
(dump-fop 'fop-funcall-for-effect fasl-output)
note-name-defined))
(defun note-name-defined (name kind)
;; We do this BOUNDP check because this function can be called when
- ;; not in a compilation unit (as when loading top-level forms).
+ ;; not in a compilation unit (as when loading top level forms).
(when (boundp '*undefined-warnings*)
(setq *undefined-warnings*
(delete-if (lambda (x)
(values))
;;; Replace all references to COMPONENT's non-closure XEPs that appear
-;;; in top-level or externally-referenced components, changing to
-;;; :TOP-LEVEL-XEP FUNCTIONALs. If the cross-component ref is not in a
-;;; :TOP-LEVEL/externally-referenced component, or is to a closure,
+;;; in top level or externally-referenced components, changing to
+;;; :TOPLEVEL-XEP FUNCTIONALs. If the cross-component ref is not in a
+;;; :TOPLEVEL/externally-referenced component, or is to a closure,
;;; then substitution is suppressed.
;;;
;;; When a cross-component ref is not substituted, we return T to
;;; indicate that early deletion of this component's IR1 should not be
;;; done. We also return T if this component contains
-;;; :TOP-LEVEL/externally-referenced lambdas (though it is not a
-;;; :TOP-LEVEL component.)
+;;; :TOPLEVEL/externally-referenced lambdas (though it is not a
+;;; :TOPLEVEL component.)
;;;
;;; We deliberately don't use the normal reference deletion, since we
;;; don't want to trigger deletion of the XEP (although it shouldn't
;;; hurt, since this is called after COMPONENT is compiled.) Instead,
;;; we just clobber the REF-LEAF.
-(defun replace-top-level-xeps (component)
+(defun replace-toplevel-xeps (component)
(let ((res nil))
(dolist (lambda (component-lambdas component))
(case (functional-kind lambda)
(:external
(unless (lambda-has-external-references-p lambda)
(let* ((ef (functional-entry-function lambda))
- (new (make-functional :kind :top-level-xep
+ (new (make-functional :kind :toplevel-xep
:info (leaf-info lambda)
:name (leaf-name ef)
:lexenv (make-null-lexenv)))
(dolist (ref (leaf-refs lambda))
(let ((ref-component (block-component (node-block ref))))
(cond ((eq ref-component component))
- ((or (not (component-top-levelish-p ref-component))
+ ((or (not (component-toplevelish-p ref-component))
closure)
(setq res t))
(t
(setf (ref-leaf ref) new)
(push ref (leaf-refs new)))))))))
- (:top-level
+ (:toplevel
(setq res t))))
res))
(gethash info (core-object-patch-table object)))))
(values))
-;;; Call the top-level lambda function dumped for Entry, returning the
-;;; values. Entry may be a :TOP-LEVEL-XEP functional.
-(defun core-call-top-level-lambda (entry object)
+;;; Call the top level lambda function dumped for ENTRY, returning the
+;;; values. ENTRY may be a :TOPLEVEL-XEP functional.
+(defun core-call-toplevel-lambda (entry object)
(declare (type functional entry) (type core-object object))
(funcall (or (gethash (leaf-info entry)
(core-object-entry-table object))
;;;; for !COLD-INIT to be called at cold load time. !COLD-INIT is
;;;; responsible for explicitly initializing anything which has to be
;;;; initialized early before it transfers control to the ordinary
-;;;; top-level forms.
+;;;; top level forms.
;;;;
;;;; (In CMU CL, and in SBCL as of 0.6.9 anyway, functions not defined
;;;; by DEFUN aren't set up specially by GENESIS. In particular,
\f
;;;; translators for compiler-magic special forms
-;;; This handles EVAL-WHEN in non-top-level forms. (EVAL-WHENs in
-;;; top-level forms are picked off and handled by PROCESS-TOP-LEVEL-FORM,
+;;; This handles EVAL-WHEN in non-top-level forms. (EVAL-WHENs in top
+;;; level forms are picked off and handled by PROCESS-TOPLEVEL-FORM,
;;; so that they're never seen at this level.)
;;;
;;; ANSI "3.2.3.1 Processing of Top Level Forms" says that processing
;;; call FUN (with no arguments).
;;;
;;; This is split off from the IR1 convert method so that it can be
-;;; shared by the special-case top-level MACROLET processing code.
+;;; shared by the special-case top level MACROLET processing code.
(defun funcall-in-macrolet-lexenv (definitions fun)
(%funcall-in-foomacrolet-lexenv
(lambda (definition)
;;; logic shared between IR1 translators for LOCALLY, MACROLET,
;;; and SYMBOL-MACROLET
;;;
-;;; Note that all these things need to preserve top-level-formness,
+;;; Note that all these things need to preserve toplevel-formness,
;;; but we don't need to worry about that within an IR1 translator,
-;;; since top-level-formness is picked off by PROCESS-TOP-LEVEL-FOO
+;;; since toplevel-formness is picked off by PROCESS-TOPLEVEL-FOO
;;; forms before we hit the IR1 transform level.
(defun ir1-translate-locally (body start cont)
(declare (type list body) (type continuation start cont))
#!+sb-doc
"LOCALLY Declaration* Form*
Sequentially evaluate the Forms in a lexical environment where the
- the Declarations have effect. If LOCALLY is a top-level form, then
- the Forms are also processed as top-level forms."
+ the Declarations have effect. If LOCALLY is a top level form, then
+ the Forms are also processed as top level forms."
(ir1-translate-locally body start cont))
\f
;;;; FLET and LABELS
;;;
;;; Substitution of individual references is inhibited if the
;;; reference is in a different component from the home. This can only
-;;; happen with closures over top-level lambda vars. In such cases,
+;;; happen with closures over top level lambda vars. In such cases,
;;; the references may have already been compiled, and thus can't be
;;; retroactively modified.
;;;
t)
(t
(aver (eq (functional-kind (lambda-home fun))
- :top-level))
+ :toplevel))
nil)))
leaf var))
t)))))
(context nil :type list)
;; the FILE-INFO-NAME for the relevant FILE-INFO
(file-name (missing-arg) :type (or pathname (member :lisp :stream)))
- ;; the file position at which the top-level form starts, if applicable
+ ;; the file position at which the top level form starts, if applicable
(file-position nil :type (or index null))
;; the original source part of the source path
(original-source-path nil :type list))
\f
;;;; exported functions
-;;; This function takes a form and the top-level form number for that
+;;; This function takes a form and the top level form number for that
;;; form, and returns a lambda representing the translation of that
;;; form in the current global environment. The returned lambda is a
-;;; top-level lambda that can be called to cause evaluation of the
+;;; top level lambda that can be called to cause evaluation of the
;;; forms. This lambda is in the initial component. If FOR-VALUE is T,
;;; then the value of the form is returned from the function,
;;; otherwise NIL is returned.
;;; The hashtables used to hold global namespace info must be
;;; reallocated elsewhere. Note also that *LEXENV* is not bound, so
;;; that local macro definitions can be introduced by enclosing code.
-(defun ir1-top-level (form path for-value)
+(defun ir1-toplevel (form path for-value)
(declare (list path))
(let* ((*current-path* path)
(component (make-empty-component))
(setf (component-kind component) :initial)
(let* ((forms (if for-value `(,form) `(,form nil)))
(res (ir1-convert-lambda-body forms ())))
- (setf (leaf-name res) "top-level form")
+ (setf (leaf-name res) "top level form") ; FIXME: would be nice to have form index in name here, or some other info to aid in BACKTRACE
(setf (functional-entry-function res) res)
(setf (functional-arg-documentation res) ())
- (setf (functional-kind res) :top-level)
+ (setf (functional-kind res) :toplevel)
res)))
;;; *CURRENT-FORM-NUMBER* is used in FIND-SOURCE-PATHS to compute the
;;; form number to associate with a source path. This should be bound
;;; to an initial value of 0 before the processing of each truly
-;;; top-level form.
+;;; top level form.
(declaim (type index *current-form-number*))
(defvar *current-form-number*)
;;; This function is called on freshly read forms to record the
;;; initial location of each form (and subform.) Form is the form to
-;;; find the paths in, and TLF-NUM is the top-level form number of the
-;;; truly top-level form.
+;;; find the paths in, and TLF-NUM is the top level form number of the
+;;; truly top level form.
;;;
;;; This gets a bit interesting when the source code is circular. This
;;; can (reasonably?) happen in the case of circular list constants.
;;; &OPTIONAL and &REST args are annotated with an ARG-INFO structure
;;; which contains the extra information. If we hit something losing,
;;; we bug out with COMPILER-ERROR. These values are returned:
-;;; 1. a list of the var structures for each top-level argument;
+;;; 1. a list of the var structures for each top level argument;
;;; 2. a flag indicating whether &KEY was specified;
;;; 3. a flag indicating whether other &KEY args are allowed;
;;; 4. a list of the &AUX variables; and
(function-info-ir2-convert function-info))))
(substitute-leaf fun var)
;; If in a simple environment, then we can allow backward
- ;; references to this function from following top-level forms.
+ ;; references to this function from following top level forms.
(when expansion (setf (defined-fun-functional var) fun)))
fun)))
(lambda-physenv (node-home-lambda (block-last block))))
;;; Return the Top Level Form number of PATH, i.e. the ordinal number
-;;; of its original source's top-level form in its compilation unit.
+;;; of its original source's top level form in its compilation unit.
(defun source-path-tlf-number (path)
(declare (list path))
(car (last path)))
(declare (type clambda leaf))
(let ((kind (functional-kind leaf))
(bind (lambda-bind leaf)))
- (aver (not (member kind '(:deleted :optional :top-level))))
+ (aver (not (member kind '(:deleted :optional :toplevel))))
(aver (not (functional-has-external-references-p leaf)))
(setf (functional-kind leaf) :deleted)
(setf (lambda-bind leaf) nil)
(return nil)))))))
;;; Return true if function is an XEP. This is true of normal XEPs
-;;; (:EXTERNAL kind) and top-level lambdas (:TOP-LEVEL kind.)
+;;; (:EXTERNAL kind) and top level lambdas (:TOPLEVEL kind.)
(defun external-entry-point-p (fun)
(declare (type functional fun))
- (not (null (member (functional-kind fun) '(:external :top-level)))))
+ (not (null (member (functional-kind fun) '(:external :toplevel)))))
;;; If CONT's only use is a non-notinline global function reference,
;;; then return the referenced symbol, otherwise NIL. If NOTINLINE-OK
;;; This gets interesting when the referenced function is a closure:
;;; we must make the closure and move the closed over values into it.
;;;
-;;; LEAF is either a :TOP-LEVEL-XEP functional or the XEP lambda for
+;;; LEAF is either a :TOPLEVEL-XEP functional or the XEP lambda for
;;; the called function, since local call analysis converts all
;;; closure references. If a TL-XEP, we know it is not a closure.
;;;
;;; If a closed-over LAMBDA-VAR has no refs (is deleted), then we
;;; don't initialize that slot. This can happen with closures over
-;;; top-level variables, where optimization of the closure deleted the
+;;; top level variables, where optimization of the closure deleted the
;;; variable. Since we committed to the closure format when we
-;;; pre-analyzed the top-level code, we just leave an empty slot.
+;;; pre-analyzed the top level code, we just leave an empty slot.
(defun ir2-convert-closure (node block leaf res)
(declare (type ref node) (type ir2-block block)
(type functional leaf) (type tn res))
(clambda
(physenv-closure (get-lambda-physenv leaf)))
(functional
- (aver (eq (functional-kind leaf) :top-level-xep))
+ (aver (eq (functional-kind leaf) :toplevel-xep))
nil))))
(cond (closure
(let ((this-env (node-physenv node)))
(vop closure-ref node block closure (incf n) (cdr loc)))))
(vop setup-environment node block start-label)))
- (unless (eq (functional-kind fun) :top-level)
+ (unless (eq (functional-kind fun) :toplevel)
(let ((vars (lambda-vars fun))
(n 0))
(when (leaf-refs (first vars))
(let* ((fun (bind-lambda node))
(env (physenv-info (lambda-physenv fun))))
(aver (member (functional-kind fun)
- '(nil :external :optional :top-level :cleanup)))
+ '(nil :external :optional :toplevel :cleanup)))
(when (external-entry-point-p fun)
(init-xep-environment node block fun)
;;; to use code like this, to factor out some shared functionality for clarity
;;; and for economy. But the motivation for splitting out this code here is
;;; much weirder. In the current version of the code, the cross-compiler calls
-;;; UNCROSS on each top-level form before processing it. Ordinarily, UNCROSS
+;;; UNCROSS on each top level form before processing it. Ordinarily, UNCROSS
;;; isn't called on macro expansions, but since DEF-BOOLEAN-ATTRIBUTE expands
;;; into a PROGN, the cross-compiler does end up calling UNCROSS on (the
-;;; components of) its macroexpansion, since they're separate top-level forms.
+;;; components of) its macroexpansion, since they're separate top level forms.
;;; In the classic CMU CL macroexpansion, the call to GET-SETF-EXPANSION is in
;;; the macroexpansion, and even when I translate it to
;;; SB!XC:GET-SETF-MACROEXPANSION so that it will work on target code, my
(block-delete-p block)
(eq (functional-kind (block-home-lambda block)) :deleted)
(member (functional-kind original-fun)
- '(:top-level-xep :deleted))
+ '(:toplevel-xep :deleted))
(not (or (eq (component-kind component) :initial)
(eq (block-component
(node-block
;;
;; The (SETF .. NIL) caused problems in sbcl-0.pre7.37.flaky5.2 when
;; I was trying to get Python to emit :EXTERNAL LAMBDAs directly
- ;; (instead of only being able to emit funny little :TOP-LEVEL stubs
+ ;; (instead of only being able to emit funny little :TOPLEVEL stubs
;; which you called in order to get the address of an external LAMBDA):
;; the external function was defined in terms of internal function,
;; which was LET-converted, and then things blew up downstream when
-;;;; the top-level interfaces to the compiler, plus some other
+;;;; the top level interfaces to the compiler, plus some other
;;;; compiler-related stuff (e.g. CL:CALL-ARGUMENTS-LIMIT) which
;;;; doesn't obviously belong anywhere else
(defvar *entry-points*)
(declaim (list *entry-points*))
-;;; When block compiling, used by PROCESS-FORM to accumulate top-level
+;;; When block compiling, used by PROCESS-FORM to accumulate top level
;;; lambdas resulting from compiling subforms. (In reverse order.)
-(defvar *top-level-lambdas*)
-(declaim (list *top-level-lambdas*))
+(defvar *toplevel-lambdas*)
+(declaim (list *toplevel-lambdas*))
(defvar sb!xc:*compile-verbose* t
#!+sb-doc
(when (functional-has-external-references-p fun)
(return))
(case (functional-kind fun)
- (:top-level (return))
+ (:toplevel (return))
(:external
(unless (every (lambda (ref)
(eq (block-component (node-block ref))
(vector-push-extend form forms)
(vector-push-extend pos (file-info-positions file-info))
(find-source-paths form current-idx)
- (process-top-level-form form
- `(original-source-start 0 ,current-idx)
- nil)))))))
+ (process-toplevel-form form
+ `(original-source-start 0 ,current-idx)
+ nil)))))))
;;; Return the INDEX'th source form read from INFO and the position
;;; where it was read.
(values (aref (file-info-forms file-info) index)
(aref (file-info-positions file-info) index))))
\f
-;;;; top-level form processing
+;;;; processing of top level forms
-;;; This is called by top-level form processing when we are ready to
+;;; This is called by top level form processing when we are ready to
;;; actually compile something. If *BLOCK-COMPILE* is T, then we still
;;; convert the form, but delay compilation, pushing the result on
-;;; *TOP-LEVEL-LAMBDAS* instead.
+;;; *TOPLEVEL-LAMBDAS* instead.
(defun convert-and-maybe-compile (form path)
(declare (list path))
(let* ((*lexenv* (make-lexenv :policy *policy*))
- (tll (ir1-top-level form path nil)))
- (cond ((eq *block-compile* t) (push tll *top-level-lambdas*))
- (t (compile-top-level (list tll) nil)))))
+ (tll (ir1-toplevel form path nil)))
+ (cond ((eq *block-compile* t) (push tll *toplevel-lambdas*))
+ (t (compile-toplevel (list tll) nil)))))
;;; Macroexpand FORM in the current environment with an error handler.
;;; We only expand one level, so that we retain all the intervening
(format nil "~S" form))
condition))))
-;;; Process a PROGN-like portion of a top-level form. FORMS is a list of
+;;; Process a PROGN-like portion of a top level form. FORMS is a list of
;;; the forms, and PATH is the source path of the FORM they came out of.
;;; COMPILE-TIME-TOO is as in ANSI "3.2.3.1 Processing of Top Level Forms".
-(defun process-top-level-progn (forms path compile-time-too)
+(defun process-toplevel-progn (forms path compile-time-too)
(declare (list forms) (list path))
(dolist (form forms)
- (process-top-level-form form path compile-time-too)))
+ (process-toplevel-form form path compile-time-too)))
-;;; Process a top-level use of LOCALLY, or anything else (e.g.
-;;; MACROLET) at top-level which has declarations and ordinary forms.
+;;; Process a top level use of LOCALLY, or anything else (e.g.
+;;; MACROLET) at top level which has declarations and ordinary forms.
;;; We parse declarations and then recursively process the body.
-(defun process-top-level-locally (body path compile-time-too)
+(defun process-toplevel-locally (body path compile-time-too)
(declare (list path))
(multiple-value-bind (forms decls) (sb!sys:parse-body body nil)
(let* ((*lexenv*
;; inside LOCALLY works OK. Failing that, at least we could
;; issue a warning instead of silently screwing up.
(*policy* (lexenv-policy *lexenv*)))
- (process-top-level-progn forms path compile-time-too))))
+ (process-toplevel-progn forms path compile-time-too))))
;;; Parse an EVAL-WHEN situations list, returning three flags,
;;; (VALUES COMPILE-TOPLEVEL LOAD-TOPLEVEL EXECUTE), indicating
(maybe-frob (optional-dispatch-more-entry f))
(maybe-frob (optional-dispatch-main-entry f)))))))
-(defun make-functional-from-top-level-lambda (definition
- &key
- name
- (path
- ;; I'd thought NIL should
- ;; work, but it doesn't.
- ;; -- WHN 2001-09-20
- (missing-arg)))
+(defun make-functional-from-toplevel-lambda (definition
+ &key
+ name
+ (path
+ ;; I'd thought NIL should
+ ;; work, but it doesn't.
+ ;; -- WHN 2001-09-20
+ (missing-arg)))
(let* ((*current-path* path)
(component (make-empty-component))
(*current-component* component))
(unless (or (null name) (legal-fun-name-p name))
(error "not a legal function name: ~S" name))
(let* ((*lexenv* (make-lexenv :policy *policy*))
- (fun (make-functional-from-top-level-lambda lambda-expression
- :name name
- :path path)))
+ (fun (make-functional-from-toplevel-lambda lambda-expression
+ :name name
+ :path path)))
;; FIXME: The compile-it code from here on is sort of a
- ;; twisted version of the code in COMPILE-TOP-LEVEL. It'd be
+ ;; twisted version of the code in COMPILE-TOPLEVEL. It'd be
;; better to find a way to share the code there; or
;; alternatively, to use this code to replace the code there.
;; (The second alternative might be pretty easy if we used
;; the :LOCALL-ONLY option to IR1-FOR-LAMBDA. Then maybe the
- ;; whole FUNCTIONAL-KIND=:TOP-LEVEL case could go away..)
+ ;; whole FUNCTIONAL-KIND=:TOPLEVEL case could go away..)
(local-call-analyze-until-done (list fun))
(find-initial-dfo (list fun))
(let ((*all-components* (append components-from-dfo top-components)))
- (mapc #'preallocate-physenvs-for-top-levelish-lambdas
+ (mapc #'preallocate-physenvs-for-toplevelish-lambdas
(append hairy-top top-components))
(dolist (component-from-dfo components-from-dfo)
(compile-component component-from-dfo)
- (replace-top-level-xeps component-from-dfo)))
+ (replace-toplevel-xeps component-from-dfo)))
(prog1
(let ((entry-table (etypecase *compile-object*
(mapc #'clear-ir1-info components-from-dfo)
(clear-stuff)))))
-(defun process-top-level-cold-fset (name lambda-expression path)
+(defun process-toplevel-cold-fset (name lambda-expression path)
(unless (producing-fasl-file)
(error "can't COLD-FSET except in a fasl file"))
(unless (legal-fun-name-p name)
*compile-object*)
(values))
-;;; Process a top-level FORM with the specified source PATH.
-;;; * If this is a magic top-level form, then do stuff.
+;;; Process a top level FORM with the specified source PATH.
+;;; * If this is a magic top level form, then do stuff.
;;; * If this is a macro, then expand it.
;;; * Otherwise, just compile it.
;;;
;;; COMPILE-TIME-TOO is as defined in ANSI
;;; "3.2.3.1 Processing of Top Level Forms".
-(defun process-top-level-form (form path compile-time-too)
+(defun process-toplevel-form (form path compile-time-too)
(declare (list path))
- (catch 'process-top-level-form-error-abort
+ (catch 'process-toplevel-form-error-abort
(let* ((path (or (gethash form *source-paths*) (cons form path)))
(*compiler-error-bailout*
(lambda ()
`(error "execution of a form compiled with errors:~% ~S"
',form)
path)
- (throw 'process-top-level-form-error-abort nil))))
+ (throw 'process-toplevel-form-error-abort nil))))
(if (atom form)
;; (There are no EVAL-WHEN issues in the ATOM case until
(aver (not compile-time-too))
(destructuring-bind (cold-fset fun-name lambda-expression) form
(declare (ignore cold-fset))
- (process-top-level-cold-fset fun-name
- lambda-expression
- path)))
+ (process-toplevel-cold-fset fun-name
+ lambda-expression
+ path)))
((eval-when macrolet symbol-macrolet);things w/ 1 arg before body
(need-at-least-one-arg form)
(destructuring-bind (special-operator magic &rest body) form
(let ((new-compile-time-too (or ct
(and compile-time-too
e))))
- (cond (lt (process-top-level-progn
+ (cond (lt (process-toplevel-progn
body path new-compile-time-too))
(new-compile-time-too (eval
`(progn ,@body)))))))
(funcall-in-macrolet-lexenv
magic
(lambda ()
- (process-top-level-locally body
- path
- compile-time-too))))
+ (process-toplevel-locally body
+ path
+ compile-time-too))))
((symbol-macrolet)
(funcall-in-symbol-macrolet-lexenv
magic
(lambda ()
- (process-top-level-locally body
- path
- compile-time-too)))))))
+ (process-toplevel-locally body
+ path
+ compile-time-too)))))))
((locally)
- (process-top-level-locally (rest form) path compile-time-too))
+ (process-toplevel-locally (rest form) path compile-time-too))
((progn)
- (process-top-level-progn (rest form) path compile-time-too))
+ (process-toplevel-progn (rest form) path compile-time-too))
;; When we're cross-compiling, consider: what should we
;; do when we hit e.g.
;; (EVAL-WHEN (:COMPILE-TOPLEVEL)
;; cross-compilation host.)
(slightly-uncrossed (cons (uncross (first form))
(rest form)))
- (expanded (preprocessor-macroexpand-1 slightly-uncrossed)))
+ (expanded (preprocessor-macroexpand-1
+ slightly-uncrossed)))
(if (eq expanded slightly-uncrossed)
;; (Now that we're no longer processing toplevel
;; forms, and hence no longer need to worry about
;; otherwise we'd tend to EVAL subforms more than
;; once, because of WHEN COMPILE-TIME-TOO form
;; above.)
- (process-top-level-form expanded path nil))))
+ (process-toplevel-form expanded path nil))))
;; When we're not cross-compiling, we only need to
;; macroexpand once, so we can follow the 1-thru-6
;; sequence of steps in ANSI's "3.2.3.1 Processing of
(eval form))
(convert-and-maybe-compile form path))
(t
- (process-top-level-form expanded
- path
- compile-time-too))))))))))
+ (process-toplevel-form expanded
+ path
+ compile-time-too))))))))))
(values))
\f
;;; not value) at load time.
(defun compile-make-load-form-init-forms (forms name)
(let ((lambda (compile-load-time-stuff `(progn ,@forms) name nil)))
- (fasl-dump-top-level-lambda-call lambda *compile-object*)))
+ (fasl-dump-toplevel-lambda-call lambda *compile-object*)))
;;; Does the actual work of COMPILE-LOAD-TIME-VALUE or
;;; COMPILE-MAKE-LOAD-FORM- INIT-FORMS.
(defun compile-load-time-stuff (form name for-value)
(with-ir1-namespace
(let* ((*lexenv* (make-null-lexenv))
- (lambda (ir1-top-level form *current-path* for-value)))
+ (lambda (ir1-toplevel form *current-path* for-value)))
(setf (leaf-name lambda) name)
- (compile-top-level (list lambda) t)
+ (compile-toplevel (list lambda) t)
lambda)))
-;;; This is called by COMPILE-TOP-LEVEL when it was passed T for
+;;; This is called by COMPILE-TOPLEVEL when it was passed T for
;;; LOAD-TIME-VALUE-P (which happens in COMPILE-LOAD-TIME-STUFF). We
;;; don't try to combine this component with anything else and frob
-;;; the name. If not in a :TOP-LEVEL component, then don't bother
+;;; the name. If not in a :TOPLEVEL component, then don't bother
;;; compiling, because it was merged with a run-time component.
(defun compile-load-time-value-lambda (lambdas)
(aver (null (cdr lambdas)))
(let* ((lambda (car lambdas))
(component (block-component (node-block (lambda-bind lambda)))))
- (when (eql (component-kind component) :top-level)
+ (when (eql (component-kind component) :toplevel)
(setf (component-name component) (leaf-name lambda))
(compile-component component)
(clear-ir1-info component))))
\f
;;;; COMPILE-FILE
-;;; We build a list of top-level lambdas, and then periodically smash
+;;; We build a list of top level lambdas, and then periodically smash
;;; them together into a single component and compile it.
-(defvar *pending-top-level-lambdas*)
+(defvar *pending-toplevel-lambdas*)
-;;; The maximum number of top-level lambdas we put in a single
-;;; top-level component.
+;;; The maximum number of top level lambdas we put in a single
+;;; top level component.
;;;
;;; CMU CL 18b used this nontrivially by default (setting it to 10)
;;; but consequently suffered from the inability to execute some
;;; GENESIS, which is desirable, since at least for SBCL version
;;; 0.6.7, this is the high water mark for memory usage during system
;;; construction.
-(defparameter *top-level-lambda-max* 0)
+(defparameter *toplevel-lambda-max* 0)
-(defun object-call-top-level-lambda (tll)
+(defun object-call-toplevel-lambda (tll)
(declare (type functional tll))
(let ((object *compile-object*))
(etypecase object
(fasl-output
- (fasl-dump-top-level-lambda-call tll object))
+ (fasl-dump-toplevel-lambda-call tll object))
(core-object
- (core-call-top-level-lambda tll object))
+ (core-call-toplevel-lambda tll object))
(null))))
;;; Add LAMBDAS to the pending lambdas. If this leaves more than
-;;; *TOP-LEVEL-LAMBDA-MAX* lambdas in the list, or if FORCE-P is true,
+;;; *TOPLEVEL-LAMBDA-MAX* lambdas in the list, or if FORCE-P is true,
;;; then smash the lambdas into a single component, compile it, and
;;; call the resulting function.
-(defun sub-compile-top-level-lambdas (lambdas force-p)
+(defun sub-compile-toplevel-lambdas (lambdas force-p)
(declare (list lambdas))
- (setq *pending-top-level-lambdas*
- (append *pending-top-level-lambdas* lambdas))
- (let ((pending *pending-top-level-lambdas*))
+ (setq *pending-toplevel-lambdas*
+ (append *pending-toplevel-lambdas* lambdas))
+ (let ((pending *pending-toplevel-lambdas*))
(when (and pending
- (or (> (length pending) *top-level-lambda-max*)
+ (or (> (length pending) *toplevel-lambda-max*)
force-p))
- (multiple-value-bind (component tll) (merge-top-level-lambdas pending)
- (setq *pending-top-level-lambdas* ())
+ (multiple-value-bind (component tll) (merge-toplevel-lambdas pending)
+ (setq *pending-toplevel-lambdas* ())
(compile-component component)
(clear-ir1-info component)
- (object-call-top-level-lambda tll))))
+ (object-call-toplevel-lambda tll))))
(values))
-;;; Compile top-level code and call the top-level lambdas. We pick off
-;;; top-level lambdas in non-top-level components here, calling
-;;; SUB-c-t-l-l on each subsequence of normal top-level lambdas.
-(defun compile-top-level-lambdas (lambdas force-p)
+;;; Compile top level code and call the top level lambdas. We pick off
+;;; top level lambdas in non-top-level components here, calling
+;;; SUB-c-t-l-l on each subsequence of normal top level lambdas.
+(defun compile-toplevel-lambdas (lambdas force-p)
(declare (list lambdas))
(let ((len (length lambdas)))
(flet ((loser (start)
(block-component
(node-block
(lambda-bind x))))
- :top-level)))
+ :toplevel)))
lambdas
:start start)
len)))
(loser (loser start) (loser start)))
((>= start len)
(when force-p
- (sub-compile-top-level-lambdas nil t)))
- (sub-compile-top-level-lambdas (subseq lambdas start loser)
- (or force-p (/= loser len)))
+ (sub-compile-toplevel-lambdas nil t)))
+ (sub-compile-toplevel-lambdas (subseq lambdas start loser)
+ (or force-p (/= loser len)))
(unless (= loser len)
- (object-call-top-level-lambda (elt lambdas loser))))))
+ (object-call-toplevel-lambda (elt lambdas loser))))))
(values))
-;;; Compile LAMBDAS (a list of CLAMBDAs for top-level forms) into the
+;;; Compile LAMBDAS (a list of CLAMBDAs for top level forms) into the
;;; object file.
;;;
;;; LOAD-TIME-VALUE-P seems to control whether it's MAKE-LOAD-FORM and
;;; COMPILE-LOAD-TIME-VALUE stuff. -- WHN 20000201
-(defun compile-top-level (lambdas load-time-value-p)
+(defun compile-toplevel (lambdas load-time-value-p)
(declare (list lambdas))
(maybe-mumble "locall ")
(multiple-value-bind (components top-components hairy-top)
(find-initial-dfo lambdas)
(let ((*all-components* (append components top-components))
- (top-level-closure nil))
+ (toplevel-closure nil))
(when *check-consistency*
(maybe-mumble "[check]~%")
(check-ir1-consistency *all-components*))
(dolist (component (append hairy-top top-components))
- (when (pre-physenv-analyze-top-level component)
- (setq top-level-closure t)))
+ (when (pre-physenv-analyze-toplevel component)
+ (setq toplevel-closure t)))
(dolist (component components)
(compile-component component)
- (when (replace-top-level-xeps component)
- (setq top-level-closure t)))
+ (when (replace-toplevel-xeps component)
+ (setq toplevel-closure t)))
(when *check-consistency*
(maybe-mumble "[check]~%")
(if load-time-value-p
(compile-load-time-value-lambda lambdas)
- (compile-top-level-lambdas lambdas top-level-closure))
+ (compile-toplevel-lambdas lambdas toplevel-closure))
(mapc #'clear-ir1-info components)
(clear-stuff)))
;;; compilation.
(defun finish-block-compilation ()
(when *block-compile*
- (when *top-level-lambdas*
- (compile-top-level (nreverse *top-level-lambdas*) nil)
- (setq *top-level-lambdas* ()))
+ (when *toplevel-lambdas*
+ (compile-toplevel (nreverse *toplevel-lambdas*) nil)
+ (setq *toplevel-lambdas* ()))
(setq *block-compile* nil)
(setq *entry-points* nil)))
(*source-info* info)
(sb!xc:*compile-file-pathname* nil)
(sb!xc:*compile-file-truename* nil)
- (*top-level-lambdas* ())
- (*pending-top-level-lambdas* ())
+ (*toplevel-lambdas* ())
+ (*pending-toplevel-lambdas* ())
(*compiler-error-bailout*
(lambda ()
(compiler-mumble "~2&; fatal error, aborting compilation~%")
(sub-sub-compile-file info)
(finish-block-compilation)
- (compile-top-level-lambdas () t)
+ (compile-toplevel-lambdas () t)
(let ((object *compile-object*))
(etypecase object
(fasl-output (fasl-dump-source-info info object))
(:ignore-it
nil)
(t
- (compile-top-level-lambdas () t)
+ (compile-toplevel-lambdas () t)
(when (fasl-constant-already-dumped-p constant *compile-object*)
(return-from emit-make-load-form nil))
(let* ((name (let ((*print-level* 1) (*print-length* 2))
:key #'operand-parse-name))))))
(values))
\f
-;;; the top-level parse function: clobber PARSE to represent the
+;;; the top level parse function: clobber PARSE to represent the
;;; specified options.
(defun parse-define-vop (parse specs)
(declare (type vop-parse parse) (list specs))
;; is indicated by the magic ORIGINAL-SOURCE-START marker. The first
;; element of the original source is the "form number", which is the
;; ordinal number of this form in a depth-first, left-to-right walk
- ;; of the truly top-level form in which this appears.
+ ;; of the truly-top-level form in which this appears.
;;
;; Following is a list of integers describing the path taken through
;; the source to get to this point:
;; (K L M ...) => (NTH K (NTH L (NTH M ...)))
;;
- ;; The last element in the list is the top-level form number, which
+ ;; The last element in the list is the top level form number, which
;; is the ordinal number (in this call to the compiler) of the truly
- ;; top-level form containing the original source.
+ ;; top level form containing the original source.
(source-path *current-path* :type list)
;; If this node is in a tail-recursive position, then this is set to
;; T. At the end of IR1 (in physical environment analysis) this is
;; The possibilities are:
;; NIL
;; an ordinary component, containing non-top-level code
- ;; :TOP-LEVEL
+ ;; :TOPLEVEL
;; a component containing only load-time code
- ;; :COMPLEX-TOP-LEVEL
+ ;; :COMPLEX-TOPLEVEL
;; In the old system, before FUNCTIONAL-HAS-EXTERNAL-REFERENCES-P
;; was defined, this was necessarily a component containing both
- ;; top-level and run-time code. Now this state is also used for
+ ;; top level and run-time code. Now this state is also used for
;; a component with HAS-EXTERNAL-REFERENCES-P functionals in it.
;; :INITIAL
;; the result of initial IR1 conversion, on which component
;; :DELETED
;; debris left over from component analysis
;;
- ;; See also COMPONENT-TOP-LEVELISH-P.
- (kind nil :type (member nil :top-level :complex-top-level :initial :deleted))
+ ;; See also COMPONENT-TOPLEVELISH-P.
+ (kind nil :type (member nil :toplevel :complex-toplevel :initial :deleted))
;; the blocks that are the dummy head and tail of the DFO
;;
;; Entry/exit points have these blocks as their
name
(reanalyze :test reanalyze))
-;;; Before sbcl-0.7.0, there were :TOP-LEVEL things which were magical
+;;; Before sbcl-0.7.0, there were :TOPLEVEL things which were magical
;;; in multiple ways. That's since been refactored into the orthogonal
;;; properties "optimized for locall with no arguments" and "externally
;;; visible/referenced (so don't delete it)". The code <0.7.0 did a lot
;;; this function is a sort of literal translation of those tests into
;;; the new world.
;;;
-;;; FIXME: After things settle down, bare :TOP-LEVEL might go away, at
+;;; FIXME: After things settle down, bare :TOPLEVEL might go away, at
;;; which time it might be possible to replace the COMPONENT-KIND
-;;; :TOP-LEVEL mess with a flag COMPONENT-HAS-EXTERNAL-REFERENCES-P
+;;; :TOPLEVEL mess with a flag COMPONENT-HAS-EXTERNAL-REFERENCES-P
;;; along the lines of FUNCTIONAL-HAS-EXTERNAL-REFERENCES-P.
-(defun lambda-top-levelish-p (clambda)
- (or (eql (lambda-kind clambda) :top-level)
+(defun lambda-toplevelish-p (clambda)
+ (or (eql (lambda-kind clambda) :toplevel)
(lambda-has-external-references-p clambda)))
-(defun component-top-levelish-p (component)
+(defun component-toplevelish-p (component)
(member (component-kind component)
- '(:top-level :complex-top-level)))
+ '(:toplevel :complex-toplevel)))
;;; A CLEANUP structure represents some dynamic binding action. Blocks
;;; are annotated with the current CLEANUP so that dynamic bindings
;; an external entry point lambda. The function it is an entry
;; for is in the ENTRY-FUNCTION slot.
;;
- ;; :TOP-LEVEL
- ;; a top-level lambda, holding a compiled top-level form.
+ ;; :TOPLEVEL
+ ;; a top level lambda, holding a compiled top level form.
;; Compiled very much like NIL, but provides an indication of
- ;; top-level context. A top-level lambda should have *no*
- ;; references. Its Entry-Function is a self-pointer.
+ ;; top level context. A :TOPLEVEL lambda should have *no*
+ ;; references. Its ENTRY-FUNCTION is a self-pointer.
;;
- ;; :TOP-LEVEL-XEP
- ;; After a component is compiled, we clobber any top-level code
+ ;; :TOPLEVEL-XEP
+ ;; After a component is compiled, we clobber any top level code
;; references to its non-closure XEPs with dummy FUNCTIONAL
;; structures having this kind. This prevents the retained
- ;; top-level code from holding onto the IR for the code it
+ ;; top level code from holding onto the IR for the code it
;; references.
;;
;; :ESCAPE
;; :DELETED
;; This function has been found to be uncallable, and has been
;; marked for deletion.
- (kind nil :type (member nil :optional :deleted :external :top-level
+ (kind nil :type (member nil :optional :deleted :external :toplevel
:escape :cleanup :let :mv-let :assignment
- :top-level-xep))
+ :toplevel-xep))
;; Is this a function that some external entity (e.g. the fasl dumper)
;; refers to, so that even when it appears to have no references, it
;; shouldn't be deleted? In the old days (before
;; sbcl-0.pre7.37.flaky5.2) this was sort of implicitly true when
- ;; KIND was :TOP-LEVEL. Now it must be set explicitly, both for
- ;; :TOP-LEVEL functions and for any other kind of functions that we
+ ;; KIND was :TOPLEVEL. Now it must be set explicitly, both for
+ ;; :TOPLEVEL functions and for any other kind of functions that we
;; want to dump or return from #'CL:COMPILE or whatever.
(has-external-references-p nil)
;; In a normal function, this is the external entry point (XEP)
;; In an XEP lambda (indicated by the :EXTERNAL kind), this is the
;; function that the XEP is an entry-point for. The body contains
;; local calls to all the actual entry points in the function. In a
- ;; :TOP-LEVEL lambda (which is its own XEP) this is a self-pointer.
+ ;; :TOPLEVEL lambda (which is its own XEP) this is a self-pointer.
;;
;; With all other kinds, this is null.
(entry-function nil :type (or functional null))
;;; Like EMIT-SAVES, only different. We avoid redundant saving within
;;; the block, and don't restore values that aren't used before the
-;;; next call. This function is just the top-level loop over the
+;;; next call. This function is just the top level loop over the
;;; blocks in the component, which locates blocks that need saving
;;; done.
(defun optimized-emit-saves (component)
;;; 10. the &MORE context var;
;;; 11. the &MORE count var.
;;;
-;;; The top-level lambda list syntax is checked for validity, but the
+;;; The top level lambda list syntax is checked for validity, but the
;;; arg specifiers are just passed through untouched. If something is
;;; wrong, we use COMPILER-ERROR, aborting compilation to the last
;;; recovery point.
(dolist (fun (component-lambdas component))
(when (null (leaf-refs fun))
(let ((kind (functional-kind fun)))
- (unless (or (eq kind :top-level)
+ (unless (or (eq kind :toplevel)
(functional-has-external-references-p fun))
(aver (member kind '(:optional :cleanup :escape)))
(setf (functional-kind fun) nil)
(values))
-;;; This is to be called on a COMPONENT with top-level LAMBDAs before
+;;; This is to be called on a COMPONENT with top level LAMBDAs before
;;; the compilation of the associated non-top-level code to detect
-;;; closed over top-level variables. We just do COMPUTE-CLOSURE on all
+;;; closed over top level variables. We just do COMPUTE-CLOSURE on all
;;; the lambdas. This will pre-allocate environments for all the
-;;; functions with closed-over top-level variables. The post-pass will
+;;; functions with closed-over top level variables. The post-pass will
;;; use the existing structure, rather than allocating a new one. We
;;; return true if we discover any possible closure vars.
-(defun pre-physenv-analyze-top-level (component)
+(defun pre-physenv-analyze-toplevel (component)
(declare (type component component))
(let ((found-it nil))
(dolist (lambda (component-lambdas component))
(setq found-it t))))
found-it))
-;;; This is like old CMU CL PRE-ENVIRONMENT-ANALYZE-TOP-LEVEL, except
+;;; This is like old CMU CL PRE-ENVIRONMENT-ANALYZE-TOPLEVEL, except
;;; (1) It's been brought into the post-0.7.0 world where the property
;;; HAS-EXTERNAL-REFERENCES-P is orthogonal to the property of
;;; being specialized/optimized for locall at top level.
;;; find any possible closure variables.
;;;
;;; I wish I could find an explanation of why
-;;; PRE-ENVIRONMENT-ANALYZE-TOP-LEVEL is important. The old CMU CL
+;;; PRE-ENVIRONMENT-ANALYZE-TOPLEVEL is important. The old CMU CL
;;; comments said
-;;; Called on component with top-level lambdas before the
+;;; Called on component with top level lambdas before the
;;; compilation of the associated non-top-level code to detect
-;;; closed over top-level variables. We just do COMPUTE-CLOSURE on
+;;; closed over top level variables. We just do COMPUTE-CLOSURE on
;;; all the lambdas. This will pre-allocate environments for all
-;;; the functions with closed-over top-level variables. The
+;;; the functions with closed-over top level variables. The
;;; post-pass will use the existing structure, rather than
;;; allocating a new one. We return true if we discover any
;;; possible closure vars.
;;; bottom out on the outermost enclosing thing, and (insert
;;; mysterious reason here) it's important to set up bottomed-out-here
;;; environments before anything else. -- WHN 2001-09-30
-(defun preallocate-physenvs-for-top-levelish-lambdas (component)
+(defun preallocate-physenvs-for-toplevelish-lambdas (component)
(dolist (clambda (component-lambdas component))
- (when (lambda-top-levelish-p clambda)
+ (when (lambda-toplevelish-p clambda)
(compute-closure clambda)))
(values))
\f
;;;; annotation graph walk
-;;; Do a backward walk in the flow graph simulating the run-time stack of
-;;; unknown-values continuations and annotating the blocks with the result.
+;;; Do a backward walk in the flow graph simulating the run-time stack
+;;; of unknown-values continuations and annotating the blocks with the
+;;; result.
;;;
-;;; Block is the block that is currently being walked and Stack is the stack
-;;; of unknown-values continuations in effect immediately after block. We
-;;; simulate the stack by popping off the unknown-values generated by this
-;;; block (if any) and pushing the continuations for values received by this
-;;; block. (The role of push and pop are interchanged because we are doing a
-;;; backward walk.)
+;;; BLOCK is the block that is currently being walked and STACK is the
+;;; stack of unknown-values continuations in effect immediately after
+;;; block. We simulate the stack by popping off the unknown-values
+;;; generated by this block (if any) and pushing the continuations for
+;;; values received by this block. (The role of push and pop are
+;;; interchanged because we are doing a backward walk.)
;;;
-;;; If we run into a values generator whose continuation isn't on stack top,
-;;; then the receiver hasn't yet been reached on any walk to this use. In this
-;;; case, we ignore the push for now, counting on Annotate-Dead-Values to clean
-;;; it up if we discover that it isn't reachable at all.
+;;; If we run into a values generator whose continuation isn't on
+;;; stack top, then the receiver hasn't yet been reached on any walk
+;;; to this use. In this case, we ignore the push for now, counting on
+;;; Annotate-Dead-Values to clean it up if we discover that it isn't
+;;; reachable at all.
;;;
-;;; If our final stack isn't empty, then we walk all the predecessor blocks
-;;; that don't have all the continuations that we have on our Start-Stack on
-;;; their End-Stack. This is our termination condition for the graph walk. We
-;;; put the test around the recursive call so that the initial call to this
-;;; function will do something even though there isn't initially anything on
-;;; the stack.
+;;; If our final stack isn't empty, then we walk all the predecessor
+;;; blocks that don't have all the continuations that we have on our
+;;; START-STACK on their END-STACK. This is our termination condition
+;;; for the graph walk. We put the test around the recursive call so
+;;; that the initial call to this function will do something even
+;;; though there isn't initially anything on the stack.
;;;
-;;; We can use the tailp test, since the only time we want to bottom out
-;;; with a non-empty stack is when we intersect with another path from the same
-;;; top-level call to this function that has more values receivers on that
-;;; path. When we bottom out in this way, we are counting on
-;;; DISCARD-UNUSED-VALUES doing its thing.
+;;; We can use the tailp test, since the only time we want to bottom
+;;; out with a non-empty stack is when we intersect with another path
+;;; from the same top level call to this function that has more values
+;;; receivers on that path. When we bottom out in this way, we are
+;;; counting on DISCARD-UNUSED-VALUES doing its thing.
;;;
;;; When we do recurse, we check that predecessor's END-STACK is a
-;;; subsequence of our START-STACK. There may be extra stuff on the top
-;;; of our stack because the last path to the predecessor may have discarded
-;;; some values that we use. There may be extra stuff on the bottom of our
-;;; stack because this walk may be from a values receiver whose lifetime
-;;; encloses that of the previous walk.
+;;; subsequence of our START-STACK. There may be extra stuff on the
+;;; top of our stack because the last path to the predecessor may have
+;;; discarded some values that we use. There may be extra stuff on the
+;;; bottom of our stack because this walk may be from a values
+;;; receiver whose lifetime encloses that of the previous walk.
;;;
-;;; If a predecessor block is the component head, then it must be the case
-;;; that this is a NLX entry stub. If so, we just stop our walk, since the
-;;; stack at the exit point doesn't have anything to do with our stack.
+;;; If a predecessor block is the component head, then it must be the
+;;; case that this is a NLX entry stub. If so, we just stop our walk,
+;;; since the stack at the exit point doesn't have anything to do with
+;;; our stack.
(defun stack-simulation-walk (block stack)
(declare (type cblock block) (list stack))
(let ((2block (block-info block)))
(defstruct (source-form-cache (:conc-name sfcache-)
(:copier nil))
(debug-source nil :type (or null sb!di:debug-source))
- (top-level-form-index -1 :type fixnum)
- (top-level-form nil :type list)
+ (toplevel-form-index -1 :type fixnum)
+ (toplevel-form nil :type list)
(form-number-mapping-table nil :type (or null (vector list)))
(last-location-retrieved nil :type (or null sb!di:code-location))
(last-form-retrieved -1 :type fixnum))
-(defun get-top-level-form (debug-source tlf-index)
+(defun get-toplevel-form (debug-source tlf-index)
(let ((name (sb!di:debug-source-name debug-source)))
(ecase (sb!di:debug-source-from debug-source)
(:file
(file-position f char-offset))
(t
(warn "Source file ~S has been modified; ~@
- using form offset instead of file index."
+ using form offset instead of ~
+ file index."
name)
(let ((*read-suppress* t))
(dotimes (i local-tlf-index) (read f)))))
(and cache
(and (eq (sb!di:code-location-debug-source loc)
(sfcache-debug-source cache))
- (eq (sb!di:code-location-top-level-form-offset loc)
- (sfcache-top-level-form-index cache)))))
+ (eq (sb!di:code-location-toplevel-form-offset loc)
+ (sfcache-toplevel-form-index cache)))))
(defun get-source-form (loc context &optional cache)
(let* ((cache-valid (cache-valid loc cache))
- (tlf-index (sb!di:code-location-top-level-form-offset loc))
+ (tlf-index (sb!di:code-location-toplevel-form-offset loc))
(form-number (sb!di:code-location-form-number loc))
- (top-level-form
+ (toplevel-form
(if cache-valid
- (sfcache-top-level-form cache)
- (get-top-level-form (sb!di:code-location-debug-source loc)
+ (sfcache-toplevel-form cache)
+ (get-toplevel-form (sb!di:code-location-debug-source loc)
tlf-index)))
(mapping-table
(if cache-valid
(sfcache-form-number-mapping-table cache)
- (sb!di:form-number-translations top-level-form tlf-index))))
+ (sb!di:form-number-translations toplevel-form tlf-index))))
(when (and (not cache-valid) cache)
(setf (sfcache-debug-source cache) (sb!di:code-location-debug-source loc)
- (sfcache-top-level-form-index cache) tlf-index
- (sfcache-top-level-form cache) top-level-form
+ (sfcache-toplevel-form-index cache) tlf-index
+ (sfcache-toplevel-form cache) toplevel-form
(sfcache-form-number-mapping-table cache) mapping-table))
- (cond ((null top-level-form)
+ (cond ((null toplevel-form)
nil)
((> form-number (length mapping-table))
(warn "bogus form-number in form! The source file has probably ~@
been changed too much to cope with.")
(when cache
;; Disable future warnings.
- (setf (sfcache-top-level-form cache) nil))
+ (setf (sfcache-toplevel-form cache) nil))
nil)
(t
(when cache
(setf (sfcache-last-location-retrieved cache) loc)
(setf (sfcache-last-form-retrieved cache) form-number))
- (sb!di:source-path-context top-level-form
+ (sb!di:source-path-context toplevel-form
(aref mapping-table form-number)
context)))))
(dolist (seg segments)
(disassemble-segment seg stream dstate)))))
\f
-;;;; top-level functions
+;;;; top level functions
;;; Disassemble the machine code instructions for FUNCTION.
(defun disassemble-function (function &key
;;; Find the function that is being compiled by COMPILE and bash its
;;; name to NAME. We also substitute for any references to name so
;;; that recursive calls will be compiled direct. LAMBDA is the
-;;; top-level lambda for the compilation. A REF for the real function
-;;; is the only thing in the top-level lambda other than the bind and
+;;; top level lambda for the compilation. A REF for the real function
+;;; is the only thing in the top level lambda other than the bind and
;;; return, so it isn't too hard to find.
(defun compile-fix-fun-name (lambda name)
(declare (type clambda lambda) (type (or symbol cons) name))
(*lexenv* (make-null-lexenv))
(form (get-lambda-to-compile definition))
(*source-info* (make-lisp-source-info form))
- (*top-level-lambdas* ())
+ (*toplevel-lambdas* ())
(*block-compile* nil)
(*compiler-error-bailout*
#'(lambda ()
(sb-kernel:become-defined-fun-name sym)
`(,sym ',class (list ,@initargs)))))))
-(defmacro expanding-make-instance-top-level (&rest forms &environment env)
+(defmacro expanding-make-instance-toplevel (&rest forms &environment env)
(let* ((*make-instance-function-keys* nil)
(form (macroexpand `(expanding-make-instance ,@forms) env)))
`(progn
(defmacro defconstructor
(name class lambda-list &rest initialization-arguments)
- `(expanding-make-instance-top-level
+ `(expanding-make-instance-toplevel
(defun ,name ,lambda-list
(make-instance ',class ,@initialization-arguments))))
'(time-constant-keys-make-instance 1000))
*tests*)
-(expanding-make-instance-top-level
+(expanding-make-instance-toplevel
(defun constant-keys-make-instance (n)
(dotimes-fixnum (i n) (make-instance 'plist-mixin))))
;;; for internal versions, especially for internal versions off the
;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.pre7.85"
+"0.pre7.86"