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

Unified Diff: src/heap/heap.cc

Issue 1180263006: Only shrink new space when we are not in the process of obtaining pretenuring feedback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 361b4d91d7ffbdbf128fb05f6dde00e27f84e0a7..e1d01f5423b821427d2fc5e0b3cb3c61f4ca8344 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -530,7 +530,8 @@ void Heap::RepairFreeListsAfterDeserialization() {
}
-void Heap::ProcessPretenuringFeedback() {
+bool Heap::ProcessPretenuringFeedback() {
+ bool trigger_deoptimization = false;
if (FLAG_allocation_site_pretenuring) {
int tenure_decisions = 0;
int dont_tenure_decisions = 0;
@@ -551,7 +552,6 @@ void Heap::ProcessPretenuringFeedback() {
int i = 0;
Object* list_element = allocation_sites_list();
- bool trigger_deoptimization = false;
bool maximum_size_scavenge = MaximumSizeScavenge();
while (use_scratchpad ? i < allocation_sites_scratchpad_length_
: list_element->IsAllocationSite()) {
@@ -603,6 +603,7 @@ void Heap::ProcessPretenuringFeedback() {
dont_tenure_decisions);
}
}
+ return trigger_deoptimization;
}
@@ -632,9 +633,6 @@ void Heap::GarbageCollectionEpilogue() {
ZapFromSpace();
}
- // Process pretenuring feedback and update allocation sites.
- ProcessPretenuringFeedback();
-
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
Verify();
@@ -1250,9 +1248,14 @@ bool Heap::PerformGarbageCollection(
Scavenge();
}
-
+ bool deopted = ProcessPretenuringFeedback();
UpdateSurvivalStatistics(start_new_space_size);
- ConfigureNewGenerationSize();
+
+ // When pretenuring is collecting new feedback, we do not shrink the new space
+ // right away.
+ if (!deopted) {
+ ConfigureNewGenerationSize();
+ }
ConfigureInitialOldGenerationSize();
isolate_->counters()->objs_since_last_young()->Set(0);
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698