Index: src/arm/code-stubs-arm.cc |
=================================================================== |
--- src/arm/code-stubs-arm.cc (revision 7395) |
+++ src/arm/code-stubs-arm.cc (working copy) |
@@ -2884,6 +2884,9 @@ |
case TRBinaryOpIC::HEAP_NUMBER: |
GenerateHeapNumberStub(masm); |
break; |
+ case TRBinaryOpIC::ODDBALL: |
+ GenerateOddballStub(masm); |
+ break; |
case TRBinaryOpIC::STRING: |
GenerateStringStub(masm); |
break; |
@@ -3606,6 +3609,39 @@ |
} |
+void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { |
+ Label call_runtime; |
+ |
+ if (op_ == Token::ADD) { |
+ // Handle string addition here, because it is the only operation |
+ // that does not do a ToNumber conversion on the operands. |
+ GenerateAddStrings(masm); |
+ } |
+ |
+ // Convert oddball arguments to numbers. |
+ Label check, done; |
+ __ CompareRoot(r1, Heap::kUndefinedValueRootIndex); |
+ __ b(ne, &check); |
+ if (Token::IsBitOp(op_)) { |
+ __ mov(r1, Operand(Smi::FromInt(0))); |
+ } else { |
+ __ LoadRoot(r1, Heap::kNanValueRootIndex); |
+ } |
+ __ jmp(&done); |
+ __ bind(&check); |
+ __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); |
+ __ b(ne, &done); |
+ if (Token::IsBitOp(op_)) { |
+ __ mov(r0, Operand(Smi::FromInt(0))); |
+ } else { |
+ __ LoadRoot(r0, Heap::kNanValueRootIndex); |
+ } |
+ __ bind(&done); |
+ |
+ GenerateHeapNumberStub(masm); |
+} |
+ |
+ |
void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
Label call_runtime; |
ASSERT(operands_type_ == TRBinaryOpIC::HEAP_NUMBER); |