Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: src/heap/mark-compact.h

Issue 2796233003: [heap] Evacuation for young generation (Closed)
Patch Set: Rebase after disabling black allocation during GCs Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index a76936fc923810350364a116abf117f78afca0b0..22a126b115136bcd73a7fd1a3a9c6702b02b7e82 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -305,7 +305,15 @@ class MarkCompactCollectorBase {
protected:
explicit MarkCompactCollectorBase(Heap* heap) : heap_(heap) {}
+ virtual void ProcessMarkingDeque() = 0;
Hannes Payer (out of office) 2017/05/03 14:44:53 Can you move the comments from MarkCompacts to the
Michael Lippautz 2017/05/03 15:08:03 Done.
+ virtual void EmptyMarkingDeque() = 0;
virtual void MarkLiveObjects() = 0;
+ 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 +321,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 +332,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 +358,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;
};
@@ -581,7 +601,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
// 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
@@ -603,7 +623,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
// 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();
+ 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 +644,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 +683,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();
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | src/heap/mark-compact.cc » ('j') | src/heap/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698