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

Unified Diff: src/top.h

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/objects-inl.h ('k') | src/top.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/top.h
===================================================================
--- src/top.h (revision 2717)
+++ src/top.h (working copy)
@@ -46,6 +46,7 @@
// The context where the current execution method is created and for variable
// lookups.
Context* context_;
+ int thread_id_;
Object* pending_exception_;
bool has_pending_message_;
const char* pending_message_;
@@ -118,6 +119,10 @@
thread_local_.save_context_ = save;
}
+ // Access to current thread id.
+ static int thread_id() { return thread_local_.thread_id_; }
+ static void set_thread_id(int id) { thread_local_.thread_id_ = id; }
+
// Interface to pending exception.
static Object* pending_exception() {
ASSERT(has_pending_exception());
@@ -152,7 +157,8 @@
// exceptions. If an exception was thrown and not handled by an external
// handler the exception is scheduled to be rethrown when we return to running
// JavaScript code. If an exception is scheduled true is returned.
- static bool optional_reschedule_exception(bool is_bottom_call);
+ static bool OptionalRescheduleException(bool is_bottom_call,
+ bool force_clear_catchable);
static bool* external_caught_exception_address() {
return &thread_local_.external_caught_exception_;
@@ -246,7 +252,8 @@
static void DoThrow(Object* exception,
MessageLocation* location,
const char* message);
- static bool ShouldReportException(bool* is_caught_externally);
+ static bool ShouldReturnException(bool* is_caught_externally,
+ bool catchable_by_javascript);
static void ReportUncaughtException(Handle<Object> exception,
MessageLocation* location,
Handle<String> stack_trace);
@@ -260,6 +267,7 @@
// Out of resource exception helpers.
static Failure* StackOverflow();
+ static Failure* TerminateExecution();
// Administration
static void Initialize();
« no previous file with comments | « src/objects-inl.h ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698