Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 0bd763bc763b7d22826cbd0646ac4dd69860640b..40c8e7914befb61c129f659dd5f3b62924a88e8d 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 |