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()); |