| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 library fletchc.function_codegen; | 5 library dartino_compiler.function_codegen; |
| 6 | 6 |
| 7 import 'package:compiler/src/resolution/tree_elements.dart' show | 7 import 'package:compiler/src/resolution/tree_elements.dart' show |
| 8 TreeElements; | 8 TreeElements; |
| 9 | 9 |
| 10 import 'package:compiler/src/elements/elements.dart'; | 10 import 'package:compiler/src/elements/elements.dart'; |
| 11 import 'package:compiler/src/tree/tree.dart'; | 11 import 'package:compiler/src/tree/tree.dart'; |
| 12 | 12 |
| 13 import 'fletch_context.dart'; | 13 import 'dartino_context.dart'; |
| 14 | 14 |
| 15 import 'fletch_function_builder.dart' show | 15 import 'dartino_function_builder.dart' show |
| 16 FletchFunctionBuilder; | 16 DartinoFunctionBuilder; |
| 17 | 17 |
| 18 import 'fletch_registry.dart' show | 18 import 'dartino_registry.dart' show |
| 19 FletchRegistry; | 19 DartinoRegistry; |
| 20 | 20 |
| 21 import 'closure_environment.dart'; | 21 import 'closure_environment.dart'; |
| 22 | 22 |
| 23 import 'codegen_visitor.dart'; | 23 import 'codegen_visitor.dart'; |
| 24 | 24 |
| 25 class FunctionCodegen extends CodegenVisitor with FletchRegistryMixin { | 25 class FunctionCodegen extends CodegenVisitor with DartinoRegistryMixin { |
| 26 final FletchRegistry registry; | 26 final DartinoRegistry registry; |
| 27 int setterResultSlot; | 27 int setterResultSlot; |
| 28 | 28 |
| 29 FunctionCodegen(FletchFunctionBuilder functionBuilder, | 29 FunctionCodegen(DartinoFunctionBuilder functionBuilder, |
| 30 FletchContext context, | 30 DartinoContext context, |
| 31 TreeElements elements, | 31 TreeElements elements, |
| 32 this.registry, | 32 this.registry, |
| 33 ClosureEnvironment closureEnvironment, | 33 ClosureEnvironment closureEnvironment, |
| 34 FunctionElement function) | 34 FunctionElement function) |
| 35 : super(functionBuilder, context, elements, | 35 : super(functionBuilder, context, elements, |
| 36 closureEnvironment, function); | 36 closureEnvironment, function); |
| 37 | 37 |
| 38 FunctionElement get function => element; | 38 FunctionElement get function => element; |
| 39 | 39 |
| 40 // If the function is a setter, push the argument to later be returned. | 40 // If the function is a setter, push the argument to later be returned. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 void optionalReplaceResultValue() { | 128 void optionalReplaceResultValue() { |
| 129 if (hasAssignmentSemantics) { | 129 if (hasAssignmentSemantics) { |
| 130 assembler.pop(); | 130 assembler.pop(); |
| 131 assembler.loadSlot(setterResultSlot); | 131 assembler.loadSlot(setterResultSlot); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 } | 134 } |
| OLD | NEW |