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

Side by Side Diff: runtime/vm/intermediate_language_arm.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.cc ('k') | runtime/vm/intermediate_language_ia32.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_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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
307 locs->set_in(0, Location::RegisterOrConstant(left())); 307 locs->set_in(0, Location::RegisterOrConstant(left()));
308 // Only one input can be a constant operand. The case of two constant 308 // Only one input can be a constant operand. The case of two constant
309 // operands should be handled by constant propagation. 309 // operands should be handled by constant propagation.
310 locs->set_in(1, locs->in(0).IsConstant() 310 locs->set_in(1, locs->in(0).IsConstant()
311 ? Location::RequiresRegister() 311 ? Location::RequiresRegister()
312 : Location::RegisterOrConstant(right())); 312 : Location::RegisterOrConstant(right()));
313 locs->set_out(Location::RequiresRegister()); 313 locs->set_out(Location::RequiresRegister());
314 return locs; 314 return locs;
315 } 315 }
316 if (is_checked_strict_equal()) { 316 if (IsCheckedStrictEqual()) {
317 const intptr_t kNumTemps = 1; 317 const intptr_t kNumTemps = 1;
318 LocationSummary* locs = 318 LocationSummary* locs =
319 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 319 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
320 locs->set_in(0, Location::RequiresRegister()); 320 locs->set_in(0, Location::RequiresRegister());
321 locs->set_in(1, Location::RequiresRegister()); 321 locs->set_in(1, Location::RequiresRegister());
322 locs->set_temp(0, Location::RequiresRegister()); 322 locs->set_temp(0, Location::RequiresRegister());
323 locs->set_out(Location::RequiresRegister()); 323 locs->set_out(Location::RequiresRegister());
324 return locs; 324 return locs;
325 } 325 }
326 if (IsPolymorphic()) { 326 if (IsPolymorphic()) {
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 return; 749 return;
750 } 750 }
751 if (receiver_class_id() == kMintCid) { 751 if (receiver_class_id() == kMintCid) {
752 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch); 752 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch);
753 return; 753 return;
754 } 754 }
755 if (receiver_class_id() == kDoubleCid) { 755 if (receiver_class_id() == kDoubleCid) {
756 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch); 756 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch);
757 return; 757 return;
758 } 758 }
759 if (is_checked_strict_equal()) { 759 if (IsCheckedStrictEqual()) {
760 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch, 760 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch,
761 deopt_id()); 761 deopt_id());
762 return; 762 return;
763 } 763 }
764 if (IsPolymorphic()) { 764 if (IsPolymorphic()) {
765 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(), 765 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(),
766 deopt_id(), token_pos()); 766 deopt_id(), token_pos());
767 return; 767 return;
768 } 768 }
769 Register left = locs()->in(0).reg(); 769 Register left = locs()->in(0).reg();
(...skipping 20 matching lines...) Expand all
790 return; 790 return;
791 } 791 }
792 if (receiver_class_id() == kMintCid) { 792 if (receiver_class_id() == kMintCid) {
793 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch); 793 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch);
794 return; 794 return;
795 } 795 }
796 if (receiver_class_id() == kDoubleCid) { 796 if (receiver_class_id() == kDoubleCid) {
797 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch); 797 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
798 return; 798 return;
799 } 799 }
800 if (is_checked_strict_equal()) { 800 if (IsCheckedStrictEqual()) {
801 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch, 801 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch,
802 deopt_id()); 802 deopt_id());
803 return; 803 return;
804 } 804 }
805 if (IsPolymorphic()) { 805 if (IsPolymorphic()) {
806 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(), 806 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(),
807 deopt_id(), token_pos()); 807 deopt_id(), token_pos());
808 return; 808 return;
809 } 809 }
810 Register left = locs()->in(0).reg(); 810 Register left = locs()->in(0).reg();
(...skipping 2783 matching lines...) Expand 10 before | Expand all | Expand 10 after
3594 compiler->GenerateCall(token_pos(), 3594 compiler->GenerateCall(token_pos(),
3595 &label, 3595 &label,
3596 PcDescriptors::kOther, 3596 PcDescriptors::kOther,
3597 locs()); 3597 locs());
3598 __ Drop(2); // Discard type arguments and receiver. 3598 __ Drop(2); // Discard type arguments and receiver.
3599 } 3599 }
3600 3600
3601 } // namespace dart 3601 } // namespace dart
3602 3602
3603 #endif // defined TARGET_ARCH_ARM 3603 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698