From b7e536d668c92f5c61611fb65b4260e5e601fb44 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Tue, 18 Apr 2017 19:32:08 -0400 Subject: [PATCH] A few random genesis cleanups * Rename ASSIGN-TLS-INDEX -> ASSIGN-TLS-INDEX-IF-NEEDED so not to imply that it always consumes an index. * Delete redundant AVER. PACKAGE-OK-FOR-TARGET-SYMBOL-P is checked by SYMBOL-PACKAGE-FOR-TARGET-SYMBOL * Delete useless assignment to ACCESS near end of COLD-INTERN * Delete unused function OFFSET-STATIC-SYMBOL --- package-data-list.lisp-expr | 1 - src/compiler/generic/genesis.lisp | 7 ++----- src/compiler/generic/utils.lisp | 12 ------------ 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index fa45a605c..8de0df537 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -3069,7 +3069,6 @@ structure representations" "NULL-SC-NUMBER" "OCFP-SAVE-OFFSET" "ODD-FIXNUM-LOWTAG" - "OFFSET-STATIC-SYMBOL" "OTHER-IMMEDIATE-0-LOWTAG" "OTHER-IMMEDIATE-1-LOWTAG" "OTHER-IMMEDIATE-2-LOWTAG" diff --git a/src/compiler/generic/genesis.lisp b/src/compiler/generic/genesis.lisp index 7109abd09..25becce4d 100644 --- a/src/compiler/generic/genesis.lisp +++ b/src/compiler/generic/genesis.lisp @@ -953,7 +953,7 @@ core and return a descriptor to it." symbol)) #!+sb-thread -(defun assign-tls-index (symbol cold-symbol) +(defun assign-tls-index-if-needed (symbol cold-symbol) (let ((index (info :variable :wired-tls symbol))) (cond ((integerp index) ; thread slot (cold-assign-tls-index cold-symbol index)) @@ -1545,7 +1545,6 @@ core and return a descriptor to it." &key (access nil) (gspace (symbol-value *cold-symbol-gspace*)) &aux (package (symbol-package-for-target-symbol symbol))) - (aver (package-ok-for-target-symbol-p package)) ;; Anything on the cross-compilation host which refers to the target ;; machinery through the host SB-XC package should be translated to @@ -1568,10 +1567,8 @@ core and return a descriptor to it." (record-accessibility (or access (nth-value 1 (find-symbol (symbol-name symbol) package))) pkg-info handle package symbol)) - #!+sb-thread - (assign-tls-index symbol handle) + #!+sb-thread (assign-tls-index-if-needed symbol handle) (when (eq package *keyword-package*) - (setq access :external) (cold-set handle handle)) handle))) diff --git a/src/compiler/generic/utils.lisp b/src/compiler/generic/utils.lisp index 0852fc2dc..92ead0906 100644 --- a/src/compiler/generic/utils.lisp +++ b/src/compiler/generic/utils.lisp @@ -45,18 +45,6 @@ (- list-pointer-lowtag))) 0)) -;;; Given a byte offset, OFFSET, return the appropriate static symbol. -(defun offset-static-symbol (offset) - (if (zerop offset) - nil - (multiple-value-bind (n rem) - (truncate (+ offset list-pointer-lowtag (- other-pointer-lowtag) - (- (pad-data-block (1- symbol-size)))) - (pad-data-block symbol-size)) - (unless (and (zerop rem) (<= 0 n (1- (length *static-symbols*)))) - (error "The byte offset ~W is not valid." offset)) - (elt *static-symbols* n)))) - ;;; Return the (byte) offset from NIL to the start of the fdefn object ;;; for the static function NAME. (defun static-fdefn-offset (name) -- 2.11.4.GIT