 Chromium Code Reviews
 Chromium Code Reviews Issue 11782028:
  Parallel and concurrent sweeping.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 11782028:
  Parallel and concurrent sweeping.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/mark-compact.h | 
| diff --git a/src/mark-compact.h b/src/mark-compact.h | 
| index 9a0b014d633d6a069f288c9341cd9eac38531a66..1595c3bff0d260c4fc9ce909a18671e1d7cd5b7d 100644 | 
| --- a/src/mark-compact.h | 
| +++ b/src/mark-compact.h | 
| @@ -587,9 +587,15 @@ class MarkCompactCollector { | 
| enum SweeperType { | 
| CONSERVATIVE, | 
| LAZY_CONSERVATIVE, | 
| + PARALLEL_CONSERVATIVE, | 
| PRECISE | 
| }; | 
| + enum SweepingParallelism { | 
| + SWEEP_SEQUENTIALLY, | 
| + SWEEP_IN_PARALLEL | 
| + }; | 
| + | 
| #ifdef VERIFY_HEAP | 
| void VerifyMarkbitsAreClean(); | 
| static void VerifyMarkbitsAreClean(PagedSpace* space); | 
| @@ -598,7 +604,10 @@ class MarkCompactCollector { | 
| // Sweep a single page from the given space conservatively. | 
| // Return a number of reclaimed bytes. | 
| - static intptr_t SweepConservatively(PagedSpace* space, Page* p); | 
| + template<SweepingParallelism type> | 
| + static intptr_t SweepConservatively(PagedSpace* space, | 
| + FreeList* free_list, | 
| + Page* p); | 
| INLINE(static bool ShouldSkipEvacuationSlotRecording(Object** anchor)) { | 
| return Page::FromAddress(reinterpret_cast<Address>(anchor))-> | 
| @@ -664,6 +673,16 @@ class MarkCompactCollector { | 
| MarkingParity marking_parity() { return marking_parity_; } | 
| + void SweepInParallel(PagedSpace* space, | 
| + FreeList* private_free_list, | 
| + FreeList* free_list); | 
| + | 
| + void WaitUntilSweepingCompleted(); | 
| + | 
| + intptr_t StealMemoryFromSweeperThreads(PagedSpace* space); | 
| + | 
| + bool AreSweeperThreadsActivated(); | 
| + | 
| private: | 
| MarkCompactCollector(); | 
| ~MarkCompactCollector(); | 
| @@ -672,6 +691,7 @@ class MarkCompactCollector { | 
| void RemoveDeadInvalidatedCode(); | 
| void ProcessInvalidatedCode(ObjectVisitor* visitor); | 
| + void StartSweeperThreads(); | 
| #ifdef DEBUG | 
| enum CollectorState { | 
| @@ -836,6 +856,8 @@ class MarkCompactCollector { | 
| void SweepSpace(PagedSpace* space, SweeperType sweeper); | 
| + void PrepareParallelSweeping(PagedSpace* space); | 
| 
Michael Starzinger
2013/01/30 11:01:19
The implementation of this method is gone, let's a
 
Hannes Payer (out of office)
2013/01/30 12:07:32
Done.
 | 
| + | 
| #ifdef DEBUG | 
| friend class MarkObjectVisitor; | 
| static void VisitObject(HeapObject* obj); |