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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 62203018: Remove dead code from IfThenElse and StrictCompare in the compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 30390)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -4692,7 +4692,11 @@
LocationSummary* locs =
new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RegisterOrConstant(left()));
- locs->set_in(1, Location::RegisterOrConstant(right()));
+ // Only one of the inputs can be a constant. Choose register if the first one
+ // is a constant.
+ locs->set_in(1, locs->in(0).IsConstant()
+ ? Location::RequiresRegister()
+ : Location::RegisterOrConstant(right()));
// TODO(vegorov): support byte register constraints in the register allocator.
locs->set_out(Location::RegisterLocation(EDX));
return locs;
@@ -4705,18 +4709,6 @@
Location left = locs()->in(0);
Location right = locs()->in(1);
- if (left.IsConstant() && right.IsConstant()) {
- // TODO(srdjan): Determine why this instruction was not eliminated.
- bool result = (left.constant().raw() == right.constant().raw());
- if ((kind_ == Token::kNE_STRICT) || (kind_ == Token::kNE)) {
- result = !result;
- }
- __ movl(locs()->out().reg(),
- Immediate(reinterpret_cast<int32_t>(
- Smi::New(result ? if_true_ : if_false_))));
- return;
- }
-
ASSERT(!left.IsConstant() || !right.IsConstant());
// Clear upper part of the out register. We are going to use setcc on it
« 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