Commit fd530c12 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] MinorMC: Parallel marking

Bug: chromium:651354
Change-Id: I9df2ca542112f04787987bda67657fc4015787b5
Reviewed-on: https://chromium-review.googlesource.com/506152
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45363}
parent 9595d0f6
...@@ -671,6 +671,10 @@ DEFINE_BOOL(incremental_marking_wrappers, true, ...@@ -671,6 +671,10 @@ DEFINE_BOOL(incremental_marking_wrappers, true,
"use incremental marking for marking wrappers") "use incremental marking for marking wrappers")
DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING, "use concurrent marking") DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING, "use concurrent marking")
DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking") DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking")
DEFINE_BOOL(minor_mc_parallel_marking, true,
"use parallel marking for the young generation")
DEFINE_BOOL(trace_minor_mc_parallel_marking, false,
"trace parallel marking for the young generation")
DEFINE_INT(min_progress_during_incremental_marking_finalization, 32, DEFINE_INT(min_progress_during_incremental_marking_finalization, 32,
"keep finalizing incremental marking as long as we discover at " "keep finalizing incremental marking as long as we discover at "
"least this many unmarked objects") "least this many unmarked objects")
...@@ -1300,6 +1304,7 @@ DEFINE_BOOL(single_threaded, false, "disable the use of background tasks") ...@@ -1300,6 +1304,7 @@ DEFINE_BOOL(single_threaded, false, "disable the use of background tasks")
DEFINE_NEG_IMPLICATION(single_threaded, concurrent_recompilation) DEFINE_NEG_IMPLICATION(single_threaded, concurrent_recompilation)
DEFINE_NEG_IMPLICATION(single_threaded, concurrent_marking) DEFINE_NEG_IMPLICATION(single_threaded, concurrent_marking)
DEFINE_NEG_IMPLICATION(single_threaded, concurrent_sweeping) DEFINE_NEG_IMPLICATION(single_threaded, concurrent_sweeping)
DEFINE_NEG_IMPLICATION(single_threaded, minor_mc_parallel_marking)
DEFINE_NEG_IMPLICATION(single_threaded, parallel_compaction) DEFINE_NEG_IMPLICATION(single_threaded, parallel_compaction)
DEFINE_NEG_IMPLICATION(single_threaded, parallel_pointer_update) DEFINE_NEG_IMPLICATION(single_threaded, parallel_pointer_update)
DEFINE_NEG_IMPLICATION(single_threaded, concurrent_store_buffer) DEFINE_NEG_IMPLICATION(single_threaded, concurrent_store_buffer)
......
...@@ -531,8 +531,8 @@ void GCTracer::PrintNVP() const { ...@@ -531,8 +531,8 @@ void GCTracer::PrintNVP() const {
"finish_sweeping=%.2f " "finish_sweeping=%.2f "
"mark=%.2f " "mark=%.2f "
"mark.identify_global_handles=%.2f " "mark.identify_global_handles=%.2f "
"mark.seed=%.2f "
"mark.roots=%.2f " "mark.roots=%.2f "
"mark.old_to_new=%.2f "
"mark.weak=%.2f " "mark.weak=%.2f "
"mark.global_handles=%.2f " "mark.global_handles=%.2f "
"clear=%.2f " "clear=%.2f "
...@@ -552,8 +552,8 @@ void GCTracer::PrintNVP() const { ...@@ -552,8 +552,8 @@ void GCTracer::PrintNVP() const {
current_.scopes[Scope::MINOR_MC_SWEEPING], current_.scopes[Scope::MINOR_MC_SWEEPING],
current_.scopes[Scope::MINOR_MC_MARK], current_.scopes[Scope::MINOR_MC_MARK],
current_.scopes[Scope::MINOR_MC_MARK_IDENTIFY_GLOBAL_HANDLES], current_.scopes[Scope::MINOR_MC_MARK_IDENTIFY_GLOBAL_HANDLES],
current_.scopes[Scope::MINOR_MC_MARK_SEED],
current_.scopes[Scope::MINOR_MC_MARK_ROOTS], current_.scopes[Scope::MINOR_MC_MARK_ROOTS],
current_.scopes[Scope::MINOR_MC_MARK_OLD_TO_NEW_POINTERS],
current_.scopes[Scope::MINOR_MC_MARK_WEAK], current_.scopes[Scope::MINOR_MC_MARK_WEAK],
current_.scopes[Scope::MINOR_MC_MARK_GLOBAL_HANDLES], current_.scopes[Scope::MINOR_MC_MARK_GLOBAL_HANDLES],
current_.scopes[Scope::MINOR_MC_CLEAR], current_.scopes[Scope::MINOR_MC_CLEAR],
......
...@@ -101,7 +101,7 @@ enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects }; ...@@ -101,7 +101,7 @@ enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects };
F(MINOR_MC_MARK) \ F(MINOR_MC_MARK) \
F(MINOR_MC_MARK_GLOBAL_HANDLES) \ F(MINOR_MC_MARK_GLOBAL_HANDLES) \
F(MINOR_MC_MARK_IDENTIFY_GLOBAL_HANDLES) \ F(MINOR_MC_MARK_IDENTIFY_GLOBAL_HANDLES) \
F(MINOR_MC_MARK_OLD_TO_NEW_POINTERS) \ F(MINOR_MC_MARK_SEED) \
F(MINOR_MC_MARK_ROOTS) \ F(MINOR_MC_MARK_ROOTS) \
F(MINOR_MC_MARK_WEAK) \ F(MINOR_MC_MARK_WEAK) \
F(MINOR_MC_MARKING_DEQUE) \ F(MINOR_MC_MARKING_DEQUE) \
......
This diff is collapsed.
...@@ -360,14 +360,29 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -360,14 +360,29 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase {
void CleanupSweepToIteratePages(); void CleanupSweepToIteratePages();
private: private:
class RootMarkingVisitorSeedOnly;
class RootMarkingVisitor; class RootMarkingVisitor;
inline MarkingDeque* marking_deque() { return &marking_deque_; } static const int kNumMarkers = 4;
static const int kMainMarker = 0;
inline MarkingDeque* marking_deque(int index) {
DCHECK_LT(index, kNumMarkers);
return marking_deque_[index];
}
inline YoungGenerationMarkingVisitor* marking_visitor(int index) {
DCHECK_LT(index, kNumMarkers);
return marking_visitor_[index];
}
SlotCallbackResult CheckAndMarkObject(Heap* heap, Address slot_address); SlotCallbackResult CheckAndMarkObject(Heap* heap, Address slot_address);
void MarkLiveObjects() override; void MarkLiveObjects() override;
void MarkRootSetInParallel();
void ProcessMarkingDeque() override; void ProcessMarkingDeque() override;
void EmptyMarkingDeque() override; void EmptyMarkingDeque() override;
void EmptySpecificMarkingDeque(MarkingDeque* marking_deque,
YoungGenerationMarkingVisitor* visitor);
void ClearNonLiveReferences() override; void ClearNonLiveReferences() override;
void EvacuatePrologue() override; void EvacuatePrologue() override;
...@@ -376,12 +391,16 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -376,12 +391,16 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase {
void EvacuatePagesInParallel() override; void EvacuatePagesInParallel() override;
void UpdatePointersAfterEvacuation() override; void UpdatePointersAfterEvacuation() override;
MarkingDeque marking_deque_; int NumberOfMarkingTasks();
YoungGenerationMarkingVisitor* marking_visitor_;
MarkingDeque* marking_deque_[kNumMarkers];
YoungGenerationMarkingVisitor* marking_visitor_[kNumMarkers];
base::Semaphore page_parallel_job_semaphore_; base::Semaphore page_parallel_job_semaphore_;
List<Page*> new_space_evacuation_pages_; List<Page*> new_space_evacuation_pages_;
std::vector<Page*> sweep_to_iterate_pages_; std::vector<Page*> sweep_to_iterate_pages_;
friend class MarkYoungGenerationJobTraits;
friend class YoungGenerationMarkingTask;
friend class YoungGenerationMarkingVisitor; friend class YoungGenerationMarkingVisitor;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment