Index: src/heap/mark-compact.h |
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h |
index a76936fc923810350364a116abf117f78afca0b0..754e823705268ebe6f7f4b5948180ea0c323b397 100644 |
--- a/src/heap/mark-compact.h |
+++ b/src/heap/mark-compact.h |
@@ -305,7 +305,19 @@ class MarkCompactCollectorBase { |
protected: |
explicit MarkCompactCollectorBase(Heap* heap) : heap_(heap) {} |
+ // Marking operations for objects reachable from roots. |
virtual void MarkLiveObjects() = 0; |
+ // Mark objects reachable (transitively) from objects in the marking |
+ // stack. |
+ virtual void EmptyMarkingDeque() = 0; |
+ virtual void ProcessMarkingDeque() = 0; |
+ // Clear non-live references held in side data structures. |
+ virtual void ClearNonLiveReferences() = 0; |
+ virtual void EvacuatePrologue() = 0; |
+ virtual void EvacuateEpilogue() = 0; |
+ virtual void Evacuate() = 0; |
+ virtual void EvacuatePagesInParallel() = 0; |
+ virtual void UpdatePointersAfterEvacuation() = 0; |
// The number of parallel compaction tasks, including the main thread. |
int NumberOfParallelCompactionTasks(int pages, intptr_t live_bytes); |
@@ -313,7 +325,8 @@ class MarkCompactCollectorBase { |
template <class Evacuator, class Collector> |
void CreateAndExecuteEvacuationTasks( |
Collector* collector, PageParallelJob<EvacuationJobTraits>* job, |
- RecordMigratedSlotVisitor* record_visitor, const intptr_t live_bytes, |
+ RecordMigratedSlotVisitor* record_visitor, |
+ MigrationObserver* migration_observer, const intptr_t live_bytes, |
const int& abandoned_pages); |
Heap* heap_; |
@@ -323,7 +336,9 @@ class MarkCompactCollectorBase { |
class MinorMarkCompactCollector final : public MarkCompactCollectorBase { |
public: |
explicit MinorMarkCompactCollector(Heap* heap) |
- : MarkCompactCollectorBase(heap), marking_deque_(heap) {} |
+ : MarkCompactCollectorBase(heap), |
+ marking_deque_(heap), |
+ page_parallel_job_semaphore_(0) {} |
MarkingState marking_state(HeapObject* object) const override { |
return MarkingState::External(object); |
@@ -347,10 +362,19 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase { |
SlotCallbackResult CheckAndMarkObject(Heap* heap, Address slot_address); |
void MarkLiveObjects() override; |
- void ProcessMarkingDeque(); |
- void EmptyMarkingDeque(); |
+ void ProcessMarkingDeque() override; |
+ void EmptyMarkingDeque() override; |
+ void ClearNonLiveReferences() override; |
+ |
+ void EvacuatePrologue() override; |
+ void EvacuateEpilogue() override; |
+ void Evacuate() override; |
+ void EvacuatePagesInParallel() override; |
+ void UpdatePointersAfterEvacuation() override; |
MarkingDeque marking_deque_; |
+ base::Semaphore page_parallel_job_semaphore_; |
+ List<Page*> new_space_evacuation_pages_; |
friend class StaticYoungGenerationMarkingVisitor; |
}; |
@@ -557,7 +581,6 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { |
void PrepareForCodeFlushing(); |
- // Marking operations for objects reachable from roots. |
void MarkLiveObjects() override; |
// Pushes a black object onto the marking stack and accounts for live bytes. |
@@ -579,9 +602,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { |
// the string table are weak. |
void MarkStringTable(RootMarkingVisitor* visitor); |
- // Mark objects reachable (transitively) from objects in the marking stack |
- // or overflowed in the heap. |
- void ProcessMarkingDeque(); |
+ void ProcessMarkingDeque() override; |
// Mark objects reachable (transitively) from objects in the marking stack |
// or overflowed in the heap. This respects references only considered in |
@@ -599,11 +620,9 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { |
// Collects a list of dependent code from maps embedded in optimize code. |
DependentCode* DependentCodeListFromNonLiveMaps(); |
- // Mark objects reachable (transitively) from objects in the marking |
- // stack. This function empties the marking stack, but may leave |
- // overflowed objects in the heap, in which case the marking stack's |
- // overflow flag will be set. |
- void EmptyMarkingDeque(); |
+ // This function empties the marking stack, but may leave overflowed objects |
+ // in the heap, in which case the marking stack's overflow flag will be set. |
+ void EmptyMarkingDeque() override; |
// Refill the marking stack with overflowed objects from the heap. This |
// function either leaves the marking stack full or clears the overflow |
@@ -624,7 +643,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { |
// Clear non-live references in weak cells, transition and descriptor arrays, |
// and deoptimize dependent code of non-live maps. |
- void ClearNonLiveReferences(); |
+ void ClearNonLiveReferences() override; |
void MarkDependentCodeForDeoptimization(DependentCode* list); |
// Find non-live targets of simple transitions in the given list. Clear |
// transitions to non-live targets and if needed trim descriptors arrays. |
@@ -663,13 +682,11 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { |
void StartSweepSpaces(); |
void StartSweepSpace(PagedSpace* space); |
- void EvacuatePrologue(); |
- void EvacuateEpilogue(); |
- void EvacuatePagesInParallel(); |
- |
- void EvacuateNewSpaceAndCandidates(); |
- |
- void UpdatePointersAfterEvacuation(); |
+ void EvacuatePrologue() override; |
+ void EvacuateEpilogue() override; |
+ void Evacuate() override; |
+ void EvacuatePagesInParallel() override; |
+ void UpdatePointersAfterEvacuation() override; |
void ReleaseEvacuationCandidates(); |