X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-hash-table.lisp;h=a5dbf2646cf75527a383b65f155080bd54a5e3ec;hb=672ac5849b408281b5ca0dfc3fd58d418de2b272;hp=a27d1921fb9ad2e77154621ce4a3da903c3e5d36;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/code/target-hash-table.lisp b/src/code/target-hash-table.lisp index a27d192..a5dbf26 100644 --- a/src/code/target-hash-table.lisp +++ b/src/code/target-hash-table.lisp @@ -11,9 +11,6 @@ ;;;; files for more information. (in-package "SB!IMPL") - -(file-comment - "$Header$") ;;;; utilities @@ -23,6 +20,11 @@ (deftype hash () `(integer 0 ,max-hash)) +;;; FIXME: Does this always make a nonnegative FIXNUM? If so, then +;;; explain why. If not (or if the reason it always makes a +;;; nonnegative FIXNUM is only the accident that pointers in supported +;;; architectures happen to be in the lower half of the address +;;; space), then fix it. #!-sb-fluid (declaim (inline pointer-hash)) (defun pointer-hash (key) (declare (values hash)) @@ -427,7 +429,7 @@ (defun %puthash (key hash-table value) (declare (type hash-table hash-table)) - (assert (hash-table-index-vector hash-table)) + (aver (hash-table-index-vector hash-table)) (without-gcing ;; We need to rehash here so that a current key can be found if it ;; exists. Check that there is room for one more entry. May not be @@ -481,7 +483,7 @@ ;; Pop a KV slot off the free list (let ((free-kv-slot (hash-table-next-free-kv hash-table))) ;; Double-check for overflow. - (assert (not (zerop free-kv-slot))) + (aver (not (zerop free-kv-slot))) (setf (hash-table-next-free-kv hash-table) (aref next-vector free-kv-slot)) (incf (hash-table-number-entries hash-table)) @@ -493,7 +495,7 @@ (when hash-vector (if (not eq-based) (setf (aref hash-vector free-kv-slot) hashing) - (assert (= (aref hash-vector free-kv-slot) #x80000000)))) + (aver (= (aref hash-vector free-kv-slot) #x80000000)))) ;; Push this slot into the next chain. (setf (aref next-vector free-kv-slot) next) @@ -615,7 +617,7 @@ (do ((i 2 (1+ i))) ((>= i kv-length)) (setf (aref kv-vector i) +empty-ht-slot+)) - (assert (eq (aref kv-vector 0) hash-table)) + (aver (eq (aref kv-vector 0) hash-table)) ;; Set up the free list, all free. (do ((i 1 (1+ i))) ((>= i (1- size))) @@ -648,7 +650,7 @@ #!+sb-doc "For each entry in HASH-TABLE, call the designated function on the key and value of the entry. Return NIL." - (let ((fun (coerce function-designator 'function)) + (let ((fun (%coerce-callable-to-function function-designator)) (size (length (hash-table-next-vector hash-table)))) (declare (type function fun)) (do ((i 1 (1+ i)))