| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:js_runtime/shared/embedded_names.dart'; | 5 import 'package:js_runtime/shared/embedded_names.dart'; |
| 6 import 'package:kernel/ast.dart' as ir; | 6 import 'package:kernel/ast.dart' as ir; |
| 7 | 7 |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart'; | 9 import '../common/names.dart'; |
| 10 import '../constants/constructors.dart'; | 10 import '../constants/constructors.dart'; |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 if (expressions == null) return null; | 508 if (expressions == null) return null; |
| 509 return new ConstructedConstantExpression( | 509 return new ConstructedConstantExpression( |
| 510 elementMap.createInterfaceType(target.enclosingClass, arguments.types), | 510 elementMap.createInterfaceType(target.enclosingClass, arguments.types), |
| 511 elementMap.getConstructor(target), | 511 elementMap.getConstructor(target), |
| 512 elementMap.getCallStructure(arguments), | 512 elementMap.getCallStructure(arguments), |
| 513 expressions); | 513 expressions); |
| 514 } | 514 } |
| 515 | 515 |
| 516 @override | 516 @override |
| 517 ConstantExpression visitConstructorInvocation(ir.ConstructorInvocation node) { | 517 ConstantExpression visitConstructorInvocation(ir.ConstructorInvocation node) { |
| 518 if (!node.isConst) return null; |
| 518 return _computeConstructorInvocation(node.target, node.arguments); | 519 return _computeConstructorInvocation(node.target, node.arguments); |
| 519 } | 520 } |
| 520 | 521 |
| 521 @override | 522 @override |
| 522 ConstantExpression visitVariableGet(ir.VariableGet node) { | 523 ConstantExpression visitVariableGet(ir.VariableGet node) { |
| 523 if (node.variable.parent is ir.FunctionNode) { | 524 if (node.variable.parent is ir.FunctionNode) { |
| 524 ir.FunctionNode function = node.variable.parent; | 525 ir.FunctionNode function = node.variable.parent; |
| 525 int index = function.positionalParameters.indexOf(node.variable); | 526 int index = function.positionalParameters.indexOf(node.variable); |
| 526 if (index != -1) { | 527 if (index != -1) { |
| 527 return new PositionalArgumentReference(index); | 528 return new PositionalArgumentReference(index); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 } | 861 } |
| 861 if (isRedirecting) { | 862 if (isRedirecting) { |
| 862 return new RedirectingGenerativeConstantConstructor( | 863 return new RedirectingGenerativeConstantConstructor( |
| 863 defaultValues, superConstructorInvocation); | 864 defaultValues, superConstructorInvocation); |
| 864 } else { | 865 } else { |
| 865 return new GenerativeConstantConstructor( | 866 return new GenerativeConstantConstructor( |
| 866 type, defaultValues, fieldMap, superConstructorInvocation); | 867 type, defaultValues, fieldMap, superConstructorInvocation); |
| 867 } | 868 } |
| 868 } | 869 } |
| 869 } | 870 } |
| OLD | NEW |