Title: [116583] trunk/Source
Revision
116583
Author
[email protected]
Date
2012-05-09 17:19:55 -0700 (Wed, 09 May 2012)

Log Message

It should be possible to get useful debug logging from the JIT memory allocator
https://bugs.webkit.org/show_bug.cgi?id=86042

Reviewed by Geoff Garen.

Source/_javascript_Core: 

* jit/ExecutableAllocator.h:

Source/WTF: 

* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::findAndRemoveFreeSpace):
(WTF::MetaAllocator::addFreeSpace):
(WTF::MetaAllocator::dumpProfile):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (116582 => 116583)


--- trunk/Source/_javascript_Core/ChangeLog	2012-05-10 00:18:23 UTC (rev 116582)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-05-10 00:19:55 UTC (rev 116583)
@@ -1,3 +1,12 @@
+2012-05-09  Filip Pizlo  <[email protected]>
+
+        It should be possible to get useful debug logging from the JIT memory allocator
+        https://bugs.webkit.org/show_bug.cgi?id=86042
+
+        Reviewed by Geoff Garen.
+
+        * jit/ExecutableAllocator.h:
+
 2012-05-09  Gavin Barraclough  <[email protected]>
 
         GC race condition in OpaqueJSClass::prototype

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.h (116582 => 116583)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2012-05-10 00:18:23 UTC (rev 116582)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2012-05-10 00:19:55 UTC (rev 116583)
@@ -30,6 +30,7 @@
 #include <limits>
 #include <wtf/Assertions.h>
 #include <wtf/MetaAllocatorHandle.h>
+#include <wtf/MetaAllocator.h>
 #include <wtf/PageAllocation.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>

Modified: trunk/Source/WTF/ChangeLog (116582 => 116583)


--- trunk/Source/WTF/ChangeLog	2012-05-10 00:18:23 UTC (rev 116582)
+++ trunk/Source/WTF/ChangeLog	2012-05-10 00:19:55 UTC (rev 116583)
@@ -1,3 +1,15 @@
+2012-05-09  Filip Pizlo  <[email protected]>
+
+        It should be possible to get useful debug logging from the JIT memory allocator
+        https://bugs.webkit.org/show_bug.cgi?id=86042
+
+        Reviewed by Geoff Garen.
+
+        * wtf/MetaAllocator.cpp:
+        (WTF::MetaAllocator::findAndRemoveFreeSpace):
+        (WTF::MetaAllocator::addFreeSpace):
+        (WTF::MetaAllocator::dumpProfile):
+
 2012-05-08  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r116440.

Modified: trunk/Source/WTF/wtf/MetaAllocator.cpp (116582 => 116583)


--- trunk/Source/WTF/wtf/MetaAllocator.cpp	2012-05-10 00:18:23 UTC (rev 116582)
+++ trunk/Source/WTF/wtf/MetaAllocator.cpp	2012-05-10 00:19:55 UTC (rev 116583)
@@ -29,6 +29,7 @@
 #include "config.h"
 #include "MetaAllocator.h"
 
+#include <wtf/DataLog.h>
 #include <wtf/FastMalloc.h>
 
 namespace WTF {
@@ -260,6 +261,10 @@
         }
     }
     
+#if ENABLE(META_ALLOCATOR_PROFILE)
+    dumpProfile();
+#endif
+
     return result;
 }
 
@@ -381,6 +386,10 @@
             m_freeSpaceEndAddressMap.add(end, node);
         }
     }
+    
+#if ENABLE(META_ALLOCATOR_PROFILE)
+    dumpProfile();
+#endif
 }
 
 void MetaAllocator::incrementPageOccupancy(void* address, size_t sizeInBytes)
@@ -441,7 +450,8 @@
 #if ENABLE(META_ALLOCATOR_PROFILE)
 void MetaAllocator::dumpProfile()
 {
-    dataLog("num allocations = %u, num frees = %u\n", m_numAllocations, m_numFrees);
+    dataLog("%d: MetaAllocator(%p): num allocations = %u, num frees = %u, allocated = %lu, reserved = %lu, committed = %lu\n",
+            getpid(), this, m_numAllocations, m_numFrees, m_bytesAllocated, m_bytesReserved, m_bytesCommitted);
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to