[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

barraclough at apple.com barraclough at apple.com
Fri Jan 21 15:09:39 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 5802e803549b57022174238841fcb53901dcc93c
Author: barraclough at apple.com <barraclough at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 7 23:59:18 2011 +0000

    Bug 26276 - Need a mechanism to determine stack extent on WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE platforms
    
    Reviewed by Geoff Garen.
    
    Fix for win32.  The base of the stack is stored in the "deallocation stack" field of the
    Thread Information Block - see: http://en.wikipedia.org/wiki/Win32_Thread_Information_Block
    for more information!
    
    * wtf/StackBounds.cpp:
    (WTF::StackBounds::initialize):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75289 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 25b0dce..54ac1e9 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-07  Gavin Barraclough  <barraclough at apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 26276 - Need a mechanism to determine stack extent on WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE platforms
+
+        Fix for win32.  The base of the stack is stored in the "deallocation stack" field of the
+        Thread Information Block - see: http://en.wikipedia.org/wiki/Win32_Thread_Information_Block
+        for more information!
+
+        * wtf/StackBounds.cpp:
+        (WTF::StackBounds::initialize):
+
 2011-01-07  Adam Roben  <aroben at apple.com>
 
         Update react-to-vsprops-changes.py after r74855
diff --git a/Source/JavaScriptCore/wtf/StackBounds.cpp b/Source/JavaScriptCore/wtf/StackBounds.cpp
index be8ce84..f83695e 100644
--- a/Source/JavaScriptCore/wtf/StackBounds.cpp
+++ b/Source/JavaScriptCore/wtf/StackBounds.cpp
@@ -60,12 +60,12 @@ namespace WTF {
 // Bug 26276 - Need a mechanism to determine stack extent
 //
 // These platforms should now be working correctly:
-//     DARWIN, QNX, UNIX
+//     DARWIN, WINDOWS-CPU(X86), QNX, UNIX, WINCE
 // These platforms are not:
-//     WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE
+//     WINDOWS-CPU(X86_64), SOLARIS, OPENBSD, SYMBIAN, HAIKU
 //
 // FIXME: remove this! - this code unsafely guesses at stack sizes!
-#if OS(WINDOWS) || OS(SOLARIS) || OS(OPENBSD) || OS(SYMBIAN) || OS(HAIKU)
+#if (OS(WINDOWS) && CPU(X86_64)) || OS(SOLARIS) || OS(OPENBSD) || OS(SYMBIAN) || OS(HAIKU)
 // 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.
@@ -247,39 +247,37 @@ void StackBounds::initialize()
     m_bound = isGrowingDownward ? lowerStackBound : upperStackBound;
 }
 
-#elif OS(WINDOWS)
+#elif OS(WINDOWS) && (CPU(X86) || CPU(X86_64))
 
 void StackBounds::initialize()
 {
-#if CPU(X86) && COMPILER(MSVC)
-    // offset 0x18 from the FS segment register gives a pointer to
-    // the thread information block for the current thread
+#if CPU(X86)
+    // Offset 0x18 from the FS segment register gives a pointer to
+    // the thread information block for the current thread.
     NT_TIB* pTib;
+#if COMPILER(MSVC)
     __asm {
         MOV EAX, FS:[18h]
         MOV pTib, EAX
     }
-    m_origin = static_cast<void*>(pTib->StackBase);
-#elif CPU(X86) && COMPILER(GCC)
-    // offset 0x18 from the FS segment register gives a pointer to
-    // the thread information block for the current thread
-    NT_TIB* pTib;
+#else
     asm ( "movl %%fs:0x18, %0\n"
           : "=r" (pTib)
         );
+#endif
+    // See http://en.wikipedia.org/wiki/Win32_Thread_Information_Block for more information!
+    void* pDeallocationStack = reinterpret_cast<char*>(pTib) + 0xE0C;
     m_origin = static_cast<void*>(pTib->StackBase);
+    m_bound = *static_cast<void**>(pDeallocationStack);
 #elif CPU(X86_64)
     PNT_TIB64 pTib = reinterpret_cast<PNT_TIB64>(NtCurrentTeb());
     m_origin = reinterpret_cast<void*>(pTib->StackBase);
-#else
-#error Need a way to get the stack bounds on this platform (Windows)
-#endif
-    // Looks like we should be able to get pTib->StackLimit
     m_bound = estimateStackBound(m_origin);
+#endif
 }
 
 #else
-#error Need a way to get the stack bounds on this platform
+#error Need a way to get the stack bounds on this platform.
 #endif
 
 } // namespace WTF

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list