Index: Source/platform/heap/ThreadState.h |
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h |
index a2428428e52eb5fb9229509dee82db3436e9dfc5..df370839fbdda7327f5e9594c4e5fb1b98488e16 100644 |
--- a/Source/platform/heap/ThreadState.h |
+++ b/Source/platform/heap/ThreadState.h |
@@ -638,6 +638,19 @@ private: |
void snapshotFreeList(); |
#endif |
+ // By entering a no-gc allowed scope, conservative GCs will not |
+ // be forced while handling an out-of-line allocation request. |
+ // Intended used when constructing subclasses of GC mixins, where |
+ // the object being constructed cannot be safely traced & marked |
+ // fully should a GC be allowed. |
+ template<typename U, typename V> friend class AllocateObjectTrait; |
+ void enterNoGCAllowedScope() { m_noGCAllowedCount++; } |
haraken
2015/02/23 08:24:23
enterGCForbiddenScope ? (for consistency with Swee
sof
2015/02/23 10:29:02
Switched naming to align with that.
|
+ void leaveNoGCAllowedScope() |
+ { |
+ ASSERT(m_noGCAllowedCount > 0); |
+ m_noGCAllowedCount--; |
+ } |
+ |
static WTF::ThreadSpecific<ThreadState*>* s_threadSpecific; |
static uintptr_t s_mainThreadStackStart; |
static uintptr_t s_mainThreadUnderestimatedStackSize; |
@@ -665,6 +678,7 @@ private: |
bool m_didV8GCAfterLastGC; |
bool m_sweepForbidden; |
size_t m_noAllocationCount; |
+ size_t m_noGCAllowedCount; |
size_t m_allocatedObjectSizeBeforeGC; |
BaseHeap* m_heaps[NumberOfHeaps]; |