Title: [150603] trunk/Source/WTF
Revision
150603
Author
par...@webkit.org
Date
2013-05-23 12:19:10 -0700 (Thu, 23 May 2013)

Log Message

Use correct stack size on Solaris and OpenBSD
https://bugs.webkit.org/show_bug.cgi?id=114978

Reviewed by Oliver Hunt.

Original patch by David Hill <da...@wmol.com>.

Use stack_t.ss_size for getting the size of the stack.

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

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (150602 => 150603)


--- trunk/Source/WTF/ChangeLog	2013-05-23 18:55:53 UTC (rev 150602)
+++ trunk/Source/WTF/ChangeLog	2013-05-23 19:19:10 UTC (rev 150603)
@@ -1,3 +1,19 @@
+2013-05-23 Patrick Gansterer <par...@webkit.org>
+
+        Use correct stack size on Solaris and OpenBSD
+        https://bugs.webkit.org/show_bug.cgi?id=114978
+
+        Reviewed by Oliver Hunt.
+
+        Original patch by David Hill <da...@wmol.com>.
+
+        Use stack_t.ss_size for getting the size of the stack.
+
+        * wtf/Platform.h:
+        * wtf/StackBounds.cpp:
+        (WTF):
+        (WTF::StackBounds::initialize):
+
 2013-05-23  Patrick Gansterer  <par...@webkit.org>
 
         [WIN] Implement correct detection of stack size

Modified: trunk/Source/WTF/wtf/Platform.h (150602 => 150603)


--- trunk/Source/WTF/wtf/Platform.h	2013-05-23 18:55:53 UTC (rev 150602)
+++ trunk/Source/WTF/wtf/Platform.h	2013-05-23 19:19:10 UTC (rev 150603)
@@ -65,6 +65,11 @@
 #define WTF_CPU_ALPHA 1
 #endif
 
+/* CPU(HPPA) - HP PA-RISC */
+#if defined(__hppa__) || defined(__hppa64__)
+#define WTF_CPU_HPPA 1
+#endif
+
 /* CPU(IA64) - Itanium / IA-64 */
 #if defined(__ia64__)
 #define WTF_CPU_IA64 1

Modified: trunk/Source/WTF/wtf/StackBounds.cpp (150602 => 150603)


--- trunk/Source/WTF/wtf/StackBounds.cpp	2013-05-23 18:55:53 UTC (rev 150602)
+++ trunk/Source/WTF/wtf/StackBounds.cpp	2013-05-23 19:19:10 UTC (rev 150603)
@@ -55,24 +55,6 @@
 
 namespace WTF {
 
-// Bug 26276 - Need a mechanism to determine stack extent
-//
-// These platforms should now be working correctly:
-//     DARWIN, QNX, UNIX, WINDOWS
-// These platforms are not:
-//     SOLARIS, OPENBSD
-//
-// FIXME: remove this! - this code unsafely guesses at stack sizes!
-#if OS(SOLARIS) || OS(OPENBSD)
-// Based on the current limit used by the JSC parser, guess the stack size.
-static const ptrdiff_t estimatedStackSize = 128 * sizeof(void*) * 1024;
-// This method assumes the stack is growing downwards.
-static void* estimateStackBound(void* origin)
-{
-    return static_cast<char*>(origin) - estimatedStackSize;
-}
-#endif
-
 #if OS(DARWIN)
 
 void StackBounds::initialize()
@@ -124,7 +106,7 @@
     stack_t s;
     thr_stksegment(&s);
     m_origin = s.ss_sp;
-    m_bound = estimateStackBound(m_origin);
+    m_bound = static_cast<char*>(m_origin) - s.ss_size;
 }
 
 #elif OS(OPENBSD)
@@ -135,7 +117,11 @@
     stack_t stack;
     pthread_stackseg_np(thread, &stack);
     m_origin = stack.ss_sp;
-    m_bound = estimateStackBound(m_origin);
+#if CPU(HPPA)
+    m_bound = static_cast<char*>(m_origin) + stack.ss_size;
+#else
+    m_bound = static_cast<char*>(m_origin) - stack.ss_size;
+#endif
 }
 
 #elif OS(UNIX)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to