Chromium Code Reviews| Index: runtime/vm/compiler.cc |
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc |
| index 56717e0e20702bb34512805dec63c2de08f3ac09..e52cba9d1cbd4534c67ee898094df46b98d1066d 100644 |
| --- a/runtime/vm/compiler.cc |
| +++ b/runtime/vm/compiler.cc |
| @@ -17,6 +17,7 @@ |
| #include "vm/flow_graph_allocator.h" |
| #include "vm/flow_graph_builder.h" |
| #include "vm/flow_graph_compiler.h" |
| +#include "vm/flow_graph_inliner.h" |
| #include "vm/flow_graph_optimizer.h" |
| #include "vm/il_printer.h" |
| #include "vm/longjump.h" |
| @@ -38,6 +39,7 @@ DEFINE_FLAG(bool, cse, true, "Do common subexpression elimination."); |
| DEFINE_FLAG(int, deoptimization_counter_threshold, 5, |
| "How many times we allow deoptimization before we disallow" |
| " certain optimizations"); |
| +DEFINE_FLAG(bool, inlining, true, "Enable call-site inlining"); |
|
Kevin Millikin (Google)
2012/08/29 14:01:04
Flag name should be a verb to match the others. S
zerny-google
2012/08/30 07:31:40
Done.
|
| DECLARE_FLAG(bool, print_flow_graph); |
| @@ -189,6 +191,14 @@ static bool CompileParsedFunctionHelper(const ParsedFunction& parsed_function, |
| // Compute the use lists. |
| flow_graph->ComputeUseLists(); |
| + // Inlining (mutates the flow graph) |
| + if (FLAG_inlining) { |
| + FlowGraphInliner inliner(flow_graph); |
| + inliner.Inline(); |
| + // Verify that the use lists are still valid. |
| + DEBUG_ASSERT(flow_graph->ValidateUseLists()); |
| + } |
| + |
| // Propagate types and eliminate more type tests. |
| FlowGraphTypePropagator propagator(*flow_graph); |
| propagator.PropagateTypes(); |