kwangyul.seo at gmail.com
Fri Oct 16 11:51:03 PDT 2009
GetThreadCallStack() is a kernel function, but it is not Kernel-mode
only. So you can definitely use it to get the stack base address.
However, Pkfuncs.h (which includes the function declaration, related
structures and constants) is not usually available for user-level
applications. You need to create a header file by yourself to use it.
The current method with isPageWritable is not so efficient, but it is
performed only once. Thus there is no problem. On the other hand,
GetThreadCallStack seems to return frames of kernel functions too (it
is a kernel function anyway), so the returned stack base address is
slightly larger. It means it takes more time to scan the stack when GC
Kwang Yul Seo
On Fri, Oct 16, 2009 at 3:05 PM, Taeyun Kim <zeo at logicplant.com> wrote:
> I'm currently looking at the source code for WINCE port.
> In Collector.cpp, getStackBase() scans through the memory pages using IsPageWritable() to guess the base of the stack.
> But isn't it more precise to use GetThreadCallStack() instead?
> By using GetThreadCallStack(), one can get all the stack frames. The CallSnapshotEx structure which is filled by GetThreadCallStack() for each stack frame has dwFramePtr member, and that member's value of the last stack frame can be used to indicate the base of the stack of the thread.
> Has GetThreadCallStack() been considered and decided not to be used?
> Maybe the performance issue?
> What is the reason to disable it?
> For ARM processor, I tried to fill some platform-specific portion in Collector.cpp for WINCE, and after that, it was compiled successfully with ENABLE_JSC_MULTIPLE_THREADS set to 1. (getStackBase() mentioned above must be changed not to use global variables for this). But I haven't tested it since I cannot build the remaining modules for WINCE port(WebCore, WebKit etc.) for now.
> Is there any complex problems? (Maybe the performance issue?)
> Thanks in advance.
> Taeyun Kim
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev