| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 void visitNullLiteral(ir.NullLiteral literal) { | 215 void visitNullLiteral(ir.NullLiteral literal) { |
| 216 impactBuilder.registerConstantLiteral(new NullConstantExpression()); | 216 impactBuilder.registerConstantLiteral(new NullConstantExpression()); |
| 217 } | 217 } |
| 218 | 218 |
| 219 @override | 219 @override |
| 220 void visitListLiteral(ir.ListLiteral literal) { | 220 void visitListLiteral(ir.ListLiteral literal) { |
| 221 visitNodes(literal.expressions); | 221 visitNodes(literal.expressions); |
| 222 DartType elementType = checkType(literal.typeArgument); | 222 DartType elementType = checkType(literal.typeArgument); |
| 223 | 223 |
| 224 impactBuilder.registerListLiteral(new ListLiteralUse( | 224 impactBuilder.registerListLiteral(new ListLiteralUse( |
| 225 compiler.coreTypes.listType(elementType), | 225 compiler.commonElements.listType(elementType), |
| 226 isConstant: literal.isConst, | 226 isConstant: literal.isConst, |
| 227 isEmpty: literal.expressions.isEmpty)); | 227 isEmpty: literal.expressions.isEmpty)); |
| 228 } | 228 } |
| 229 | 229 |
| 230 @override | 230 @override |
| 231 void visitMapLiteral(ir.MapLiteral literal) { | 231 void visitMapLiteral(ir.MapLiteral literal) { |
| 232 visitNodes(literal.entries); | 232 visitNodes(literal.entries); |
| 233 DartType keyType = checkType(literal.keyType); | 233 DartType keyType = checkType(literal.keyType); |
| 234 DartType valueType = checkType(literal.valueType); | 234 DartType valueType = checkType(literal.valueType); |
| 235 impactBuilder.registerMapLiteral(new MapLiteralUse( | 235 impactBuilder.registerMapLiteral(new MapLiteralUse( |
| 236 compiler.coreTypes.mapType(keyType, valueType), | 236 compiler.commonElements.mapType(keyType, valueType), |
| 237 isConstant: literal.isConst, | 237 isConstant: literal.isConst, |
| 238 isEmpty: literal.entries.isEmpty)); | 238 isEmpty: literal.entries.isEmpty)); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void visitMapEntry(ir.MapEntry entry) { | 241 void visitMapEntry(ir.MapEntry entry) { |
| 242 visitNode(entry.key); | 242 visitNode(entry.key); |
| 243 visitNode(entry.value); | 243 visitNode(entry.value); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void _visitArguments(ir.Arguments arguments) { | 246 void _visitArguments(ir.Arguments arguments) { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 Element target = astAdapter.getElement(node.target).declaration; | 567 Element target = astAdapter.getElement(node.target).declaration; |
| 568 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( | 568 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( |
| 569 target, astAdapter.getCallStructure(node.arguments))); | 569 target, astAdapter.getCallStructure(node.arguments))); |
| 570 } | 570 } |
| 571 | 571 |
| 572 // TODO(johnniwinther): Make this throw and visit child nodes explicitly | 572 // TODO(johnniwinther): Make this throw and visit child nodes explicitly |
| 573 // instead to ensure that we don't visit unwanted parts of the ir. | 573 // instead to ensure that we don't visit unwanted parts of the ir. |
| 574 @override | 574 @override |
| 575 void defaultNode(ir.Node node) => node.visitChildren(this); | 575 void defaultNode(ir.Node node) => node.visitChildren(this); |
| 576 } | 576 } |
| OLD | NEW |