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

Side by Side Diff: runtime/lib/stacktrace.cc

Issue 23494026: Change inlined stack frame iterator to use code and pc instead of frame. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 #include "vm/exceptions.h" 6 #include "vm/exceptions.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/runtime_entry.h" 8 #include "vm/runtime_entry.h"
9 #include "vm/stack_frame.h" 9 #include "vm/stack_frame.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 Function& func = Function::Handle(); 48 Function& func = Function::Handle();
49 Code& code = Code::Handle(); 49 Code& code = Code::Handle();
50 Smi& offset = Smi::Handle(); 50 Smi& offset = Smi::Handle();
51 bool catch_frame_skipped = false; // Tracks if catch frame has been skipped. 51 bool catch_frame_skipped = false; // Tracks if catch frame has been skipped.
52 while (frame != NULL) { 52 while (frame != NULL) {
53 if (frame->IsDartFrame()) { 53 if (frame->IsDartFrame()) {
54 code = frame->LookupDartCode(); 54 code = frame->LookupDartCode();
55 if (code.is_optimized()) { 55 if (code.is_optimized()) {
56 // For optimized frames, extract all the inlined functions if any 56 // For optimized frames, extract all the inlined functions if any
57 // into the stack trace. 57 // into the stack trace.
58 for (InlinedFunctionsIterator it(frame); !it.Done(); it.Advance()) { 58 for (InlinedFunctionsIterator it(code, frame->pc());
59 !it.Done(); it.Advance()) {
59 func = it.function(); 60 func = it.function();
60 code = it.code(); 61 code = it.code();
61 uword pc = it.pc(); 62 uword pc = it.pc();
62 ASSERT(pc != 0); 63 ASSERT(pc != 0);
63 ASSERT(code.EntryPoint() <= pc); 64 ASSERT(code.EntryPoint() <= pc);
64 ASSERT(pc < (code.EntryPoint() + code.Size())); 65 ASSERT(pc < (code.EntryPoint() + code.Size()));
65 if (func.is_visible()) { 66 if (func.is_visible()) {
66 if (!catch_frame_skipped) { 67 if (!catch_frame_skipped) {
67 catch_frame_skipped = true; 68 catch_frame_skipped = true;
68 } else { 69 } else {
(...skipping 22 matching lines...) Expand all
91 } 92 }
92 const Array& func_array = Array::Handle(Array::MakeArray(func_list)); 93 const Array& func_array = Array::Handle(Array::MakeArray(func_list));
93 const Array& code_array = Array::Handle(Array::MakeArray(code_list)); 94 const Array& code_array = Array::Handle(Array::MakeArray(code_list));
94 const Array& pc_offset_array = 95 const Array& pc_offset_array =
95 Array::Handle(Array::MakeArray(pc_offset_list)); 96 Array::Handle(Array::MakeArray(pc_offset_list));
96 trace.SetCatchStacktrace(func_array, code_array, pc_offset_array); 97 trace.SetCatchStacktrace(func_array, code_array, pc_offset_array);
97 return Object::null(); 98 return Object::null();
98 } 99 }
99 100
100 } // namespace dart 101 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698