I'm using V8 for user script execution, and want to abort the script if it uses too much CPU time. My current code uses V8::TerminateExecution(V8::GetCurrentThreadId()) in a SIGPROF handler, and is working fine, I think, except for one problem: After an uncatchable exception, any further calls into V8 trigger a SIGABRT from Raise(). This tallies with the docos for TryCatch::CanContinue():
"Currently, the only type of exception that can be caught by a TryCatch handler and for which it does not make sense to continue is termination exception. Such exceptions are thrown when the TerminateExecution methods are called to terminate a long-running script. If CanContinue returns false, the correct action is to perform any C++ cleanup needed and then return." My question is: How can I tell V8 that it's okay to continue again? Do I need to destroy the execution context altogether and rebuild from scratch? Alternatively, is there a "lesser alternative" to TerminateExecution that is more recoverable? Thanks! Chris Angelico -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
