| Index: runtime/vm/compiler.cc
|
| ===================================================================
|
| --- runtime/vm/compiler.cc (revision 42443)
|
| +++ runtime/vm/compiler.cc (working copy)
|
| @@ -456,6 +456,10 @@
|
| }
|
| }
|
|
|
| + // Maps inline_id_to_function[inline_id] -> function. Top scope
|
| + // function has inline_id 0. The map is populated by the inliner.
|
| + GrowableArray<const Function*> inline_id_to_function;
|
| + inline_id_to_function.Add(&function);
|
| // Collect all instance fields that are loaded in the graph and
|
| // have non-generic type feedback attached to them that can
|
| // potentially affect optimizations.
|
| @@ -473,6 +477,8 @@
|
| optimizer.TryOptimizePatterns();
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
|
|
| + FlowGraphInliner::SetInliningId(*flow_graph, 0);
|
| +
|
| // Inlining (mutates the flow graph)
|
| if (FLAG_use_inlining) {
|
| TimerScope timer(FLAG_compiler_stats,
|
| @@ -485,7 +491,7 @@
|
| optimizer.ApplyClassIds();
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
|
|
| - FlowGraphInliner inliner(flow_graph);
|
| + FlowGraphInliner inliner(flow_graph, &inline_id_to_function);
|
| inliner.Inline();
|
| // Use lists are maintained and validated by the inliner.
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| @@ -679,7 +685,8 @@
|
| }
|
|
|
| Assembler assembler(use_far_branches);
|
| - FlowGraphCompiler graph_compiler(&assembler, flow_graph, optimized);
|
| + FlowGraphCompiler graph_compiler(
|
| + &assembler, flow_graph, optimized, inline_id_to_function);
|
| {
|
| TimerScope timer(FLAG_compiler_stats,
|
| &CompilerStats::graphcompiler_timer,
|
| @@ -694,6 +701,7 @@
|
| const Code& code = Code::Handle(
|
| Code::FinalizeCode(function, &assembler, optimized));
|
| code.set_is_optimized(optimized);
|
| + code.set_inlined_intervals(graph_compiler.inlined_code_intervals());
|
| graph_compiler.FinalizePcDescriptors(code);
|
| graph_compiler.FinalizeDeoptInfo(code);
|
| graph_compiler.FinalizeStackmaps(code);
|
|
|