Index: Source/platform/heap/Handle.h |
diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h |
index 83e4bff467c72d9deea4dfffdc38bd29b01880a8..a0f4bf025494408ca0c3e4601692af838ed0b96f 100644 |
--- a/Source/platform/heap/Handle.h |
+++ b/Source/platform/heap/Handle.h |
@@ -179,6 +179,8 @@ protected: |
, m_roots(RootsAccessor::roots()) |
#endif |
{ |
+ // Persistent must belong to a thread that will GC it. |
+ ASSERT(m_roots == GlobalPersistents::roots() || ThreadState::current()); |
typename RootsAccessor::Lock lock; |
m_prev = RootsAccessor::roots(); |
m_next = m_prev->m_next; |
@@ -192,6 +194,7 @@ protected: |
, m_roots(RootsAccessor::roots()) |
#endif |
{ |
+ ASSERT(m_roots == GlobalPersistents::roots() || ThreadState::current()); |
// We don't support allocation of thread local Persistents while doing |
// thread shutdown/cleanup. |
ASSERT(!ThreadState::current()->isTerminating()); |