Commit 25064ff9 authored by verwaest's avatar verwaest Committed by Commit bot

[runtime] JSObject::GetKeys never returns the EnumCache, so we don't need to...

[runtime] JSObject::GetKeys never returns the EnumCache, so we don't need to copy in GetPropertyNames

BUG=148757
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34536}
parent cafe34ae
...@@ -3783,11 +3783,10 @@ MaybeLocal<Array> v8::Object::GetPropertyNames(Local<Context> context) { ...@@ -3783,11 +3783,10 @@ MaybeLocal<Array> v8::Object::GetPropertyNames(Local<Context> context) {
!i::JSReceiver::GetKeys(self, i::INCLUDE_PROTOS, i::ENUMERABLE_STRINGS) !i::JSReceiver::GetKeys(self, i::INCLUDE_PROTOS, i::ENUMERABLE_STRINGS)
.ToHandle(&value); .ToHandle(&value);
RETURN_ON_FAILED_EXECUTION(Array); RETURN_ON_FAILED_EXECUTION(Array);
// Because we use caching to speed up enumeration it is important DCHECK(self->map()->EnumLength() == i::kInvalidEnumCacheSentinel ||
// to never change the result of the basic enumeration function so self->map()->EnumLength() == 0 ||
// we clone the result. self->map()->instance_descriptors()->GetEnumCache() != *value);
auto elms = isolate->factory()->CopyFixedArray(value); auto result = isolate->factory()->NewJSArrayWithElements(value);
auto result = isolate->factory()->NewJSArrayWithElements(elms);
RETURN_ESCAPED(Utils::ToLocal(result)); RETURN_ESCAPED(Utils::ToLocal(result));
} }
......
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