Revision: 23167
Author:   [email protected]
Date:     Mon Aug 18 14:59:04 2014 UTC
Log:      Rename the configuration flags of the LookupIterator

BUG=
[email protected]

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

Modified:
 /branches/bleeding_edge/src/api.cc
 /branches/bleeding_edge/src/bootstrapper.cc
 /branches/bleeding_edge/src/factory.cc
 /branches/bleeding_edge/src/isolate.cc
 /branches/bleeding_edge/src/json-stringifier.h
 /branches/bleeding_edge/src/lookup.cc
 /branches/bleeding_edge/src/lookup.h
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/api.cc  Mon Aug 18 07:54:19 2014 UTC
+++ /branches/bleeding_edge/src/api.cc  Mon Aug 18 14:59:04 2014 UTC
@@ -3576,9 +3576,9 @@
   // If the property being looked up is a callback, it can throw
   // an exception.
   EXCEPTION_PREAMBLE(isolate);
-  i::LookupIterator it(
-      receiver, name, i::Handle<i::JSReceiver>(lookup->holder(), isolate),
-      i::LookupIterator::SKIP_INTERCEPTOR);
+  i::LookupIterator it(receiver, name,
+                       i::Handle<i::JSReceiver>(lookup->holder(), isolate),
+                       i::LookupIterator::CHECK_DERIVED_SKIP_INTERCEPTOR);
   i::Handle<i::Object> result;
   has_pending_exception = !i::Object::GetProperty(&it).ToHandle(&result);
   EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Mon Aug 18 07:54:19 2014 UTC
+++ /branches/bleeding_edge/src/bootstrapper.cc Mon Aug 18 14:59:04 2014 UTC
@@ -780,7 +780,7 @@
name, code, prototype, JS_GLOBAL_OBJECT_TYPE, JSGlobalObject::kSize);
 #ifdef DEBUG
     LookupIterator it(prototype, factory()->constructor_string(),
-                      LookupIterator::CHECK_OWN_REAL);
+                      LookupIterator::CHECK_PROPERTY);
     Handle<Object> value = JSReceiver::GetProperty(&it).ToHandleChecked();
     DCHECK(it.IsFound());
     DCHECK_EQ(*isolate()->object_function(), *value);
=======================================
--- /branches/bleeding_edge/src/factory.cc      Tue Aug 12 15:28:20 2014 UTC
+++ /branches/bleeding_edge/src/factory.cc      Mon Aug 18 14:59:04 2014 UTC
@@ -2169,8 +2169,7 @@
   if (prototype->IsTheHole()) {
 #ifdef DEBUG
     LookupIterator it(handle(JSObject::cast(result->prototype())),
-                      constructor_string(),
-                      LookupIterator::CHECK_OWN_REAL);
+ constructor_string(), LookupIterator::CHECK_PROPERTY);
     MaybeHandle<Object> maybe_prop = Object::GetProperty(&it);
     DCHECK(it.IsFound());
     DCHECK(maybe_prop.ToHandleChecked().is_identical_to(result));
=======================================
--- /branches/bleeding_edge/src/isolate.cc      Wed Aug 13 11:14:35 2014 UTC
+++ /branches/bleeding_edge/src/isolate.cc      Mon Aug 18 14:59:04 2014 UTC
@@ -1056,8 +1056,8 @@
// Look up as own property. If the lookup fails, the exception is // probably not a valid Error object. In that case, we fall through
           // and capture the stack trace at this throw site.
-          LookupIterator lookup(
-              exception_handle, key, LookupIterator::CHECK_OWN_REAL);
+          LookupIterator lookup(exception_handle, key,
+                                LookupIterator::CHECK_PROPERTY);
           Handle<Object> stack_trace_property;
if (Object::GetProperty(&lookup).ToHandle(&stack_trace_property) &&
               stack_trace_property->IsJSArray()) {
=======================================
--- /branches/bleeding_edge/src/json-stringifier.h Mon Aug 4 11:34:54 2014 UTC +++ /branches/bleeding_edge/src/json-stringifier.h Mon Aug 18 14:59:04 2014 UTC
@@ -339,7 +339,8 @@

 MaybeHandle<Object> BasicJsonStringifier::ApplyToJsonFunction(
     Handle<Object> object, Handle<Object> key) {
- LookupIterator it(object, tojson_string_, LookupIterator::SKIP_INTERCEPTOR);
+  LookupIterator it(object, tojson_string_,
+                    LookupIterator::CHECK_DERIVED_SKIP_INTERCEPTOR);
   Handle<Object> fun;
ASSIGN_RETURN_ON_EXCEPTION(isolate_, fun, Object::GetProperty(&it), Object);
   if (!fun->IsJSFunction()) return object;
=======================================
--- /branches/bleeding_edge/src/lookup.cc       Mon Aug 18 14:26:30 2014 UTC
+++ /branches/bleeding_edge/src/lookup.cc       Mon Aug 18 14:59:04 2014 UTC
@@ -174,7 +174,7 @@

   // Reload the information.
   state_ = NOT_FOUND;
-  configuration_ = CHECK_OWN_REAL;
+  configuration_ = CHECK_PROPERTY;
   state_ = LookupInHolder(*holder_map_);
   DCHECK(IsFound());
   HasProperty();
=======================================
--- /branches/bleeding_edge/src/lookup.h        Mon Aug 18 14:26:30 2014 UTC
+++ /branches/bleeding_edge/src/lookup.h        Mon Aug 18 14:59:04 2014 UTC
@@ -15,15 +15,19 @@
 class LookupIterator V8_FINAL BASE_EMBEDDED {
  public:
   enum Configuration {
-    CHECK_OWN_REAL = 0,
-    CHECK_HIDDEN = 1 << 0,
-    CHECK_DERIVED = 1 << 1,
+    // Configuration bits.
+    CHECK_HIDDEN_PROPERTY = 1 << 0,
+    CHECK_DERIVED_PROPERTY = 1 << 1,
     CHECK_INTERCEPTOR = 1 << 2,
     CHECK_ACCESS_CHECK = 1 << 3,
-    CHECK_HIDDEN_ACCESS = CHECK_HIDDEN | CHECK_ACCESS_CHECK,
-    SKIP_INTERCEPTOR = CHECK_HIDDEN_ACCESS | CHECK_DERIVED,
-    CHECK_ALL = SKIP_INTERCEPTOR | CHECK_INTERCEPTOR,
-    CHECK_OWN = CHECK_HIDDEN_ACCESS | CHECK_INTERCEPTOR
+
+    // Convience combinations of bits.
+    CHECK_PROPERTY = 0,
+ CHECK_HIDDEN_SKIP_INTERCEPTOR = CHECK_HIDDEN_PROPERTY | CHECK_ACCESS_CHECK,
+    CHECK_DERIVED_SKIP_INTERCEPTOR =
+        CHECK_HIDDEN_SKIP_INTERCEPTOR | CHECK_DERIVED_PROPERTY,
+    CHECK_DERIVED = CHECK_DERIVED_SKIP_INTERCEPTOR | CHECK_INTERCEPTOR,
+    CHECK_HIDDEN = CHECK_HIDDEN_SKIP_INTERCEPTOR | CHECK_INTERCEPTOR
   };

   enum State {
@@ -44,9 +48,8 @@
     DESCRIPTOR
   };

-  LookupIterator(Handle<Object> receiver,
-                 Handle<Name> name,
-                 Configuration configuration = CHECK_ALL)
+  LookupIterator(Handle<Object> receiver, Handle<Name> name,
+                 Configuration configuration = CHECK_DERIVED)
       : configuration_(ComputeConfiguration(configuration, name)),
         state_(NOT_FOUND),
         property_kind_(DATA),
@@ -62,10 +65,9 @@
     Next();
   }

-  LookupIterator(Handle<Object> receiver,
-                 Handle<Name> name,
+  LookupIterator(Handle<Object> receiver, Handle<Name> name,
                  Handle<JSReceiver> holder,
-                 Configuration configuration = CHECK_ALL)
+                 Configuration configuration = CHECK_DERIVED)
       : configuration_(ComputeConfiguration(configuration, name)),
         state_(NOT_FOUND),
         property_kind_(DATA),
@@ -161,10 +163,10 @@
     return !IsBootstrapping() && (configuration_ & CHECK_INTERCEPTOR) != 0;
   }
   bool check_derived() const {
-    return (configuration_ & CHECK_DERIVED) != 0;
+    return (configuration_ & CHECK_DERIVED_PROPERTY) != 0;
   }
   bool check_hidden() const {
-    return (configuration_ & CHECK_HIDDEN) != 0;
+    return (configuration_ & CHECK_HIDDEN_PROPERTY) != 0;
   }
   bool check_access_check() const {
     return (configuration_ & CHECK_ACCESS_CHECK) != 0;
@@ -183,7 +185,7 @@
   static Configuration ComputeConfiguration(
       Configuration configuration, Handle<Name> name) {
     if (name->IsOwn()) {
-      return static_cast<Configuration>(configuration & CHECK_OWN);
+      return static_cast<Configuration>(configuration & CHECK_HIDDEN);
     } else {
       return configuration;
     }
=======================================
--- /branches/bleeding_edge/src/objects.cc      Mon Aug 18 14:46:38 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Mon Aug 18 14:59:04 2014 UTC
@@ -3871,7 +3871,7 @@
 void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name,
                            Handle<Object> value,
                            PropertyAttributes attributes) {
-  LookupIterator it(object, name, LookupIterator::CHECK_OWN_REAL);
+  LookupIterator it(object, name, LookupIterator::CHECK_PROPERTY);
 #ifdef DEBUG
   uint32_t index;
   DCHECK(!object->IsJSProxy());
@@ -3896,7 +3896,8 @@
     PropertyAttributes attributes,
     ExecutableAccessorInfoHandling handling) {
   DCHECK(!value->IsTheHole());
-  LookupIterator it(object, name, LookupIterator::CHECK_HIDDEN_ACCESS);
+  LookupIterator it(object, name,
+                    LookupIterator::CHECK_HIDDEN_SKIP_INTERCEPTOR);
   bool is_observed = object->map()->is_observed() &&
                      *name != it.isolate()->heap()->hidden_string();
   for (; it.IsFound(); it.Next()) {
@@ -4066,7 +4067,7 @@
   if (object->IsJSObject() && name->AsArrayIndex(&index)) {
     return GetOwnElementAttribute(object, index);
   }
-  LookupIterator it(object, name, LookupIterator::CHECK_OWN);
+  LookupIterator it(object, name, LookupIterator::CHECK_HIDDEN);
   return GetPropertyAttributes(&it);
 }

@@ -4774,7 +4775,7 @@

 bool JSObject::HasHiddenProperties(Handle<JSObject> object) {
   Handle<Name> hidden = object->GetIsolate()->factory()->hidden_string();
-  LookupIterator it(object, hidden, LookupIterator::CHECK_OWN_REAL);
+  LookupIterator it(object, hidden, LookupIterator::CHECK_PROPERTY);
   Maybe<PropertyAttributes> maybe = GetPropertyAttributes(&it);
// Cannot get an exception since the hidden_string isn't accessible to JS.
   DCHECK(maybe.has_value);
@@ -5006,8 +5007,9 @@

   // Skip interceptors on FORCE_DELETION.
   LookupIterator::Configuration config =
-      delete_mode == FORCE_DELETION ? LookupIterator::CHECK_HIDDEN_ACCESS
-                                    : LookupIterator::CHECK_OWN;
+      delete_mode == FORCE_DELETION
+          ? LookupIterator::CHECK_HIDDEN_SKIP_INTERCEPTOR
+          : LookupIterator::CHECK_HIDDEN;

   LookupIterator it(object, name, config);

@@ -6623,7 +6625,8 @@
       }
     }
   } else {
-    LookupIterator it(object, name, LookupIterator::SKIP_INTERCEPTOR);
+    LookupIterator it(object, name,
+                      LookupIterator::CHECK_DERIVED_SKIP_INTERCEPTOR);
     for (; it.IsFound(); it.Next()) {
       switch (it.state()) {
         case LookupIterator::NOT_FOUND:
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Mon Aug 18 14:38:44 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Mon Aug 18 14:59:04 2014 UTC
@@ -1980,7 +1980,7 @@
     }
   } else {
     // Get attributes.
-    LookupIterator it(obj, name, LookupIterator::CHECK_OWN);
+    LookupIterator it(obj, name, LookupIterator::CHECK_HIDDEN);
     Maybe<PropertyAttributes> maybe = JSObject::GetPropertyAttributes(&it);
     if (!maybe.has_value) return MaybeHandle<Object>();
     attrs = maybe.value;
@@ -2159,7 +2159,7 @@
                               PropertyAttributes attr, bool is_var,
                               bool is_const, bool is_function) {
   // Do the lookup own properties only, see ES5 erratum.
-  LookupIterator it(global, name, LookupIterator::CHECK_HIDDEN);
+  LookupIterator it(global, name, LookupIterator::CHECK_HIDDEN_PROPERTY);
   Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it);
   DCHECK(maybe.has_value);
   PropertyAttributes old_attributes = maybe.value;
@@ -2289,7 +2289,7 @@
   Handle<GlobalObject> global = isolate->global_object();

   // Lookup the property as own on the global object.
-  LookupIterator it(global, name, LookupIterator::CHECK_HIDDEN);
+  LookupIterator it(global, name, LookupIterator::CHECK_HIDDEN_PROPERTY);
   Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it);
   DCHECK(maybe.has_value);
   PropertyAttributes old_attributes = maybe.value;
@@ -2439,7 +2439,7 @@
     // code can run in between that modifies the declared property.
DCHECK(holder->IsJSGlobalObject() || holder->IsJSContextExtensionObject());

-    LookupIterator it(holder, name, LookupIterator::CHECK_HIDDEN);
+    LookupIterator it(holder, name, LookupIterator::CHECK_HIDDEN_PROPERTY);
Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it);
     if (!maybe.has_value) return isolate->heap()->exception();
     PropertyAttributes old_attributes = maybe.value;
@@ -5277,7 +5277,7 @@
 #ifdef DEBUG
   uint32_t index = 0;
   DCHECK(!key->ToArrayIndex(&index));
-  LookupIterator it(object, key, LookupIterator::CHECK_OWN_REAL);
+  LookupIterator it(object, key, LookupIterator::CHECK_PROPERTY);
   Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it);
   DCHECK(maybe.has_value);
   RUNTIME_ASSERT(!it.IsFound());
@@ -5309,7 +5309,7 @@
   bool duplicate;
   if (key->IsName()) {
     LookupIterator it(object, Handle<Name>::cast(key),
-                      LookupIterator::CHECK_OWN_REAL);
+                      LookupIterator::CHECK_PROPERTY);
Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it);
     DCHECK(maybe.has_value);
     duplicate = it.IsFound();

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