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

Unified Diff: src/mark-compact.cc

Issue 404083002: Wait for sweeper threads when a scan on scavenge page is not swept. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/mark-compact.h ('k') | src/store-buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ||
« no previous file with comments | « src/mark-compact.h ('k') | src/store-buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698