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

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

Issue 1166793002: Oilpan: add assert to verify eager finalization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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
Index: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index 213170db701f44d52e20cb88735a751a38d74add..ce528c7a2716cc83229c7ee35dc5290a65269391 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -238,13 +238,13 @@ public:
public:
explicit SweepForbiddenScope(ThreadState* state) : m_state(state)
{
- ASSERT(!m_state->m_sweepForbidden);
- m_state->m_sweepForbidden = true;
+ ASSERT(!m_state->m_isSweepForbidden);
+ m_state->m_isSweepForbidden = true;
}
~SweepForbiddenScope()
{
- ASSERT(m_state->m_sweepForbidden);
- m_state->m_sweepForbidden = false;
+ ASSERT(m_state->m_isSweepForbidden);
+ m_state->m_isSweepForbidden = false;
}
private:
ThreadState* m_state;
@@ -374,7 +374,21 @@ public:
ASSERT(m_gcForbiddenCount > 0);
m_gcForbiddenCount--;
}
- bool sweepForbidden() const { return m_sweepForbidden; }
+ bool sweepForbidden() const { return m_isSweepForbidden; }
+
+#if ENABLE(ASSERT)
+ bool isEagerlySweeping() const { return m_isEagerlySweeping; }
+ void enterEagerSweepScope()
+ {
+ ASSERT(!m_isEagerlySweeping);
+ m_isEagerlySweeping = true;
+ }
+ void leaveEagerSweepScope()
+ {
+ ASSERT(m_isEagerlySweeping);
+ m_isEagerlySweeping = false;
+ }
+#endif
void prepareRegionTree();
void flushHeapDoesNotContainCacheIfNeeded();
@@ -709,18 +723,17 @@ private:
intptr_t* m_endOfStack;
void* m_safePointScopeMarker;
Vector<Address> m_safePointStackCopy;
- bool m_atSafePoint;
Vector<Interruptor*> m_interruptors;
- bool m_sweepForbidden;
+
size_t m_noAllocationCount;
size_t m_gcForbiddenCount;
+
BaseHeap* m_heaps[NumberOfHeaps];
int m_vectorBackingHeapIndex;
size_t m_heapAges[NumberOfHeaps];
size_t m_currentHeapAges;
- bool m_isTerminating;
GarbageCollectedMixinConstructorMarker* m_gcMixinMarker;
bool m_shouldFlushHeapDoesNotContainCache;
@@ -748,6 +761,13 @@ private:
static const int likelyToBePromptlyFreedArraySize = (1 << 8);
static const int likelyToBePromptlyFreedArrayMask = likelyToBePromptlyFreedArraySize - 1;
OwnPtr<int[]> m_likelyToBePromptlyFreed;
+
+ bool m_atSafePoint;
+ bool m_isTerminating;
+ bool m_isSweepForbidden;
+#if ENABLE(ASSERT)
+ bool m_isEagerlySweeping;
+#endif
};
template<ThreadAffinity affinity> class ThreadStateFor;

Powered by Google App Engine
This is Rietveld 408576698