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

Unified Diff: src/heap/heap.h

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
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index aa9358fa799e166d4c7b0da241fdc30dde999924..779ce3a8943d15c0b3210e36bd4469e72cf29b5f 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -7,6 +7,11 @@
#include <cmath>
+#ifdef TRACE_RETAINING_PATH
+#include <map>
+#include <string>
+#endif
+
#include "src/allocation.h"
#include "src/assert-scope.h"
#include "src/counters.h"
@@ -1444,6 +1449,12 @@ class Heap {
bool deserialization_complete() const { return deserialization_complete_; }
+#ifdef TRACE_RETAINING_PATH
+ void SetCurrentRetainer(HeapObject* obj);
+ void SetCurrentRootRetainer(std::string root);
+ void AddRetainedObject(HeapObject* obj);
+#endif
+
protected:
// Methods made available to tests.
@@ -2124,6 +2135,15 @@ class Heap {
bool deserialization_complete_;
+#ifdef TRACE_RETAINING_PATH
+ void ClearRetainingInfo();
+ void PrintRetainingPath(HeapObject* obj, const char* comment);
+ std::map<HeapObject*, HeapObject*> retainer_;
+ std::map<HeapObject*, std::string> root_retainer_;
+ HeapObject* current_retainer_;
+ std::string current_root_retainer_;
+#endif
+
friend class AlwaysAllocateScope;
friend class Deserializer;
friend class Factory;
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698