Handle<Value> data = Handle<Value>());
// Schedule a debugger break to happen when JavaScript code is run
- // in the given isolate. If no isolate is provided the default
- // isolate is used.
- static void DebugBreak(Isolate* isolate = NULL);
+ // in the given isolate.
+ static void DebugBreak(Isolate* isolate);
// Remove scheduled debugger break in given isolate if it has not
- // happened yet. If no isolate is provided the default isolate is
- // used.
- static void CancelDebugBreak(Isolate* isolate = NULL);
+ // happened yet.
+ static void CancelDebugBreak(Isolate* isolate);
// Break execution of JavaScript in the given isolate (this method
// can be invoked from a non-VM thread) for further client command
// execution on a VM thread. Client data is then passed in
// EventDetails to EventCallback2 at the moment when the VM actually
- // stops. If no isolate is provided the default isolate is used.
- static void DebugBreakForCommand(ClientData* data = NULL,
- Isolate* isolate = NULL);
+ // stops.
+ static void DebugBreakForCommand(Isolate* isolate, ClientData* data);
+
+ // TODO(svenpanne) Remove this when Chrome is updated.
+ static void DebugBreakForCommand(ClientData* data, Isolate* isolate) {
+ DebugBreakForCommand(isolate, data);
+ }
// Message based interface. The message protocol is JSON.
static void SetMessageHandler2(MessageHandler2 handler);
- // If no isolate is provided the default isolate is
- // used.
- // TODO(dcarney): remove
- static void SendCommand(const uint16_t* command, int length,
- ClientData* client_data = NULL,
- Isolate* isolate = NULL);
static void SendCommand(Isolate* isolate,
const uint16_t* command, int length,
ClientData* client_data = NULL);
* (default Isolate if not provided). V8 will abort if LiveEdit is
* unexpectedly used. LiveEdit is enabled by default.
*/
- static void SetLiveEditEnabled(bool enable, Isolate* isolate = NULL);
+ static void SetLiveEditEnabled(Isolate* isolate, bool enable);
+
+ // TODO(svenpanne) Remove this when Chrome is updated.
+ static void SetLiveEditEnabled(bool enable, Isolate* isolate) {
+ SetLiveEditEnabled(isolate, enable);
+ }
};
/**
* Forcefully terminate the current thread of JavaScript execution
- * in the given isolate. If no isolate is provided, the default
- * isolate is used.
+ * in the given isolate.
*
* This method can be used by any thread even if that thread has not
* acquired the V8 lock with a Locker object.
*
* \param isolate The isolate in which to terminate the current JS execution.
*/
- static void TerminateExecution(Isolate* isolate = NULL);
+ static void TerminateExecution(Isolate* isolate);
/**
* Is V8 terminating JavaScript execution.
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();
- }
+ reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution();
}
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();
- }
+ reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->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);
- }
+ i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_isolate->stack_guard()->Continue(i::DEBUGBREAK);
}
-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);
- }
+void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) {
+ i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_isolate->debugger()->EnqueueDebugCommand(data);
}
}
-void Debug::SendCommand(const uint16_t* command, int length,
- ClientData* client_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()->ProcessCommand(
- i::Vector<const uint16_t>(command, length), client_data);
- } else {
- i::Isolate::GetDefaultIsolateDebugger()->ProcessCommand(
- i::Vector<const uint16_t>(command, length), client_data);
- }
-}
-
-
void Debug::SetHostDispatchHandler(HostDispatchHandler handler,
int period) {
i::Isolate* isolate = i::Isolate::Current();
}
-void Debug::SetLiveEditEnabled(bool enable, Isolate* isolate) {
- // If no isolate is supplied, use the default isolate.
- i::Debugger* debugger;
- if (isolate != NULL) {
- i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
- debugger = internal_isolate->debugger();
- } else {
- debugger = i::Isolate::GetDefaultIsolateDebugger();
- }
- debugger->set_live_edit_enabled(enable);
+void Debug::SetLiveEditEnabled(Isolate* isolate, bool enable) {
+ i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_isolate->debugger()->set_live_edit_enabled(enable);
}
decoder.WriteUtf16(temp.start(), utf16_length);
// Send the request received to the debugger.
- v8::Debug::SendCommand(temp.start(),
+ v8::Debug::SendCommand(reinterpret_cast<v8::Isolate*>(agent_->isolate()),
+ temp.start(),
utf16_length,
- NULL,
- reinterpret_cast<v8::Isolate*>(agent_->isolate()));
+ NULL);
if (is_closing_session) {
// Session is closed.
// Once become suspended, V8 will stay so indefinitely long, until remote
// debugger connects and issues "continue" command.
Debugger::message_handler_ = StubMessageHandler2;
- v8::Debug::DebugBreak();
+ v8::Debug::DebugBreak(reinterpret_cast<v8::Isolate*>(isolate_));
}
if (agent_ == NULL) {
}
} static_initializer;
-#ifdef ENABLE_DEBUGGER_SUPPORT
-Debugger* Isolate::GetDefaultIsolateDebugger() {
- EnsureDefaultIsolate();
- return default_isolate_->debugger();
-}
-#endif
-
-
-StackGuard* Isolate::GetDefaultIsolateStackGuard() {
- EnsureDefaultIsolate();
- return default_isolate_->stack_guard();
-}
-
void Isolate::EnterDefaultIsolate() {
EnsureDefaultIsolate();
}
-v8::Isolate* Isolate::GetDefaultIsolateForLocking() {
- EnsureDefaultIsolate();
- return reinterpret_cast<v8::Isolate*>(default_isolate_);
-}
-
-
Address Isolate::get_address_from_id(Isolate::AddressId id) {
return isolate_addresses_[id];
}
// If one does not yet exist, return null.
PerIsolateThreadData* FindPerThreadDataForThread(ThreadId thread_id);
-#ifdef ENABLE_DEBUGGER_SUPPORT
- // Get the debugger from the default isolate. Preinitializes the
- // default isolate if needed.
- static Debugger* GetDefaultIsolateDebugger();
-#endif
-
- // Get the stack guard from the default isolate. Preinitializes the
- // default isolate if needed.
- static StackGuard* GetDefaultIsolateStackGuard();
-
// Returns the key used to store the pointer to the current isolate.
// Used internally for V8 threads that do not execute JavaScript but still
// are part of the domain of an isolate (like the context switcher).
return sweeper_thread_;
}
- // PreInits and returns a default isolate. Needed when a new thread tries
- // to create a Locker for the first time (the lock itself is in the isolate).
- // TODO(svenpanne) This method is on death row...
- static v8::Isolate* GetDefaultIsolateForLocking();
-
int id() const { return static_cast<int>(id_); }
HStatistics* GetHStatistics();