Reviewers: Igor Sheludko,

Message:
ptal

Description:
Micro-optimize lookupiterator: faster path for fast-mode objects

BUG=chromium:505998
LOG=n

Please review this at https://codereview.chromium.org/1222543003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+7, -7 lines):
  M src/lookup-inl.h


Index: src/lookup-inl.h
diff --git a/src/lookup-inl.h b/src/lookup-inl.h
index 98971390b60e1dd8674670ffa326f4546b978997..62f1a938a2a0dea88ab0cfa6799a32512cf7acf0 100644
--- a/src/lookup-inl.h
+++ b/src/lookup-inl.h
@@ -78,6 +78,12 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* const map,
           if (number_ == kMaxUInt32) return NOT_FOUND;
           property_details_ = accessor->GetDetails(backing_store, number_);
         }
+      } 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 (holder->IsGlobalObject()) {
GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary();
         int number = dict->FindEntry(name_);
@@ -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()) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to