| 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 ZoneGrowableArray<TokenPosition>* await_token_positions() const { |
| 289 return await_token_positions_; |
| 290 } |
| 291 |
| 292 void set_await_token_positions( |
| 293 ZoneGrowableArray<TokenPosition>* await_token_positions) { |
| 294 await_token_positions_ = await_token_positions; |
| 295 } |
| 296 |
| 288 // Replaces uses that are dominated by dom of 'def' with 'other'. | 297 // 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. | 298 // Note: uses that occur at instruction dom itself are not dominated by it. |
| 290 static void RenameDominatedUses(Definition* def, | 299 static void RenameDominatedUses(Definition* def, |
| 291 Instruction* dom, | 300 Instruction* dom, |
| 292 Definition* other); | 301 Definition* other); |
| 293 | 302 |
| 294 private: | 303 private: |
| 295 friend class IfConverter; | 304 friend class IfConverter; |
| 296 friend class BranchSimplifier; | 305 friend class BranchSimplifier; |
| 297 friend class ConstantPropagator; | 306 friend class ConstantPropagator; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 ConstantInstr* constant_null_; | 390 ConstantInstr* constant_null_; |
| 382 ConstantInstr* constant_dead_; | 391 ConstantInstr* constant_dead_; |
| 383 ConstantInstr* constant_empty_context_; | 392 ConstantInstr* constant_empty_context_; |
| 384 | 393 |
| 385 BlockEffects* block_effects_; | 394 BlockEffects* block_effects_; |
| 386 bool licm_allowed_; | 395 bool licm_allowed_; |
| 387 | 396 |
| 388 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; | 397 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; |
| 389 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; | 398 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; |
| 390 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; | 399 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; |
| 400 ZoneGrowableArray<TokenPosition>* await_token_positions_; |
| 391 DirectChainedHashMap<ConstantPoolTrait> constant_instr_pool_; | 401 DirectChainedHashMap<ConstantPoolTrait> constant_instr_pool_; |
| 392 BitVector* captured_parameters_; | 402 BitVector* captured_parameters_; |
| 393 | 403 |
| 394 intptr_t inlining_id_; | 404 intptr_t inlining_id_; |
| 395 }; | 405 }; |
| 396 | 406 |
| 397 | 407 |
| 398 class LivenessAnalysis : public ValueObject { | 408 class LivenessAnalysis : public ValueObject { |
| 399 public: | 409 public: |
| 400 LivenessAnalysis(intptr_t variable_count, | 410 LivenessAnalysis(intptr_t variable_count, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 545 |
| 536 private: | 546 private: |
| 537 GrowableArray<Definition*> defs_; | 547 GrowableArray<Definition*> defs_; |
| 538 BitVector* contains_vector_; | 548 BitVector* contains_vector_; |
| 539 }; | 549 }; |
| 540 | 550 |
| 541 | 551 |
| 542 } // namespace dart | 552 } // namespace dart |
| 543 | 553 |
| 544 #endif // RUNTIME_VM_FLOW_GRAPH_H_ | 554 #endif // RUNTIME_VM_FLOW_GRAPH_H_ |
| OLD | NEW |