Use registers to pass arguments to GenericBinaryOpStub.

Currently arguments are never passed on registers (due to the way ArgsInRegistersSupported is written) and
if they were, the stub would break in several places because registers are not preserved properly in the
course of execution. This CL makes use of registers more often (than never) and makes sure that registers are
handler properly.
A peformance gain is small (0.2-0.3%) but stable.
This CL was extracted from the one sent out earlier (http://codereview.chromium.org/551093).

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3692 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5428e036
This diff is collapsed.
......@@ -698,11 +698,15 @@ class GenericBinaryOpStub: public CodeStub {
void GenerateSmiCode(MacroAssembler* masm, Label* slow);
void GenerateLoadArguments(MacroAssembler* masm);
void GenerateReturn(MacroAssembler* masm);
void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure);
// Args in registers are always OK for ADD and SUB. Floating-point MUL and DIV
// are also OK. Though MUL and DIV on SMIs modify the original registers so
// we need to push args on stack anyway.
bool ArgsInRegistersSupported() {
return ((op_ == Token::ADD) || (op_ == Token::SUB)
|| (op_ == Token::MUL) || (op_ == Token::DIV))
&& flags_ != NO_SMI_CODE_IN_STUB;
return ((op_ == Token::ADD) || (op_ == Token::SUB)) ||
(((op_ == Token::MUL) || (op_ == Token::DIV))
&& (flags_ == NO_SMI_CODE_IN_STUB));
}
bool IsOperationCommutative() {
return (op_ == Token::ADD) || (op_ == Token::MUL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment