Remove :salted-symbol-hash as a choice

This commit is contained in:
Douglas Katzman 2024-08-06 22:03:08 +00:00
parent ccd18bd457
commit a2c50e6eee
12 changed files with 4 additions and 25 deletions

View file

@ -4,4 +4,3 @@
; hooks in for someone to add the support later.
:arm-vfp :arm-vfpv2
:fp-and-pc-standard-save
:salted-symbol-hash

View file

@ -1,3 +1,2 @@
:gencgc :use-cons-region :soft-card-marks
:alien-callbacks
:salted-symbol-hash

View file

@ -1,3 +1,2 @@
:gencgc
:compare-and-swap-vops :alien-callbacks
:salted-symbol-hash

View file

@ -1,2 +1 @@
:gencgc
:salted-symbol-hash

View file

@ -6,4 +6,3 @@
:alien-callbacks
:cycle-counter
:fp-and-pc-standard-save
:salted-symbol-hash

View file

@ -58,9 +58,8 @@
most-positive-fixnum)))
(defun sxhash-symbol-xform (s)
#-salted-symbol-hash `(symbol-hash ,s)
#+(and salted-symbol-hash 64-bit) `(let ((h (symbol-name-hash ,s))) (sb-int:mix h h))
#+(and salted-symbol-hash (not 64-bit)) `(symbol-name-hash ,s))
#+64-bit `(let ((h (symbol-name-hash ,s))) (sb-int:mix h h)) ; get 60ish bits from 32
#-64-bit `(symbol-name-hash ,s))
) ; end EVAL-WHEN
(defun calc-symbol-name-hash (string length)

View file

@ -392,8 +392,6 @@ distinct from the global value. Can also be SETF."
(name-hash (calc-symbol-name-hash name (length name)))
(symbol #+x86-64 (symbol-allocator-macro kind name)
#-x86-64 (sb-vm::%alloc-symbol name)))
#-salted-symbol-hash (%set-symbol-hash symbol name-hash)
#+salted-symbol-hash
(let ((salt (murmur-hash-word/fixnum
(word-mix name-hash (get-lisp-obj-address symbol)))))
#+64-bit

View file

@ -319,12 +319,6 @@
(pushnew :immobile-code sb-xc:*features*))
(when (target-featurep :64-bit)
(push :compact-symbol sb-xc:*features*))
(when (target-featurep :64-bit)
;; Considering that a single config file governs rv32 and rv64, I don't
;; know how to make this properly configurable. In theory, 32-bit builds could
;; have a salted hash (gaining 3 bits by making the hash slot raw), but
;; they don't, so in light of things, this is a valid criterion.
(push :salted-symbol-hash sb-xc:*features*))
(when (target-featurep '(:and :sb-thread (:or (:and :darwin (:not (:or :ppc :x86))) :openbsd)))
(push :os-thread-stack sb-xc:*features*))
(when (target-featurep '(:and :x86 :int4-breakpoints))

View file

@ -1154,9 +1154,6 @@ core and return a descriptor to it."
(defun assign-symbol-hash (descriptor wordindex name)
;; "why not just call sb-c::symbol-name-hash?" you ask? because: no symbol.
(let ((name-hash (sb-c::calc-symbol-name-hash name (length name))))
#-salted-symbol-hash
(write-wordindexed descriptor wordindex (make-fixnum-descriptor name-hash))
#+salted-symbol-hash
(let* ((salt (sb-impl::murmur3-fmix-word (descriptor-bits descriptor)))
(prng-byte sb-impl::symbol-hash-prng-byte)
;; 64-bit: Low 4 bytes to high 4 bytes of slot

View file

@ -433,8 +433,7 @@ during backtrace.
:init :null)
(name :init :arg :ref-trans symbol-name)
;; The remaining slots can be ignored by GC
#+salted-symbol-hash (hash)
#-salted-symbol-hash (hash :set-trans %set-symbol-hash :ref-trans symbol-hash)
(hash)
(package-id :type index ; actually 16 bits. (Could go in the header)
:ref-trans symbol-package-id
:set-trans sb-impl::set-symbol-package-id :set-known ())

View file

@ -167,9 +167,6 @@
(deftransform hash-as-if-symbol-name ((object) (symbol) * :important nil)
`(symbol-name-hash object))
#-salted-symbol-hash
(define-source-transform symbol-name-hash (s) `(ldb (byte 32 0) (symbol-hash ,s)))
(intern "SCRAMBLE" "SB-C")
(intern "TAB" "SB-C")

View file

@ -126,7 +126,7 @@
(values (/ n-well-hashed-sets n-homograph-sets)
result)))
(with-test (:name :hashing-improvements :skipped-on (not :salted-symbol-hash))
(with-test (:name :hashing-improvements)
;; Roughly: For each set of symbols colliding on SXHASH at all, what fraction
;; of those sets do NOT have any collisions on SYMBOL-HASH.
(let ((expectation