(:info start-lab copy-more-arg-follows)
(:vop-var vop)
(:generator 1
- (align n-lowtag-bits)
+ (emit-alignment n-lowtag-bits)
(trace-table-entry trace-table-fun-prologue)
(emit-label start-lab)
;; Skip space for the function header.
(count-okay (gen-label)))
(note-this-location vop :unknown-return)
;; Branch off to the MV case.
- (inst nop)
- (inst jmp-short regs-defaulted)
+ (inst jmp :c regs-defaulted)
;; Default the register args, and set up the stack as if we
;; entered the MV return point.
;; Restore EDI, and reset the stack.
(emit-label restore-edi)
(loadw rdi-tn rbx-tn (- (1+ 1)))
- (inst mov rsp-tn rbx-tn))))
+ (inst mov rsp-tn rbx-tn)
+ (inst cld))))
(values))
\f
;;;; unknown values receiving
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)
(:generator 20
;; Avoid the copy if there are no more args.
(cond ((zerop fixed)
- (inst jecxz JUST-ALLOC-FRAME))
+ (inst jrcxz JUST-ALLOC-FRAME))
(t
(inst cmp rcx-tn (fixnumize fixed))
(inst jmp :be JUST-ALLOC-FRAME)))
;; 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.
(inst mov value (make-ea :qword :base object :index value))))
;;; Turn more arg (context, count) into a list.
-(defoptimizer (%listify-rest-args stack-allocate-result) ((&rest args))
- t)
-
(define-vop (listify-rest-args)
(:translate %listify-rest-args)
(:policy :safe)
(move rcx count)
;; Check to see whether there are no args, and just return NIL if so.
(inst mov result nil-value)
- (inst jecxz done)
- (inst lea dst (make-ea :qword :index rcx :scale 2))
+ (inst jrcxz done)
+ (inst lea dst (make-ea :qword :base rcx :index rcx))
(maybe-pseudo-atomic stack-allocate-p
- (allocation dst dst node stack-allocate-p)
- (inst lea dst (make-ea :byte :base dst :disp list-pointer-lowtag))
+ (allocation dst dst node stack-allocate-p list-pointer-lowtag)
(inst shr rcx (1- n-lowtag-bits))
;; Set decrement mode (successive args at lower addresses)
(inst std)
(inst sub rcx 1)
(inst jmp :nz loop)
;; NIL out the last cons.
- (storew nil-value dst 1 list-pointer-lowtag))
+ (storew nil-value dst 1 list-pointer-lowtag)
+ (inst cld))
(emit-label done))))
;;; Return the location and size of the &MORE arg glob created by
(:save-p :compute-only)
(:generator 3
(let ((err-lab
- (generate-error-code vop invalid-arg-count-error nargs)))
+ (generate-error-code vop 'invalid-arg-count-error nargs)))
(if (zerop count)
(inst test nargs nargs) ; smaller instruction
(inst cmp nargs (fixnumize count)))
(:vop-var vop)
(:save-p :compute-only)
(:generator 1000
- (error-call vop ,error ,@args)))))
+ (error-call vop ',error ,@args)))))
(def arg-count-error invalid-arg-count-error
sb!c::%arg-count-error nargs)
(def type-check-error object-not-type-error sb!c::%type-check-error