| 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_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 return parallel_move_ != NULL; | 1172 return parallel_move_ != NULL; |
| 1173 } | 1173 } |
| 1174 | 1174 |
| 1175 ParallelMoveInstr* GetParallelMove() { | 1175 ParallelMoveInstr* GetParallelMove() { |
| 1176 if (parallel_move_ == NULL) { | 1176 if (parallel_move_ == NULL) { |
| 1177 parallel_move_ = new ParallelMoveInstr(); | 1177 parallel_move_ = new ParallelMoveInstr(); |
| 1178 } | 1178 } |
| 1179 return parallel_move_; | 1179 return parallel_move_; |
| 1180 } | 1180 } |
| 1181 | 1181 |
| 1182 bool IsEmptyBlock(); | |
| 1183 | |
| 1184 // Discover basic-block structure by performing a recursive depth first | 1182 // Discover basic-block structure by performing a recursive depth first |
| 1185 // traversal of the instruction graph reachable from this instruction. As | 1183 // traversal of the instruction graph reachable from this instruction. As |
| 1186 // a side effect, the block entry instructions in the graph are assigned | 1184 // a side effect, the block entry instructions in the graph are assigned |
| 1187 // numbers in both preorder and postorder. The array 'preorder' maps | 1185 // numbers in both preorder and postorder. The array 'preorder' maps |
| 1188 // preorder block numbers to the block entry instruction with that number | 1186 // preorder block numbers to the block entry instruction with that number |
| 1189 // and analogously for the array 'postorder'. The depth first spanning | 1187 // and analogously for the array 'postorder'. The depth first spanning |
| 1190 // tree is recorded in the array 'parent', which maps preorder block | 1188 // tree is recorded in the array 'parent', which maps preorder block |
| 1191 // numbers to the preorder number of the block's spanning-tree parent. | 1189 // numbers to the preorder number of the block's spanning-tree parent. |
| 1192 // The array 'assigned_vars' maps preorder block numbers to the set of | 1190 // The array 'assigned_vars' maps preorder block numbers to the set of |
| 1193 // assigned frame-allocated local variables in the block. As a side | 1191 // assigned frame-allocated local variables in the block. As a side |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 return const_cast<BlockEntryInstr*>(this); | 1245 return const_cast<BlockEntryInstr*>(this); |
| 1248 } | 1246 } |
| 1249 | 1247 |
| 1250 // Helper to mutate the graph during inlining. This block should be | 1248 // Helper to mutate the graph during inlining. This block should be |
| 1251 // replaced with new_block as a predecessor of all of this block's | 1249 // replaced with new_block as a predecessor of all of this block's |
| 1252 // successors. | 1250 // successors. |
| 1253 void ReplaceAsPredecessorWith(BlockEntryInstr* new_block); | 1251 void ReplaceAsPredecessorWith(BlockEntryInstr* new_block); |
| 1254 | 1252 |
| 1255 void set_block_id(intptr_t block_id) { block_id_ = block_id; } | 1253 void set_block_id(intptr_t block_id) { block_id_ = block_id; } |
| 1256 | 1254 |
| 1257 // For all instruction in this block: Remove all inputs (including in the | |
| 1258 // environment) from their definition's use lists for all instructions. | |
| 1259 void ClearAllInstructions(); | |
| 1260 | |
| 1261 protected: | 1255 protected: |
| 1262 BlockEntryInstr(intptr_t block_id, intptr_t try_index) | 1256 BlockEntryInstr(intptr_t block_id, intptr_t try_index) |
| 1263 : block_id_(block_id), | 1257 : block_id_(block_id), |
| 1264 try_index_(try_index), | 1258 try_index_(try_index), |
| 1265 preorder_number_(-1), | 1259 preorder_number_(-1), |
| 1266 postorder_number_(-1), | 1260 postorder_number_(-1), |
| 1267 dominator_(NULL), | 1261 dominator_(NULL), |
| 1268 dominated_blocks_(1), | 1262 dominated_blocks_(1), |
| 1269 last_instruction_(NULL), | 1263 last_instruction_(NULL), |
| 1270 parallel_move_(NULL), | 1264 parallel_move_(NULL), |
| (...skipping 5538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6809 ForwardInstructionIterator* current_iterator_; | 6803 ForwardInstructionIterator* current_iterator_; |
| 6810 | 6804 |
| 6811 private: | 6805 private: |
| 6812 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6806 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6813 }; | 6807 }; |
| 6814 | 6808 |
| 6815 | 6809 |
| 6816 } // namespace dart | 6810 } // namespace dart |
| 6817 | 6811 |
| 6818 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6812 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |