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

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

Issue 16813002: Make constant propagation to fold x == x and re-run type propagation for better range analysis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 deopt_id(), 297 deopt_id(),
298 kArgumentDefinitionTestRuntimeEntry, 298 kArgumentDefinitionTestRuntimeEntry,
299 locs()); 299 locs());
300 __ lw(result, Address(SP, 3 * kWordSize)); // Pop bool result. 300 __ lw(result, Address(SP, 3 * kWordSize)); // Pop bool result.
301 __ addiu(SP, SP, Immediate(4 * kWordSize)); 301 __ addiu(SP, SP, Immediate(4 * kWordSize));
302 } 302 }
303 303
304 304
305 LocationSummary* EqualityCompareInstr::MakeLocationSummary() const { 305 LocationSummary* EqualityCompareInstr::MakeLocationSummary() const {
306 const intptr_t kNumInputs = 2; 306 const intptr_t kNumInputs = 2;
307 const bool is_checked_strict_equal =
308 HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
309 if (receiver_class_id() == kMintCid) { 307 if (receiver_class_id() == kMintCid) {
310 const intptr_t kNumTemps = 1; 308 const intptr_t kNumTemps = 1;
311 LocationSummary* locs = 309 LocationSummary* locs =
312 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 310 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
313 locs->set_in(0, Location::RequiresFpuRegister()); 311 locs->set_in(0, Location::RequiresFpuRegister());
314 locs->set_in(1, Location::RequiresFpuRegister()); 312 locs->set_in(1, Location::RequiresFpuRegister());
315 locs->set_temp(0, Location::RequiresRegister()); 313 locs->set_temp(0, Location::RequiresRegister());
316 locs->set_out(Location::RequiresRegister()); 314 locs->set_out(Location::RequiresRegister());
317 return locs; 315 return locs;
318 } 316 }
(...skipping 12 matching lines...) Expand all
331 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 329 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
332 locs->set_in(0, Location::RegisterOrConstant(left())); 330 locs->set_in(0, Location::RegisterOrConstant(left()));
333 // Only one input can be a constant operand. The case of two constant 331 // Only one input can be a constant operand. The case of two constant
334 // operands should be handled by constant propagation. 332 // operands should be handled by constant propagation.
335 locs->set_in(1, locs->in(0).IsConstant() 333 locs->set_in(1, locs->in(0).IsConstant()
336 ? Location::RequiresRegister() 334 ? Location::RequiresRegister()
337 : Location::RegisterOrConstant(right())); 335 : Location::RegisterOrConstant(right()));
338 locs->set_out(Location::RequiresRegister()); 336 locs->set_out(Location::RequiresRegister());
339 return locs; 337 return locs;
340 } 338 }
341 if (is_checked_strict_equal) { 339 if (is_checked_strict_equal()) {
342 const intptr_t kNumTemps = 1; 340 const intptr_t kNumTemps = 1;
343 LocationSummary* locs = 341 LocationSummary* locs =
344 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 342 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
345 locs->set_in(0, Location::RequiresRegister()); 343 locs->set_in(0, Location::RequiresRegister());
346 locs->set_in(1, Location::RequiresRegister()); 344 locs->set_in(1, Location::RequiresRegister());
347 locs->set_temp(0, Location::RequiresRegister()); 345 locs->set_temp(0, Location::RequiresRegister());
348 locs->set_out(Location::RequiresRegister()); 346 locs->set_out(Location::RequiresRegister());
349 return locs; 347 return locs;
350 } 348 }
351 if (IsPolymorphic()) { 349 if (IsPolymorphic()) {
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 return; 748 return;
751 } 749 }
752 if (receiver_class_id() == kMintCid) { 750 if (receiver_class_id() == kMintCid) {
753 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch); 751 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch);
754 return; 752 return;
755 } 753 }
756 if (receiver_class_id() == kDoubleCid) { 754 if (receiver_class_id() == kDoubleCid) {
757 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch); 755 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch);
758 return; 756 return;
759 } 757 }
760 const bool is_checked_strict_equal = 758 if (is_checked_strict_equal()) {
761 HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
762 if (is_checked_strict_equal) {
763 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch, 759 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch,
764 deopt_id()); 760 deopt_id());
765 return; 761 return;
766 } 762 }
767 if (IsPolymorphic()) { 763 if (IsPolymorphic()) {
768 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(), 764 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(),
769 deopt_id(), token_pos()); 765 deopt_id(), token_pos());
770 return; 766 return;
771 } 767 }
772 Register left = locs()->in(0).reg(); 768 Register left = locs()->in(0).reg();
(...skipping 23 matching lines...) Expand all
796 return; 792 return;
797 } 793 }
798 if (receiver_class_id() == kMintCid) { 794 if (receiver_class_id() == kMintCid) {
799 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch); 795 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch);
800 return; 796 return;
801 } 797 }
802 if (receiver_class_id() == kDoubleCid) { 798 if (receiver_class_id() == kDoubleCid) {
803 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch); 799 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
804 return; 800 return;
805 } 801 }
806 const bool is_checked_strict_equal = 802 if (is_checked_strict_equal()) {
807 HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
808 if (is_checked_strict_equal) {
809 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch, 803 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch,
810 deopt_id()); 804 deopt_id());
811 return; 805 return;
812 } 806 }
813 if (IsPolymorphic()) { 807 if (IsPolymorphic()) {
814 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(), 808 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(),
815 deopt_id(), token_pos()); 809 deopt_id(), token_pos());
816 return; 810 return;
817 } 811 }
818 Register left = locs()->in(0).reg(); 812 Register left = locs()->in(0).reg();
(...skipping 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after
3308 compiler->GenerateCall(token_pos(), 3302 compiler->GenerateCall(token_pos(),
3309 &label, 3303 &label,
3310 PcDescriptors::kOther, 3304 PcDescriptors::kOther,
3311 locs()); 3305 locs());
3312 __ Drop(2); // Discard type arguments and receiver. 3306 __ Drop(2); // Discard type arguments and receiver.
3313 } 3307 }
3314 3308
3315 } // namespace dart 3309 } // namespace dart
3316 3310
3317 #endif // defined TARGET_ARCH_MIPS 3311 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698