Keep the number of descriptors below DescriptorArray::kMaxNumberOfDescriptors even for accessors

Review URL: https://codereview.chromium.org/11362182

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12916 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 13f8fb47
......@@ -4712,7 +4712,9 @@ MaybeObject* JSObject::DefinePropertyAccessor(String* name,
// to do a lookup, which seems to be a bit of overkill.
Heap* heap = GetHeap();
bool only_attribute_changes = getter->IsNull() && setter->IsNull();
if (HasFastProperties() && !only_attribute_changes) {
if (HasFastProperties() && !only_attribute_changes &&
(map()->NumberOfOwnDescriptors() <
DescriptorArray::kMaxNumberOfDescriptors)) {
MaybeObject* getterOk = heap->undefined_value();
if (!getter->IsNull()) {
getterOk = DefineFastAccessor(name, ACCESSOR_GETTER, getter, attributes);
......
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