| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // Remove environments from the instructions which do not deoptimize. | 279 // Remove environments from the instructions which do not deoptimize. |
| 280 void EliminateEnvironments(); | 280 void EliminateEnvironments(); |
| 281 | 281 |
| 282 bool IsReceiver(Definition* def) const; | 282 bool IsReceiver(Definition* def) const; |
| 283 | 283 |
| 284 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the | 284 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the |
| 285 // shift can be a truncating Smi shift-left and result is always Smi. | 285 // shift can be a truncating Smi shift-left and result is always Smi. |
| 286 // Merge instructions (only per basic-block). | 286 // Merge instructions (only per basic-block). |
| 287 void TryOptimizePatterns(); | 287 void TryOptimizePatterns(); |
| 288 | 288 |
| 289 ZoneGrowableArray<TokenPosition>* await_token_positions() const { | |
| 290 return await_token_positions_; | |
| 291 } | |
| 292 | |
| 293 void set_await_token_positions( | |
| 294 ZoneGrowableArray<TokenPosition>* await_token_positions) { | |
| 295 await_token_positions_ = await_token_positions; | |
| 296 } | |
| 297 | |
| 298 // Replaces uses that are dominated by dom of 'def' with 'other'. | 289 // Replaces uses that are dominated by dom of 'def' with 'other'. |
| 299 // Note: uses that occur at instruction dom itself are not dominated by it. | 290 // Note: uses that occur at instruction dom itself are not dominated by it. |
| 300 static void RenameDominatedUses(Definition* def, | 291 static void RenameDominatedUses(Definition* def, |
| 301 Instruction* dom, | 292 Instruction* dom, |
| 302 Definition* other); | 293 Definition* other); |
| 303 | 294 |
| 304 // Renames uses of redefined values to make sure that uses of redefined | 295 // Renames uses of redefined values to make sure that uses of redefined |
| 305 // values that are dominated by a redefinition are renamed. | 296 // values that are dominated by a redefinition are renamed. |
| 306 void RenameUsesDominatedByRedefinitions(); | 297 void RenameUsesDominatedByRedefinitions(); |
| 307 | 298 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 ConstantInstr* constant_null_; | 384 ConstantInstr* constant_null_; |
| 394 ConstantInstr* constant_dead_; | 385 ConstantInstr* constant_dead_; |
| 395 ConstantInstr* constant_empty_context_; | 386 ConstantInstr* constant_empty_context_; |
| 396 | 387 |
| 397 BlockEffects* block_effects_; | 388 BlockEffects* block_effects_; |
| 398 bool licm_allowed_; | 389 bool licm_allowed_; |
| 399 | 390 |
| 400 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; | 391 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; |
| 401 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; | 392 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; |
| 402 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; | 393 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; |
| 403 ZoneGrowableArray<TokenPosition>* await_token_positions_; | |
| 404 DirectChainedHashMap<ConstantPoolTrait> constant_instr_pool_; | 394 DirectChainedHashMap<ConstantPoolTrait> constant_instr_pool_; |
| 405 BitVector* captured_parameters_; | 395 BitVector* captured_parameters_; |
| 406 | 396 |
| 407 intptr_t inlining_id_; | 397 intptr_t inlining_id_; |
| 408 }; | 398 }; |
| 409 | 399 |
| 410 | 400 |
| 411 class LivenessAnalysis : public ValueObject { | 401 class LivenessAnalysis : public ValueObject { |
| 412 public: | 402 public: |
| 413 LivenessAnalysis(intptr_t variable_count, | 403 LivenessAnalysis(intptr_t variable_count, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 538 |
| 549 private: | 539 private: |
| 550 GrowableArray<Definition*> defs_; | 540 GrowableArray<Definition*> defs_; |
| 551 BitVector* contains_vector_; | 541 BitVector* contains_vector_; |
| 552 }; | 542 }; |
| 553 | 543 |
| 554 | 544 |
| 555 } // namespace dart | 545 } // namespace dart |
| 556 | 546 |
| 557 #endif // RUNTIME_VM_FLOW_GRAPH_H_ | 547 #endif // RUNTIME_VM_FLOW_GRAPH_H_ |
| OLD | NEW |