From 9cc1ac8545e7c1ef3a5c61c479860770ad73f391 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Fri, 7 Jul 2017 09:13:29 -0400 Subject: [PATCH] Rearrange to avoid a local notinline declaration --- build-order.lisp-expr | 5 +++-- src/compiler/early-c.lisp | 1 + src/compiler/generic/core.lisp | 13 ------------- src/compiler/generic/target-core.lisp | 13 +++++++++++++ src/compiler/main.lisp | 5 +++-- src/compiler/x86-64/vm.lisp | 2 -- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/build-order.lisp-expr b/build-order.lisp-expr index a82c23862..64be0911e 100644 --- a/build-order.lisp-expr +++ b/build-order.lisp-expr @@ -335,6 +335,9 @@ ;; DEFINE-STORAGE-CLASS, needed by target/vm.lisp ("src/compiler/meta-vmdef") + ("src/compiler/fixup") ; for DEFSTRUCT FIXUP, needed by generic/core + ("src/compiler/generic/core") ; for CORE-OBJECT-P, needed by x86-64/vm + ;; for e.g. DESCRIPTOR-REG, needed by primtype.lisp ("src/compiler/target/vm") @@ -447,8 +450,6 @@ ("src/compiler/bit-util") - ("src/compiler/fixup") ; for DEFSTRUCT FIXUP - ("src/compiler/generic/core") ("src/code/thread") ("src/code/load") diff --git a/src/compiler/early-c.lisp b/src/compiler/early-c.lisp index 5ee170214..1e27dadfd 100644 --- a/src/compiler/early-c.lisp +++ b/src/compiler/early-c.lisp @@ -131,6 +131,7 @@ (defvar *undefined-warnings*) (defvar *warnings-p*) (defvar *lambda-conversions*) +(defvar *compile-object* nil) (defvar *stack-allocate-dynamic-extent* t "If true (the default), the compiler respects DYNAMIC-EXTENT declarations diff --git a/src/compiler/generic/core.lisp b/src/compiler/generic/core.lisp index 452ff0421..c04f8146a 100644 --- a/src/compiler/generic/core.lisp +++ b/src/compiler/generic/core.lisp @@ -113,19 +113,6 @@ (core-object-entry-table object)) (error "Unresolved forward reference.")))) -;;; Backpatch all the DEBUG-INFOs dumped so far with the specified -;;; SOURCE-INFO list. We also check that there are no outstanding -;;; forward references to functions. -(defun fix-core-source-info (info object &optional function) - (declare (type core-object object) - (type (or null function) function)) - (aver (zerop (hash-table-count (core-object-patch-table object)))) - (let ((source (debug-source-for-info info :function function))) - (dolist (info (core-object-debug-info object)) - (setf (debug-info-source info) source))) - (setf (core-object-debug-info object) nil) - (values)) - #!+(and immobile-code (host-feature sb-xc)) (progn ;; Use FDEFINITION because it strips encapsulations - whether that's diff --git a/src/compiler/generic/target-core.lisp b/src/compiler/generic/target-core.lisp index 8012f212d..13840c607 100644 --- a/src/compiler/generic/target-core.lisp +++ b/src/compiler/generic/target-core.lisp @@ -149,3 +149,16 @@ (setf (code-header-ref code-obj index) (%coerce-name-to-fun (cdr const)))))))))))) (values)) + +;;; Backpatch all the DEBUG-INFOs dumped so far with the specified +;;; SOURCE-INFO list. We also check that there are no outstanding +;;; forward references to functions. +(defun fix-core-source-info (info object &optional function) + (declare (type core-object object) + (type (or null function) function)) + (aver (zerop (hash-table-count (core-object-patch-table object)))) + (let ((source (debug-source-for-info info :function function))) + (dolist (info (core-object-debug-info object)) + (setf (debug-info-source info) source))) + (setf (core-object-debug-info object) nil) + (values)) diff --git a/src/compiler/main.lisp b/src/compiler/main.lisp index df3927fac..72d674f6b 100644 --- a/src/compiler/main.lisp +++ b/src/compiler/main.lisp @@ -98,9 +98,8 @@ (pprint-logical-block (*standard-output* nil :per-line-prefix "; ") (apply #'compiler-mumble foo)))) -(deftype object () '(or fasl-output core-object null)) -(defvar *compile-object* nil) +(deftype object () '(or fasl-output core-object null)) (declaim (type object *compile-object*)) (defvar *compile-toplevel-object* nil) @@ -1288,6 +1287,8 @@ necessary, since type inference may take arbitrarily long to converge.") ;; EVAL strategy of compiling everything inside (LAMBDA () ;; ...). -- CSR, 2002-11-02 (when (core-object-p *compile-object*) + #+sb-xc-host (error "Can't compile to core") + #-sb-xc-host (fix-core-source-info *source-info* *compile-object* (and (policy (lambda-bind fun) (> eval-store-source-form 0)) diff --git a/src/compiler/x86-64/vm.lisp b/src/compiler/x86-64/vm.lisp index 3894d1855..e4528f26b 100644 --- a/src/compiler/x86-64/vm.lisp +++ b/src/compiler/x86-64/vm.lisp @@ -452,8 +452,6 @@ ;;; If value can be represented as an immediate constant, then return ;;; the appropriate SC number, otherwise return NIL. (defun immediate-constant-sc (value) - (declare (notinline sb!c::core-object-p) ; forward ref - (special sb!c::*compile-object*)) (typecase value ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum) character) -- 2.11.4.GIT