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

Unified Diff: src/heap/heap.cc

Issue 1913083002: [heap] Uncommit pooled pages concurrently (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 4 years, 8 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 51d09edf32b2f77286a23fa85edcd703f15af12c..fb7e0325ac7cb4f0914c44294a8c269324a62a2e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -157,9 +157,6 @@ Heap::Heap()
current_gc_flags_(Heap::kNoGCFlags),
current_gc_callback_flags_(GCCallbackFlags::kNoGCCallbackFlags),
external_string_table_(this),
- chunks_queued_for_free_(NULL),
- concurrent_unmapping_tasks_active_(0),
- pending_unmapping_tasks_semaphore_(0),
gc_callbacks_depth_(0),
deserialization_complete_(false),
strong_roots_list_(NULL),
@@ -5445,8 +5442,6 @@ void Heap::TearDown() {
delete scavenge_job_;
scavenge_job_ = nullptr;
- WaitUntilUnmappingOfFreeChunksCompleted();
-
delete array_buffer_tracker_;
array_buffer_tracker_ = nullptr;
@@ -6252,75 +6247,6 @@ void Heap::ExternalStringTable::TearDown() {
}
-class Heap::UnmapFreeMemoryTask : public v8::Task {
- public:
- UnmapFreeMemoryTask(Heap* heap, MemoryChunk* head)
- : heap_(heap), head_(head) {}
- virtual ~UnmapFreeMemoryTask() {}
-
- private:
- // v8::Task overrides.
- void Run() override {
- heap_->FreeQueuedChunks(head_);
- heap_->pending_unmapping_tasks_semaphore_.Signal();
- }
-
- Heap* heap_;
- MemoryChunk* head_;
-
- DISALLOW_COPY_AND_ASSIGN(UnmapFreeMemoryTask);
-};
-
-
-void Heap::WaitUntilUnmappingOfFreeChunksCompleted() {
- while (concurrent_unmapping_tasks_active_ > 0) {
- pending_unmapping_tasks_semaphore_.Wait();
- concurrent_unmapping_tasks_active_--;
- }
-}
-
-
-void Heap::QueueMemoryChunkForFree(MemoryChunk* chunk) {
- // PreFree logically frees the memory chunk. However, the actual freeing
- // will happen on a separate thread sometime later.
- memory_allocator()->PreFreeMemory(chunk);
-
- // The chunks added to this queue will be freed by a concurrent thread.
- chunk->set_next_chunk(chunks_queued_for_free_);
- chunks_queued_for_free_ = chunk;
-}
-
-
-void Heap::FreeQueuedChunks() {
- if (chunks_queued_for_free_ != NULL) {
- 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
- // that we are done.
- pending_unmapping_tasks_semaphore_.Signal();
- }
- concurrent_unmapping_tasks_active_++;
-}
-
-
-void Heap::FreeQueuedChunks(MemoryChunk* list_head) {
- MemoryChunk* next;
- MemoryChunk* chunk;
- for (chunk = list_head; chunk != NULL; chunk = next) {
- next = chunk->next_chunk();
- memory_allocator()->PerformFreeMemory(chunk);
- }
-}
-
-
void Heap::RememberUnmappedPage(Address page, bool compacted) {
uintptr_t p = reinterpret_cast<uintptr_t>(page);
// Tag the page pointer to make it findable in the dump file.
« 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