Chromium Code Reviews| Index: src/mark-compact.cc |
| diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
| index ea797a5866a63fb26dd46b76baeadb85effeccc6..91b2f0518cedfae5a78982a450209bbb5176b0d8 100644 |
| --- a/src/mark-compact.cc |
| +++ b/src/mark-compact.cc |
| @@ -3774,6 +3774,7 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) { |
| 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 +3810,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 +3821,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)); |
| + } |
| + freed_bytes += SweepConservatively<SWEEP_SEQUENTIALLY>(space, NULL, p); |
|
Michael Starzinger
2013/03/05 17:46:33
Longer than 80 characters. Also the free_bytes cou
Hannes Payer (out of office)
2013/03/05 17:48:38
Already done.
|
| + 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: { |