| Index: src/heap/mark-compact.cc
|
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
|
| index 51a650a09930bd70af2d196beebe1e6b97abcc37..27d257980f281c9067d264f8e239bda5d198a481 100644
|
| --- a/src/heap/mark-compact.cc
|
| +++ b/src/heap/mark-compact.cc
|
| @@ -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);
|
| -
|
| - // 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);
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_WEAKCLOSURE);
|
| +
|
| + // 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);
|
| +
|
| + // 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();
|
|
|
|
|