Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: src/objects.cc

Issue 352813002: Wrap InitializeProperty around SetOwnPropertyIgnoreAttributes and switch over uses (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index e9bedcadeb1eff4b9fbd61d29a71a69b1218849c..7e76f3e42e578839127dc3759d3f82e31749afe9 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4175,6 +4175,28 @@ MaybeHandle<Object> JSObject::SetPropertyForResult(
}
+void JSObject::InitializeProperty(
+ Handle<JSObject> object,
+ Handle<Name> name,
+ Handle<Object> value,
+ PropertyAttributes attributes,
+ ValueType value_type,
+ StoreMode store_mode) {
+#ifdef DEBUG
+ uint32_t index;
+ ASSERT(!object->IsJSProxy());
+ ASSERT(!name->AsArrayIndex(&index));
+ LookupIterator it(object, name, LookupIterator::CHECK_OWN_REAL);
+ GetPropertyAttributes(&it);
+ ASSERT(!it.IsFound());
+ ASSERT(object->map()->is_extensible());
+#endif
+ SetOwnPropertyIgnoreAttributes(
+ object, name, value, attributes, value_type, store_mode,
+ OMIT_EXTENSIBILITY_CHECK).Check();
+}
+
+
// Set a real own property, even if it is READ_ONLY. If the property is not
// present, add it with attributes NONE. This code is an exact clone of
// SetProperty, with the check for IsReadOnly and the check for a
@@ -5147,13 +5169,8 @@ Handle<ObjectHashTable> JSObject::GetOrCreateHiddenPropertiesHashtable(
}
JSObject::SetOwnPropertyIgnoreAttributes(
- object,
- isolate->factory()->hidden_string(),
- hashtable,
- DONT_ENUM,
- OPTIMAL_REPRESENTATION,
- ALLOW_AS_CONSTANT,
- OMIT_EXTENSIBILITY_CHECK).Assert();
+ object, isolate->factory()->hidden_string(),
+ hashtable, DONT_ENUM).Assert();
return hashtable;
}

Powered by Google App Engine
This is Rietveld 408576698