[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}
This commit is contained in:
parent
a39544b674
commit
a81c47f358
@ -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();
|
||||
}
|
||||
|
||||
@ -580,9 +580,11 @@ void IncrementalMarking::StartBlackAllocation() {
|
||||
}
|
||||
|
||||
void IncrementalMarking::FinishBlackAllocation() {
|
||||
black_allocation_ = false;
|
||||
if (FLAG_trace_incremental_marking) {
|
||||
PrintF("[IncrementalMarking] Black allocation finished\n");
|
||||
if (black_allocation_) {
|
||||
black_allocation_ = false;
|
||||
if (FLAG_trace_incremental_marking) {
|
||||
PrintF("[IncrementalMarking] Black allocation finished\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -756,6 +758,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user