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

Unified Diff: src/objects.cc

Issue 1255133002: [stubs] Properly handle read-only properties in StoreGlobalViaContextStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 years, 5 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 | « src/mips64/code-stubs-mips64.cc ('k') | src/property-details.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 4227b7f190bc04bb96874e5197dab45e8210d68a..2e1443ab47ed246fd65e657905f35b21568169ba 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -15816,6 +15816,8 @@ Handle<PropertyCell> PropertyCell::InvalidateEntry(
} else {
cell->set_value(isolate->heap()->the_hole_value());
}
+ details = details.set_cell_type(PropertyCellType::kInvalidated);
+ cell->set_property_details(details);
cell->dependent_code()->DeoptimizeDependentCodeGroup(
isolate, DependentCode::kPropertyCellChangedGroup);
return new_cell;
@@ -15887,9 +15889,7 @@ void PropertyCell::UpdateCell(Handle<GlobalDictionary> dictionary, int entry,
const PropertyDetails original_details = cell->property_details();
// Data accesses could be cached in ics or optimized code.
bool invalidate =
- (original_details.kind() == kData && details.kind() == kAccessor) ||
- ((original_details.attributes() & READ_ONLY) !=
- (details.attributes() & READ_ONLY));
+ original_details.kind() == kData && details.kind() == kAccessor;
int index = original_details.dictionary_index();
PropertyCellType old_type = original_details.cell_type();
// Preserve the enumeration index unless the property was deleted or never
@@ -15912,8 +15912,9 @@ void PropertyCell::UpdateCell(Handle<GlobalDictionary> dictionary, int entry,
cell->set_value(*value);
// Deopt when transitioning from a constant type.
- if (!invalidate && (old_type != new_type)) {
- auto isolate = dictionary->GetIsolate();
+ if (!invalidate && (old_type != new_type ||
+ original_details.IsReadOnly() != details.IsReadOnly())) {
+ Isolate* isolate = dictionary->GetIsolate();
cell->dependent_code()->DeoptimizeDependentCodeGroup(
isolate, DependentCode::kPropertyCellChangedGroup);
}
@@ -15930,5 +15931,6 @@ void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
isolate, DependentCode::kPropertyCellChangedGroup);
}
}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698