CHECK_EQ(LookupIterator::ACCESSOR, it.state());
DCHECK(it.HolderIsReceiverOrHiddenPrototype());
it.ReconfigureDataProperty(value, it.property_details().attributes());
- value = it.WriteDataValue(value);
+ it.WriteDataValue(value);
if (is_observed && !old_value->SameValue(*value)) {
return JSObject::EnqueueChangeRecord(object, "update", name, old_value);
}
-Handle<Object> LookupIterator::WriteDataValue(Handle<Object> value) {
+void LookupIterator::WriteDataValue(Handle<Object> value) {
DCHECK_EQ(DATA, state_);
Handle<JSObject> holder = GetHolder<JSObject>();
if (holder_map_->is_dictionary_map()) {
Handle<NameDictionary> property_dictionary =
handle(holder->property_dictionary());
if (holder->IsGlobalObject()) {
- value = PropertyCell::UpdateCell(property_dictionary, dictionary_entry(),
- value, property_details_);
+ PropertyCell::UpdateCell(property_dictionary, dictionary_entry(), value,
+ property_details_);
} else {
property_dictionary->ValueAtPut(dictionary_entry(), *value);
}
} else {
DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type());
}
- return value;
}
it->PrepareForDataProperty(value);
// Write the property value.
- value = it->WriteDataValue(value);
+ it->WriteDataValue(value);
// Send the change record if there are observers.
if (is_observed && !value->SameValue(*maybe_old.ToHandleChecked())) {
JSObject::AddSlowProperty(receiver, it->name(), value, attributes);
} else {
// Write the property value.
- value = it->WriteDataValue(value);
+ it->WriteDataValue(value);
}
// Send the change record if there are observers.
}
it.ReconfigureDataProperty(value, attributes);
- value = it.WriteDataValue(value);
+ it.WriteDataValue(value);
if (is_observed) {
RETURN_ON_EXCEPTION(
if (is_observed) old_value = it.GetDataValue();
it.ReconfigureDataProperty(value, attributes);
- value = it.WriteDataValue(value);
+ it.WriteDataValue(value);
if (is_observed) {
if (old_value->SameValue(*value)) {
}
-Handle<Object> PropertyCell::UpdateCell(Handle<NameDictionary> dictionary,
- int entry, Handle<Object> value,
- PropertyDetails details) {
+void PropertyCell::UpdateCell(Handle<NameDictionary> dictionary, int entry,
+ Handle<Object> value, PropertyDetails details) {
DCHECK(!value->IsTheHole());
DCHECK(dictionary->ValueAt(entry)->IsPropertyCell());
Handle<PropertyCell> cell(PropertyCell::cast(dictionary->ValueAt(entry)));
DCHECK(index > 0);
details = details.set_index(index);
- // Heuristic: if a small-ish string is stored in a previously uninitialized
- // property cell, internalize it.
- const int kMaxLengthForInternalization = 200;
- if ((old_type == PropertyCellType::kUninitialized ||
- old_type == PropertyCellType::kUndefined) &&
- value->IsString()) {
- auto string = Handle<String>::cast(value);
- if (string->length() <= kMaxLengthForInternalization) {
- value = cell->GetIsolate()->factory()->InternalizeString(string);
- }
- }
-
auto new_type = UpdatedType(cell, value, original_details);
if (invalidate) cell = PropertyCell::InvalidateEntry(dictionary, entry);
cell->dependent_code()->DeoptimizeDependentCodeGroup(
isolate, DependentCode::kPropertyCellChangedGroup);
}
- return value;
}
static PropertyCellType UpdatedType(Handle<PropertyCell> cell,
Handle<Object> value,
PropertyDetails details);
- static Handle<Object> UpdateCell(Handle<NameDictionary> dictionary, int entry,
- Handle<Object> value,
- PropertyDetails details);
+ static void UpdateCell(Handle<NameDictionary> dictionary, int entry,
+ Handle<Object> value, PropertyDetails details);
static Handle<PropertyCell> InvalidateEntry(Handle<NameDictionary> dictionary,
int entry);