master: Pass header as untagged word in alloc_immobile_fixedobj

snuglas via Sbcl-commits <[email protected]> Sat, 02 May 2026 02:11:28 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  072061b567e9bd3d6c2d4b42972d5baeba070172 (commit)
      from  26add0a4ad21b7ab2ee10a10cd95b31051f174a0 (commit)

- Log -----------------------------------------------------------------
commit 072061b567e9bd3d6c2d4b42972d5baeba070172
Author: Douglas Katzman <[email protected]>
Date:   Fri May 1 22:09:57 2026 -0400

    Pass header as untagged word in alloc_immobile_fixedobj
---
 src/code/alloc.lisp            | 2 +-
 src/compiler/arm64/alloc.lisp  | 2 +-
 src/compiler/x86-64/alloc.lisp | 2 +-
 src/runtime/immobile-space.c   | 1 -
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/code/alloc.lisp b/src/code/alloc.lisp
index 856b75bfd..939f585ef 100644
--- a/src/code/alloc.lisp
+++ b/src/code/alloc.lisp
@@ -91,7 +91,7 @@
 ;;;  - Symbols have exactly 1 size-class
 ;;;  - Layouts have varying size-class
 (defun alloc-immobile-fixedobj (nwords header)
-  (let* ((widetag (logand (truly-the fixnum header) widetag-mask))
+  (let* ((widetag (logand (the sb-vm:word header) widetag-mask))
          (aligned-nwords (truly-the fixnum (align-up (the fixnum nwords) 2)))
          (size-class
           ;; If you change this, then be sure to update tests/immobile-space.impure
diff --git a/src/compiler/arm64/alloc.lisp b/src/compiler/arm64/alloc.lisp
index e41f88ac0..31b782ae4 100644
--- a/src/compiler/arm64/alloc.lisp
+++ b/src/compiler/arm64/alloc.lisp
@@ -172,7 +172,7 @@
 (define-vop (alloc-immobile-fixedobj)
   (:args (size-class :scs (any-reg) :target c-arg1)
          (nwords :scs (any-reg) :target c-arg2)
-         (header :scs (any-reg) :target c-arg3))
+         (header :scs (unsigned-reg) :target c-arg3))
   (:results (result :scs (descriptor-reg)))
   (:save-p t)
   (:temporary (:sc unsigned-reg :from (:argument 0) :to :eval :offset nl0-offset) c-arg1)
diff --git a/src/compiler/x86-64/alloc.lisp b/src/compiler/x86-64/alloc.lisp
index 30eb4064a..a8c445e75 100644
--- a/src/compiler/x86-64/alloc.lisp
+++ b/src/compiler/x86-64/alloc.lisp
@@ -1183,7 +1183,7 @@
 (define-vop (alloc-immobile-fixedobj)
   (:args (size-class :scs (any-reg) :target c-arg1)
          (nwords :scs (any-reg) :target c-arg2)
-         (header :scs (any-reg) :target c-arg3))
+         (header :scs (unsigned-reg) :target c-arg3))
   (:temporary (:sc unsigned-reg :from (:argument 0) :to :eval
                :offset #.(first *c-call-register-arg-offsets*)) c-arg1)
   (:temporary (:sc unsigned-reg :from (:argument 1) :to :eval
diff --git a/src/runtime/immobile-space.c b/src/runtime/immobile-space.c
index 55fd44df3..8a1ce87d4 100644
--- a/src/runtime/immobile-space.c
+++ b/src/runtime/immobile-space.c
@@ -339,7 +339,6 @@ alloc_immobile_fixedobj(int size_class, int spacing_words, uword_t header)
 {
   size_class = fixnum_value(size_class);
   spacing_words = fixnum_value(spacing_words);
-  header = fixnum_value(header);
 
   unsigned int page;
   lispobj word;

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL