Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 2949513002: Revert "Reduce copying, redundancy & repetition for codegen of comparison instructions" (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compiler.h" 10 #include "vm/compiler.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 intptr_t temp = true_value; 171 intptr_t temp = true_value;
172 true_value = false_value; 172 true_value = false_value;
173 false_value = temp; 173 false_value = temp;
174 swapped = true; 174 swapped = true;
175 } 175 }
176 176
177 // Initialize result with the true value. 177 // Initialize result with the true value.
178 __ LoadImmediate(result, Smi::RawValue(true_value)); 178 __ LoadImmediate(result, Smi::RawValue(true_value));
179 179
180 // Emit comparison code. This must not overwrite the result register. 180 // Emit comparison code. This must not overwrite the result register.
181 // IfThenElseInstr::Supports() should prevent EmitComparisonCode from using
182 // the labels or returning an invalid condition.
183 BranchLabels labels = {NULL, NULL, NULL}; // Emit branch-free code. 181 BranchLabels labels = {NULL, NULL, NULL}; // Emit branch-free code.
184 Condition true_condition = comparison()->EmitComparisonCode(compiler, labels); 182 Condition true_condition = comparison()->EmitComparisonCode(compiler, labels);
185 ASSERT(true_condition.IsValid());
186 if (swapped) { 183 if (swapped) {
187 true_condition = NegateCondition(true_condition); 184 true_condition = NegateCondition(true_condition);
188 } 185 }
189 186
190 // Evaluate condition and provide result in CMPRES1. 187 // Evaluate condition and provide result in CMPRES1.
191 Register left = true_condition.left(); 188 Register left = true_condition.left();
192 Register right = true_condition.right(); 189 Register right = true_condition.right();
193 bool zero_is_false = true; // Zero in CMPRES1 indicates a false condition. 190 bool zero_is_false = true; // Zero in CMPRES1 indicates a false condition.
194 switch (true_condition.rel_op()) { 191 switch (true_condition.rel_op()) {
195 case AL: 192 case AL:
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 return EmitSmiComparisonOp(compiler, *locs(), kind()); 774 return EmitSmiComparisonOp(compiler, *locs(), kind());
778 } else if (operation_cid() == kMintCid) { 775 } else if (operation_cid() == kMintCid) {
779 return EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), labels); 776 return EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), labels);
780 } else { 777 } else {
781 ASSERT(operation_cid() == kDoubleCid); 778 ASSERT(operation_cid() == kDoubleCid);
782 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels); 779 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels);
783 } 780 }
784 } 781 }
785 782
786 783
787 void ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 784 void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
785 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
786 __ Comment("EqualityCompareInstr");
787
788 Label is_true, is_false; 788 Label is_true, is_false;
789 BranchLabels labels = {&is_true, &is_false, &is_false}; 789 BranchLabels labels = {&is_true, &is_false, &is_false};
790 Condition true_condition = EmitComparisonCode(compiler, labels); 790 Condition true_condition = EmitComparisonCode(compiler, labels);
791 if (true_condition.IsValid()) { 791 EmitBranchOnCondition(compiler, true_condition, labels);
792 EmitBranchOnCondition(compiler, true_condition, labels);
793 }
794 792
795 Register result = this->locs()->out(0).reg(); 793 Register result = locs()->out(0).reg();
796 Label done; 794 Label done;
797 __ Bind(&is_false); 795 __ Bind(&is_false);
798 __ LoadObject(result, Bool::False()); 796 __ LoadObject(result, Bool::False());
799 __ b(&done); 797 __ b(&done);
800 __ Bind(&is_true); 798 __ Bind(&is_true);
801 __ LoadObject(result, Bool::True()); 799 __ LoadObject(result, Bool::True());
802 __ Bind(&done); 800 __ Bind(&done);
803 } 801 }
804 802
805 803
806 void ComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler, 804 void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
807 BranchInstr* branch) { 805 BranchInstr* branch) {
806 __ Comment("EqualityCompareInstr::EmitBranchCode");
807 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
808
808 BranchLabels labels = compiler->CreateBranchLabels(branch); 809 BranchLabels labels = compiler->CreateBranchLabels(branch);
809 Condition true_condition = EmitComparisonCode(compiler, labels); 810 Condition true_condition = EmitComparisonCode(compiler, labels);
810 if (true_condition.IsValid()) { 811 EmitBranchOnCondition(compiler, true_condition, labels);
811 EmitBranchOnCondition(compiler, true_condition, labels);
812 }
813 } 812 }
814 813
815 814
816 LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const { 815 LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const {
817 const intptr_t kNumInputs = 2; 816 const intptr_t kNumInputs = 2;
818 const intptr_t kNumTemps = 0; 817 const intptr_t kNumTemps = 0;
819 LocationSummary* locs = new (zone) 818 LocationSummary* locs = new (zone)
820 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 819 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
821 locs->set_in(0, Location::RequiresRegister()); 820 locs->set_in(0, Location::RequiresRegister());
822 // Only one input can be a constant operand. The case of two constant 821 // Only one input can be a constant operand. The case of two constant
(...skipping 11 matching lines...) Expand all
834 ASSERT(right.constant().IsSmi()); 833 ASSERT(right.constant().IsSmi());
835 const int32_t imm = reinterpret_cast<int32_t>(right.constant().raw()); 834 const int32_t imm = reinterpret_cast<int32_t>(right.constant().raw());
836 __ AndImmediate(CMPRES1, left, imm); 835 __ AndImmediate(CMPRES1, left, imm);
837 } else { 836 } else {
838 __ and_(CMPRES1, left, right.reg()); 837 __ and_(CMPRES1, left, right.reg());
839 } 838 }
840 return Condition(CMPRES1, ZR, (kind() == Token::kNE) ? NE : EQ); 839 return Condition(CMPRES1, ZR, (kind() == Token::kNE) ? NE : EQ);
841 } 840 }
842 841
843 842
843 void TestSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
844 // Never emitted outside of the BranchInstr.
845 UNREACHABLE();
846 }
847
848
849 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler,
850 BranchInstr* branch) {
851 BranchLabels labels = compiler->CreateBranchLabels(branch);
852 Condition true_condition = EmitComparisonCode(compiler, labels);
853 EmitBranchOnCondition(compiler, true_condition, labels);
854 }
855
856
844 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone, 857 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone,
845 bool opt) const { 858 bool opt) const {
846 const intptr_t kNumInputs = 1; 859 const intptr_t kNumInputs = 1;
847 const intptr_t kNumTemps = 1; 860 const intptr_t kNumTemps = 1;
848 LocationSummary* locs = new (zone) 861 LocationSummary* locs = new (zone)
849 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 862 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
850 locs->set_in(0, Location::RequiresRegister()); 863 locs->set_in(0, Location::RequiresRegister());
851 locs->set_temp(0, Location::RequiresRegister()); 864 locs->set_temp(0, Location::RequiresRegister());
852 locs->set_out(0, Location::RequiresRegister()); 865 locs->set_out(0, Location::RequiresRegister());
853 return locs; 866 return locs;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 // If the cid is not in the list, jump to the opposite label from the cids 899 // If the cid is not in the list, jump to the opposite label from the cids
887 // that are in the list. These must be all the same (see asserts in the 900 // that are in the list. These must be all the same (see asserts in the
888 // constructor). 901 // constructor).
889 Label* target = result ? labels.false_label : labels.true_label; 902 Label* target = result ? labels.false_label : labels.true_label;
890 if (target != labels.fall_through) { 903 if (target != labels.fall_through) {
891 __ b(target); 904 __ b(target);
892 } 905 }
893 } else { 906 } else {
894 __ b(deopt); 907 __ b(deopt);
895 } 908 }
896 // Dummy result as this method already did the jump, there's no need 909 // Dummy result as the last instruction is a jump or fall through.
897 // for the caller to branch on a condition. 910 return Condition(CMPRES1, ZR, AL);
898 return Condition(ZR, ZR, INVALID_RELATION);
899 } 911 }
900 912
901 913
914 void TestCidsInstr::EmitBranchCode(FlowGraphCompiler* compiler,
915 BranchInstr* branch) {
916 BranchLabels labels = compiler->CreateBranchLabels(branch);
917 EmitComparisonCode(compiler, labels);
918 }
919
920
921 void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
922 Register result_reg = locs()->out(0).reg();
923 Label is_true, is_false, done;
924 BranchLabels labels = {&is_true, &is_false, &is_false};
925 EmitComparisonCode(compiler, labels);
926 __ Bind(&is_false);
927 __ LoadObject(result_reg, Bool::False());
928 __ b(&done);
929 __ Bind(&is_true);
930 __ LoadObject(result_reg, Bool::True());
931 __ Bind(&done);
932 }
933
934
902 LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone, 935 LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone,
903 bool opt) const { 936 bool opt) const {
904 const intptr_t kNumInputs = 2; 937 const intptr_t kNumInputs = 2;
905 const intptr_t kNumTemps = 0; 938 const intptr_t kNumTemps = 0;
906 if (operation_cid() == kMintCid) { 939 if (operation_cid() == kMintCid) {
907 const intptr_t kNumTemps = 0; 940 const intptr_t kNumTemps = 0;
908 LocationSummary* locs = new (zone) 941 LocationSummary* locs = new (zone)
909 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 942 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
910 locs->set_in(0, Location::Pair(Location::RequiresRegister(), 943 locs->set_in(0, Location::Pair(Location::RequiresRegister(),
911 Location::RequiresRegister())); 944 Location::RequiresRegister()));
(...skipping 30 matching lines...) Expand all
942 return EmitSmiComparisonOp(compiler, *locs(), kind()); 975 return EmitSmiComparisonOp(compiler, *locs(), kind());
943 } else if (operation_cid() == kMintCid) { 976 } else if (operation_cid() == kMintCid) {
944 return EmitUnboxedMintComparisonOp(compiler, *locs(), kind(), labels); 977 return EmitUnboxedMintComparisonOp(compiler, *locs(), kind(), labels);
945 } else { 978 } else {
946 ASSERT(operation_cid() == kDoubleCid); 979 ASSERT(operation_cid() == kDoubleCid);
947 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels); 980 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels);
948 } 981 }
949 } 982 }
950 983
951 984
985 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
986 __ Comment("RelationalOpInstr");
987
988 Label is_true, is_false;
989 BranchLabels labels = {&is_true, &is_false, &is_false};
990 Condition true_condition = EmitComparisonCode(compiler, labels);
991 EmitBranchOnCondition(compiler, true_condition, labels);
992
993 Register result = locs()->out(0).reg();
994 Label done;
995 __ Bind(&is_false);
996 __ LoadObject(result, Bool::False());
997 __ b(&done);
998 __ Bind(&is_true);
999 __ LoadObject(result, Bool::True());
1000 __ Bind(&done);
1001 }
1002
1003
1004 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
1005 BranchInstr* branch) {
1006 __ Comment("RelationalOpInstr");
1007
1008 BranchLabels labels = compiler->CreateBranchLabels(branch);
1009 Condition true_condition = EmitComparisonCode(compiler, labels);
1010 EmitBranchOnCondition(compiler, true_condition, labels);
1011 }
1012
1013
952 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone, 1014 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone,
953 bool opt) const { 1015 bool opt) const {
954 return MakeCallSummary(zone); 1016 return MakeCallSummary(zone);
955 } 1017 }
956 1018
957 1019
958 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1020 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
959 SetupNative(); 1021 SetupNative();
960 __ Comment("NativeCallInstr"); 1022 __ Comment("NativeCallInstr");
961 Register result = locs()->out(0).reg(); 1023 Register result = locs()->out(0).reg();
(...skipping 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 3240
3179 void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler, 3241 void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
3180 BranchInstr* branch) { 3242 BranchInstr* branch) {
3181 BranchLabels labels = compiler->CreateBranchLabels(branch); 3243 BranchLabels labels = compiler->CreateBranchLabels(branch);
3182 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath( 3244 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
3183 this, compiler->CurrentTryIndex(), labels, 3245 this, compiler->CurrentTryIndex(), labels,
3184 /* merged = */ true); 3246 /* merged = */ true);
3185 compiler->AddSlowPathCode(slow_path); 3247 compiler->AddSlowPathCode(slow_path);
3186 EMIT_SMI_CHECK; 3248 EMIT_SMI_CHECK;
3187 Condition true_condition = EmitComparisonCode(compiler, labels); 3249 Condition true_condition = EmitComparisonCode(compiler, labels);
3188 ASSERT(true_condition.IsValid());
3189 EmitBranchOnCondition(compiler, true_condition, labels); 3250 EmitBranchOnCondition(compiler, true_condition, labels);
3190 __ Bind(slow_path->exit_label()); 3251 __ Bind(slow_path->exit_label());
3191 } 3252 }
3192 3253
3193 3254
3194 void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3255 void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3195 Label true_label, false_label, done; 3256 Label true_label, false_label, done;
3196 BranchLabels labels = {&true_label, &false_label, &false_label}; 3257 BranchLabels labels = {&true_label, &false_label, &false_label};
3197 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath( 3258 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
3198 this, compiler->CurrentTryIndex(), labels, 3259 this, compiler->CurrentTryIndex(), labels,
3199 /* merged = */ false); 3260 /* merged = */ false);
3200 compiler->AddSlowPathCode(slow_path); 3261 compiler->AddSlowPathCode(slow_path);
3201 EMIT_SMI_CHECK; 3262 EMIT_SMI_CHECK;
3202 Condition true_condition = EmitComparisonCode(compiler, labels); 3263 Condition true_condition = EmitComparisonCode(compiler, labels);
3203 ASSERT(true_condition.IsValid());
3204 EmitBranchOnCondition(compiler, true_condition, labels); 3264 EmitBranchOnCondition(compiler, true_condition, labels);
3205 Register result = locs()->out(0).reg(); 3265 Register result = locs()->out(0).reg();
3206 __ Bind(&false_label); 3266 __ Bind(&false_label);
3207 __ LoadObject(result, Bool::False()); 3267 __ LoadObject(result, Bool::False());
3208 __ b(&done); 3268 __ b(&done);
3209 __ Bind(&true_label); 3269 __ Bind(&true_label);
3210 __ LoadObject(result, Bool::True()); 3270 __ LoadObject(result, Bool::True());
3211 __ Bind(&done); 3271 __ Bind(&done);
3212 __ Bind(slow_path->exit_label()); 3272 __ Bind(slow_path->exit_label());
3213 } 3273 }
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
3908 __ bc1t(labels.true_label); 3968 __ bc1t(labels.true_label);
3909 } 3969 }
3910 } else { 3970 } else {
3911 if (is_negated) { 3971 if (is_negated) {
3912 __ bc1t(labels.false_label); 3972 __ bc1t(labels.false_label);
3913 } else { 3973 } else {
3914 __ bc1f(labels.false_label); 3974 __ bc1f(labels.false_label);
3915 } 3975 }
3916 __ b(labels.true_label); 3976 __ b(labels.true_label);
3917 } 3977 }
3918 return Condition(ZR, ZR, INVALID_RELATION); // Unused. 3978 return Condition(); // Unused.
3919 } else { 3979 } else {
3920 ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite); 3980 ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
3921 __ mfc1(CMPRES1, EvenFRegisterOf(value)); 3981 __ mfc1(CMPRES1, EvenFRegisterOf(value));
3922 // If the low word isn't zero, then it isn't infinity. 3982 // If the low word isn't zero, then it isn't infinity.
3923 __ bne(CMPRES1, ZR, is_negated ? labels.true_label : labels.false_label); 3983 __ bne(CMPRES1, ZR, is_negated ? labels.true_label : labels.false_label);
3924 __ mfc1(CMPRES1, OddFRegisterOf(value)); 3984 __ mfc1(CMPRES1, OddFRegisterOf(value));
3925 // Mask off the sign bit. 3985 // Mask off the sign bit.
3926 __ AndImmediate(CMPRES1, CMPRES1, 0x7FFFFFFF); 3986 __ AndImmediate(CMPRES1, CMPRES1, 0x7FFFFFFF);
3927 // Compare with +infinity. 3987 // Compare with +infinity.
3928 __ LoadImmediate(CMPRES2, 0x7FF00000); 3988 __ LoadImmediate(CMPRES2, 0x7FF00000);
3929 return Condition(CMPRES1, CMPRES2, is_negated ? NE : EQ); 3989 return Condition(CMPRES1, CMPRES2, is_negated ? NE : EQ);
3930 } 3990 }
3931 } 3991 }
3932 3992
3993 void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
3994 BranchInstr* branch) {
3995 ASSERT(compiler->is_optimizing());
3996 BranchLabels labels = compiler->CreateBranchLabels(branch);
3997 Condition true_condition = EmitComparisonCode(compiler, labels);
3998 // Branches for isNaN are emitted in EmitComparisonCode already.
3999 if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
4000 EmitBranchOnCondition(compiler, true_condition, labels);
4001 }
4002 }
4003
4004
4005 void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4006 Label is_true, is_false;
4007 BranchLabels labels = {&is_true, &is_false, &is_false};
4008 Condition true_condition = EmitComparisonCode(compiler, labels);
4009 // Branches for isNaN are emitted in EmitComparisonCode already.
4010 if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
4011 EmitBranchOnCondition(compiler, true_condition, labels);
4012 }
4013 const Register result = locs()->out(0).reg();
4014 Label done;
4015 __ Comment("return bool");
4016 __ Bind(&is_false);
4017 __ LoadObject(result, Bool::False());
4018 __ b(&done);
4019 __ Bind(&is_true);
4020 __ LoadObject(result, Bool::True());
4021 __ Bind(&done);
4022 }
4023
4024
3933 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone, 4025 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
3934 bool opt) const { 4026 bool opt) const {
3935 UNIMPLEMENTED(); 4027 UNIMPLEMENTED();
3936 return NULL; 4028 return NULL;
3937 } 4029 }
3938 4030
3939 4031
3940 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4032 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3941 UNIMPLEMENTED(); 4033 UNIMPLEMENTED();
3942 } 4034 }
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
5887 left.reg(), right.reg(), needs_number_check(), token_pos(), deopt_id_); 5979 left.reg(), right.reg(), needs_number_check(), token_pos(), deopt_id_);
5888 } 5980 }
5889 if (kind() != Token::kEQ_STRICT) { 5981 if (kind() != Token::kEQ_STRICT) {
5890 ASSERT(kind() == Token::kNE_STRICT); 5982 ASSERT(kind() == Token::kNE_STRICT);
5891 true_condition = NegateCondition(true_condition); 5983 true_condition = NegateCondition(true_condition);
5892 } 5984 }
5893 return true_condition; 5985 return true_condition;
5894 } 5986 }
5895 5987
5896 5988
5989 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5990 __ Comment("StrictCompareInstr");
5991 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
5992
5993 Label is_true, is_false;
5994 BranchLabels labels = {&is_true, &is_false, &is_false};
5995 Condition true_condition = EmitComparisonCode(compiler, labels);
5996 EmitBranchOnCondition(compiler, true_condition, labels);
5997
5998 Register result = locs()->out(0).reg();
5999 Label done;
6000 __ Bind(&is_false);
6001 __ LoadObject(result, Bool::False());
6002 __ b(&done);
6003 __ Bind(&is_true);
6004 __ LoadObject(result, Bool::True());
6005 __ Bind(&done);
6006 }
6007
6008
6009 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
6010 BranchInstr* branch) {
6011 __ Comment("StrictCompareInstr::EmitBranchCode");
6012 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
6013
6014 BranchLabels labels = compiler->CreateBranchLabels(branch);
6015 Condition true_condition = EmitComparisonCode(compiler, labels);
6016 EmitBranchOnCondition(compiler, true_condition, labels);
6017 }
6018
6019
5897 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone, 6020 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
5898 bool opt) const { 6021 bool opt) const {
5899 return LocationSummary::Make(zone, 1, Location::RequiresRegister(), 6022 return LocationSummary::Make(zone, 1, Location::RequiresRegister(),
5900 LocationSummary::kNoCall); 6023 LocationSummary::kNoCall);
5901 } 6024 }
5902 6025
5903 6026
5904 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6027 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5905 Register value = locs()->in(0).reg(); 6028 Register value = locs()->in(0).reg();
5906 Register result = locs()->out(0).reg(); 6029 Register result = locs()->out(0).reg();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
5961 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), 6084 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
5962 kGrowRegExpStackRuntimeEntry, 1, locs()); 6085 kGrowRegExpStackRuntimeEntry, 1, locs());
5963 __ lw(result, Address(SP, 1 * kWordSize)); 6086 __ lw(result, Address(SP, 1 * kWordSize));
5964 __ addiu(SP, SP, Immediate(2 * kWordSize)); 6087 __ addiu(SP, SP, Immediate(2 * kWordSize));
5965 } 6088 }
5966 6089
5967 6090
5968 } // namespace dart 6091 } // namespace dart
5969 6092
5970 #endif // defined TARGET_ARCH_MIPS 6093 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698