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

Unified Diff: src/api.cc

Issue 1766293002: [runtime] JSObject::GetKeys never returns the EnumCache, so we don't need to copy in GetPropertyNam… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 2f65cafb95be4d1acdc98ef296af651ad0a74771..07d7f59f6eeb3ce135848f8fdb90a8442dcf3b87 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3783,11 +3783,10 @@ MaybeLocal<Array> v8::Object::GetPropertyNames(Local<Context> context) {
!i::JSReceiver::GetKeys(self, i::INCLUDE_PROTOS, i::ENUMERABLE_STRINGS)
.ToHandle(&value);
RETURN_ON_FAILED_EXECUTION(Array);
- // Because we use caching to speed up enumeration it is important
- // to never change the result of the basic enumeration function so
- // we clone the result.
- auto elms = isolate->factory()->CopyFixedArray(value);
- auto result = isolate->factory()->NewJSArrayWithElements(elms);
+ DCHECK(self->map()->EnumLength() == i::kInvalidEnumCacheSentinel ||
+ self->map()->EnumLength() == 0 ||
+ self->map()->instance_descriptors()->GetEnumCache() != *value);
+ auto result = isolate->factory()->NewJSArrayWithElements(value);
RETURN_ESCAPED(Utils::ToLocal(result));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698