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,
Handle<PropertyCell> cell,
Handle<Object> value,
PropertyDetails details) {
PropertyCellType type = details.cell_type();
DCHECK(!value->IsTheHole(isolate));
if (cell->value().IsTheHole(isolate)) {
switch (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) {
DCHECK(!cell->value().IsTheHole(isolate));
switch (details.cell_type()) {
case PropertyCellType::kUndefined:
return PropertyCellType::kConstant;
case PropertyCellType::kConstant:
......@@ -6428,20 +6417,12 @@ Handle<PropertyCell> PropertyCell::PrepareForValue(
Handle<Object> value, PropertyDetails details) {
DCHECK(!value->IsTheHole(isolate));
Handle<PropertyCell> cell(dictionary->CellAt(entry), isolate);
CHECK(!cell->value().IsTheHole(isolate));
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;
int 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();
}
int index = original_details.dictionary_index();
DCHECK_LT(0, index);
details = details.set_index(index);
......@@ -6464,7 +6445,7 @@ Handle<PropertyCell> PropertyCell::PrepareForValue(
}
// 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())) {
cell->dependent_code().DeoptimizeDependentCodeGroup(
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