Chromium Code Reviews| Index: runtime/vm/compiler.cc |
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc |
| index ee9a5a08fb47a0d655796c53545688108e517585..3761087398b89f2a29da14a60e20b7c2b4fa7871 100644 |
| --- a/runtime/vm/compiler.cc |
| +++ b/runtime/vm/compiler.cc |
| @@ -7,6 +7,7 @@ |
| #include "vm/assembler.h" |
| #include "vm/ast_printer.h" |
| +#include "vm/block_scheduler.h" |
| #include "vm/code_generator.h" |
| #include "vm/code_patcher.h" |
| #include "vm/dart_entry.h" |
| @@ -294,6 +295,11 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function, |
| } |
| } |
| + BlockScheduler block_scheduler(flow_graph); |
|
Florian Schneider
2013/08/12 11:30:09
Maybe add a flag FLAG_reorder_basic_blocks to cont
Kevin Millikin (Google)
2013/08/13 11:14:57
Done.
|
| + if (optimized) { |
| + block_scheduler.AssignEdgeWeights(); |
| + } |
| + |
| if (optimized) { |
| TimerScope timer(FLAG_compiler_stats, |
| &CompilerStats::ssa_timer, |
| @@ -306,7 +312,6 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_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. |
| @@ -481,15 +486,15 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function, |
| FlowGraphAllocator allocator(*flow_graph); |
| allocator.AllocateRegisters(); |
| + block_scheduler.ReorderBlocks(); |
| + |
| if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) { |
| FlowGraphPrinter::PrintGraph("After Optimizations", flow_graph); |
| } |
| } |
| Assembler assembler; |
| - FlowGraphCompiler graph_compiler(&assembler, |
| - *flow_graph, |
| - optimized); |
| + FlowGraphCompiler graph_compiler(&assembler, flow_graph, optimized); |
| { |
| TimerScope timer(FLAG_compiler_stats, |
| &CompilerStats::graphcompiler_timer, |