Chromium Code Reviews| Index: src/heap/incremental-marking.cc |
| diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc |
| index 686c6738821437a1621c4f495391632813ae58e3..2f16ad3af1b3e75a8c7741743d8d2ede61e2c9d1 100644 |
| --- a/src/heap/incremental-marking.cc |
| +++ b/src/heap/incremental-marking.cc |
| @@ -557,7 +557,7 @@ void IncrementalMarking::StartMarking() { |
| IncrementalMarkingRootMarkingVisitor visitor(this); |
| heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); |
| - if (FLAG_black_allocation) { |
| + if (FLAG_black_allocation && !heap()->ShouldReduceMemory()) { |
| StartBlackAllocation(); |
| } |
| @@ -583,9 +583,11 @@ void IncrementalMarking::StartBlackAllocation() { |
| } |
| void IncrementalMarking::FinishBlackAllocation() { |
| - black_allocation_ = false; |
| - if (FLAG_trace_incremental_marking) { |
| - PrintF("[IncrementalMarking] Black allocation finished\n"); |
| + if (black_allocation_) { |
|
Hannes Payer (out of office)
2016/04/08 11:43:25
We cannot guarantee that black allocation was on.
|
| + black_allocation_ = false; |
| + if (FLAG_trace_incremental_marking) { |
| + PrintF("[IncrementalMarking] Black allocation finished\n"); |
| + } |
| } |
| } |
| @@ -759,6 +761,12 @@ void IncrementalMarking::FinalizeIncrementally() { |
| (marking_progress < |
| FLAG_min_progress_during_incremental_marking_finalization)) { |
| finalize_marking_completed_ = true; |
| + |
| + // If black allocation was not enabled earlier, start black allocation |
| + // here. |
| + if (FLAG_black_allocation && !black_allocation_) { |
| + StartBlackAllocation(); |
| + } |
| } |
| } |