Revision: 23262
Author:   [email protected]
Date:     Thu Aug 21 08:26:42 2014 UTC
Log:      Get rid of all non-IC uses of LookupOwnRealNamedProperty

BUG=
[email protected]

Review URL: https://codereview.chromium.org/491023002
http://code.google.com/p/v8/source/detail?r=23262

Modified:
 /branches/bleeding_edge/src/lookup-inl.h
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/test/cctest/test-api.cc

=======================================
--- /branches/bleeding_edge/src/lookup-inl.h    Tue Aug 19 17:02:04 2014 UTC
+++ /branches/bleeding_edge/src/lookup-inl.h    Thu Aug 21 08:26:42 2014 UTC
@@ -20,7 +20,10 @@
          next->map()->is_hidden_prototype());

   if (!check_derived() &&
-      !(check_hidden() && next->map()->is_hidden_prototype())) {
+      !(check_hidden() && next->map()->is_hidden_prototype()) &&
+ // Always lookup behind the JSGlobalProxy into the JSGlobalObject, even
+      // when not checking other hidden prototypes.
+      !(map->IsJSGlobalProxyMap() && next->IsJSGlobalObject())) {
     return NULL;
   }

=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu Aug 21 08:16:06 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Thu Aug 21 08:26:42 2014 UTC
@@ -12944,11 +12944,11 @@
   uint32_t length = 0;
   CHECK(array->length()->ToArrayIndex(&length));
   if (length <= index) {
-    Isolate* isolate = array->GetIsolate();
-    LookupResult lookup(isolate);
-    Handle<Name> length_string = isolate->factory()->length_string();
-    array->LookupOwnRealNamedProperty(length_string, &lookup);
-    return lookup.IsReadOnly();
+ LookupIterator it(array, array->GetIsolate()->factory()->length_string(),
+                      LookupIterator::CHECK_PROPERTY);
+    CHECK(it.IsFound());
+    CHECK(it.HasProperty());
+    return it.IsReadOnly();
   }
   return false;
 }
@@ -13332,20 +13332,10 @@

 Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object,
                                            Handle<Name> key) {
-  Isolate* isolate = object->GetIsolate();
-  SealHandleScope shs(isolate);
-  // Check access rights if needed.
-  if (object->IsAccessCheckNeeded()) {
-    if (!isolate->MayNamedAccess(object, key, v8::ACCESS_HAS)) {
-      isolate->ReportFailedAccessCheck(object, v8::ACCESS_HAS);
-      RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Maybe<bool>());
-      return maybe(false);
-    }
-  }
-
-  LookupResult result(isolate);
-  object->LookupOwnRealNamedProperty(key, &result);
-  return maybe(result.IsFound() && !result.IsInterceptor());
+  LookupIterator it(object, key, LookupIterator::CHECK_ACCESS_CHECK);
+  Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
+  if (!maybe_result.has_value) return Maybe<bool>();
+  return maybe(it.IsFound());
 }


@@ -13380,20 +13370,10 @@

 Maybe<bool> JSObject::HasRealNamedCallbackProperty(Handle<JSObject> object,
                                                    Handle<Name> key) {
-  Isolate* isolate = object->GetIsolate();
-  SealHandleScope shs(isolate);
-  // Check access rights if needed.
-  if (object->IsAccessCheckNeeded()) {
-    if (!isolate->MayNamedAccess(object, key, v8::ACCESS_HAS)) {
-      isolate->ReportFailedAccessCheck(object, v8::ACCESS_HAS);
-      RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Maybe<bool>());
-      return maybe(false);
-    }
-  }
-
-  LookupResult result(isolate);
-  object->LookupOwnRealNamedProperty(key, &result);
-  return maybe(result.IsPropertyCallbacks());
+  LookupIterator it(object, key, LookupIterator::CHECK_ACCESS_CHECK);
+  Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
+  if (!maybe_result.has_value) return Maybe<bool>();
+ return maybe(it.IsFound() && it.property_kind() == LookupIterator::ACCESSOR);
 }


=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Wed Aug 20 15:25:13 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-api.cc Thu Aug 21 08:26:42 2014 UTC
@@ -21771,7 +21771,6 @@

   // Create a context and set an x property on it's global object.
   LocalContext context0(NULL, global_template);
-  context0->Global()->Set(v8_str("x"), v8_num(42));
   v8::Handle<v8::Object> global0 = context0->Global();

   // Create a context with a different security token so that the

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