| 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 '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 @override | 264 @override |
| 265 void visitConstructorInvocation(ir.ConstructorInvocation node) { | 265 void visitConstructorInvocation(ir.ConstructorInvocation node) { |
| 266 handleNew(node, node.target, isConst: node.isConst); | 266 handleNew(node, node.target, isConst: node.isConst); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void handleNew(ir.InvocationExpression node, ir.Member target, | 269 void handleNew(ir.InvocationExpression node, ir.Member target, |
| 270 {bool isConst: false}) { | 270 {bool isConst: false}) { |
| 271 _visitArguments(node.arguments); | 271 _visitArguments(node.arguments); |
| 272 ConstructorEntity constructor = elementAdapter.getConstructor(target); | 272 ConstructorEntity constructor = elementAdapter.getConstructor(target); |
| 273 if (commonElements.isSymbolConstructor(constructor)) { |
| 274 impactBuilder.registerFeature(Feature.SYMBOL_CONSTRUCTOR); |
| 275 } |
| 273 InterfaceType type = elementAdapter.createInterfaceType( | 276 InterfaceType type = elementAdapter.createInterfaceType( |
| 274 target.enclosingClass, node.arguments.types); | 277 target.enclosingClass, node.arguments.types); |
| 275 CallStructure callStructure = | 278 CallStructure callStructure = |
| 276 elementAdapter.getCallStructure(node.arguments); | 279 elementAdapter.getCallStructure(node.arguments); |
| 277 impactBuilder.registerStaticUse(isConst | 280 impactBuilder.registerStaticUse(isConst |
| 278 ? new StaticUse.constConstructorInvoke(constructor, callStructure, type) | 281 ? new StaticUse.constConstructorInvoke(constructor, callStructure, type) |
| 279 : new StaticUse.typedConstructorInvoke( | 282 : new StaticUse.typedConstructorInvoke( |
| 280 constructor, callStructure, type)); | 283 constructor, callStructure, type)); |
| 281 if (type.typeArguments.any((DartType type) => !type.isDynamic)) { | 284 if (type.typeArguments.any((DartType type) => !type.isDynamic)) { |
| 282 impactBuilder.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK); | 285 impactBuilder.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 ConstructorEntity target = elementAdapter.getConstructor(node.target); | 596 ConstructorEntity target = elementAdapter.getConstructor(node.target); |
| 594 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( | 597 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( |
| 595 target, elementAdapter.getCallStructure(node.arguments))); | 598 target, elementAdapter.getCallStructure(node.arguments))); |
| 596 } | 599 } |
| 597 | 600 |
| 598 // TODO(johnniwinther): Make this throw and visit child nodes explicitly | 601 // TODO(johnniwinther): Make this throw and visit child nodes explicitly |
| 599 // instead to ensure that we don't visit unwanted parts of the ir. | 602 // instead to ensure that we don't visit unwanted parts of the ir. |
| 600 @override | 603 @override |
| 601 void defaultNode(ir.Node node) => node.visitChildren(this); | 604 void defaultNode(ir.Node node) => node.visitChildren(this); |
| 602 } | 605 } |
| OLD | NEW |