1 ;;;; "warm initialization": initialization which comes after cold init
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "COMMON-LISP-USER")
14 ;;;; general warm init compilation policy
16 (proclaim '(optimize (compilation-speed 1)
17 (debug #+sb-show
2 #-sb-show
1)
23 ;;; Assert that genesis preserved shadowing symbols.
24 (let ((p sb-assem
::*backend-instruction-set-package
*))
25 (unless (eq p
(find-package "SB-VM"))
26 (dolist (expect '("SEGMENT" "MAKE-SEGMENT"))
27 (assert (find expect
(package-shadowing-symbols p
) :test
'string
=)))))
30 ;;;; compiling and loading more of the system
32 (load "src/cold/muffler.lisp")
34 ;;; FIXME: CMU CL's pclcom.lisp had extra optional stuff wrapped around
35 ;;; COMPILE-PCL, at least some of which we should probably have too:
37 ;;; (with-compilation-unit
38 ;;; (:optimize '(optimize (debug #+(and (not high-security) small) .5
39 ;;; #-(or high-security small) 2
40 ;;; #+high-security 3)
41 ;;; (speed 2) (safety #+(and (not high-security) small) 0
42 ;;; #-(or high-security small) 2
43 ;;; #+high-security 3)
44 ;;; (inhibit-warnings 2))
45 ;;; :optimize-interface '(optimize-interface #+(and (not high-security) small)
47 ;;; #+high-security (safety 3))
48 ;;; :context-declarations
49 ;;; '((:external (declare (optimize-interface (safety #-high-security 2 #+high-
51 ;;; (debug #-high-security 1 #+high-s
53 ;;; ((:or :macro (:match "$EARLY-") (:match "$BOOT-"))
54 ;;; (declare (optimize (speed 0))))))
56 ;;; FIXME: This has mutated into a hack which crudely duplicates
57 ;;; functionality from the existing mechanism to load files from
58 ;;; build-order.lisp-expr, without being quite parallel. (E.g. object
59 ;;; files end up alongside the source files instead of ending up in
60 ;;; parallel directory trees.) Maybe we could merge the filenames here
61 ;;; into build-order.lisp-expr with some new flag (perhaps :WARM) to
62 ;;; indicate that the files should be handled not in cold load but
65 '("SRC;CODE;WARM-ERROR"
66 ;; We re-nickname SB-SEQUENCE as SEQUENCE now.
67 ;; It could be done in genesis, but not earlier,
68 ;; since the host has a package of that name.
69 "SRC;CODE;DEFPACKAGE"))
73 '("SRC;INTERPRETER;MACROS"
74 "SRC;INTERPRETER;CHECKFUNS"
76 "SRC;INTERPRETER;SEXPR"
77 "SRC;INTERPRETER;SPECIAL-FORMS"
78 "SRC;INTERPRETER;EVAL"
79 "SRC;INTERPRETER;DEBUG"))
81 '(;; CLOS, derived from the PCL reference implementation
83 ;; This PCL build order is based on a particular
84 ;; (arbitrary) linearization of the declared build
85 ;; order dependencies from the old PCL defsys.lisp
86 ;; dependency database.
87 #+nil
"src/pcl/walk" ; #+NIL = moved to build-order.lisp-expr
88 #+nil
"SRC;PCL;EARLY-LOW"
90 "SRC;PCL;COMPILER-SUPPORT"
92 #+nil
"SRC;PCL;SLOT-NAME" ; moved to build-order.lisp-expr
107 "SRC;PCL;GENERIC-FUNCTIONS"
118 "SRC;PCL;DOCUMENTATION"
119 "SRC;PCL;PRINT-OBJECT"
123 '("SRC;CODE;SETF-FUNS"
124 ;; miscellaneous functionality which depends on CLOS
125 "SRC;CODE;LATE-CONDITION"
127 ;; CLOS-level support for the Gray OO streams
128 ;; extension (which is also supported by various
129 ;; lower-level hooks elsewhere in the code)
130 "SRC;PCL;GRAY-STREAMS-CLASS"
131 "SRC;PCL;GRAY-STREAMS"
133 ;; CLOS-level support for User-extensible sequences.
136 ;; other functionality not needed for cold init, moved
137 ;; to warm init to reduce peak memory requirement in
141 "SRC;CODE;DESCRIBE-POLICY"
147 #+win32
"SRC;CODE;WARM-MSWIN"
148 "SRC;CODE;RUN-PROGRAM"
149 #+sb-traceroot
"SRC;CODE;TRACEROOT"
151 #+immobile-code
"SRC;CODE;IMMOBILE-CODE"
152 "SRC;CODE;REPACK-XREF"))
153 (sb-c::*handled-conditions
* sb-c
::*handled-conditions
*))
154 (declare (special *compile-files-p
*))
155 (proclaim '(sb-ext:muffle-conditions
156 (or (satisfies unable-to-optimize-note-p
)
157 (satisfies optional
+key-style-warning-p
))))
161 (let ((fullname (concatenate 'string
"SYS:" stem
".LISP")))
162 (sb-int:/show
"about to compile" fullname
)
163 (flet ((report-recompile-restart (stream)
164 (format stream
"Recompile file ~S" fullname
))
165 (report-continue-restart (stream)
167 "Continue, using possibly bogus file ~S"
168 (compile-file-pathname fullname
))))
171 (multiple-value-bind (output-truename warnings-p failure-p
)
172 (ecase (if (boundp '*compile-files-p
*) *compile-files-p
* t
)
173 ((t) (compile-file fullname
))
174 ((nil) (compile-file-pathname fullname
)))
175 (declare (ignore warnings-p
))
176 (sb-int:/show
"done compiling" fullname
)
177 (cond ((not output-truename
)
178 (error "COMPILE-FILE of ~S failed." fullname
))
182 (error "FAILURE-P was set when creating ~S."
185 :report report-recompile-restart
186 (go retry-compile-file
))
188 :report report-continue-restart
189 (setf failure-p nil
)))
190 ;; Don't leave failed object files lying around.
191 (when (and failure-p
(probe-file output-truename
))
192 (delete-file output-truename
)
193 (format t
"~&deleted ~S~%" output-truename
))))
194 ;; Otherwise: success, just fall through.
196 (unless (handler-bind
197 ((sb-kernel:redefinition-with-defgeneric
199 (load output-truename
))
200 (error "LOAD of ~S failed." output-truename
))
201 (sb-int:/show
"done loading" output-truename
))))))))
203 (let ((*print-length
* 10)
206 (*compile-print
* nil
))
208 (with-compilation-unit () (do-srcs interpreter-srcs
))
209 (with-compilation-unit () (do-srcs pcl-srcs
))
210 (do-srcs other-srcs
))))