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() {
}
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);
// 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);
......
......@@ -1865,7 +1865,7 @@ class Heap {
// space evacuation. Note that between feedback collection and calling this
// method object in old space must not move.
// Right now we only process pretenuring feedback in high promotion mode.
void ProcessPretenuringFeedback();
bool ProcessPretenuringFeedback();
// Checks whether a global GC is necessary
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