Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index ea797a5866a63fb26dd46b76baeadb85effeccc6..4b28368b0ece878d57088b0db8cc9db855626af8 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -3770,10 +3770,10 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) { |
PageIterator it(space); |
- intptr_t freed_bytes = 0; |
int pages_swept = 0; |
bool lazy_sweeping_active = false; |
bool unused_page_present = false; |
+ bool parallel_sweeping_active = false; |
while (it.has_next()) { |
Page* p = it.next(); |
@@ -3809,15 +3809,6 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) { |
unused_page_present = true; |
} |
- if (lazy_sweeping_active) { |
- if (FLAG_gc_verbose) { |
- PrintF("Sweeping 0x%" V8PRIxPTR " lazily postponed.\n", |
- reinterpret_cast<intptr_t>(p)); |
- } |
- space->IncreaseUnsweptFreeBytes(p); |
- continue; |
- } |
- |
switch (sweeper) { |
case CONSERVATIVE: { |
if (FLAG_gc_verbose) { |
@@ -3829,24 +3820,42 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) { |
break; |
} |
case LAZY_CONSERVATIVE: { |
- if (FLAG_gc_verbose) { |
- PrintF("Sweeping 0x%" V8PRIxPTR " conservatively as needed.\n", |
- reinterpret_cast<intptr_t>(p)); |
+ if (lazy_sweeping_active) { |
+ if (FLAG_gc_verbose) { |
+ PrintF("Sweeping 0x%" V8PRIxPTR " lazily postponed.\n", |
+ reinterpret_cast<intptr_t>(p)); |
+ } |
+ space->IncreaseUnsweptFreeBytes(p); |
+ } else { |
+ if (FLAG_gc_verbose) { |
+ PrintF("Sweeping 0x%" V8PRIxPTR " conservatively.\n", |
+ reinterpret_cast<intptr_t>(p)); |
+ } |
+ SweepConservatively<SWEEP_SEQUENTIALLY>(space, NULL, p); |
+ pages_swept++; |
+ space->SetPagesToSweep(p->next_page()); |
+ lazy_sweeping_active = true; |
} |
- freed_bytes += SweepConservatively<SWEEP_SEQUENTIALLY>(space, NULL, p); |
- pages_swept++; |
- space->SetPagesToSweep(p->next_page()); |
- lazy_sweeping_active = true; |
break; |
} |
case CONCURRENT_CONSERVATIVE: |
case PARALLEL_CONSERVATIVE: { |
- if (FLAG_gc_verbose) { |
- PrintF("Sweeping 0x%" V8PRIxPTR " conservatively in parallel.\n", |
- reinterpret_cast<intptr_t>(p)); |
+ if (!parallel_sweeping_active) { |
+ if (FLAG_gc_verbose) { |
+ PrintF("Sweeping 0x%" V8PRIxPTR " conservatively.\n", |
+ reinterpret_cast<intptr_t>(p)); |
+ } |
+ SweepConservatively<SWEEP_SEQUENTIALLY>(space, NULL, p); |
+ pages_swept++; |
+ parallel_sweeping_active = true; |
+ } else { |
+ if (FLAG_gc_verbose) { |
+ PrintF("Sweeping 0x%" V8PRIxPTR " conservatively in parallel.\n", |
+ reinterpret_cast<intptr_t>(p)); |
+ } |
+ p->set_parallel_sweeping(1); |
+ space->IncreaseUnsweptFreeBytes(p); |
} |
- p->set_parallel_sweeping(1); |
- space->IncreaseUnsweptFreeBytes(p); |
break; |
} |
case PRECISE: { |