Put RECONSTITUTE-OBJECT back into make-host

Needed for new-and-improved finalizer logic, pending commit.
This commit is contained in:
Douglas Katzman 2023-01-11 18:55:50 -05:00
parent 95513aefc3
commit 1f4402d2ef
2 changed files with 13 additions and 19 deletions

View file

@ -155,25 +155,6 @@
(ash header-word (- hash-slot-present-flag))
1))))
;;; Macros not needed after this file (and avoids a redefinition warning this way)
(eval-when (:compile-toplevel)
(defmacro widetag@baseptr (sap)
#+big-endian `(sap-ref-8 ,sap ,(1- n-word-bytes))
#+little-endian `(sap-ref-8 ,sap 0))
(defmacro lispobj@baseptr (sap widetag)
`(%make-lisp-obj
(logior (sap-int ,sap)
(logand (deref (extern-alien "widetag_lowtag" (array char 256)) ,widetag)
lowtag-mask)))))
;;; This uses the funny fixnum representation of ADDRESS. I'd like to change this
;;; to take a SAP but god forbid people are using it?
;;; DO NOT USE THIS! It is soon to be removed
(defun reconstitute-object (address)
(let ((sap (descriptor-sap address)))
(lispobj@baseptr sap (widetag@baseptr sap))))
;;; Iterate over all the objects in the contiguous block of memory
;;; with the low address at START and the high address just before
;;; END, calling FUN with the object, the object's type code, and the

View file

@ -140,6 +140,19 @@
(declaim (inline descriptor-sap))
(defun descriptor-sap (x) (int-sap (get-lisp-obj-address x)))
(defmacro widetag@baseptr (sap)
`(sap-ref-8 ,sap #+big-endian ,(1- n-word-bytes) #+little-endian 0))
(defmacro lispobj@baseptr (sap widetag)
`(%make-lisp-obj
(logior (sap-int ,sap)
(logand (deref (extern-alien "widetag_lowtag" (array char 256)) ,widetag)
lowtag-mask))))
;;; Return an object given its base ADDRESS in the manner that DESCRIPTOR-SAP accepts.
(defun reconstitute-object (address)
(let ((sap (descriptor-sap address)))
(lispobj@baseptr sap (widetag@baseptr sap))))
(eval-when (:compile-toplevel :load-toplevel :execute)