Skip to content

Commit

Permalink
v8: backport codereview.chromium.org/11362182
Browse files Browse the repository at this point in the history
Keep the number of descriptors below
DescriptorArray::kMaxNumberOfDescriptors even for accessors

Review URL: https://codereview.chromium.org/11362182
  • Loading branch information
svenpanne@chromium.org authored and indutny committed Jan 10, 2014
1 parent 56913d2 commit 196184d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deps/v8/src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4453,7 +4453,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);
Expand Down

0 comments on commit 196184d

Please sign in to comment.