> > I'm not sure. However, I need to iterate over all pointers. I thought >> > that there > >> are roots and there are pointers inside objects and that is roughly >> > all pointers > >> in the system and these 2 sets do not overlap. >> Do you think it is also worth making into a comment? >> > > As all objects are in the heap the heap iterator will visit all of them. > The strong roots are the set of objects which defines the initial set of > live objects when performing a GC. They include all "basic" objects, > objects reachable from the execution stack, objects reachable from the > various C++ structures used internally, etc. In this case I think you > could just use the HeapIterator. We have been talking about making a > HeapIterator which only visits live objects using the same marking > scheme as used by the GC, but have never taken the time. The > HeapIterator just visits everything. > > The thing is that I need to iterate over all pointers, not over all objects (because I replace one pointer with another). So I think I still have to iterate over all roots. In particular, I think it might be important to visit pointer on stack(s), cause I suspect they may occasionally point to the Code object.
It's good you mentioned how HeapIterator works. I idly guess it traverses pointers like GC does. However, I guess there's nothing bad in replacing pointers in dead objects too. Peter -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
