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); |
25 | 26 |
26 void remove(HInstruction instruction) { | 27 void remove(HInstruction instruction) { |
27 lives.remove(instruction); | 28 lives.remove(instruction); |
28 } | 29 } |
29 | 30 |
30 void add(HInstruction instruction) { | 31 void add(HInstruction instruction) { |
31 // If the instruction is a check, we add its checked input | 32 // If the instruction is a check, we add its checked input |
32 // instead. This allows sharing the same environment between | 33 // instead. This allows sharing the same environment between |
33 // different type guards. | 34 // different type guards. |
34 // | 35 // |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 hasComplexBailoutTargets = true; | 626 hasComplexBailoutTargets = true; |
626 } | 627 } |
627 } else { | 628 } else { |
628 hasComplexBailoutTargets = true; | 629 hasComplexBailoutTargets = true; |
629 blocks.forEach((HBasicBlock block) { | 630 blocks.forEach((HBasicBlock block) { |
630 block.bailoutTargets.add(target); | 631 block.bailoutTargets.add(target); |
631 }); | 632 }); |
632 } | 633 } |
633 } | 634 } |
634 } | 635 } |
OLD | NEW |