@@ -2856,6 +2856,9 @@ void TypeRecordingBinaryOpStub::Generate(MacroAssembler* masm) {
2856
2856
case TRBinaryOpIC::HEAP_NUMBER:
2857
2857
GenerateHeapNumberStub (masm);
2858
2858
break ;
2859
+ case TRBinaryOpIC::ODDBALL:
2860
+ GenerateOddballStub (masm);
2861
+ break ;
2859
2862
case TRBinaryOpIC::STRING:
2860
2863
GenerateStringStub (masm);
2861
2864
break ;
@@ -3572,10 +3575,43 @@ void TypeRecordingBinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
3572
3575
}
3573
3576
3574
3577
3578
+ void TypeRecordingBinaryOpStub::GenerateOddballStub (MacroAssembler* masm) {
3579
+ Label call_runtime;
3580
+
3581
+ if (op_ == Token::ADD) {
3582
+ // Handle string addition here, because it is the only operation
3583
+ // that does not do a ToNumber conversion on the operands.
3584
+ GenerateAddStrings (masm);
3585
+ }
3586
+
3587
+ // Convert oddball arguments to numbers.
3588
+ Label check, done;
3589
+ __ LoadRoot (ip, Heap::kUndefinedValueRootIndex );
3590
+ __ cmp (r1, ip);
3591
+ __ b (ne, &check);
3592
+ if (Token::IsBitOp (op_)) {
3593
+ __ mov (r1, Operand (Smi::FromInt (0 )));
3594
+ } else {
3595
+ __ LoadRoot (r1, Heap::kNanValueRootIndex );
3596
+ }
3597
+ __ jmp (&done);
3598
+ __ bind (&check);
3599
+ __ LoadRoot (ip, Heap::kUndefinedValueRootIndex );
3600
+ __ cmp (r0, ip);
3601
+ __ b (ne, &done);
3602
+ if (Token::IsBitOp (op_)) {
3603
+ __ mov (r0, Operand (Smi::FromInt (0 )));
3604
+ } else {
3605
+ __ LoadRoot (r0, Heap::kNanValueRootIndex );
3606
+ }
3607
+ __ bind (&done);
3608
+
3609
+ GenerateHeapNumberStub (masm);
3610
+ }
3611
+
3612
+
3575
3613
void TypeRecordingBinaryOpStub::GenerateHeapNumberStub (MacroAssembler* masm) {
3576
3614
Label not_numbers, call_runtime;
3577
- ASSERT (operands_type_ == TRBinaryOpIC::HEAP_NUMBER);
3578
-
3579
3615
GenerateFPOperation (masm, false , ¬_numbers, &call_runtime);
3580
3616
3581
3617
__ bind (¬_numbers);
0 commit comments