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:
parent
dba8e83b41
commit
4fcc2dca7e
@ -339,6 +339,7 @@ void GCTracer::PrintNVP() const {
|
||||
current_.scopes[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]);
|
||||
PrintF("misc_compaction=%.1f ",
|
||||
current_.scopes[Scope::MC_UPDATE_MISC_POINTERS]);
|
||||
PrintF("weak_closure=%.1f ", current_.scopes[Scope::MC_WEAKCLOSURE]);
|
||||
PrintF("weakcollection_process=%.1f ",
|
||||
current_.scopes[Scope::MC_WEAKCOLLECTION_PROCESS]);
|
||||
PrintF("weakcollection_clear=%.1f ",
|
||||
|
@ -103,6 +103,7 @@ class GCTracer {
|
||||
MC_UPDATE_POINTERS_TO_EVACUATED,
|
||||
MC_UPDATE_POINTERS_BETWEEN_EVACUATED,
|
||||
MC_UPDATE_MISC_POINTERS,
|
||||
MC_WEAKCLOSURE,
|
||||
MC_WEAKCOLLECTION_PROCESS,
|
||||
MC_WEAKCOLLECTION_CLEAR,
|
||||
MC_WEAKCOLLECTION_ABORT,
|
||||
|
@ -2222,29 +2222,33 @@ void MarkCompactCollector::MarkLiveObjects() {
|
||||
|
||||
ProcessTopOptimizedFrame(&root_visitor);
|
||||
|
||||
// The objects reachable from the roots are marked, yet unreachable
|
||||
// objects are unmarked. Mark objects reachable due to host
|
||||
// application specific logic or through Harmony weak maps.
|
||||
ProcessEphemeralMarking(&root_visitor, false);
|
||||
{
|
||||
GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_WEAKCLOSURE);
|
||||
|
||||
// The objects reachable from the roots, weak maps or object groups
|
||||
// are marked. Objects pointed to only by weak global handles cannot be
|
||||
// immediately reclaimed. Instead, we have to mark them as pending and mark
|
||||
// objects reachable from them.
|
||||
//
|
||||
// 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);
|
||||
// The objects reachable from the roots are marked, yet unreachable
|
||||
// objects are unmarked. Mark objects reachable due to host
|
||||
// application specific logic or through Harmony weak maps.
|
||||
ProcessEphemeralMarking(&root_visitor, false);
|
||||
|
||||
// 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);
|
||||
// The objects reachable from the roots, weak maps or object groups
|
||||
// are marked. Objects pointed to only by weak global handles cannot be
|
||||
// immediately reclaimed. Instead, we have to mark them as pending and mark
|
||||
// objects reachable from them.
|
||||
//
|
||||
// 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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user