Commit 367a1c18 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[runtime] Remove an obsolete path in PropertyCell code

Change-Id: I2c9f3ac81710b89543b392819a6cce03eaba6cae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536639
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71181}
parent fa0c2fa2
...@@ -6393,20 +6393,9 @@ PropertyCellType PropertyCell::UpdatedType(Isolate* isolate, ...@@ -6393,20 +6393,9 @@ PropertyCellType PropertyCell::UpdatedType(Isolate* isolate,
Handle<PropertyCell> cell, Handle<PropertyCell> cell,
Handle<Object> value, Handle<Object> value,
PropertyDetails details) { PropertyDetails details) {
PropertyCellType type = details.cell_type();
DCHECK(!value->IsTheHole(isolate)); DCHECK(!value->IsTheHole(isolate));
if (cell->value().IsTheHole(isolate)) { DCHECK(!cell->value().IsTheHole(isolate));
switch (type) { switch (details.cell_type()) {
// Only allow a cell to transition once into constant state.
case PropertyCellType::kUninitialized:
return TypeForUninitializedCell(isolate, value);
case PropertyCellType::kInvalidated:
return PropertyCellType::kMutable;
default:
UNREACHABLE();
}
}
switch (type) {
case PropertyCellType::kUndefined: case PropertyCellType::kUndefined:
return PropertyCellType::kConstant; return PropertyCellType::kConstant;
case PropertyCellType::kConstant: case PropertyCellType::kConstant:
...@@ -6428,20 +6417,12 @@ Handle<PropertyCell> PropertyCell::PrepareForValue( ...@@ -6428,20 +6417,12 @@ Handle<PropertyCell> PropertyCell::PrepareForValue(
Handle<Object> value, PropertyDetails details) { Handle<Object> value, PropertyDetails details) {
DCHECK(!value->IsTheHole(isolate)); DCHECK(!value->IsTheHole(isolate));
Handle<PropertyCell> cell(dictionary->CellAt(entry), isolate); Handle<PropertyCell> cell(dictionary->CellAt(entry), isolate);
CHECK(!cell->value().IsTheHole(isolate));
const PropertyDetails original_details = cell->property_details(); const PropertyDetails original_details = cell->property_details();
// Data accesses could be cached in ics or optimized code. // Data accesses could be cached in ics or optimized code.
bool invalidate = bool invalidate =
original_details.kind() == kData && details.kind() == kAccessor; original_details.kind() == kData && details.kind() == kAccessor;
int index; int index = original_details.dictionary_index();
PropertyCellType old_type = original_details.cell_type();
// Preserve the enumeration index unless the property was deleted or never
// initialized.
if (cell->value().IsTheHole(isolate)) {
index = GlobalDictionary::NextEnumerationIndex(isolate, dictionary);
dictionary->set_next_enumeration_index(index + 1);
} else {
index = original_details.dictionary_index();
}
DCHECK_LT(0, index); DCHECK_LT(0, index);
details = details.set_index(index); details = details.set_index(index);
...@@ -6464,7 +6445,7 @@ Handle<PropertyCell> PropertyCell::PrepareForValue( ...@@ -6464,7 +6445,7 @@ Handle<PropertyCell> PropertyCell::PrepareForValue(
} }
// Deopt when transitioning from a constant type. // Deopt when transitioning from a constant type.
if (!invalidate && (old_type != new_type || if (!invalidate && (original_details.cell_type() != new_type ||
original_details.IsReadOnly() != details.IsReadOnly())) { original_details.IsReadOnly() != details.IsReadOnly())) {
cell->dependent_code().DeoptimizeDependentCodeGroup( cell->dependent_code().DeoptimizeDependentCodeGroup(
DependentCode::kPropertyCellChangedGroup); DependentCode::kPropertyCellChangedGroup);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment