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

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: Improve naming + optimize allocateOnHeapIndex() usage 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
« no previous file with comments | « Source/platform/heap/ThreadState.h ('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.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index a552cc3bcace888a7640d578698db16cd19550bd..2be4900377a959a67d0a37c7ef6748bc9f184f78 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_gcForbiddenCount(0)
, 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_gcForbiddenCount))
+ return false;
+
size_t newSize = Heap::allocatedObjectSize();
if (newSize >= 300 * 1024 * 1024) {
// If we consume too much memory, trigger a conservative GC
« no previous file with comments | « Source/platform/heap/ThreadState.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698