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

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

Issue 23549020: Optimize conditional branches that have same true/false targets. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 7 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_optimizer.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 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 return parallel_move_ != NULL; 1153 return parallel_move_ != NULL;
1154 } 1154 }
1155 1155
1156 ParallelMoveInstr* GetParallelMove() { 1156 ParallelMoveInstr* GetParallelMove() {
1157 if (parallel_move_ == NULL) { 1157 if (parallel_move_ == NULL) {
1158 parallel_move_ = new ParallelMoveInstr(); 1158 parallel_move_ = new ParallelMoveInstr();
1159 } 1159 }
1160 return parallel_move_; 1160 return parallel_move_;
1161 } 1161 }
1162 1162
1163 bool IsEmptyBlock();
1164
1163 // Discover basic-block structure by performing a recursive depth first 1165 // Discover basic-block structure by performing a recursive depth first
1164 // traversal of the instruction graph reachable from this instruction. As 1166 // traversal of the instruction graph reachable from this instruction. As
1165 // a side effect, the block entry instructions in the graph are assigned 1167 // a side effect, the block entry instructions in the graph are assigned
1166 // numbers in both preorder and postorder. The array 'preorder' maps 1168 // numbers in both preorder and postorder. The array 'preorder' maps
1167 // preorder block numbers to the block entry instruction with that number 1169 // preorder block numbers to the block entry instruction with that number
1168 // and analogously for the array 'postorder'. The depth first spanning 1170 // and analogously for the array 'postorder'. The depth first spanning
1169 // tree is recorded in the array 'parent', which maps preorder block 1171 // tree is recorded in the array 'parent', which maps preorder block
1170 // numbers to the preorder number of the block's spanning-tree parent. 1172 // numbers to the preorder number of the block's spanning-tree parent.
1171 // The array 'assigned_vars' maps preorder block numbers to the set of 1173 // The array 'assigned_vars' maps preorder block numbers to the set of
1172 // assigned frame-allocated local variables in the block. As a side 1174 // assigned frame-allocated local variables in the block. As a side
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 return const_cast<BlockEntryInstr*>(this); 1228 return const_cast<BlockEntryInstr*>(this);
1227 } 1229 }
1228 1230
1229 // Helper to mutate the graph during inlining. This block should be 1231 // Helper to mutate the graph during inlining. This block should be
1230 // replaced with new_block as a predecessor of all of this block's 1232 // replaced with new_block as a predecessor of all of this block's
1231 // successors. 1233 // successors.
1232 void ReplaceAsPredecessorWith(BlockEntryInstr* new_block); 1234 void ReplaceAsPredecessorWith(BlockEntryInstr* new_block);
1233 1235
1234 void set_block_id(intptr_t block_id) { block_id_ = block_id; } 1236 void set_block_id(intptr_t block_id) { block_id_ = block_id; }
1235 1237
1238 // For all instruction in this block: Remove all inputs (including in the
1239 // environment) from their definition's use lists for all instructions.
1240 void ClearAllInstructions();
1241
1236 protected: 1242 protected:
1237 BlockEntryInstr(intptr_t block_id, intptr_t try_index) 1243 BlockEntryInstr(intptr_t block_id, intptr_t try_index)
1238 : block_id_(block_id), 1244 : block_id_(block_id),
1239 try_index_(try_index), 1245 try_index_(try_index),
1240 preorder_number_(-1), 1246 preorder_number_(-1),
1241 postorder_number_(-1), 1247 postorder_number_(-1),
1242 dominator_(NULL), 1248 dominator_(NULL),
1243 dominated_blocks_(1), 1249 dominated_blocks_(1),
1244 last_instruction_(NULL), 1250 last_instruction_(NULL),
1245 parallel_move_(NULL), 1251 parallel_move_(NULL),
(...skipping 5538 matching lines...) Expand 10 before | Expand all | Expand 10 after
6784 ForwardInstructionIterator* current_iterator_; 6790 ForwardInstructionIterator* current_iterator_;
6785 6791
6786 private: 6792 private:
6787 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 6793 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
6788 }; 6794 };
6789 6795
6790 6796
6791 } // namespace dart 6797 } // namespace dart
6792 6798
6793 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 6799 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698