| Index: runtime/vm/intermediate_language_mips.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_mips.cc (revision 22689)
|
| +++ runtime/vm/intermediate_language_mips.cc (working copy)
|
| @@ -2480,8 +2480,8 @@
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
|
| - locs->set_in(0, Location::RegisterOrSmiConstant(length()));
|
| - locs->set_in(1, Location::RegisterOrSmiConstant(index()));
|
| + locs->set_in(locLength, Location::RegisterOrSmiConstant(length()));
|
| + locs->set_in(locIndex, Location::RegisterOrSmiConstant(index()));
|
| return locs;
|
| }
|
|
|
| @@ -2489,28 +2489,31 @@
|
| void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Label* deopt = compiler->AddDeoptStub(deopt_id(),
|
| kDeoptCheckArrayBound);
|
| - if (locs()->in(0).IsConstant() && locs()->in(1).IsConstant()) {
|
| + if (locs()->in(locLength).IsConstant() && locs()->in(locIndex).IsConstant()) {
|
| + ASSERT((Smi::Cast(locs()->in(locLength).constant()).Value() <=
|
| + Smi::Cast(locs()->in(locIndex).constant()).Value()) ||
|
| + (Smi::Cast(locs()->in(locIndex).constant()).Value() < 0));
|
| // Unconditionally deoptimize for constant bounds checks because they
|
| // only occur only when index is out-of-bounds.
|
| __ b(deopt);
|
| return;
|
| }
|
|
|
| - if (locs()->in(1).IsConstant()) {
|
| - Register length = locs()->in(0).reg();
|
| - const Object& constant = locs()->in(1).constant();
|
| + if (locs()->in(locIndex).IsConstant()) {
|
| + Register length = locs()->in(locLength).reg();
|
| + const Object& constant = locs()->in(locIndex).constant();
|
| ASSERT(constant.IsSmi());
|
| __ BranchUnsignedLessEqual(
|
| length, reinterpret_cast<int32_t>(constant.raw()), deopt);
|
| - } else if (locs()->in(0).IsConstant()) {
|
| - ASSERT(locs()->in(0).constant().IsSmi());
|
| - const Smi& smi_const = Smi::Cast(locs()->in(0).constant());
|
| - Register index = locs()->in(1).reg();
|
| + } else if (locs()->in(locLength).IsConstant()) {
|
| + ASSERT(locs()->in(locLength).constant().IsSmi());
|
| + const Smi& smi_const = Smi::Cast(locs()->in(locLength).constant());
|
| + Register index = locs()->in(locIndex).reg();
|
| __ BranchUnsignedGreaterEqual(
|
| index, reinterpret_cast<int32_t>(smi_const.raw()), deopt);
|
| } else {
|
| - Register length = locs()->in(0).reg();
|
| - Register index = locs()->in(1).reg();
|
| + Register length = locs()->in(locLength).reg();
|
| + Register index = locs()->in(locIndex).reg();
|
| __ BranchUnsignedGreaterEqual(index, length, deopt);
|
| }
|
| }
|
|
|