0.6.12.6:
[sbcl.git] / src / code / target-hash-table.lisp
index a27d192..a5dbf26 100644 (file)
@@ -11,9 +11,6 @@
 ;;;; files for more information.
 
 (in-package "SB!IMPL")
-
-(file-comment
-  "$Header$")
 \f
 ;;;; utilities
 
 (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))
 
 (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
        ;; 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))
         (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)
     (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)))
   #!+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)))