| Index: src/heap/mark-compact.cc
|
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
|
| index 1daaed5fb2a72eac4fddc80cb87d0bbf6edb6c41..4a7efe5f7cb1ef4fe9a43c94637fbeef0bb78d4c 100644
|
| --- a/src/heap/mark-compact.cc
|
| +++ b/src/heap/mark-compact.cc
|
| @@ -2107,14 +2107,17 @@ void MarkCompactCollector::MarkLiveObjects() {
|
| // with the C stack limit check.
|
| PostponeInterruptsScope postpone(isolate());
|
|
|
| - IncrementalMarking* incremental_marking = heap_->incremental_marking();
|
| - if (was_marked_incrementally_) {
|
| - incremental_marking->Finalize();
|
| - } else {
|
| - // Abort any pending incremental activities e.g. incremental sweeping.
|
| - incremental_marking->Stop();
|
| - if (marking_deque_.in_use()) {
|
| - marking_deque_.Uninitialize(true);
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK_INC);
|
| + IncrementalMarking* incremental_marking = heap_->incremental_marking();
|
| + if (was_marked_incrementally_) {
|
| + incremental_marking->Finalize();
|
| + } else {
|
| + // Abort any pending incremental activities e.g. incremental sweeping.
|
| + incremental_marking->Stop();
|
| + if (marking_deque_.in_use()) {
|
| + marking_deque_.Uninitialize(true);
|
| + }
|
| }
|
| }
|
|
|
| @@ -2126,20 +2129,36 @@ void MarkCompactCollector::MarkLiveObjects() {
|
| EnsureMarkingDequeIsCommittedAndInitialize(
|
| MarkCompactCollector::kMaxMarkingDequeSize);
|
|
|
| - PrepareForCodeFlushing();
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(),
|
| + GCTracer::Scope::MC_MARK_PREPCODEFLUSH);
|
| + PrepareForCodeFlushing();
|
| + }
|
|
|
| RootMarkingVisitor root_visitor(heap());
|
| - MarkRoots(&root_visitor);
|
|
|
| - ProcessTopOptimizedFrame(&root_visitor);
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK_ROOT);
|
| + MarkRoots(&root_visitor);
|
| + }
|
| +
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK_TOPOPT);
|
| + ProcessTopOptimizedFrame(&root_visitor);
|
| + }
|
|
|
| // Retaining dying maps should happen before or during ephemeral marking
|
| // because a map could keep the key of an ephemeron alive. Note that map
|
| // aging is imprecise: maps that are kept alive only by ephemerons will age.
|
| - RetainMaps();
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(),
|
| + GCTracer::Scope::MC_MARK_RETAINMAPS);
|
| + RetainMaps();
|
| + }
|
|
|
| {
|
| - GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_WEAKCLOSURE);
|
| + GCTracer::Scope gc_scope(heap()->tracer(),
|
| + GCTracer::Scope::MC_MARK_WEAKCLOSURE);
|
|
|
| // The objects reachable from the roots are marked, yet unreachable
|
| // objects are unmarked. Mark objects reachable due to host
|
| @@ -2176,28 +2195,45 @@ void MarkCompactCollector::MarkLiveObjects() {
|
|
|
|
|
| void MarkCompactCollector::AfterMarking() {
|
| - // Prune the string table removing all strings only pointed to by the
|
| - // string table. Cannot use string_table() here because the string
|
| - // table is marked.
|
| - StringTable* string_table = heap()->string_table();
|
| - InternalizedStringTableCleaner internalized_visitor(heap());
|
| - string_table->IterateElements(&internalized_visitor);
|
| - string_table->ElementsRemoved(internalized_visitor.PointersRemoved());
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(),
|
| + GCTracer::Scope::MC_MARK_STRINGTABLE);
|
|
|
| - ExternalStringTableCleaner external_visitor(heap());
|
| - heap()->external_string_table_.Iterate(&external_visitor);
|
| - heap()->external_string_table_.CleanUp();
|
| + // Prune the string table removing all strings only pointed to by the
|
| + // string table. Cannot use string_table() here because the string
|
| + // table is marked.
|
| + StringTable* string_table = heap()->string_table();
|
| + InternalizedStringTableCleaner internalized_visitor(heap());
|
| + string_table->IterateElements(&internalized_visitor);
|
| + string_table->ElementsRemoved(internalized_visitor.PointersRemoved());
|
|
|
| - // Process the weak references.
|
| - MarkCompactWeakObjectRetainer mark_compact_object_retainer;
|
| - heap()->ProcessAllWeakReferences(&mark_compact_object_retainer);
|
| + ExternalStringTableCleaner external_visitor(heap());
|
| + heap()->external_string_table_.Iterate(&external_visitor);
|
| + heap()->external_string_table_.CleanUp();
|
| + }
|
|
|
| - // Remove object groups after marking phase.
|
| - heap()->isolate()->global_handles()->RemoveObjectGroups();
|
| - heap()->isolate()->global_handles()->RemoveImplicitRefGroups();
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(),
|
| + GCTracer::Scope::MC_MARK_WEAKREFS);
|
| +
|
| + // Process the weak references.
|
| + MarkCompactWeakObjectRetainer mark_compact_object_retainer;
|
| + heap()->ProcessAllWeakReferences(&mark_compact_object_retainer);
|
| + }
|
| +
|
| + {
|
| + GCTracer::Scope gc_scope(heap()->tracer(),
|
| + GCTracer::Scope::MC_MARK_GLOBALHANDLES);
|
| +
|
| + // Remove object groups after marking phase.
|
| + heap()->isolate()->global_handles()->RemoveObjectGroups();
|
| + heap()->isolate()->global_handles()->RemoveImplicitRefGroups();
|
| + }
|
|
|
| // Flush code from collected candidates.
|
| if (is_code_flushing_enabled()) {
|
| + GCTracer::Scope gc_scope(heap()->tracer(),
|
| + GCTracer::Scope::MC_MARK_CODEFLUSH);
|
| code_flusher_->ProcessCandidates();
|
| }
|
|
|
|
|