Chromium Code Reviews| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 619 function.deoptimization_counter())); | 619 function.deoptimization_counter())); |
| 620 | 620 |
| 621 // Abort if the inlinable bit on the function is low. | 621 // Abort if the inlinable bit on the function is low. |
| 622 if (!function.CanBeInlined()) { | 622 if (!function.CanBeInlined()) { |
| 623 TRACE_INLINING(THR_Print(" Bailout: not inlinable\n")); | 623 TRACE_INLINING(THR_Print(" Bailout: not inlinable\n")); |
| 624 PRINT_INLINING_TREE("Not inlinable", | 624 PRINT_INLINING_TREE("Not inlinable", |
| 625 &call_data->caller, &function, call_data->call); | 625 &call_data->caller, &function, call_data->call); |
| 626 return false; | 626 return false; |
| 627 } | 627 } |
| 628 | 628 |
| 629 // Function has not beed compiled yet. With lazy compilation a function | |
| 630 // that has not been executed won't have any type feedback. In | |
| 631 // precompilation mode we don't rely on type feedback. | |
|
srdjan
2015/10/21 17:37:46
This can be a problem for Siva's change where we s
rmacnak
2015/10/21 18:00:30
Can this check if the function has an ic data arra
Florian Schneider
2015/10/22 13:59:25
I would opt for checking the ic data array, but I
srdjan
2015/10/22 15:31:26
OK, to replicate current behavior. CC-ing Siva to
| |
| 632 if (!Compiler::always_optimize() && !function.HasCode()) { | |
| 633 TRACE_INLINING(THR_Print(" Bailout: not compiled yet\n")); | |
| 634 PRINT_INLINING_TREE("Not compiled", | |
| 635 &call_data->caller, &function, call_data->call); | |
| 636 return false; | |
| 637 } | |
| 638 | |
| 629 // Abort if this function has deoptimized too much. | 639 // Abort if this function has deoptimized too much. |
| 630 if (function.deoptimization_counter() >= | 640 if (function.deoptimization_counter() >= |
| 631 FLAG_deoptimization_counter_threshold) { | 641 FLAG_deoptimization_counter_threshold) { |
| 632 function.set_is_inlinable(false); | 642 function.set_is_inlinable(false); |
| 633 TRACE_INLINING(THR_Print(" Bailout: deoptimization threshold\n")); | 643 TRACE_INLINING(THR_Print(" Bailout: deoptimization threshold\n")); |
| 634 PRINT_INLINING_TREE("Deoptimization threshold exceeded", | 644 PRINT_INLINING_TREE("Deoptimization threshold exceeded", |
| 635 &call_data->caller, &function, call_data->call); | 645 &call_data->caller, &function, call_data->call); |
| 636 return false; | 646 return false; |
| 637 } | 647 } |
| 638 | 648 |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1883 intptr_t FlowGraphInliner::NextInlineId(const Function& function, | 1893 intptr_t FlowGraphInliner::NextInlineId(const Function& function, |
| 1884 intptr_t parent_id) { | 1894 intptr_t parent_id) { |
| 1885 const intptr_t id = inline_id_to_function_->length(); | 1895 const intptr_t id = inline_id_to_function_->length(); |
| 1886 inline_id_to_function_->Add(&function); | 1896 inline_id_to_function_->Add(&function); |
| 1887 caller_inline_id_->Add(parent_id); | 1897 caller_inline_id_->Add(parent_id); |
| 1888 return id; | 1898 return id; |
| 1889 } | 1899 } |
| 1890 | 1900 |
| 1891 | 1901 |
| 1892 } // namespace dart | 1902 } // namespace dart |
| OLD | NEW |