| 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 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2648 const Object& obj = shift_left->left()->BoundConstant(); | 2648 const Object& obj = shift_left->left()->BoundConstant(); |
| 2649 if (obj.IsSmi()) { | 2649 if (obj.IsSmi()) { |
| 2650 const intptr_t left_int = Smi::Cast(obj).Value(); | 2650 const intptr_t left_int = Smi::Cast(obj).Value(); |
| 2651 if (left_int == 0) { | 2651 if (left_int == 0) { |
| 2652 __ bltz(right, deopt); | 2652 __ bltz(right, deopt); |
| 2653 __ mov(result, ZR); | 2653 __ mov(result, ZR); |
| 2654 return; | 2654 return; |
| 2655 } | 2655 } |
| 2656 const intptr_t max_right = kSmiBits - Utils::HighestBit(left_int); | 2656 const intptr_t max_right = kSmiBits - Utils::HighestBit(left_int); |
| 2657 const bool right_needs_check = | 2657 const bool right_needs_check = |
| 2658 (right_range == NULL) || | 2658 !RangeUtils::IsWithin(right_range, 0, max_right - 1); |
| 2659 !right_range->IsWithin(0, max_right - 1); | |
| 2660 if (right_needs_check) { | 2659 if (right_needs_check) { |
| 2661 __ BranchUnsignedGreaterEqual( | 2660 __ BranchUnsignedGreaterEqual( |
| 2662 right, reinterpret_cast<int32_t>(Smi::New(max_right)), deopt); | 2661 right, reinterpret_cast<int32_t>(Smi::New(max_right)), deopt); |
| 2663 } | 2662 } |
| 2664 __ SmiUntag(TMP, right); | 2663 __ SmiUntag(TMP, right); |
| 2665 __ sllv(result, left, TMP); | 2664 __ sllv(result, left, TMP); |
| 2666 } | 2665 } |
| 2667 return; | 2666 return; |
| 2668 } | 2667 } |
| 2669 | 2668 |
| 2670 const bool right_needs_check = | 2669 const bool right_needs_check = |
| 2671 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); | 2670 !RangeUtils::IsWithin(right_range, 0, (Smi::kBits - 1)); |
| 2672 if (is_truncating) { | 2671 if (is_truncating) { |
| 2673 if (right_needs_check) { | 2672 if (right_needs_check) { |
| 2674 const bool right_may_be_negative = | 2673 const bool right_may_be_negative = |
| 2675 (right_range == NULL) || !right_range->IsPositive(); | 2674 (right_range == NULL) || !right_range->IsPositive(); |
| 2676 if (right_may_be_negative) { | 2675 if (right_may_be_negative) { |
| 2677 ASSERT(shift_left->CanDeoptimize()); | 2676 ASSERT(shift_left->CanDeoptimize()); |
| 2678 __ bltz(right, deopt); | 2677 __ bltz(right, deopt); |
| 2679 } | 2678 } |
| 2680 Label done, is_not_zero; | 2679 Label done, is_not_zero; |
| 2681 | 2680 |
| (...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4811 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 4810 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 4812 #if defined(DEBUG) | 4811 #if defined(DEBUG) |
| 4813 __ LoadImmediate(S4, kInvalidObjectPointer); | 4812 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 4814 __ LoadImmediate(S5, kInvalidObjectPointer); | 4813 __ LoadImmediate(S5, kInvalidObjectPointer); |
| 4815 #endif | 4814 #endif |
| 4816 } | 4815 } |
| 4817 | 4816 |
| 4818 } // namespace dart | 4817 } // namespace dart |
| 4819 | 4818 |
| 4820 #endif // defined TARGET_ARCH_MIPS | 4819 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |