OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 __ MoveRegister(result, left); | 2504 __ MoveRegister(result, left); |
2505 break; | 2505 break; |
2506 } else if (value == -1) { | 2506 } else if (value == -1) { |
2507 // Check the corner case of dividing the 'MIN_SMI' with -1, in which | 2507 // Check the corner case of dividing the 'MIN_SMI' with -1, in which |
2508 // case we cannot negate the result. | 2508 // case we cannot negate the result. |
2509 __ CompareImmediate(left, 0x80000000); | 2509 __ CompareImmediate(left, 0x80000000); |
2510 __ b(deopt, EQ); | 2510 __ b(deopt, EQ); |
2511 __ rsb(result, left, ShifterOperand(0)); | 2511 __ rsb(result, left, ShifterOperand(0)); |
2512 break; | 2512 break; |
2513 } | 2513 } |
2514 ASSERT((value != 0) && Utils::IsPowerOfTwo(Utils::Abs(value))); | 2514 ASSERT(Utils::IsPowerOfTwo(Utils::Abs(value))); |
2515 const intptr_t shift_count = | 2515 const intptr_t shift_count = |
2516 Utils::ShiftForPowerOfTwo(Utils::Abs(value)) + kSmiTagSize; | 2516 Utils::ShiftForPowerOfTwo(Utils::Abs(value)) + kSmiTagSize; |
2517 ASSERT(kSmiTagSize == 1); | 2517 ASSERT(kSmiTagSize == 1); |
2518 __ mov(IP, ShifterOperand(left, ASR, 31)); | 2518 __ mov(IP, ShifterOperand(left, ASR, 31)); |
2519 ASSERT(shift_count > 1); // 1, -1 case handled above. | 2519 ASSERT(shift_count > 1); // 1, -1 case handled above. |
2520 Register temp = locs()->temp(0).reg(); | 2520 Register temp = locs()->temp(0).reg(); |
2521 __ add(temp, left, ShifterOperand(IP, LSR, 32 - shift_count)); | 2521 __ add(temp, left, ShifterOperand(IP, LSR, 32 - shift_count)); |
2522 ASSERT(shift_count > 0); | 2522 ASSERT(shift_count > 0); |
2523 __ mov(result, ShifterOperand(temp, ASR, shift_count)); | 2523 __ mov(result, ShifterOperand(temp, ASR, shift_count)); |
2524 if (value < 0) { | 2524 if (value < 0) { |
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4700 compiler->GenerateCall(token_pos(), | 4700 compiler->GenerateCall(token_pos(), |
4701 &label, | 4701 &label, |
4702 PcDescriptors::kOther, | 4702 PcDescriptors::kOther, |
4703 locs()); | 4703 locs()); |
4704 __ Drop(2); // Discard type arguments and receiver. | 4704 __ Drop(2); // Discard type arguments and receiver. |
4705 } | 4705 } |
4706 | 4706 |
4707 } // namespace dart | 4707 } // namespace dart |
4708 | 4708 |
4709 #endif // defined TARGET_ARCH_ARM | 4709 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |