Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 196184d

Browse files
svenpanne@chromium.orgindutny
authored andcommitted
v8: backport codereview.chromium.org/11362182
Keep the number of descriptors below DescriptorArray::kMaxNumberOfDescriptors even for accessors Review URL: https://codereview.chromium.org/11362182
1 parent 56913d2 commit 196184d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

deps/v8/src/objects.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -4453,7 +4453,9 @@ MaybeObject* JSObject::DefinePropertyAccessor(String* name,
44534453
// to do a lookup, which seems to be a bit of overkill.
44544454
Heap* heap = GetHeap();
44554455
bool only_attribute_changes = getter->IsNull() && setter->IsNull();
4456-
if (HasFastProperties() && !only_attribute_changes) {
4456+
if (HasFastProperties() && !only_attribute_changes &&
4457+
(map()->NumberOfOwnDescriptors() <
4458+
DescriptorArray::kMaxNumberOfDescriptors)) {
44574459
MaybeObject* getterOk = heap->undefined_value();
44584460
if (!getter->IsNull()) {
44594461
getterOk = DefineFastAccessor(name, ACCESSOR_GETTER, getter, attributes);

0 commit comments

Comments
 (0)