Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index 595d6ee3ce09ddf35ae26cd6a7f7444e78c48802..81361f02aae4023a3aa5d7b202ed89fd73828e7f 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -4098,39 +4098,44 @@ int MarkCompactCollector::SweepConservatively(PagedSpace* space, |
int MarkCompactCollector::SweepInParallel(PagedSpace* space, |
int required_freed_bytes) { |
- 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); |
int max_freed = 0; |
int max_freed_overall = 0; |
+ PageIterator it(space); |
while (it.has_next()) { |
Page* p = it.next(); |
- if (p->TryParallelSweeping()) { |
- if (space->swept_precisely()) { |
- max_freed = SweepPrecisely<SWEEP_ONLY, |
- SWEEP_IN_PARALLEL, |
- IGNORE_SKIP_LIST, |
- IGNORE_FREE_SPACE>( |
- space, &private_free_list, p, NULL); |
- } else { |
- max_freed = SweepConservatively<SWEEP_IN_PARALLEL>( |
- space, &private_free_list, p); |
- } |
- ASSERT(max_freed >= 0); |
- free_list->Concatenate(&private_free_list); |
- if (required_freed_bytes > 0 && max_freed >= required_freed_bytes) { |
- return max_freed; |
- } |
- max_freed_overall = Max(max_freed, max_freed_overall); |
+ max_freed = SweepInParallel(p, space); |
+ ASSERT(max_freed >= 0); |
+ if (required_freed_bytes > 0 && max_freed >= required_freed_bytes) { |
+ return max_freed; |
} |
+ max_freed_overall = Max(max_freed, max_freed_overall); |
if (p == space->end_of_unswept_pages()) break; |
} |
return max_freed_overall; |
} |
+int MarkCompactCollector::SweepInParallel(Page* page, PagedSpace* space) { |
+ int max_freed = 0; |
+ if (page->TryParallelSweeping()) { |
+ 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); |
+ if (space->swept_precisely()) { |
+ max_freed = SweepPrecisely<SWEEP_ONLY, SWEEP_IN_PARALLEL, |
+ IGNORE_SKIP_LIST, IGNORE_FREE_SPACE>( |
+ space, &private_free_list, page, NULL); |
+ } else { |
+ max_freed = SweepConservatively<SWEEP_IN_PARALLEL>( |
+ space, &private_free_list, page); |
+ } |
+ free_list->Concatenate(&private_free_list); |
+ } |
+ return max_freed; |
+} |
+ |
+ |
void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) { |
space->set_swept_precisely(sweeper == PRECISE || |
sweeper == CONCURRENT_PRECISE || |