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

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

Issue 980653002: Oilpan: disable conservative GCs during initial GC mixin construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add GC mixin test Created 5 years, 9 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 | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index f4a487d86ff0dabcfa6b205aa3542fb5e695a653..64f5d108e02584ff7180b71132b43c86a0f1acd2 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -554,6 +554,21 @@ public:
double collectionRate() const { return m_collectionRate; }
+ // By entering a gc-forbidden scope, conservative GCs will not
+ // be allowed 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 while its subclasses are being
+ // constructed.
+ void enterGCForbiddenScope(unsigned delta)
+ {
+ m_gcForbiddenCount += delta;
+ }
+
+#if ENABLE(ASSERT)
+ bool isGCForbidden() const { return m_gcForbiddenCount; }
+#endif
+
private:
ThreadState();
~ThreadState();
@@ -595,14 +610,7 @@ private:
void snapshotFreeList();
#endif
- // By entering a gc-forbidden scope, conservative GCs will not
- // be allowed 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 while its subclasses are being
- // constructed.
- template<typename U, typename V> friend class AllocateObjectTrait;
- void enterGCForbiddenScope() { m_gcForbiddenCount++; }
+ template<typename U> friend class GarbageCollectedMixinConstructorMarker;
void leaveGCForbiddenScope()
{
ASSERT(m_gcForbiddenCount > 0);
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698