https://chromiumcodereview.appspot.com/22935005/diff/1/src/x64/full-codegen-x64.cc
File src/x64/full-codegen-x64.cc (right):

https://chromiumcodereview.appspot.com/22935005/diff/1/src/x64/full-codegen-x64.cc#newcode4425
src/x64/full-codegen-x64.cc:4425: if (expr->op() == Token::INC) {
I think the shorter sequence is better without the scratch register in
the case that performance matters.

Have you considered making the SmiAddConstant/SmiSubConstant handle the
overflow case similarly to how this code does? e.g.

SmiAddConstant(...) {
addq(...)
Label local_done
j(no_overflow, &local_done);
subq(...)
jmp(&stub)
bind(&local_done);
}

Or do the extra branches destroy performance in this case?

Perhaps you should leave the "fast" version for now and we'll tackle
this problem in the CL that introduces the SmiWrapper

On 2013/08/13 09:05:57, haitao.feng wrote:
An alternative is:
     if (expr->op() == Token::INC) {
       __ SmiAddConstant(rax, rax, Smi::FromInt(1), &stub_call);
     } else {
       __ SmiSubConstant(rax, rax, Smi::FromInt(1), &stub_call);
     }
     __ jmp(&done, Label::kNear);
     __ bind(&slow);

This version uses 5 instructions in SmiAddConstant (movq
kScratchRegister,
kSmiConstantRegister; addq(kScratchRegister, rax); j(overflow,
&stub_call);
movq(rax, kScratchRegister), jmp(&done)) than 2 (addq(rax,
kSmiConstantRegister), j(no_overflow, &done) for normal cases.

https://chromiumcodereview.appspot.com/22935005/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to