1.0.4.85: small PCL cleanups and thread-safety notes
[sbcl.git] / src / compiler / x86 / cell.lisp
index ca2eca9..e30f508 100644 (file)
   (:ignore name)
   (:results)
   (:generator 1
-     (if (sc-is value immediate)
-        (let ((val (tn-value value)))
-           (etypecase val
-              (integer
-               (inst mov
-                     (make-ea :dword :base object
-                              :disp (- (* offset n-word-bytes) lowtag))
-                     (fixnumize val)))
-              (symbol
-               (inst mov
-                     (make-ea :dword :base object
-                              :disp (- (* offset n-word-bytes) lowtag))
-                     (+ nil-value (static-symbol-offset val))))
-              (character
-               (inst mov
-                     (make-ea :dword :base object
-                              :disp (- (* offset n-word-bytes) lowtag))
-                     (logior (ash (char-code val) n-widetag-bits)
-                             character-widetag)))))
-       ;; Else, value not immediate.
-       (storew value object offset lowtag))))
+     (storew (encode-value-if-immediate value) object offset lowtag)))
 \f
 
 
 (define-vop (set cell-set)
   (:variant symbol-value-slot other-pointer-lowtag))
 
-;;; Do a cell ref with an error check for being unbound.
-;;; XXX stil used? I can't see where -dan
-(define-vop (checked-cell-ref)
-  (:args (object :scs (descriptor-reg) :target obj-temp))
-  (:results (value :scs (descriptor-reg any-reg)))
-  (:policy :fast-safe)
-  (:vop-var vop)
-  (:save-p :compute-only)
-  (:temporary (:sc descriptor-reg :from (:argument 0)) obj-temp))
-
 ;;; With Symbol-Value, we check that the value isn't the trap object. So
 ;;; Symbol-Value of NIL is NIL.
 #!+sb-thread
   (:generator 4
     (move result value)
     (inst lock)
-    (inst add (make-ea :dword :base object
-                       :disp (- (* symbol-value-slot n-word-bytes)
-                                other-pointer-lowtag))
+    (inst add (make-ea-for-object-slot object symbol-value-slot
+                                       other-pointer-lowtag)
           value)))
 
 #!+sb-thread
   (:generator 38
     (load-type type function (- fun-pointer-lowtag))
     (inst lea raw
-          (make-ea :byte :base function
-                   :disp (- (* simple-fun-code-offset n-word-bytes)
-                            fun-pointer-lowtag)))
+          (make-ea-for-object-slot function simple-fun-code-offset
+                                   fun-pointer-lowtag))
     (inst cmp type simple-fun-header-widetag)
     (inst jmp :e normal-fn)
     (inst lea raw (make-fixup "closure_tramp" :foreign))