From: jochen@chromium.org Date: Tue, 21 Jan 2014 11:48:51 +0000 (+0000) Subject: Move the temporary private freelist closer to where it's used X-Git-Tag: upstream/4.7.83~11084 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b3b9bd316eba197da97288fc6a9ca59a8b0fc0f;p=platform%2Fupstream%2Fv8.git 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 --- 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_; };