Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index d77047fc0bfd79a23cea2ce3067750d543b210ad..d66daea0a0aa7f751f3854a72a91ac01eb48fa0c 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -1817,6 +1817,9 @@ void TypeRecordingBinaryOpStub::Generate(MacroAssembler* masm) { |
case TRBinaryOpIC::ODDBALL: |
GenerateOddballStub(masm); |
break; |
+ case TRBinaryOpIC::BOTH_STRING: |
+ GenerateBothStringStub(masm); |
+ break; |
case TRBinaryOpIC::STRING: |
GenerateStringStub(masm); |
break; |
@@ -2257,6 +2260,36 @@ void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) { |
} |
+void TypeRecordingBinaryOpStub::GenerateBothStringStub(MacroAssembler* masm) { |
+ Label call_runtime; |
+ ASSERT(operands_type_ == TRBinaryOpIC::BOTH_STRING); |
+ ASSERT(op_ == Token::ADD); |
+ // If both arguments are strings, call the string add stub. |
+ // Otherwise, do a transition. |
+ |
+ // Registers containing left and right operands respectively. |
+ Register left = r1; |
+ Register right = r0; |
+ |
+ // Test if left operand is a string. |
+ __ JumpIfSmi(left, &call_runtime); |
+ __ CompareObjectType(left, r2, r2, FIRST_NONSTRING_TYPE); |
+ __ b(ge, &call_runtime); |
+ |
+ // Test if right operand is a string. |
+ __ JumpIfSmi(right, &call_runtime); |
+ __ CompareObjectType(right, r2, r2, FIRST_NONSTRING_TYPE); |
+ __ b(ge, &call_runtime); |
+ |
+ StringAddStub string_add_stub(NO_STRING_CHECK_IN_STUB); |
+ GenerateRegisterArgsPush(masm); |
+ __ TailCallStub(&string_add_stub); |
+ |
+ __ bind(&call_runtime); |
+ GenerateTypeTransition(masm); |
+} |
+ |
+ |
void TypeRecordingBinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
ASSERT(operands_type_ == TRBinaryOpIC::INT32); |