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

Unified Diff: Source/platform/heap/Handle.h

Issue 337653002: Oilpan: GC_TRACING: Improve object path dump (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Skip WebCore::Persistent frames automatically Created 6 years, 6 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 | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Handle.h
diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
index 6de5dbc17563d21e82f0fec9aadefca5d49d8e44..90eacd246c51476cbabcc8159f215707e4c93235 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -294,28 +294,31 @@ public:
Persistent(T* raw) : m_raw(raw)
{
ASSERT_IS_VALID_PERSISTENT_POINTER(m_raw);
+ recordBacktrace();
}
explicit Persistent(T& raw) : m_raw(&raw)
{
ASSERT_IS_VALID_PERSISTENT_POINTER(m_raw);
+ recordBacktrace();
}
- Persistent(const Persistent& other) : m_raw(other) { }
+ Persistent(const Persistent& other) : m_raw(other) { recordBacktrace(); }
template<typename U>
- Persistent(const Persistent<U, RootsAccessor>& other) : m_raw(other) { }
+ Persistent(const Persistent<U, RootsAccessor>& other) : m_raw(other) { recordBacktrace(); }
template<typename U>
- Persistent(const Member<U>& other) : m_raw(other) { }
+ Persistent(const Member<U>& other) : m_raw(other) { recordBacktrace(); }
template<typename U>
- Persistent(const RawPtr<U>& other) : m_raw(other.get()) { }
+ Persistent(const RawPtr<U>& other) : m_raw(other.get()) { recordBacktrace(); }
template<typename U>
Persistent& operator=(U* other)
{
m_raw = other;
+ recordBacktrace();
return *this;
}
@@ -342,7 +345,7 @@ public:
{
COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, NonGarbageCollectedObjectInPersistent);
#if ENABLE(GC_TRACING)
- visitor->setHostInfo(this, "Persistent");
+ visitor->setHostInfo(this, m_tracingName.isEmpty() ? "Persistent" : m_tracingName);
#endif
visitor->mark(m_raw);
}
@@ -366,6 +369,7 @@ public:
Persistent& operator=(const Persistent& other)
{
m_raw = other;
+ recordBacktrace();
return *this;
}
@@ -373,6 +377,7 @@ public:
Persistent& operator=(const Persistent<U, RootsAccessor>& other)
{
m_raw = other;
+ recordBacktrace();
return *this;
}
@@ -380,6 +385,7 @@ public:
Persistent& operator=(const Member<U>& other)
{
m_raw = other;
+ recordBacktrace();
return *this;
}
@@ -387,12 +393,24 @@ public:
Persistent& operator=(const RawPtr<U>& other)
{
m_raw = other;
+ recordBacktrace();
return *this;
}
T* get() const { return m_raw; }
private:
+#if ENABLE(GC_TRACING)
+ void recordBacktrace()
+ {
+ if (m_raw)
+ m_tracingName = Heap::createBacktraceString();
+ }
+
+ String m_tracingName;
+#else
+ inline void recordBacktrace() const { }
+#endif
T* m_raw;
friend class CrossThreadPersistent<T>;
@@ -425,7 +443,13 @@ public:
template<typename OtherCollection>
PersistentHeapCollectionBase(const OtherCollection& other) : Collection(other) { }
- void trace(Visitor* visitor) { visitor->trace(*static_cast<Collection*>(this)); }
+ void trace(Visitor* visitor)
+ {
+#if ENABLE(GC_TRACING)
+ visitor->setHostInfo(this, "PersistentHeapCollectionBase");
+#endif
+ visitor->trace(*static_cast<Collection*>(this));
+ }
};
template<
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698