Commit d5b94e97 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Addresses some performance regression in the GenericBinaryOpStub on ARM...

Addresses some performance regression in the GenericBinaryOpStub on ARM following Crankshaft introduction. 

BUG=none
TEST=none

Patch by Rodolph Perfetta from ARM Ltd.

Review URL: http://codereview.chromium.org/5781010


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6146 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1dc835a5
......@@ -1222,16 +1222,22 @@ void GenericBinaryOpStub::HandleBinaryOpSlowCases(
bool generate_code_to_calculate_answer = true;
if (ShouldGenerateFPCode()) {
// DIV has neither SmiSmi fast code nor specialized slow code.
// So don't try to patch a DIV Stub.
if (runtime_operands_type_ == BinaryOpIC::DEFAULT) {
switch (op_) {
case Token::ADD:
case Token::SUB:
case Token::MUL:
case Token::DIV:
GenerateTypeTransition(masm); // Tail call.
generate_code_to_calculate_answer = false;
break;
case Token::DIV:
// DIV has neither SmiSmi fast code nor specialized slow code.
// So don't try to patch a DIV Stub.
break;
default:
break;
}
......@@ -1292,7 +1298,8 @@ void GenericBinaryOpStub::HandleBinaryOpSlowCases(
// HEAP_NUMBERS stub is slower than GENERIC on a pair of smis.
// r0 is known to be a smi. If r1 is also a smi then switch to GENERIC.
Label r1_is_not_smi;
if (runtime_operands_type_ == BinaryOpIC::HEAP_NUMBERS) {
if ((runtime_operands_type_ == BinaryOpIC::HEAP_NUMBERS) &&
HasSmiSmiFastPath()) {
__ tst(r1, Operand(kSmiTagMask));
__ b(ne, &r1_is_not_smi);
GenerateTypeTransition(masm); // Tail call.
......
......@@ -77,7 +77,7 @@ class GenericBinaryOpStub : public CodeStub {
rhs_(rhs),
constant_rhs_(constant_rhs),
specialized_on_rhs_(RhsIsOneWeWantToOptimizeFor(op, constant_rhs)),
runtime_operands_type_(BinaryOpIC::DEFAULT),
runtime_operands_type_(BinaryOpIC::UNINIT_OR_SMI),
name_(NULL) { }
GenericBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info)
......@@ -178,6 +178,10 @@ class GenericBinaryOpStub : public CodeStub {
return lhs_is_r0 ? r1 : r0;
}
bool HasSmiSmiFastPath() {
return op_ != Token::DIV;
}
bool ShouldGenerateSmiCode() {
return ((op_ != Token::DIV && op_ != Token::MOD) || specialized_on_rhs_) &&
runtime_operands_type_ != BinaryOpIC::HEAP_NUMBERS &&
......
......@@ -38,6 +38,8 @@
#include "scopes.h"
#include "stub-cache.h"
#include "arm/code-stubs-arm.h"
namespace v8 {
namespace internal {
......
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