As an embedder, shouldn't it be easy to simply start timing when you call into V8?
On Sun, Oct 18, 2015 at 2:07 PM <[email protected]> wrote: > Hi, I originally asked this in v8-users, but it looks like more dev > question for me. > > I'm embedding v8 and have to limit max time that arbitrary script > execution may take. > > As to script running complete event, it is more or less clear - > v8::Isolate:: > AddCallCompletedCallback() will do the job, but as to catching start I'm > stuck a bit. There is v8::Isolate::SetEventLogger() which also may do the > job, callback receives event name and start/end flag, so I can strcmp() > event name (the target one is V8.Execute) and track it in this way, but > maybe there are nicer solution, like > v8::Isolate::AddCallCompletedCallback() but for start, not complete? > > Without hook, one have track any possible execution points, (not only > v8::ScriptRun() but also v8::Value::ToString, v8::Function::Call and so > on), which may lead to some missed execution point. > > Under the hood PREPARE_FOR_EXECUTION_GENERIC macros creates > v8::CallDepthScope() which calling callbacks attached with v8::Isolate:: > AddCallCompletedCallback() in it destructor. Is it appropriate way to add > something v8::Isolate:: > AddCallStartsCallback() or something like that (suggest naming, if > anything)? > > -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
