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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 2572543003: Treat dispatchers and implicit accessors the same for inlining decisions. (Closed)
Patch Set: Created 4 years 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/object.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
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index dafb65990e29eba3cb422de5b96f4e4771cf37e5..062196160f0408a82922d383075660f6c1533cb1 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -381,7 +381,8 @@ class CallSites : public ValueObject {
current->AsPolymorphicInstanceCall();
if (!inline_only_recognized_methods ||
instance_call->HasSingleRecognizedTarget() ||
- instance_call->ic_data().HasOnlyDispatcherTargets()) {
+ instance_call->ic_data()
+ .HasOnlyDispatcherOrImplicitAccessorTargets()) {
instance_calls_.Add(InstanceCallInfo(instance_call, graph));
} else {
// Method not inlined because inlining too deep and method
@@ -397,7 +398,8 @@ class CallSites : public ValueObject {
} else if (current->IsStaticCall()) {
StaticCallInstr* static_call = current->AsStaticCall();
if (!inline_only_recognized_methods ||
- static_call->function().IsRecognized()) {
+ static_call->function().IsRecognized() ||
+ static_call->function().IsDispatcherOrImplicitAccessor()) {
static_calls_.Add(StaticCallInfo(static_call, graph));
} else {
// Method not inlined because inlining too deep and method
@@ -936,10 +938,8 @@ class CallSiteInliner : public ValueObject {
}
// Inline dispatcher methods regardless of the current depth.
- const intptr_t depth = (function.IsInvokeFieldDispatcher() ||
- function.IsNoSuchMethodDispatcher())
- ? 0
- : inlining_depth_;
+ const intptr_t depth =
+ function.IsDispatcherOrImplicitAccessor() ? 0 : inlining_depth_;
collected_call_sites_->FindCallSites(callee_graph, depth,
&inlined_info_);
@@ -1924,9 +1924,8 @@ bool FlowGraphInliner::AlwaysInline(const Function& function) {
return true;
}
- if (function.IsImplicitGetterFunction() ||
- function.IsImplicitSetterFunction()) {
- // Inlined accessors are smaller than a call.
+ if (function.IsDispatcherOrImplicitAccessor()) {
+ // Smaller or same size as the call.
return true;
}
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698