Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index d60a481c201bd6428d7f1c6efbd713587a2970b5..445480a3eb46d860ded047f0ae9d8276172814e9 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -1266,9 +1266,14 @@ bool Isolate::ComputeLocation(MessageLocation* target) { |
Object* script = fun->shared()->script(); |
if (script->IsScript() && |
!(Script::cast(script)->source()->IsUndefined())) { |
- int pos = frame->LookupCode()->SourcePosition(frame->pc()); |
- // Compute the location from the function and the reloc info. |
Handle<Script> casted_script(Script::cast(script)); |
+ // Compute the location from the function and the relocation info of the |
+ // baseline code. For optimized code this will use the deoptimization |
+ // information to get canonical location information. |
+ List<FrameSummary> frames(FLAG_max_inlining_levels + 1); |
+ it.frame()->Summarize(&frames); |
+ FrameSummary& summary = frames.last(); |
+ int pos = summary.code()->SourcePosition(summary.pc()); |
*target = MessageLocation(casted_script, pos, pos + 1, handle(fun)); |
return true; |
} |