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 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 Instruction* current = it.Current(); | 1812 Instruction* current = it.Current(); |
1813 // Do not overwrite owner function. | 1813 // Do not overwrite owner function. |
1814 ASSERT(!current->has_inlining_id()); | 1814 ASSERT(!current->has_inlining_id()); |
1815 current->set_inlining_id(inlining_id); | 1815 current->set_inlining_id(inlining_id); |
1816 } | 1816 } |
1817 } | 1817 } |
1818 } | 1818 } |
1819 | 1819 |
1820 | 1820 |
1821 // Use function name to determine if inlineable operator. | 1821 // Use function name to determine if inlineable operator. |
1822 // TODO(srdjan): add names as necessary | 1822 // Add names as necessary. |
1823 static bool IsInlineableOperator(const Function& function) { | 1823 static bool IsInlineableOperator(const Function& function) { |
1824 return (function.name() == Symbols::IndexToken().raw()) || | 1824 return (function.name() == Symbols::IndexToken().raw()) || |
1825 (function.name() == Symbols::AssignIndexToken().raw()) || | 1825 (function.name() == Symbols::AssignIndexToken().raw()) || |
1826 (function.name() == Symbols::Plus().raw()) || | 1826 (function.name() == Symbols::Plus().raw()) || |
1827 (function.name() == Symbols::Minus().raw()); | 1827 (function.name() == Symbols::Minus().raw()); |
1828 } | 1828 } |
1829 | 1829 |
1830 | 1830 |
1831 bool FlowGraphInliner::AlwaysInline(const Function& function) { | 1831 bool FlowGraphInliner::AlwaysInline(const Function& function) { |
1832 const char* kAlwaysInlineAnnotation = "AlwaysInline"; | 1832 const char* kAlwaysInlineAnnotation = "AlwaysInline"; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 intptr_t FlowGraphInliner::NextInlineId(const Function& function, | 1894 intptr_t FlowGraphInliner::NextInlineId(const Function& function, |
1895 intptr_t parent_id) { | 1895 intptr_t parent_id) { |
1896 const intptr_t id = inline_id_to_function_->length(); | 1896 const intptr_t id = inline_id_to_function_->length(); |
1897 inline_id_to_function_->Add(&function); | 1897 inline_id_to_function_->Add(&function); |
1898 caller_inline_id_->Add(parent_id); | 1898 caller_inline_id_->Add(parent_id); |
1899 return id; | 1899 return id; |
1900 } | 1900 } |
1901 | 1901 |
1902 | 1902 |
1903 } // namespace dart | 1903 } // namespace dart |
OLD | NEW |