Chromium Code Reviews| Index: frog/leg/ssa/bailout.dart |
| =================================================================== |
| --- frog/leg/ssa/bailout.dart (revision 4468) |
| +++ frog/leg/ssa/bailout.dart (working copy) |
| @@ -37,15 +37,14 @@ |
| } |
| List<HInstruction> buildAndSetLast(HInstruction instruction) { |
| - remove(instruction); |
|
floitsch
2012/02/22 17:22:32
keep.
|
| List<HInstruction> result = new List<HInstruction>.from(lives); |
| result.addLast(instruction); |
| - add(instruction); |
| return result; |
| } |
| bool isEmpty() => lives.isEmpty(); |
| bool contains(HInstruction instruction) => lives.contains(instruction); |
| + void clear() => lives.clear(); |
| } |
| /** |
| @@ -200,9 +199,17 @@ |
| // Deal with all kinds of control flow instructions. In case we add |
| // a new one, we will hit an internal error. |
| void visitExit(HExit exit) {} |
| - void visitReturn(HReturn instruction) {} |
| - void visitThrow(HThrow instruction) {} |
| + void visitReturn(HReturn instruction) { |
| + environment.clear(); |
| + visitInstruction(instruction); |
| + } |
| + |
| + void visitThrow(HThrow instruction) { |
| + environment.clear(); |
| + visitInstruction(instruction); |
| + } |
| + |
| void visitControlFlow(HControlFlow instruction) { |
| compiler.internalError('Control flow instructions already dealt with.', |
| instruction: instruction); |
| @@ -217,8 +224,8 @@ |
| SsaTypeGuardBuilder(Compiler compiler) : super(compiler); |
| - HInstruction tryInsertTypeGuard(HInstruction instruction, |
| - HInstruction insertionPoint) { |
| + void tryInsertTypeGuard(HInstruction instruction, |
| + HInstruction insertionPoint) { |
| // If we found a type for the instruction, but the instruction |
| // does not know if it produces that type, add a type guard. |
| if (instruction.type.isKnown() && !instruction.hasExpectedType()) { |