Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 617933003: Iterative graph traversal in FlowGraph::DiscoverBlocks() (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added documentation of DiscoverBlock return value. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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. Returns true when called the
1158 // effect of this function, the set of basic block predecessors (e.g., 1158 // first time on this particular block within one graph traversal, and false
1159 // block entry instructions of predecessor blocks) and also the last 1159 // on all successive calls.
1160 // instruction in the block is recorded in each entry instruction. 1160 bool DiscoverBlock(
1161 void DiscoverBlocks(
1162 BlockEntryInstr* predecessor, 1161 BlockEntryInstr* predecessor,
1163 GrowableArray<BlockEntryInstr*>* preorder, 1162 GrowableArray<BlockEntryInstr*>* preorder,
1164 GrowableArray<BlockEntryInstr*>* postorder, 1163 GrowableArray<intptr_t>* parent);
1165 GrowableArray<intptr_t>* parent,
1166 intptr_t variable_count,
1167 intptr_t fixed_parameter_count);
1168 1164
1169 // Perform a depth first search to prune code not reachable from an OSR 1165 // Perform a depth first search to prune code not reachable from an OSR
1170 // entry point. 1166 // entry point.
1171 bool PruneUnreachable(FlowGraphBuilder* builder, 1167 bool PruneUnreachable(FlowGraphBuilder* builder,
1172 GraphEntryInstr* graph_entry, 1168 GraphEntryInstr* graph_entry,
1173 Instruction* parent, 1169 Instruction* parent,
1174 intptr_t osr_id, 1170 intptr_t osr_id,
1175 BitVector* block_marks); 1171 BitVector* block_marks);
1176 1172
1177 virtual intptr_t InputCount() const { return 0; } 1173 virtual intptr_t InputCount() const { return 0; }
(...skipping 7266 matching lines...) Expand 10 before | Expand all | Expand 10 after
8444 Isolate* isolate, bool opt) const { \ 8440 Isolate* isolate, bool opt) const { \
8445 UNIMPLEMENTED(); \ 8441 UNIMPLEMENTED(); \
8446 return NULL; \ 8442 return NULL; \
8447 } \ 8443 } \
8448 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8444 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8449 8445
8450 8446
8451 } // namespace dart 8447 } // namespace dart
8452 8448
8453 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8449 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698