Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1472)

Unified Diff: src/heap/heap.cc

Issue 1320893002: Wait for concurrent unmapping tasks in GC prologue. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index accae68a1260ce53ba5fe2b83f996e5633b2d7ee..e9d3492000d15e4767ffe9ea3f5052e7cdbbd552 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -137,7 +137,8 @@ Heap::Heap()
current_gc_callback_flags_(GCCallbackFlags::kNoGCCallbackFlags),
external_string_table_(this),
chunks_queued_for_free_(NULL),
- pending_unmap_job_semaphore_(0),
+ concurrent_unmapping_tasks_active_(0),
+ pending_unmapping_tasks_semaphore_(0),
gc_callbacks_depth_(0),
deserialization_complete_(false),
concurrent_sweeping_enabled_(false),
@@ -5760,6 +5761,8 @@ void Heap::TearDown() {
memory_reducer_ = nullptr;
}
+ WaitUntilUnmappingOfFreeChunksCompleted();
+
TearDownArrayBuffers();
isolate_->global_handles()->TearDown();
@@ -6524,7 +6527,7 @@ class Heap::UnmapFreeMemoryTask : public v8::Task {
// v8::Task overrides.
void Run() override {
heap_->FreeQueuedChunks(head_);
- heap_->pending_unmap_job_semaphore_.Signal();
+ heap_->pending_unmapping_tasks_semaphore_.Signal();
}
Heap* heap_;
@@ -6535,9 +6538,10 @@ class Heap::UnmapFreeMemoryTask : public v8::Task {
void Heap::WaitUntilUnmappingOfFreeChunksCompleted() {
- // We start an unmap job after sweeping and after compaction.
- pending_unmap_job_semaphore_.Wait();
- pending_unmap_job_semaphore_.Wait();
+ while (concurrent_unmapping_tasks_active_ > 0) {
+ pending_unmapping_tasks_semaphore_.Wait();
+ concurrent_unmapping_tasks_active_--;
+ }
}
@@ -6574,8 +6578,9 @@ void Heap::FreeQueuedChunks() {
} else {
// If we do not have anything to unmap, we just signal the semaphore
// that we are done.
- pending_unmap_job_semaphore_.Signal();
+ pending_unmapping_tasks_semaphore_.Signal();
}
+ concurrent_unmapping_tasks_active_++;
}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698