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

Unified Diff: src/builtins.cc

Issue 702243003: Basic array capacity feedback via allocation sites. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 6 years, 1 month 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/elements.cc » ('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 c52d22852d0deb8fd4f3e9a0ea9462eadbab6147..40483c2dc9a9463c3328b8038e3119a2234bb6e3 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -348,6 +348,14 @@ BUILTIN(ArrayPush) {
ElementsAccessor::kCopyToEndAndInitializeToHole);
elms = new_elms;
+
+ // Do we have an AllocationMemento, to store this feedback?
+ AllocationMemento* memento =
+ isolate->heap()->FindAllocationMemento(*array);
+ if (memento != NULL && memento->IsValid()) {
+ AllocationSite* site = memento->GetAllocationSite();
+ site->DigestInitialElementsCapacityFeedback(new_length);
+ }
}
// Add the provided values.
« no previous file with comments | « no previous file | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698