| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 if (isConst && commonElements.isSymbolConstructor(constructor)) { | 287 if (isConst && commonElements.isSymbolConstructor(constructor)) { |
| 288 ConstantValue value = | 288 ConstantValue value = |
| 289 elementAdapter.getConstantValue(node.arguments.positional.first); | 289 elementAdapter.getConstantValue(node.arguments.positional.first); |
| 290 if (!value.isString) { | 290 if (!value.isString) { |
| 291 throw new SpannableAssertionFailure( | 291 throw new SpannableAssertionFailure( |
| 292 CURRENT_ELEMENT_SPANNABLE, | 292 CURRENT_ELEMENT_SPANNABLE, |
| 293 "Unexpected constant value in const Symbol(...) call: " | 293 "Unexpected constant value in const Symbol(...) call: " |
| 294 "${value.toStructuredText()}"); | 294 "${value.toStructuredText()}"); |
| 295 } | 295 } |
| 296 StringConstantValue stringValue = value; | 296 StringConstantValue stringValue = value; |
| 297 impactBuilder | 297 impactBuilder.registerConstSymbolName(stringValue.primitiveValue); |
| 298 .registerConstSymbolName(stringValue.primitiveValue.slowToString()); | |
| 299 } | 298 } |
| 300 } | 299 } |
| 301 | 300 |
| 302 @override | 301 @override |
| 303 void visitSuperInitializer(ir.SuperInitializer node) { | 302 void visitSuperInitializer(ir.SuperInitializer node) { |
| 304 ConstructorEntity target = elementAdapter.getConstructor(node.target); | 303 ConstructorEntity target = elementAdapter.getConstructor(node.target); |
| 305 _visitArguments(node.arguments); | 304 _visitArguments(node.arguments); |
| 306 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( | 305 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( |
| 307 target, elementAdapter.getCallStructure(node.arguments))); | 306 target, elementAdapter.getCallStructure(node.arguments))); |
| 308 } | 307 } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 ConstructorEntity target = elementAdapter.getConstructor(node.target); | 595 ConstructorEntity target = elementAdapter.getConstructor(node.target); |
| 597 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( | 596 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( |
| 598 target, elementAdapter.getCallStructure(node.arguments))); | 597 target, elementAdapter.getCallStructure(node.arguments))); |
| 599 } | 598 } |
| 600 | 599 |
| 601 // TODO(johnniwinther): Make this throw and visit child nodes explicitly | 600 // TODO(johnniwinther): Make this throw and visit child nodes explicitly |
| 602 // instead to ensure that we don't visit unwanted parts of the ir. | 601 // instead to ensure that we don't visit unwanted parts of the ir. |
| 603 @override | 602 @override |
| 604 void defaultNode(ir.Node node) => node.visitChildren(this); | 603 void defaultNode(ir.Node node) => node.visitChildren(this); |
| 605 } | 604 } |
| OLD | NEW |