From a373e7530c67c964146555c37ad07b5f73737272 Mon Sep 17 00:00:00 2001 From: ulan Date: Tue, 5 Jan 2016 05:10:55 -0800 Subject: [PATCH] Guard UnmapFreeMemoryTask with a flag. BUG=chromium:574349 LOG=NO Review URL: https://codereview.chromium.org/1553233003 Cr-Commit-Position: refs/heads/master@{#33113} --- src/heap/heap.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/heap/heap.cc b/src/heap/heap.cc index 0bd763bc76..40c8e7914b 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -6098,9 +6098,14 @@ void Heap::FilterStoreBufferEntriesOnAboutToBeFreedPages() { void Heap::FreeQueuedChunks() { if (chunks_queued_for_free_ != NULL) { - V8::GetCurrentPlatform()->CallOnBackgroundThread( - new UnmapFreeMemoryTask(this, chunks_queued_for_free_), - v8::Platform::kShortRunningTask); + if (FLAG_concurrent_sweeping) { + V8::GetCurrentPlatform()->CallOnBackgroundThread( + new UnmapFreeMemoryTask(this, chunks_queued_for_free_), + v8::Platform::kShortRunningTask); + } else { + FreeQueuedChunks(chunks_queued_for_free_); + pending_unmapping_tasks_semaphore_.Signal(); + } chunks_queued_for_free_ = NULL; } else { // If we do not have anything to unmap, we just signal the semaphore