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 RUNTIME_VM_FLOW_GRAPH_H_ | 5 #ifndef RUNTIME_VM_FLOW_GRAPH_H_ |
6 #define RUNTIME_VM_FLOW_GRAPH_H_ | 6 #define RUNTIME_VM_FLOW_GRAPH_H_ |
7 | 7 |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/hash_map.h" | 10 #include "vm/hash_map.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // Remove environments from the instructions which do not deoptimize. | 278 // Remove environments from the instructions which do not deoptimize. |
279 void EliminateEnvironments(); | 279 void EliminateEnvironments(); |
280 | 280 |
281 bool IsReceiver(Definition* def) const; | 281 bool IsReceiver(Definition* def) const; |
282 | 282 |
283 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the | 283 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the |
284 // shift can be a truncating Smi shift-left and result is always Smi. | 284 // shift can be a truncating Smi shift-left and result is always Smi. |
285 // Merge instructions (only per basic-block). | 285 // Merge instructions (only per basic-block). |
286 void TryOptimizePatterns(); | 286 void TryOptimizePatterns(); |
287 | 287 |
| 288 // Replaces uses that are dominated by dom of 'def' with 'other'. |
| 289 // Note: uses that occur at instruction dom itself are not dominated by it. |
| 290 static void RenameDominatedUses(Definition* def, |
| 291 Instruction* dom, |
| 292 Definition* other); |
| 293 |
288 private: | 294 private: |
289 friend class IfConverter; | 295 friend class IfConverter; |
290 friend class BranchSimplifier; | 296 friend class BranchSimplifier; |
291 friend class ConstantPropagator; | 297 friend class ConstantPropagator; |
292 friend class DeadCodeElimination; | 298 friend class DeadCodeElimination; |
293 | 299 |
294 // SSA transformation methods and fields. | 300 // SSA transformation methods and fields. |
295 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); | 301 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); |
296 | 302 |
297 void CompressPath(intptr_t start_index, | 303 void CompressPath(intptr_t start_index, |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 535 |
530 private: | 536 private: |
531 GrowableArray<Definition*> defs_; | 537 GrowableArray<Definition*> defs_; |
532 BitVector* contains_vector_; | 538 BitVector* contains_vector_; |
533 }; | 539 }; |
534 | 540 |
535 | 541 |
536 } // namespace dart | 542 } // namespace dart |
537 | 543 |
538 #endif // RUNTIME_VM_FLOW_GRAPH_H_ | 544 #endif // RUNTIME_VM_FLOW_GRAPH_H_ |
OLD | NEW |