| 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 SsaCodeGeneratorTask extends CompilerTask { | 7 class SsaCodeGeneratorTask extends CompilerTask { |
| 8 | 8 |
| 9 final JavaScriptBackend backend; | 9 final JavaScriptBackend backend; |
| 10 final SourceInformationStrategy sourceInformationFactory; | 10 final SourceInformationStrategy sourceInformationFactory; |
| (...skipping 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2687 return pop(); | 2687 return pop(); |
| 2688 } else if (checkedType.containsOnlyBool(classWorld)) { | 2688 } else if (checkedType.containsOnlyBool(classWorld)) { |
| 2689 // input is !bool | 2689 // input is !bool |
| 2690 checkBool(input, '!==', input.sourceInformation); | 2690 checkBool(input, '!==', input.sourceInformation); |
| 2691 return pop(); | 2691 return pop(); |
| 2692 } else if (checkedType.containsOnlyString(classWorld)) { | 2692 } else if (checkedType.containsOnlyString(classWorld)) { |
| 2693 // input is !string | 2693 // input is !string |
| 2694 checkString(input, '!==', input.sourceInformation); | 2694 checkString(input, '!==', input.sourceInformation); |
| 2695 return pop(); | 2695 return pop(); |
| 2696 } | 2696 } |
| 2697 compiler.internalError(input, 'Unexpected check.'); | 2697 compiler.internalError(input, 'Unexpected check: $checkedType.'); |
| 2698 return null; | 2698 return null; |
| 2699 } | 2699 } |
| 2700 | 2700 |
| 2701 void visitTypeConversion(HTypeConversion node) { | 2701 void visitTypeConversion(HTypeConversion node) { |
| 2702 if (node.isArgumentTypeCheck || node.isReceiverTypeCheck) { | 2702 if (node.isArgumentTypeCheck || node.isReceiverTypeCheck) { |
| 2703 ClassWorld classWorld = compiler.world; | 2703 ClassWorld classWorld = compiler.world; |
| 2704 // An int check if the input is not int or null, is not | 2704 // An int check if the input is not int or null, is not |
| 2705 // sufficient for doing an argument or receiver check. | 2705 // sufficient for doing an argument or receiver check. |
| 2706 assert(compiler.trustTypeAnnotations || | 2706 assert(compiler.trustTypeAnnotations || |
| 2707 !node.checkedType.containsOnlyInt(classWorld) || | 2707 !node.checkedType.containsOnlyInt(classWorld) || |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2863 } | 2863 } |
| 2864 registry.registerStaticUse(helper); | 2864 registry.registerStaticUse(helper); |
| 2865 return backend.emitter.staticFunctionAccess(helper); | 2865 return backend.emitter.staticFunctionAccess(helper); |
| 2866 } | 2866 } |
| 2867 | 2867 |
| 2868 @override | 2868 @override |
| 2869 void visitRef(HRef node) { | 2869 void visitRef(HRef node) { |
| 2870 visit(node.value); | 2870 visit(node.value); |
| 2871 } | 2871 } |
| 2872 } | 2872 } |
| OLD | NEW |