Index: src/runtime/runtime-internal.cc |
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc |
index 812cd09c099bf6bfd4499ce576b1994bf508d432..c1ef69efdc027325f00160b6c655371132ca3e70 100644 |
--- a/src/runtime/runtime-internal.cc |
+++ b/src/runtime/runtime-internal.cc |
@@ -365,20 +365,19 @@ namespace { |
bool ComputeLocation(Isolate* isolate, MessageLocation* target) { |
JavaScriptFrameIterator it(isolate); |
if (!it.done()) { |
- JavaScriptFrame* frame = it.frame(); |
- JSFunction* fun = frame->function(); |
- Object* script = fun->shared()->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(); |
+ Handle<JSFunction> function = summary.function(); |
+ Handle<Object> script(function->shared()->script(), isolate); |
+ int pos = summary.abstract_code()->SourcePosition(summary.code_offset()); |
if (script->IsScript() && |
- !(Script::cast(script)->source()->IsUndefined(isolate))) { |
- Handle<Script> casted_script(Script::cast(script), isolate); |
- // 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.abstract_code()->SourcePosition(summary.code_offset()); |
- *target = MessageLocation(casted_script, pos, pos + 1, handle(fun)); |
+ !(Handle<Script>::cast(script)->source()->IsUndefined(isolate))) { |
+ Handle<Script> casted_script = Handle<Script>::cast(script); |
+ *target = MessageLocation(casted_script, pos, pos + 1, function); |
return true; |
} |
} |