Commit 72456950 authored by ulan's avatar ulan Committed by Commit bot

[heap] Properly handle --noconcurrent-sweeping flag in page unmapper.

BUG=

Review-Url: https://codereview.chromium.org/2347073003
Cr-Commit-Position: refs/heads/master@{#39544}
parent 4286f2c0
......@@ -1163,8 +1163,8 @@ void IncrementalMarking::SpeedUp() {
void IncrementalMarking::FinalizeSweeping() {
DCHECK(state_ == SWEEPING);
if (heap_->mark_compact_collector()->sweeping_in_progress() &&
(heap_->mark_compact_collector()->sweeper().IsSweepingCompleted() ||
!FLAG_concurrent_sweeping)) {
(!FLAG_concurrent_sweeping ||
heap_->mark_compact_collector()->sweeper().IsSweepingCompleted())) {
heap_->mark_compact_collector()->EnsureSweepingCompleted();
}
if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
......
......@@ -567,6 +567,7 @@ void MarkCompactCollector::EnsureSweepingCompleted() {
}
bool MarkCompactCollector::Sweeper::IsSweepingCompleted() {
DCHECK(FLAG_concurrent_sweeping);
while (pending_sweeper_tasks_semaphore_.WaitFor(
base::TimeDelta::FromSeconds(0))) {
num_sweeping_tasks_.Increment(-1);
......
......@@ -398,7 +398,7 @@ bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) {
// We cannot free memory chunks in new space while the sweeper is running
// since a sweeper thread might be stuck right before trying to lock the
// corresponding page.
return !chunk->InNewSpace() || (mc == nullptr) ||
return !chunk->InNewSpace() || (mc == nullptr) || !FLAG_concurrent_sweeping ||
mc->sweeper().IsSweepingCompleted();
}
......
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