OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/debug/debug-frames.h" | 5 #include "src/debug/debug-frames.h" |
6 | 6 |
7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 return is_optimized_ ? deoptimized_frame_->GetExpression(index) | 65 return is_optimized_ ? deoptimized_frame_->GetExpression(index) |
66 : handle(frame_->GetExpression(index), isolate_); | 66 : handle(frame_->GetExpression(index), isolate_); |
67 } | 67 } |
68 | 68 |
69 | 69 |
70 int FrameInspector::GetSourcePosition() { | 70 int FrameInspector::GetSourcePosition() { |
71 if (is_optimized_) { | 71 if (is_optimized_) { |
72 return deoptimized_frame_->GetSourcePosition(); | 72 return deoptimized_frame_->GetSourcePosition(); |
73 } else if (is_interpreted_) { | 73 } else if (is_interpreted_) { |
74 InterpretedFrame* frame = reinterpret_cast<InterpretedFrame*>(frame_); | 74 InterpretedFrame* frame = reinterpret_cast<InterpretedFrame*>(frame_); |
75 BytecodeArray* bytecode_array = frame->GetBytecodeArray(); | 75 BytecodeArray* bytecode_array = |
| 76 frame->function()->shared()->bytecode_array(); |
76 return bytecode_array->SourcePosition(frame->GetBytecodeOffset()); | 77 return bytecode_array->SourcePosition(frame->GetBytecodeOffset()); |
77 } else { | 78 } else { |
78 Code* code = frame_->LookupCode(); | 79 Code* code = frame_->LookupCode(); |
79 int offset = static_cast<int>(frame_->pc() - code->instruction_start()); | 80 int offset = static_cast<int>(frame_->pc() - code->instruction_start()); |
80 return code->SourcePosition(offset); | 81 return code->SourcePosition(offset); |
81 } | 82 } |
82 } | 83 } |
83 | 84 |
84 | 85 |
85 bool FrameInspector::IsConstructor() { | 86 bool FrameInspector::IsConstructor() { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; | 217 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; |
217 if (++count == index) return i; | 218 if (++count == index) return i; |
218 } | 219 } |
219 } | 220 } |
220 return -1; | 221 return -1; |
221 } | 222 } |
222 | 223 |
223 | 224 |
224 } // namespace internal | 225 } // namespace internal |
225 } // namespace v8 | 226 } // namespace v8 |
OLD | NEW |