| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2731 // TODO(vegorov): should be eliminated earlier by constant propagation. | 2731 // TODO(vegorov): should be eliminated earlier by constant propagation. |
| 2732 const bool result = (kind() == Token::kEQ_STRICT) ? | 2732 const bool result = (kind() == Token::kEQ_STRICT) ? |
| 2733 left.constant().raw() == right.constant().raw() : | 2733 left.constant().raw() == right.constant().raw() : |
| 2734 left.constant().raw() != right.constant().raw(); | 2734 left.constant().raw() != right.constant().raw(); |
| 2735 __ LoadObject(locs()->out().reg(), result ? Bool::True() : Bool::False()); | 2735 __ LoadObject(locs()->out().reg(), result ? Bool::True() : Bool::False()); |
| 2736 return; | 2736 return; |
| 2737 } | 2737 } |
| 2738 if (left.IsConstant()) { | 2738 if (left.IsConstant()) { |
| 2739 compiler->EmitEqualityRegConstCompare(right.reg(), | 2739 compiler->EmitEqualityRegConstCompare(right.reg(), |
| 2740 left.constant(), | 2740 left.constant(), |
| 2741 needs_number_check()); | 2741 needs_number_check(), |
| 2742 token_pos()); |
| 2742 } else if (right.IsConstant()) { | 2743 } else if (right.IsConstant()) { |
| 2743 compiler->EmitEqualityRegConstCompare(left.reg(), | 2744 compiler->EmitEqualityRegConstCompare(left.reg(), |
| 2744 right.constant(), | 2745 right.constant(), |
| 2745 needs_number_check()); | 2746 needs_number_check(), |
| 2747 token_pos()); |
| 2746 } else { | 2748 } else { |
| 2747 compiler->EmitEqualityRegRegCompare(left.reg(), | 2749 compiler->EmitEqualityRegRegCompare(left.reg(), |
| 2748 right.reg(), | 2750 right.reg(), |
| 2749 needs_number_check()); | 2751 needs_number_check(), |
| 2752 token_pos()); |
| 2750 } | 2753 } |
| 2751 | 2754 |
| 2752 Register result = locs()->out().reg(); | 2755 Register result = locs()->out().reg(); |
| 2753 Label load_true, done; | 2756 Label load_true, done; |
| 2754 if (kind() == Token::kEQ_STRICT) { | 2757 if (kind() == Token::kEQ_STRICT) { |
| 2755 __ beq(CMPRES, ZR, &load_true); | 2758 __ beq(CMPRES, ZR, &load_true); |
| 2756 } else { | 2759 } else { |
| 2757 ASSERT(kind() == Token::kNE_STRICT); | 2760 ASSERT(kind() == Token::kNE_STRICT); |
| 2758 __ bne(CMPRES, ZR, &load_true); | 2761 __ bne(CMPRES, ZR, &load_true); |
| 2759 } | 2762 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2775 // TODO(vegorov): should be eliminated earlier by constant propagation. | 2778 // TODO(vegorov): should be eliminated earlier by constant propagation. |
| 2776 const bool result = (kind() == Token::kEQ_STRICT) ? | 2779 const bool result = (kind() == Token::kEQ_STRICT) ? |
| 2777 left.constant().raw() == right.constant().raw() : | 2780 left.constant().raw() == right.constant().raw() : |
| 2778 left.constant().raw() != right.constant().raw(); | 2781 left.constant().raw() != right.constant().raw(); |
| 2779 branch->EmitBranchOnValue(compiler, result); | 2782 branch->EmitBranchOnValue(compiler, result); |
| 2780 return; | 2783 return; |
| 2781 } | 2784 } |
| 2782 if (left.IsConstant()) { | 2785 if (left.IsConstant()) { |
| 2783 compiler->EmitEqualityRegConstCompare(right.reg(), | 2786 compiler->EmitEqualityRegConstCompare(right.reg(), |
| 2784 left.constant(), | 2787 left.constant(), |
| 2785 needs_number_check()); | 2788 needs_number_check(), |
| 2789 token_pos()); |
| 2786 } else if (right.IsConstant()) { | 2790 } else if (right.IsConstant()) { |
| 2787 compiler->EmitEqualityRegConstCompare(left.reg(), | 2791 compiler->EmitEqualityRegConstCompare(left.reg(), |
| 2788 right.constant(), | 2792 right.constant(), |
| 2789 needs_number_check()); | 2793 needs_number_check(), |
| 2794 token_pos()); |
| 2790 } else { | 2795 } else { |
| 2791 compiler->EmitEqualityRegRegCompare(left.reg(), | 2796 compiler->EmitEqualityRegRegCompare(left.reg(), |
| 2792 right.reg(), | 2797 right.reg(), |
| 2793 needs_number_check()); | 2798 needs_number_check(), |
| 2799 token_pos()); |
| 2794 } | 2800 } |
| 2795 | 2801 |
| 2796 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE; | 2802 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE; |
| 2797 branch->EmitBranchOnCondition(compiler, true_condition); | 2803 branch->EmitBranchOnCondition(compiler, true_condition); |
| 2798 } | 2804 } |
| 2799 | 2805 |
| 2800 | 2806 |
| 2801 LocationSummary* BooleanNegateInstr::MakeLocationSummary() const { | 2807 LocationSummary* BooleanNegateInstr::MakeLocationSummary() const { |
| 2802 return LocationSummary::Make(1, | 2808 return LocationSummary::Make(1, |
| 2803 Location::RequiresRegister(), | 2809 Location::RequiresRegister(), |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2893 compiler->GenerateCall(token_pos(), | 2899 compiler->GenerateCall(token_pos(), |
| 2894 &label, | 2900 &label, |
| 2895 PcDescriptors::kOther, | 2901 PcDescriptors::kOther, |
| 2896 locs()); | 2902 locs()); |
| 2897 __ Drop(2); // Discard type arguments and receiver. | 2903 __ Drop(2); // Discard type arguments and receiver. |
| 2898 } | 2904 } |
| 2899 | 2905 |
| 2900 } // namespace dart | 2906 } // namespace dart |
| 2901 | 2907 |
| 2902 #endif // defined TARGET_ARCH_MIPS | 2908 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |