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 |