]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - heap/HeapStatistics.cpp
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / heap / HeapStatistics.cpp
index 55e3e9d9db4c182da50c7a514209b42000dee500..f351f6ab5136445198a9a2aa94258161d44890b8 100644 (file)
@@ -27,8 +27,9 @@
 #include "HeapStatistics.h"
 
 #include "Heap.h"
+#include "HeapIterationScope.h"
 #include "JSObject.h"
-#include "Operations.h"
+#include "JSCInlines.h"
 #include "Options.h"
 #include <stdlib.h>
 #if OS(UNIX)
@@ -194,7 +195,7 @@ inline void StorageStatistics::operator()(JSCell* cell)
         return;
 
     JSObject* object = jsCast<JSObject*>(cell);
-    if (hasIndexedProperties(object->structure()->indexingType()))
+    if (hasIndexedProperties(object->indexingType()))
         return;
 
     if (object->structure()->isUncacheableDictionary())
@@ -232,10 +233,13 @@ void HeapStatistics::showObjectStatistics(Heap* heap)
     dataLogF("\n=== Heap Statistics: ===\n");
     dataLogF("size: %ldkB\n", static_cast<long>(heap->m_sizeAfterLastCollect / KB));
     dataLogF("capacity: %ldkB\n", static_cast<long>(heap->capacity() / KB));
-    dataLogF("pause time: %lfms\n\n", heap->m_lastGCLength);
+    dataLogF("pause time: %lfms\n\n", heap->m_lastFullGCLength);
 
     StorageStatistics storageStatistics;
-    heap->m_objectSpace.forEachLiveCell(storageStatistics);
+    {
+        HeapIterationScope iterationScope(*heap);
+        heap->m_objectSpace.forEachLiveCell(iterationScope, storageStatistics);
+    }
     dataLogF("wasted .property storage: %ldkB (%ld%%)\n",
         static_cast<long>(
             (storageStatistics.storageCapacity() - storageStatistics.storageSize()) / KB),