Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: runtime/vm/redundancy_elimination.cc

Issue 1722733002: In background compilation make a copy of Field in order to freeze its state (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: s Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())));
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698