Index: runtime/vm/intermediate_language_mips.cc |
=================================================================== |
--- runtime/vm/intermediate_language_mips.cc (revision 38478) |
+++ runtime/vm/intermediate_language_mips.cc (working copy) |
@@ -1141,48 +1141,6 @@ |
} |
-static Address ElementAddressForIntIndex(bool is_external, |
- intptr_t cid, |
- intptr_t index_scale, |
- Register array, |
- intptr_t index) { |
- const int64_t offset = index * index_scale + |
- (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag)); |
- ASSERT(Utils::IsInt(32, offset)); |
- ASSERT(Address::CanHoldOffset(offset)); |
- return Address(array, static_cast<int32_t>(offset)); |
-} |
- |
- |
-static Address ElementAddressForRegIndex(Assembler* assembler, |
- bool is_load, |
- bool is_external, |
- intptr_t cid, |
- intptr_t index_scale, |
- Register array, |
- Register index) { |
- // Note that index is expected smi-tagged, (i.e, LSL 1) for all arrays. |
- const intptr_t shift = Utils::ShiftForPowerOfTwo(index_scale) - kSmiTagShift; |
- const int32_t offset = |
- is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag); |
- ASSERT(array != TMP); |
- ASSERT(index != TMP); |
- const Register base = is_load ? TMP : index; |
- if (shift < 0) { |
- ASSERT(shift == -1); |
- assembler->sra(TMP, index, 1); |
- assembler->addu(base, array, TMP); |
- } else if (shift == 0) { |
- assembler->addu(base, array, index); |
- } else { |
- assembler->sll(TMP, index, shift); |
- assembler->addu(base, array, TMP); |
- } |
- ASSERT(Address::CanHoldOffset(offset)); |
- return Address(base, offset); |
-} |
- |
- |
void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
__ TraceSimMsg("LoadIndexedInstr"); |
// The array register points to the backing store for external arrays. |
@@ -1190,12 +1148,12 @@ |
const Location index = locs()->in(1); |
Address element_address = index.IsRegister() |
- ? ElementAddressForRegIndex(compiler->assembler(), |
- true, // Load. |
- IsExternal(), class_id(), index_scale(), |
- array, index.reg()) |
- : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), |
- array, Smi::Cast(index.constant()).Value()); |
+ ? __ ElementAddressForRegIndex(true, // Load. |
+ IsExternal(), class_id(), index_scale(), |
+ array, index.reg()) |
+ : __ ElementAddressForIntIndex( |
+ IsExternal(), class_id(), index_scale(), |
+ array, Smi::Cast(index.constant()).Value()); |
// Warning: element_address may use register TMP as base. |
if ((representation() == kUnboxedDouble) || |
@@ -1364,12 +1322,12 @@ |
const Location index = locs()->in(1); |
Address element_address = index.IsRegister() |
- ? ElementAddressForRegIndex(compiler->assembler(), |
- false, // Store. |
- IsExternal(), class_id(), index_scale(), |
- array, index.reg()) |
- : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), |
- array, Smi::Cast(index.constant()).Value()); |
+ ? __ ElementAddressForRegIndex(false, // Store. |
+ IsExternal(), class_id(), index_scale(), |
+ array, index.reg()) |
+ : __ ElementAddressForIntIndex( |
+ IsExternal(), class_id(), index_scale(), |
+ array, Smi::Cast(index.constant()).Value()); |
switch (class_id()) { |
case kArrayCid: |