OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of ssa; | 5 part of ssa; |
6 | 6 |
7 class BailoutInfo { | 7 class BailoutInfo { |
8 int instructionId; | 8 int instructionId; |
9 int bailoutId; | 9 int bailoutId; |
10 BailoutInfo(this.instructionId, this.bailoutId); | 10 BailoutInfo(this.instructionId, this.bailoutId); |
11 } | 11 } |
12 | 12 |
13 /** | 13 /** |
14 * Keeps track of the execution environment for instructions. An | 14 * Keeps track of the execution environment for instructions. An |
15 * execution environment contains the SSA instructions that are live. | 15 * execution environment contains the SSA instructions that are live. |
16 */ | 16 */ |
17 class Environment { | 17 class Environment { |
18 final Set<HInstruction> lives; | 18 final Set<HInstruction> lives; |
19 final List<HBasicBlock> loopMarkers; | 19 final List<HBasicBlock> loopMarkers; |
20 Environment() : lives = new Set<HInstruction>(), | 20 Environment() : lives = new Set<HInstruction>(), |
21 loopMarkers = new List<HBasicBlock>(); | 21 loopMarkers = new List<HBasicBlock>(); |
22 Environment.from(Environment other) | 22 Environment.from(Environment other) |
23 : lives = new Set<HInstruction>.from(other.lives), | 23 : lives = new Set<HInstruction>.from(other.lives), |
24 loopMarkers = new List<HBasicBlock>.from(other.loopMarkers, | 24 loopMarkers = new List<HBasicBlock>.from(other.loopMarkers); |
25 growable: true); | |
26 | 25 |
27 void remove(HInstruction instruction) { | 26 void remove(HInstruction instruction) { |
28 lives.remove(instruction); | 27 lives.remove(instruction); |
29 } | 28 } |
30 | 29 |
31 void add(HInstruction instruction) { | 30 void add(HInstruction instruction) { |
32 // If the instruction is a check, we add its checked input | 31 // If the instruction is a check, we add its checked input |
33 // instead. This allows sharing the same environment between | 32 // instead. This allows sharing the same environment between |
34 // different type guards. | 33 // different type guards. |
35 // | 34 // |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 hasComplexBailoutTargets = true; | 625 hasComplexBailoutTargets = true; |
627 } | 626 } |
628 } else { | 627 } else { |
629 hasComplexBailoutTargets = true; | 628 hasComplexBailoutTargets = true; |
630 blocks.forEach((HBasicBlock block) { | 629 blocks.forEach((HBasicBlock block) { |
631 block.bailoutTargets.add(target); | 630 block.bailoutTargets.add(target); |
632 }); | 631 }); |
633 } | 632 } |
634 } | 633 } |
635 } | 634 } |
OLD | NEW |