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

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

Issue 1308163003: Oilpan: Give a chance to schedule a precise GC after V8 minor and major GCs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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') | no next file » | 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 8126e720f54d9987347a98d46e4abeace17f9bd2..a6f33018f482969fc7ba57ef9a9f26bd31ccec49 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -657,6 +657,11 @@ bool ThreadState::shouldSchedulePreciseGC()
#endif
}
+bool ThreadState::shouldScheduleV8FollowupGC()
+{
+ return judgeGCThreshold(32 * 1024 * 1024, 1.5);
+}
+
bool ThreadState::shouldSchedulePageNavigationGC(float estimatedRemovalRatio)
{
return judgeGCThreshold(1024 * 1024, 1.5 * (1 - estimatedRemovalRatio));
@@ -668,6 +673,21 @@ bool ThreadState::shouldForceConservativeGC()
return judgeGCThreshold(32 * 1024 * 1024, 5.0);
}
+void ThreadState::scheduleV8FollowupGCIfNeeded()
+{
+ ASSERT(checkThread());
+ if (isGCForbidden())
+ return;
+
+ if (isSweepingInProgress())
+ return;
+ ASSERT(!sweepForbidden());
+
+ Heap::reportMemoryUsageForTracing();
+ if (shouldScheduleV8FollowupGC())
+ schedulePreciseGC();
+}
+
void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio)
{
ASSERT(checkThread());
« no previous file with comments | « Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698