Index: src/debug.cc |
diff --git a/src/debug.cc b/src/debug.cc |
index 4dce4cff053ff630fba8a2f9db2962fbe55e6608..bac05a06c4446aefbbc3a915a499e77fc7fc3d2b 100644 |
--- a/src/debug.cc |
+++ b/src/debug.cc |
@@ -814,6 +814,8 @@ Object* Debug::Break(Arguments args) { |
HandleScope scope; |
ASSERT(args.length() == 0); |
+ thread_local_.frames_are_dropped_ = false; |
+ |
// Get the top-most JavaScript frame. |
JavaScriptFrameIterator it; |
JavaScriptFrame* frame = it.frame(); |
@@ -890,8 +892,13 @@ Object* Debug::Break(Arguments args) { |
PrepareStep(step_action, step_count); |
} |
- // Install jump to the call address which was overwritten. |
- SetAfterBreakTarget(frame); |
+ if (thread_local_.frames_are_dropped_) { |
+ // We must have been calling IC stub. Do not return there anymore. |
+ Code* plain_return = Builtins::builtin(Builtins::PlainReturn_LiveEdit); |
+ thread_local_.after_break_target_ = plain_return->entry(); |
+ } else { |
+ SetAfterBreakTarget(frame); |
+ } |
return Heap::undefined_value(); |
} |
@@ -1655,6 +1662,12 @@ void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { |
} |
+void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id) { |
+ thread_local_.frames_are_dropped_ = true; |
+ thread_local_.break_frame_id_ = new_break_frame_id; |
+} |
+ |
+ |
bool Debug::IsDebugGlobal(GlobalObject* global) { |
return IsLoaded() && global == Debug::debug_context()->global(); |
} |