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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 291383003: Throttle excessive inlining in lareg functions, enable inlining in checked mode, some bug fixes. (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 36520)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -49,6 +49,8 @@
"default 10%: calls above-equal 10% of max-count are inlined.");
DEFINE_FLAG(bool, inline_recursive, true,
"Inline recursive calls.");
+DEFINE_FLAG(int, max_inlined_per_depth, 500,
+ "Max. number of inlined calls per depth");
DEFINE_FLAG(bool, print_inlining_tree, false, "Print inlining tree");
DECLARE_FLAG(bool, compiler_stats);
@@ -240,6 +242,12 @@
instance_calls_.is_empty());
}
+ intptr_t NumCalls() const {
+ return instance_calls_.length() +
+ static_calls_.length() +
+ closure_calls_.length();
+ }
+
void Clear() {
static_calls_.Clear();
closure_calls_.Clear();
@@ -516,6 +524,13 @@
while (collected_call_sites_->HasCalls()) {
TRACE_INLINING(OS::Print(" Depth %" Pd " ----------\n",
inlining_depth_));
+ if (collected_call_sites_->NumCalls() > FLAG_max_inlined_per_depth) {
+ break;
+ }
+ if (FLAG_print_inlining_tree) {
+ OS::Print("**Depth % " Pd " calls to inline %" Pd "\n",
+ inlining_depth_, collected_call_sites_->NumCalls());
+ }
// Swap collected and inlining arrays and clear the new collecting array.
call_sites_temp = collected_call_sites_;
collected_call_sites_ = inlining_call_sites_;
@@ -1002,8 +1017,6 @@
}
if (target.IsNull()) {
TRACE_INLINING(OS::Print(" Bailout: non-closure operator\n"));
- PRINT_INLINING_TREE("Non-closure operator",
- call_info[call_idx].caller, &target, call);
continue;
}
GrowableArray<Value*> arguments(call->ArgumentCount());
@@ -1667,11 +1680,6 @@
return;
}
- if (FLAG_enable_type_checks) {
- // TODO(srdjan): Fix out-of-memory crash in checked mode.
- return;
- }
-
TRACE_INLINING(OS::Print("Inlining calls in %s\n", top.ToCString()));
if (FLAG_trace_inlining &&
« 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