Reviewers: Jakob,

Message:
PTAL

Description:
Get rid of last non-JSReceiver::Lookup usage of LookupOwn

BUG=

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

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+8, -7 lines):
  M src/lookup.h
  M src/objects.h
  M src/runtime.cc


Index: src/lookup.h
diff --git a/src/lookup.h b/src/lookup.h
index 84bdc7b4996a3f3b50ac60b22634846b6774c3b1..5e2b4921801c87926727323b50b3a4070c0eadf8 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -23,6 +23,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {

     // Convience combinations of bits.
     CHECK_PROPERTY = 0,
+    CHECK_OWN = CHECK_ACCESS_CHECK | CHECK_INTERCEPTOR,
CHECK_HIDDEN_SKIP_INTERCEPTOR = CHECK_HIDDEN_PROPERTY | CHECK_ACCESS_CHECK,
     CHECK_DERIVED_SKIP_INTERCEPTOR =
         CHECK_HIDDEN_SKIP_INTERCEPTOR | CHECK_DERIVED_PROPERTY,
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 927782d30a10348a59f84fa04126b10d3ec4a4a0..ae118b4aca38d861f80fc4e43c1524a308dc2e55 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1999,7 +1999,6 @@ class JSReceiver: public HeapObject {

   // Lookup a property.  If found, the result is valid and has
   // detailed information.
-  void LookupOwn(Handle<Name> name, LookupResult* result);
   void Lookup(Handle<Name> name, LookupResult* result);

   enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS };
@@ -2011,6 +2010,7 @@ class JSReceiver: public HeapObject {
       KeyCollectionType type);

  private:
+  void LookupOwn(Handle<Name> name, LookupResult* result);
   DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
 };

Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 4aeef9d4558b7a59c3dcb06aa3d2d8052d022b92..79c9d49a894b836b47997a5b1374e5a9ca003af6 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4870,18 +4870,18 @@ RUNTIME_FUNCTION(Runtime_KeyedGetProperty) {
         }
         // Lookup cache miss.  Perform lookup and update the cache if
         // appropriate.
-        LookupResult result(isolate);
-        receiver->LookupOwn(key, &result);
-        if (result.IsField()) {
-          FieldIndex field_index = result.GetFieldIndex();
+        LookupIterator it(receiver, key, LookupIterator::CHECK_OWN);
+        if (it.IsFound() && it.state() == LookupIterator::PROPERTY &&
+            it.HasProperty() && it.property_details().type() == FIELD) {
+          FieldIndex field_index = it.GetFieldIndex();
           // Do not track double fields in the keyed lookup cache. Reading
           // double values requires boxing.
-          if (!result.representation().IsDouble()) {
+          if (!it.representation().IsDouble()) {
             keyed_lookup_cache->Update(receiver_map, key,
                 field_index.GetKeyedLookupCacheIndex());
           }
           AllowHeapAllocation allow_allocation;
- return *JSObject::FastPropertyAt(receiver, result.representation(),
+          return *JSObject::FastPropertyAt(receiver, it.representation(),
                                            field_index);
         }
       } else {


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