| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 2620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2631 __ sllv(result, left, TMP); | 2631 __ sllv(result, left, TMP); |
| 2632 } | 2632 } |
| 2633 return; | 2633 return; |
| 2634 } | 2634 } |
| 2635 | 2635 |
| 2636 const bool right_needs_check = | 2636 const bool right_needs_check = |
| 2637 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); | 2637 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); |
| 2638 if (is_truncating) { | 2638 if (is_truncating) { |
| 2639 if (right_needs_check) { | 2639 if (right_needs_check) { |
| 2640 const bool right_may_be_negative = | 2640 const bool right_may_be_negative = |
| 2641 (right_range == NULL) || right_range->IsNegative(); | 2641 (right_range == NULL) || !right_range->IsPositive(); |
| 2642 if (right_may_be_negative) { | 2642 if (right_may_be_negative) { |
| 2643 ASSERT(shift_left->CanDeoptimize()); | 2643 ASSERT(shift_left->CanDeoptimize()); |
| 2644 __ bltz(right, deopt); | 2644 __ bltz(right, deopt); |
| 2645 } | 2645 } |
| 2646 Label done, is_not_zero; | 2646 Label done, is_not_zero; |
| 2647 | 2647 |
| 2648 __ sltiu(CMPRES1, | 2648 __ sltiu(CMPRES1, |
| 2649 right, Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits)))); | 2649 right, Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits)))); |
| 2650 __ movz(result, ZR, CMPRES1); // result = right >= kBits ? 0 : result. | 2650 __ movz(result, ZR, CMPRES1); // result = right >= kBits ? 0 : result. |
| 2651 __ sra(TMP, right, kSmiTagSize); | 2651 __ sra(TMP, right, kSmiTagSize); |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4681 compiler->GenerateCall(token_pos(), | 4681 compiler->GenerateCall(token_pos(), |
| 4682 &label, | 4682 &label, |
| 4683 PcDescriptors::kOther, | 4683 PcDescriptors::kOther, |
| 4684 locs()); | 4684 locs()); |
| 4685 __ Drop(ArgumentCount()); // Discard arguments. | 4685 __ Drop(ArgumentCount()); // Discard arguments. |
| 4686 } | 4686 } |
| 4687 | 4687 |
| 4688 } // namespace dart | 4688 } // namespace dart |
| 4689 | 4689 |
| 4690 #endif // defined TARGET_ARCH_MIPS | 4690 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |