Title: [149146] trunk/Source
Revision
149146
Author
[email protected]
Date
2013-04-25 15:17:34 -0700 (Thu, 25 Apr 2013)

Log Message

Stack guards are too conservative
https://bugs.webkit.org/show_bug.cgi?id=115147

Reviewed by Mark Hahnenberg.

Source/_javascript_Core:

Increase stack guard to closer to old size.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::StackPolicy::StackPolicy):

Source/WTF:

Use getrlimit on darwin to get the stack size for the main thread.

* wtf/StackBounds.cpp:
(WTF::StackBounds::initialize):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (149145 => 149146)


--- trunk/Source/_javascript_Core/ChangeLog	2013-04-25 21:39:35 UTC (rev 149145)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-04-25 22:17:34 UTC (rev 149146)
@@ -3,6 +3,18 @@
         Stack guards are too conservative
         https://bugs.webkit.org/show_bug.cgi?id=115147
 
+        Reviewed by Mark Hahnenberg.
+
+        Increase stack guard to closer to old size.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::StackPolicy::StackPolicy):
+
+2013-04-25  Oliver Hunt  <[email protected]>
+
+        Stack guards are too conservative
+        https://bugs.webkit.org/show_bug.cgi?id=115147
+
         Reviewed by Geoffrey Garen.
 
         Reduce the limits and simplify the decision making.

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (149145 => 149146)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2013-04-25 21:39:35 UTC (rev 149145)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2013-04-25 22:17:34 UTC (rev 149146)
@@ -126,8 +126,8 @@
     //
     // These sizes were derived from the stack usage of a number of sites when
     // layout occurs when we've already consumed most of the C stack.
-    const size_t requiredStack = 64 * KB;
-    const size_t errorModeRequiredStack = 32 * KB;
+    const size_t requiredStack = 256 * KB;
+    const size_t errorModeRequiredStack = 64 * KB;
 
     size_t requiredCapacity = m_interpreter.m_errorHandlingModeReentry ? errorModeRequiredStack : requiredStack;
 

Modified: trunk/Source/WTF/ChangeLog (149145 => 149146)


--- trunk/Source/WTF/ChangeLog	2013-04-25 21:39:35 UTC (rev 149145)
+++ trunk/Source/WTF/ChangeLog	2013-04-25 22:17:34 UTC (rev 149146)
@@ -1,3 +1,15 @@
+2013-04-25  Oliver Hunt  <[email protected]>
+
+        Stack guards are too conservative
+        https://bugs.webkit.org/show_bug.cgi?id=115147
+
+        Reviewed by Mark Hahnenberg.
+
+        Use getrlimit on darwin to get the stack size for the main thread.
+
+        * wtf/StackBounds.cpp:
+        (WTF::StackBounds::initialize):
+
 2013-04-25  Andreas Kling  <[email protected]>
 
         Remove ENABLE(PARSED_STYLE_SHEET_CACHING) and make it always-on.

Modified: trunk/Source/WTF/wtf/StackBounds.cpp (149145 => 149146)


--- trunk/Source/WTF/wtf/StackBounds.cpp	2013-04-25 21:39:35 UTC (rev 149145)
+++ trunk/Source/WTF/wtf/StackBounds.cpp	2013-04-25 22:17:34 UTC (rev 149146)
@@ -79,7 +79,17 @@
 {
     pthread_t thread = pthread_self();
     m_origin = pthread_get_stackaddr_np(thread);
-    m_bound = static_cast<char*>(m_origin) - pthread_get_stacksize_np(thread);
+    size_t size = 0;
+    if (pthread_main_np()) {
+        // FIXME: <rdar://problem/13741204>
+        // pthread_get_size lies to us when we're the main thread, use get_rlimit instead
+        rlimit limit;
+        getrlimit(RLIMIT_STACK, &limit);
+        size = limit.rlim_cur;
+    } else
+        size = pthread_get_stacksize_np(thread);
+
+    m_bound = static_cast<char*>(m_origin) - size;
 }
 
 #elif OS(QNX)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to