| 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 #ifndef VM_FLOW_GRAPH_H_ | 5 #ifndef VM_FLOW_GRAPH_H_ |
| 6 #define VM_FLOW_GRAPH_H_ | 6 #define VM_FLOW_GRAPH_H_ |
| 7 | 7 |
| 8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
| 9 #include "vm/hash_map.h" | 9 #include "vm/hash_map.h" |
| 10 #include "vm/intermediate_language.h" | 10 #include "vm/intermediate_language.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 public: | 84 public: |
| 85 FlowGraph(const FlowGraphBuilder& builder, | 85 FlowGraph(const FlowGraphBuilder& builder, |
| 86 GraphEntryInstr* graph_entry, | 86 GraphEntryInstr* graph_entry, |
| 87 intptr_t max_block_id); | 87 intptr_t max_block_id); |
| 88 | 88 |
| 89 const FlowGraphBuilder& builder() const { | 89 const FlowGraphBuilder& builder() const { |
| 90 return builder_; | 90 return builder_; |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Function properties. | 93 // Function properties. |
| 94 const ParsedFunction& parsed_function() const { | 94 ParsedFunction& parsed_function() const { |
| 95 return parsed_function_; | 95 return parsed_function_; |
| 96 } | 96 } |
| 97 intptr_t parameter_count() const { | 97 intptr_t parameter_count() const { |
| 98 return num_copied_params_ + num_non_copied_params_; | 98 return num_copied_params_ + num_non_copied_params_; |
| 99 } | 99 } |
| 100 intptr_t variable_count() const { | 100 intptr_t variable_count() const { |
| 101 return parameter_count() + num_stack_locals_; | 101 return parameter_count() + num_stack_locals_; |
| 102 } | 102 } |
| 103 intptr_t num_stack_locals() const { | 103 intptr_t num_stack_locals() const { |
| 104 return num_stack_locals_; | 104 return num_stack_locals_; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 310 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used |
| 311 // if/when computing SSA. | 311 // if/when computing SSA. |
| 312 GrowableArray<intptr_t> parent_; | 312 GrowableArray<intptr_t> parent_; |
| 313 GrowableArray<BitVector*> assigned_vars_; | 313 GrowableArray<BitVector*> assigned_vars_; |
| 314 | 314 |
| 315 intptr_t current_ssa_temp_index_; | 315 intptr_t current_ssa_temp_index_; |
| 316 intptr_t max_block_id_; | 316 intptr_t max_block_id_; |
| 317 | 317 |
| 318 // Flow graph fields. | 318 // Flow graph fields. |
| 319 const FlowGraphBuilder& builder_; | 319 const FlowGraphBuilder& builder_; |
| 320 const ParsedFunction& parsed_function_; | 320 ParsedFunction& parsed_function_; |
| 321 const intptr_t num_copied_params_; | 321 const intptr_t num_copied_params_; |
| 322 const intptr_t num_non_copied_params_; | 322 const intptr_t num_non_copied_params_; |
| 323 const intptr_t num_stack_locals_; | 323 const intptr_t num_stack_locals_; |
| 324 GraphEntryInstr* graph_entry_; | 324 GraphEntryInstr* graph_entry_; |
| 325 GrowableArray<BlockEntryInstr*> preorder_; | 325 GrowableArray<BlockEntryInstr*> preorder_; |
| 326 GrowableArray<BlockEntryInstr*> postorder_; | 326 GrowableArray<BlockEntryInstr*> postorder_; |
| 327 GrowableArray<BlockEntryInstr*> reverse_postorder_; | 327 GrowableArray<BlockEntryInstr*> reverse_postorder_; |
| 328 GrowableArray<BlockEntryInstr*> optimized_block_order_; | 328 GrowableArray<BlockEntryInstr*> optimized_block_order_; |
| 329 ConstantInstr* constant_null_; | 329 ConstantInstr* constant_null_; |
| 330 ConstantInstr* constant_dead_; | 330 ConstantInstr* constant_dead_; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 // Per block sets of available blocks. Block A is available at the block B if | 439 // Per block sets of available blocks. Block A is available at the block B if |
| 440 // and only if A dominates B and all paths from A to B are free of side | 440 // and only if A dominates B and all paths from A to B are free of side |
| 441 // effects. | 441 // effects. |
| 442 GrowableArray<BitVector*> available_at_; | 442 GrowableArray<BitVector*> available_at_; |
| 443 }; | 443 }; |
| 444 | 444 |
| 445 | 445 |
| 446 } // namespace dart | 446 } // namespace dart |
| 447 | 447 |
| 448 #endif // VM_FLOW_GRAPH_H_ | 448 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |