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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 227723002: VM: Implement closure calls as instance calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: minimal inlining tweaks Created 6 years, 8 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
Index: runtime/vm/flow_graph_inliner.cc
===================================================================
--- runtime/vm/flow_graph_inliner.cc (revision 34878)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -473,9 +473,9 @@
inlining_call_sites_ = call_sites_temp;
collected_call_sites_->Clear();
// Inline call sites at the current depth.
+ InlineInstanceCalls();
srdjan 2014/04/09 18:28:43 Any reason for changing the order?
Florian Schneider 2014/04/10 08:49:25 The reason is that dispatchers are instance calls,
InlineStaticCalls();
InlineClosureCalls();
- InlineInstanceCalls();
// Increment the inlining depth. Checked before recursive inlining.
++inlining_depth_;
}
@@ -712,9 +712,18 @@
return false;
}
- collected_call_sites_->FindCallSites(callee_graph,
- inlining_depth_,
- &inlined_info_);
+ if (function.IsInvokeFieldDispatcher() ||
+ function.IsNoSuchMethodDispatcher()) {
+ // Append call sites to the currently processed list so that dispatcher
+ // methods get inlined regardless of the current depth.
+ inlining_call_sites_->FindCallSites(callee_graph,
+ 0,
+ &inlined_info_);
+ } else {
+ collected_call_sites_->FindCallSites(callee_graph,
+ inlining_depth_,
+ &inlined_info_);
+ }
// Add the function to the cache.
if (!in_cache) {

Powered by Google App Engine
This is Rietveld 408576698