| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 Code::Handle(function.unoptimized_code()); | 539 Code::Handle(function.unoptimized_code()); |
| 540 ic_data_array = unoptimized_code.ExtractTypeFeedbackArray(); | 540 ic_data_array = unoptimized_code.ExtractTypeFeedbackArray(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 // Build the callee graph. | 543 // Build the callee graph. |
| 544 InlineExitCollector* exit_collector = | 544 InlineExitCollector* exit_collector = |
| 545 new InlineExitCollector(caller_graph_, call); | 545 new InlineExitCollector(caller_graph_, call); |
| 546 FlowGraphBuilder builder(parsed_function, | 546 FlowGraphBuilder builder(parsed_function, |
| 547 ic_data_array, | 547 ic_data_array, |
| 548 exit_collector, | 548 exit_collector, |
| 549 guarded_fields_, |
| 549 Isolate::kNoDeoptId); | 550 Isolate::kNoDeoptId); |
| 550 builder.SetInitialBlockId(caller_graph_->max_block_id()); | 551 builder.SetInitialBlockId(caller_graph_->max_block_id()); |
| 551 FlowGraph* callee_graph; | 552 FlowGraph* callee_graph; |
| 552 { | 553 { |
| 553 TimerScope timer(FLAG_compiler_stats, | 554 TimerScope timer(FLAG_compiler_stats, |
| 554 &CompilerStats::graphinliner_build_timer, | 555 &CompilerStats::graphinliner_build_timer, |
| 555 isolate); | 556 isolate); |
| 556 callee_graph = builder.BuildGraph(); | 557 callee_graph = builder.BuildGraph(); |
| 557 } | 558 } |
| 558 | 559 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 callee_graph->ComputeSSA(caller_graph_->max_virtual_register_number(), | 600 callee_graph->ComputeSSA(caller_graph_->max_virtual_register_number(), |
| 600 param_stubs); | 601 param_stubs); |
| 601 DEBUG_ASSERT(callee_graph->VerifyUseLists()); | 602 DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| 602 } | 603 } |
| 603 | 604 |
| 604 { | 605 { |
| 605 TimerScope timer(FLAG_compiler_stats, | 606 TimerScope timer(FLAG_compiler_stats, |
| 606 &CompilerStats::graphinliner_opt_timer, | 607 &CompilerStats::graphinliner_opt_timer, |
| 607 isolate); | 608 isolate); |
| 608 // TODO(zerny): Do more optimization passes on the callee graph. | 609 // TODO(zerny): Do more optimization passes on the callee graph. |
| 609 FlowGraphOptimizer optimizer(callee_graph, guarded_fields_); | 610 FlowGraphOptimizer optimizer(callee_graph); |
| 610 optimizer.ApplyICData(); | 611 optimizer.ApplyICData(); |
| 611 DEBUG_ASSERT(callee_graph->VerifyUseLists()); | 612 DEBUG_ASSERT(callee_graph->VerifyUseLists()); |
| 612 } | 613 } |
| 613 | 614 |
| 614 if (FLAG_trace_inlining && | 615 if (FLAG_trace_inlining && |
| 615 (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) { | 616 (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) { |
| 616 OS::Print("Callee graph for inlining %s\n", | 617 OS::Print("Callee graph for inlining %s\n", |
| 617 function.ToFullyQualifiedCString()); | 618 function.ToFullyQualifiedCString()); |
| 618 FlowGraphPrinter printer(*callee_graph); | 619 FlowGraphPrinter printer(*callee_graph); |
| 619 printer.PrintBlocks(); | 620 printer.PrintBlocks(); |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 OS::Print("After Inlining of %s\n", flow_graph_-> | 1443 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1443 parsed_function().function().ToFullyQualifiedCString()); | 1444 parsed_function().function().ToFullyQualifiedCString()); |
| 1444 FlowGraphPrinter printer(*flow_graph_); | 1445 FlowGraphPrinter printer(*flow_graph_); |
| 1445 printer.PrintBlocks(); | 1446 printer.PrintBlocks(); |
| 1446 } | 1447 } |
| 1447 } | 1448 } |
| 1448 } | 1449 } |
| 1449 } | 1450 } |
| 1450 | 1451 |
| 1451 } // namespace dart | 1452 } // namespace dart |
| OLD | NEW |