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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/debug.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-frames.cc
diff --git a/src/debug/debug-frames.cc b/src/debug/debug-frames.cc
index 012d29162234a6f26466b43bca5bdffc7926abb8..df395fcb1fd2a5f4ea8edec6488802cf54c2a214 100644
--- a/src/debug/debug-frames.cc
+++ b/src/debug/debug-frames.cc
@@ -69,8 +69,13 @@ Object* FrameInspector::GetExpression(int index) {
int FrameInspector::GetSourcePosition() {
- return is_optimized_ ? deoptimized_frame_->GetSourcePosition()
- : frame_->LookupCode()->SourcePosition(frame_->pc());
+ if (is_optimized_) {
+ return deoptimized_frame_->GetSourcePosition();
+ } else {
+ Code* code = frame_->LookupCode();
+ int offset = static_cast<int>(frame_->pc() - code->instruction_start());
+ return code->SourcePosition(offset);
+ }
}
« 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