Index: runtime/vm/intermediate_language_ia32.cc |
=================================================================== |
--- runtime/vm/intermediate_language_ia32.cc (revision 30058) |
+++ runtime/vm/intermediate_language_ia32.cc (working copy) |
@@ -326,18 +326,6 @@ |
} |
-static void EmitBranchOnValue(FlowGraphCompiler* compiler, |
- TargetEntryInstr* true_successor, |
- TargetEntryInstr* false_successor, |
- bool value) { |
- if (value && !compiler->CanFallThroughTo(true_successor)) { |
- __ jmp(compiler->GetJumpLabel(true_successor)); |
- } else if (!value && !compiler->CanFallThroughTo(false_successor)) { |
- __ jmp(compiler->GetJumpLabel(false_successor)); |
- } |
-} |
- |
- |
static void EmitBranchOnCondition(FlowGraphCompiler* compiler, |
TargetEntryInstr* true_successor, |
TargetEntryInstr* false_successor, |
@@ -632,7 +620,6 @@ |
BranchInstr* branch) { |
ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ)); |
if (operation_cid() == kSmiCid) { |
- // Deoptimizes if both arguments not Smi. |
EmitSmiComparisonOp(compiler, *locs(), kind(), branch); |
return; |
} |
@@ -4658,7 +4645,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())); |
locs->set_out(Location::RequiresRegister()); |
return locs; |
} |
@@ -4669,14 +4660,7 @@ |
ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
Location left = locs()->in(0); |
Location right = locs()->in(1); |
- if (left.IsConstant() && right.IsConstant()) { |
- // TODO(vegorov): should be eliminated earlier by constant propagation. |
- const bool result = (kind() == Token::kEQ_STRICT) ? |
- left.constant().raw() == right.constant().raw() : |
- left.constant().raw() != right.constant().raw(); |
- __ LoadObject(locs()->out().reg(), Bool::Get(result)); |
- return; |
- } |
+ ASSERT(!left.IsConstant() || !right.IsConstant()); |
if (left.IsConstant()) { |
compiler->EmitEqualityRegConstCompare(right.reg(), |
left.constant(), |
@@ -4711,17 +4695,7 @@ |
ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
Location left = locs()->in(0); |
Location right = locs()->in(1); |
- if (left.IsConstant() && right.IsConstant()) { |
- // TODO(vegorov): should be eliminated earlier by constant propagation. |
- const bool result = (kind() == Token::kEQ_STRICT) ? |
- left.constant().raw() == right.constant().raw() : |
- left.constant().raw() != right.constant().raw(); |
- EmitBranchOnValue(compiler, |
- branch->true_successor(), |
- branch->false_successor(), |
- result); |
- return; |
- } |
+ ASSERT(!left.IsConstant() || !right.IsConstant()); |
if (left.IsConstant()) { |
compiler->EmitEqualityRegConstCompare(right.reg(), |
left.constant(), |