Commit a81c47f3 authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Do not perform black allocation in memory reducing mode.

Black allocation discards all old-space free-lists, which may be quite full when we perform memory reducing GCs.

BUG=chromium:599174
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35374}
parent a39544b6
...@@ -557,7 +557,7 @@ void IncrementalMarking::StartMarking() { ...@@ -557,7 +557,7 @@ void IncrementalMarking::StartMarking() {
IncrementalMarkingRootMarkingVisitor visitor(this); IncrementalMarkingRootMarkingVisitor visitor(this);
heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG);
if (FLAG_black_allocation) { if (FLAG_black_allocation && !heap()->ShouldReduceMemory()) {
StartBlackAllocation(); StartBlackAllocation();
} }
...@@ -580,10 +580,12 @@ void IncrementalMarking::StartBlackAllocation() { ...@@ -580,10 +580,12 @@ void IncrementalMarking::StartBlackAllocation() {
} }
void IncrementalMarking::FinishBlackAllocation() { void IncrementalMarking::FinishBlackAllocation() {
if (black_allocation_) {
black_allocation_ = false; black_allocation_ = false;
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Black allocation finished\n"); PrintF("[IncrementalMarking] Black allocation finished\n");
} }
}
} }
void IncrementalMarking::MarkRoots() { void IncrementalMarking::MarkRoots() {
...@@ -756,6 +758,12 @@ void IncrementalMarking::FinalizeIncrementally() { ...@@ -756,6 +758,12 @@ void IncrementalMarking::FinalizeIncrementally() {
(marking_progress < (marking_progress <
FLAG_min_progress_during_incremental_marking_finalization)) { FLAG_min_progress_during_incremental_marking_finalization)) {
finalize_marking_completed_ = true; finalize_marking_completed_ = true;
// If black allocation was not enabled earlier, start black allocation
// here.
if (FLAG_black_allocation && !black_allocation_) {
StartBlackAllocation();
}
} }
} }
......
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