X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fmemory.lisp;h=4a9a14a8b3de066b62099077b607ac314a7a60ce;hb=94e0f68a627ce839d59e88b4c8faad486e75af91;hp=6f5ef02d5b00855fc889655725e9eea4f6a98dd0;hpb=0d871fd7a98fc4af92a8b942a1154761466ad8c9;p=sbcl.git diff --git a/src/compiler/x86/memory.lisp b/src/compiler/x86/memory.lisp index 6f5ef02..4a9a14a 100644 --- a/src/compiler/x86/memory.lisp +++ b/src/compiler/x86/memory.lisp @@ -78,8 +78,7 @@ (:policy :fast-safe) (:generator 4 (move result value) - (inst xadd (make-ea :dword :base object - :disp (- (* offset n-word-bytes) lowtag)) + (inst xadd (make-ea-for-object-slot object offset lowtag) value))) ;;; SLOT-REF and SLOT-SET are used to define VOPs like CLOSURE-REF, @@ -98,27 +97,7 @@ (:variant-vars base lowtag) (:info offset) (:generator 4 - (if (sc-is value immediate) - (let ((val (tn-value value))) - (etypecase val - (integer - (inst mov - (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) - (fixnumize val))) - (symbol - (inst mov - (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) - (+ nil-value (static-symbol-offset val)))) - (character - (inst mov - (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) - (logior (ash (char-code val) n-widetag-bits) - character-widetag))))) - ;; Else, value not immediate. - (storew value object (+ base offset) lowtag)))) + (storew (encode-value-if-immediate value) object (+ base offset) lowtag))) (define-vop (slot-set-conditional) (:args (object :scs (descriptor-reg) :to :eval) @@ -133,8 +112,7 @@ (:generator 4 (move eax old-value) (move temp new-value) - (inst cmpxchg (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) + (inst cmpxchg (make-ea-for-object-slot object (+ base offset) lowtag) temp) (move result eax))) @@ -148,6 +126,5 @@ (:info offset) (:generator 4 (move result value) - (inst xadd (make-ea :dword :base object - :disp (- (* (+ base offset) n-word-bytes) lowtag)) + (inst xadd (make-ea-for-object-slot object (+ base offset) lowtag) value)))