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

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

Issue 18053010: Equality can be converted to a strict equality with checks. If the number of checks exceeds the thr… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 295 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
296 locs->set_in(0, Location::RegisterOrConstant(left())); 296 locs->set_in(0, Location::RegisterOrConstant(left()));
297 // Only one input can be a constant operand. The case of two constant 297 // Only one input can be a constant operand. The case of two constant
298 // operands should be handled by constant propagation. 298 // operands should be handled by constant propagation.
299 locs->set_in(1, locs->in(0).IsConstant() 299 locs->set_in(1, locs->in(0).IsConstant()
300 ? Location::RequiresRegister() 300 ? Location::RequiresRegister()
301 : Location::RegisterOrConstant(right())); 301 : Location::RegisterOrConstant(right()));
302 locs->set_out(Location::RequiresRegister()); 302 locs->set_out(Location::RequiresRegister());
303 return locs; 303 return locs;
304 } 304 }
305 if (is_checked_strict_equal()) { 305 if (IsCheckedStrictEqual()) {
306 const intptr_t kNumTemps = 1; 306 const intptr_t kNumTemps = 1;
307 LocationSummary* locs = 307 LocationSummary* locs =
308 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 308 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
309 locs->set_in(0, Location::RequiresRegister()); 309 locs->set_in(0, Location::RequiresRegister());
310 locs->set_in(1, Location::RequiresRegister()); 310 locs->set_in(1, Location::RequiresRegister());
311 locs->set_temp(0, Location::RequiresRegister()); 311 locs->set_temp(0, Location::RequiresRegister());
312 locs->set_out(Location::RequiresRegister()); 312 locs->set_out(Location::RequiresRegister());
313 return locs; 313 return locs;
314 } 314 }
315 if (IsPolymorphic()) { 315 if (IsPolymorphic()) {
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 return; 797 return;
798 } 798 }
799 if (receiver_class_id() == kMintCid) { 799 if (receiver_class_id() == kMintCid) {
800 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch); 800 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch);
801 return; 801 return;
802 } 802 }
803 if (receiver_class_id() == kDoubleCid) { 803 if (receiver_class_id() == kDoubleCid) {
804 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch); 804 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch);
805 return; 805 return;
806 } 806 }
807 if (is_checked_strict_equal()) { 807 if (IsCheckedStrictEqual()) {
808 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch, 808 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch,
809 deopt_id()); 809 deopt_id());
810 return; 810 return;
811 } 811 }
812 if (IsPolymorphic()) { 812 if (IsPolymorphic()) {
813 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(), 813 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(),
814 deopt_id(), token_pos()); 814 deopt_id(), token_pos());
815 return; 815 return;
816 } 816 }
817 Register left = locs()->in(0).reg(); 817 Register left = locs()->in(0).reg();
(...skipping 24 matching lines...) Expand all
842 return; 842 return;
843 } 843 }
844 if (receiver_class_id() == kMintCid) { 844 if (receiver_class_id() == kMintCid) {
845 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch); 845 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch);
846 return; 846 return;
847 } 847 }
848 if (receiver_class_id() == kDoubleCid) { 848 if (receiver_class_id() == kDoubleCid) {
849 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch); 849 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
850 return; 850 return;
851 } 851 }
852 if (is_checked_strict_equal()) { 852 if (IsCheckedStrictEqual()) {
853 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch, 853 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch,
854 deopt_id()); 854 deopt_id());
855 return; 855 return;
856 } 856 }
857 if (IsPolymorphic()) { 857 if (IsPolymorphic()) {
858 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(), 858 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(),
859 deopt_id(), token_pos()); 859 deopt_id(), token_pos());
860 return; 860 return;
861 } 861 }
862 Register left = locs()->in(0).reg(); 862 Register left = locs()->in(0).reg();
(...skipping 2870 matching lines...) Expand 10 before | Expand all | Expand 10 after
3733 compiler->GenerateCall(token_pos(), 3733 compiler->GenerateCall(token_pos(),
3734 &label, 3734 &label,
3735 PcDescriptors::kOther, 3735 PcDescriptors::kOther,
3736 locs()); 3736 locs());
3737 __ Drop(2); // Discard type arguments and receiver. 3737 __ Drop(2); // Discard type arguments and receiver.
3738 } 3738 }
3739 3739
3740 } // namespace dart 3740 } // namespace dart
3741 3741
3742 #endif // defined TARGET_ARCH_MIPS 3742 #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