diff options
Diffstat (limited to 'deps/v8/src/debug.h')
-rw-r--r-- | deps/v8/src/debug.h | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/deps/v8/src/debug.h b/deps/v8/src/debug.h index 7bb4a428f2..b6aba5aad1 100644 --- a/deps/v8/src/debug.h +++ b/deps/v8/src/debug.h @@ -332,6 +332,7 @@ class Debug { k_after_break_target_address, k_debug_break_return_address, k_debug_break_slot_address, + k_restarter_frame_function_pointer, k_register_address }; @@ -339,6 +340,10 @@ class Debug { static Address* after_break_target_address() { return reinterpret_cast<Address*>(&thread_local_.after_break_target_); } + static Address* restarter_frame_function_pointer_address() { + Object*** address = &thread_local_.restarter_frame_function_pointer_; + return reinterpret_cast<Address*>(address); + } // Support for saving/restoring registers when handling debug break calls. static Object** register_address(int r) { @@ -415,10 +420,22 @@ class Debug { }; static void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, - FrameDropMode mode); + FrameDropMode mode, + Object** restarter_frame_function_pointer); + + // Initializes an artificial stack frame. The data it contains is used for: + // a. successful work of frame dropper code which eventually gets control, + // b. being compatible with regular stack structure for various stack + // iterators. + // Returns address of stack allocated pointer to restarted function, + // the value that is called 'restarter_frame_function_pointer'. The value + // at this address (possibly updated by GC) may be used later when preparing + // 'step in' operation. + // The implementation is architecture-specific. + // TODO(LiveEdit): consider reviewing it as architecture-independent. + static Object** SetUpFrameDropperFrame(StackFrame* bottom_js_frame, + Handle<Code> code); - static void SetUpFrameDropperFrame(StackFrame* bottom_js_frame, - Handle<Code> code); static const int kFrameDropperFrameSize; private: @@ -495,6 +512,11 @@ class Debug { // Pending interrupts scheduled while debugging. int pending_interrupts_; + + // When restarter frame is on stack, stores the address + // of the pointer to function being restarted. Otherwise (most of the time) + // stores NULL. This pointer is used with 'step in' implementation. + Object** restarter_frame_function_pointer_; }; // Storage location for registers when handling debug break calls @@ -906,8 +928,6 @@ class EnterDebugger BASE_EMBEDDED { // Stack allocated class for disabling break. class DisableBreak BASE_EMBEDDED { public: - // Enter the debugger by storing the previous top context and setting the - // current top context to the debugger context. explicit DisableBreak(bool disable_break) { prev_disable_break_ = Debug::disable_break(); Debug::set_disable_break(disable_break); @@ -940,6 +960,10 @@ class Debug_Address { return Debug_Address(Debug::k_debug_break_return_address); } + static Debug_Address RestarterFrameFunctionPointer() { + return Debug_Address(Debug::k_restarter_frame_function_pointer); + } + static Debug_Address Register(int reg) { return Debug_Address(Debug::k_register_address, reg); } @@ -952,6 +976,9 @@ class Debug_Address { return reinterpret_cast<Address>(Debug::debug_break_return_address()); case Debug::k_debug_break_slot_address: return reinterpret_cast<Address>(Debug::debug_break_slot_address()); + case Debug::k_restarter_frame_function_pointer: + return reinterpret_cast<Address>( + Debug::restarter_frame_function_pointer_address()); case Debug::k_register_address: return reinterpret_cast<Address>(Debug::register_address(reg_)); default: |