| 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 = | 75 BytecodeArray* bytecode_array = frame->GetBytecodeArray(); |
| 76 frame->function()->shared()->bytecode_array(); | |
| 77 return bytecode_array->SourcePosition(frame->GetBytecodeOffset()); | 76 return bytecode_array->SourcePosition(frame->GetBytecodeOffset()); |
| 78 } else { | 77 } else { |
| 79 Code* code = frame_->LookupCode(); | 78 Code* code = frame_->LookupCode(); |
| 80 int offset = static_cast<int>(frame_->pc() - code->instruction_start()); | 79 int offset = static_cast<int>(frame_->pc() - code->instruction_start()); |
| 81 return code->SourcePosition(offset); | 80 return code->SourcePosition(offset); |
| 82 } | 81 } |
| 83 } | 82 } |
| 84 | 83 |
| 85 | 84 |
| 86 bool FrameInspector::IsConstructor() { | 85 bool FrameInspector::IsConstructor() { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; | 216 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; |
| 218 if (++count == index) return i; | 217 if (++count == index) return i; |
| 219 } | 218 } |
| 220 } | 219 } |
| 221 return -1; | 220 return -1; |
| 222 } | 221 } |
| 223 | 222 |
| 224 | 223 |
| 225 } // namespace internal | 224 } // namespace internal |
| 226 } // namespace v8 | 225 } // namespace v8 |
| OLD | NEW |