Chromium Code Reviews| Index: src/mark-compact.cc |
| diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
| index ea797a5866a63fb26dd46b76baeadb85effeccc6..88d9de1813b4621e0570682c7f0c995832ad9a3e 100644 |
| --- a/src/mark-compact.cc |
| +++ b/src/mark-compact.cc |
| @@ -67,6 +67,7 @@ MarkCompactCollector::MarkCompactCollector() : // NOLINT |
| compacting_(false), |
| was_marked_incrementally_(false), |
| sweeping_pending_(false), |
| + sequential_sweeping_(false), |
| tracer_(NULL), |
| migration_slots_buffer_(NULL), |
| heap_(NULL), |
| @@ -3895,37 +3896,38 @@ void MarkCompactCollector::SweepSpaces() { |
| // the map space last because freeing non-live maps overwrites them and |
| // the other spaces rely on possibly non-live maps to get the sizes for |
| // non-live objects. |
| + { SweepingScope scope(this); |
|
Michael Starzinger
2013/03/05 17:20:11
Since the scope extends till the end of this funct
Hannes Payer (out of office)
2013/03/05 17:27:04
Done.
|
| + SweepSpace(heap()->old_pointer_space(), how_to_sweep); |
| + SweepSpace(heap()->old_data_space(), how_to_sweep); |
| + |
| + if (how_to_sweep == PARALLEL_CONSERVATIVE || |
| + how_to_sweep == CONCURRENT_CONSERVATIVE) { |
| + // TODO(hpayer): fix race with concurrent sweeper |
| + StartSweeperThreads(); |
| + } |
| - SweepSpace(heap()->old_pointer_space(), how_to_sweep); |
| - SweepSpace(heap()->old_data_space(), how_to_sweep); |
| - |
| - if (how_to_sweep == PARALLEL_CONSERVATIVE || |
| - how_to_sweep == CONCURRENT_CONSERVATIVE) { |
| - // TODO(hpayer): fix race with concurrent sweeper |
| - StartSweeperThreads(); |
| - } |
| - |
| - if (how_to_sweep == PARALLEL_CONSERVATIVE) { |
| - WaitUntilSweepingCompleted(); |
| - } |
| + if (how_to_sweep == PARALLEL_CONSERVATIVE) { |
| + WaitUntilSweepingCompleted(); |
| + } |
| - RemoveDeadInvalidatedCode(); |
| - SweepSpace(heap()->code_space(), PRECISE); |
| + RemoveDeadInvalidatedCode(); |
| + SweepSpace(heap()->code_space(), PRECISE); |
| - SweepSpace(heap()->cell_space(), PRECISE); |
| + SweepSpace(heap()->cell_space(), PRECISE); |
| - EvacuateNewSpaceAndCandidates(); |
| + EvacuateNewSpaceAndCandidates(); |
| - // ClearNonLiveTransitions depends on precise sweeping of map space to |
| - // detect whether unmarked map became dead in this collection or in one |
| - // of the previous ones. |
| - SweepSpace(heap()->map_space(), PRECISE); |
| + // ClearNonLiveTransitions depends on precise sweeping of map space to |
| + // detect whether unmarked map became dead in this collection or in one |
| + // of the previous ones. |
| + SweepSpace(heap()->map_space(), PRECISE); |
| - // Deallocate unmarked objects and clear marked bits for marked objects. |
| - heap_->lo_space()->FreeUnmarkedObjects(); |
| + // Deallocate unmarked objects and clear marked bits for marked objects. |
| + heap_->lo_space()->FreeUnmarkedObjects(); |
| - if (how_to_sweep != CONCURRENT_CONSERVATIVE) { |
| - FinalizeSweeping(); |
| + if (how_to_sweep != CONCURRENT_CONSERVATIVE) { |
| + FinalizeSweeping(); |
| + } |
| } |
| } |