| 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 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2368 __ b(ne, &return_heap_number); | 2368 __ b(ne, &return_heap_number); |
| 2369 __ bind(¬_zero); | 2369 __ bind(¬_zero); |
| 2370 | 2370 |
| 2371 // Tag the result and return. | 2371 // Tag the result and return. |
| 2372 __ SmiTag(r0, scratch1); | 2372 __ SmiTag(r0, scratch1); |
| 2373 __ Ret(); | 2373 __ Ret(); |
| 2374 } else { | 2374 } else { |
| 2375 // DIV just falls through to allocating a heap number. | 2375 // DIV just falls through to allocating a heap number. |
| 2376 } | 2376 } |
| 2377 | 2377 |
| 2378 __ bind(&return_heap_number); | |
| 2379 // Return a heap number, or fall through to type transition or runtime | |
| 2380 // call if we can't. | |
| 2381 if (result_type_ >= (op_ == Token::DIV) ? TRBinaryOpIC::HEAP_NUMBER | 2378 if (result_type_ >= (op_ == Token::DIV) ? TRBinaryOpIC::HEAP_NUMBER |
| 2382 : TRBinaryOpIC::INT32) { | 2379 : TRBinaryOpIC::INT32) { |
| 2380 __ bind(&return_heap_number); |
| 2383 // We are using vfp registers so r5 is available. | 2381 // We are using vfp registers so r5 is available. |
| 2384 heap_number_result = r5; | 2382 heap_number_result = r5; |
| 2385 GenerateHeapResultAllocation(masm, | 2383 GenerateHeapResultAllocation(masm, |
| 2386 heap_number_result, | 2384 heap_number_result, |
| 2387 heap_number_map, | 2385 heap_number_map, |
| 2388 scratch1, | 2386 scratch1, |
| 2389 scratch2, | 2387 scratch2, |
| 2390 &call_runtime); | 2388 &call_runtime); |
| 2391 __ sub(r0, heap_number_result, Operand(kHeapObjectTag)); | 2389 __ sub(r0, heap_number_result, Operand(kHeapObjectTag)); |
| 2392 __ vstr(d5, r0, HeapNumber::kValueOffset); | 2390 __ vstr(d5, r0, HeapNumber::kValueOffset); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2535 __ TailCallStub(&stub); | 2533 __ TailCallStub(&stub); |
| 2536 } | 2534 } |
| 2537 | 2535 |
| 2538 break; | 2536 break; |
| 2539 } | 2537 } |
| 2540 | 2538 |
| 2541 default: | 2539 default: |
| 2542 UNREACHABLE(); | 2540 UNREACHABLE(); |
| 2543 } | 2541 } |
| 2544 | 2542 |
| 2545 // We never expect DIV to yield an integer result, so we always generate | 2543 if (transition.is_linked()) { |
| 2546 // type transition code for DIV operations expecting an integer result: the | |
| 2547 // code will fall through to this type transition. | |
| 2548 if (transition.is_linked() || | |
| 2549 ((op_ == Token::DIV) && (result_type_ <= TRBinaryOpIC::INT32))) { | |
| 2550 __ bind(&transition); | 2544 __ bind(&transition); |
| 2551 GenerateTypeTransition(masm); | 2545 GenerateTypeTransition(masm); |
| 2552 } | 2546 } |
| 2553 | 2547 |
| 2554 __ bind(&call_runtime); | 2548 __ bind(&call_runtime); |
| 2555 GenerateCallRuntime(masm); | 2549 GenerateCallRuntime(masm); |
| 2556 } | 2550 } |
| 2557 | 2551 |
| 2558 | 2552 |
| 2559 void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { | 2553 void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) { |
| (...skipping 3284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5844 __ str(pc, MemOperand(sp, 0)); | 5838 __ str(pc, MemOperand(sp, 0)); |
| 5845 __ Jump(target); // Call the C++ function. | 5839 __ Jump(target); // Call the C++ function. |
| 5846 } | 5840 } |
| 5847 | 5841 |
| 5848 | 5842 |
| 5849 #undef __ | 5843 #undef __ |
| 5850 | 5844 |
| 5851 } } // namespace v8::internal | 5845 } } // namespace v8::internal |
| 5852 | 5846 |
| 5853 #endif // V8_TARGET_ARCH_ARM | 5847 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |