Commit ef006855 authored by verwaest@chromium.org's avatar verwaest@chromium.org

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
parent ad3a1a99
...@@ -1364,7 +1364,7 @@ class DictionaryElementsAccessor ...@@ -1364,7 +1364,7 @@ class DictionaryElementsAccessor
uint32_t number = static_cast<uint32_t>(key->Number()); uint32_t number = static_cast<uint32_t>(key->Number());
if (new_length <= number && number < old_length) { if (new_length <= number && number < old_length) {
PropertyDetails details = dict->DetailsAt(i); PropertyDetails details = dict->DetailsAt(i);
if (details.IsDontDelete()) new_length = number + 1; if (!details.IsConfigurable()) new_length = number + 1;
} }
} }
} }
......
...@@ -3584,14 +3584,14 @@ OStream& HTransitionElementsKind::PrintDataTo(OStream& os) const { // NOLINT ...@@ -3584,14 +3584,14 @@ OStream& HTransitionElementsKind::PrintDataTo(OStream& os) const { // NOLINT
OStream& HLoadGlobalCell::PrintDataTo(OStream& os) const { // NOLINT OStream& HLoadGlobalCell::PrintDataTo(OStream& os) const { // NOLINT
os << "[" << *cell().handle() << "]"; os << "[" << *cell().handle() << "]";
if (!details_.IsDontDelete()) os << " (deleteable)"; if (details_.IsConfigurable()) os << " (configurable)";
if (details_.IsReadOnly()) os << " (read-only)"; if (details_.IsReadOnly()) os << " (read-only)";
return os; return os;
} }
bool HLoadGlobalCell::RequiresHoleCheck() const { bool HLoadGlobalCell::RequiresHoleCheck() const {
if (details_.IsDontDelete() && !details_.IsReadOnly()) return false; if (!details_.IsConfigurable()) return false;
for (HUseIterator it(uses()); !it.Done(); it.Advance()) { for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
HValue* use = it.value(); HValue* use = it.value();
if (!use->IsChange()) return true; if (!use->IsChange()) return true;
...@@ -3613,7 +3613,7 @@ OStream& HInnerAllocatedObject::PrintDataTo(OStream& os) const { // NOLINT ...@@ -3613,7 +3613,7 @@ OStream& HInnerAllocatedObject::PrintDataTo(OStream& os) const { // NOLINT
OStream& HStoreGlobalCell::PrintDataTo(OStream& os) const { // NOLINT OStream& HStoreGlobalCell::PrintDataTo(OStream& os) const { // NOLINT
os << "[" << *cell().handle() << "] = " << NameOf(value()); os << "[" << *cell().handle() << "] = " << NameOf(value());
if (!details_.IsDontDelete()) os << " (deleteable)"; if (details_.IsConfigurable()) os << " (configurable)";
if (details_.IsReadOnly()) os << " (read-only)"; if (details_.IsReadOnly()) os << " (read-only)";
return os; return os;
} }
......
...@@ -5793,9 +5793,7 @@ class HStoreGlobalCell V8_FINAL : public HUnaryOperation { ...@@ -5793,9 +5793,7 @@ class HStoreGlobalCell V8_FINAL : public HUnaryOperation {
Handle<PropertyCell>, PropertyDetails); Handle<PropertyCell>, PropertyDetails);
Unique<PropertyCell> cell() const { return cell_; } Unique<PropertyCell> cell() const { return cell_; }
bool RequiresHoleCheck() { bool RequiresHoleCheck() { return details_.IsConfigurable(); }
return !details_.IsDontDelete() || details_.IsReadOnly();
}
bool NeedsWriteBarrier() { bool NeedsWriteBarrier() {
return StoringValueNeedsWriteBarrier(value()); return StoringValueNeedsWriteBarrier(value());
} }
......
...@@ -2510,7 +2510,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { ...@@ -2510,7 +2510,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
bool IsAccessor() const { return lookup_.IsPropertyCallbacks(); } bool IsAccessor() const { return lookup_.IsPropertyCallbacks(); }
bool IsTransition() const { return lookup_.IsTransition(); } 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 IsReadOnly() const { return lookup_.IsReadOnly(); }
bool IsCacheable() const { return lookup_.IsCacheable(); } bool IsCacheable() const { return lookup_.IsCacheable(); }
......
...@@ -153,7 +153,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED { ...@@ -153,7 +153,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
DCHECK(has_property_); DCHECK(has_property_);
return property_details_; return property_details_;
} }
bool IsConfigurable() const { return !property_details().IsDontDelete(); } bool IsConfigurable() const { return property_details().IsConfigurable(); }
bool IsReadOnly() const { return property_details().IsReadOnly(); } bool IsReadOnly() const { return property_details().IsReadOnly(); }
Representation representation() const { Representation representation() const {
return property_details().representation(); return property_details().representation();
......
...@@ -709,11 +709,11 @@ Handle<Object> JSObject::DeleteNormalizedProperty(Handle<JSObject> object, ...@@ -709,11 +709,11 @@ Handle<Object> JSObject::DeleteNormalizedProperty(Handle<JSObject> object,
// If we have a global object set the cell to the hole. // If we have a global object set the cell to the hole.
if (object->IsGlobalObject()) { if (object->IsGlobalObject()) {
PropertyDetails details = dictionary->DetailsAt(entry); PropertyDetails details = dictionary->DetailsAt(entry);
if (details.IsDontDelete()) { if (!details.IsConfigurable()) {
if (mode != FORCE_DELETION) return isolate->factory()->false_value(); if (mode != FORCE_DELETION) return isolate->factory()->false_value();
// When forced to delete global properties, we have to make a // When forced to delete global properties, we have to make a
// map change to invalidate any ICs that think they can load // 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. // the hole value.
Handle<Map> new_map = Map::CopyDropDescriptors(handle(object->map())); Handle<Map> new_map = Map::CopyDropDescriptors(handle(object->map()));
DCHECK(new_map->is_dictionary_map()); DCHECK(new_map->is_dictionary_map());
...@@ -6008,7 +6008,7 @@ static bool UpdateGetterSetterInDictionary( ...@@ -6008,7 +6008,7 @@ static bool UpdateGetterSetterInDictionary(
Object* result = dictionary->ValueAt(entry); Object* result = dictionary->ValueAt(entry);
PropertyDetails details = dictionary->DetailsAt(entry); PropertyDetails details = dictionary->DetailsAt(entry);
if (details.type() == CALLBACKS && result->IsAccessorPair()) { if (details.type() == CALLBACKS && result->IsAccessorPair()) {
DCHECK(!details.IsDontDelete()); DCHECK(details.IsConfigurable());
if (details.attributes() != attributes) { if (details.attributes() != attributes) {
dictionary->DetailsAtPut( dictionary->DetailsAtPut(
entry, entry,
...@@ -15121,7 +15121,7 @@ Handle<Object> Dictionary<Derived, Shape, Key>::DeleteProperty( ...@@ -15121,7 +15121,7 @@ Handle<Object> Dictionary<Derived, Shape, Key>::DeleteProperty(
Factory* factory = dictionary->GetIsolate()->factory(); Factory* factory = dictionary->GetIsolate()->factory();
PropertyDetails details = dictionary->DetailsAt(entry); PropertyDetails details = dictionary->DetailsAt(entry);
// Ignore attributes if forcing a deletion. // Ignore attributes if forcing a deletion.
if (details.IsDontDelete() && mode != JSReceiver::FORCE_DELETION) { if (!details.IsConfigurable() && mode != JSReceiver::FORCE_DELETION) {
return factory->false_value(); return factory->false_value();
} }
......
...@@ -260,7 +260,7 @@ class PropertyDetails BASE_EMBEDDED { ...@@ -260,7 +260,7 @@ class PropertyDetails BASE_EMBEDDED {
} }
bool IsReadOnly() const { return (attributes() & READ_ONLY) != 0; } 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 IsDontEnum() const { return (attributes() & DONT_ENUM) != 0; }
bool IsDeleted() const { return DeletedField::decode(value_) != 0;} bool IsDeleted() const { return DeletedField::decode(value_) != 0;}
......
...@@ -260,7 +260,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED { ...@@ -260,7 +260,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
return IsDescriptorOrDictionary() && type() == CONSTANT; return IsDescriptorOrDictionary() && type() == CONSTANT;
} }
bool IsDontDelete() const { return details_.IsDontDelete(); } bool IsConfigurable() const { return details_.IsConfigurable(); }
bool IsDontEnum() const { return details_.IsDontEnum(); } bool IsDontEnum() const { return details_.IsDontEnum(); }
bool IsFound() const { return lookup_type_ != NOT_FOUND; } bool IsFound() const { return lookup_type_ != NOT_FOUND; }
bool IsDescriptorOrDictionary() const { bool IsDescriptorOrDictionary() const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment