Chromium Code Reviews| Index: Source/platform/heap/ThreadState.cpp |
| diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
| index deaa5135d82c09596854b74a0164c6e37fec1fe5..e60da1a227b95c5cdba451b77d3026a890b93cbe 100644 |
| --- a/Source/platform/heap/ThreadState.cpp |
| +++ b/Source/platform/heap/ThreadState.cpp |
| @@ -893,6 +893,8 @@ void ThreadState::preGC() |
| makeConsistentForSweeping(); |
| prepareRegionTree(); |
| flushHeapDoesNotContainCacheIfNeeded(); |
| + if (isMainThread()) |
| + m_allocatedObjectSizeBeforeSweeping = Heap::allocatedObjectSize() + Heap::markedObjectSize(); |
|
haraken
2015/01/13 11:56:48
Shall we rename it to m_objectSizeBeforeGC?
sof
2015/01/13 12:11:53
Done.
|
| } |
| void ThreadState::postGC(GCType gcType) |
| @@ -1037,8 +1039,6 @@ void ThreadState::postGCProcessing() |
| return; |
| m_didV8GCAfterLastGC = false; |
| - if (isMainThread()) |
| - m_allocatedObjectSizeBeforeSweeping = Heap::allocatedObjectSize(); |
|
haraken
2015/01/13 11:56:48
Before this CL, m_allocatedObjectSizeBeforeSweepin
sof
2015/01/13 12:11:53
Yes; m_collectionRate then mapping to +Inf.
haraken
2015/01/13 12:23:08
oh...
Also let's add a zero-division check to the
sof
2015/01/13 12:35:57
Asserted on m_collectionRate's range.
|
| #if ENABLE(GC_PROFILE_HEAP) |
| // We snapshot the heap prior to sweeping to get numbers for both resources |