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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 ConstantInstr* constant_null_; | 388 ConstantInstr* constant_null_; |
380 ConstantInstr* constant_dead_; | 389 ConstantInstr* constant_dead_; |
381 ConstantInstr* constant_empty_context_; | 390 ConstantInstr* constant_empty_context_; |
382 | 391 |
383 BlockEffects* block_effects_; | 392 BlockEffects* block_effects_; |
384 bool licm_allowed_; | 393 bool licm_allowed_; |
385 | 394 |
386 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; | 395 ZoneGrowableArray<BlockEntryInstr*>* loop_headers_; |
387 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; | 396 ZoneGrowableArray<BitVector*>* loop_invariant_loads_; |
388 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; | 397 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; |
| 398 ZoneGrowableArray<TokenPosition>* await_token_positions_; |
389 DirectChainedHashMap<ConstantPoolTrait> constant_instr_pool_; | 399 DirectChainedHashMap<ConstantPoolTrait> constant_instr_pool_; |
390 BitVector* captured_parameters_; | 400 BitVector* captured_parameters_; |
391 | 401 |
392 intptr_t inlining_id_; | 402 intptr_t inlining_id_; |
393 }; | 403 }; |
394 | 404 |
395 | 405 |
396 class LivenessAnalysis : public ValueObject { | 406 class LivenessAnalysis : public ValueObject { |
397 public: | 407 public: |
398 LivenessAnalysis(intptr_t variable_count, | 408 LivenessAnalysis(intptr_t variable_count, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 543 |
534 private: | 544 private: |
535 GrowableArray<Definition*> defs_; | 545 GrowableArray<Definition*> defs_; |
536 BitVector* contains_vector_; | 546 BitVector* contains_vector_; |
537 }; | 547 }; |
538 | 548 |
539 | 549 |
540 } // namespace dart | 550 } // namespace dart |
541 | 551 |
542 #endif // RUNTIME_VM_FLOW_GRAPH_H_ | 552 #endif // RUNTIME_VM_FLOW_GRAPH_H_ |
OLD | NEW |