diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-02-03 09:06:03 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-02-03 09:07:02 -0800 |
commit | c7cb4daa25966e4f9af3c6d5499d762736454da9 (patch) | |
tree | 27c6541f5a1207eb74797ed63a43126c9bf2ba81 /deps/v8/src/debug.h | |
parent | c723acc72192334a62bea6ff4baa33aab0da50ad (diff) | |
download | node-c7cb4daa25966e4f9af3c6d5499d762736454da9.tar.gz |
Upgrade V8 to 2.1.0
Diffstat (limited to 'deps/v8/src/debug.h')
-rw-r--r-- | deps/v8/src/debug.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/deps/v8/src/debug.h b/deps/v8/src/debug.h index c37e08b38..cab9e8e44 100644 --- a/deps/v8/src/debug.h +++ b/deps/v8/src/debug.h @@ -132,7 +132,6 @@ class BreakLocationIterator { int position_; int statement_position_; Handle<DebugInfo> debug_info_; - Handle<Code> debug_break_stub_; RelocIterator* reloc_iterator_; RelocIterator* reloc_iterator_original_; @@ -391,7 +390,6 @@ class Debug { static void ClearStepOut(); static void ClearStepNext(); // Returns whether the compile succeeded. - static bool EnsureCompiled(Handle<SharedFunctionInfo> shared); static void RemoveDebugInfo(Handle<DebugInfo> debug_info); static void SetAfterBreakTarget(JavaScriptFrame* frame); static Handle<Object> CheckBreakPoints(Handle<Object> break_point); @@ -559,6 +557,9 @@ class CommandMessageQueue BASE_EMBEDDED { }; +class MessageDispatchHelperThread; + + // LockingCommandMessageQueue is a thread-safe circular buffer of CommandMessage // messages. The message data is not managed by LockingCommandMessageQueue. // Pointers to the data are passed in and out. Implemented by adding a @@ -619,7 +620,8 @@ class Debugger { static void SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler, int period); static void SetDebugMessageDispatchHandler( - v8::Debug::DebugMessageDispatchHandler handler); + v8::Debug::DebugMessageDispatchHandler handler, + bool provide_locker); // Invoke the message handler function. static void InvokeMessageHandler(MessageImpl message); @@ -645,6 +647,8 @@ class Debugger { // Blocks until the agent has started listening for connections static void WaitForAgent(); + static void CallMessageDispatchHandler(); + // Unload the debugger if possible. Only called when no debugger is currently // active. static void UnloadDebugger(); @@ -654,7 +658,9 @@ class Debugger { // Check whether the message handler was been cleared. if (debugger_unload_pending_) { - UnloadDebugger(); + if (Debug::debugger_entry() == NULL) { + UnloadDebugger(); + } } // Currently argument event is not used. @@ -681,7 +687,9 @@ class Debugger { static v8::Debug::MessageHandler2 message_handler_; static bool debugger_unload_pending_; // Was message handler cleared? static v8::Debug::HostDispatchHandler host_dispatch_handler_; + static Mutex* dispatch_handler_access_; // Mutex guarding dispatch handler. static v8::Debug::DebugMessageDispatchHandler debug_message_dispatch_handler_; + static MessageDispatchHelperThread* message_dispatch_helper_thread_; static int host_dispatch_micros_; static DebuggerAgent* agent_; @@ -858,6 +866,27 @@ class Debug_Address { int reg_; }; +// The optional thread that Debug Agent may use to temporary call V8 to process +// pending debug requests if debuggee is not running V8 at the moment. +// Techincally it does not call V8 itself, rather it asks embedding program +// to do this via v8::Debug::HostDispatchHandler +class MessageDispatchHelperThread: public Thread { + public: + MessageDispatchHelperThread(); + ~MessageDispatchHelperThread(); + + void Schedule(); + + private: + void Run(); + + Semaphore* const sem_; + Mutex* const mutex_; + bool already_signalled_; + + DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); +}; + } } // namespace v8::internal |