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

Unified Diff: src/api.cc

Issue 6672044: [Isolates] Fix debugger and termination APIs callable from other threads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: Address comments. Created 9 years, 9 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 | « include/v8-debug.h ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3f7a345b0ab0fc7b0ac1cb5d7d3b8c44798fa6f7..5dc78befa4e841fbd5db7b017d3292d2a8f8df5d 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4291,9 +4291,13 @@ void V8::TerminateExecution(int thread_id) {
}
-void V8::TerminateExecution() {
- if (!i::Isolate::Current()->IsInitialized()) return;
- i::Isolate::Current()->stack_guard()->TerminateExecution();
+void V8::TerminateExecution(Isolate* isolate) {
+ // If no isolate is supplied, use the default isolate.
+ if (isolate != NULL) {
+ reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution();
+ } else {
+ i::Isolate::GetDefaultIsolateStackGuard()->TerminateExecution();
+ }
}
@@ -4558,20 +4562,35 @@ bool Debug::SetDebugEventListener(v8::Handle<v8::Object> that,
}
-void Debug::DebugBreak() {
- if (!i::Isolate::Current()->IsInitialized()) return;
- i::Isolate::Current()->stack_guard()->DebugBreak();
+void Debug::DebugBreak(Isolate* isolate) {
+ // If no isolate is supplied, use the default isolate.
+ if (isolate != NULL) {
+ reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak();
+ } else {
+ i::Isolate::GetDefaultIsolateStackGuard()->DebugBreak();
+ }
}
-void Debug::CancelDebugBreak() {
- i::Isolate::Current()->stack_guard()->Continue(i::DEBUGBREAK);
+void Debug::CancelDebugBreak(Isolate* isolate) {
+ // If no isolate is supplied, use the default isolate.
+ if (isolate != NULL) {
+ i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_isolate->stack_guard()->Continue(i::DEBUGBREAK);
+ } else {
+ i::Isolate::GetDefaultIsolateStackGuard()->Continue(i::DEBUGBREAK);
+ }
}
-void Debug::DebugBreakForCommand(ClientData* data) {
- if (!i::Isolate::Current()->IsInitialized()) return;
- i::Isolate::Current()->debugger()->EnqueueDebugCommand(data);
+void Debug::DebugBreakForCommand(ClientData* data, Isolate* isolate) {
+ // If no isolate is supplied, use the default isolate.
+ if (isolate != NULL) {
+ i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_isolate->debugger()->EnqueueDebugCommand(data);
+ } else {
+ i::Isolate::GetDefaultIsolateDebugger()->EnqueueDebugCommand(data);
+ }
}
« no previous file with comments | « include/v8-debug.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698