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 (assert (zerop (deref (extern-alien "lowtag_for_widetag" (array char
64))
17 (ash sb-vm
:character-widetag -
2))))
19 (proclaim '(optimize (compilation-speed 1)
20 (debug #+sb-show
2 #-sb-show
1)
26 ;;; Assert that genesis preserved shadowing symbols.
27 (let ((p sb-assem
::*backend-instruction-set-package
*))
28 (unless (eq p
(find-package "SB-VM"))
29 (dolist (expect '("SEGMENT" "MAKE-SEGMENT"))
30 (assert (find expect
(package-shadowing-symbols p
) :test
'string
=)))))
33 ;;;; compiling and loading more of the system
35 (load "src/cold/muffler.lisp")
37 ;;; FIXME: CMU CL's pclcom.lisp had extra optional stuff wrapped around
38 ;;; COMPILE-PCL, at least some of which we should probably have too:
40 ;;; (with-compilation-unit
41 ;;; (:optimize '(optimize (debug #+(and (not high-security) small) .5
42 ;;; #-(or high-security small) 2
43 ;;; #+high-security 3)
44 ;;; (speed 2) (safety #+(and (not high-security) small) 0
45 ;;; #-(or high-security small) 2
46 ;;; #+high-security 3)
47 ;;; (inhibit-warnings 2))
48 ;;; :optimize-interface '(optimize-interface #+(and (not high-security) small)
50 ;;; #+high-security (safety 3))
51 ;;; :context-declarations
52 ;;; '((:external (declare (optimize-interface (safety #-high-security 2 #+high-
54 ;;; (debug #-high-security 1 #+high-s
56 ;;; ((:or :macro (:match "$EARLY-") (:match "$BOOT-"))
57 ;;; (declare (optimize (speed 0))))))
59 ;;; FIXME: This has mutated into a hack which crudely duplicates
60 ;;; functionality from the existing mechanism to load files from
61 ;;; build-order.lisp-expr, without being quite parallel. (E.g. object
62 ;;; files end up alongside the source files instead of ending up in
63 ;;; parallel directory trees.) Maybe we could merge the filenames here
64 ;;; into build-order.lisp-expr with some new flag (perhaps :WARM) to
65 ;;; indicate that the files should be handled not in cold load but
68 '("SRC;CODE;WARM-ERROR"
69 "SRC;CODE;ROOM" ; for MAP-ALLOCATED-OBJECTS
70 ;; We re-nickname SB-SEQUENCE as SEQUENCE now.
71 ;; It could be done in genesis, but not earlier,
72 ;; since the host has a package of that name.
73 "SRC;CODE;DEFPACKAGE"))
77 '("SRC;INTERPRETER;MACROS"
78 "SRC;INTERPRETER;CHECKFUNS"
80 "SRC;INTERPRETER;SEXPR"
81 "SRC;INTERPRETER;SPECIAL-FORMS"
82 "SRC;INTERPRETER;EVAL"
83 "SRC;INTERPRETER;DEBUG"))
85 '(;; CLOS, derived from the PCL reference implementation
87 ;; This PCL build order is based on a particular
88 ;; (arbitrary) linearization of the declared build
89 ;; order dependencies from the old PCL defsys.lisp
90 ;; dependency database.
91 #+nil
"src/pcl/walk" ; #+NIL = moved to build-order.lisp-expr
92 #+nil
"SRC;PCL;EARLY-LOW"
94 "SRC;PCL;COMPILER-SUPPORT"
96 #+nil
"SRC;PCL;SLOT-NAME" ; moved to build-order.lisp-expr
111 "SRC;PCL;GENERIC-FUNCTIONS"
122 "SRC;PCL;DOCUMENTATION"
123 "SRC;PCL;PRINT-OBJECT"
127 '("SRC;CODE;SETF-FUNS"
129 ;; miscellaneous functionality which depends on CLOS
130 "SRC;CODE;LATE-CONDITION"
132 ;; CLOS-level support for the Gray OO streams
133 ;; extension (which is also supported by various
134 ;; lower-level hooks elsewhere in the code)
135 "SRC;PCL;GRAY-STREAMS-CLASS"
136 "SRC;PCL;GRAY-STREAMS"
138 ;; CLOS-level support for User-extensible sequences.
141 ;; other functionality not needed for cold init, moved
142 ;; to warm init to reduce peak memory requirement in
146 "SRC;CODE;DESCRIBE-POLICY"
152 #+win32
"SRC;CODE;WARM-MSWIN"
153 "SRC;CODE;RUN-PROGRAM"
154 #+sb-traceroot
"SRC;CODE;TRACEROOT"
156 #+immobile-code
"SRC;CODE;IMMOBILE-SPACE"
157 "SRC;CODE;REPACK-XREF"
159 (sb-c::*handled-conditions
* sb-c
::*handled-conditions
*))
160 (declare (special *compile-files-p
*))
161 (proclaim '(sb-ext:muffle-conditions
162 (or (satisfies unable-to-optimize-note-p
)
163 (satisfies optional
+key-style-warning-p
))))
167 (let ((fullname (concatenate 'string
"SYS:" stem
".LISP")))
168 (sb-int:/show
"about to compile" fullname
)
169 (flet ((report-recompile-restart (stream)
170 (format stream
"Recompile file ~S" fullname
))
171 (report-continue-restart (stream)
173 "Continue, using possibly bogus file ~S"
174 (compile-file-pathname fullname
))))
177 (multiple-value-bind (output-truename warnings-p failure-p
)
178 (ecase (if (boundp '*compile-files-p
*) *compile-files-p
* t
)
179 ((t) (compile-file fullname
))
180 ((nil) (compile-file-pathname fullname
)))
181 (declare (ignore warnings-p
))
182 (sb-int:/show
"done compiling" fullname
)
183 (cond ((not output-truename
)
184 (error "COMPILE-FILE of ~S failed." fullname
))
188 (error "FAILURE-P was set when creating ~S."
191 :report report-recompile-restart
192 (go retry-compile-file
))
194 :report report-continue-restart
195 (setf failure-p nil
)))
196 ;; Don't leave failed object files lying around.
197 (when (and failure-p
(probe-file output-truename
))
198 (delete-file output-truename
)
199 (format t
"~&deleted ~S~%" output-truename
))))
200 ;; Otherwise: success, just fall through.
202 (unless (handler-bind
203 ((sb-kernel:redefinition-with-defgeneric
205 (load output-truename
))
206 (error "LOAD of ~S failed." output-truename
))
207 (sb-int:/show
"done loading" output-truename
))))))))
209 (let ((*print-length
* 10)
212 (*compile-print
* nil
))
214 (with-compilation-unit () (do-srcs interpreter-srcs
))
215 (with-compilation-unit () (do-srcs pcl-srcs
))
216 (do-srcs other-srcs
))))