diff options
Diffstat (limited to 'deps/v8/src/debug.h')
-rw-r--r-- | deps/v8/src/debug.h | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/deps/v8/src/debug.h b/deps/v8/src/debug.h index 67debc7543..2b5f43ab49 100644 --- a/deps/v8/src/debug.h +++ b/deps/v8/src/debug.h @@ -174,7 +174,8 @@ class BreakLocationIterator { // the cache is the script id. class ScriptCache : private HashMap { public: - ScriptCache() : HashMap(ScriptMatch), collected_scripts_(10) {} + explicit ScriptCache(Isolate* isolate) + : HashMap(ScriptMatch), isolate_(isolate), collected_scripts_(10) {} virtual ~ScriptCache() { Clear(); } // Add script to the cache. @@ -203,6 +204,7 @@ class ScriptCache : private HashMap { v8::Persistent<v8::Value>* obj, void* data); + Isolate* isolate_; // List used during GC to temporarily store id's of collected scripts. List<int> collected_scripts_; }; @@ -259,7 +261,9 @@ class Debug { void FloodHandlerWithOneShot(); void ChangeBreakOnException(ExceptionBreakType type, bool enable); bool IsBreakOnException(ExceptionBreakType type); - void PrepareStep(StepAction step_action, int step_count); + void PrepareStep(StepAction step_action, + int step_count, + StackFrame::Id frame_id); void ClearStepping(); void ClearStepOut(); bool IsStepping() { return thread_local_.step_count_ > 0; } @@ -532,7 +536,7 @@ class Debug { explicit Debug(Isolate* isolate); ~Debug(); - static bool CompileDebuggerScript(int index); + static bool CompileDebuggerScript(Isolate* isolate, int index); void ClearOneShot(); void ActivateStepIn(StackFrame* frame); void ClearStepIn(); @@ -664,6 +668,7 @@ class MessageImpl: public v8::Debug::Message { virtual v8::Handle<v8::String> GetJSON() const; virtual v8::Handle<v8::Context> GetEventContext() const; virtual v8::Debug::ClientData* GetClientData() const; + virtual v8::Isolate* GetIsolate() const; private: MessageImpl(bool is_event, @@ -762,7 +767,6 @@ class MessageDispatchHelperThread; class LockingCommandMessageQueue BASE_EMBEDDED { public: LockingCommandMessageQueue(Logger* logger, int size); - ~LockingCommandMessageQueue(); bool IsEmpty() const; CommandMessage Get(); void Put(const CommandMessage& message); @@ -770,7 +774,7 @@ class LockingCommandMessageQueue BASE_EMBEDDED { private: Logger* logger_; CommandMessageQueue queue_; - Mutex* lock_; + mutable Mutex mutex_; DISALLOW_COPY_AND_ASSIGN(LockingCommandMessageQueue); }; @@ -821,7 +825,7 @@ class Debugger { void SetEventListener(Handle<Object> callback, Handle<Object> data); void SetMessageHandler(v8::Debug::MessageHandler2 handler); void SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler, - int period); + TimeDelta period); void SetDebugMessageDispatchHandler( v8::Debug::DebugMessageDispatchHandler handler, bool provide_locker); @@ -863,7 +867,7 @@ class Debugger { friend void ForceUnloadDebugger(); // In test-debug.cc inline bool EventActive(v8::DebugEvent event) { - ScopedLock with(debugger_access_); + LockGuard<RecursiveMutex> lock_guard(debugger_access_); // Check whether the message handler was been cleared. if (debugger_unload_pending_) { @@ -918,7 +922,7 @@ class Debugger { Handle<Object> event_data); void ListenersChanged(); - Mutex* debugger_access_; // Mutex guarding debugger variables. + RecursiveMutex* debugger_access_; // Mutex guarding debugger variables. Handle<Object> event_listener_; // Global handle to listener. Handle<Object> event_listener_data_; bool compiling_natives_; // Are we compiling natives? @@ -929,16 +933,16 @@ class Debugger { v8::Debug::MessageHandler2 message_handler_; bool debugger_unload_pending_; // Was message handler cleared? v8::Debug::HostDispatchHandler host_dispatch_handler_; - Mutex* dispatch_handler_access_; // Mutex guarding dispatch handler. + Mutex dispatch_handler_access_; // Mutex guarding dispatch handler. v8::Debug::DebugMessageDispatchHandler debug_message_dispatch_handler_; MessageDispatchHelperThread* message_dispatch_helper_thread_; - int host_dispatch_micros_; + TimeDelta host_dispatch_period_; DebuggerAgent* agent_; static const int kQueueInitialSize = 4; LockingCommandMessageQueue command_queue_; - Semaphore* command_received_; // Signaled for each command received. + Semaphore command_received_; // Signaled for each command received. LockingCommandMessageQueue event_command_queue_; Isolate* isolate_; @@ -956,7 +960,7 @@ class Debugger { // some reason could not be entered FailedToEnter will return true. class EnterDebugger BASE_EMBEDDED { public: - EnterDebugger(); + explicit EnterDebugger(Isolate* isolate); ~EnterDebugger(); // Check whether the debugger could be entered. @@ -983,12 +987,12 @@ class EnterDebugger BASE_EMBEDDED { // Stack allocated class for disabling break. class DisableBreak BASE_EMBEDDED { public: - explicit DisableBreak(bool disable_break) : isolate_(Isolate::Current()) { + explicit DisableBreak(Isolate* isolate, bool disable_break) + : isolate_(isolate) { prev_disable_break_ = isolate_->debug()->disable_break(); isolate_->debug()->set_disable_break(disable_break); } ~DisableBreak() { - ASSERT(Isolate::Current() == isolate_); isolate_->debug()->set_disable_break(prev_disable_break_); } @@ -1047,7 +1051,7 @@ class Debug_Address { class MessageDispatchHelperThread: public Thread { public: explicit MessageDispatchHelperThread(Isolate* isolate); - ~MessageDispatchHelperThread(); + ~MessageDispatchHelperThread() {} void Schedule(); @@ -1055,8 +1059,8 @@ class MessageDispatchHelperThread: public Thread { void Run(); Isolate* isolate_; - Semaphore* const sem_; - Mutex* const mutex_; + Semaphore sem_; + Mutex mutex_; bool already_signalled_; DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); |