| 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; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import '../constants/expressions.dart'; | 7 import '../constants/expressions.dart'; |
| 8 import '../constants/values.dart' show PrimitiveConstantValue; | 8 import '../constants/values.dart' show PrimitiveConstantValue; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../dart2jslib.dart'; | 10 import '../dart2jslib.dart'; |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 (k) => new ir.InvokeConstructor(type, element, selector, k, arguments)); | 724 (k) => new ir.InvokeConstructor(type, element, selector, k, arguments)); |
| 725 } | 725 } |
| 726 | 726 |
| 727 /// Create a string concatenation of the [arguments]. | 727 /// Create a string concatenation of the [arguments]. |
| 728 ir.Primitive buildStringConcatenation(List<ir.Primitive> arguments) { | 728 ir.Primitive buildStringConcatenation(List<ir.Primitive> arguments) { |
| 729 assert(isOpen); | 729 assert(isOpen); |
| 730 return _continueWithExpression( | 730 return _continueWithExpression( |
| 731 (k) => new ir.ConcatenateStrings(k, arguments)); | 731 (k) => new ir.ConcatenateStrings(k, arguments)); |
| 732 } | 732 } |
| 733 | 733 |
| 734 /// Create an invocation of [local] where the argument structure is defined | 734 /// Create an invocation of the `call` method of [functionExpression], where |
| 735 /// by [selector] and the argument values are defined by [arguments]. | 735 /// the named arguments are given by [selector]. |
| 736 ir.Primitive buildLocalInvocation(LocalElement local, | 736 ir.Primitive buildCallInvocation( |
| 737 Selector selector, | |
| 738 List<ir.Definition> arguments) { | |
| 739 return _buildInvokeCall(buildLocalGet(local), selector, arguments); | |
| 740 } | |
| 741 | |
| 742 /// Create an invocation of the [functionExpression] where the argument | |
| 743 /// structure are defined by [selector] and the argument values are defined by | |
| 744 /// [arguments]. | |
| 745 ir.Primitive buildFunctionExpressionInvocation( | |
| 746 ir.Primitive functionExpression, | 737 ir.Primitive functionExpression, |
| 747 Selector selector, | 738 Selector selector, |
| 748 List<ir.Definition> arguments) { | 739 List<ir.Definition> arguments) { |
| 749 return _buildInvokeCall(functionExpression, selector, arguments); | 740 return _buildInvokeCall(functionExpression, selector, arguments); |
| 750 } | 741 } |
| 751 | 742 |
| 752 /// Creates an if-then-else statement with the provided [condition] where the | 743 /// Creates an if-then-else statement with the provided [condition] where the |
| 753 /// then and else branches are created through the [buildThenPart] and | 744 /// then and else branches are created through the [buildThenPart] and |
| 754 /// [buildElsePart] functions, respectively. | 745 /// [buildElsePart] functions, respectively. |
| 755 /// | 746 /// |
| (...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 ClosureEnvironment(this.selfReference, this.thisLocal, this.freeVariables); | 2007 ClosureEnvironment(this.selfReference, this.thisLocal, this.freeVariables); |
| 2017 } | 2008 } |
| 2018 | 2009 |
| 2019 /// Information about which variables are captured by a nested function. | 2010 /// Information about which variables are captured by a nested function. |
| 2020 /// | 2011 /// |
| 2021 /// This is used by the [DartIrBuilder] instead of [ClosureScope] and | 2012 /// This is used by the [DartIrBuilder] instead of [ClosureScope] and |
| 2022 /// [ClosureEnvironment]. | 2013 /// [ClosureEnvironment]. |
| 2023 abstract class DartCapturedVariableInfo { | 2014 abstract class DartCapturedVariableInfo { |
| 2024 Iterable<Local> get capturedVariables; | 2015 Iterable<Local> get capturedVariables; |
| 2025 } | 2016 } |
| OLD | NEW |