zherczeg at inf.u-szeged.hu
Mon Mar 2 00:52:21 PST 2009
that is intended, since the context pointer is the current
CallFrame/ExecState. WebKit creates its own stack (called RegisterFile) to
CallFrame (similar to ebp in x86, or fp in ARM architectures). When you
call a JS function, several important pointers are stored on the top of
the stack, like return value, current code block, previous call frame, and
these values are accessed through the CallFrame pointer. It is essential
> function to evaluate a piece of script. When executing the script, some
> callbacks provided by my code will be called, but I found that the context
> received by callbacks are different than the context I created and passed
> JSEvaluateScript function.
> Attached is a test program.
> Below is the output of this program on my system (ubuntu 8.04 64bit with
> latest webkit svn):
> Create context 0x7faf5d567e88, global object 0x7faf5d530000
> InitializeCallback(ctx=0x7faf5d567e88, obj=0x7faf5d532400)
> HasPropertyCallback(ctx=0x7faf50c4b048, obj=0x7faf5d532400,
> CallAsConstructorCallback(ctx=0x7faf50c4b0c0, obj=0x7faf5d532400)
> InitializeCallback(ctx=0x7faf50c4b0c0, obj=0x7faf5d532440)
> SetPropertyCallback(ctx=0x7faf50c4b048, obj=0x7faf5d532440, prop=prop1)
> HasPropertyCallback(ctx=0x7faf50c4b048, obj=0x7faf5d532440, prop=prop1)
> You can see that, the callback functions received several different
> pointers comparing to the one created at first beginning.
> Is it an intend behavior or a bug of webkit? And how can I avoid or
> workaround this problem?
> Thanks a lot.
> James Su
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev