if (number_ == NameDictionary::kNotFound) return false;
property_details_ = GetHolder()->property_dictionary()->DetailsAt(number_);
- // Holes in dictionary cells are absent values unless marked as read-only.
+ // Holes in dictionary cells are absent values.
if (holder->IsGlobalObject() &&
- (property_details_.IsDeleted() ||
- (!property_details_.IsReadOnly() && FetchValue()->IsTheHole()))) {
+ (property_details_.IsDeleted() || FetchValue()->IsTheHole())) {
return false;
}
} else {
ASSERT(has_property_);
ASSERT_EQ(DATA, property_kind_);
Handle<Object> value = FetchValue();
- if (value->IsTheHole()) {
- ASSERT(property_details_.IsReadOnly());
- return factory()->undefined_value();
- }
return value;
}
// We should never get here to initialize a const with the hole
// value since a const declaration would conflict with the setter.
- ASSERT(!value->IsTheHole());
ASSERT(!structure->IsForeign());
if (structure->IsExecutableAccessorInfo()) {
// api style callbacks
Handle<Object> value(object->property_dictionary()->ValueAt(
result->GetDictionaryEntry()), isolate);
if (object->IsGlobalObject()) {
- value = Handle<Object>(Handle<PropertyCell>::cast(value)->value(), isolate);
+ value = handle(Handle<PropertyCell>::cast(value)->value(), isolate);
+ ASSERT(!value->IsTheHole());
}
ASSERT(!value->IsPropertyCell() && !value->IsCell());
return value;
isolate, interceptor->data(), *object, *object);
v8::NamedPropertySetterCallback setter =
v8::ToCData<v8::NamedPropertySetterCallback>(interceptor->setter());
- Handle<Object> value_unhole = value->IsTheHole()
- ? Handle<Object>(isolate->factory()->undefined_value()) : value;
- v8::Handle<v8::Value> result = args.Call(setter,
- v8::Utils::ToLocal(name_string),
- v8::Utils::ToLocal(value_unhole));
+ v8::Handle<v8::Value> result = args.Call(
+ setter, v8::Utils::ToLocal(name_string), v8::Utils::ToLocal(value));
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
if (!result.IsEmpty()) return value;
}
// properties where map transitions are handled.
ASSERT(!result->IsFound() ||
(result->holder() == this && result->IsFastPropertyType()));
- // Disallow caching for uninitialized constants. These can only
- // occur as fields.
- if (result->IsField() &&
- result->IsReadOnly() &&
- RawFastPropertyAt(result->GetFieldIndex())->IsTheHole()) {
- result->DisallowCaching();
- }
return;
}
Object* value = property_dictionary()->ValueAt(entry);
if (IsGlobalObject()) {
PropertyDetails d = property_dictionary()->DetailsAt(entry);
- if (d.IsDeleted()) {
+ if (d.IsDeleted() || PropertyCell::cast(value)->value()->IsTheHole()) {
result->NotFound();
return;
}
value = PropertyCell::cast(value)->value();
}
- // Make sure to disallow caching for uninitialized constants
- // found in the dictionary-mode objects.
- if (value->IsTheHole()) result->DisallowCaching();
result->DictionaryResult(this, entry);
return;
}
Handle<Object> value,
StrictMode strict_mode,
StoreFromKeyed store_mode) {
+ ASSERT(!value->IsTheHole());
Isolate* isolate = object->GetIsolate();
// Make sure that the top context does not change when doing callbacks or
ExtensibilityCheck extensibility_check,
StoreFromKeyed store_from_keyed,
ExecutableAccessorInfoHandling handling) {
+ ASSERT(!value->IsTheHole());
Isolate* isolate = object->GetIsolate();
// Make sure that the top context does not change when doing callbacks or
if (result.IsFound()) {
ASSERT(result.IsNormal());
ASSERT(result.holder() == this);
- Object* value = GetNormalizedProperty(&result);
- if (!value->IsTheHole()) return value;
+ return GetNormalizedProperty(&result);
}
return GetHeap()->undefined_value();
}
Handle<Object> value) {
Isolate* isolate = cell->GetIsolate();
Handle<HeapType> old_type(cell->type(), isolate);
- Handle<HeapType> new_type = value->IsTheHole()
- ? HeapType::Any(isolate)
- : HeapType::Constant(value, isolate);
+ Handle<HeapType> new_type = HeapType::Constant(value, isolate);
- if (new_type->Is(old_type)) {
- return old_type;
- }
+ if (new_type->Is(old_type)) return old_type;
cell->dependent_code()->DeoptimizeDependentCodeGroup(
isolate, DependentCode::kPropertyCellChangedGroup);
int index = keyed_lookup_cache->Lookup(receiver_map, key);
if (index != -1) {
// Doubles are not cached, so raw read the value.
- Object* value = receiver->RawFastPropertyAt(
+ return receiver->RawFastPropertyAt(
FieldIndex::ForKeyedLookupCacheIndex(*receiver_map, index));
- return value->IsTheHole()
- ? isolate->heap()->undefined_value()
- : value;
}
// Lookup cache miss. Perform lookup and update the cache if
// appropriate.
if (!receiver->IsGlobalObject()) return value;
value = PropertyCell::cast(value)->value();
if (!value->IsTheHole()) return value;
- // If value is the hole do the general lookup.
+ // If value is the hole (meaning, absent) do the general lookup.
}
}
} else if (FLAG_smi_only_arrays && key_obj->IsSmi()) {
if (!result->IsFound()) return value;
switch (result->type()) {
case NORMAL:
- value = JSObject::GetNormalizedProperty(
- handle(result->holder(), isolate), result);
- break;
+ return JSObject::GetNormalizedProperty(handle(result->holder(), isolate),
+ result);
case FIELD:
- value = JSObject::FastPropertyAt(handle(result->holder(), isolate),
- result->representation(),
- result->GetFieldIndex());
- break;
+ return JSObject::FastPropertyAt(handle(result->holder(), isolate),
+ result->representation(),
+ result->GetFieldIndex());
case CONSTANT:
return handle(result->GetConstant(), isolate);
case CALLBACKS: {
UNREACHABLE();
break;
}
- ASSERT(!value->IsTheHole() || result->IsReadOnly());
- return value->IsTheHole()
- ? Handle<Object>::cast(isolate->factory()->undefined_value()) : value;
+ return value;
}