Commit 7ee8204c authored by haraken@chromium.org's avatar haraken@chromium.org

Oilpan: Report memory usage at each safe point

It is helpful to let Oilpan report its memory usage at each safe point.

BUG=

Review URL: https://codereview.chromium.org/1315603004

git-svn-id: svn://svn.chromium.org/blink/trunk@201090 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3edc88a9
...@@ -676,6 +676,8 @@ bool ThreadState::shouldForceConservativeGC() ...@@ -676,6 +676,8 @@ bool ThreadState::shouldForceConservativeGC()
void ThreadState::scheduleV8FollowupGCIfNeeded() void ThreadState::scheduleV8FollowupGCIfNeeded()
{ {
ASSERT(checkThread()); ASSERT(checkThread());
Heap::reportMemoryUsageForTracing();
if (isGCForbidden()) if (isGCForbidden())
return; return;
...@@ -683,7 +685,6 @@ void ThreadState::scheduleV8FollowupGCIfNeeded() ...@@ -683,7 +685,6 @@ void ThreadState::scheduleV8FollowupGCIfNeeded()
return; return;
ASSERT(!sweepForbidden()); ASSERT(!sweepForbidden());
Heap::reportMemoryUsageForTracing();
if (shouldScheduleV8FollowupGC()) if (shouldScheduleV8FollowupGC())
schedulePreciseGC(); schedulePreciseGC();
} }
...@@ -691,6 +692,8 @@ void ThreadState::scheduleV8FollowupGCIfNeeded() ...@@ -691,6 +692,8 @@ void ThreadState::scheduleV8FollowupGCIfNeeded()
void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio)
{ {
ASSERT(checkThread()); ASSERT(checkThread());
Heap::reportMemoryUsageForTracing();
if (isGCForbidden()) if (isGCForbidden())
return; return;
...@@ -701,7 +704,6 @@ void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) ...@@ -701,7 +704,6 @@ void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio)
ASSERT(!isSweepingInProgress()); ASSERT(!isSweepingInProgress());
ASSERT(!sweepForbidden()); ASSERT(!sweepForbidden());
Heap::reportMemoryUsageForTracing();
if (shouldSchedulePageNavigationGC(estimatedRemovalRatio)) if (shouldSchedulePageNavigationGC(estimatedRemovalRatio))
schedulePageNavigationGC(); schedulePageNavigationGC();
} }
...@@ -716,6 +718,8 @@ void ThreadState::schedulePageNavigationGC() ...@@ -716,6 +718,8 @@ void ThreadState::schedulePageNavigationGC()
void ThreadState::scheduleGCIfNeeded() void ThreadState::scheduleGCIfNeeded()
{ {
ASSERT(checkThread()); ASSERT(checkThread());
Heap::reportMemoryUsageForTracing();
if (isGCForbidden()) if (isGCForbidden())
return; return;
...@@ -725,8 +729,6 @@ void ThreadState::scheduleGCIfNeeded() ...@@ -725,8 +729,6 @@ void ThreadState::scheduleGCIfNeeded()
return; return;
ASSERT(!sweepForbidden()); ASSERT(!sweepForbidden());
Heap::reportMemoryUsageForTracing();
if (shouldForceMemoryPressureGC()) { if (shouldForceMemoryPressureGC()) {
Heap::collectGarbage(HeapPointersOnStack, GCWithoutSweep, Heap::ConservativeGC); Heap::collectGarbage(HeapPointersOnStack, GCWithoutSweep, Heap::ConservativeGC);
return; return;
...@@ -1230,6 +1232,8 @@ void ThreadState::resumeThreads() ...@@ -1230,6 +1232,8 @@ void ThreadState::resumeThreads()
void ThreadState::safePoint(StackState stackState) void ThreadState::safePoint(StackState stackState)
{ {
ASSERT(checkThread()); ASSERT(checkThread());
Heap::reportMemoryUsageForTracing();
runScheduledGC(stackState); runScheduledGC(stackState);
ASSERT(!m_atSafePoint); ASSERT(!m_atSafePoint);
m_stackState = stackState; m_stackState = stackState;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment