0.8.13.41: Require robustness
[sbcl.git] / src / compiler / sparc / cell.lisp
index 2d632bc..18405a3 100644 (file)
   (:policy :fast)
   (:translate symbol-value))
 
+(define-vop (symbol-hash)
+  (:policy :fast-safe)
+  (:translate symbol-hash)
+  (:args (symbol :scs (descriptor-reg)))
+  (:results (res :scs (any-reg)))
+  (:result-types positive-fixnum)
+  (:generator 2
+    ;; The symbol-hash slot of NIL holds NIL because it is also the
+    ;; cdr slot, so we have to strip off the two low bits to make sure
+    ;; it is a fixnum.  The lowtag selection magic that is required to
+    ;; ensure this is explained in the comment in objdef.lisp
+    (loadw res symbol symbol-hash-slot other-pointer-lowtag)
+    (inst andn res res fixnum-tag-mask)))
 \f
 ;;;; FDEFINITION (fdefn) objects.
 (define-vop (fdefn-fun cell-ref)
     (move obj-temp object)
     (loadw value obj-temp fdefn-fun-slot other-pointer-lowtag)
     (inst cmp value null-tn)
-    (let ((err-lab (generate-error-code vop undefined-symbol-error obj-temp)))
+    (let ((err-lab (generate-error-code vop undefined-fun-error obj-temp)))
       (inst b :eq err-lab))
     (inst nop)))