Index: src/debug/debug-frames.cc |
diff --git a/src/debug/debug-frames.cc b/src/debug/debug-frames.cc |
index f01354500b0e5ce1670a45e8e7afe6087158f99f..25634be8d233178429cfd8cf0fe3ae739cf96f0c 100644 |
--- a/src/debug/debug-frames.cc |
+++ b/src/debug/debug-frames.cc |
@@ -15,6 +15,7 @@ FrameInspector::FrameInspector(JavaScriptFrame* frame, |
has_adapted_arguments_ = frame_->has_adapted_arguments(); |
is_bottommost_ = inlined_jsframe_index == 0; |
is_optimized_ = frame_->is_optimized(); |
+ is_interpreted_ = frame_->is_interpreted(); |
// Calculate the deoptimized frame. |
if (frame->is_optimized()) { |
// TODO(turbofan): Revisit once we support deoptimization. |
@@ -69,6 +70,11 @@ Handle<Object> FrameInspector::GetExpression(int index) { |
int FrameInspector::GetSourcePosition() { |
if (is_optimized_) { |
return deoptimized_frame_->GetSourcePosition(); |
+ } else if (is_interpreted_) { |
+ InterpretedFrame* frame = reinterpret_cast<InterpretedFrame*>(frame_); |
+ BytecodeArray* bytecode_array = |
+ frame->function()->shared()->bytecode_array(); |
+ return bytecode_array->SourcePosition(frame->GetBytecodeOffset()); |
} else { |
Code* code = frame_->LookupCode(); |
int offset = static_cast<int>(frame_->pc() - code->instruction_start()); |
@@ -95,6 +101,7 @@ void FrameInspector::SetArgumentsFrame(JavaScriptFrame* frame) { |
DCHECK(has_adapted_arguments_); |
frame_ = frame; |
is_optimized_ = frame_->is_optimized(); |
+ is_interpreted_ = frame_->is_interpreted(); |
DCHECK(!is_optimized_); |
} |