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}
This commit is contained in:
jochen 2014-12-02 07:09:19 -08:00 committed by Commit bot
parent dba8e83b41
commit 4fcc2dca7e
3 changed files with 27 additions and 21 deletions

View File

@ -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 ",

View File

@ -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,

View File

@ -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, weak maps or object groups // The objects reachable from the roots are marked, yet unreachable
// are marked. Objects pointed to only by weak global handles cannot be // objects are unmarked. Mark objects reachable due to host
// immediately reclaimed. Instead, we have to mark them as pending and mark // application specific logic or through Harmony weak maps.
// objects reachable from them. ProcessEphemeralMarking(&root_visitor, false);
//
// First we identify nonlive weak handles and mark them as pending
// destruction.
heap()->isolate()->global_handles()->IdentifyWeakHandles(
&IsUnmarkedHeapObject);
// Then we mark the objects.
heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor);
// Repeat Harmony weak maps marking to mark unmarked objects reachable from // The objects reachable from the roots, weak maps or object groups
// the weak roots we just marked as pending destruction. // are marked. Objects pointed to only by weak global handles cannot be
// // immediately reclaimed. Instead, we have to mark them as pending and mark
// We only process harmony collections, as all object groups have been fully // objects reachable from them.
// processed and no weakly reachable node can discover new objects groups. //
ProcessEphemeralMarking(&root_visitor, true); // First we identify nonlive weak handles and mark them as pending
// destruction.
heap()->isolate()->global_handles()->IdentifyWeakHandles(
&IsUnmarkedHeapObject);
// Then we mark the objects.
heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor);
// Repeat Harmony weak maps marking to mark unmarked objects reachable from
// the weak roots we just marked as pending destruction.
//
// 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();