| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 backend_ast_emitter; | 5 library backend_ast_emitter; |
| 6 | 6 |
| 7 import '../tree_ir/tree_ir_nodes.dart' as tree; | 7 import '../tree_ir/tree_ir_nodes.dart' as tree; |
| 8 import 'backend_ast_nodes.dart'; | 8 import 'backend_ast_nodes.dart'; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 } | 770 } |
| 771 | 771 |
| 772 @override | 772 @override |
| 773 Expression visitInvokeMethod(tree.InvokeMethod exp, | 773 Expression visitInvokeMethod(tree.InvokeMethod exp, |
| 774 BuilderContext<Statement> context) { | 774 BuilderContext<Statement> context) { |
| 775 Expression receiver = visitExpression(exp.receiver, context); | 775 Expression receiver = visitExpression(exp.receiver, context); |
| 776 return emitMethodCall(exp, receiver, context); | 776 return emitMethodCall(exp, receiver, context); |
| 777 } | 777 } |
| 778 | 778 |
| 779 @override | 779 @override |
| 780 Expression visitInvokeSuperMethod(tree.InvokeSuperMethod exp, | 780 Expression visitInvokeMethodDirectly(tree.InvokeMethodDirectly exp, |
| 781 BuilderContext<Statement> context) { | 781 BuilderContext<Statement> context) { |
| 782 // When targeting Dart, InvokeMethodDirectly is only used for super calls. |
| 783 // The receiver is known to be `this`, and the target method is a method |
| 784 // on the super class. So we just translate it as a method call with the |
| 785 // super receiver. |
| 782 return emitMethodCall(exp, new SuperReceiver(), context); | 786 return emitMethodCall(exp, new SuperReceiver(), context); |
| 783 } | 787 } |
| 784 | 788 |
| 785 @override | 789 @override |
| 786 Expression visitInvokeConstructor(tree.InvokeConstructor exp, | 790 Expression visitInvokeConstructor(tree.InvokeConstructor exp, |
| 787 BuilderContext<Statement> context) { | 791 BuilderContext<Statement> context) { |
| 788 List<Argument> args = | 792 List<Argument> args = |
| 789 emitArguments(visitArgumentList(exp.arguments, context), exp.selector); | 793 emitArguments(visitArgumentList(exp.arguments, context), exp.selector); |
| 790 FunctionElement constructor = exp.target; | 794 FunctionElement constructor = exp.target; |
| 791 String name = constructor.name.isEmpty ? null : constructor.name; | 795 String name = constructor.name.isEmpty ? null : constructor.name; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); | 1258 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); |
| 1255 | 1259 |
| 1256 ExecutableElement get executableContext => enclosingElement; | 1260 ExecutableElement get executableContext => enclosingElement; |
| 1257 | 1261 |
| 1258 ExecutableElement get memberContext => executableContext.memberContext; | 1262 ExecutableElement get memberContext => executableContext.memberContext; |
| 1259 | 1263 |
| 1260 bool get isLocal => true; | 1264 bool get isLocal => true; |
| 1261 | 1265 |
| 1262 LibraryElement get implementationLibrary => enclosingElement.library; | 1266 LibraryElement get implementationLibrary => enclosingElement.library; |
| 1263 } | 1267 } |
| OLD | NEW |