OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 break; | 2849 break; |
2850 case TRBinaryOpIC::SMI: | 2850 case TRBinaryOpIC::SMI: |
2851 GenerateSmiStub(masm); | 2851 GenerateSmiStub(masm); |
2852 break; | 2852 break; |
2853 case TRBinaryOpIC::INT32: | 2853 case TRBinaryOpIC::INT32: |
2854 GenerateInt32Stub(masm); | 2854 GenerateInt32Stub(masm); |
2855 break; | 2855 break; |
2856 case TRBinaryOpIC::HEAP_NUMBER: | 2856 case TRBinaryOpIC::HEAP_NUMBER: |
2857 GenerateHeapNumberStub(masm); | 2857 GenerateHeapNumberStub(masm); |
2858 break; | 2858 break; |
| 2859 case TRBinaryOpIC::ODDBALL: |
| 2860 GenerateOddballStub(masm); |
| 2861 break; |
2859 case TRBinaryOpIC::STRING: | 2862 case TRBinaryOpIC::STRING: |
2860 GenerateStringStub(masm); | 2863 GenerateStringStub(masm); |
2861 break; | 2864 break; |
2862 case TRBinaryOpIC::GENERIC: | 2865 case TRBinaryOpIC::GENERIC: |
2863 GenerateGeneric(masm); | 2866 GenerateGeneric(masm); |
2864 break; | 2867 break; |
2865 default: | 2868 default: |
2866 UNREACHABLE(); | 2869 UNREACHABLE(); |
2867 } | 2870 } |
2868 } | 2871 } |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3565 if (transition.is_linked()) { | 3568 if (transition.is_linked()) { |
3566 __ bind(&transition); | 3569 __ bind(&transition); |
3567 GenerateTypeTransition(masm); | 3570 GenerateTypeTransition(masm); |
3568 } | 3571 } |
3569 | 3572 |
3570 __ bind(&call_runtime); | 3573 __ bind(&call_runtime); |
3571 GenerateCallRuntime(masm); | 3574 GenerateCallRuntime(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 void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { | 3613 void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) { |
3576 Label not_numbers, call_runtime; | 3614 Label not_numbers, call_runtime; |
3577 ASSERT(operands_type_ == TRBinaryOpIC::HEAP_NUMBER); | |
3578 | |
3579 GenerateFPOperation(masm, false, ¬_numbers, &call_runtime); | 3615 GenerateFPOperation(masm, false, ¬_numbers, &call_runtime); |
3580 | 3616 |
3581 __ bind(¬_numbers); | 3617 __ bind(¬_numbers); |
3582 GenerateTypeTransition(masm); | 3618 GenerateTypeTransition(masm); |
3583 | 3619 |
3584 __ bind(&call_runtime); | 3620 __ bind(&call_runtime); |
3585 GenerateCallRuntime(masm); | 3621 GenerateCallRuntime(masm); |
3586 } | 3622 } |
3587 | 3623 |
3588 | 3624 |
(...skipping 3185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6774 __ strb(untagged_value, MemOperand(external_pointer, untagged_key)); | 6810 __ strb(untagged_value, MemOperand(external_pointer, untagged_key)); |
6775 __ Ret(); | 6811 __ Ret(); |
6776 } | 6812 } |
6777 | 6813 |
6778 | 6814 |
6779 #undef __ | 6815 #undef __ |
6780 | 6816 |
6781 } } // namespace v8::internal | 6817 } } // namespace v8::internal |
6782 | 6818 |
6783 #endif // V8_TARGET_ARCH_ARM | 6819 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |