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

Unified Diff: src/execution.h

Issue 102063004: Introduce API to temporarily interrupt long running JavaScript code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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/api.cc ('k') | src/execution.cc » ('j') | test/cctest/test-api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.h
diff --git a/src/execution.h b/src/execution.h
index eda416c0da5409f82e9dda4bbbb749d24bf0ea01..3e62d8730ab471bc71f9d0ce5dc603be0356854e 100644
--- a/src/execution.h
+++ b/src/execution.h
@@ -43,7 +43,8 @@ enum InterruptFlag {
TERMINATE = 1 << 4,
GC_REQUEST = 1 << 5,
FULL_DEOPT = 1 << 6,
- INSTALL_CODE = 1 << 7
+ INSTALL_CODE = 1 << 7,
+ API_INTERRUPT = 1 << 8
};
@@ -222,6 +223,11 @@ class StackGuard {
void FullDeopt();
void Continue(InterruptFlag after_what);
+ void RequestInterrupt(InterruptCallback callback, void* data);
+ void ClearInterrupt();
+ bool IsAPIInterrupt();
+ void InvokeInterruptCallback();
+
// This provides an asynchronous read of the stack limits for the current
// thread. There are no locks protecting this, but it is assumed that you
// have the global V8 lock if you are using multiple V8 threads.
@@ -307,6 +313,9 @@ class StackGuard {
int nesting_;
int postpone_interrupts_nesting_;
int interrupt_flags_;
+
+ InterruptCallback interrupt_callback_;
+ void* interrupt_callback_data_;
};
// TODO(isolates): Technically this could be calculated directly from a
« no previous file with comments | « src/api.cc ('k') | src/execution.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698