Title: [139812] trunk/Source/_javascript_Core
Revision
139812
Author
[email protected]
Date
2013-01-15 17:33:30 -0800 (Tue, 15 Jan 2013)

Log Message

Use MADV_FREE_REUSABLE to return JIT memory to OS
https://bugs.webkit.org/show_bug.cgi?id=106830
<rdar://problem/11437701>

Reviewed by Geoffrey Garen.

Use MADV_FREE_REUSABLE to return JIT memory on OSes that have the underlying madvise bug
fixed.

* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::FixedVMPoolExecutableAllocator::notifyPageIsFree):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (139811 => 139812)


--- trunk/Source/_javascript_Core/ChangeLog	2013-01-16 01:07:31 UTC (rev 139811)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-01-16 01:33:30 UTC (rev 139812)
@@ -1,3 +1,17 @@
+2013-01-15  Pratik Solanki  <[email protected]>
+
+        Use MADV_FREE_REUSABLE to return JIT memory to OS
+        https://bugs.webkit.org/show_bug.cgi?id=106830
+        <rdar://problem/11437701>
+
+        Reviewed by Geoffrey Garen.
+
+        Use MADV_FREE_REUSABLE to return JIT memory on OSes that have the underlying madvise bug
+        fixed.
+
+        * jit/ExecutableAllocatorFixedVMPool.cpp:
+        (JSC::FixedVMPoolExecutableAllocator::notifyPageIsFree):
+
 2013-01-15  Levi Weintraub  <[email protected]>
 
         Unreviewed, rolling out r139790.

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocatorFixedVMPool.cpp (139811 => 139812)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocatorFixedVMPool.cpp	2013-01-16 01:07:31 UTC (rev 139811)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocatorFixedVMPool.cpp	2013-01-16 01:33:30 UTC (rev 139812)
@@ -40,6 +40,11 @@
 #include <stdio.h>
 #endif
 
+#if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+// MADV_FREE_REUSABLE does not work for JIT memory on older OSes so use MADV_FREE in that case.
+#define WTF_USE_MADV_FREE_FOR_JIT_MEMORY 1
+#endif
+
 using namespace WTF;
 
 namespace JSC {
@@ -74,7 +79,7 @@
     
     virtual void notifyNeedPage(void* page)
     {
-#if OS(DARWIN)
+#if USE(MADV_FREE_FOR_JIT_MEMORY)
         UNUSED_PARAM(page);
 #else
         m_reservation.commit(page, pageSize());
@@ -83,7 +88,7 @@
     
     virtual void notifyPageIsFree(void* page)
     {
-#if OS(DARWIN)
+#if USE(MADV_FREE_FOR_JIT_MEMORY)
         for (;;) {
             int result = madvise(page, pageSize(), MADV_FREE);
             if (!result)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to