| Index: runtime/vm/intermediate_language_mips.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_mips.cc (revision 30058)
|
| +++ runtime/vm/intermediate_language_mips.cc (working copy)
|
| @@ -469,19 +469,6 @@
|
| }
|
|
|
|
|
| -static void EmitBranchOnValue(FlowGraphCompiler* compiler,
|
| - TargetEntryInstr* true_successor,
|
| - TargetEntryInstr* false_successor,
|
| - bool value) {
|
| - __ TraceSimMsg("ControlInstruction::EmitBranchOnValue");
|
| - if (value && !compiler->CanFallThroughTo(true_successor)) {
|
| - __ b(compiler->GetJumpLabel(true_successor));
|
| - } else if (!value && !compiler->CanFallThroughTo(false_successor)) {
|
| - __ b(compiler->GetJumpLabel(false_successor));
|
| - }
|
| -}
|
| -
|
| -
|
| // The comparison result is in CMPRES1.
|
| static void EmitBranchOnCondition(FlowGraphCompiler* compiler,
|
| TargetEntryInstr* true_successor,
|
| @@ -702,7 +689,6 @@
|
| __ Comment("EqualityCompareInstr:BranchCode");
|
| ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
|
| if (operation_cid() == kSmiCid) {
|
| - // Deoptimizes if both arguments not Smi.
|
| EmitSmiComparisonOp(compiler, *locs(), kind(), branch);
|
| return;
|
| }
|
| @@ -3822,7 +3808,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;
|
| }
|
| @@ -3835,14 +3825,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(),
|
| @@ -3882,17 +3865,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(),
|
|
|