| 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;
|
|
|