Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: src/execution.cc

Issue 174056: Add support for forceful termination of JavaScript execution. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.h ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
===================================================================
--- src/execution.cc (revision 2717)
+++ src/execution.cc (working copy)
@@ -156,7 +156,8 @@
ASSERT(catcher.HasCaught());
ASSERT(Top::has_pending_exception());
ASSERT(Top::external_caught_exception());
- Top::optional_reschedule_exception(true);
+ bool is_bottom_call = HandleScopeImplementer::instance()->CallDepthIsZero();
+ Top::OptionalRescheduleException(is_bottom_call, true);
result = v8::Utils::OpenHandle(*catcher.Exception());
}
@@ -328,6 +329,19 @@
}
+bool StackGuard::IsTerminateExecution() {
+ ExecutionAccess access;
+ return thread_local_.interrupt_flags_ & TERMINATE;
+}
+
+
+void StackGuard::TerminateExecution() {
+ ExecutionAccess access;
+ thread_local_.interrupt_flags_ |= TERMINATE;
+ set_limits(kInterruptLimit, access);
+}
+
+
#ifdef ENABLE_DEBUGGER_SUPPORT
bool StackGuard::IsDebugBreak() {
ExecutionAccess access;
@@ -638,6 +652,10 @@
}
#endif
if (StackGuard::IsPreempted()) RuntimePreempt();
+ if (StackGuard::IsTerminateExecution()) {
+ StackGuard::Continue(TERMINATE);
+ return Top::TerminateExecution();
+ }
if (StackGuard::IsInterrupted()) {
// interrupt
StackGuard::Continue(INTERRUPT);
« no previous file with comments | « src/execution.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698