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

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

Issue 890663005: Introduce a flag for tracing retaining path in GC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months 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
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 1992c23925a061d7d334d12dc69b43dbc25b162e..7cf0e638c0fd84e9101db4631326a5fac707023e 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2094,10 +2094,16 @@ void MarkCompactCollector::ProcessEphemeralMarking(
DCHECK(marking_deque_.IsEmpty() && !marking_deque_.overflowed());
while (work_to_do) {
if (!only_process_harmony_weak_collections) {
+#ifdef TRACE_RETAINING_PATH
+ heap()->SetCurrentRootRetainer(std::string("[weak global handles]"));
+#endif
isolate()->global_handles()->IterateObjectGroups(
visitor, &IsUnmarkedHeapObjectWithHeap);
MarkImplicitRefGroups();
}
+#ifdef TRACE_RETAINING_PATH
+ heap()->SetCurrentRootRetainer(std::string("[weak harmony collections]"));
+#endif
ProcessWeakCollections();
work_to_do = !marking_deque_.IsEmpty();
ProcessMarkingDeque();
@@ -2106,6 +2112,9 @@ void MarkCompactCollector::ProcessEphemeralMarking(
void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) {
+#ifdef TRACE_RETAINING_PATH
+ heap()->SetCurrentRootRetainer(std::string("[top optimized frame]"));
+#endif
for (StackFrameIterator it(isolate(), isolate()->thread_local_top());
!it.done(); it.Advance()) {
if (it.frame()->type() == StackFrame::JAVA_SCRIPT) {
@@ -4412,5 +4421,12 @@ void SlotsBufferAllocator::DeallocateChain(SlotsBuffer** buffer_address) {
}
*buffer_address = NULL;
}
+
+
+#ifdef TRACE_RETAINING_PATH
+void MarkingDeque::AddRetainedObject(HeapObject* obj) {
+ obj->GetHeap()->AddRetainedObject(obj);
+}
+#endif
}
} // namespace v8::internal
« src/heap/heap.cc ('K') | « src/heap/mark-compact.h ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698