| 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 class BailoutInfo { | 5 class BailoutInfo { |
| 6 int instructionId; | 6 int instructionId; |
| 7 int bailoutId; | 7 int bailoutId; |
| 8 BailoutInfo(this.instructionId, this.bailoutId); | 8 BailoutInfo(this.instructionId, this.bailoutId); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // | 134 // |
| 135 // while (true) { <-- (4) update the marker with the environment | 135 // while (true) { <-- (4) update the marker with the environment |
| 136 // use(x); <-- (3) environment = {x} | 136 // use(x); <-- (3) environment = {x} |
| 137 // bailout; <-- (2) has the marker when computed | 137 // bailout; <-- (2) has the marker when computed |
| 138 // } <-- (1) create a loop marker | 138 // } <-- (1) create a loop marker |
| 139 // | 139 // |
| 140 // The bailout instruction first captures the marker, but it | 140 // The bailout instruction first captures the marker, but it |
| 141 // will be replaced by the live environment at the loop entry, | 141 // will be replaced by the live environment at the loop entry, |
| 142 // in this case {x}. | 142 // in this case {x}. |
| 143 environment.removeLoopMarker(block); | 143 environment.removeLoopMarker(block); |
| 144 capturedEnvironments.forEach((instruction, env) { | 144 capturedEnvironments.forEach((ignoredInstruction, env) { |
| 145 if (env.containsLoopMarker(block)) { | 145 if (env.containsLoopMarker(block)) { |
| 146 env.removeLoopMarker(block); | 146 env.removeLoopMarker(block); |
| 147 env.addAll(environment); | 147 env.addAll(environment); |
| 148 } | 148 } |
| 149 }); | 149 }); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 void visitPhi(HPhi phi) { | 153 void visitPhi(HPhi phi) { |
| 154 maybeCaptureEnvironment(phi); | 154 maybeCaptureEnvironment(phi); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 compiler.internalError('Control flow instructions already dealt with.', | 359 compiler.internalError('Control flow instructions already dealt with.', |
| 360 instruction: instruction); | 360 instruction: instruction); |
| 361 } | 361 } |
| 362 | 362 |
| 363 visitTypeGuard(HTypeGuard guard) { | 363 visitTypeGuard(HTypeGuard guard) { |
| 364 blocks.forEach((HBasicBlock block) { | 364 blocks.forEach((HBasicBlock block) { |
| 365 block.guards.add(guard); | 365 block.guards.add(guard); |
| 366 }); | 366 }); |
| 367 } | 367 } |
| 368 } | 368 } |
| OLD | NEW |