diff options
Diffstat (limited to 'js/src/jsnativestack.cpp')
-rw-r--r-- | js/src/jsnativestack.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index 166a5a4f7..4e96e01e8 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -26,11 +26,7 @@ # include <sys/syscall.h> # include <sys/types.h> # include <unistd.h> -static pid_t -gettid() -{ - return syscall(__NR_gettid); -} +# define gettid() static_cast<pid_t>(syscall(SYS_gettid)) # endif #else @@ -71,33 +67,18 @@ js::GetNativeStackBaseImpl() # endif } -#elif defined(SOLARIS) +#elif defined(XP_SOLARIS) #include <ucontext.h> JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0); -void* -js::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* +void* js::GetNativeStackBaseImpl() { - ucontext_t context; - getcontext(&context); - return static_cast<char*>(context.uc_stack.ss_sp) + - context.uc_stack.ss_size; + stack_t st; + stack_getbounds(&st); + return static_cast<char*>(st.ss_sp) + st.ss_size; } #elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__) |