From 9255dbbc30f4aaa52164d7d1cdbb7dd901b989d8 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Sat, 1 Oct 2022 02:07:58 -0400 Subject: [PATCH] Do more bootstrap symbol shake-out --- make-target-2-load.lisp | 2 +- src/code/early-raw-slots.lisp | 31 +++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/make-target-2-load.lisp b/make-target-2-load.lisp index 9c89b5a5e..1fdf82712 100644 --- a/make-target-2-load.lisp +++ b/make-target-2-load.lisp @@ -159,7 +159,7 @@ nil) ;; Todo: perform one pass, then a full GC, then a final pass to confirm ;; it worked. It should be an error if any uninternable symbols remain, - ;; but at present there are about 9 symbols with referrers. + ;; but at present there are about 7 symbols with referrers. (with-package-iterator (iter (list-all-packages) :internal :external) (loop (multiple-value-bind (winp symbol accessibility package) (iter) (declare (ignore accessibility)) diff --git a/src/code/early-raw-slots.lisp b/src/code/early-raw-slots.lisp index e8f93a2ca..27a9af04b 100644 --- a/src/code/early-raw-slots.lisp +++ b/src/code/early-raw-slots.lisp @@ -96,20 +96,14 @@ ;; By making this a cold-init function, it is possible to use raw slots ;; in cold toplevel forms. (defun !raw-slot-data-init () - (macrolet ((make-raw-slot-data (&rest args &key accessor-name &allow-other-keys) - (declare (ignorable accessor-name)) - #+sb-xc-host - `(!make-raw-slot-data ,@args) - #-sb-xc-host - (let ((access (cadr accessor-name))) + (macrolet ((make-raw-slot-data (&rest args) + #+sb-xc-host `(!make-raw-slot-data ,@args) + #-sb-xc-host ; unwrap the QUOTE from the args (this is a macro) + (let ((access (cadr (getf args :accessor-name))) + (type (cadr (getf args :raw-type)))) `(!make-raw-slot-data :accessor-fun #',access - :comparator - ;; Not a symbol, because there aren't any so-named functions. - (named-lambda ,(string (symbolicate access "=")) - (index x y) - (declare (optimize speed (safety 0))) - (= (,access x index) (,access y index))) + :comparator #',(symbolicate "RAW-" type "SLOT=") ;; Ignore the :ACCESSOR-NAME initarg ,@args :allow-other-keys t)))) (let ((double-float-alignment @@ -163,6 +157,19 @@ :n-words #+x86 6 #+sparc 8)))))) #+sb-xc-host (!raw-slot-data-init) +#-sb-xc-host +(macrolet ((define-rs= () + ;; Expand by using the host's vector of RSD instances + `(progn + ,@(loop for rsd across *raw-slot-data* + collect + (let ((type (raw-slot-data-raw-type rsd)) + (reader (raw-slot-data-accessor-name rsd))) + `(defun ,(symbolicate "RAW-" type "SLOT=") (index x y) + (declare (optimize speed (safety 0))) + (= (,reader x index) (,reader y index)))))))) + (define-rs=)) + #+sb-xc (declaim (type (simple-vector #.(length *raw-slot-data*)) *raw-slot-data*))