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

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

Issue 946163003: Prevent GCs when constructing GC mixin objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add assert Created 5 years, 10 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.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index a552cc3bcace888a7640d578698db16cd19550bd..11519e5bcda35073e0824e6ecc97ceaecb1128cd 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -236,6 +236,7 @@ ThreadState::ThreadState()
, m_didV8GCAfterLastGC(false)
, m_sweepForbidden(false)
, m_noAllocationCount(0)
+ , m_noGCAllowedCount(0)
haraken 2015/02/23 08:24:23 Can we add ASSERT(!m_noGCAllowedCount) to somewher
sof 2015/02/23 10:29:02 It is currently asserted for on leaving; is that s
, m_isTerminating(false)
, m_shouldFlushHeapDoesNotContainCache(false)
, m_collectionRate(1.0)
@@ -669,6 +670,9 @@ bool ThreadState::shouldSchedulePreciseGC()
// These heuristics affect performance significantly.
bool ThreadState::shouldForceConservativeGC()
{
+ if (UNLIKELY(m_noGCAllowedCount))
haraken 2015/02/23 08:24:23 I'm wondering how unlikely this happens. What happ
sof 2015/02/23 08:30:20 Not sure I understand the concern - Node is an Eve
+ return false;
+
size_t newSize = Heap::allocatedObjectSize();
if (newSize >= 300 * 1024 * 1024) {
// If we consume too much memory, trigger a conservative GC

Powered by Google App Engine
This is Rietveld 408576698