| 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/growable_array.h" | 8 #include "vm/growable_array.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 void set_loop_invariant_loads( | 210 void set_loop_invariant_loads( |
| 211 ZoneGrowableArray<BitVector*>* loop_invariant_loads) { | 211 ZoneGrowableArray<BitVector*>* loop_invariant_loads) { |
| 212 loop_invariant_loads_ = loop_invariant_loads; | 212 loop_invariant_loads_ = loop_invariant_loads; |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool IsCompiledForOsr() const { return graph_entry()->IsCompiledForOsr(); } | 215 bool IsCompiledForOsr() const { return graph_entry()->IsCompiledForOsr(); } |
| 216 | 216 |
| 217 static void AddToGuardedFields(ZoneGrowableArray<const Field*>* array, | 217 static void AddToGuardedFields(ZoneGrowableArray<const Field*>* array, |
| 218 const Field* field); | 218 const Field* field); |
| 219 void AddToDeferredPrefixes(ZoneGrowableArray<const LibraryPrefix*>* from); |
| 219 | 220 |
| 220 ZoneGrowableArray<const Field*>* guarded_fields() const { | 221 ZoneGrowableArray<const Field*>* guarded_fields() const { |
| 221 return guarded_fields_; | 222 return guarded_fields_; |
| 222 } | 223 } |
| 223 | 224 |
| 225 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes() const { |
| 226 return deferred_prefixes_; |
| 227 } |
| 228 |
| 224 private: | 229 private: |
| 225 friend class IfConverter; | 230 friend class IfConverter; |
| 226 friend class BranchSimplifier; | 231 friend class BranchSimplifier; |
| 227 friend class ConstantPropagator; | 232 friend class ConstantPropagator; |
| 228 friend class DeadCodeElimination; | 233 friend class DeadCodeElimination; |
| 229 | 234 |
| 230 // SSA transformation methods and fields. | 235 // SSA transformation methods and fields. |
| 231 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); | 236 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); |
| 232 | 237 |
| 233 void CompressPath( | 238 void CompressPath( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 ConstantInstr* constant_dead_; | 298 ConstantInstr* constant_dead_; |
| 294 | 299 |
| 295 BlockEffects* block_effects_; | 300 BlockEffects* block_effects_; |
| 296 bool licm_allowed_; | 301 bool licm_allowed_; |
| 297 | 302 |
| 298 bool use_far_branches_; | 303 bool use_far_branches_; |
| 299 | 304 |
| 300 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; | 305 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; |
| 301 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; | 306 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; |
| 302 ZoneGrowableArray<const Field*>* guarded_fields_; | 307 ZoneGrowableArray<const Field*>* guarded_fields_; |
| 308 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; |
| 303 }; | 309 }; |
| 304 | 310 |
| 305 | 311 |
| 306 class LivenessAnalysis : public ValueObject { | 312 class LivenessAnalysis : public ValueObject { |
| 307 public: | 313 public: |
| 308 LivenessAnalysis(intptr_t variable_count, | 314 LivenessAnalysis(intptr_t variable_count, |
| 309 const GrowableArray<BlockEntryInstr*>& postorder); | 315 const GrowableArray<BlockEntryInstr*>& postorder); |
| 310 | 316 |
| 311 void Analyze(); | 317 void Analyze(); |
| 312 | 318 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // Per block sets of available blocks. Block A is available at the block B if | 408 // Per block sets of available blocks. Block A is available at the block B if |
| 403 // and only if A dominates B and all paths from A to B are free of side | 409 // and only if A dominates B and all paths from A to B are free of side |
| 404 // effects. | 410 // effects. |
| 405 GrowableArray<BitVector*> available_at_; | 411 GrowableArray<BitVector*> available_at_; |
| 406 }; | 412 }; |
| 407 | 413 |
| 408 | 414 |
| 409 } // namespace dart | 415 } // namespace dart |
| 410 | 416 |
| 411 #endif // VM_FLOW_GRAPH_H_ | 417 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |