OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
(...skipping 10 matching lines...) Expand all Loading... |
21 import '../elements/resolution_types.dart'; | 21 import '../elements/resolution_types.dart'; |
22 import '../io/source_information.dart'; | 22 import '../io/source_information.dart'; |
23 import '../js/js.dart' as js; | 23 import '../js/js.dart' as js; |
24 import '../js_backend/backend.dart' show JavaScriptBackend; | 24 import '../js_backend/backend.dart' show JavaScriptBackend; |
25 import '../kernel/kernel.dart'; | 25 import '../kernel/kernel.dart'; |
26 import '../native/native.dart' as native; | 26 import '../native/native.dart' as native; |
27 import '../resolution/tree_elements.dart'; | 27 import '../resolution/tree_elements.dart'; |
28 import '../tree/dartstring.dart'; | 28 import '../tree/dartstring.dart'; |
29 import '../tree/nodes.dart' show Node; | 29 import '../tree/nodes.dart' show Node; |
30 import '../types/masks.dart'; | 30 import '../types/masks.dart'; |
31 import '../universe/call_structure.dart' show CallStructure; | |
32 import '../universe/selector.dart'; | 31 import '../universe/selector.dart'; |
33 import '../universe/side_effects.dart' show SideEffects; | 32 import '../universe/side_effects.dart' show SideEffects; |
34 import '../universe/use.dart' show DynamicUse, StaticUse; | 33 import '../universe/use.dart' show DynamicUse; |
35 import '../world.dart'; | 34 import '../world.dart'; |
36 import 'graph_builder.dart'; | 35 import 'graph_builder.dart'; |
37 import 'jump_handler.dart'; | 36 import 'jump_handler.dart'; |
38 import 'kernel_ast_adapter.dart'; | 37 import 'kernel_ast_adapter.dart'; |
39 import 'kernel_string_builder.dart'; | 38 import 'kernel_string_builder.dart'; |
40 import 'locals_handler.dart'; | 39 import 'locals_handler.dart'; |
41 import 'loop_handler.dart'; | 40 import 'loop_handler.dart'; |
42 import 'nodes.dart'; | 41 import 'nodes.dart'; |
43 import 'ssa_branch_builder.dart'; | 42 import 'ssa_branch_builder.dart'; |
44 import 'switch_continue_analysis.dart'; | 43 import 'switch_continue_analysis.dart'; |
(...skipping 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2888 return; | 2887 return; |
2889 } | 2888 } |
2890 | 2889 |
2891 bool _isInterfaceWithNoDynamicTypes(ir.DartType type) { | 2890 bool _isInterfaceWithNoDynamicTypes(ir.DartType type) { |
2892 bool isMethodTypeVariableType(ir.DartType typeArgType) { | 2891 bool isMethodTypeVariableType(ir.DartType typeArgType) { |
2893 return (typeArgType is ir.TypeParameterType && | 2892 return (typeArgType is ir.TypeParameterType && |
2894 typeArgType.parameter.parent is ir.FunctionNode); | 2893 typeArgType.parameter.parent is ir.FunctionNode); |
2895 } | 2894 } |
2896 | 2895 |
2897 return type is ir.InterfaceType && | 2896 return type is ir.InterfaceType && |
2898 (type as ir.InterfaceType).typeArguments.any( | 2897 type.typeArguments.any((ir.DartType typeArgType) => |
2899 (ir.DartType typeArgType) => | 2898 typeArgType is! ir.DynamicType && |
2900 typeArgType is! ir.DynamicType && | 2899 typeArgType is! ir.InvalidType && |
2901 typeArgType is! ir.InvalidType && | 2900 !isMethodTypeVariableType(type)); |
2902 !isMethodTypeVariableType(type)); | |
2903 } | 2901 } |
2904 | 2902 |
2905 @override | 2903 @override |
2906 void visitThrow(ir.Throw throwNode) { | 2904 void visitThrow(ir.Throw throwNode) { |
2907 _visitThrowExpression(throwNode.expression); | 2905 _visitThrowExpression(throwNode.expression); |
2908 if (isReachable) { | 2906 if (isReachable) { |
2909 handleInTryStatement(); | 2907 handleInTryStatement(); |
2910 push(new HThrowExpression(pop(), null)); | 2908 push(new HThrowExpression(pop(), null)); |
2911 isReachable = false; | 2909 isReachable = false; |
2912 } | 2910 } |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3228 enterBlock.setBlockFlow( | 3226 enterBlock.setBlockFlow( |
3229 new HTryBlockInformation( | 3227 new HTryBlockInformation( |
3230 kernelBuilder.wrapStatementGraph(bodyGraph), | 3228 kernelBuilder.wrapStatementGraph(bodyGraph), |
3231 exception, | 3229 exception, |
3232 kernelBuilder.wrapStatementGraph(catchGraph), | 3230 kernelBuilder.wrapStatementGraph(catchGraph), |
3233 kernelBuilder.wrapStatementGraph(finallyGraph)), | 3231 kernelBuilder.wrapStatementGraph(finallyGraph)), |
3234 exitBlock); | 3232 exitBlock); |
3235 kernelBuilder.inTryStatement = previouslyInTryStatement; | 3233 kernelBuilder.inTryStatement = previouslyInTryStatement; |
3236 } | 3234 } |
3237 } | 3235 } |
OLD | NEW |