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

Unified Diff: src/lookup-inl.h

Issue 1222543003: Micro-optimize lookupiterator: faster path for fast-mode objects (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 | « no previous file | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup-inl.h
diff --git a/src/lookup-inl.h b/src/lookup-inl.h
index 98971390b60e1dd8674670ffa326f4546b978997..ae1793ef171f1abcade6da881cce500269be2f9d 100644
--- a/src/lookup-inl.h
+++ b/src/lookup-inl.h
@@ -78,7 +78,13 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* const map,
if (number_ == kMaxUInt32) return NOT_FOUND;
property_details_ = accessor->GetDetails(backing_store, number_);
}
- } else if (holder->IsGlobalObject()) {
+ } else if (!map->is_dictionary_map()) {
+ DescriptorArray* descriptors = map->instance_descriptors();
+ int number = descriptors->SearchWithCache(*name_, map);
+ if (number == DescriptorArray::kNotFound) return NOT_FOUND;
+ number_ = static_cast<uint32_t>(number);
+ property_details_ = descriptors->GetDetails(number_);
+ } else if (map->IsGlobalObjectMap()) {
GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary();
int number = dict->FindEntry(name_);
if (number == GlobalDictionary::kNotFound) return NOT_FOUND;
@@ -87,18 +93,12 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* const map,
PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_));
if (cell->value()->IsTheHole()) return NOT_FOUND;
property_details_ = cell->property_details();
- } else if (map->is_dictionary_map()) {
+ } else {
NameDictionary* dict = JSObject::cast(holder)->property_dictionary();
int number = dict->FindEntry(name_);
if (number == NameDictionary::kNotFound) return NOT_FOUND;
number_ = static_cast<uint32_t>(number);
property_details_ = dict->DetailsAt(number_);
- } else {
- DescriptorArray* descriptors = map->instance_descriptors();
- int number = descriptors->SearchWithCache(*name_, map);
- if (number == DescriptorArray::kNotFound) return NOT_FOUND;
- number_ = static_cast<uint32_t>(number);
- property_details_ = descriptors->GetDetails(number_);
}
has_property_ = true;
switch (property_details_.kind()) {
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698