Index: runtime/vm/redundancy_elimination.cc |
diff --git a/runtime/vm/redundancy_elimination.cc b/runtime/vm/redundancy_elimination.cc |
index 01a6ce46b012f7305812818774316adf1a3d3073..adc131995d27c87fd9ca5f9c5cdd683056dbd1af 100644 |
--- a/runtime/vm/redundancy_elimination.cc |
+++ b/runtime/vm/redundancy_elimination.cc |
@@ -481,12 +481,13 @@ class Place : public ValueObject { |
} |
bool SameField(const Place* other) const { |
- return (kind() == kField) ? (field().raw() == other->field().raw()) |
- : (offset_in_bytes_ == other->offset_in_bytes_); |
+ return (kind() == kField) ? |
+ (field().Original() == other->field().Original()) : |
+ (offset_in_bytes_ == other->offset_in_bytes_); |
} |
intptr_t FieldHashcode() const { |
- return (kind() == kField) ? reinterpret_cast<intptr_t>(field().raw()) |
+ return (kind() == kField) ? reinterpret_cast<intptr_t>(field().Original()) |
: offset_in_bytes_; |
} |
@@ -3085,6 +3086,8 @@ void AllocationSinking::DetachMaterializations() { |
// Add a field/offset to the list of fields if it is not yet present there. |
static bool AddSlot(ZoneGrowableArray<const Object*>* slots, |
const Object& slot) { |
+ ASSERT(slot.IsSmi() || slot.IsField()); |
+ ASSERT(!slot.IsField() || Field::Cast(slot).IsOriginal()); |
for (intptr_t i = 0; i < slots->length(); i++) { |
if ((*slots)[i]->raw() == slot.raw()) { |
return false; |
@@ -3281,7 +3284,7 @@ void AllocationSinking::InsertMaterializations(Definition* alloc) { |
StoreInstanceFieldInstr* store = use->instruction()->AsStoreInstanceField(); |
if ((store != NULL) && (store->instance()->definition() == alloc)) { |
if (!store->field().IsNull()) { |
- AddSlot(slots, store->field()); |
+ AddSlot(slots, Field::ZoneHandle(Z, store->field().Original())); |
} else { |
AddSlot(slots, Smi::ZoneHandle(Z, Smi::New(store->offset_in_bytes()))); |
} |