}
-void Object::Lookup(Name* name, LookupResult* result) {
+void Object::Lookup(Handle<Name> name, LookupResult* result) {
+ DisallowHeapAllocation no_gc;
Object* holder = NULL;
if (IsJSReceiver()) {
holder = this;
Handle<Name> name,
PropertyAttributes* attributes) {
LookupResult lookup(name->GetIsolate());
- object->Lookup(*name, &lookup);
+ object->Lookup(name, &lookup);
MaybeHandle<Object> result =
GetProperty(object, receiver, &lookup, name, attributes);
ASSERT(*attributes <= ABSENT);
case CONSTANT: {
// Search ALL_CAN_READ accessors in prototype chain.
LookupResult r(isolate);
- result->holder()->LookupRealNamedPropertyInPrototypes(*name, &r);
+ result->holder()->LookupRealNamedPropertyInPrototypes(name, &r);
if (r.IsProperty()) {
return GetPropertyWithFailedAccessCheck(
object, receiver, &r, name, attributes);
// If the object has an interceptor, try real named properties.
// No access check in GetPropertyAttributeWithInterceptor.
LookupResult r(isolate);
- result->holder()->LookupRealNamedProperty(*name, &r);
+ result->holder()->LookupRealNamedProperty(name, &r);
if (r.IsProperty()) {
return GetPropertyWithFailedAccessCheck(
object, receiver, &r, name, attributes);
if (!continue_search) break;
// Search ALL_CAN_READ accessors in prototype chain.
LookupResult r(object->GetIsolate());
- result->holder()->LookupRealNamedPropertyInPrototypes(*name, &r);
+ result->holder()->LookupRealNamedPropertyInPrototypes(name, &r);
if (r.IsProperty()) {
return GetPropertyAttributeWithFailedAccessCheck(
object, &r, name, continue_search);
// No access check in GetPropertyAttributeWithInterceptor.
LookupResult r(object->GetIsolate());
if (continue_search) {
- result->holder()->LookupRealNamedProperty(*name, &r);
+ result->holder()->LookupRealNamedProperty(name, &r);
} else {
- result->holder()->LocalLookupRealNamedProperty(*name, &r);
+ result->holder()->LocalLookupRealNamedProperty(name, &r);
}
if (!r.IsFound()) break;
return GetPropertyAttributeWithFailedAccessCheck(
// Check local property, ignore interceptor.
Isolate* isolate = object->GetIsolate();
LookupResult result(isolate);
- object->LocalLookupRealNamedProperty(*name, &result);
+ object->LocalLookupRealNamedProperty(name, &result);
if (!result.IsFound()) {
object->map()->LookupTransition(*object, *name, &result);
}
StrictMode strict_mode,
StoreFromKeyed store_mode) {
LookupResult result(object->GetIsolate());
- object->LocalLookup(*name, &result, true);
+ object->LocalLookup(name, &result, true);
if (!result.IsFound()) {
object->map()->LookupTransition(JSObject::cast(*object), *name, &result);
}
// accessor that wants to handle the property, or whether the property is
// read-only on the prototype chain.
LookupResult result(isolate);
- object->LookupRealNamedPropertyInPrototypes(*name, &result);
+ object->LookupRealNamedPropertyInPrototypes(name, &result);
if (result.IsFound()) {
switch (result.type()) {
case NORMAL:
}
-void JSObject::LocalLookupRealNamedProperty(Name* name, LookupResult* result) {
+void JSObject::LocalLookupRealNamedProperty(Handle<Name> name,
+ LookupResult* result) {
DisallowHeapAllocation no_gc;
if (IsJSGlobalProxy()) {
Object* proto = GetPrototype();
}
if (HasFastProperties()) {
- map()->LookupDescriptor(this, name, result);
+ map()->LookupDescriptor(this, *name, result);
// A property or a map transition was found. We return all of these result
// types because LocalLookupRealNamedProperty is used when setting
// properties where map transitions are handled.
}
-void JSObject::LookupRealNamedProperty(Name* name, LookupResult* result) {
+void JSObject::LookupRealNamedProperty(Handle<Name> name,
+ LookupResult* result) {
+ DisallowHeapAllocation no_gc;
LocalLookupRealNamedProperty(name, result);
if (result->IsFound()) return;
}
-void JSObject::LookupRealNamedPropertyInPrototypes(Name* name,
+void JSObject::LookupRealNamedPropertyInPrototypes(Handle<Name> name,
LookupResult* result) {
+ DisallowHeapAllocation no_gc;
Isolate* isolate = GetIsolate();
Heap* heap = isolate->heap();
for (Object* pt = GetPrototype();
bool check_prototype,
StrictMode strict_mode) {
if (check_prototype && !result->IsProperty()) {
- object->LookupRealNamedPropertyInPrototypes(*name, result);
+ object->LookupRealNamedPropertyInPrototypes(name, result);
}
if (result->IsProperty()) {
// Try lookup real named properties. Note that only property can be
// set is callbacks marked as ALL_CAN_WRITE on the prototype chain.
LookupResult r(object->GetIsolate());
- object->LookupRealNamedProperty(*name, &r);
+ object->LookupRealNamedProperty(name, &r);
if (r.IsProperty()) {
return SetPropertyWithFailedAccessCheck(object,
&r,
EnqueueChangeRecord(object, "add", name, old_value);
} else {
LookupResult new_lookup(isolate);
- object->LocalLookup(*name, &new_lookup, true);
+ object->LocalLookup(name, &new_lookup, true);
if (new_lookup.IsDataProperty()) {
Handle<Object> new_value =
Object::GetPropertyOrElement(object, name).ToHandleChecked();
AssertNoContextChange ncc(isolate);
LookupResult lookup(isolate);
- object->LocalLookup(*name, &lookup, true);
+ object->LocalLookup(name, &lookup, true);
if (!lookup.IsFound()) {
object->map()->LookupTransition(*object, *name, &lookup);
}
if (lookup.IsInterceptor() ||
(lookup.IsDescriptorOrDictionary() && lookup.type() == CALLBACKS)) {
- object->LocalLookupRealNamedProperty(*name, &lookup);
+ object->LocalLookupRealNamedProperty(name, &lookup);
}
// Check for accessor in prototype chain removed here in clone.
EnqueueChangeRecord(object, "reconfigure", name, old_value);
} else {
LookupResult new_lookup(isolate);
- object->LocalLookup(*name, &new_lookup, true);
+ object->LocalLookup(name, &new_lookup, true);
bool value_changed = false;
if (new_lookup.IsDataProperty()) {
Handle<Object> new_value =
// Check local property, ignore interceptor.
Isolate* isolate = object->GetIsolate();
LookupResult result(isolate);
- object->LocalLookupRealNamedProperty(*name, &result);
+ object->LocalLookupRealNamedProperty(name, &result);
if (result.IsFound()) return result.GetAttributes();
if (continue_search) {
}
// Named property.
LookupResult lookup(object->GetIsolate());
- object->Lookup(*key, &lookup);
+ object->Lookup(key, &lookup);
return GetPropertyAttributeForResult(object, receiver, &lookup, key, true);
}
}
// Named property.
LookupResult lookup(object->GetIsolate());
- object->LocalLookup(*name, &lookup, true);
+ object->LocalLookup(name, &lookup, true);
return GetPropertyAttributeForResult(object, object, &lookup, name, false);
}
return GetHeap()->undefined_value();
}
} else {
- LookupResult result(GetIsolate());
- LocalLookupRealNamedProperty(GetHeap()->hidden_string(), &result);
+ Isolate* isolate = GetIsolate();
+ LookupResult result(isolate);
+ LocalLookupRealNamedProperty(isolate->factory()->hidden_string(), &result);
if (result.IsFound()) {
ASSERT(result.IsNormal());
ASSERT(result.holder() == this);
// Check local property, ignore interceptor.
Isolate* isolate = object->GetIsolate();
LookupResult result(isolate);
- object->LocalLookupRealNamedProperty(*name, &result);
+ object->LocalLookupRealNamedProperty(name, &result);
if (!result.IsFound()) return isolate->factory()->true_value();
// Normalize object if needed.
}
LookupResult lookup(isolate);
- object->LocalLookup(*name, &lookup, true);
+ object->LocalLookup(name, &lookup, true);
if (!lookup.IsFound()) return isolate->factory()->true_value();
// Ignore attributes if forcing a deletion.
if (lookup.IsDontDelete() && mode != FORCE_DELETION) {
LookupResult lookup(isolate);
{
DisallowHeapAllocation no_allocation;
- object->LookupRealNamedProperty(*key, &lookup);
+ object->LookupRealNamedProperty(key, &lookup);
}
Handle<Object> result = isolate->factory()->undefined_value();
if (lookup.IsFound() && !lookup.IsTransition()) {
void JSReceiver::LocalLookup(
- Name* name, LookupResult* result, bool search_hidden_prototypes) {
+ Handle<Name> name, LookupResult* result, bool search_hidden_prototypes) {
+ DisallowHeapAllocation no_gc;
ASSERT(name->IsName());
- Heap* heap = GetHeap();
-
if (IsJSGlobalProxy()) {
Object* proto = GetPrototype();
if (proto->IsNull()) return result->NotFound();
// Check for lookup interceptor except when bootstrapping.
if (js_object->HasNamedInterceptor() &&
- !heap->isolate()->bootstrapper()->IsActive()) {
+ !GetIsolate()->bootstrapper()->IsActive()) {
result->InterceptorResult(js_object);
return;
}
}
-void JSReceiver::Lookup(Name* name, LookupResult* result) {
+void JSReceiver::Lookup(Handle<Name> name, LookupResult* result) {
+ DisallowHeapAllocation no_gc;
// Ecma-262 3rd 8.6.2.4
- Heap* heap = GetHeap();
+ Handle<Object> null_value = GetIsolate()->factory()->null_value();
for (Object* current = this;
- current != heap->null_value();
+ current != *null_value;
current = JSObject::cast(current)->GetPrototype()) {
JSReceiver::cast(current)->LocalLookup(name, result, false);
if (result->IsFound()) return;
// Search object and its prototype chain for callback properties.
-void JSObject::LookupCallbackProperty(Name* name, LookupResult* result) {
- Heap* heap = GetHeap();
+void JSObject::LookupCallbackProperty(Handle<Name> name, LookupResult* result) {
+ DisallowHeapAllocation no_gc;
+ Handle<Object> null_value = GetIsolate()->factory()->null_value();
for (Object* current = this;
- current != heap->null_value() && current->IsJSObject();
+ current != *null_value && current->IsJSObject();
current = JSObject::cast(current)->GetPrototype()) {
JSObject::cast(current)->LocalLookupRealNamedProperty(name, result);
if (result->IsPropertyCallbacks()) return;
Handle<Name> name) {
Isolate* isolate = object->GetIsolate();
LookupResult result(isolate);
- object->LocalLookupRealNamedProperty(*name, &result);
+ object->LocalLookupRealNamedProperty(name, &result);
if (result.IsPropertyCallbacks()) {
// Note that the result can actually have IsDontDelete() == true when we
// e.g. have to fall back to the slow case while adding a setter after
// to be overwritten because allowing overwriting could potentially
// cause security problems.
LookupResult callback_result(isolate);
- object->LookupCallbackProperty(*name, &callback_result);
+ object->LookupCallbackProperty(name, &callback_result);
if (callback_result.IsFound()) {
Object* callback_obj = callback_result.GetCallbackObject();
if (callback_obj->IsAccessorInfo()) {
}
} else {
LookupResult lookup(isolate);
- object->LocalLookup(*name, &lookup, true);
+ object->LocalLookup(name, &lookup, true);
preexists = lookup.IsProperty();
if (preexists && lookup.IsDataProperty()) {
old_value =
ASSERT(accessor->IsSpecFunction() || accessor->IsUndefined());
Isolate* isolate = object->GetIsolate();
LookupResult result(isolate);
- object->LocalLookup(*name, &result);
+ object->LocalLookup(name, &result);
if (result.IsFound() && !result.IsPropertyCallbacks()) {
return false;
} else {
// Lookup the name.
LookupResult result(isolate);
- object->LocalLookup(*name, &result, true);
+ object->LocalLookup(name, &result, true);
// ES5 forbids turning a property into an accessor if it's not
// configurable (that is IsDontDelete in ES3 and v8), see 8.6.1 (Table 5).
if (result.IsFound() && (result.IsReadOnly() || result.IsDontDelete())) {
!obj->IsNull();
obj = handle(JSReceiver::cast(*obj)->GetPrototype(), isolate)) {
LookupResult result(isolate);
- JSReceiver::cast(*obj)->LocalLookup(*name, &result);
+ JSReceiver::cast(*obj)->LocalLookup(name, &result);
if (result.IsFound()) {
if (result.IsReadOnly()) return isolate->factory()->undefined_value();
if (result.IsPropertyCallbacks()) {
Isolate* isolate = object->GetIsolate();
LookupResult lookup(isolate);
- object->LocalLookupRealNamedProperty(*name, &lookup);
+ object->LocalLookupRealNamedProperty(name, &lookup);
if (lookup.IsPropertyCallbacks() &&
lookup.GetCallbackObject()->IsAccessorPair()) {
// Check local property in holder, ignore interceptor.
Isolate* isolate = object->GetIsolate();
LookupResult lookup(isolate);
- object->LocalLookupRealNamedProperty(*name, &lookup);
+ object->LocalLookupRealNamedProperty(name, &lookup);
if (lookup.IsFound()) {
return GetProperty(object, receiver, &lookup, name, attributes);
} else {
}
LookupResult result(isolate);
- object->LocalLookupRealNamedProperty(*key, &result);
+ object->LocalLookupRealNamedProperty(key, &result);
return result.IsFound() && !result.IsInterceptor();
}
}
LookupResult result(isolate);
- object->LocalLookupRealNamedProperty(*key, &result);
+ object->LocalLookupRealNamedProperty(key, &result);
return result.IsPropertyCallbacks();
}
}
-// TODO(ishell): Remove this when all the callers are handlified.
-int NameDictionary::FindEntry(Name* key) {
- DisallowHeapAllocation no_allocation;
- Isolate* isolate = key->GetIsolate();
- HandleScope scope(isolate);
- return FindEntry(handle(key, isolate));
-}
-
-
// Find entry for key otherwise return kNotFound.
int NameDictionary::FindEntry(Handle<Name> key) {
if (!key->IsUniqueName()) {
Isolate* isolate = obj->GetIsolate();
LookupResult lookup(isolate);
- obj->LocalLookup(*name, &lookup, true);
+ obj->LocalLookup(name, &lookup, true);
if (!lookup.IsProperty()) return ACCESS_ABSENT;
Handle<JSObject> holder(lookup.holder(), isolate);
case INTERCEPTOR:
// If the object has an interceptor, try real named properties.
// Overwrite the result to fetch the correct property later.
- holder->LookupRealNamedProperty(*name, &lookup);
+ holder->LookupRealNamedProperty(name, &lookup);
if (lookup.IsProperty() && lookup.IsPropertyCallbacks()) {
if (CheckAccessException(lookup.GetCallbackObject(), access_type)) {
return ACCESS_ALLOWED;
// value of the variable if the property is already there.
// Do the lookup locally only, see ES5 erratum.
LookupResult lookup(isolate);
- global->LocalLookup(*name, &lookup, true);
+ global->LocalLookup(name, &lookup, true);
if (lookup.IsFound()) {
// We found an existing property. Unless it was an interceptor
// that claims the property is absent, skip this declaration.
}
LookupResult lookup(isolate);
- global->LocalLookup(*name, &lookup, true);
+ global->LocalLookup(name, &lookup, true);
// Compute the property attributes. According to ECMA-262,
// the property must be non-configurable except in eval.
if (initial_value->IsTheHole() &&
!object->IsJSContextExtensionObject()) {
LookupResult lookup(isolate);
- object->Lookup(*name, &lookup);
+ object->Lookup(name, &lookup);
if (lookup.IsPropertyCallbacks()) {
return ThrowRedeclarationError(isolate, name);
}
// Note that objects can have hidden prototypes, so we need to traverse
// the whole chain of hidden prototypes to do a 'local' lookup.
LookupResult lookup(isolate);
- isolate->context()->global_object()->LocalLookup(*name, &lookup, true);
+ isolate->context()->global_object()->LocalLookup(name, &lookup, true);
if (lookup.IsInterceptor()) {
Handle<JSObject> holder(lookup.holder());
PropertyAttributes intercepted =
// prototype chain (this rules out using SetProperty).
// We use SetLocalPropertyIgnoreAttributes instead
LookupResult lookup(isolate);
- global->LocalLookup(*name, &lookup);
+ global->LocalLookup(name, &lookup);
if (!lookup.IsFound()) {
HandleScope handle_scope(isolate);
Handle<GlobalObject> global(isolate->context()->global_object());
// Set it if it hasn't been set before. NOTE: We cannot use
// GetProperty() to get the current value as it 'unholes' the value.
LookupResult lookup(isolate);
- object->LocalLookupRealNamedProperty(*name, &lookup);
+ object->LocalLookupRealNamedProperty(name, &lookup);
ASSERT(lookup.IsFound()); // the property was declared
ASSERT(lookup.IsReadOnly()); // and it was declared as read-only
// Lookup cache miss. Perform lookup and update the cache if
// appropriate.
LookupResult result(isolate);
- receiver->LocalLookup(*key, &result);
+ receiver->LocalLookup(key, &result);
if (result.IsField()) {
int offset = result.GetFieldIndex().field_index();
// Do not track double fields in the keyed lookup cache. Reading
}
LookupResult lookup(isolate);
- js_object->LocalLookupRealNamedProperty(*name, &lookup);
+ js_object->LocalLookupRealNamedProperty(name, &lookup);
// Special case for callback properties.
if (lookup.IsPropertyCallbacks()) {
Handle<JSObject> jsproto = obj;
for (int i = 0; i < length; i++) {
LookupResult result(isolate);
- jsproto->LocalLookup(*name, &result);
+ jsproto->LocalLookup(name, &result);
if (result.IsFound()) {
// LookupResult is not GC safe as it holds raw object pointers.
// GC can happen later in this code so put the required fields into
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
LookupResult result(isolate);
- obj->Lookup(*name, &result);
+ obj->Lookup(name, &result);
return *DebugLookupResultValue(isolate, obj, name, &result);
}