| 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_BUILDER_H_ | 5 #ifndef VM_FLOW_GRAPH_BUILDER_H_ |
| 6 #define VM_FLOW_GRAPH_BUILDER_H_ | 6 #define VM_FLOW_GRAPH_BUILDER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 Instruction* entry() const { return entry_; } | 107 Instruction* entry() const { return entry_; } |
| 108 Instruction* exit() const { return exit_; } | 108 Instruction* exit() const { return exit_; } |
| 109 | 109 |
| 110 bool is_empty() const { return entry_ == NULL; } | 110 bool is_empty() const { return entry_ == NULL; } |
| 111 bool is_open() const { return is_empty() || exit_ != NULL; } | 111 bool is_open() const { return is_empty() || exit_ != NULL; } |
| 112 | 112 |
| 113 void Bailout(const char* reason); | 113 void Bailout(const char* reason); |
| 114 | 114 |
| 115 // Append a graph fragment to this graph. Assumes this graph is open. | 115 // Append a graph fragment to this graph. Assumes this graph is open. |
| 116 void Append(const EffectGraphVisitor& other_fragment); | 116 void Append(const EffectGraphVisitor& other_fragment); |
| 117 // Append a single instruction. Assumes this graph is open. | 117 // Append a single instruction. Assumes this graph is open. Can not be a |
| 118 // block entry instruction. |
| 118 void AddInstruction(Instruction* instruction); | 119 void AddInstruction(Instruction* instruction); |
| 119 | 120 |
| 121 // Append a new block entry to the graph. |
| 122 void AddBlockEntry(BlockEntryInstr* successor); |
| 123 |
| 120 // Append a 'diamond' branch and join to this graph, depending on which | 124 // Append a 'diamond' branch and join to this graph, depending on which |
| 121 // parts are reachable. Assumes this graph is open. | 125 // parts are reachable. Assumes this graph is open. |
| 122 void Join(const TestGraphVisitor& test_fragment, | 126 void Join(const TestGraphVisitor& test_fragment, |
| 123 const EffectGraphVisitor& true_fragment, | 127 const EffectGraphVisitor& true_fragment, |
| 124 const EffectGraphVisitor& false_fragment); | 128 const EffectGraphVisitor& false_fragment); |
| 125 | 129 |
| 126 // Append a 'while loop' test and back edge to this graph, depending on | 130 // Append a 'while loop' test and back edge to this graph, depending on |
| 127 // which parts are reachable. Afterward, the graph exit is the false | 131 // which parts are reachable. Afterward, the graph exit is the false |
| 128 // successor of the loop condition. | 132 // successor of the loop condition. |
| 129 void TieLoop(const TestGraphVisitor& test_fragment, | 133 void TieLoop(const TestGraphVisitor& test_fragment, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // Output parameters. | 331 // Output parameters. |
| 328 TargetEntryInstr** true_successor_address_; | 332 TargetEntryInstr** true_successor_address_; |
| 329 TargetEntryInstr** false_successor_address_; | 333 TargetEntryInstr** false_successor_address_; |
| 330 | 334 |
| 331 intptr_t condition_token_pos_; | 335 intptr_t condition_token_pos_; |
| 332 }; | 336 }; |
| 333 | 337 |
| 334 } // namespace dart | 338 } // namespace dart |
| 335 | 339 |
| 336 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 340 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |