zhxb.ustc at gmail.com
Mon Mar 23 02:26:07 PDT 2009
I have a question about the objects referencing between Javasciptcore
JSNode uses m_impl to reference a Node in WebCore. And when
KJS::Collector::collect() is called the function mark() of each JSNode is
invoked to keep the corresponding Node in WebCore alive in memory.
The problem is: I want to seperate the memory managment of
each page. To do so, I allocate a large block of memory for eache page,
and delete it when loading the next page. ( I have commented out
'pagecache', 'backforwardlist' etc.)
But, when it jumps back to a page which has been visited before, and a
javascipt codes is excuted, it crashes when JSNode use m_impl to reference
a Node in WebCore. The reason is m_impl is pointing an empty memory block.
I used gdb to examine the value of m_impl, and I found that it likely
address of a Node created when this page was loaded the first time.
My question is: how do JavaSciptCore maintain the JSNode(s) to make them
the old Nodes? And how can I force JSNode's m_impl reference the new Node?
Do I make myself clear?
Appreciate any clues!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev