| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 7 #include "vm/block_scheduler.h" | 7 #include "vm/block_scheduler.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/flow_graph.h" | 10 #include "vm/flow_graph.h" |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 } | 613 } |
| 614 | 614 |
| 615 { | 615 { |
| 616 TimerScope timer(FLAG_compiler_stats, | 616 TimerScope timer(FLAG_compiler_stats, |
| 617 &CompilerStats::graphinliner_opt_timer, | 617 &CompilerStats::graphinliner_opt_timer, |
| 618 isolate); | 618 isolate); |
| 619 // TODO(zerny): Do more optimization passes on the callee graph. | 619 // TODO(zerny): Do more optimization passes on the callee graph. |
| 620 FlowGraphOptimizer optimizer(callee_graph); | 620 FlowGraphOptimizer optimizer(callee_graph); |
| 621 optimizer.ApplyICData(); | 621 optimizer.ApplyICData(); |
| 622 DEBUG_ASSERT(callee_graph->VerifyUseLists()); | 622 DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| 623 |
| 624 // Optimize (a << b) & c patterns, merge truncdiv/mod. Must occur before |
| 625 // 'SelectRepresentations' which inserts conversion nodes. |
| 626 optimizer.TryOptimizePatterns(); |
| 627 DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| 623 } | 628 } |
| 624 | 629 |
| 625 if (FLAG_trace_inlining && | 630 if (FLAG_trace_inlining && |
| 626 (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) { | 631 (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) { |
| 627 OS::Print("Callee graph for inlining %s\n", | 632 OS::Print("Callee graph for inlining %s\n", |
| 628 function.ToFullyQualifiedCString()); | 633 function.ToFullyQualifiedCString()); |
| 629 FlowGraphPrinter printer(*callee_graph); | 634 FlowGraphPrinter printer(*callee_graph); |
| 630 printer.PrintBlocks(); | 635 printer.PrintBlocks(); |
| 631 } | 636 } |
| 632 | 637 |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1522 OS::Print("After Inlining of %s\n", flow_graph_-> | 1527 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1523 parsed_function().function().ToFullyQualifiedCString()); | 1528 parsed_function().function().ToFullyQualifiedCString()); |
| 1524 FlowGraphPrinter printer(*flow_graph_); | 1529 FlowGraphPrinter printer(*flow_graph_); |
| 1525 printer.PrintBlocks(); | 1530 printer.PrintBlocks(); |
| 1526 } | 1531 } |
| 1527 } | 1532 } |
| 1528 } | 1533 } |
| 1529 } | 1534 } |
| 1530 | 1535 |
| 1531 } // namespace dart | 1536 } // namespace dart |
| OLD | NEW |