| Index: runtime/vm/intermediate_language_x64.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_x64.cc (revision 36535)
|
| +++ runtime/vm/intermediate_language_x64.cc (working copy)
|
| @@ -955,26 +955,16 @@
|
| Register array = locs()->in(0).reg();
|
| Location index = locs()->in(1);
|
|
|
| - const bool is_external =
|
| - (this->array()->definition()->representation() == kUntagged);
|
| Address element_address(kNoRegister, 0);
|
| + element_address = index.IsRegister()
|
| + ? compiler->ElementAddressForRegIndex(
|
| + true, // Load.
|
| + IsExternal(), class_id(), index_scale(), array, index.reg())
|
| + : compiler->ElementAddressForIntIndex(
|
| + true, // Load.
|
| + IsExternal(), class_id(), index_scale(), array,
|
| + Smi::Cast(index.constant()).Value());
|
|
|
| - if (is_external) {
|
| - element_address = index.IsRegister()
|
| - ? compiler->ExternalElementAddressForRegIndex(
|
| - index_scale(), array, index.reg())
|
| - : compiler->ExternalElementAddressForIntIndex(
|
| - index_scale(), array, Smi::Cast(index.constant()).Value());
|
| - } else {
|
| - ASSERT(this->array()->definition()->representation() == kTagged);
|
| - element_address = index.IsRegister()
|
| - ? compiler->ElementAddressForRegIndex(
|
| - class_id(), index_scale(), array, index.reg())
|
| - : compiler->ElementAddressForIntIndex(
|
| - class_id(), index_scale(), array,
|
| - Smi::Cast(index.constant()).Value());
|
| - }
|
| -
|
| if ((representation() == kUnboxedDouble) ||
|
| (representation() == kUnboxedFloat32x4) ||
|
| (representation() == kUnboxedInt32x4) ||
|
| @@ -1138,24 +1128,15 @@
|
| Register array = locs()->in(0).reg();
|
| Location index = locs()->in(1);
|
|
|
| - const bool is_external =
|
| - (this->array()->definition()->representation() == kUntagged);
|
| Address element_address(kNoRegister, 0);
|
| - if (is_external) {
|
| - element_address = index.IsRegister()
|
| - ? compiler->ExternalElementAddressForRegIndex(
|
| - index_scale(), array, index.reg())
|
| - : compiler->ExternalElementAddressForIntIndex(
|
| - index_scale(), array, Smi::Cast(index.constant()).Value());
|
| - } else {
|
| - ASSERT(this->array()->definition()->representation() == kTagged);
|
| - element_address = index.IsRegister()
|
| - ? compiler->ElementAddressForRegIndex(
|
| - class_id(), index_scale(), array, index.reg())
|
| - : compiler->ElementAddressForIntIndex(
|
| - class_id(), index_scale(), array,
|
| - Smi::Cast(index.constant()).Value());
|
| - }
|
| + element_address = index.IsRegister()
|
| + ? compiler->ElementAddressForRegIndex(
|
| + false, // Store.
|
| + IsExternal(), class_id(), index_scale(), array, index.reg())
|
| + : compiler->ElementAddressForIntIndex(
|
| + false, // Store.
|
| + IsExternal(), class_id(), index_scale(), array,
|
| + Smi::Cast(index.constant()).Value());
|
|
|
| if ((index_scale() == 1) && index.IsRegister()) {
|
| __ SmiUntag(index.reg());
|
|
|