OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #ifndef RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ | 5 #ifndef RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ |
6 #define RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ | 6 #define RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class FlowGraphInliner : ValueObject { | 25 class FlowGraphInliner : ValueObject { |
26 public: | 26 public: |
27 FlowGraphInliner(FlowGraph* flow_graph, | 27 FlowGraphInliner(FlowGraph* flow_graph, |
28 GrowableArray<const Function*>* inline_id_to_function, | 28 GrowableArray<const Function*>* inline_id_to_function, |
29 GrowableArray<TokenPosition>* inline_id_to_token_pos, | 29 GrowableArray<TokenPosition>* inline_id_to_token_pos, |
30 GrowableArray<intptr_t>* caller_inline_id, | 30 GrowableArray<intptr_t>* caller_inline_id, |
31 bool use_speculative_inlining, | 31 bool use_speculative_inlining, |
32 GrowableArray<intptr_t>* inlining_black_list, | 32 GrowableArray<intptr_t>* inlining_black_list, |
33 Precompiler* precompiler); | 33 Precompiler* precompiler); |
34 | 34 |
35 // The flow graph is destructively updated upon inlining. | 35 // The flow graph is destructively updated upon inlining. Returns the max |
36 void Inline(); | 36 // depth that we inlined. |
| 37 int Inline(); |
37 | 38 |
38 // Compute graph info if it was not already computed or if 'force' is true. | 39 // Compute graph info if it was not already computed or if 'force' is true. |
39 static void CollectGraphInfo(FlowGraph* flow_graph, bool force = false); | 40 static void CollectGraphInfo(FlowGraph* flow_graph, bool force = false); |
40 static void SetInliningId(FlowGraph* flow_graph, intptr_t inlining_id); | 41 static void SetInliningId(FlowGraph* flow_graph, intptr_t inlining_id); |
41 | 42 |
42 bool AlwaysInline(const Function& function); | 43 bool AlwaysInline(const Function& function); |
43 | 44 |
44 FlowGraph* flow_graph() const { return flow_graph_; } | 45 FlowGraph* flow_graph() const { return flow_graph_; } |
45 intptr_t NextInlineId(const Function& function, | 46 intptr_t NextInlineId(const Function& function, |
46 TokenPosition tp, | 47 TokenPosition tp, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const bool use_speculative_inlining_; | 82 const bool use_speculative_inlining_; |
82 GrowableArray<intptr_t>* inlining_black_list_; | 83 GrowableArray<intptr_t>* inlining_black_list_; |
83 Precompiler* precompiler_; | 84 Precompiler* precompiler_; |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner); | 86 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace dart | 89 } // namespace dart |
89 | 90 |
90 #endif // RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ | 91 #endif // RUNTIME_VM_COMPILER_BACKEND_INLINER_H_ |
OLD | NEW |