Commit 443f6765 authored by hpayer's avatar hpayer Committed by Commit bot

Only shrink new space when we are not in the process of obtaining pretenuring feedback.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29053}
parent 72f85045
...@@ -530,7 +530,8 @@ void Heap::RepairFreeListsAfterDeserialization() { ...@@ -530,7 +530,8 @@ void Heap::RepairFreeListsAfterDeserialization() {
} }
void Heap::ProcessPretenuringFeedback() { bool Heap::ProcessPretenuringFeedback() {
bool trigger_deoptimization = false;
if (FLAG_allocation_site_pretenuring) { if (FLAG_allocation_site_pretenuring) {
int tenure_decisions = 0; int tenure_decisions = 0;
int dont_tenure_decisions = 0; int dont_tenure_decisions = 0;
...@@ -551,7 +552,6 @@ void Heap::ProcessPretenuringFeedback() { ...@@ -551,7 +552,6 @@ void Heap::ProcessPretenuringFeedback() {
int i = 0; int i = 0;
Object* list_element = allocation_sites_list(); Object* list_element = allocation_sites_list();
bool trigger_deoptimization = false;
bool maximum_size_scavenge = MaximumSizeScavenge(); bool maximum_size_scavenge = MaximumSizeScavenge();
while (use_scratchpad ? i < allocation_sites_scratchpad_length_ while (use_scratchpad ? i < allocation_sites_scratchpad_length_
: list_element->IsAllocationSite()) { : list_element->IsAllocationSite()) {
...@@ -603,6 +603,7 @@ void Heap::ProcessPretenuringFeedback() { ...@@ -603,6 +603,7 @@ void Heap::ProcessPretenuringFeedback() {
dont_tenure_decisions); dont_tenure_decisions);
} }
} }
return trigger_deoptimization;
} }
...@@ -632,9 +633,6 @@ void Heap::GarbageCollectionEpilogue() { ...@@ -632,9 +633,6 @@ void Heap::GarbageCollectionEpilogue() {
ZapFromSpace(); ZapFromSpace();
} }
// Process pretenuring feedback and update allocation sites.
ProcessPretenuringFeedback();
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (FLAG_verify_heap) { if (FLAG_verify_heap) {
Verify(); Verify();
...@@ -1250,9 +1248,14 @@ bool Heap::PerformGarbageCollection( ...@@ -1250,9 +1248,14 @@ bool Heap::PerformGarbageCollection(
Scavenge(); Scavenge();
} }
bool deopted = ProcessPretenuringFeedback();
UpdateSurvivalStatistics(start_new_space_size); 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(); ConfigureInitialOldGenerationSize();
isolate_->counters()->objs_since_last_young()->Set(0); isolate_->counters()->objs_since_last_young()->Set(0);
......
...@@ -1865,7 +1865,7 @@ class Heap { ...@@ -1865,7 +1865,7 @@ class Heap {
// space evacuation. Note that between feedback collection and calling this // space evacuation. Note that between feedback collection and calling this
// method object in old space must not move. // method object in old space must not move.
// Right now we only process pretenuring feedback in high promotion mode. // Right now we only process pretenuring feedback in high promotion mode.
void ProcessPretenuringFeedback(); bool ProcessPretenuringFeedback();
// Checks whether a global GC is necessary // Checks whether a global GC is necessary
GarbageCollector SelectGarbageCollector(AllocationSpace space, GarbageCollector SelectGarbageCollector(AllocationSpace space,
......
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