Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: src/heap/mark-compact.cc

Issue 769253002: Trace how long it takes to compute the weak closure during mark-compact (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698