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

Side by Side 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: empty patch set as per comment 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 unified diff | Download patch
« no previous file with comments | « src/frames.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 return ReThrow(thrown); 1320 return ReThrow(thrown);
1321 } 1321 }
1322 1322
1323 1323
1324 void Isolate::PrintCurrentStackTrace(FILE* out) { 1324 void Isolate::PrintCurrentStackTrace(FILE* out) {
1325 StackTraceFrameIterator it(this); 1325 StackTraceFrameIterator it(this);
1326 while (!it.done()) { 1326 while (!it.done()) {
1327 HandleScope scope(this); 1327 HandleScope scope(this);
1328 // Find code position if recorded in relocation info. 1328 // Find code position if recorded in relocation info.
1329 StandardFrame* frame = it.frame(); 1329 StandardFrame* frame = it.frame();
1330 Code* code = frame->LookupCode(); 1330 int pos;
1331 int offset = static_cast<int>(frame->pc() - code->instruction_start()); 1331 if (frame->is_interpreted()) {
1332 int pos = frame->LookupCode()->SourcePosition(offset); 1332 InterpretedFrame* iframe = reinterpret_cast<InterpretedFrame*>(frame);
1333 pos = iframe->GetBytecodeArray()->SourcePosition(
1334 iframe->GetBytecodeOffset());
1335 } else {
1336 Code* code = frame->LookupCode();
1337 int offset = static_cast<int>(frame->pc() - code->instruction_start());
1338 pos = frame->LookupCode()->SourcePosition(offset);
1339 }
1333 Handle<Object> pos_obj(Smi::FromInt(pos), this); 1340 Handle<Object> pos_obj(Smi::FromInt(pos), this);
1334 // Fetch function and receiver. 1341 // Fetch function and receiver.
1335 Handle<JSFunction> fun(frame->function()); 1342 Handle<JSFunction> fun(frame->function());
1336 Handle<Object> recv(frame->receiver(), this); 1343 Handle<Object> recv(frame->receiver(), this);
1337 // Advance to the next JavaScript frame and determine if the 1344 // Advance to the next JavaScript frame and determine if the
1338 // current frame is the top-level frame. 1345 // current frame is the top-level frame.
1339 it.Advance(); 1346 it.Advance();
1340 Handle<Object> is_top_level = factory()->ToBoolean(it.done()); 1347 Handle<Object> is_top_level = factory()->ToBoolean(it.done());
1341 // Generate and print stack trace line. 1348 // Generate and print stack trace line.
1342 Handle<String> line = 1349 Handle<String> line =
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 // Then check whether this scope intercepts. 2994 // Then check whether this scope intercepts.
2988 if ((flag & intercept_mask_)) { 2995 if ((flag & intercept_mask_)) {
2989 intercepted_flags_ |= flag; 2996 intercepted_flags_ |= flag;
2990 return true; 2997 return true;
2991 } 2998 }
2992 return false; 2999 return false;
2993 } 3000 }
2994 3001
2995 } // namespace internal 3002 } // namespace internal
2996 } // namespace v8 3003 } // namespace v8
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698