From 7b3b9bd316eba197da97288fc6a9ca59a8b0fc0f Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Tue, 21 Jan 2014 11:48:51 +0000 Subject: [PATCH] Move the temporary private freelist closer to where it's used BUG=v8:3104 R=hpayer@chromium.org LOG=n Review URL: https://codereview.chromium.org/143193002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18707 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mark-compact.cc | 8 ++++---- src/mark-compact.h | 3 +-- src/sweeper-thread.cc | 11 +++-------- src/sweeper-thread.h | 2 -- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/mark-compact.cc b/src/mark-compact.cc index 2d030a2..3a03ac2 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -3976,18 +3976,18 @@ intptr_t MarkCompactCollector::SweepConservatively(PagedSpace* space, } -void MarkCompactCollector::SweepInParallel(PagedSpace* space, - FreeList* private_free_list) { +void MarkCompactCollector::SweepInParallel(PagedSpace* space) { PageIterator it(space); FreeList* free_list = space == heap()->old_pointer_space() ? free_list_old_pointer_space_.get() : free_list_old_data_space_.get(); + FreeList private_free_list(space); while (it.has_next()) { Page* p = it.next(); if (p->TryParallelSweeping()) { - SweepConservatively(space, private_free_list, p); - free_list->Concatenate(private_free_list); + SweepConservatively(space, &private_free_list, p); + free_list->Concatenate(&private_free_list); } } } diff --git a/src/mark-compact.h b/src/mark-compact.h index f44d6ca..c14f0b0 100644 --- a/src/mark-compact.h +++ b/src/mark-compact.h @@ -717,8 +717,7 @@ class MarkCompactCollector { MarkingParity marking_parity() { return marking_parity_; } // Concurrent and parallel sweeping support. - void SweepInParallel(PagedSpace* space, - FreeList* private_free_list); + void SweepInParallel(PagedSpace* space); void WaitUntilSweepingCompleted(); diff --git a/src/sweeper-thread.cc b/src/sweeper-thread.cc index 741b9db..097b594 100644 --- a/src/sweeper-thread.cc +++ b/src/sweeper-thread.cc @@ -44,10 +44,7 @@ SweeperThread::SweeperThread(Isolate* isolate) collector_(heap_->mark_compact_collector()), start_sweeping_semaphore_(0), end_sweeping_semaphore_(0), - stop_semaphore_(0), - private_free_list_old_data_space_(heap_->paged_space(OLD_DATA_SPACE)), - private_free_list_old_pointer_space_( - heap_->paged_space(OLD_POINTER_SPACE)) { + stop_semaphore_(0) { NoBarrier_Store(&stop_thread_, static_cast(false)); } @@ -66,10 +63,8 @@ void SweeperThread::Run() { return; } - collector_->SweepInParallel(heap_->old_data_space(), - &private_free_list_old_data_space_); - collector_->SweepInParallel(heap_->old_pointer_space(), - &private_free_list_old_pointer_space_); + collector_->SweepInParallel(heap_->old_data_space()); + collector_->SweepInParallel(heap_->old_pointer_space()); end_sweeping_semaphore_.Signal(); } } diff --git a/src/sweeper-thread.h b/src/sweeper-thread.h index 085d5d0..3f7917b 100644 --- a/src/sweeper-thread.h +++ b/src/sweeper-thread.h @@ -59,8 +59,6 @@ class SweeperThread : public Thread { Semaphore start_sweeping_semaphore_; Semaphore end_sweeping_semaphore_; Semaphore stop_semaphore_; - FreeList private_free_list_old_data_space_; - FreeList private_free_list_old_pointer_space_; volatile AtomicWord stop_thread_; }; -- 2.7.4