master: Do some more renaming
snuglas via Sbcl-commits <[email protected]>
| Newsgroups | gmane.lisp.steel-bank.cvs |
|---|---|
| Message-ID | <[email protected]> |
The branch "master" has been updated in SBCL:
via f4d064cdd009c586d6e7735376e8b8b6f47f281e (commit)
from 2993d7965c2c0172a9df29faae1b3799c36ed411 (commit)
- Log -----------------------------------------------------------------
commit f4d064cdd009c586d6e7735376e8b8b6f47f281e
Author: Douglas Katzman <[email protected]>
Date: Mon Apr 13 18:52:49 2026 -0400
Do some more renaming
alien-linkage-table-entry-address becomes alien-linkage-index-to-addr.
Add an optional DATAP argument which is needed to do one or both suggestions at
FOREIGN-SYMBOL-SAP in src/compiler/x86-64/c-call - the address returned by
-INDEX-TO-ADDR needs to be aware of how the indexed entry will be used.
---
src/code/foreign.lisp | 5 ++---
src/compiler/arm/macros.lisp | 2 +-
src/compiler/generic/genesis.lisp | 8 ++++----
src/compiler/generic/utils.lisp | 5 +++--
src/compiler/mips/c-call.lisp | 4 ++--
src/compiler/mips/show.lisp | 4 ++--
src/compiler/x86-64/insts.lisp | 2 +-
src/compiler/x86-64/target-insts.lisp | 2 +-
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/code/foreign.lisp b/src/code/foreign.lisp
index 429437a30..fc305eef2 100644
--- a/src/code/foreign.lisp
+++ b/src/code/foreign.lisp
@@ -134,7 +134,7 @@ The returned address is always a linkage-table address.
Symbols are entered into the linkage-table if they aren't there already."
(declare (ignorable datap))
(let ((index (ensure-alien-linkage-index name datap)))
- (values (sb-vm::alien-linkage-table-entry-address index) t)))
+ (values (sb-vm::alien-linkage-index-to-addr index) t)))
(defun foreign-symbol-sap (symbol &optional datap)
"Returns a SAP corresponding to the foreign symbol. DATAP must be true if the
@@ -179,8 +179,7 @@ symbol designates a variable. May enter the symbol into the linkage-table."
addr
(+ sb-vm:alien-linkage-space-start (1- sb-vm:alien-linkage-space-size)))
(return-from sap-foreign-symbol
- (alien-linkage-index-to-name
- (sb-vm::alien-linkage-index-from-address addr))))
+ (alien-linkage-index-to-name (sb-vm::alien-linkage-index-from-addr addr))))
#+os-provides-dladdr
(with-alien ((info (struct dl-info
(filename c-string)
diff --git a/src/compiler/arm/macros.lisp b/src/compiler/arm/macros.lisp
index 2303b6559..35abbd67d 100644
--- a/src/compiler/arm/macros.lisp
+++ b/src/compiler/arm/macros.lisp
@@ -202,7 +202,7 @@
(ash 1 (tn-offset lr-tn))))
;; select the C function index as per *ALIEN-LINKAGE-TABLE-PREDEFINED-ENTRIES*
(let ((index (if (eq type 'list) 1 0)))
- (inst ldr alloc-tn (@ null-tn (- (alien-linkage-table-entry-address index)
+ (inst ldr alloc-tn (@ null-tn (- (alien-linkage-index-to-addr index)
nil-value))))
(inst blx alloc-tn)
(inst word (logior #xe8bd0000 ; POP {rN, lr}
diff --git a/src/compiler/generic/genesis.lisp b/src/compiler/generic/genesis.lisp
index e3b6c54bd..a3039f52d 100644
--- a/src/compiler/generic/genesis.lisp
+++ b/src/compiler/generic/genesis.lisp
@@ -2418,7 +2418,7 @@ Legal values for OFFSET are -4, -8, -12, ..."
*cold-foreign-symbol-table*
(hash-table-count *cold-foreign-symbol-table*))))
#+x86-64 index
- #-x86-64 (sb-vm::alien-linkage-table-entry-address index)))
+ #-x86-64 (sb-vm::alien-linkage-index-to-addr index)))
(defun foreign-symbols-to-core ()
(flet ((to-core (list transducer target-symbol)
@@ -3951,10 +3951,10 @@ III. initially undefined function references (alphabetically):
(format t "~%~|~%IX. alien linkage table:~2%")
(dolist (entry (sort (sb-int:%hash-table-alist *cold-foreign-symbol-table*)
#'< :key #'cdr))
- (let ((name (car entry)))
+ (let* ((name (car entry)) (datap (listp name)))
(format t " ~:[ ~;(D)~] ~8x = ~a~%"
- (listp name)
- (sb-vm::alien-linkage-table-entry-address (cdr entry))
+ datap
+ (sb-vm::alien-linkage-index-to-addr (cdr entry) datap)
(car (ensure-list name)))))
#+sb-thread
diff --git a/src/compiler/generic/utils.lisp b/src/compiler/generic/utils.lisp
index 51bc861f6..919c23769 100644
--- a/src/compiler/generic/utils.lisp
+++ b/src/compiler/generic/utils.lisp
@@ -75,13 +75,14 @@
(symbol-macrolet ((space-end (+ alien-linkage-space-start alien-linkage-space-size)))
;;; the address of the linkage table entry for table index I.
-(defun alien-linkage-table-entry-address (i)
+(defun alien-linkage-index-to-addr (i &optional datap)
+ (declare (ignore datap))
(ecase alien-linkage-table-growth-direction
(:up (+ (* i alien-linkage-table-entry-size) alien-linkage-space-start))
(:down (- space-end (* (1+ i) alien-linkage-table-entry-size)))))
#-sb-xc-host
-(defun alien-linkage-index-from-address (addr)
+(defun alien-linkage-index-from-addr (addr)
(ecase alien-linkage-table-growth-direction
(:up (floor (- addr alien-linkage-space-start) alien-linkage-table-entry-size))
(:down (1- (floor (- space-end addr) space-end))))))
diff --git a/src/compiler/mips/c-call.lisp b/src/compiler/mips/c-call.lisp
index aec5cdd43..581c4f14d 100644
--- a/src/compiler/mips/c-call.lisp
+++ b/src/compiler/mips/c-call.lisp
@@ -250,8 +250,8 @@
(let ((cur-nfp (current-nfp-tn vop)))
(when cur-nfp
(store-stack-tn nfp-save cur-nfp))
- ;; (alien-linkage-table-entry-address 0) is "call-into-c" in mips-assem.S
- (inst lw tramp null-tn (- (alien-linkage-table-entry-address 0) nil-value))
+ ;; (alien-linkage-index-to-addr 0) is "call-into-c" in mips-assem.S
+ (inst lw tramp null-tn (- (alien-linkage-index-to-addr 0) nil-value))
(inst nop)
(inst jal tramp)
(inst move cfunc function)
diff --git a/src/compiler/mips/show.lisp b/src/compiler/mips/show.lisp
index da103c068..b73cfbbba 100644
--- a/src/compiler/mips/show.lisp
+++ b/src/compiler/mips/show.lisp
@@ -26,8 +26,8 @@
(when cur-nfp
(store-stack-tn nfp-save cur-nfp))
(move nl0 object)
- ;; (alien-linkage-table-entry-address 0) is "call-into-c" in mips-assem.S
- (inst lw tramp null-tn (- (alien-linkage-table-entry-address 0) nil-value))
+ ;; (alien-linkage-index-to-addr 0) is "call-into-c" in mips-assem.S
+ (inst lw tramp null-tn (- (alien-linkage-index-to-addr 0) nil-value))
(inst li cfunc (make-fixup "debug_print" :foreign))
(inst jal tramp)
(inst subu nsp-tn 16)
diff --git a/src/compiler/x86-64/insts.lisp b/src/compiler/x86-64/insts.lisp
index 19c8e5dd1..65c846090 100644
--- a/src/compiler/x86-64/insts.lisp
+++ b/src/compiler/x86-64/insts.lisp
@@ -3426,7 +3426,7 @@
(if (eql addend sb-vm::+nil-indirect+) (+ nil-based-disp 8) nil-based-disp)))
(:rel32 ; subkind is meaningless - this is a PC-relative fixup.
;; must be ASM codeblob if #-immobile-space
- (sb-vm::alien-linkage-table-entry-address value)))
+ (sb-vm::alien-linkage-index-to-addr value)))
addend 0))))
;; Preprocess the value based on FLAVOR and the implicit addend at the
;; fixup location. The addend will be zero for most <KIND,FLAVOR> pairs.
diff --git a/src/compiler/x86-64/target-insts.lisp b/src/compiler/x86-64/target-insts.lisp
index 5dea78053..84b522236 100644
--- a/src/compiler/x86-64/target-insts.lisp
+++ b/src/compiler/x86-64/target-insts.lisp
@@ -490,7 +490,7 @@
(or (when (<= sb-vm:alien-linkage-space-start addr
(+ sb-vm:alien-linkage-space-start
(1- sb-vm:alien-linkage-space-size)))
- (let* ((index (sb-vm::alien-linkage-index-from-address addr))
+ (let* ((index (sb-vm::alien-linkage-index-from-addr addr))
(name (sb-impl::alien-linkage-index-to-name index)))
(note (lambda (s) (format s "&~A" name)) dstate)))
(unless (sb-kernel:immobile-space-addr-p addr)
-----------------------------------------------------------------------
hooks/post-receive
--
SBCL