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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 // Do nothing. | 2608 // Do nothing. |
2609 break; | 2609 break; |
2610 } else if (value == -1) { | 2610 } else if (value == -1) { |
2611 // Check the corner case of dividing the 'MIN_SMI' with -1, in which | 2611 // Check the corner case of dividing the 'MIN_SMI' with -1, in which |
2612 // case we cannot negate the result. | 2612 // case we cannot negate the result. |
2613 __ cmpl(left, Immediate(0x80000000)); | 2613 __ cmpl(left, Immediate(0x80000000)); |
2614 __ j(EQUAL, deopt); | 2614 __ j(EQUAL, deopt); |
2615 __ negl(left); | 2615 __ negl(left); |
2616 break; | 2616 break; |
2617 } | 2617 } |
2618 ASSERT((value != 0) && Utils::IsPowerOfTwo(Utils::Abs(value))); | 2618 ASSERT(Utils::IsPowerOfTwo(Utils::Abs(value))); |
2619 const intptr_t shift_count = | 2619 const intptr_t shift_count = |
2620 Utils::ShiftForPowerOfTwo(Utils::Abs(value)) + kSmiTagSize; | 2620 Utils::ShiftForPowerOfTwo(Utils::Abs(value)) + kSmiTagSize; |
2621 ASSERT(kSmiTagSize == 1); | 2621 ASSERT(kSmiTagSize == 1); |
2622 Register temp = locs()->temp(0).reg(); | 2622 Register temp = locs()->temp(0).reg(); |
2623 __ movl(temp, left); | 2623 __ movl(temp, left); |
2624 __ sarl(temp, Immediate(31)); | 2624 __ sarl(temp, Immediate(31)); |
2625 ASSERT(shift_count > 1); // 1, -1 case handled above. | 2625 ASSERT(shift_count > 1); // 1, -1 case handled above. |
2626 __ shrl(temp, Immediate(32 - shift_count)); | 2626 __ shrl(temp, Immediate(32 - shift_count)); |
2627 __ addl(left, temp); | 2627 __ addl(left, temp); |
2628 ASSERT(shift_count > 0); | 2628 ASSERT(shift_count > 0); |
(...skipping 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5265 PcDescriptors::kOther, | 5265 PcDescriptors::kOther, |
5266 locs()); | 5266 locs()); |
5267 __ Drop(2); // Discard type arguments and receiver. | 5267 __ Drop(2); // Discard type arguments and receiver. |
5268 } | 5268 } |
5269 | 5269 |
5270 } // namespace dart | 5270 } // namespace dart |
5271 | 5271 |
5272 #undef __ | 5272 #undef __ |
5273 | 5273 |
5274 #endif // defined TARGET_ARCH_IA32 | 5274 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |