| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library dart2js.ir_builder_task; | 5 library dart2js.ir_builder_task; |
| 6 | 6 |
| 7 import '../closure.dart' as closurelib; | 7 import '../closure.dart' as closurelib; |
| 8 import '../closure.dart' hide ClosureScope; | 8 import '../closure.dart' hide ClosureScope; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 3619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3630 @override | 3630 @override |
| 3631 ir.Primitive handleConstructorInvoke( | 3631 ir.Primitive handleConstructorInvoke( |
| 3632 ast.NewExpression node, | 3632 ast.NewExpression node, |
| 3633 ConstructorElement constructor, | 3633 ConstructorElement constructor, |
| 3634 DartType type, | 3634 DartType type, |
| 3635 ast.NodeList arguments, | 3635 ast.NodeList arguments, |
| 3636 CallStructure callStructure, | 3636 CallStructure callStructure, |
| 3637 _) { | 3637 _) { |
| 3638 List<ir.Primitive> arguments = | 3638 List<ir.Primitive> arguments = |
| 3639 node.send.arguments.mapToList(visit, growable:false); | 3639 node.send.arguments.mapToList(visit, growable:false); |
| 3640 arguments = normalizeStaticArguments( | 3640 // Use default values from the effective target, not the immediate target. |
| 3641 callStructure, constructor, arguments); | 3641 ConstructorElement target = constructor.effectiveTarget; |
| 3642 arguments = normalizeStaticArguments(callStructure, target, arguments); |
| 3642 return irBuilder.buildConstructorInvocation( | 3643 return irBuilder.buildConstructorInvocation( |
| 3643 constructor.effectiveTarget, | 3644 target, |
| 3644 callStructure, | 3645 callStructure, |
| 3645 constructor.computeEffectiveTargetType(type), | 3646 constructor.computeEffectiveTargetType(type), |
| 3646 arguments); | 3647 arguments); |
| 3647 } | 3648 } |
| 3648 | 3649 |
| 3649 @override | 3650 @override |
| 3650 ir.Primitive buildStaticNoSuchMethod(Selector selector, | 3651 ir.Primitive buildStaticNoSuchMethod(Selector selector, |
| 3651 List<ir.Primitive> arguments) { | 3652 List<ir.Primitive> arguments) { |
| 3652 Element thrower = backend.getThrowNoSuchMethod(); | 3653 Element thrower = backend.getThrowNoSuchMethod(); |
| 3653 ir.Primitive receiver = irBuilder.buildStringConstant(''); | 3654 ir.Primitive receiver = irBuilder.buildStringConstant(''); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3767 node.body = replacementFor(node.body); | 3768 node.body = replacementFor(node.body); |
| 3768 } | 3769 } |
| 3769 } | 3770 } |
| 3770 | 3771 |
| 3771 /// Visit a just-deleted subterm and unlink all [Reference]s in it. | 3772 /// Visit a just-deleted subterm and unlink all [Reference]s in it. |
| 3772 class RemovalVisitor extends ir.RecursiveVisitor { | 3773 class RemovalVisitor extends ir.RecursiveVisitor { |
| 3773 processReference(ir.Reference reference) { | 3774 processReference(ir.Reference reference) { |
| 3774 reference.unlink(); | 3775 reference.unlink(); |
| 3775 } | 3776 } |
| 3776 } | 3777 } |
| OLD | NEW |