Bug 621000. Implement GetNativeStackBaseImpl for AIX. r=mrbkap
authorAndew Paprocki <andrew@ishiboo.com>
Tue, 22 Mar 2011 17:19:10 -0400
changeset 64336 70d9c9f2c148
parent 64335 a65b4b1d9676
child 64337 e8dda9a82da7
push id19328
push usercleary@mozilla.com
push date2011-03-29 21:56 +0000
treeherdermozilla-central@3d0784802ce6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs621000
milestone2.0b13pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 621000. Implement GetNativeStackBaseImpl for AIX. r=mrbkap
js/src/jsnativestack.cpp
--- a/js/src/jsnativestack.cpp
+++ b/js/src/jsnativestack.cpp
@@ -155,40 +155,43 @@ JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTI
 void *
 GetNativeStackBaseImpl()
 {
     stack_t st;
     stack_getbounds(&st);
     return static_cast<char*>(st.ss_sp) + st.ss_size;
 }
 
+#elif defined(AIX)
+
+#include <ucontext.h>
+
+JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0);
+
+void *
+GetNativeStackBaseImpl()
+{
+    ucontext_t context;
+    getcontext(&context);
+    return static_cast<char*>(context.uc_stack.ss_sp) +
+        context.uc_stack.ss_size;
+}
+
 #elif defined(XP_OS2)
 
 void *
 GetNativeStackBaseImpl()
 {
     PTIB  ptib;
     PPIB  ppib;
 
     DosGetInfoBlocks(&ptib, &ppib);
     return ptib->tib_pstacklimit;
 }
 
-#elif defined(SOLARIS)
-
-#include <ucontext.h>
-
-void *
-GetNativeStackBaseImpl()
-{
-    stack_t st;
-    stack_getbounds(&st);
-    return static_cast<char*>(st.ss_sp) + st.ss_size;
-}
-
 #else /* XP_UNIX */
 
 void *
 GetNativeStackBaseImpl()
 {
     pthread_t thread = pthread_self();
 # if defined(XP_MACOSX) || defined(DARWIN)
     return pthread_get_stackaddr_np(thread);