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

Unified Diff: runtime/lib/stacktrace.cc

Issue 23964003: Traverse inlined frames lazily when printing the stacktrace. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/stacktrace.cc
===================================================================
--- runtime/lib/stacktrace.cc (revision 27140)
+++ runtime/lib/stacktrace.cc (working copy)
@@ -36,8 +36,6 @@
DEFINE_NATIVE_ENTRY(Stacktrace_setupFullStacktrace, 1) {
const Stacktrace& trace =
Stacktrace::CheckedHandle(arguments->NativeArgAt(0));
- const GrowableObjectArray& func_list =
- GrowableObjectArray::Handle(GrowableObjectArray::New());
const GrowableObjectArray& code_list =
GrowableObjectArray::Handle(GrowableObjectArray::New());
const GrowableObjectArray& pc_offset_list =
@@ -52,49 +50,23 @@
while (frame != NULL) {
if (frame->IsDartFrame()) {
code = frame->LookupDartCode();
- if (code.is_optimized()) {
- // For optimized frames, extract all the inlined functions if any
- // into the stack trace.
- for (InlinedFunctionsIterator it(code, frame->pc());
- !it.Done(); it.Advance()) {
- func = it.function();
- code = it.code();
- uword pc = it.pc();
- ASSERT(pc != 0);
- ASSERT(code.EntryPoint() <= pc);
- ASSERT(pc < (code.EntryPoint() + code.Size()));
- if (func.is_visible()) {
- if (!catch_frame_skipped) {
- catch_frame_skipped = true;
- } else {
- offset = Smi::New(pc - code.EntryPoint());
- func_list.Add(func);
- code_list.Add(code);
- pc_offset_list.Add(offset);
- }
- }
+ offset = Smi::New(frame->pc() - code.EntryPoint());
+ func = code.function();
+ if (func.is_visible()) {
siva 2013/09/04 22:25:21 I think we should do this filtering in the print f
srdjan 2013/09/05 18:14:09 Done.
+ if (!catch_frame_skipped) {
+ catch_frame_skipped = true;
+ } else {
+ code_list.Add(code);
+ pc_offset_list.Add(offset);
}
- } else {
- offset = Smi::New(frame->pc() - code.EntryPoint());
- func = code.function();
- if (func.is_visible()) {
- if (!catch_frame_skipped) {
- catch_frame_skipped = true;
- } else {
- func_list.Add(func);
- code_list.Add(code);
- pc_offset_list.Add(offset);
- }
- }
}
}
frame = frames.NextFrame();
}
- const Array& func_array = Array::Handle(Array::MakeArray(func_list));
const Array& code_array = Array::Handle(Array::MakeArray(code_list));
const Array& pc_offset_array =
Array::Handle(Array::MakeArray(pc_offset_list));
- trace.SetCatchStacktrace(func_array, code_array, pc_offset_array);
+ trace.SetCatchStacktrace(code_array, pc_offset_array);
return Object::null();
}
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698