Changeset 150603 in webkit


Ignore:
Timestamp:
May 23, 2013 12:19:10 PM (11 years ago)
Author:
Patrick Gansterer
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 <david@wmol.com>.

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

  • wtf/Platform.h:
  • wtf/StackBounds.cpp:

(WTF):
(WTF::StackBounds::initialize):

Location:
trunk/Source/WTF
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r150600 r150603  
     12013-05-23 Patrick Gansterer <paroga@webkit.org>
     2
     3        Use correct stack size on Solaris and OpenBSD
     4        https://bugs.webkit.org/show_bug.cgi?id=114978
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Original patch by David Hill <david@wmol.com>.
     9
     10        Use stack_t.ss_size for getting the size of the stack.
     11
     12        * wtf/Platform.h:
     13        * wtf/StackBounds.cpp:
     14        (WTF):
     15        (WTF::StackBounds::initialize):
     16
    1172013-05-23  Patrick Gansterer  <paroga@webkit.org>
    218
  • trunk/Source/WTF/wtf/Platform.h

    r150561 r150603  
    6666#endif
    6767
     68/* CPU(HPPA) - HP PA-RISC */
     69#if defined(__hppa__) || defined(__hppa64__)
     70#define WTF_CPU_HPPA 1
     71#endif
     72
    6873/* CPU(IA64) - Itanium / IA-64 */
    6974#if defined(__ia64__)
  • trunk/Source/WTF/wtf/StackBounds.cpp

    r150600 r150603  
    5656namespace WTF {
    5757
    58 // Bug 26276 - Need a mechanism to determine stack extent
    59 //
    60 // These platforms should now be working correctly:
    61 //     DARWIN, QNX, UNIX, WINDOWS
    62 // These platforms are not:
    63 //     SOLARIS, OPENBSD
    64 //
    65 // FIXME: remove this! - this code unsafely guesses at stack sizes!
    66 #if OS(SOLARIS) || OS(OPENBSD)
    67 // Based on the current limit used by the JSC parser, guess the stack size.
    68 static const ptrdiff_t estimatedStackSize = 128 * sizeof(void*) * 1024;
    69 // This method assumes the stack is growing downwards.
    70 static void* estimateStackBound(void* origin)
    71 {
    72     return static_cast<char*>(origin) - estimatedStackSize;
    73 }
    74 #endif
    75 
    7658#if OS(DARWIN)
    7759
     
    125107    thr_stksegment(&s);
    126108    m_origin = s.ss_sp;
    127     m_bound = estimateStackBound(m_origin);
     109    m_bound = static_cast<char*>(m_origin) - s.ss_size;
    128110}
    129111
     
    136118    pthread_stackseg_np(thread, &stack);
    137119    m_origin = stack.ss_sp;
    138     m_bound = estimateStackBound(m_origin);
     120#if CPU(HPPA)
     121    m_bound = static_cast<char*>(m_origin) + stack.ss_size;
     122#else
     123    m_bound = static_cast<char*>(m_origin) - stack.ss_size;
     124#endif
    139125}
    140126
Note: See TracChangeset for help on using the changeset viewer.