| 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/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 605 } |
| 606 | 606 |
| 607 // If depth is less or equal to threshold recursively add call sites. | 607 // If depth is less or equal to threshold recursively add call sites. |
| 608 if (inlining_depth_ < FLAG_inlining_depth_threshold) { | 608 if (inlining_depth_ < FLAG_inlining_depth_threshold) { |
| 609 collected_call_sites_->FindCallSites(callee_graph); | 609 collected_call_sites_->FindCallSites(callee_graph); |
| 610 } | 610 } |
| 611 | 611 |
| 612 // Add the function to the cache. | 612 // Add the function to the cache. |
| 613 if (!in_cache) function_cache_.Add(parsed_function); | 613 if (!in_cache) function_cache_.Add(parsed_function); |
| 614 | 614 |
| 615 // Functions can be inlined before they are optimized. | |
| 616 // If not yet present, allocate deoptimization history array. | |
| 617 function.EnsureDeoptHistory(); | |
| 618 | |
| 619 // Build succeeded so we restore the bailout jump. | 615 // Build succeeded so we restore the bailout jump. |
| 620 inlined_ = true; | 616 inlined_ = true; |
| 621 inlined_size_ += size; | 617 inlined_size_ += size; |
| 622 isolate->set_long_jump_base(base); | 618 isolate->set_long_jump_base(base); |
| 623 isolate->set_deopt_id(prev_deopt_id); | 619 isolate->set_deopt_id(prev_deopt_id); |
| 624 | 620 |
| 625 call_data->callee_graph = callee_graph; | 621 call_data->callee_graph = callee_graph; |
| 626 call_data->parameter_stubs = param_stubs; | 622 call_data->parameter_stubs = param_stubs; |
| 627 call_data->exit_collector = exit_collector; | 623 call_data->exit_collector = exit_collector; |
| 628 TRACE_INLINING(OS::Print(" Success\n")); | 624 TRACE_INLINING(OS::Print(" Success\n")); |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 OS::Print("After Inlining of %s\n", flow_graph_-> | 1338 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1343 parsed_function().function().ToFullyQualifiedCString()); | 1339 parsed_function().function().ToFullyQualifiedCString()); |
| 1344 FlowGraphPrinter printer(*flow_graph_); | 1340 FlowGraphPrinter printer(*flow_graph_); |
| 1345 printer.PrintBlocks(); | 1341 printer.PrintBlocks(); |
| 1346 } | 1342 } |
| 1347 } | 1343 } |
| 1348 } | 1344 } |
| 1349 } | 1345 } |
| 1350 | 1346 |
| 1351 } // namespace dart | 1347 } // namespace dart |
| OLD | NEW |