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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 288343010: Fix inlining tree printing to skip duplicates as the gathered inlined info is aggregated from many … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
===================================================================
--- runtime/vm/flow_graph_inliner.cc (revision 36432)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -817,7 +817,17 @@
private:
friend class PolymorphicInliner;
+
+ static bool Contains(const GrowableArray<intptr_t>& a, intptr_t deopt_id) {
+ for (intptr_t i = 0; i < a.length(); i++) {
+ if (a[i] == deopt_id) return true;
+ }
+ return false;
+ }
+
void PrintInlinedInfoFor(const Function& caller, intptr_t depth) {
+ // Prevent duplicate printing as inlined_info aggregates all inlinining.
+ GrowableArray<intptr_t> call_instructions_printed;
// Print those that were inlined.
for (intptr_t i = 0; i < inlined_info_.length(); i++) {
const InlinedInfo& info = inlined_info_[i];
@@ -825,7 +835,8 @@
continue;
}
if ((info.inlined_depth == depth) &&
- (info.caller->raw() == caller.raw())) {
+ (info.caller->raw() == caller.raw()) &&
+ !Contains(call_instructions_printed, info.call_instr->GetDeoptId())) {
for (int t = 0; t < depth; t++) {
OS::Print(" ");
}
@@ -833,8 +844,10 @@
info.call_instr->GetDeoptId(),
info.inlined->ToQualifiedCString());
PrintInlinedInfoFor(*info.inlined, depth + 1);
+ call_instructions_printed.Add(info.call_instr->GetDeoptId());
}
}
+ call_instructions_printed.Clear();
// Print those that were not inlined.
for (intptr_t i = 0; i < inlined_info_.length(); i++) {
const InlinedInfo& info = inlined_info_[i];
@@ -842,7 +855,8 @@
continue;
}
if ((info.inlined_depth == depth) &&
- (info.caller->raw() == caller.raw())) {
+ (info.caller->raw() == caller.raw()) &&
+ !Contains(call_instructions_printed, info.call_instr->GetDeoptId())) {
for (int t = 0; t < depth; t++) {
OS::Print(" ");
}
@@ -850,6 +864,7 @@
info.call_instr->GetDeoptId(),
info.inlined->ToQualifiedCString(),
info.bailout_reason);
+ call_instructions_printed.Add(info.call_instr->GetDeoptId());
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698