| 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 VM_FLOW_GRAPH_INLINER_H_ | 5 #ifndef VM_FLOW_GRAPH_INLINER_H_ |
| 6 #define VM_FLOW_GRAPH_INLINER_H_ | 6 #define VM_FLOW_GRAPH_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 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 class Definition; | 13 class Definition; |
| 14 class Field; | 14 class Field; |
| 15 class FlowGraph; | 15 class FlowGraph; |
| 16 class ForwardInstructionIterator; | 16 class ForwardInstructionIterator; |
| 17 class Function; | 17 class Function; |
| 18 class InstanceCallInstr; | 18 class InstanceCallInstr; |
| 19 class Instruction; | 19 class Instruction; |
| 20 class StaticCallInstr; |
| 20 class TargetEntryInstr; | 21 class TargetEntryInstr; |
| 21 | 22 |
| 22 class FlowGraphInliner : ValueObject { | 23 class FlowGraphInliner : ValueObject { |
| 23 public: | 24 public: |
| 24 FlowGraphInliner(FlowGraph* flow_graph, | 25 FlowGraphInliner(FlowGraph* flow_graph, |
| 25 GrowableArray<const Function*>* inline_id_to_function, | 26 GrowableArray<const Function*>* inline_id_to_function, |
| 26 GrowableArray<TokenPosition>* inline_id_to_token_pos, | 27 GrowableArray<TokenPosition>* inline_id_to_token_pos, |
| 27 GrowableArray<intptr_t>* caller_inline_id, | 28 GrowableArray<intptr_t>* caller_inline_id, |
| 28 bool use_speculative_inlining, | 29 bool use_speculative_inlining, |
| 29 GrowableArray<intptr_t>* inlining_black_list); | 30 GrowableArray<intptr_t>* inlining_black_list); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 42 TokenPosition tp, | 43 TokenPosition tp, |
| 43 intptr_t caller_id); | 44 intptr_t caller_id); |
| 44 | 45 |
| 45 bool trace_inlining() const { return trace_inlining_; } | 46 bool trace_inlining() const { return trace_inlining_; } |
| 46 | 47 |
| 47 static bool TryReplaceInstanceCallWithInline( | 48 static bool TryReplaceInstanceCallWithInline( |
| 48 FlowGraph* flow_graph, | 49 FlowGraph* flow_graph, |
| 49 ForwardInstructionIterator* iterator, | 50 ForwardInstructionIterator* iterator, |
| 50 InstanceCallInstr* call); | 51 InstanceCallInstr* call); |
| 51 | 52 |
| 53 static bool TryReplaceStaticCallWithInline( |
| 54 FlowGraph* flow_graph, |
| 55 ForwardInstructionIterator* iterator, |
| 56 StaticCallInstr* call); |
| 57 |
| 52 static bool TryInlineRecognizedMethod(FlowGraph* flow_graph, | 58 static bool TryInlineRecognizedMethod(FlowGraph* flow_graph, |
| 53 intptr_t receiver_cid, | 59 intptr_t receiver_cid, |
| 54 const Function& target, | 60 const Function& target, |
| 55 Instruction* call, | 61 Instruction* call, |
| 56 Definition* receiver, | 62 Definition* receiver, |
| 57 TokenPosition token_pos, | 63 TokenPosition token_pos, |
| 58 const ICData& ic_data, | 64 const ICData& ic_data, |
| 59 TargetEntryInstr** entry, | 65 TargetEntryInstr** entry, |
| 60 Definition** last); | 66 Definition** last); |
| 61 | 67 |
| 62 bool use_speculative_inlining() const { return use_speculative_inlining_; } | 68 bool use_speculative_inlining() const { return use_speculative_inlining_; } |
| 63 | 69 |
| 64 private: | 70 private: |
| 65 friend class CallSiteInliner; | 71 friend class CallSiteInliner; |
| 66 | 72 |
| 67 FlowGraph* flow_graph_; | 73 FlowGraph* flow_graph_; |
| 68 GrowableArray<const Function*>* inline_id_to_function_; | 74 GrowableArray<const Function*>* inline_id_to_function_; |
| 69 GrowableArray<TokenPosition>* inline_id_to_token_pos_; | 75 GrowableArray<TokenPosition>* inline_id_to_token_pos_; |
| 70 GrowableArray<intptr_t>* caller_inline_id_; | 76 GrowableArray<intptr_t>* caller_inline_id_; |
| 71 const bool trace_inlining_; | 77 const bool trace_inlining_; |
| 72 const bool use_speculative_inlining_; | 78 const bool use_speculative_inlining_; |
| 73 GrowableArray<intptr_t>* inlining_black_list_; | 79 GrowableArray<intptr_t>* inlining_black_list_; |
| 74 | 80 |
| 75 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner); | 81 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner); |
| 76 }; | 82 }; |
| 77 | 83 |
| 78 } // namespace dart | 84 } // namespace dart |
| 79 | 85 |
| 80 #endif // VM_FLOW_GRAPH_INLINER_H_ | 86 #endif // VM_FLOW_GRAPH_INLINER_H_ |
| OLD | NEW |