Index: src/debug/debug.cc |
diff --git a/src/debug/debug.cc b/src/debug/debug.cc |
index 3a6e0ac0de86cc3ae4d9929eb8323da7bc9aa495..2efbd87c6ae9761cd8c43c7e1493bf3a40af5441 100644 |
--- a/src/debug/debug.cc |
+++ b/src/debug/debug.cc |
@@ -16,6 +16,7 @@ |
#include "src/frames-inl.h" |
#include "src/full-codegen/full-codegen.h" |
#include "src/global-handles.h" |
+#include "src/interpreter/bytecodes.h" |
#include "src/interpreter/interpreter.h" |
#include "src/isolate-inl.h" |
#include "src/list.h" |
@@ -473,7 +474,6 @@ |
thread_local_.last_fp_ = 0; |
thread_local_.target_fp_ = 0; |
thread_local_.step_in_enabled_ = false; |
- thread_local_.return_value_ = Handle<Object>(); |
// TODO(isolates): frames_are_dropped_? |
base::NoBarrier_Store(&thread_local_.current_debug_scope_, |
static_cast<base::AtomicWord>(0)); |
@@ -560,8 +560,10 @@ |
debug_context_ = Handle<Context>(); |
} |
-void Debug::Break(JavaScriptFrame* frame) { |
+ |
+void Debug::Break(Arguments args, JavaScriptFrame* frame) { |
HandleScope scope(isolate_); |
+ DCHECK(args.length() == 0); |
// Initialize LiveEdit. |
LiveEdit::InitializeThreadLocal(this); |
@@ -1567,11 +1569,25 @@ |
UNREACHABLE(); |
} |
-void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { |
- after_break_target_ = NULL; |
- if (!LiveEdit::SetAfterBreakTarget(this)) { |
- // Continue just after the slot. |
- after_break_target_ = frame->pc(); |
+Object* Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { |
+ if (frame->is_interpreted()) { |
+ // Find the handler from the original bytecode array. |
+ InterpretedFrame* interpreted_frame = |
+ reinterpret_cast<InterpretedFrame*>(frame); |
+ SharedFunctionInfo* shared = interpreted_frame->function()->shared(); |
+ BytecodeArray* bytecode_array = shared->bytecode_array(); |
+ int bytecode_offset = interpreted_frame->GetBytecodeOffset(); |
+ interpreter::Bytecode bytecode = |
+ interpreter::Bytecodes::FromByte(bytecode_array->get(bytecode_offset)); |
+ return isolate_->interpreter()->GetBytecodeHandler( |
+ bytecode, interpreter::OperandScale::kSingle); |
+ } else { |
+ after_break_target_ = NULL; |
+ if (!LiveEdit::SetAfterBreakTarget(this)) { |
+ // Continue just after the slot. |
+ after_break_target_ = frame->pc(); |
+ } |
+ return isolate_->heap()->undefined_value(); |
} |
} |
@@ -2312,10 +2328,9 @@ |
base::NoBarrier_Store(&debug_->thread_local_.current_debug_scope_, |
reinterpret_cast<base::AtomicWord>(this)); |
- // Store the previous break id, frame id and return value. |
+ // Store the previous break id and frame id. |
break_id_ = debug_->break_id(); |
break_frame_id_ = debug_->break_frame_id(); |
- return_value_ = debug_->return_value(); |
// Create the new break info. If there is no JavaScript frames there is no |
// break frame id. |
@@ -2353,7 +2368,6 @@ |
// Restore to the previous break state. |
debug_->thread_local_.break_frame_id_ = break_frame_id_; |
debug_->thread_local_.break_id_ = break_id_; |
- debug_->thread_local_.return_value_ = return_value_; |
debug_->UpdateState(); |
} |