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

Unified Diff: src/builtins.cc

Issue 1690953002: [runtime/heap] Introduce CopyFixedArrayUpTo to match CopyFixedArrayAndGrow, copying to a smaller ar… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index c6368bbd573c674417b4da5b37955b8b455f1e5e..29bfa2f00ef580258c88d764d2a01d63986b2b04 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1869,10 +1869,7 @@ BUILTIN(ObjectKeys) {
if (enum_length != 0) {
Handle<FixedArray> cache(
js_object->map()->instance_descriptors()->GetEnumCache());
- keys = isolate->factory()->NewFixedArray(enum_length);
- for (int i = 0; i < enum_length; i++) {
- keys->set(i, cache->get(i));
- }
+ keys = isolate->factory()->CopyFixedArrayUpTo(cache, enum_length);
}
}
}
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698