diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc index c4a118afb7..0a023b7b90 100644 --- a/src/heap/gc-tracer.cc +++ b/src/heap/gc-tracer.cc @@ -559,6 +559,10 @@ void GCTracer::PrintNVP() const { "mark.prepare_code_flush=%.1f " "mark.roots=%.1f " "mark.weak_closure=%.1f " + "mark.weak_closure.ephemeral=%.1f " + "mark.weak_closure.weak_handles=%.1f " + "mark.weak_closure.weak_roots=%.1f " + "mark.weak_closure.harmony=%.1f " "sweep=%.1f " "sweep.code=%.1f " "sweep.map=%.1f " @@ -628,6 +632,10 @@ void GCTracer::PrintNVP() const { current_.scopes[Scope::MC_MARK_PREPARE_CODE_FLUSH], current_.scopes[Scope::MC_MARK_ROOTS], current_.scopes[Scope::MC_MARK_WEAK_CLOSURE], + current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_EPHEMERAL], + current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_WEAK_HANDLES], + current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_WEAK_ROOTS], + current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_HARMONY], current_.scopes[Scope::MC_SWEEP], current_.scopes[Scope::MC_SWEEP_CODE], current_.scopes[Scope::MC_SWEEP_MAP], diff --git a/src/heap/gc-tracer.h b/src/heap/gc-tracer.h index 45e4dc61dc..4621f3a0f1 100644 --- a/src/heap/gc-tracer.h +++ b/src/heap/gc-tracer.h @@ -98,6 +98,10 @@ class GCTracer { MC_MARK_PREPARE_CODE_FLUSH, MC_MARK_ROOTS, MC_MARK_WEAK_CLOSURE, + MC_MARK_WEAK_CLOSURE_EPHEMERAL, + MC_MARK_WEAK_CLOSURE_WEAK_HANDLES, + MC_MARK_WEAK_CLOSURE_WEAK_ROOTS, + MC_MARK_WEAK_CLOSURE_HARMONY, MC_SWEEP, MC_SWEEP_CODE, MC_SWEEP_MAP, diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index affe13d873..cadb68834b 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -2142,7 +2142,12 @@ void MarkCompactCollector::MarkLiveObjects() { // 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_MARK_WEAK_CLOSURE_EPHEMERAL); + ProcessEphemeralMarking(&root_visitor, false); + ProcessMarkingDeque(); + } // The objects reachable from the roots, weak maps or object groups // are marked. Objects pointed to only by weak global handles cannot be @@ -2151,18 +2156,33 @@ void MarkCompactCollector::MarkLiveObjects() { // // First we identify nonlive weak handles and mark them as pending // destruction. - heap()->isolate()->global_handles()->IdentifyWeakHandles( - &IsUnmarkedHeapObject); + { + GCTracer::Scope gc_scope( + heap()->tracer(), GCTracer::Scope::MC_MARK_WEAK_CLOSURE_WEAK_HANDLES); + heap()->isolate()->global_handles()->IdentifyWeakHandles( + &IsUnmarkedHeapObject); + ProcessMarkingDeque(); + } // Then we mark the objects. - heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); - ProcessMarkingDeque(); + + { + GCTracer::Scope gc_scope( + heap()->tracer(), GCTracer::Scope::MC_MARK_WEAK_CLOSURE_WEAK_ROOTS); + heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); + ProcessMarkingDeque(); + } // 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); + { + GCTracer::Scope gc_scope(heap()->tracer(), + GCTracer::Scope::MC_MARK_WEAK_CLOSURE_HARMONY); + ProcessEphemeralMarking(&root_visitor, true); + ProcessMarkingDeque(); + } } if (FLAG_print_cumulative_gc_stat) { diff --git a/tools/eval_gc_time.sh b/tools/eval_gc_time.sh index bad4d135e1..23f7a4f369 100755 --- a/tools/eval_gc_time.sh +++ b/tools/eval_gc_time.sh @@ -90,6 +90,10 @@ INTERESTING_OLD_GEN_KEYS="\ mark.prepare_code_flush \ mark.roots \ mark.weak_closure \ + mark.weak_closure.ephemeral \ + mark.weak_closure.weak_handles \ + mark.weak_closure.weak_roots \ + mark.weak_closure.harmony \ sweep \ sweep.code \ sweep.map \