Chromium Code Reviews| Index: runtime/vm/flow_graph_inliner.cc |
| diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc |
| index f2fd49df71357f799fe46bef390b5094dabe68bf..9f2d39af82b1af3583b1e322277b704384dc0a8c 100644 |
| --- a/runtime/vm/flow_graph_inliner.cc |
| +++ b/runtime/vm/flow_graph_inliner.cc |
| @@ -4,6 +4,7 @@ |
| #include "vm/flow_graph_inliner.h" |
| +#include "vm/aot_optimizer.h" |
| #include "vm/block_scheduler.h" |
| #include "vm/branch_optimizer.h" |
| #include "vm/compiler.h" |
| @@ -790,10 +791,10 @@ class CallSiteInliner : public ValueObject { |
| CSTAT_TIMER_SCOPE(thread(), graphinliner_opt_timer); |
| // TODO(fschneider): Improve suppression of speculative inlining. |
| // Deopt-ids overlap between caller and callee. |
| - FlowGraphOptimizer optimizer(callee_graph, |
| - inliner_->use_speculative_inlining_, |
| - inliner_->inlining_black_list_); |
| if (FLAG_precompilation) { |
| + AotOptimizer optimizer(callee_graph, |
| + inliner_->use_speculative_inlining_, |
| + inliner_->inlining_black_list_); |
| optimizer.PopulateWithICData(); |
| optimizer.ApplyClassIds(); |
| @@ -801,14 +802,26 @@ class CallSiteInliner : public ValueObject { |
| FlowGraphTypePropagator::Propagate(callee_graph); |
| DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| - } |
| - optimizer.ApplyICData(); |
| - DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| - // Optimize (a << b) & c patterns, merge instructions. Must occur |
| - // before 'SelectRepresentations' which inserts conversion nodes. |
| - optimizer.TryOptimizePatterns(); |
| - DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| + optimizer.ApplyICData(); |
| + DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| + |
| + // Optimize (a << b) & c patterns, merge instructions. Must occur |
| + // before 'SelectRepresentations' which inserts conversion nodes. |
| + optimizer.TryOptimizePatterns(); |
| + DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| + } else { |
| + FlowGraphOptimizer optimizer(callee_graph, |
|
rmacnak
2016/02/19 00:54:32
Maybe this should be JitOptimizer for clarity.
Florian Schneider
2016/02/19 17:42:29
Ack. Will do this in a separate CL to not blow thi
|
| + inliner_->use_speculative_inlining_, |
| + inliner_->inlining_black_list_); |
| + optimizer.ApplyICData(); |
| + DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| + |
| + // Optimize (a << b) & c patterns, merge instructions. Must occur |
| + // before 'SelectRepresentations' which inserts conversion nodes. |
| + optimizer.TryOptimizePatterns(); |
| + DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| + } |
| } |
| if (FLAG_support_il_printer && FLAG_trace_inlining && |
| @@ -1508,9 +1521,6 @@ static Instruction* AppendInstruction(Instruction* first, |
| bool PolymorphicInliner::TryInlineRecognizedMethod(intptr_t receiver_cid, |
| const Function& target) { |
| - FlowGraphOptimizer optimizer(owner_->caller_graph(), |
| - false, // Speculative inlining not applicable. |
| - NULL); |
| TargetEntryInstr* entry; |
| Definition* last; |
| // Replace the receiver argument with a redefinition to prevent code from |