| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 static_cast<double>(initial_size_); | 406 static_cast<double>(initial_size_); |
| 407 } | 407 } |
| 408 | 408 |
| 409 bool TryInlining(const Function& function, | 409 bool TryInlining(const Function& function, |
| 410 const Array& argument_names, | 410 const Array& argument_names, |
| 411 InlinedCallData* call_data) { | 411 InlinedCallData* call_data) { |
| 412 TRACE_INLINING(OS::Print(" => %s (deopt count %d)\n", | 412 TRACE_INLINING(OS::Print(" => %s (deopt count %d)\n", |
| 413 function.ToCString(), | 413 function.ToCString(), |
| 414 function.deoptimization_counter())); | 414 function.deoptimization_counter())); |
| 415 | 415 |
| 416 // TODO(fschneider): Enable inlining inside try-blocks. |
| 417 if (call_data->call->GetBlock()->try_index() != |
| 418 CatchClauseNode::kInvalidTryIndex) { |
| 419 TRACE_INLINING(OS::Print(" Bailout: inside try-block\n")); |
| 420 return false; |
| 421 } |
| 422 |
| 416 // Abort if the inlinable bit on the function is low. | 423 // Abort if the inlinable bit on the function is low. |
| 417 if (!function.IsInlineable()) { | 424 if (!function.IsInlineable()) { |
| 418 TRACE_INLINING(OS::Print(" Bailout: not inlinable\n")); | 425 TRACE_INLINING(OS::Print(" Bailout: not inlinable\n")); |
| 419 return false; | 426 return false; |
| 420 } | 427 } |
| 421 | 428 |
| 422 // Abort if this function has deoptimized too much. | 429 // Abort if this function has deoptimized too much. |
| 423 if (function.deoptimization_counter() >= | 430 if (function.deoptimization_counter() >= |
| 424 FLAG_deoptimization_counter_threshold) { | 431 FLAG_deoptimization_counter_threshold) { |
| 425 function.set_is_inlinable(false); | 432 function.set_is_inlinable(false); |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 OS::Print("After Inlining of %s\n", flow_graph_-> | 1336 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1330 parsed_function().function().ToFullyQualifiedCString()); | 1337 parsed_function().function().ToFullyQualifiedCString()); |
| 1331 FlowGraphPrinter printer(*flow_graph_); | 1338 FlowGraphPrinter printer(*flow_graph_); |
| 1332 printer.PrintBlocks(); | 1339 printer.PrintBlocks(); |
| 1333 } | 1340 } |
| 1334 } | 1341 } |
| 1335 } | 1342 } |
| 1336 } | 1343 } |
| 1337 | 1344 |
| 1338 } // namespace dart | 1345 } // namespace dart |
| OLD | NEW |