Title: [195106] releases/WebKitGTK/webkit-2.10/Source/_javascript_Core
Revision
195106
Author
[email protected]
Date
2016-01-15 02:06:27 -0800 (Fri, 15 Jan 2016)

Log Message

Merge r193648 - Crashes on PPC64 due to mprotect() on address not aligned to the page size
https://bugs.webkit.org/show_bug.cgi?id=130237

Reviewed by Mark Lam.

Make sure that commitSize is at least as big as the page size.

* interpreter/JSStack.cpp:
(JSC::commitSize):
(JSC::JSStack::JSStack):
(JSC::JSStack::growSlowCase):
* interpreter/JSStack.h:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/ChangeLog (195105 => 195106)


--- releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/ChangeLog	2016-01-15 09:35:43 UTC (rev 195105)
+++ releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/ChangeLog	2016-01-15 10:06:27 UTC (rev 195106)
@@ -1,3 +1,18 @@
+2015-12-07  Alberto Garcia  <[email protected]>
+
+        Crashes on PPC64 due to mprotect() on address not aligned to the page size
+        https://bugs.webkit.org/show_bug.cgi?id=130237
+
+        Reviewed by Mark Lam.
+
+        Make sure that commitSize is at least as big as the page size.
+
+        * interpreter/JSStack.cpp:
+        (JSC::commitSize):
+        (JSC::JSStack::JSStack):
+        (JSC::JSStack::growSlowCase):
+        * interpreter/JSStack.h:
+
 2015-11-26  Carlos Garcia Campos  <[email protected]>
 
         [GLIB] Implement garbage collector timers

Modified: releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/interpreter/JSStack.cpp (195105 => 195106)


--- releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/interpreter/JSStack.cpp	2016-01-15 09:35:43 UTC (rev 195105)
+++ releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/interpreter/JSStack.cpp	2016-01-15 10:06:27 UTC (rev 195106)
@@ -40,6 +40,14 @@
 #if !ENABLE(JIT)
 static size_t committedBytesCount = 0;
 
+static size_t commitSize()
+{
+    static size_t size = 0;
+    if (!size)
+        size = std::max(16 * 1024, getpagesize());
+    return size;
+}
+
 static StaticLock stackStatisticsMutex;
 #endif // !ENABLE(JIT)
 
@@ -55,7 +63,7 @@
     size_t capacity = Options::maxPerThreadStackUsage();
     ASSERT(capacity && isPageAligned(capacity));
 
-    m_reservation = PageReservation::reserve(WTF::roundUpToMultipleOf(commitSize, capacity), OSAllocator::JSVMStackPages);
+    m_reservation = PageReservation::reserve(WTF::roundUpToMultipleOf(commitSize(), capacity), OSAllocator::JSVMStackPages);
     setStackLimit(highAddress());
     m_commitTop = highAddress();
     
@@ -89,7 +97,7 @@
     // have it is still within our budget. If not, we'll fail to grow and
     // return false.
     ptrdiff_t delta = reinterpret_cast<char*>(m_commitTop) - reinterpret_cast<char*>(newTopOfStackWithReservedZone);
-    delta = WTF::roundUpToMultipleOf(commitSize, delta);
+    delta = WTF::roundUpToMultipleOf(commitSize(), delta);
     Register* newCommitTop = m_commitTop - (delta / sizeof(Register));
     if (newCommitTop < reservationTop())
         return false;

Modified: releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/interpreter/JSStack.h (195105 => 195106)


--- releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/interpreter/JSStack.h	2016-01-15 09:35:43 UTC (rev 195105)
+++ releases/WebKitGTK/webkit-2.10/Source/_javascript_Core/interpreter/JSStack.h	2016-01-15 10:06:27 UTC (rev 195106)
@@ -67,7 +67,6 @@
             FirstArgument,
         };
 
-        static const size_t commitSize = 16 * 1024;
         // Allow 8k of excess registers before we start trying to reap the stack
         static const ptrdiff_t maxExcessCapacity = 8 * 1024;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to