| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2854 // TODO(vegorov): should be eliminated earlier by constant propagation. | 2854 // TODO(vegorov): should be eliminated earlier by constant propagation. |
| 2855 const bool result = (kind() == Token::kEQ_STRICT) ? | 2855 const bool result = (kind() == Token::kEQ_STRICT) ? |
| 2856 left.constant().raw() == right.constant().raw() : | 2856 left.constant().raw() == right.constant().raw() : |
| 2857 left.constant().raw() != right.constant().raw(); | 2857 left.constant().raw() != right.constant().raw(); |
| 2858 __ LoadObject(locs()->out().reg(), result ? Bool::True() : Bool::False()); | 2858 __ LoadObject(locs()->out().reg(), result ? Bool::True() : Bool::False()); |
| 2859 return; | 2859 return; |
| 2860 } | 2860 } |
| 2861 if (left.IsConstant()) { | 2861 if (left.IsConstant()) { |
| 2862 compiler->EmitEqualityRegConstCompare(right.reg(), | 2862 compiler->EmitEqualityRegConstCompare(right.reg(), |
| 2863 left.constant(), | 2863 left.constant(), |
| 2864 needs_number_check()); | 2864 needs_number_check(), |
| 2865 token_pos()); |
| 2865 } else if (right.IsConstant()) { | 2866 } else if (right.IsConstant()) { |
| 2866 compiler->EmitEqualityRegConstCompare(left.reg(), | 2867 compiler->EmitEqualityRegConstCompare(left.reg(), |
| 2867 right.constant(), | 2868 right.constant(), |
| 2868 needs_number_check()); | 2869 needs_number_check(), |
| 2870 token_pos()); |
| 2869 } else { | 2871 } else { |
| 2870 compiler->EmitEqualityRegRegCompare(left.reg(), | 2872 compiler->EmitEqualityRegRegCompare(left.reg(), |
| 2871 right.reg(), | 2873 right.reg(), |
| 2872 needs_number_check()); | 2874 needs_number_check(), |
| 2875 token_pos()); |
| 2873 } | 2876 } |
| 2874 | 2877 |
| 2875 Register result = locs()->out().reg(); | 2878 Register result = locs()->out().reg(); |
| 2876 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE; | 2879 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE; |
| 2877 __ LoadObject(result, Bool::True(), true_condition); | 2880 __ LoadObject(result, Bool::True(), true_condition); |
| 2878 __ LoadObject(result, Bool::False(), NegateCondition(true_condition)); | 2881 __ LoadObject(result, Bool::False(), NegateCondition(true_condition)); |
| 2879 } | 2882 } |
| 2880 | 2883 |
| 2881 | 2884 |
| 2882 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 2885 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
| 2883 BranchInstr* branch) { | 2886 BranchInstr* branch) { |
| 2884 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | 2887 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
| 2885 Location left = locs()->in(0); | 2888 Location left = locs()->in(0); |
| 2886 Location right = locs()->in(1); | 2889 Location right = locs()->in(1); |
| 2887 if (left.IsConstant() && right.IsConstant()) { | 2890 if (left.IsConstant() && right.IsConstant()) { |
| 2888 // TODO(vegorov): should be eliminated earlier by constant propagation. | 2891 // TODO(vegorov): should be eliminated earlier by constant propagation. |
| 2889 const bool result = (kind() == Token::kEQ_STRICT) ? | 2892 const bool result = (kind() == Token::kEQ_STRICT) ? |
| 2890 left.constant().raw() == right.constant().raw() : | 2893 left.constant().raw() == right.constant().raw() : |
| 2891 left.constant().raw() != right.constant().raw(); | 2894 left.constant().raw() != right.constant().raw(); |
| 2892 branch->EmitBranchOnValue(compiler, result); | 2895 branch->EmitBranchOnValue(compiler, result); |
| 2893 return; | 2896 return; |
| 2894 } | 2897 } |
| 2895 if (left.IsConstant()) { | 2898 if (left.IsConstant()) { |
| 2896 compiler->EmitEqualityRegConstCompare(right.reg(), | 2899 compiler->EmitEqualityRegConstCompare(right.reg(), |
| 2897 left.constant(), | 2900 left.constant(), |
| 2898 needs_number_check()); | 2901 needs_number_check(), |
| 2902 token_pos()); |
| 2899 } else if (right.IsConstant()) { | 2903 } else if (right.IsConstant()) { |
| 2900 compiler->EmitEqualityRegConstCompare(left.reg(), | 2904 compiler->EmitEqualityRegConstCompare(left.reg(), |
| 2901 right.constant(), | 2905 right.constant(), |
| 2902 needs_number_check()); | 2906 needs_number_check(), |
| 2907 token_pos()); |
| 2903 } else { | 2908 } else { |
| 2904 compiler->EmitEqualityRegRegCompare(left.reg(), | 2909 compiler->EmitEqualityRegRegCompare(left.reg(), |
| 2905 right.reg(), | 2910 right.reg(), |
| 2906 needs_number_check()); | 2911 needs_number_check(), |
| 2912 token_pos()); |
| 2907 } | 2913 } |
| 2908 | 2914 |
| 2909 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE; | 2915 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE; |
| 2910 branch->EmitBranchOnCondition(compiler, true_condition); | 2916 branch->EmitBranchOnCondition(compiler, true_condition); |
| 2911 } | 2917 } |
| 2912 | 2918 |
| 2913 | 2919 |
| 2914 LocationSummary* BooleanNegateInstr::MakeLocationSummary() const { | 2920 LocationSummary* BooleanNegateInstr::MakeLocationSummary() const { |
| 2915 return LocationSummary::Make(1, | 2921 return LocationSummary::Make(1, |
| 2916 Location::RequiresRegister(), | 2922 Location::RequiresRegister(), |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3004 compiler->GenerateCall(token_pos(), | 3010 compiler->GenerateCall(token_pos(), |
| 3005 &label, | 3011 &label, |
| 3006 PcDescriptors::kOther, | 3012 PcDescriptors::kOther, |
| 3007 locs()); | 3013 locs()); |
| 3008 __ Drop(2); // Discard type arguments and receiver. | 3014 __ Drop(2); // Discard type arguments and receiver. |
| 3009 } | 3015 } |
| 3010 | 3016 |
| 3011 } // namespace dart | 3017 } // namespace dart |
| 3012 | 3018 |
| 3013 #endif // defined TARGET_ARCH_ARM | 3019 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |