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

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: adjust inlining of dispatchers 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
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/intermediate_language.h » ('j') | 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 34916)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -301,7 +301,8 @@
PolymorphicInstanceCallInstr* instance_call =
current->AsPolymorphicInstanceCall();
if (!inline_only_recognized_methods ||
- instance_call->HasSingleRecognizedTarget()) {
+ instance_call->HasSingleRecognizedTarget() ||
+ instance_call->HasSingleDispatcherTarget()) {
instance_calls_.Add(InstanceCallInfo(instance_call, graph));
} else {
// Method not inlined because inlining too deep and method
@@ -473,9 +474,9 @@
inlining_call_sites_ = call_sites_temp;
collected_call_sites_->Clear();
// Inline call sites at the current depth.
+ InlineInstanceCalls();
InlineStaticCalls();
InlineClosureCalls();
- InlineInstanceCalls();
// Increment the inlining depth. Checked before recursive inlining.
++inlining_depth_;
}
@@ -712,9 +713,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) {
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698