From 55ef2a710fad3030cd4b5437be0779ff4d8eacd6 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Thu, 17 Aug 2017 11:50:55 -0400 Subject: [PATCH] Remove a few objects from static space if #!+immobile-code --- contrib/sb-introspect/test-driver.lisp | 6 ++++++ src/compiler/generic/genesis.lisp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/contrib/sb-introspect/test-driver.lisp b/contrib/sb-introspect/test-driver.lisp index 2cc9d82e2..b671e666c 100644 --- a/contrib/sb-introspect/test-driver.lisp +++ b/contrib/sb-introspect/test-driver.lisp @@ -334,6 +334,12 @@ (tai '*print-base* :heap '(:space :immobile)) t) +(deftest allocation-information.2c + ;; This is a a test of SBCL genesis that leverages sb-introspect. + (tai (sb-kernel::find-fdefn (elt sb-vm:+static-fdefns+ 0)) + :heap '(:space #-immobile-space :static #+immobile-space :immobile)) + t) + (deftest allocation-information.3 (tai 42 :immediate nil) t) diff --git a/src/compiler/generic/genesis.lisp b/src/compiler/generic/genesis.lisp index 2d007cdd1..2c4d9e417 100644 --- a/src/compiler/generic/genesis.lisp +++ b/src/compiler/generic/genesis.lisp @@ -1645,6 +1645,11 @@ core and return a descriptor to it." (cold-set t-symbol t-symbol)) (dolist (sym sb!vm::+c-callable-fdefns+) (cold-fdefinition-object (cold-intern sym) nil *static*)) + + ;; With immobile-code, static-fdefns as a concept are useful - + ;; the implication is that the function's definition will not change. + ;; But the fdefn per se is not useful - callers refer to callees directly. + #!-immobile-code (dovector (sym sb!vm:+static-fdefns+) (let* ((fdefn (cold-fdefinition-object (cold-intern sym) nil *static*)) (offset (- (+ (- (descriptor-bits fdefn) -- 2.11.4.GIT