Index: src/debug.h |
diff --git a/src/debug.h b/src/debug.h |
index 7bb4a428f2c9b08af13f84170b6fb6a32b820ae8..0a0f87515361d2129f6bbbf1e8251a07d91e7f09 100644 |
--- a/src/debug.h |
+++ b/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 |
@@ -940,6 +962,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 +978,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: |