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

Side by Side Diff: runtime/vm/exceptions.cc

Issue 12049039: Fix source position for stack traces with optimized top function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: avoid default arguments by using pending_deoptimization_env_ Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/debugger.h" 9 #include "vm/debugger.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Smi& offset = Smi::Handle(); 42 Smi& offset = Smi::Handle();
43 while (!frame->IsEntryFrame()) { 43 while (!frame->IsEntryFrame()) {
44 if (frame->IsDartFrame()) { 44 if (frame->IsDartFrame()) {
45 code = frame->LookupDartCode(); 45 code = frame->LookupDartCode();
46 if (code.is_optimized()) { 46 if (code.is_optimized()) {
47 // For optimized frames, extract all the inlined functions if any 47 // For optimized frames, extract all the inlined functions if any
48 // into the stack trace. 48 // into the stack trace.
49 InlinedFunctionsInDartFrameIterator optimized_frames(frame); 49 InlinedFunctionsInDartFrameIterator optimized_frames(frame);
50 while (true) { 50 while (true) {
51 uword pc = 0; 51 uword pc = 0;
52 func = optimized_frames.GetNextFunction(&pc); 52 func = optimized_frames.GetNextFunction(&pc, &code);
53 if (func.IsNull()) { 53 if (func.IsNull()) {
54 break; 54 break;
55 } 55 }
56 ASSERT(pc != 0); 56 ASSERT(pc != 0);
57 code = func.unoptimized_code();
58 offset = Smi::New(pc - code.EntryPoint()); 57 offset = Smi::New(pc - code.EntryPoint());
59 func_list.Add(func); 58 func_list.Add(func);
60 code_list.Add(code); 59 code_list.Add(code);
61 pc_offset_list.Add(offset); 60 pc_offset_list.Add(offset);
62 } 61 }
63 } else { 62 } else {
64 offset = Smi::New(frame->pc() - code.EntryPoint()); 63 offset = Smi::New(frame->pc() - code.EntryPoint());
65 func = code.function(); 64 func = code.function();
66 func_list.Add(func); 65 func_list.Add(func);
67 code_list.Add(code); 66 code_list.Add(code);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 case kIsolateUnhandledException: 463 case kIsolateUnhandledException:
465 library = Library::IsolateLibrary(); 464 library = Library::IsolateLibrary();
466 class_name = &Symbols::IsolateUnhandledException(); 465 class_name = &Symbols::IsolateUnhandledException();
467 break; 466 break;
468 } 467 }
469 468
470 return DartLibraryCalls::ExceptionCreate(library, *class_name, arguments); 469 return DartLibraryCalls::ExceptionCreate(library, *class_name, arguments);
471 } 470 }
472 471
473 } // namespace dart 472 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698