From 41386e9cb918eed93b3f13648cbef387e371e451 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 20 May 2015 09:56:07 +0000 Subject: webkitgtk-2.4.9 --- Source/JavaScriptCore/heap/HeapStatistics.cpp | 44 +++++++++++---------------- 1 file changed, 17 insertions(+), 27 deletions(-) (limited to 'Source/JavaScriptCore/heap/HeapStatistics.cpp') diff --git a/Source/JavaScriptCore/heap/HeapStatistics.cpp b/Source/JavaScriptCore/heap/HeapStatistics.cpp index bc5465fb9..f23def711 100644 --- a/Source/JavaScriptCore/heap/HeapStatistics.cpp +++ b/Source/JavaScriptCore/heap/HeapStatistics.cpp @@ -28,8 +28,8 @@ #include "Heap.h" #include "HeapIterationScope.h" -#include "JSCInlines.h" #include "JSObject.h" +#include "Operations.h" #include "Options.h" #include #if OS(UNIX) @@ -132,7 +132,6 @@ void HeapStatistics::logStatistics() void HeapStatistics::exitWithFailure() { - exit(-1); } void HeapStatistics::reportSuccess() @@ -167,7 +166,7 @@ class StorageStatistics : public MarkedBlock::VoidFunctor { public: StorageStatistics(); - IterationStatus operator()(JSCell*); + void operator()(JSCell*); size_t objectWithOutOfLineStorageCount(); size_t objectCount(); @@ -176,8 +175,6 @@ public: size_t storageCapacity(); private: - void visit(JSCell*); - size_t m_objectWithOutOfLineStorageCount; size_t m_objectCount; size_t m_storageSize; @@ -192,13 +189,13 @@ inline StorageStatistics::StorageStatistics() { } -inline void StorageStatistics::visit(JSCell* cell) +inline void StorageStatistics::operator()(JSCell* cell) { if (!cell->isObject()) return; JSObject* object = jsCast(cell); - if (hasIndexedProperties(object->indexingType())) + if (hasIndexedProperties(object->structure()->indexingType())) return; if (object->structure()->isUncacheableDictionary()) @@ -211,12 +208,6 @@ inline void StorageStatistics::visit(JSCell* cell) m_storageCapacity += object->structure()->totalStorageCapacity() * sizeof(WriteBarrierBase); } -inline IterationStatus StorageStatistics::operator()(JSCell* cell) -{ - visit(cell); - return IterationStatus::Continue; -} - inline size_t StorageStatistics::objectWithOutOfLineStorageCount() { return m_objectWithOutOfLineStorageCount; @@ -242,26 +233,25 @@ void HeapStatistics::showObjectStatistics(Heap* heap) dataLogF("\n=== Heap Statistics: ===\n"); dataLogF("size: %ldkB\n", static_cast(heap->m_sizeAfterLastCollect / KB)); dataLogF("capacity: %ldkB\n", static_cast(heap->capacity() / KB)); - dataLogF("pause time: %lfs\n\n", heap->m_lastFullGCLength); + dataLogF("pause time: %lfms\n\n", heap->m_lastGCLength); StorageStatistics storageStatistics; { HeapIterationScope iterationScope(*heap); heap->m_objectSpace.forEachLiveCell(iterationScope, storageStatistics); } - long wastedPropertyStorageBytes = 0; - long wastedPropertyStoragePercent = 0; - long objectWithOutOfLineStorageCount = 0; - long objectsWithOutOfLineStoragePercent = 0; - if ((storageStatistics.storageCapacity() > 0) && (storageStatistics.objectCount() > 0)) { - wastedPropertyStorageBytes = static_cast((storageStatistics.storageCapacity() - storageStatistics.storageSize()) / KB); - wastedPropertyStoragePercent = static_cast( - (storageStatistics.storageCapacity() - storageStatistics.storageSize()) * 100 / storageStatistics.storageCapacity()); - objectWithOutOfLineStorageCount = static_cast(storageStatistics.objectWithOutOfLineStorageCount()); - objectsWithOutOfLineStoragePercent = objectWithOutOfLineStorageCount * 100 / storageStatistics.objectCount(); - } - dataLogF("wasted .property storage: %ldkB (%ld%%)\n", wastedPropertyStorageBytes, wastedPropertyStoragePercent); - dataLogF("objects with out-of-line .property storage: %ld (%ld%%)\n", objectWithOutOfLineStorageCount, objectsWithOutOfLineStoragePercent); + dataLogF("wasted .property storage: %ldkB (%ld%%)\n", + static_cast( + (storageStatistics.storageCapacity() - storageStatistics.storageSize()) / KB), + static_cast( + (storageStatistics.storageCapacity() - storageStatistics.storageSize()) * 100 + / storageStatistics.storageCapacity())); + dataLogF("objects with out-of-line .property storage: %ld (%ld%%)\n", + static_cast( + storageStatistics.objectWithOutOfLineStorageCount()), + static_cast( + storageStatistics.objectWithOutOfLineStorageCount() * 100 + / storageStatistics.objectCount())); } } // namespace JSC -- cgit v1.2.1