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.

Best regards,
Gabor



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

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

Reply via email to