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

Unified Diff: src/isolate.cc

Issue 1909663005: [interpreter] Fix stack trace printers for debugging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
« src/frames.cc ('K') | « src/frames.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index c81afcc0e744226b626a9ba497af6199aa6ec5ef..d6ac75d3fe16f08faec41afd895e93c5270eaf19 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1327,9 +1327,17 @@ void Isolate::PrintCurrentStackTrace(FILE* out) {
HandleScope scope(this);
// Find code position if recorded in relocation info.
StandardFrame* 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;
+ if (frame->is_java_script() &&
Michael Starzinger 2016/04/21 17:05:18 nit: Just "frame->is_interpreted()" is sufficient.
Yang 2016/04/22 05:03:39 Done.
+ JavaScriptFrame::cast(frame)->is_interpreted()) {
+ InterpretedFrame* iframe = reinterpret_cast<InterpretedFrame*>(frame);
+ pos = iframe->GetBytecodeArray()->SourcePosition(
+ iframe->GetBytecodeOffset());
+ } else {
+ 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());
« src/frames.cc ('K') | « src/frames.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698