Reviewers: ulan,

Message:
PTAL


https://codereview.chromium.org/494063002/diff/1/src/hydrogen-instructions.h
File src/hydrogen-instructions.h (right):

https://codereview.chromium.org/494063002/diff/1/src/hydrogen-instructions.h#newcode5796
src/hydrogen-instructions.h:5796: bool RequiresHoleCheck() { return
details_.IsConfigurable(); }
I removed IsReadOnly because we don't use the hole anymore for const
declarations.

Description:
Rename IsDontDelete to IsConfigurable (and invert conditions)

BUG=

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

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

Affected files (+13, -15 lines):
  M src/elements.cc
  M src/hydrogen.h
  M src/hydrogen-instructions.h
  M src/hydrogen-instructions.cc
  M src/lookup.h
  M src/objects.cc
  M src/property.h
  M src/property-details.h


Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index c95ca5da055cc29b104414792e37ae7fbf61b420..76b9b03bf62d51a0ff4a59127f809f8f441fef84 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -1364,7 +1364,7 @@ class DictionaryElementsAccessor
           uint32_t number = static_cast<uint32_t>(key->Number());
           if (new_length <= number && number < old_length) {
             PropertyDetails details = dict->DetailsAt(i);
-            if (details.IsDontDelete()) new_length = number + 1;
+            if (!details.IsConfigurable()) new_length = number + 1;
           }
         }
       }
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 5b5386b4e8418d5bb2bb1ab82d91cab244467bda..dbfe555c428c2fbb4c9f9748f79749fe4a98b696 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -3584,14 +3584,14 @@ OStream& HTransitionElementsKind::PrintDataTo(OStream& os) const { // NOLINT

 OStream& HLoadGlobalCell::PrintDataTo(OStream& os) const {  // NOLINT
   os << "[" << *cell().handle() << "]";
-  if (!details_.IsDontDelete()) os << " (deleteable)";
+  if (details_.IsConfigurable()) os << " (configurable)";
   if (details_.IsReadOnly()) os << " (read-only)";
   return os;
 }


 bool HLoadGlobalCell::RequiresHoleCheck() const {
-  if (details_.IsDontDelete() && !details_.IsReadOnly()) return false;
+  if (!details_.IsConfigurable()) return false;
   for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
     HValue* use = it.value();
     if (!use->IsChange()) return true;
@@ -3613,7 +3613,7 @@ OStream& HInnerAllocatedObject::PrintDataTo(OStream& os) const { // NOLINT

 OStream& HStoreGlobalCell::PrintDataTo(OStream& os) const {  // NOLINT
   os << "[" << *cell().handle() << "] = " << NameOf(value());
-  if (!details_.IsDontDelete()) os << " (deleteable)";
+  if (details_.IsConfigurable()) os << " (configurable)";
   if (details_.IsReadOnly()) os << " (read-only)";
   return os;
 }
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 4c29e34d40510f54765641c02abdca3425bb41d0..ec50f5bdfd2733c3ab9b8d96159c15c2e37e4865 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -5793,9 +5793,7 @@ class HStoreGlobalCell V8_FINAL : public HUnaryOperation {
                                  Handle<PropertyCell>, PropertyDetails);

   Unique<PropertyCell> cell() const { return cell_; }
-  bool RequiresHoleCheck() {
-    return !details_.IsDontDelete() || details_.IsReadOnly();
-  }
+  bool RequiresHoleCheck() { return details_.IsConfigurable(); }
   bool NeedsWriteBarrier() {
     return StoringValueNeedsWriteBarrier(value());
   }
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index f98f28d2f58eb3e5d91e0af881296c7e2415730c..158322ffbebf37ef584faf1d4c1cc43b936b0d7a 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -2510,7 +2510,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
     bool IsAccessor() const { return lookup_.IsPropertyCallbacks(); }
     bool IsTransition() const { return lookup_.IsTransition(); }

-    bool IsConfigurable() const { return !lookup_.IsDontDelete(); }
+    bool IsConfigurable() const { return lookup_.IsConfigurable(); }
     bool IsReadOnly() const { return lookup_.IsReadOnly(); }
     bool IsCacheable() const { return lookup_.IsCacheable(); }

Index: src/lookup.h
diff --git a/src/lookup.h b/src/lookup.h
index 5e2b4921801c87926727323b50b3a4070c0eadf8..e09eeeea244e74b18c81a80d01db51c3eb3300a7 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -153,7 +153,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
     DCHECK(has_property_);
     return property_details_;
   }
- bool IsConfigurable() const { return !property_details().IsDontDelete(); } + bool IsConfigurable() const { return property_details().IsConfigurable(); }
   bool IsReadOnly() const { return property_details().IsReadOnly(); }
   Representation representation() const {
     return property_details().representation();
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 72578713eb980508b68222aa6dc84d5540cde29a..57f3918198a57d1d647731892d9e35be55c6c402 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -709,11 +709,11 @@ Handle<Object> JSObject::DeleteNormalizedProperty(Handle<JSObject> object,
     // If we have a global object set the cell to the hole.
     if (object->IsGlobalObject()) {
       PropertyDetails details = dictionary->DetailsAt(entry);
-      if (details.IsDontDelete()) {
+      if (!details.IsConfigurable()) {
if (mode != FORCE_DELETION) return isolate->factory()->false_value();
         // When forced to delete global properties, we have to make a
         // map change to invalidate any ICs that think they can load
-        // from the DontDelete cell without checking if it contains
+        // from the non-configurable cell without checking if it contains
         // the hole value.
Handle<Map> new_map = Map::CopyDropDescriptors(handle(object->map()));
         DCHECK(new_map->is_dictionary_map());
@@ -6008,7 +6008,7 @@ static bool UpdateGetterSetterInDictionary(
     Object* result = dictionary->ValueAt(entry);
     PropertyDetails details = dictionary->DetailsAt(entry);
     if (details.type() == CALLBACKS && result->IsAccessorPair()) {
-      DCHECK(!details.IsDontDelete());
+      DCHECK(details.IsConfigurable());
       if (details.attributes() != attributes) {
         dictionary->DetailsAtPut(
             entry,
@@ -15121,7 +15121,7 @@ Handle<Object> Dictionary<Derived, Shape, Key>::DeleteProperty(
   Factory* factory = dictionary->GetIsolate()->factory();
   PropertyDetails details = dictionary->DetailsAt(entry);
   // Ignore attributes if forcing a deletion.
-  if (details.IsDontDelete() && mode != JSReceiver::FORCE_DELETION) {
+  if (!details.IsConfigurable() && mode != JSReceiver::FORCE_DELETION) {
     return factory->false_value();
   }

Index: src/property-details.h
diff --git a/src/property-details.h b/src/property-details.h
index 960c46c4f79a91580defd124b9c71d8def94da36..3e54473350358ed37312a19e13a8313a449cdb3e 100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -260,7 +260,7 @@ class PropertyDetails BASE_EMBEDDED {
   }

   bool IsReadOnly() const { return (attributes() & READ_ONLY) != 0; }
-  bool IsDontDelete() const { return (attributes() & DONT_DELETE) != 0; }
+  bool IsConfigurable() const { return (attributes() & DONT_DELETE) == 0; }
   bool IsDontEnum() const { return (attributes() & DONT_ENUM) != 0; }
   bool IsDeleted() const { return DeletedField::decode(value_) != 0;}

Index: src/property.h
diff --git a/src/property.h b/src/property.h
index ab2dcef8081eb8441f118abd8d276c3b0ea282a4..f64f9df849f0ef5af68824c4a4ebe96edb4e3830 100644
--- a/src/property.h
+++ b/src/property.h
@@ -260,7 +260,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
     return IsDescriptorOrDictionary() && type() == CONSTANT;
   }

-  bool IsDontDelete() const { return details_.IsDontDelete(); }
+  bool IsConfigurable() const { return details_.IsConfigurable(); }
   bool IsDontEnum() const { return details_.IsDontEnum(); }
   bool IsFound() const { return lookup_type_ != NOT_FOUND; }
   bool IsDescriptorOrDictionary() const {


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