| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2648 } | 2648 } |
| 2649 return; | 2649 return; |
| 2650 } | 2650 } |
| 2651 | 2651 |
| 2652 const bool right_needs_check = | 2652 const bool right_needs_check = |
| 2653 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); | 2653 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); |
| 2654 ASSERT(right == RCX); // Count must be in RCX | 2654 ASSERT(right == RCX); // Count must be in RCX |
| 2655 if (is_truncating) { | 2655 if (is_truncating) { |
| 2656 if (right_needs_check) { | 2656 if (right_needs_check) { |
| 2657 const bool right_may_be_negative = | 2657 const bool right_may_be_negative = |
| 2658 (right_range == NULL) || right_range->IsNegative(); | 2658 (right_range == NULL) || !right_range->IsPositive(); |
| 2659 if (right_may_be_negative) { | 2659 if (right_may_be_negative) { |
| 2660 ASSERT(shift_left->CanDeoptimize()); | 2660 ASSERT(shift_left->CanDeoptimize()); |
| 2661 __ CompareImmediate(right, Immediate(0), PP); | 2661 __ CompareImmediate(right, Immediate(0), PP); |
| 2662 __ j(NEGATIVE, deopt); | 2662 __ j(NEGATIVE, deopt); |
| 2663 } | 2663 } |
| 2664 Label done, is_not_zero; | 2664 Label done, is_not_zero; |
| 2665 __ CompareImmediate(right, | 2665 __ CompareImmediate(right, |
| 2666 Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))), PP); | 2666 Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))), PP); |
| 2667 __ j(BELOW, &is_not_zero, Assembler::kNearJump); | 2667 __ j(BELOW, &is_not_zero, Assembler::kNearJump); |
| 2668 __ xorq(left, left); | 2668 __ xorq(left, left); |
| (...skipping 3154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5823 PcDescriptors::kOther, | 5823 PcDescriptors::kOther, |
| 5824 locs()); | 5824 locs()); |
| 5825 __ Drop(ArgumentCount()); // Discard arguments. | 5825 __ Drop(ArgumentCount()); // Discard arguments. |
| 5826 } | 5826 } |
| 5827 | 5827 |
| 5828 } // namespace dart | 5828 } // namespace dart |
| 5829 | 5829 |
| 5830 #undef __ | 5830 #undef __ |
| 5831 | 5831 |
| 5832 #endif // defined TARGET_ARCH_X64 | 5832 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |