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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. | 615 // Functions can be inlined before they are optimized. |
616 // If not yet present, allocate deoptimization history array. | 616 // If not yet present, allocate deoptimization history array. |
617 Array& deopt_history = Array::Handle(function.deopt_history()); | 617 function.EnsureDeoptHistory(); |
618 if (deopt_history.IsNull()) { | |
619 deopt_history = Array::New(FLAG_deoptimization_counter_threshold); | |
620 function.set_deopt_history(deopt_history); | |
621 } | |
622 | 618 |
623 // Build succeeded so we restore the bailout jump. | 619 // Build succeeded so we restore the bailout jump. |
624 inlined_ = true; | 620 inlined_ = true; |
625 inlined_size_ += size; | 621 inlined_size_ += size; |
626 isolate->set_long_jump_base(base); | 622 isolate->set_long_jump_base(base); |
627 isolate->set_deopt_id(prev_deopt_id); | 623 isolate->set_deopt_id(prev_deopt_id); |
628 | 624 |
629 call_data->callee_graph = callee_graph; | 625 call_data->callee_graph = callee_graph; |
630 call_data->parameter_stubs = param_stubs; | 626 call_data->parameter_stubs = param_stubs; |
631 call_data->exit_collector = exit_collector; | 627 call_data->exit_collector = exit_collector; |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 OS::Print("After Inlining of %s\n", flow_graph_-> | 1339 OS::Print("After Inlining of %s\n", flow_graph_-> |
1344 parsed_function().function().ToFullyQualifiedCString()); | 1340 parsed_function().function().ToFullyQualifiedCString()); |
1345 FlowGraphPrinter printer(*flow_graph_); | 1341 FlowGraphPrinter printer(*flow_graph_); |
1346 printer.PrintBlocks(); | 1342 printer.PrintBlocks(); |
1347 } | 1343 } |
1348 } | 1344 } |
1349 } | 1345 } |
1350 } | 1346 } |
1351 | 1347 |
1352 } // namespace dart | 1348 } // namespace dart |
OLD | NEW |