Reviewers: Igor Sheludko,

Message:
PTAL

Description:
Remove the holder_ field from LookupResult

BUG=

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

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

Affected files (+14, -27 lines):
  M src/hydrogen.cc
  M src/objects.h
  M src/objects.cc
  M src/objects-inl.h
  M src/property.h
  M src/property.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index c8fbbc7c87c1b6ed86de444588a196f8a280d05a..0b2583a12cbf8f33594112577fa1eb7460bf0ef8 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5980,7 +5980,7 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::IsCompatible(

 bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupDescriptor() {
   if (!type_->IsClass()) return true;
-  map()->LookupDescriptor(NULL, *name_, &lookup_);
+  map()->LookupDescriptor(*name_, &lookup_);
   return LoadResult(map());
 }

@@ -6073,7 +6073,7 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() {
       lookup_.NotFound();
       return false;
     }
-    map->LookupDescriptor(*holder_, *name_, &lookup_);
+    map->LookupDescriptor(*name_, &lookup_);
     if (IsFound()) return LoadResult(map);
   }
   lookup_.NotFound();
@@ -6096,7 +6096,7 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic() {

   if (IsAccessorConstant()) return true;
   Handle<Map> map = this->map();
-  map->LookupTransition(NULL, *name_, NONE, &lookup_);
+  map->LookupTransition(*name_, NONE, &lookup_);
   if (lookup_.IsTransitionToData() && map->unused_property_fields() > 0) {
     // Construct the object field access.
     int descriptor = transition()->LastAdded();
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 0c72d9511daaa9062bd6110128e888f3c88e76e0..bc79580ac38674914cc219804c75d348f56f6546 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3026,22 +3026,19 @@ PropertyDetails Map::GetLastDescriptorDetails() {
 }


-void Map::LookupDescriptor(JSObject* holder,
-                           Name* name,
-                           LookupResult* result) {
+void Map::LookupDescriptor(Name* name, LookupResult* result) {
   DescriptorArray* descriptors = this->instance_descriptors();
   int number = descriptors->SearchWithCache(name, this);
   if (number == DescriptorArray::kNotFound) return result->NotFound();
- result->DescriptorResult(holder, descriptors->GetDetails(number), number);
+  result->DescriptorResult(descriptors->GetDetails(number), number);
 }


-void Map::LookupTransition(JSObject* holder, Name* name,
-                           PropertyAttributes attributes,
+void Map::LookupTransition(Name* name, PropertyAttributes attributes,
                            LookupResult* result) {
   int transition_index = this->SearchTransition(kData, name, attributes);
if (transition_index == TransitionArray::kNotFound) return result->NotFound();
-  result->TransitionResult(holder, this->GetTransition(transition_index));
+  result->TransitionResult(this->GetTransition(transition_index));
 }


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 7459ed4525b2d96df98729803fddc17fbbdf2227..f9bb9eca825e24e94f3ed02b5ecf234a2f4b1e24 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13571,7 +13571,7 @@ bool JSArray::IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) {
   DCHECK(!jsarray_map->is_dictionary_map());
   LookupResult lookup(isolate);
   Handle<Name> length_string = isolate->factory()->length_string();
-  jsarray_map->LookupDescriptor(NULL, *length_string, &lookup);
+  jsarray_map->LookupDescriptor(*length_string, &lookup);
   return lookup.IsReadOnly();
 }

Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index d7d6e6717b7ce5a89be989a21d736d0392cd1f44..dae219d2763bb21e7879b93f0688e707803683fc 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5995,15 +5995,11 @@ class Map: public HeapObject {
     cache->set(kProtoTransitionNumberOfEntriesOffset, Smi::FromInt(value));
   }

-  // Lookup in the map's instance descriptors and fill out the result
-  // with the given holder if the name is found. The holder may be
-  // NULL when this function is used from the compiler.
-  inline void LookupDescriptor(JSObject* holder,
-                               Name* name,
-                               LookupResult* result);
+ // Lookup in the map's instance descriptors and fill out the result if the
+  // name is found.
+  inline void LookupDescriptor(Name* name, LookupResult* result);

-  inline void LookupTransition(JSObject* holder, Name* name,
-                               PropertyAttributes attributes,
+  inline void LookupTransition(Name* name, PropertyAttributes attributes,
                                LookupResult* result);

   inline PropertyDetails GetLastDescriptorDetails();
Index: src/property.cc
diff --git a/src/property.cc b/src/property.cc
index 63837d3a92f312e07b787282981219b1dd590c7a..961b04342053fe2f245e1affd572b97298221028 100644
--- a/src/property.cc
+++ b/src/property.cc
@@ -13,7 +13,6 @@ namespace internal {
 void LookupResult::Iterate(ObjectVisitor* visitor) {
   LookupResult* current = this;  // Could be NULL.
   while (current != NULL) {
-    visitor->VisitPointer(bit_cast<Object**>(&current->holder_));
     visitor->VisitPointer(bit_cast<Object**>(&current->transition_));
     current = current->next_;
   }
Index: src/property.h
diff --git a/src/property.h b/src/property.h
index dd2ede880741873094a4ad5e63f9bbe506ee6feb..79abca04c9d50f4e6c160b0893f9537bf758f418 100644
--- a/src/property.h
+++ b/src/property.h
@@ -110,7 +110,6 @@ class LookupResult FINAL BASE_EMBEDDED {
       : isolate_(isolate),
         next_(isolate->top_lookup_result()),
         lookup_type_(NOT_FOUND),
-        holder_(NULL),
         transition_(NULL),
         details_(NONE, DATA, Representation::None()) {
     isolate->set_top_lookup_result(this);
@@ -123,26 +122,23 @@ class LookupResult FINAL BASE_EMBEDDED {

   Isolate* isolate() const { return isolate_; }

- void DescriptorResult(JSObject* holder, PropertyDetails details, int number) {
+  void DescriptorResult(PropertyDetails details, int number) {
     lookup_type_ = DESCRIPTOR_TYPE;
-    holder_ = holder;
     transition_ = NULL;
     details_ = details;
     number_ = number;
   }

-  void TransitionResult(JSObject* holder, Map* target) {
+  void TransitionResult(Map* target) {
     lookup_type_ = TRANSITION_TYPE;
     number_ = target->LastAdded();
     details_ = target->instance_descriptors()->GetDetails(number_);
-    holder_ = holder;
     transition_ = target;
   }

   void NotFound() {
     lookup_type_ = NOT_FOUND;
     details_ = PropertyDetails(NONE, DATA, 0);
-    holder_ = NULL;
     transition_ = NULL;
   }

@@ -232,7 +228,6 @@ class LookupResult FINAL BASE_EMBEDDED {
   // Where did we find the result;
   enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_;

-  JSReceiver* holder_;
   Map* transition_;
   int number_;
   PropertyDetails details_;


--
--
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