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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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_arm.cc ('k') | runtime/vm/intermediate_language_mips.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 locs->set_in(0, Location::RegisterOrConstant(left())); 256 locs->set_in(0, Location::RegisterOrConstant(left()));
257 // Only one input can be a constant operand. The case of two constant 257 // Only one input can be a constant operand. The case of two constant
258 // operands should be handled by constant propagation. 258 // operands should be handled by constant propagation.
259 // Only right can be a stack slot. 259 // Only right can be a stack slot.
260 locs->set_in(1, locs->in(0).IsConstant() 260 locs->set_in(1, locs->in(0).IsConstant()
261 ? Location::RequiresRegister() 261 ? Location::RequiresRegister()
262 : Location::RegisterOrConstant(right())); 262 : Location::RegisterOrConstant(right()));
263 locs->set_out(Location::RequiresRegister()); 263 locs->set_out(Location::RequiresRegister());
264 return locs; 264 return locs;
265 } 265 }
266 if (is_checked_strict_equal()) { 266 if (IsCheckedStrictEqual()) {
267 const intptr_t kNumTemps = 1; 267 const intptr_t kNumTemps = 1;
268 LocationSummary* locs = 268 LocationSummary* locs =
269 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 269 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
270 locs->set_in(0, Location::RequiresRegister()); 270 locs->set_in(0, Location::RequiresRegister());
271 locs->set_in(1, Location::RequiresRegister()); 271 locs->set_in(1, Location::RequiresRegister());
272 locs->set_temp(0, Location::RequiresRegister()); 272 locs->set_temp(0, Location::RequiresRegister());
273 locs->set_out(Location::RequiresRegister()); 273 locs->set_out(Location::RequiresRegister());
274 return locs; 274 return locs;
275 } 275 }
276 if (IsPolymorphic()) { 276 if (IsPolymorphic()) {
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 return; 799 return;
800 } 800 }
801 if (receiver_class_id() == kMintCid) { 801 if (receiver_class_id() == kMintCid) {
802 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch); 802 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch);
803 return; 803 return;
804 } 804 }
805 if (receiver_class_id() == kDoubleCid) { 805 if (receiver_class_id() == kDoubleCid) {
806 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch); 806 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch);
807 return; 807 return;
808 } 808 }
809 if (is_checked_strict_equal()) { 809 if (IsCheckedStrictEqual()) {
810 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch, 810 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch,
811 deopt_id()); 811 deopt_id());
812 return; 812 return;
813 } 813 }
814 if (IsPolymorphic()) { 814 if (IsPolymorphic()) {
815 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(), 815 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(),
816 deopt_id(), token_pos()); 816 deopt_id(), token_pos());
817 return; 817 return;
818 } 818 }
819 Register left = locs()->in(0).reg(); 819 Register left = locs()->in(0).reg();
(...skipping 19 matching lines...) Expand all
839 return; 839 return;
840 } 840 }
841 if (receiver_class_id() == kMintCid) { 841 if (receiver_class_id() == kMintCid) {
842 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch); 842 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch);
843 return; 843 return;
844 } 844 }
845 if (receiver_class_id() == kDoubleCid) { 845 if (receiver_class_id() == kDoubleCid) {
846 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch); 846 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
847 return; 847 return;
848 } 848 }
849 if (is_checked_strict_equal()) { 849 if (IsCheckedStrictEqual()) {
850 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch, 850 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch,
851 deopt_id()); 851 deopt_id());
852 return; 852 return;
853 } 853 }
854 if (IsPolymorphic()) { 854 if (IsPolymorphic()) {
855 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(), 855 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(),
856 deopt_id(), token_pos()); 856 deopt_id(), token_pos());
857 return; 857 return;
858 } 858 }
859 Register left = locs()->in(0).reg(); 859 Register left = locs()->in(0).reg();
(...skipping 3887 matching lines...) Expand 10 before | Expand all | Expand 10 after
4747 PcDescriptors::kOther, 4747 PcDescriptors::kOther,
4748 locs()); 4748 locs());
4749 __ Drop(2); // Discard type arguments and receiver. 4749 __ Drop(2); // Discard type arguments and receiver.
4750 } 4750 }
4751 4751
4752 } // namespace dart 4752 } // namespace dart
4753 4753
4754 #undef __ 4754 #undef __
4755 4755
4756 #endif // defined TARGET_ARCH_IA32 4756 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698