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 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 break; | 1810 break; |
1811 case TRBinaryOpIC::INT32: | 1811 case TRBinaryOpIC::INT32: |
1812 GenerateInt32Stub(masm); | 1812 GenerateInt32Stub(masm); |
1813 break; | 1813 break; |
1814 case TRBinaryOpIC::HEAP_NUMBER: | 1814 case TRBinaryOpIC::HEAP_NUMBER: |
1815 GenerateHeapNumberStub(masm); | 1815 GenerateHeapNumberStub(masm); |
1816 break; | 1816 break; |
1817 case TRBinaryOpIC::ODDBALL: | 1817 case TRBinaryOpIC::ODDBALL: |
1818 GenerateOddballStub(masm); | 1818 GenerateOddballStub(masm); |
1819 break; | 1819 break; |
| 1820 case TRBinaryOpIC::BOTH_STRING: |
| 1821 GenerateBothStringStub(masm); |
| 1822 break; |
1820 case TRBinaryOpIC::STRING: | 1823 case TRBinaryOpIC::STRING: |
1821 GenerateStringStub(masm); | 1824 GenerateStringStub(masm); |
1822 break; | 1825 break; |
1823 case TRBinaryOpIC::GENERIC: | 1826 case TRBinaryOpIC::GENERIC: |
1824 GenerateGeneric(masm); | 1827 GenerateGeneric(masm); |
1825 break; | 1828 break; |
1826 default: | 1829 default: |
1827 UNREACHABLE(); | 1830 UNREACHABLE(); |
1828 } | 1831 } |
1829 } | 1832 } |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2250 void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) { | 2253 void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) { |
2251 ASSERT(operands_type_ == TRBinaryOpIC::STRING); | 2254 ASSERT(operands_type_ == TRBinaryOpIC::STRING); |
2252 ASSERT(op_ == Token::ADD); | 2255 ASSERT(op_ == Token::ADD); |
2253 // Try to add arguments as strings, otherwise, transition to the generic | 2256 // Try to add arguments as strings, otherwise, transition to the generic |
2254 // TRBinaryOpIC type. | 2257 // TRBinaryOpIC type. |
2255 GenerateAddStrings(masm); | 2258 GenerateAddStrings(masm); |
2256 GenerateTypeTransition(masm); | 2259 GenerateTypeTransition(masm); |
2257 } | 2260 } |
2258 | 2261 |
2259 | 2262 |
| 2263 void TypeRecordingBinaryOpStub::GenerateBothStringStub(MacroAssembler* masm) { |
| 2264 Label call_runtime; |
| 2265 ASSERT(operands_type_ == TRBinaryOpIC::BOTH_STRING); |
| 2266 ASSERT(op_ == Token::ADD); |
| 2267 // If both arguments are strings, call the string add stub. |
| 2268 // Otherwise, do a transition. |
| 2269 |
| 2270 // Registers containing left and right operands respectively. |
| 2271 Register left = r1; |
| 2272 Register right = r0; |
| 2273 |
| 2274 // Test if left operand is a string. |
| 2275 __ JumpIfSmi(left, &call_runtime); |
| 2276 __ CompareObjectType(left, r2, r2, FIRST_NONSTRING_TYPE); |
| 2277 __ b(ge, &call_runtime); |
| 2278 |
| 2279 // Test if right operand is a string. |
| 2280 __ JumpIfSmi(right, &call_runtime); |
| 2281 __ CompareObjectType(right, r2, r2, FIRST_NONSTRING_TYPE); |
| 2282 __ b(ge, &call_runtime); |
| 2283 |
| 2284 StringAddStub string_add_stub(NO_STRING_CHECK_IN_STUB); |
| 2285 GenerateRegisterArgsPush(masm); |
| 2286 __ TailCallStub(&string_add_stub); |
| 2287 |
| 2288 __ bind(&call_runtime); |
| 2289 GenerateTypeTransition(masm); |
| 2290 } |
| 2291 |
| 2292 |
2260 void TypeRecordingBinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { | 2293 void TypeRecordingBinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
2261 ASSERT(operands_type_ == TRBinaryOpIC::INT32); | 2294 ASSERT(operands_type_ == TRBinaryOpIC::INT32); |
2262 | 2295 |
2263 Register left = r1; | 2296 Register left = r1; |
2264 Register right = r0; | 2297 Register right = r0; |
2265 Register scratch1 = r7; | 2298 Register scratch1 = r7; |
2266 Register scratch2 = r9; | 2299 Register scratch2 = r9; |
2267 DwVfpRegister double_scratch = d0; | 2300 DwVfpRegister double_scratch = d0; |
2268 SwVfpRegister single_scratch = s3; | 2301 SwVfpRegister single_scratch = s3; |
2269 | 2302 |
(...skipping 3581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5851 __ str(pc, MemOperand(sp, 0)); | 5884 __ str(pc, MemOperand(sp, 0)); |
5852 __ Jump(target); // Call the C++ function. | 5885 __ Jump(target); // Call the C++ function. |
5853 } | 5886 } |
5854 | 5887 |
5855 | 5888 |
5856 #undef __ | 5889 #undef __ |
5857 | 5890 |
5858 } } // namespace v8::internal | 5891 } } // namespace v8::internal |
5859 | 5892 |
5860 #endif // V8_TARGET_ARCH_ARM | 5893 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |