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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 10989016: Add is_inlinable field to functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use bit field Created 8 years, 3 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/flow_graph_builder.cc ('k') | 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 c60ee6d788403975ea86a1d4619d8604e09abac1..ff9652428dd6a22553a026fe1e561be4d91ce80b 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -41,6 +41,12 @@ class CallSiteInliner : public FlowGraphVisitor {
Definition* call) {
TRACE_INLINING(OS::Print(" => %s\n", function.ToCString()));
+ // Abort if the inlinable bit on the function is low.
+ if (!function.is_inlinable()) {
+ TRACE_INLINING(OS::Print(" Bailout: not inlinable\n"));
+ return false;
+ }
+
// Abort if the callee has optional parameters.
if (function.HasOptionalParameters()) {
TRACE_INLINING(OS::Print(" Bailout: optional parameters\n"));
@@ -52,6 +58,7 @@ class CallSiteInliner : public FlowGraphVisitor {
// Abort if the callee has an intrinsic translation.
if (Intrinsifier::CanIntrinsify(function)) {
+ function.set_is_inlinable(false);
TRACE_INLINING(OS::Print(" Bailout: can intrinsify\n"));
return false;
}
@@ -89,6 +96,7 @@ class CallSiteInliner : public FlowGraphVisitor {
// Abort if the callee graph contains control flow.
if (callee_graph->preorder().length() != 2) {
+ function.set_is_inlinable(false);
isolate->set_long_jump_base(base);
isolate->set_ic_data_array(prev_ic_data.raw());
TRACE_INLINING(OS::Print(" Bailout: control flow\n"));
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698