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 import 'dart:math' as math; | 5 import 'dart:math' as math; |
6 import '../common.dart'; | 6 import '../common.dart'; |
7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
8 import '../common/tasks.dart' show CompilerTask; | 8 import '../common/tasks.dart' show CompilerTask; |
9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
10 import '../constants/constant_system.dart'; | 10 import '../constants/constant_system.dart'; |
(...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2870 body = unwrapStatement(body); | 2870 body = unwrapStatement(body); |
2871 pushStatement(new js.If.noElse(test, body) | 2871 pushStatement(new js.If.noElse(test, body) |
2872 .withSourceInformation(node.sourceInformation)); | 2872 .withSourceInformation(node.sourceInformation)); |
2873 return; | 2873 return; |
2874 } | 2874 } |
2875 | 2875 |
2876 assert(node.isCheckedModeCheck || node.isCastTypeCheck); | 2876 assert(node.isCheckedModeCheck || node.isCastTypeCheck); |
2877 DartType type = node.typeExpression; | 2877 DartType type = node.typeExpression; |
2878 assert(!type.isTypedef); | 2878 assert(!type.isTypedef); |
2879 assert(!type.isDynamic); | 2879 assert(!type.isDynamic); |
| 2880 assert(!type.isVoid); |
2880 if (type.isFunctionType) { | 2881 if (type.isFunctionType) { |
2881 // TODO(5022): We currently generate $isFunction checks for | 2882 // TODO(5022): We currently generate $isFunction checks for |
2882 // function types. | 2883 // function types. |
2883 registry.registerTypeUse( | 2884 registry.registerTypeUse( |
2884 new TypeUse.isCheck(compiler.commonElements.functionType)); | 2885 new TypeUse.isCheck(compiler.commonElements.functionType)); |
2885 } | 2886 } |
2886 registry.registerTypeUse(new TypeUse.isCheck(type)); | 2887 registry.registerTypeUse(new TypeUse.isCheck(type)); |
2887 | 2888 |
2888 CheckedModeHelper helper; | 2889 CheckedModeHelper helper; |
2889 if (node.isBooleanConversionCheck) { | 2890 if (node.isBooleanConversionCheck) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2981 return closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { | 2982 return closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { |
2982 return !backend.rti.isTrivialSubstitution(subclass, cls); | 2983 return !backend.rti.isTrivialSubstitution(subclass, cls); |
2983 }); | 2984 }); |
2984 } | 2985 } |
2985 | 2986 |
2986 @override | 2987 @override |
2987 void visitRef(HRef node) { | 2988 void visitRef(HRef node) { |
2988 visit(node.value); | 2989 visit(node.value); |
2989 } | 2990 } |
2990 } | 2991 } |
OLD | NEW |