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 'dart:collection' show Queue; | 6 import 'dart:collection' show Queue; |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
9 import '../common/tasks.dart' show CompilerTask; | 9 import '../common/tasks.dart' show CompilerTask; |
10 import '../constants/constant_system.dart'; | 10 import '../constants/constant_system.dart'; |
(...skipping 2910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2921 body = unwrapStatement(body); | 2921 body = unwrapStatement(body); |
2922 pushStatement(new js.If.noElse(test, body) | 2922 pushStatement(new js.If.noElse(test, body) |
2923 .withSourceInformation(node.sourceInformation)); | 2923 .withSourceInformation(node.sourceInformation)); |
2924 return; | 2924 return; |
2925 } | 2925 } |
2926 | 2926 |
2927 assert(node.isCheckedModeCheck || node.isCastTypeCheck); | 2927 assert(node.isCheckedModeCheck || node.isCastTypeCheck); |
2928 DartType type = node.typeExpression; | 2928 DartType type = node.typeExpression; |
2929 assert(!type.isTypedef); | 2929 assert(!type.isTypedef); |
2930 assert(!type.isDynamic); | 2930 assert(!type.isDynamic); |
| 2931 assert(!type.isVoid); |
2931 if (type.isFunctionType) { | 2932 if (type.isFunctionType) { |
2932 // TODO(5022): We currently generate $isFunction checks for | 2933 // TODO(5022): We currently generate $isFunction checks for |
2933 // function types. | 2934 // function types. |
2934 _registry | 2935 _registry |
2935 .registerTypeUse(new TypeUse.isCheck(_commonElements.functionType)); | 2936 .registerTypeUse(new TypeUse.isCheck(_commonElements.functionType)); |
2936 } | 2937 } |
2937 _registry.registerTypeUse(new TypeUse.isCheck(type)); | 2938 _registry.registerTypeUse(new TypeUse.isCheck(type)); |
2938 | 2939 |
2939 CheckedModeHelper helper; | 2940 CheckedModeHelper helper; |
2940 if (node.isBooleanConversionCheck) { | 2941 if (node.isBooleanConversionCheck) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3039 return _closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { | 3040 return _closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { |
3040 return !_rtiSubstitutions.isTrivialSubstitution(subclass, cls); | 3041 return !_rtiSubstitutions.isTrivialSubstitution(subclass, cls); |
3041 }); | 3042 }); |
3042 } | 3043 } |
3043 | 3044 |
3044 @override | 3045 @override |
3045 void visitRef(HRef node) { | 3046 void visitRef(HRef node) { |
3046 visit(node.value); | 3047 visit(node.value); |
3047 } | 3048 } |
3048 } | 3049 } |
OLD | NEW |