| 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 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 push->ReplaceUsesWith(push->value()->definition()); | 1685 push->ReplaceUsesWith(push->value()->definition()); |
| 1686 push->RemoveFromGraph(); | 1686 push->RemoveFromGraph(); |
| 1687 } | 1687 } |
| 1688 } | 1688 } |
| 1689 return entry; | 1689 return entry; |
| 1690 } | 1690 } |
| 1691 | 1691 |
| 1692 | 1692 |
| 1693 void PolymorphicInliner::Inline() { | 1693 void PolymorphicInliner::Inline() { |
| 1694 // Consider the polymorphic variants in order by frequency. | 1694 // Consider the polymorphic variants in order by frequency. |
| 1695 FlowGraphCompiler::SortICDataByCount(call_->ic_data(), &variants_); | 1695 FlowGraphCompiler::SortICDataByCount(call_->ic_data(), |
| 1696 &variants_, |
| 1697 /* drop_smi = */ false); |
| 1696 for (intptr_t var_idx = 0; var_idx < variants_.length(); ++var_idx) { | 1698 for (intptr_t var_idx = 0; var_idx < variants_.length(); ++var_idx) { |
| 1697 const Function& target = *variants_[var_idx].target; | 1699 const Function& target = *variants_[var_idx].target; |
| 1698 const intptr_t receiver_cid = variants_[var_idx].cid; | 1700 const intptr_t receiver_cid = variants_[var_idx].cid; |
| 1699 | 1701 |
| 1700 // First check if this is the same target as an earlier inlined variant. | 1702 // First check if this is the same target as an earlier inlined variant. |
| 1701 if (CheckInlinedDuplicate(target)) { | 1703 if (CheckInlinedDuplicate(target)) { |
| 1702 inlined_variants_.Add(variants_[var_idx]); | 1704 inlined_variants_.Add(variants_[var_idx]); |
| 1703 continue; | 1705 continue; |
| 1704 } | 1706 } |
| 1705 | 1707 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1828 | 1830 |
| 1829 | 1831 |
| 1830 intptr_t FlowGraphInliner::NextInlineId(const Function& function) { | 1832 intptr_t FlowGraphInliner::NextInlineId(const Function& function) { |
| 1831 const intptr_t id = inline_id_to_function_->length(); | 1833 const intptr_t id = inline_id_to_function_->length(); |
| 1832 inline_id_to_function_->Add(&function); | 1834 inline_id_to_function_->Add(&function); |
| 1833 return id; | 1835 return id; |
| 1834 } | 1836 } |
| 1835 | 1837 |
| 1836 | 1838 |
| 1837 } // namespace dart | 1839 } // namespace dart |
| OLD | NEW |