Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1354)

Unified Diff: src/debug.cc

Issue 2844030: LiveEdit: Support debug break slots in frame dropping implementation (Closed)
Patch Set: mistype Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.h ('k') | src/liveedit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index d513b3121cc3b86f7df27d229b248738705c8417..f7c06f06ed0cce9ca172530a4b3b03e7f6328fb5 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -854,7 +854,7 @@ Object* Debug::Break(Arguments args) {
HandleScope scope;
ASSERT(args.length() == 0);
- thread_local_.frames_are_dropped_ = false;
+ thread_local_.frame_drop_mode_ = FRAMES_UNTOUCHED;
// Get the top-most JavaScript frame.
JavaScriptFrameIterator it;
@@ -932,12 +932,22 @@ Object* Debug::Break(Arguments args) {
PrepareStep(step_action, step_count);
}
- if (thread_local_.frames_are_dropped_) {
- // We must have been calling IC stub. Do not return there anymore.
+ if (thread_local_.frame_drop_mode_ == FRAMES_UNTOUCHED) {
+ SetAfterBreakTarget(frame);
+ } else if (thread_local_.frame_drop_mode_ == FRAME_DROPPED_IN_IC_CALL) {
+ // We must have been calling IC stub. Do not go there anymore.
Code* plain_return = Builtins::builtin(Builtins::PlainReturn_LiveEdit);
thread_local_.after_break_target_ = plain_return->entry();
+ } else if (thread_local_.frame_drop_mode_ ==
+ FRAME_DROPPED_IN_DEBUG_SLOT_CALL) {
+ // Debug break slot stub does not return normally, instead it manually
+ // cleans the stack and jumps. We should patch the jump address.
+ Code* plain_return = Builtins::builtin(Builtins::FrameDropper_LiveEdit);
+ thread_local_.after_break_target_ = plain_return->entry();
+ } else if (thread_local_.frame_drop_mode_ == FRAME_DROPPED_IN_DIRECT_CALL) {
+ // Nothing to do, after_break_target is not used here.
} else {
- SetAfterBreakTarget(frame);
+ UNREACHABLE();
}
return Heap::undefined_value();
@@ -1749,8 +1759,9 @@ bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) {
}
-void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id) {
- thread_local_.frames_are_dropped_ = true;
+void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
+ FrameDropMode mode) {
+ thread_local_.frame_drop_mode_ = mode;
thread_local_.break_frame_id_ = new_break_frame_id;
}
« no previous file with comments | « src/debug.h ('k') | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698