Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 3336bd0c401997201820c7e5af0e9913bf1b839f..8cf5186581caa8b6b36bc5fb1c01d9bcada12a8e 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -1320,9 +1320,16 @@ void Isolate::PrintCurrentStackTrace(FILE* out) { |
HandleScope scope(this); |
// Find code position if recorded in relocation info. |
JavaScriptFrame* frame = it.frame(); |
- Code* code = frame->LookupCode(); |
- int offset = static_cast<int>(frame->pc() - code->instruction_start()); |
- int pos = frame->LookupCode()->SourcePosition(offset); |
+ int pos = RelocInfo::kNoPosition; |
+ if (frame->is_interpreted()) { |
+ InterpretedFrame* iframe = reinterpret_cast<InterpretedFrame*>(frame); |
+ BytecodeArray* bytecode_array = iframe->GetBytecodeArray(); |
+ pos = bytecode_array->SourcePosition(iframe->GetBytecodeOffset()); |
+ } else if (!frame->is_optimized()) { |
+ Code* code = frame->LookupCode(); |
+ int offset = static_cast<int>(frame->pc() - code->instruction_start()); |
+ pos = frame->LookupCode()->SourcePosition(offset); |
+ } |
Handle<Object> pos_obj(Smi::FromInt(pos), this); |
// Fetch function and receiver. |
Handle<JSFunction> fun(frame->function()); |