Add methods to allow resuming execution after calling TerminateExecution().
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 21 Mar 2013 10:47:34 +0000 (10:47 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 21 Mar 2013 10:47:34 +0000 (10:47 +0000)
commit53adf3b19c97e88d6db2fe15eab8d5401de6b3c6
tree350889ee77785becdf139b1f62debc4cc46b17a5
parent788de160c5aec67b3025550b103455dce8b210e5
Add methods to allow resuming execution after calling TerminateExecution().

Two new methods are added to allow embedders to determine that execution
should be resumed at a particular point in the stack without being forced
to unwind all JS frames.

* V8::CancelTerminateExecution() -- When execution is terminated via a call
  to V8::TerminateExecution(), this method can be called to clear the
  termination exception so that the engine can continue to be used.

* TryCatch::HasTerminated() -- When a TryCatch has caught a termination
  exception, HasTerminated() will return true to indicate it is valid to
  call V8::ResumeExecution() if desired.

A test case is added to cctest/test-thread-termination.cc.

BUG=v8:2361

Patch from Andrew Paprocki <andrew@ishiboo.com>.

Review URL: https://chromiumcodereview.appspot.com/11142013
Patch from Andrew Paprocki <andrew@ishiboo.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14022 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
AUTHORS
include/v8.h
src/api.cc
src/execution.cc
src/execution.h
src/isolate.cc
src/isolate.h
test/cctest/test-thread-termination.cc