| 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 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 return parallel_move_ != NULL; | 1138 return parallel_move_ != NULL; |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 ParallelMoveInstr* GetParallelMove() { | 1141 ParallelMoveInstr* GetParallelMove() { |
| 1142 if (parallel_move_ == NULL) { | 1142 if (parallel_move_ == NULL) { |
| 1143 parallel_move_ = new ParallelMoveInstr(); | 1143 parallel_move_ = new ParallelMoveInstr(); |
| 1144 } | 1144 } |
| 1145 return parallel_move_; | 1145 return parallel_move_; |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 // Discover basic-block structure by performing a recursive depth first | 1148 // Discover basic-block structure of the current block. Must be called |
| 1149 // traversal of the instruction graph reachable from this instruction. As | 1149 // on all graph blocks in preorder to yield valid results. As a side effect, |
| 1150 // a side effect, the block entry instructions in the graph are assigned | 1150 // the block entry instructions in the graph are assigned preorder numbers. |
| 1151 // numbers in both preorder and postorder. The array 'preorder' maps | 1151 // The array 'preorder' maps preorder block numbers to the block entry |
| 1152 // preorder block numbers to the block entry instruction with that number | 1152 // instruction with that number. The depth first spanning tree is recorded |
| 1153 // and analogously for the array 'postorder'. The depth first spanning | 1153 // in the array 'parent', which maps preorder block numbers to the preorder |
| 1154 // tree is recorded in the array 'parent', which maps preorder block | 1154 // number of the block's spanning-tree parent. As a side effect of this |
| 1155 // numbers to the preorder number of the block's spanning-tree parent. | 1155 // function, the set of basic block predecessors (e.g., block entry |
| 1156 // The array 'assigned_vars' maps preorder block numbers to the set of | 1156 // instructions of predecessor blocks) and also the last instruction in the |
| 1157 // assigned frame-allocated local variables in the block. As a side | 1157 // block is recorded in each entry instruction. |
| 1158 // effect of this function, the set of basic block predecessors (e.g., | 1158 bool DiscoverBlock( |
| 1159 // block entry instructions of predecessor blocks) and also the last | |
| 1160 // instruction in the block is recorded in each entry instruction. | |
| 1161 void DiscoverBlocks( | |
| 1162 BlockEntryInstr* predecessor, | 1159 BlockEntryInstr* predecessor, |
| 1163 GrowableArray<BlockEntryInstr*>* preorder, | 1160 GrowableArray<BlockEntryInstr*>* preorder, |
| 1164 GrowableArray<BlockEntryInstr*>* postorder, | 1161 GrowableArray<intptr_t>* parent); |
| 1165 GrowableArray<intptr_t>* parent, | |
| 1166 intptr_t variable_count, | |
| 1167 intptr_t fixed_parameter_count); | |
| 1168 | 1162 |
| 1169 // Perform a depth first search to prune code not reachable from an OSR | 1163 // Perform a depth first search to prune code not reachable from an OSR |
| 1170 // entry point. | 1164 // entry point. |
| 1171 bool PruneUnreachable(FlowGraphBuilder* builder, | 1165 bool PruneUnreachable(FlowGraphBuilder* builder, |
| 1172 GraphEntryInstr* graph_entry, | 1166 GraphEntryInstr* graph_entry, |
| 1173 Instruction* parent, | 1167 Instruction* parent, |
| 1174 intptr_t osr_id, | 1168 intptr_t osr_id, |
| 1175 BitVector* block_marks); | 1169 BitVector* block_marks); |
| 1176 | 1170 |
| 1177 virtual intptr_t InputCount() const { return 0; } | 1171 virtual intptr_t InputCount() const { return 0; } |
| (...skipping 7266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8444 Isolate* isolate, bool opt) const { \ | 8438 Isolate* isolate, bool opt) const { \ |
| 8445 UNIMPLEMENTED(); \ | 8439 UNIMPLEMENTED(); \ |
| 8446 return NULL; \ | 8440 return NULL; \ |
| 8447 } \ | 8441 } \ |
| 8448 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8442 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8449 | 8443 |
| 8450 | 8444 |
| 8451 } // namespace dart | 8445 } // namespace dart |
| 8452 | 8446 |
| 8453 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8447 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |