Commit 4b7ce144 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

Reland "[heap] Move pointers updating to ItemParallelJob"

Furthermore avoid lock-step between pointer updating phases as they
should execute in parallel without synchronization restrictions.

This reverts commit bc6adb86.

Bug: chromium:726040
Change-Id: I1713d4333f0ce1604ff51c02461f3ef91e4bdaed
Reviewed-on: https://chromium-review.googlesource.com/521062Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45657}
parent a99c26b7
...@@ -538,10 +538,8 @@ void GCTracer::PrintNVP() const { ...@@ -538,10 +538,8 @@ void GCTracer::PrintNVP() const {
"evacuate=%.2f " "evacuate=%.2f "
"evacuate.copy=%.2f " "evacuate.copy=%.2f "
"evacuate.update_pointers=%.2f " "evacuate.update_pointers=%.2f "
"evacuate.update_pointers.to_new=%.2f " "evacuate.update_pointers.to_new_roots=%.2f "
"evacuate.update_pointers.to_new.tospace=%.2f " "evacuate.update_pointers.slots=%.2f "
"evacuate.update_pointers.to_new.roots=%.2f "
"evacuate.update_pointers.to_new.old=%.2f "
"update_marking_deque=%.2f " "update_marking_deque=%.2f "
"reset_liveness=%.2f\n", "reset_liveness=%.2f\n",
duration, spent_in_mutator, "mmc", current_.reduce_memory, duration, spent_in_mutator, "mmc", current_.reduce_memory,
...@@ -558,12 +556,9 @@ void GCTracer::PrintNVP() const { ...@@ -558,12 +556,9 @@ void GCTracer::PrintNVP() const {
current_.scopes[Scope::MINOR_MC_EVACUATE], current_.scopes[Scope::MINOR_MC_EVACUATE],
current_.scopes[Scope::MINOR_MC_EVACUATE_COPY], current_.scopes[Scope::MINOR_MC_EVACUATE_COPY],
current_.scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS], current_.scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS],
current_.scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW],
current_
.scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_TOSPACE],
current_ current_
.scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_ROOTS], .scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_ROOTS],
current_.scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_OLD], current_.scopes[Scope::MINOR_MC_EVACUATE_UPDATE_POINTERS_SLOTS],
current_.scopes[Scope::MINOR_MC_MARKING_DEQUE], current_.scopes[Scope::MINOR_MC_MARKING_DEQUE],
current_.scopes[Scope::MINOR_MC_RESET_LIVENESS]); current_.scopes[Scope::MINOR_MC_RESET_LIVENESS]);
break; break;
...@@ -598,8 +593,8 @@ void GCTracer::PrintNVP() const { ...@@ -598,8 +593,8 @@ void GCTracer::PrintNVP() const {
"evacuate.epilogue=%.1f " "evacuate.epilogue=%.1f "
"evacuate.rebalance=%.1f " "evacuate.rebalance=%.1f "
"evacuate.update_pointers=%.1f " "evacuate.update_pointers=%.1f "
"evacuate.update_pointers.to_evacuated=%.1f " "evacuate.update_pointers.to_new_roots=%.1f "
"evacuate.update_pointers.to_new=%.1f " "evacuate.update_pointers.slots=%.1f "
"evacuate.update_pointers.weak=%.1f " "evacuate.update_pointers.weak=%.1f "
"finish=%.1f " "finish=%.1f "
"mark=%.1f " "mark=%.1f "
...@@ -682,8 +677,8 @@ void GCTracer::PrintNVP() const { ...@@ -682,8 +677,8 @@ void GCTracer::PrintNVP() const {
current_.scopes[Scope::MC_EVACUATE_EPILOGUE], current_.scopes[Scope::MC_EVACUATE_EPILOGUE],
current_.scopes[Scope::MC_EVACUATE_REBALANCE], current_.scopes[Scope::MC_EVACUATE_REBALANCE],
current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS], current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS],
current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED], current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_NEW_ROOTS],
current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_NEW], current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_SLOTS],
current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_WEAK], current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_WEAK],
current_.scopes[Scope::MC_FINISH], current_.scopes[Scope::MC_MARK], current_.scopes[Scope::MC_FINISH], current_.scopes[Scope::MC_MARK],
current_.scopes[Scope::MC_MARK_FINISH_INCREMENTAL], current_.scopes[Scope::MC_MARK_FINISH_INCREMENTAL],
......
...@@ -34,81 +34,79 @@ enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects }; ...@@ -34,81 +34,79 @@ enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects };
F(MC_INCREMENTAL_EXTERNAL_EPILOGUE) \ F(MC_INCREMENTAL_EXTERNAL_EPILOGUE) \
F(MC_INCREMENTAL_EXTERNAL_PROLOGUE) F(MC_INCREMENTAL_EXTERNAL_PROLOGUE)
#define TRACER_SCOPES(F) \ #define TRACER_SCOPES(F) \
INCREMENTAL_SCOPES(F) \ INCREMENTAL_SCOPES(F) \
F(HEAP_EPILOGUE) \ F(HEAP_EPILOGUE) \
F(HEAP_EPILOGUE_REDUCE_NEW_SPACE) \ F(HEAP_EPILOGUE_REDUCE_NEW_SPACE) \
F(HEAP_EXTERNAL_EPILOGUE) \ F(HEAP_EXTERNAL_EPILOGUE) \
F(HEAP_EXTERNAL_PROLOGUE) \ F(HEAP_EXTERNAL_PROLOGUE) \
F(HEAP_EXTERNAL_WEAK_GLOBAL_HANDLES) \ F(HEAP_EXTERNAL_WEAK_GLOBAL_HANDLES) \
F(HEAP_PROLOGUE) \ F(HEAP_PROLOGUE) \
F(MC_CLEAR) \ F(MC_CLEAR) \
F(MC_CLEAR_DEPENDENT_CODE) \ F(MC_CLEAR_DEPENDENT_CODE) \
F(MC_CLEAR_MAPS) \ F(MC_CLEAR_MAPS) \
F(MC_CLEAR_SLOTS_BUFFER) \ F(MC_CLEAR_SLOTS_BUFFER) \
F(MC_CLEAR_STORE_BUFFER) \ F(MC_CLEAR_STORE_BUFFER) \
F(MC_CLEAR_STRING_TABLE) \ F(MC_CLEAR_STRING_TABLE) \
F(MC_CLEAR_WEAK_CELLS) \ F(MC_CLEAR_WEAK_CELLS) \
F(MC_CLEAR_WEAK_COLLECTIONS) \ F(MC_CLEAR_WEAK_COLLECTIONS) \
F(MC_CLEAR_WEAK_LISTS) \ F(MC_CLEAR_WEAK_LISTS) \
F(MC_EPILOGUE) \ F(MC_EPILOGUE) \
F(MC_EVACUATE) \ F(MC_EVACUATE) \
F(MC_EVACUATE_CANDIDATES) \ F(MC_EVACUATE_CANDIDATES) \
F(MC_EVACUATE_CLEAN_UP) \ F(MC_EVACUATE_CLEAN_UP) \
F(MC_EVACUATE_COPY) \ F(MC_EVACUATE_COPY) \
F(MC_EVACUATE_EPILOGUE) \ F(MC_EVACUATE_EPILOGUE) \
F(MC_EVACUATE_PROLOGUE) \ F(MC_EVACUATE_PROLOGUE) \
F(MC_EVACUATE_REBALANCE) \ F(MC_EVACUATE_REBALANCE) \
F(MC_EVACUATE_UPDATE_POINTERS) \ F(MC_EVACUATE_UPDATE_POINTERS) \
F(MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED) \ F(MC_EVACUATE_UPDATE_POINTERS_SLOTS) \
F(MC_EVACUATE_UPDATE_POINTERS_TO_NEW) \ F(MC_EVACUATE_UPDATE_POINTERS_TO_NEW_ROOTS) \
F(MC_EVACUATE_UPDATE_POINTERS_WEAK) \ F(MC_EVACUATE_UPDATE_POINTERS_WEAK) \
F(MC_FINISH) \ F(MC_FINISH) \
F(MC_MARK) \ F(MC_MARK) \
F(MC_MARK_FINISH_INCREMENTAL) \ F(MC_MARK_FINISH_INCREMENTAL) \
F(MC_MARK_ROOTS) \ F(MC_MARK_ROOTS) \
F(MC_MARK_WEAK_CLOSURE) \ F(MC_MARK_WEAK_CLOSURE) \
F(MC_MARK_WEAK_CLOSURE_EPHEMERAL) \ F(MC_MARK_WEAK_CLOSURE_EPHEMERAL) \
F(MC_MARK_WEAK_CLOSURE_WEAK_HANDLES) \ F(MC_MARK_WEAK_CLOSURE_WEAK_HANDLES) \
F(MC_MARK_WEAK_CLOSURE_WEAK_ROOTS) \ F(MC_MARK_WEAK_CLOSURE_WEAK_ROOTS) \
F(MC_MARK_WEAK_CLOSURE_HARMONY) \ F(MC_MARK_WEAK_CLOSURE_HARMONY) \
F(MC_MARK_WRAPPER_EPILOGUE) \ F(MC_MARK_WRAPPER_EPILOGUE) \
F(MC_MARK_WRAPPER_PROLOGUE) \ F(MC_MARK_WRAPPER_PROLOGUE) \
F(MC_MARK_WRAPPER_TRACING) \ F(MC_MARK_WRAPPER_TRACING) \
F(MC_PROLOGUE) \ F(MC_PROLOGUE) \
F(MC_SWEEP) \ F(MC_SWEEP) \
F(MC_SWEEP_CODE) \ F(MC_SWEEP_CODE) \
F(MC_SWEEP_MAP) \ F(MC_SWEEP_MAP) \
F(MC_SWEEP_OLD) \ F(MC_SWEEP_OLD) \
F(MINOR_MC) \ F(MINOR_MC) \
F(MINOR_MC_CLEAR) \ F(MINOR_MC_CLEAR) \
F(MINOR_MC_CLEAR_STRING_TABLE) \ F(MINOR_MC_CLEAR_STRING_TABLE) \
F(MINOR_MC_CLEAR_WEAK_LISTS) \ F(MINOR_MC_CLEAR_WEAK_LISTS) \
F(MINOR_MC_EVACUATE) \ F(MINOR_MC_EVACUATE) \
F(MINOR_MC_EVACUATE_CLEAN_UP) \ F(MINOR_MC_EVACUATE_CLEAN_UP) \
F(MINOR_MC_EVACUATE_COPY) \ F(MINOR_MC_EVACUATE_COPY) \
F(MINOR_MC_EVACUATE_EPILOGUE) \ F(MINOR_MC_EVACUATE_EPILOGUE) \
F(MINOR_MC_EVACUATE_PROLOGUE) \ F(MINOR_MC_EVACUATE_PROLOGUE) \
F(MINOR_MC_EVACUATE_REBALANCE) \ F(MINOR_MC_EVACUATE_REBALANCE) \
F(MINOR_MC_EVACUATE_UPDATE_POINTERS) \ F(MINOR_MC_EVACUATE_UPDATE_POINTERS) \
F(MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW) \ F(MINOR_MC_EVACUATE_UPDATE_POINTERS_SLOTS) \
F(MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_ROOTS) \ F(MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_ROOTS) \
F(MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_TOSPACE) \ F(MINOR_MC_EVACUATE_UPDATE_POINTERS_WEAK) \
F(MINOR_MC_EVACUATE_UPDATE_POINTERS_TO_NEW_OLD) \ F(MINOR_MC_MARK) \
F(MINOR_MC_EVACUATE_UPDATE_POINTERS_WEAK) \ F(MINOR_MC_MARK_GLOBAL_HANDLES) \
F(MINOR_MC_MARK) \ F(MINOR_MC_MARK_SEED) \
F(MINOR_MC_MARK_GLOBAL_HANDLES) \ F(MINOR_MC_MARK_ROOTS) \
F(MINOR_MC_MARK_SEED) \ F(MINOR_MC_MARK_WEAK) \
F(MINOR_MC_MARK_ROOTS) \ F(MINOR_MC_MARKING_DEQUE) \
F(MINOR_MC_MARK_WEAK) \ F(MINOR_MC_RESET_LIVENESS) \
F(MINOR_MC_MARKING_DEQUE) \ F(MINOR_MC_SWEEPING) \
F(MINOR_MC_RESET_LIVENESS) \ F(SCAVENGER_EVACUATE) \
F(MINOR_MC_SWEEPING) \ F(SCAVENGER_OLD_TO_NEW_POINTERS) \
F(SCAVENGER_EVACUATE) \ F(SCAVENGER_ROOTS) \
F(SCAVENGER_OLD_TO_NEW_POINTERS) \ F(SCAVENGER_SCAVENGE) \
F(SCAVENGER_ROOTS) \ F(SCAVENGER_SEMISPACE) \
F(SCAVENGER_SCAVENGE) \
F(SCAVENGER_SEMISPACE) \
F(SCAVENGER_WEAK) F(SCAVENGER_WEAK)
#define TRACE_GC(tracer, scope_id) \ #define TRACE_GC(tracer, scope_id) \
......
This diff is collapsed.
...@@ -22,6 +22,7 @@ namespace internal { ...@@ -22,6 +22,7 @@ namespace internal {
// Forward declarations. // Forward declarations.
class EvacuationJobTraits; class EvacuationJobTraits;
class HeapObjectVisitor; class HeapObjectVisitor;
class ItemParallelJob;
class LocalWorkStealingMarkingDeque; class LocalWorkStealingMarkingDeque;
class MarkCompactCollector; class MarkCompactCollector;
class MinorMarkCompactCollector; class MinorMarkCompactCollector;
...@@ -276,9 +277,9 @@ class MarkCompactCollectorBase { ...@@ -276,9 +277,9 @@ class MarkCompactCollectorBase {
// Returns whether this page should be moved according to heuristics. // Returns whether this page should be moved according to heuristics.
bool ShouldMovePage(Page* p, intptr_t live_bytes); bool ShouldMovePage(Page* p, intptr_t live_bytes);
int CollectToSpaceUpdatingItems(ItemParallelJob* job);
template <RememberedSetType type> template <RememberedSetType type>
void UpdatePointersInParallel(base::Semaphore* semaphore); int CollectRememberedSetUpdatingItems(ItemParallelJob* job);
void UpdateToSpacePointersInParallel(base::Semaphore* semaphore);
int NumberOfParallelCompactionTasks(int pages); int NumberOfParallelCompactionTasks(int pages);
int NumberOfParallelPointerUpdateTasks(int pages, int slots); int NumberOfParallelPointerUpdateTasks(int pages, int slots);
......
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