Chromium Code Reviews| Index: lib/compiler/implementation/ssa/builder.dart |
| =================================================================== |
| --- lib/compiler/implementation/ssa/builder.dart (revision 12308) |
| +++ lib/compiler/implementation/ssa/builder.dart (working copy) |
| @@ -1352,11 +1352,11 @@ |
| } |
| } |
| - HInstruction potentiallyCheckType(HInstruction original, |
| - Element sourceElement) { |
| + HInstruction potentiallyCheckType( |
| + HInstruction original, Element sourceElement, |
| + { int kind: HTypeConversion.CHECKED_MODE_CHECK }) { |
| if (!compiler.enableTypeAssertions) return original; |
| - HInstruction other = original.convertType( |
| - compiler, sourceElement, HTypeConversion.CHECKED_MODE_CHECK); |
| + HInstruction other = original.convertType(compiler, sourceElement, kind); |
| if (other != original) add(other); |
| return other; |
| } |
| @@ -1433,10 +1433,19 @@ |
| stack.add(stack.last()); |
| } |
| - HBoolify popBoolified() { |
| - HBoolify boolified = new HBoolify(pop()); |
| - add(boolified); |
| - return boolified; |
| + HInstruction popBoolified() { |
| + HInstruction result; |
|
kasperl
2012/09/13 10:34:19
Maybe move this to the else branch and just return
ngeoffray
2012/09/13 10:52:32
Done.
|
| + HInstruction value = pop(); |
| + if (compiler.enableTypeAssertions) { |
| + result = potentiallyCheckType( |
| + value, |
| + compiler.boolClass, |
| + kind: HTypeConversion.BOOLEAN_CONVERSION_CHECK); |
| + } else { |
| + result = new HBoolify(value); |
| + add(result); |
| + } |
| + return result; |
| } |
| HInstruction attachPosition(HInstruction target, Node node) { |