Index: Source/platform/heap/Heap.cpp |
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp |
index ef9249c058ee6469fe8655e1d0367e00607a7168..8dfcc442d08c2dbdb6be17578e0180d6d2f63221 100644 |
--- a/Source/platform/heap/Heap.cpp |
+++ b/Source/platform/heap/Heap.cpp |
@@ -457,7 +457,6 @@ Address BaseHeap::lazySweep(size_t allocationSize, size_t gcInfoIndex) |
ScriptForbiddenScope::exit(); |
Heap::reportMemoryUsageForTracing(); |
- |
return result; |
} |
@@ -888,7 +887,7 @@ Address NormalPageHeap::outOfLineAllocate(size_t allocationSize, size_t gcInfoIn |
// Ideally we want to update the persistent count every time a persistent |
// handle is created or destructed, but that is heavy. So we do the update |
// only in outOfLineAllocate(). |
- threadState()->updatePersistentCounters(); |
+ threadState()->updateWrapperCounters(); |
// 1. If this allocation is big enough, allocate a large object. |
if (allocationSize >= largeObjectSizeThreshold) { |
@@ -1934,15 +1933,11 @@ void Heap::init() |
s_allocatedObjectSize = 0; |
s_objectSizeAtLastGC = 0; |
s_markedObjectSize = 0; |
- s_persistentCount = 0; |
- s_persistentCountAtLastGC = 0; |
- s_collectedPersistentCount = 0; |
+ s_markedObjectSizeAtLastCompleteSweep = 1024 * 1024; |
+ s_wrapperCount = 0; |
+ s_wrapperCountAtLastGC = 0; |
+ s_collectedWrapperCount = 0; |
s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages(); |
- // Initially, the total heap size is very small. Thus we'll hit the GC |
- // condition (i.e., 50% increase on the heap size etc) even if we don't |
- // take into account the memory usage explained by the collected persistent |
- // handles. So it is OK to set a large initial value. |
- s_heapSizePerPersistent = 1024 * 1024; |
s_estimatedMarkingTimePerByte = 0.0; |
GCInfoTable::init(); |
@@ -2404,12 +2399,12 @@ void Heap::reportMemoryUsageForTracing() |
// They are capped to INT_MAX just in case. |
TRACE_COUNTER1("blink_gc", "Heap::allocatedObjectSizeKB", std::min(Heap::allocatedObjectSize() / 1024, static_cast<size_t>(INT_MAX))); |
TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeKB", std::min(Heap::markedObjectSize() / 1024, static_cast<size_t>(INT_MAX))); |
+ TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeAtLastCompleteSweepKB", std::min(Heap::markedObjectSizeAtLastCompleteSweep() / 1024, static_cast<size_t>(INT_MAX))); |
TRACE_COUNTER1("blink_gc", "Heap::allocatedSpaceKB", std::min(Heap::allocatedSpace() / 1024, static_cast<size_t>(INT_MAX))); |
TRACE_COUNTER1("blink_gc", "Heap::objectSizeAtLastGCKB", std::min(Heap::objectSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX))); |
- TRACE_COUNTER1("blink_gc", "Heap::persistentCount", std::min(Heap::persistentCount(), static_cast<size_t>(INT_MAX))); |
- TRACE_COUNTER1("blink_gc", "Heap::persistentCountAtLastGC", std::min(Heap::persistentCountAtLastGC(), static_cast<size_t>(INT_MAX))); |
- TRACE_COUNTER1("blink_gc", "Heap::collectedPersistentCount", std::min(Heap::collectedPersistentCount(), static_cast<size_t>(INT_MAX))); |
- TRACE_COUNTER1("blink_gc", "Heap::heapSizePerPersistent", std::min(Heap::heapSizePerPersistent(), static_cast<size_t>(INT_MAX))); |
+ TRACE_COUNTER1("blink_gc", "Heap::wrapperCount", std::min(Heap::wrapperCount(), static_cast<size_t>(INT_MAX))); |
+ TRACE_COUNTER1("blink_gc", "Heap::wrapperCountAtLastGC", std::min(Heap::wrapperCountAtLastGC(), static_cast<size_t>(INT_MAX))); |
+ TRACE_COUNTER1("blink_gc", "Heap::collectedWrapperCount", std::min(Heap::collectedWrapperCount(), static_cast<size_t>(INT_MAX))); |
TRACE_COUNTER1("blink_gc", "Heap::partitionAllocSizeAtLastGCKB", std::min(Heap::partitionAllocSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX))); |
TRACE_COUNTER1("blink_gc", "Partitions::totalSizeOfCommittedPagesKB", std::min(WTF::Partitions::totalSizeOfCommittedPages() / 1024, static_cast<size_t>(INT_MAX))); |
} |
@@ -2527,11 +2522,11 @@ void Heap::resetHeapCounters() |
Heap::reportMemoryUsageForTracing(); |
s_objectSizeAtLastGC = s_allocatedObjectSize + s_markedObjectSize; |
+ s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages(); |
+ s_wrapperCountAtLastGC = s_wrapperCount; |
s_allocatedObjectSize = 0; |
s_markedObjectSize = 0; |
- s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages(); |
- s_persistentCountAtLastGC = s_persistentCount; |
- s_collectedPersistentCount = 0; |
+ s_collectedWrapperCount = 0; |
} |
CallbackStack* Heap::s_markingStack; |
@@ -2547,11 +2542,11 @@ size_t Heap::s_allocatedSpace = 0; |
size_t Heap::s_allocatedObjectSize = 0; |
size_t Heap::s_objectSizeAtLastGC = 0; |
size_t Heap::s_markedObjectSize = 0; |
-size_t Heap::s_persistentCount = 0; |
-size_t Heap::s_persistentCountAtLastGC = 0; |
-size_t Heap::s_collectedPersistentCount = 0; |
+size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0; |
+size_t Heap::s_wrapperCount = 0; |
+size_t Heap::s_wrapperCountAtLastGC = 0; |
+size_t Heap::s_collectedWrapperCount = 0; |
size_t Heap::s_partitionAllocSizeAtLastGC = 0; |
-size_t Heap::s_heapSizePerPersistent = 0; |
double Heap::s_estimatedMarkingTimePerByte = 0.0; |
} // namespace blink |