| 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_FLOW_GRAPH_H_ | 5 #ifndef VM_FLOW_GRAPH_H_ |
| 6 #define VM_FLOW_GRAPH_H_ | 6 #define 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // Returns true if any instructions were canonicalized away. | 296 // Returns true if any instructions were canonicalized away. |
| 297 bool Canonicalize(); | 297 bool Canonicalize(); |
| 298 | 298 |
| 299 void SelectRepresentations(); | 299 void SelectRepresentations(); |
| 300 | 300 |
| 301 void WidenSmiToInt32(); | 301 void WidenSmiToInt32(); |
| 302 | 302 |
| 303 // Remove environments from the instructions which do not deoptimize. | 303 // Remove environments from the instructions which do not deoptimize. |
| 304 void EliminateEnvironments(); | 304 void EliminateEnvironments(); |
| 305 | 305 |
| 306 bool IsReceiver(Definition* def) const; |
| 307 |
| 306 private: | 308 private: |
| 307 friend class IfConverter; | 309 friend class IfConverter; |
| 308 friend class BranchSimplifier; | 310 friend class BranchSimplifier; |
| 309 friend class ConstantPropagator; | 311 friend class ConstantPropagator; |
| 310 friend class DeadCodeElimination; | 312 friend class DeadCodeElimination; |
| 311 | 313 |
| 312 // SSA transformation methods and fields. | 314 // SSA transformation methods and fields. |
| 313 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); | 315 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); |
| 314 | 316 |
| 315 void CompressPath( | 317 void CompressPath( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 BitVector* FindLoop(BlockEntryInstr* m, BlockEntryInstr* n) const; | 350 BitVector* FindLoop(BlockEntryInstr* m, BlockEntryInstr* n) const; |
| 349 | 351 |
| 350 void InsertConversionsFor(Definition* def); | 352 void InsertConversionsFor(Definition* def); |
| 351 void ConvertUse(Value* use, Representation from); | 353 void ConvertUse(Value* use, Representation from); |
| 352 void ConvertEnvironmentUse(Value* use, Representation from); | 354 void ConvertEnvironmentUse(Value* use, Representation from); |
| 353 void InsertConversion(Representation from, | 355 void InsertConversion(Representation from, |
| 354 Representation to, | 356 Representation to, |
| 355 Value* use, | 357 Value* use, |
| 356 bool is_environment_use); | 358 bool is_environment_use); |
| 357 | 359 |
| 358 bool IsReceiver(Definition* def) const; | |
| 359 void ComputeIsReceiver(PhiInstr* phi) const; | 360 void ComputeIsReceiver(PhiInstr* phi) const; |
| 360 void ComputeIsReceiverRecursive(PhiInstr* phi, | 361 void ComputeIsReceiverRecursive(PhiInstr* phi, |
| 361 GrowableArray<PhiInstr*>* unmark) const; | 362 GrowableArray<PhiInstr*>* unmark) const; |
| 362 | 363 |
| 363 Thread* thread_; | 364 Thread* thread_; |
| 364 | 365 |
| 365 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 366 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used |
| 366 // if/when computing SSA. | 367 // if/when computing SSA. |
| 367 GrowableArray<intptr_t> parent_; | 368 GrowableArray<intptr_t> parent_; |
| 368 GrowableArray<BitVector*> assigned_vars_; | 369 GrowableArray<BitVector*> assigned_vars_; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 542 |
| 542 private: | 543 private: |
| 543 GrowableArray<Definition*> defs_; | 544 GrowableArray<Definition*> defs_; |
| 544 BitVector* contains_vector_; | 545 BitVector* contains_vector_; |
| 545 }; | 546 }; |
| 546 | 547 |
| 547 | 548 |
| 548 } // namespace dart | 549 } // namespace dart |
| 549 | 550 |
| 550 #endif // VM_FLOW_GRAPH_H_ | 551 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |