From ef0068558a8167784bd2a14bfebb7acc938df2ea Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Thu, 21 Aug 2014 09:34:47 +0000 Subject: [PATCH] Rename IsDontDelete to IsConfigurable (and invert conditions) BUG= R=ulan@chromium.org Review URL: https://codereview.chromium.org/494063002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23267 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/elements.cc | 2 +- src/hydrogen-instructions.cc | 6 +++--- src/hydrogen-instructions.h | 4 +--- src/hydrogen.h | 2 +- src/lookup.h | 2 +- src/objects.cc | 8 ++++---- src/property-details.h | 2 +- src/property.h | 2 +- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/elements.cc b/src/elements.cc index c95ca5d..76b9b03 100644 --- a/src/elements.cc +++ b/src/elements.cc @@ -1364,7 +1364,7 @@ class DictionaryElementsAccessor uint32_t number = static_cast(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; } } } diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 5b5386b..dbfe555 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; } diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 4c29e34..ec50f5b 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -5793,9 +5793,7 @@ class HStoreGlobalCell V8_FINAL : public HUnaryOperation { Handle, PropertyDetails); Unique cell() const { return cell_; } - bool RequiresHoleCheck() { - return !details_.IsDontDelete() || details_.IsReadOnly(); - } + bool RequiresHoleCheck() { return details_.IsConfigurable(); } bool NeedsWriteBarrier() { return StoringValueNeedsWriteBarrier(value()); } diff --git a/src/hydrogen.h b/src/hydrogen.h index f98f28d..158322f 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(); } diff --git a/src/lookup.h b/src/lookup.h index 5e2b492..e09eeee 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(); diff --git a/src/objects.cc b/src/objects.cc index 7257871..57f3918 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -709,11 +709,11 @@ Handle JSObject::DeleteNormalizedProperty(Handle 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 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 Dictionary::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(); } diff --git a/src/property-details.h b/src/property-details.h index 960c46c..3e54473 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;} diff --git a/src/property.h b/src/property.h index ab2dcef..f64f9df 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 { -- 2.7.4