Move SFUNCTION type earlier, use it more.
[sbcl.git] / make-target-2-load.lisp
blob8a3be8a005805a91f6ae73c034058435094c16b0
1 ;;; Do warm init without compiling files.
2 (progn
3 (defvar *compile-files-p* nil)
4 "about to LOAD warm.lisp (with *compile-files-p* = NIL)")
5 (let ((*print-length* 10)
6 (*print-level* 5)
7 (*print-circle* t))
8 (load "src/cold/warm.lisp")
10 ;; Collapse identical FUN-INFOs
11 sb-int::
12 (let ((ht (make-hash-table :test 'equalp))
13 (old-count 0))
14 (sb-c::call-with-each-globaldb-name
15 (lambda (name)
16 (binding* ((info (info :function :info name) :exit-if-null)
17 (shared-info (gethash info ht info)))
18 (incf old-count)
19 (if (eq info shared-info)
20 (setf (gethash info ht) info)
21 (setf (info :function :info name) shared-info)))))
22 (format t "~&FUN-INFO: Collapsed ~D -> ~D~%"
23 old-count (hash-table-count ht)))
25 (sb-disassem::!compile-inst-printers)
27 ;; Unintern no-longer-needed stuff before the possible PURIFY in
28 ;; SAVE-LISP-AND-DIE.
29 #-sb-fluid (sb-impl::!unintern-init-only-stuff)
31 ;; A symbol whose INFO slot underwent any kind of manipulation
32 ;; such that it now has neither properties nor globaldb info,
33 ;; can have the slot set back to NIL if it wasn't already.
34 (do-all-symbols (symbol)
35 (when (and (sb-kernel:symbol-info symbol)
36 (null (sb-kernel:symbol-info-vector symbol))
37 (null (symbol-plist symbol)))
38 (setf (sb-kernel:symbol-info symbol) nil)))
40 "done with warm.lisp, about to GC :FULL T")
41 (sb-ext:gc :full t)
43 ;;; resetting compilation policy to neutral values in preparation for
44 ;;; SAVE-LISP-AND-DIE as final SBCL core (not in warm.lisp because
45 ;;; SB-C::*POLICY* has file scope)
46 (setq sb-c::*policy* (copy-structure sb-c::**baseline-policy**))
48 ;;; Lock internal packages
49 #+sb-package-locks
50 (dolist (p (list-all-packages))
51 (unless (member p (mapcar #'find-package '("KEYWORD" "CL-USER")))
52 (sb-ext:lock-package p)))
54 "done with warm.lisp, about to SAVE-LISP-AND-DIE"
55 ;;; Even if /SHOW output was wanted during build, it's probably
56 ;;; not wanted by default after build is complete. (And if it's
57 ;;; wanted, it can easily be turned back on.)
58 #+sb-show (setf sb-int:*/show* nil)
59 ;;; The system is complete now, all standard functions are
60 ;;; defined.
61 ;;; The call to CTYPE-OF-CACHE-CLEAR is probably redundant.
62 ;;; SAVE-LISP-AND-DIE calls DEINIT which calls DROP-ALL-HASH-CACHES.
63 (sb-kernel::ctype-of-cache-clear)
64 (setq sb-c::*flame-on-necessarily-undefined-thing* t)
66 ;;; Clean up stray symbols from the CL-USER package.
67 (with-package-iterator (iter "CL-USER" :internal :external)
68 (loop (multiple-value-bind (winp symbol) (iter)
69 (if winp (unintern symbol "CL-USER") (return)))))
71 #+sb-fasteval (setq sb-ext:*evaluator-mode* :interpret)
72 (sb-ext:save-lisp-and-die "output/sbcl.core")