Hi Gabor,

Den 11. okt. 2011 15:16, skrev ext [email protected]:
> Hi Kent,
>
> Just a quick status report about your question regarding MakeWeak:
>
>> For the MakeWeak approach, it would also be interesting to know why
>> those objects aren't collected early by the scavenger, causing the heap
>> to grow so much.
> V8 stores the Persistent handles in a separate place (global handles).
> There is a function in global-handles.cc (PostGarbageCollectionProcessing)
> which calls the weak callback functions and destroys the weak
> Persistent handles.
>
> This function is called by Heap::PerformGarbageCollection (in heap.cc) but
> only if the garbage collector is MARK_COMPACTOR. I tried to skip this
> condition
> and run my tests again but it didn't work. In their low-level representation
> the Persistent handles have some kind of state. The whole global handles space
> must be searched for weak handles and their states must be changed to PENDING
> before they can be destroyed. The functions doing this are in
> global-handles.cc
> (GlobalHandles::IterateWeakRoots and GlobalHandles::IdentifyWeakHandles) but
> they called from mark-compact.cc (MarkCompactCollector::MarkLiveObjects).
>
> The bottom line is that if you use the MakeWeak approach the WeakCallback
> function won't be called during Scavenge.
>
> I will try to modify the Scavenger so that it can call these functions and
> do another benchmark to measure the performance cost of it.

Thanks for the update.
It's probably a good idea to create a report for this in the v8 tracker 
(providing something like the above description) before delving too deep 
into it, just to make sure it's something the v8 devs agree can be changed.

Regards,
Kent

_______________________________________________
Qt-script mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-script

Reply via email to