Commit 4fcc2dca authored by jochen's avatar jochen Committed by Commit bot

Trace how long it takes to compute the weak closure during mark-compact

BUG=none
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/769253002

Cr-Commit-Position: refs/heads/master@{#25618}
parent dba8e83b
...@@ -339,6 +339,7 @@ void GCTracer::PrintNVP() const { ...@@ -339,6 +339,7 @@ void GCTracer::PrintNVP() const {
current_.scopes[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); current_.scopes[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]);
PrintF("misc_compaction=%.1f ", PrintF("misc_compaction=%.1f ",
current_.scopes[Scope::MC_UPDATE_MISC_POINTERS]); current_.scopes[Scope::MC_UPDATE_MISC_POINTERS]);
PrintF("weak_closure=%.1f ", current_.scopes[Scope::MC_WEAKCLOSURE]);
PrintF("weakcollection_process=%.1f ", PrintF("weakcollection_process=%.1f ",
current_.scopes[Scope::MC_WEAKCOLLECTION_PROCESS]); current_.scopes[Scope::MC_WEAKCOLLECTION_PROCESS]);
PrintF("weakcollection_clear=%.1f ", PrintF("weakcollection_clear=%.1f ",
......
...@@ -103,6 +103,7 @@ class GCTracer { ...@@ -103,6 +103,7 @@ class GCTracer {
MC_UPDATE_POINTERS_TO_EVACUATED, MC_UPDATE_POINTERS_TO_EVACUATED,
MC_UPDATE_POINTERS_BETWEEN_EVACUATED, MC_UPDATE_POINTERS_BETWEEN_EVACUATED,
MC_UPDATE_MISC_POINTERS, MC_UPDATE_MISC_POINTERS,
MC_WEAKCLOSURE,
MC_WEAKCOLLECTION_PROCESS, MC_WEAKCOLLECTION_PROCESS,
MC_WEAKCOLLECTION_CLEAR, MC_WEAKCOLLECTION_CLEAR,
MC_WEAKCOLLECTION_ABORT, MC_WEAKCOLLECTION_ABORT,
......
...@@ -2222,29 +2222,33 @@ void MarkCompactCollector::MarkLiveObjects() { ...@@ -2222,29 +2222,33 @@ void MarkCompactCollector::MarkLiveObjects() {
ProcessTopOptimizedFrame(&root_visitor); ProcessTopOptimizedFrame(&root_visitor);
// The objects reachable from the roots are marked, yet unreachable {
// objects are unmarked. Mark objects reachable due to host GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_WEAKCLOSURE);
// application specific logic or through Harmony weak maps.
ProcessEphemeralMarking(&root_visitor, false); // The objects reachable from the roots are marked, yet unreachable
// objects are unmarked. Mark objects reachable due to host
// The objects reachable from the roots, weak maps or object groups // application specific logic or through Harmony weak maps.
// are marked. Objects pointed to only by weak global handles cannot be ProcessEphemeralMarking(&root_visitor, false);
// immediately reclaimed. Instead, we have to mark them as pending and mark
// objects reachable from them. // The objects reachable from the roots, weak maps or object groups
// // are marked. Objects pointed to only by weak global handles cannot be
// First we identify nonlive weak handles and mark them as pending // immediately reclaimed. Instead, we have to mark them as pending and mark
// destruction. // objects reachable from them.
heap()->isolate()->global_handles()->IdentifyWeakHandles( //
&IsUnmarkedHeapObject); // First we identify nonlive weak handles and mark them as pending
// Then we mark the objects. // destruction.
heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); heap()->isolate()->global_handles()->IdentifyWeakHandles(
&IsUnmarkedHeapObject);
// Repeat Harmony weak maps marking to mark unmarked objects reachable from // Then we mark the objects.
// the weak roots we just marked as pending destruction. heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor);
//
// We only process harmony collections, as all object groups have been fully // Repeat Harmony weak maps marking to mark unmarked objects reachable from
// processed and no weakly reachable node can discover new objects groups. // the weak roots we just marked as pending destruction.
ProcessEphemeralMarking(&root_visitor, true); //
// We only process harmony collections, as all object groups have been fully
// processed and no weakly reachable node can discover new objects groups.
ProcessEphemeralMarking(&root_visitor, true);
}
AfterMarking(); AfterMarking();
......
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