| 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_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/parser.h" | 9 #include "vm/parser.h" | 
| 10 | 10 | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 42 // Class to incapsulate the construction and manipulation of the flow graph. | 42 // Class to incapsulate the construction and manipulation of the flow graph. | 
| 43 class FlowGraph: public ZoneAllocated { | 43 class FlowGraph: public ZoneAllocated { | 
| 44  public: | 44  public: | 
| 45   FlowGraph(const FlowGraphBuilder& builder, GraphEntryInstr* graph_entry); | 45   FlowGraph(const FlowGraphBuilder& builder, GraphEntryInstr* graph_entry); | 
| 46 | 46 | 
| 47   // Function properties. | 47   // Function properties. | 
| 48   const ParsedFunction& parsed_function() const { | 48   const ParsedFunction& parsed_function() const { | 
| 49     return parsed_function_; | 49     return parsed_function_; | 
| 50   } | 50   } | 
| 51   intptr_t parameter_count() const { | 51   intptr_t parameter_count() const { | 
| 52     return copied_parameter_count_ + non_copied_parameter_count_; | 52     return num_copied_params_ + num_non_copied_params_; | 
| 53   } | 53   } | 
| 54   intptr_t variable_count() const { | 54   intptr_t variable_count() const { | 
| 55     return parameter_count() + stack_local_count_; | 55     return parameter_count() + num_stack_locals_; | 
| 56   } | 56   } | 
| 57   intptr_t stack_local_count() const { | 57   intptr_t num_stack_locals() const { | 
| 58     return stack_local_count_; | 58     return num_stack_locals_; | 
| 59   } | 59   } | 
| 60   intptr_t copied_parameter_count() const { | 60   intptr_t num_copied_params() const { | 
| 61     return copied_parameter_count_; | 61     return num_copied_params_; | 
| 62   } | 62   } | 
| 63   intptr_t non_copied_parameter_count() const { | 63   intptr_t num_non_copied_params() const { | 
| 64     return non_copied_parameter_count_; | 64     return num_non_copied_params_; | 
| 65   } | 65   } | 
| 66 | 66 | 
| 67   // Flow graph orders. | 67   // Flow graph orders. | 
| 68   const GrowableArray<BlockEntryInstr*>& preorder() const { | 68   const GrowableArray<BlockEntryInstr*>& preorder() const { | 
| 69     return preorder_; | 69     return preorder_; | 
| 70   } | 70   } | 
| 71   const GrowableArray<BlockEntryInstr*>& postorder() const { | 71   const GrowableArray<BlockEntryInstr*>& postorder() const { | 
| 72     return postorder_; | 72     return postorder_; | 
| 73   } | 73   } | 
| 74   const GrowableArray<BlockEntryInstr*>& reverse_postorder() const { | 74   const GrowableArray<BlockEntryInstr*>& reverse_postorder() const { | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 147 | 147 | 
| 148   // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 148   // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 
| 149   // if/when computing SSA. | 149   // if/when computing SSA. | 
| 150   GrowableArray<intptr_t> parent_; | 150   GrowableArray<intptr_t> parent_; | 
| 151   GrowableArray<BitVector*> assigned_vars_; | 151   GrowableArray<BitVector*> assigned_vars_; | 
| 152 | 152 | 
| 153   intptr_t current_ssa_temp_index_; | 153   intptr_t current_ssa_temp_index_; | 
| 154 | 154 | 
| 155   // Flow graph fields. | 155   // Flow graph fields. | 
| 156   const ParsedFunction& parsed_function_; | 156   const ParsedFunction& parsed_function_; | 
| 157   const intptr_t copied_parameter_count_; | 157   const intptr_t num_copied_params_; | 
| 158   const intptr_t non_copied_parameter_count_; | 158   const intptr_t num_non_copied_params_; | 
| 159   const intptr_t stack_local_count_; | 159   const intptr_t num_stack_locals_; | 
| 160   GraphEntryInstr* graph_entry_; | 160   GraphEntryInstr* graph_entry_; | 
| 161   GrowableArray<BlockEntryInstr*> preorder_; | 161   GrowableArray<BlockEntryInstr*> preorder_; | 
| 162   GrowableArray<BlockEntryInstr*> postorder_; | 162   GrowableArray<BlockEntryInstr*> postorder_; | 
| 163   GrowableArray<BlockEntryInstr*> reverse_postorder_; | 163   GrowableArray<BlockEntryInstr*> reverse_postorder_; | 
| 164   ZoneGrowableArray<ReturnInstr*>* exits_; | 164   ZoneGrowableArray<ReturnInstr*>* exits_; | 
| 165 }; | 165 }; | 
| 166 | 166 | 
| 167 }  // namespace dart | 167 }  // namespace dart | 
| 168 | 168 | 
| 169 #endif  // VM_FLOW_GRAPH_H_ | 169 #endif  // VM_FLOW_GRAPH_H_ | 
| OLD | NEW | 
|---|