Revision: 23348
Author:   [email protected]
Date:     Mon Aug 25 11:31:38 2014 UTC
Log:      Minor LookupIterator cleanups

BUG=
[email protected]

Review URL: https://codereview.chromium.org/480283003
https://code.google.com/p/v8/source/detail?r=23348

Modified:
 /branches/bleeding_edge/src/ic/ic.cc
 /branches/bleeding_edge/src/lookup.cc
 /branches/bleeding_edge/src/lookup.h
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/ic/ic.cc        Mon Aug 25 11:17:37 2014 UTC
+++ /branches/bleeding_edge/src/ic/ic.cc        Mon Aug 25 11:31:38 2014 UTC
@@ -971,7 +971,7 @@
                                       cache_holder);
// Perform a lookup behind the interceptor. Copy the LookupIterator since
     // the original iterator will be used to fetch the value.
-    LookupIterator it(lookup);
+    LookupIterator it = *lookup;
     it.Next();
     LookupForRead(&it);
     return compiler.CompileLoadInterceptor(&it);
=======================================
--- /branches/bleeding_edge/src/lookup.cc       Fri Aug 22 11:38:21 2014 UTC
+++ /branches/bleeding_edge/src/lookup.cc       Mon Aug 25 11:31:38 2014 UTC
@@ -35,8 +35,8 @@
   // Either was found in the receiver, or the receiver has no prototype.
   if (holder == NULL) return;

-  maybe_holder_ = handle(holder);
-  holder_map_ = handle(map);
+  maybe_holder_ = handle(holder, isolate_);
+  holder_map_ = handle(map, isolate_);
 }


@@ -53,7 +53,7 @@
 Handle<Map> LookupIterator::GetReceiverMap() const {
   Handle<Object> receiver = GetReceiver();
   if (receiver->IsNumber()) return isolate_->factory()->heap_number_map();
-  return handle(Handle<HeapObject>::cast(receiver)->map());
+  return handle(Handle<HeapObject>::cast(receiver)->map(), isolate_);
 }


@@ -184,7 +184,7 @@
   }

   transition_map_ = Map::TransitionToDataProperty(
-      handle(receiver->map()), name_, value, attributes, store_mode);
+ handle(receiver->map(), isolate_), name_, value, attributes, store_mode);
   state_ = TRANSITION;
 }

@@ -209,8 +209,9 @@
   // observable.
   Handle<JSObject> receiver = GetStoreTarget();
   maybe_holder_ = receiver;
-  holder_map_ = Map::TransitionToAccessorProperty(
-      handle(receiver->map()), name_, component, accessor, attributes);
+  holder_map_ =
+      Map::TransitionToAccessorProperty(handle(receiver->map(), isolate_),
+ name_, component, accessor, attributes);
   JSObject::MigrateToMap(receiver, holder_map_);

   ReloadPropertyInformation();
@@ -243,7 +244,7 @@
   JSObject::SetNormalizedProperty(receiver, name_, pair, details);

   JSObject::ReoptimizeIfPrototype(receiver);
-  holder_map_ = handle(receiver->map());
+  holder_map_ = handle(receiver->map(), isolate_);
   ReloadPropertyInformation();
 }

=======================================
--- /branches/bleeding_edge/src/lookup.h        Fri Aug 22 11:38:21 2014 UTC
+++ /branches/bleeding_edge/src/lookup.h        Mon Aug 25 11:31:38 2014 UTC
@@ -52,18 +52,6 @@
     DICTIONARY,
     DESCRIPTOR
   };
-
-  explicit LookupIterator(const LookupIterator* other)
-      : configuration_(other->configuration_),
-        state_(other->state_),
-        property_kind_(other->property_kind_),
-        property_encoding_(other->property_encoding_),
-        property_details_(other->property_details_),
-        isolate_(other->isolate_),
-        name_(other->name_),
-        holder_map_(other->holder_map_),
-        maybe_receiver_(other->maybe_receiver_),
-        maybe_holder_(other->maybe_holder_) {}

   LookupIterator(Handle<Object> receiver, Handle<Name> name,
                  Configuration configuration = CHECK_DERIVED)
@@ -77,7 +65,7 @@
         maybe_receiver_(receiver),
         number_(DescriptorArray::kNotFound) {
     Handle<JSReceiver> root = GetRoot();
-    holder_map_ = handle(root->map());
+    holder_map_ = handle(root->map(), isolate_);
     maybe_holder_ = root;
     Next();
   }
@@ -92,7 +80,7 @@
         property_details_(NONE, NORMAL, Representation::None()),
         isolate_(name->GetIsolate()),
         name_(name),
-        holder_map_(holder->map()),
+        holder_map_(holder->map(), isolate_),
         maybe_receiver_(receiver),
         maybe_holder_(holder),
         number_(DescriptorArray::kNotFound) {
=======================================
--- /branches/bleeding_edge/src/objects.cc      Mon Aug 25 07:02:19 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Mon Aug 25 11:31:38 2014 UTC
@@ -12844,12 +12844,12 @@


 bool JSArray::IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) {
-    Isolate* isolate = jsarray_map->GetIsolate();
-    DCHECK(!jsarray_map->is_dictionary_map());
-    LookupResult lookup(isolate);
-    Handle<Name> length_string = isolate->factory()->length_string();
-    jsarray_map->LookupDescriptor(NULL, *length_string, &lookup);
-    return lookup.IsReadOnly();
+  Isolate* isolate = jsarray_map->GetIsolate();
+  DCHECK(!jsarray_map->is_dictionary_map());
+  LookupResult lookup(isolate);
+  Handle<Name> length_string = isolate->factory()->length_string();
+  jsarray_map->LookupDescriptor(NULL, *length_string, &lookup);
+  return lookup.IsReadOnly();
 }


@@ -14613,13 +14613,6 @@
   }
   return array->GetIsolate()->factory()->NewNumber(double_value);
 }
-
-
-PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) {
-  DCHECK(!HasFastProperties());
- Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
-  return PropertyCell::cast(value);
-}


 Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell(
=======================================
--- /branches/bleeding_edge/src/objects.h       Mon Aug 25 07:02:19 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Mon Aug 25 11:31:38 2014 UTC
@@ -7797,9 +7797,6 @@
   // [global proxy]: the global proxy object of the context
   DECL_ACCESSORS(global_proxy, JSObject)

-  // Retrieve the property cell used to store a property.
-  PropertyCell* GetPropertyCell(LookupResult* result);
-
   DECLARE_CAST(GlobalObject)

   // Layout description.
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Mon Aug 25 09:12:22 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Mon Aug 25 11:31:38 2014 UTC
@@ -10899,8 +10899,8 @@
 }


-static Handle<Object> DebugLookupResultValue(LookupIterator* it,
-                                             bool* has_caught = NULL) {
+static Handle<Object> DebugGetProperty(LookupIterator* it,
+                                       bool* has_caught = NULL) {
   for (; it->IsFound(); it->Next()) {
     switch (it->state()) {
       case LookupIterator::NOT_FOUND:
@@ -10986,7 +10986,7 @@

   LookupIterator it(obj, name, LookupIterator::CHECK_HIDDEN);
   bool has_caught = false;
-  Handle<Object> value = DebugLookupResultValue(&it, &has_caught);
+  Handle<Object> value = DebugGetProperty(&it, &has_caught);
   if (!it.IsFound()) return isolate->heap()->undefined_value();

   Handle<Object> maybe_pair;
@@ -11026,7 +11026,7 @@
   CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);

   LookupIterator it(obj, name, LookupIterator::CHECK_DERIVED);
-  return *DebugLookupResultValue(&it);
+  return *DebugGetProperty(&it);
 }


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