[webkit-dev] New marking model for GC collected objects
ggaren at apple.com
Tue Sep 1 11:32:24 PDT 2009
JSWrapperObject::markChildren is responsible for marking the
internalValue of a DateInstance. Is that function not being called?
On Sep 1, 2009, at 6:16 AM, Zoltan Herczeg wrote:
> Hi Oliver,
> it seems on ARM using WTF_USE_JSVALUE32, the internal value of a date
> object is sometimes freed by the garbage collector.
> More specifically:
> The double (millisecond) representation of a date object (returned
> by a
> "new Date" expression) is stored in JSWrapperObject:
> m_internalValue. This
> m_internalValue points to a JSNumberCell, which stores the double
> Although this JSNumberCell is referenced by m_internalValue, the GC
> collects its memory space.
> How can I fix this bug with the new mark() model?
>> Last night I landed a patch that replaces the old recursive marking
>> functions with a new iterative model that uses an explicit mark
>> stack. This means that any custom mark methods that you need to
>> now need to be slightly different from what they were previously,
>> attempt to summarise here.
>> The most obvious change is that an object is no longer responsible
>> marking itself instead the recursive mark methods have been replaced
>> by a new virtual markChildren(MarkStack&) which is responsible for
>> appending an objects children to the stack.
>> The MarkStack is a very simple class, and the only method you really
>> need to know about is MarkStack::append which adds a new object to
>> The changes to how your custom marking functions are implemented are
>> trivial, but here's a simple example
>> void MyAwesomeObject::mark()
>> if (!m_child.marked())
>> void MyAwesomeObject::markChildren(MarkStack& markStack)
>> And that's it, you're done.
>> It's important to note that you will never be in a position where you
>> call markChildren yourself, if you are that is an error.
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev