Index: qtwebkit/Source/JavaScriptCore/heap/MachineStackMarker.cpp =================================================================== --- qtwebkit.orig/Source/JavaScriptCore/heap/MachineStackMarker.cpp 2011-12-25 23:12:15.000000000 +0400 +++ qtwebkit/Source/JavaScriptCore/heap/MachineStackMarker.cpp 2013-12-04 11:59:39.108002957 +0400 @@ -20,6 +20,9 @@ */ #include "config.h" +#if OS(SOLARIS) +#undef _FILE_OFFSET_BITS +#endif #include "MachineStackMarker.h" #include "ConservativeRoots.h" @@ -60,6 +63,10 @@ #include #if OS(SOLARIS) +#include +#include +#include +#include #include #else #include @@ -331,6 +338,7 @@ #error Need a thread register struct for this platform #endif +#if !OS(SOLARIS) static size_t getPlatformThreadRegisters(const PlatformThread& platformThread, PlatformThreadRegisters& regs) { #if OS(DARWIN) @@ -381,6 +389,7 @@ #error Need a way to get thread registers on this platform #endif } +#endif static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs) { @@ -431,6 +440,7 @@ #endif } +#if !OS(SOLARIS) static void freePlatformThreadRegisters(PlatformThreadRegisters& regs) { #if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN) @@ -439,9 +449,24 @@ UNUSED_PARAM(regs); #endif } +#endif void MachineThreads::gatherFromOtherThread(ConservativeRoots& conservativeRoots, Thread* thread) { +#if OS(SOLARIS) + struct lwpstatus lwp; + char procfile[64]; + int fd; + snprintf(procfile, 64, "/proc/self/lwp/%u/lwpstatus", thread->platformThread); + fd = open(procfile, O_RDONLY, 0); + if (fd == -1) { + fprintf(stderr, "%s: %s\n", procfile, strerror(errno)); + abort(); + } + pread(fd, &lwp, sizeof(lwp), 0); + close(fd); + void* stackPointer = (void*)lwp.pr_reg[REG_SP]; +#else suspendThread(thread->platformThread); PlatformThreadRegisters regs; @@ -450,13 +475,14 @@ conservativeRoots.add(static_cast(®s), static_cast(reinterpret_cast(®s) + regSize)); void* stackPointer = otherThreadStackPointer(regs); - void* stackBase = thread->stackBase; - swapIfBackwards(stackPointer, stackBase); - conservativeRoots.add(stackPointer, stackBase); resumeThread(thread->platformThread); freePlatformThreadRegisters(regs); +#endif + void* stackBase = thread->stackBase; + swapIfBackwards(stackPointer, stackBase); + conservativeRoots.add(stackPointer, stackBase); } #endif