Chromium Code Reviews| Index: src/mark-compact.cc |
| diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
| index b26ca6a016af2588fa700f74966064c82c6ee859..2338095d8d059f1bfb03343d1ec17d7401bf75f1 100644 |
| --- a/src/mark-compact.cc |
| +++ b/src/mark-compact.cc |
| @@ -664,6 +664,21 @@ bool MarkCompactCollector::IsConcurrentSweepingInProgress() { |
| } |
| +bool MarkCompactCollector::CanMoveObjectStart(HeapObject* object) { |
| + Address address = object->address(); |
| + bool is_in_old_pointer_space = heap_->InOldPointerSpace(address); |
| + bool is_in_old_data_space = heap_->InOldDataSpace(address); |
| + |
| + if (heap_->lo_space()->Contains(object)) return false; |
| + |
| + // We cannot move the object start if the given old space page is |
| + // concurrently swept. |
| + return (!is_in_old_pointer_space && !is_in_old_data_space) || |
| + Page::FromAddress(address)->parallel_sweeping() <= |
| + MemoryChunk::PARALLEL_SWEEPING_FINALIZE; |
| + } |
|
Michael Starzinger
2014/03/24 12:21:35
nit: Indentation is off.
Hannes Payer (out of office)
2014/03/25 11:41:08
Done.
|
| + |
| + |
| void Marking::TransferMark(Address old_start, Address new_start) { |
| // This is only used when resizing an object. |
| ASSERT(MemoryChunk::FromAddress(old_start) == |
| @@ -4086,6 +4101,7 @@ void MarkCompactCollector::SweepInParallel(PagedSpace* space) { |
| if (p->TryParallelSweeping()) { |
| SweepConservatively<SWEEP_IN_PARALLEL>(space, &private_free_list, p); |
| free_list->Concatenate(&private_free_list); |
| + p->set_parallel_sweeping(MemoryChunk::PARALLEL_SWEEPING_FINALIZE); |
| } |
| } |
| } |
| @@ -4284,10 +4300,11 @@ void MarkCompactCollector::ParallelSweepSpaceComplete(PagedSpace* space) { |
| PageIterator it(space); |
| while (it.has_next()) { |
| Page* p = it.next(); |
| - if (p->parallel_sweeping() == MemoryChunk::PARALLEL_SWEEPING_IN_PROGRESS) { |
| + if (p->parallel_sweeping() == MemoryChunk::PARALLEL_SWEEPING_FINALIZE) { |
| p->set_parallel_sweeping(MemoryChunk::PARALLEL_SWEEPING_DONE); |
| p->MarkSweptConservatively(); |
| } |
| + ASSERT(p->parallel_sweeping() == MemoryChunk::PARALLEL_SWEEPING_DONE); |
| } |
| } |