| Index: runtime/vm/intermediate_language_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_ia32.cc (revision 11394)
|
| +++ runtime/vm/intermediate_language_ia32.cc (working copy)
|
| @@ -812,19 +812,9 @@
|
| Register index = locs()->in(1).reg();
|
| Register result = locs()->out().reg();
|
|
|
| - const DeoptReasonId deopt_reason =
|
| - (receiver_type() == kGrowableObjectArrayCid) ?
|
| - kDeoptLoadIndexedGrowableArray : kDeoptLoadIndexedFixedArray;
|
| -
|
| - Label* deopt = compiler->AddDeoptStub(original()->deopt_id(),
|
| - original()->try_index(),
|
| - deopt_reason);
|
| -
|
| switch (receiver_type()) {
|
| case kArrayCid:
|
| case kImmutableArrayCid:
|
| - __ cmpl(index, FieldAddress(receiver, Array::length_offset()));
|
| - __ j(ABOVE_EQUAL, deopt);
|
| // Note that index is Smi, i.e, times 2.
|
| ASSERT(kSmiTagShift == 1);
|
| __ movl(result, FieldAddress(receiver, index, TIMES_2, sizeof(RawArray)));
|
| @@ -832,10 +822,6 @@
|
|
|
| case kGrowableObjectArrayCid: {
|
| Register temp = locs()->temp(0).reg();
|
| -
|
| - __ cmpl(index,
|
| - FieldAddress(receiver, GrowableObjectArray::length_offset()));
|
| - __ j(ABOVE_EQUAL, deopt);
|
| __ movl(temp, FieldAddress(receiver, GrowableObjectArray::data_offset()));
|
| // Note that index is Smi, i.e, times 2.
|
| ASSERT(kSmiTagShift == 1);
|
| @@ -863,7 +849,6 @@
|
| if (receiver_type() == kGrowableObjectArrayCid) {
|
| locs->set_temp(0, Location::RequiresRegister());
|
| }
|
| - locs->set_out(Location::NoLocation());
|
| return locs;
|
| }
|
|
|
| @@ -873,15 +858,9 @@
|
| Register index = locs()->in(1).reg();
|
| Register value = locs()->in(2).reg();
|
|
|
| - Label* deopt = compiler->AddDeoptStub(original()->deopt_id(),
|
| - original()->try_index(),
|
| - kDeoptStoreIndexed);
|
| -
|
| switch (receiver_type()) {
|
| case kArrayCid:
|
| case kImmutableArrayCid:
|
| - __ cmpl(index, FieldAddress(receiver, Array::length_offset()));
|
| - __ j(ABOVE_EQUAL, deopt);
|
| // Note that index is Smi, i.e, times 2.
|
| ASSERT(kSmiTagShift == 1);
|
| if (this->value()->NeedsStoreBuffer()) {
|
| @@ -897,9 +876,6 @@
|
|
|
| case kGrowableObjectArrayCid: {
|
| Register temp = locs()->temp(0).reg();
|
| - __ cmpl(index,
|
| - FieldAddress(receiver, GrowableObjectArray::length_offset()));
|
| - __ j(ABOVE_EQUAL, deopt);
|
| __ movl(temp, FieldAddress(receiver, GrowableObjectArray::data_offset()));
|
| // Note that index is Smi, i.e, times 2.
|
| ASSERT(kSmiTagShift == 1);
|
| @@ -2369,6 +2345,37 @@
|
| }
|
|
|
|
|
| +LocationSummary* CheckArrayBoundComp::MakeLocationSummary() const {
|
| + return LocationSummary::Make(2,
|
| + Location::NoLocation(),
|
| + LocationSummary::kNoCall);
|
| +}
|
| +
|
| +
|
| +void CheckArrayBoundComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + Register receiver = locs()->in(0).reg();
|
| + Register index = locs()->in(1).reg();
|
| +
|
| + const DeoptReasonId deopt_reason =
|
| + (array_type() == kGrowableObjectArrayCid) ?
|
| + kDeoptLoadIndexedGrowableArray : kDeoptLoadIndexedFixedArray;
|
| + Label* deopt = compiler->AddDeoptStub(deopt_id(),
|
| + try_index(),
|
| + deopt_reason);
|
| + switch (array_type()) {
|
| + case kArrayCid:
|
| + case kImmutableArrayCid:
|
| + __ cmpl(index, FieldAddress(receiver, Array::length_offset()));
|
| + break;
|
| + case kGrowableObjectArrayCid:
|
| + __ cmpl(index,
|
| + FieldAddress(receiver, GrowableObjectArray::length_offset()));
|
| + break;
|
| + }
|
| + __ j(ABOVE_EQUAL, deopt);
|
| +}
|
| +
|
| +
|
| } // namespace dart
|
|
|
| #undef __
|
|
|