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

Unified Diff: src/runtime.cc

Issue 9295014: Find correct source position in inlined functions on debug break. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Change test to be single-threaded. Created 8 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
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index a5cc10cd8ee9d3ca46267bcbbfecd5adf308714c..5e007e2f84f08a4aa54351615c6025d826eb3f5b 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -10747,6 +10747,11 @@ class FrameInspector {
? deoptimized_frame_->GetExpression(index)
: frame_->GetExpression(index);
}
+ Address GetPc() {
+ return is_optimized_
+ ? deoptimized_frame_->GetPc()
+ : frame_->pc();
+ }
// To inspect all the provided arguments the frame might need to be
// replaced with the arguments frame.
@@ -10852,17 +10857,16 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFrameDetails) {
// Get the frame id.
Handle<Object> frame_id(WrapFrameId(it.frame()->id()), isolate);
- // Find source position.
- int position =
- it.frame()->LookupCode()->SourcePosition(it.frame()->pc());
+ // Find source position in unoptimized code.
+ Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction()));
+ Handle<SharedFunctionInfo> shared(function->shared());
+ int position = shared->code()->SourcePosition(frame_inspector.GetPc());
// Check for constructor frame. Inlined frames cannot be construct calls.
bool inlined_frame = is_optimized && inlined_jsframe_index != 0;
bool constructor = !inlined_frame && it.frame()->IsConstructor();
// Get scope info and read from it for local variable information.
- Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction()));
- Handle<SharedFunctionInfo> shared(function->shared());
Handle<ScopeInfo> scope_info(shared->scope_info());
ASSERT(*scope_info != ScopeInfo::Empty());
« no previous file with comments | « src/deoptimizer.cc ('k') | test/cctest/test-debug.cc » ('j') | test/cctest/test-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698