(inst lea result (make-ea :byte :base result :disp other-pointer-lowtag))
(storew type result 0 other-pointer-lowtag)
(storew length result vector-length-slot other-pointer-lowtag)
- (inst xor zero zero)
+ (zeroize zero)
(inst rep)
(inst stos zero)))
(inst shl result amount)
(inst shr result (- amount))))
(t (if (sc-is result unsigned-reg)
- (inst xor result result)
+ (zeroize result)
(inst mov result 0))))))))
(define-vop (fast-ash-left/signed=>signed)
(inst neg ecx)
(inst cmp ecx 63)
(inst jmp :be OKAY)
- (inst xor result result)
+ (zeroize result)
(inst jmp DONE)
OKAY
(inst shr result :cl)
(inst or ecx ecx)
(inst jmp :ns POSITIVE)
(inst neg ecx)
- (inst xor zero zero)
+ (zeroize zero)
(inst shr result :cl)
(inst cmp ecx 63)
(inst cmov :nbe result zero)
(inst inc res)
(inst jmp DONE)
ZERO
- (inst xor res res)
+ (zeroize res)
DONE))
(define-vop (unsigned-byte-64-len)
(inst inc res)
(inst jmp DONE)
ZERO
- (inst xor res res)
+ (zeroize res)
DONE))
(define-vop (unsigned-byte-64-count)
do (noise `(loadw ,name new-fp ,index)))
(noise))
'((if (zerop nargs)
- (inst xor rcx rcx)
+ (zeroize rcx)
(inst mov rcx (fixnumize nargs)))))
,@(cond ((eq return :tail)
'(;; Python has figured out what frame we should
;; Establish the values pointer and values count.
(move rbx rbp-tn)
(if (zerop nvals)
- (inst xor rcx rcx) ; smaller
+ (zeroize rcx) ; smaller
(inst mov rcx (fixnumize nvals)))
;; Restore the frame pointer.
(move rbp-tn old-fp)
;; We need to copy from downwards up to avoid overwriting some of
;; the yet uncopied args. So we need to use R9 as the copy index
;; and RCX as the loop counter, rather than using RCX for both.
- (inst xor copy-index copy-index)
+ (zeroize copy-index)
;; We used to use REP MOVS here, but on modern x86 it performs
;; much worse than an explicit loop for small blocks.
(pseudo-atomic
(emit-label get-tls-index-lock)
(inst mov temp 1)
- (inst xor rax rax)
+ (zeroize rax)
(inst lock)
(inst cmpxchg (make-ea-for-symbol-value *tls-index-lock*) temp)
(inst jmp :ne get-tls-index-lock)
(in-package "SB!VM")
+(defun zeroize (tn)
+ (let ((offset (tn-offset tn)))
+ ;; Using the 32-bit instruction accomplishes the same thing and is
+ ;; one byte shorter.
+ (if (<= offset edi-offset)
+ (let ((tn (make-random-tn :kind :normal
+ :sc (sc-or-lose 'dword-reg)
+ :offset offset)))
+ (inst xor tn tn))
+ (inst xor tn tn))))
+
(define-move-fun (load-immediate 1) (vop x y)
((immediate)
(any-reg descriptor-reg))
(etypecase val
(integer
(if (zerop val)
- (inst xor y y)
+ (zeroize y)
(inst mov y (fixnumize val))))
(symbol
(load-symbol y val))
((immediate) (signed-reg unsigned-reg))
(let ((val (tn-value x)))
(if (zerop val)
- (inst xor y y)
+ (zeroize y)
(inst mov y val))))
(define-move-fun (load-character 1) (vop x y)
(etypecase val
(integer
(if (and (zerop val) (sc-is y any-reg descriptor-reg))
- (inst xor y y)
+ (zeroize y)
(move-immediate y (fixnumize val) temp)))
(symbol
(inst mov y (+ nil-value (static-symbol-offset val))))
(let ((val (tn-value x)))
(etypecase val
((integer 0 0)
- (inst xor y y))
+ (zeroize y))
((or (signed-byte 29) (unsigned-byte 29))
(inst mov y (fixnumize val)))
(integer
(:generator 40
;; Move OBJECT into a temp we can bash on, and initialize the count.
(move ptr object)
- (inst xor count count)
+ (zeroize count)
;; If we are starting with NIL, then it's really easy.
(inst cmp ptr nil-value)
(inst jmp :e DONE)
;; Get a copy of OBJECT in a register we can bash on, and
;; initialize COUNT.
(move ptr object)
- (inst xor count count)
+ (zeroize count)
;; If we are starting with NIL, we be done.
(inst cmp ptr nil-value)
(inst jmp :e DONE)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.18.51"
+"0.9.18.52"