mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
Add support for undefined_tramp and closure_tramp in read-only space.
* These are the two "tricky" trampolines, in that genesis needs to know where they are in order to cold-load fasls, and where undefined_tramp in particular is in order to even prepare to cold-load fasls. * Add a concept of a "preload file" to genesis, to be loaded after creating NIL but before creating any FDEFN objects. * Use a target feature to switch genesis to using an assembler routine instead of a foreign symbol for the trampolines. * And use our new :NOT-GENESIS build flag to set up a file that will contain the new trampolines, and arrange for it to be loaded as the preload file, again under the same target feature. * As far as it goes, all this works, but it almost certainly has some rough edges to it. It probably isn't quite ready for upstream yet.
This commit is contained in:
parent
dc80a4e4c8
commit
fc3985c559
|
|
@ -606,6 +606,8 @@
|
|||
("src/assembly/target/array" :assem :not-host)
|
||||
("src/assembly/target/arith" :assem :not-host)
|
||||
("src/assembly/target/alloc" :assem :not-host)
|
||||
#!+read-only-tramps
|
||||
("src/assembly/target/tramps" :assem :not-host :not-genesis)
|
||||
|
||||
("src/compiler/pseudo-vops")
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,15 @@
|
|||
:direction :input)
|
||||
(read s)))
|
||||
(host-cload-stem "src/compiler/generic/genesis" nil)
|
||||
|
||||
(defparameter *preload-object-file*
|
||||
(or #!+read-only-tramps
|
||||
(stem-remap-target
|
||||
"obj/from-xc/src/assembly/target/tramps.assem-obj")
|
||||
nil))
|
||||
|
||||
(sb!vm:genesis :object-file-names *target-object-file-names*
|
||||
:preload-file *preload-object-file*
|
||||
:c-header-dir-name "output/genesis-2"
|
||||
:symbol-table-file-name "src/runtime/sbcl.nm"
|
||||
:core-file-name "output/cold-sbcl.core"
|
||||
|
|
|
|||
|
|
@ -1803,6 +1803,13 @@ core and return a descriptor to it."
|
|||
(write-wordindexed fdefn
|
||||
sb!vm:fdefn-raw-addr-slot
|
||||
(make-random-descriptor
|
||||
#!+read-only-tramps
|
||||
(or (lookup-assembler-reference 'sb!vm::undefined-tramp)
|
||||
;; Our preload for the tramps
|
||||
;; doesn't happen during host-1,
|
||||
;; so substitute a usable value.
|
||||
0)
|
||||
#!-read-only-tramps
|
||||
(cold-foreign-symbol-address "undefined_tramp"))))
|
||||
fdefn))))
|
||||
|
||||
|
|
@ -1846,6 +1853,9 @@ core and return a descriptor to it."
|
|||
(bug "FSET got closure-header-widetag")
|
||||
(/show0 "/static-fset (closure)")
|
||||
(make-random-descriptor
|
||||
#!+read-only-tramps
|
||||
(lookup-assembler-reference 'sb!vm::closure-tramp)
|
||||
#!-read-only-tramps
|
||||
(cold-foreign-symbol-address "closure_tramp")))))
|
||||
fdefn))
|
||||
|
||||
|
|
@ -3684,6 +3694,7 @@ initially undefined function references:~2%")
|
|||
;;; perhaps eventually in SB-LD or SB-BOOT.
|
||||
(defun sb!vm:genesis (&key
|
||||
object-file-names
|
||||
preload-file
|
||||
symbol-table-file-name
|
||||
core-file-name
|
||||
map-file-name
|
||||
|
|
@ -3784,6 +3795,14 @@ initially undefined function references:~2%")
|
|||
(*deferred-known-fun-refs* nil)
|
||||
#!+x86 (*load-time-code-fixups* (make-hash-table)))
|
||||
|
||||
;; If we're given a preload file, it contains tramps and whatnot
|
||||
;; that must be loaded before we create any FDEFNs. It can in
|
||||
;; theory be loaded any time between binding
|
||||
;; *COLD-ASSEMBLER-ROUTINES* above and calling
|
||||
;; INITIALIZE-STATIC-FNS below.
|
||||
(when preload-file
|
||||
(cold-load preload-file))
|
||||
|
||||
;; Prepare for cold load.
|
||||
(initialize-non-nil-symbols)
|
||||
(initialize-layouts)
|
||||
|
|
|
|||
Loading…
Reference in a new issue