I'm building an application on top of v8 that requires some objects to
be checkpointed to some state and then later restored from that
state.

I am having trouble checkpointing closures.  Looking through the code,
I noticed the function JSFunctionIterateBody in the JSFunction class
(in objects.h).  What I was thinking of doing was writing my own
ObjectVisitor that would be passed into each JSFunction's
JSFunctionIterateBody method.  This ObjectVistor would then log all
objects that it encountered.  I have a couple of questions though:

  1)  Would an objectVisitor passed into the JSFunctionIterateBody
function run through all the contexts that are associated with that
JSFunction?
  2)  When writing my objectVisitor, am I wrong in thinking that just
writing the VisitPointers function would give me adequate information
to reconstruct a JSFunction with its closure?  (Right now, I don't see
how I'd be able to tell which object pointers would be associated with
which contexts.)
  3)  Is there another way that I should be doing things?  I've looked
through serialize.h, and think that it would be a bad idea to try to
extend that for my application, and would like to do as much of the
checkpointing and restoration from javascript as possible for
flexibility and speedy development.

Please let me know.  Thanks.
  -Behram

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to