Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2791993002: Fix dart2js warnings and add test to ensure it stays clean. (Closed)
Patch Set: Address comments and fix duplicated library names. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698