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

Side by Side Diff: src/debug/debug-frames.cc

Issue 1618343002: [interpreter, debugger] abstraction for source position calculation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove bogus assertion Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/debug/debug.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 frame_->function()->shared()->asm_function() && 62 frame_->function()->shared()->asm_function() &&
63 !FLAG_turbo_asm_deoptimization) { 63 !FLAG_turbo_asm_deoptimization) {
64 return isolate_->heap()->undefined_value(); 64 return isolate_->heap()->undefined_value();
65 } 65 }
66 return is_optimized_ ? deoptimized_frame_->GetExpression(index) 66 return is_optimized_ ? deoptimized_frame_->GetExpression(index)
67 : frame_->GetExpression(index); 67 : frame_->GetExpression(index);
68 } 68 }
69 69
70 70
71 int FrameInspector::GetSourcePosition() { 71 int FrameInspector::GetSourcePosition() {
72 return is_optimized_ ? deoptimized_frame_->GetSourcePosition() 72 if (is_optimized_) {
73 : frame_->LookupCode()->SourcePosition(frame_->pc()); 73 return deoptimized_frame_->GetSourcePosition();
74 } else {
75 Code* code = frame_->LookupCode();
76 int offset = static_cast<int>(frame_->pc() - code->instruction_start());
77 return code->SourcePosition(offset);
78 }
74 } 79 }
75 80
76 81
77 bool FrameInspector::IsConstructor() { 82 bool FrameInspector::IsConstructor() {
78 return is_optimized_ && !is_bottommost_ 83 return is_optimized_ && !is_bottommost_
79 ? deoptimized_frame_->HasConstructStub() 84 ? deoptimized_frame_->HasConstructStub()
80 : frame_->IsConstructor(); 85 : frame_->IsConstructor();
81 } 86 }
82 87
83 88
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; 211 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue;
207 if (++count == index) return i; 212 if (++count == index) return i;
208 } 213 }
209 } 214 }
210 return -1; 215 return -1;
211 } 216 }
212 217
213 218
214 } // namespace internal 219 } // namespace internal
215 } // namespace v8 220 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698