| Index: Source/platform/heap/Handle.h
|
| diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
|
| index e6fcd539c63c86c117f63cb8c96a6b97c0f61dbe..47b2a6909e55cf9ea05d77d9d0a9bb4e286aff67 100644
|
| --- a/Source/platform/heap/Handle.h
|
| +++ b/Source/platform/heap/Handle.h
|
| @@ -224,39 +224,41 @@ public:
|
|
|
| Persistent(T* raw) : m_raw(raw)
|
| {
|
| - ASSERT(!m_raw || ThreadStateFor<ThreadingTrait<T>::Affinity>::state()->findPageFromAddress(m_raw));
|
| + checkPointer();
|
| recordBacktrace();
|
| }
|
|
|
| explicit Persistent(T& raw) : m_raw(&raw)
|
| {
|
| - ASSERT(!m_raw || ThreadStateFor<ThreadingTrait<T>::Affinity>::state()->findPageFromAddress(m_raw));
|
| + checkPointer();
|
| recordBacktrace();
|
| }
|
|
|
| - Persistent(const Persistent& other) : m_raw(other) { recordBacktrace(); }
|
| -
|
| - template<typename U>
|
| - Persistent(const Persistent<U>& other) : m_raw(other) { recordBacktrace(); }
|
| -
|
| - template<typename U>
|
| - Persistent(const Member<U>& other) : m_raw(other) { recordBacktrace(); }
|
| + Persistent(const Persistent& other) : m_raw(other)
|
| + {
|
| + checkPointer();
|
| + recordBacktrace();
|
| + }
|
|
|
| template<typename U>
|
| - Persistent(const RawPtr<U>& other) : m_raw(other.get()) { recordBacktrace(); }
|
| + Persistent(const Persistent<U>& other) : m_raw(other)
|
| + {
|
| + checkPointer();
|
| + recordBacktrace();
|
| + }
|
|
|
| template<typename U>
|
| - Persistent& operator=(U* other)
|
| + Persistent(const Member<U>& other) : m_raw(other)
|
| {
|
| - m_raw = other;
|
| + checkPointer();
|
| recordBacktrace();
|
| - return *this;
|
| }
|
|
|
| - Persistent& operator=(std::nullptr_t)
|
| + template<typename U>
|
| + Persistent(const RawPtr<U>& other) : m_raw(other.get())
|
| {
|
| - m_raw = nullptr;
|
| - return *this;
|
| + checkPointer();
|
| + recordBacktrace();
|
| }
|
|
|
| void clear() { m_raw = nullptr; }
|
| @@ -293,9 +295,25 @@ public:
|
|
|
| T* operator->() const { return *this; }
|
|
|
| + template<typename U>
|
| + Persistent& operator=(U* other)
|
| + {
|
| + m_raw = other;
|
| + checkPointer();
|
| + recordBacktrace();
|
| + return *this;
|
| + }
|
| +
|
| + Persistent& operator=(std::nullptr_t)
|
| + {
|
| + m_raw = nullptr;
|
| + return *this;
|
| + }
|
| +
|
| Persistent& operator=(const Persistent& other)
|
| {
|
| m_raw = other;
|
| + checkPointer();
|
| recordBacktrace();
|
| return *this;
|
| }
|
| @@ -304,6 +322,7 @@ public:
|
| Persistent& operator=(const Persistent<U>& other)
|
| {
|
| m_raw = other;
|
| + checkPointer();
|
| recordBacktrace();
|
| return *this;
|
| }
|
| @@ -312,6 +331,7 @@ public:
|
| Persistent& operator=(const Member<U>& other)
|
| {
|
| m_raw = other;
|
| + checkPointer();
|
| recordBacktrace();
|
| return *this;
|
| }
|
| @@ -320,6 +340,7 @@ public:
|
| Persistent& operator=(const RawPtr<U>& other)
|
| {
|
| m_raw = other;
|
| + checkPointer();
|
| recordBacktrace();
|
| return *this;
|
| }
|
| @@ -327,6 +348,11 @@ public:
|
| T* get() const { return m_raw; }
|
|
|
| private:
|
| + void checkPointer()
|
| + {
|
| + ASSERT(!m_raw || ThreadStateFor<ThreadingTrait<T>::Affinity>::state()->findPageFromAddress(m_raw));
|
| + }
|
| +
|
| #if ENABLE(GC_PROFILING)
|
| void recordBacktrace()
|
| {
|
|
|