Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1084)

Unified Diff: src/objects-inl.h

Issue 1178893002: Introduce LookupIterator::PropertyOrElement which converts name to index if possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 27528d644253793d8418fc019ec183557cd52c31..04b78e5f73b642bd6ab09c3986db6a2ddfda606e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6583,10 +6583,8 @@ String* String::GetForwardedInternalizedString() {
MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object,
Handle<Name> name) {
- uint32_t index;
- LookupIterator it = name->AsArrayIndex(&index)
- ? LookupIterator(name->GetIsolate(), object, index)
- : LookupIterator(object, name);
+ LookupIterator it =
+ LookupIterator::PropertyOrElement(name->GetIsolate(), object, name);
return GetProperty(&it);
}
@@ -6619,21 +6617,16 @@ Maybe<bool> JSReceiver::HasOwnProperty(Handle<JSReceiver> object,
Maybe<PropertyAttributes> JSReceiver::GetPropertyAttributes(
Handle<JSReceiver> object, Handle<Name> name) {
- uint32_t index = 0;
- LookupIterator it = name->AsArrayIndex(&index)
- ? LookupIterator(name->GetIsolate(), object, index)
- : LookupIterator(object, name);
+ LookupIterator it =
+ LookupIterator::PropertyOrElement(name->GetIsolate(), object, name);
return GetPropertyAttributes(&it);
}
Maybe<PropertyAttributes> JSReceiver::GetOwnPropertyAttributes(
Handle<JSReceiver> object, Handle<Name> name) {
- uint32_t index = 0;
- LookupIterator::Configuration c = LookupIterator::HIDDEN;
- LookupIterator it = name->AsArrayIndex(&index)
- ? LookupIterator(name->GetIsolate(), object, index, c)
- : LookupIterator(object, name, c);
+ LookupIterator it = LookupIterator::PropertyOrElement(
+ name->GetIsolate(), object, name, LookupIterator::HIDDEN);
return GetPropertyAttributes(&it);
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698