| 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 '../compile_time_constants.dart' show BackendConstantEnvironment; | 7 import '../compile_time_constants.dart' show BackendConstantEnvironment; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue; | 9 import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2698 sourceInformation: sourceInformation); | 2698 sourceInformation: sourceInformation); |
| 2699 } | 2699 } |
| 2700 | 2700 |
| 2701 /// Convert the given value to a string. | 2701 /// Convert the given value to a string. |
| 2702 ir.Primitive buildStringify(ir.Primitive value) { | 2702 ir.Primitive buildStringify(ir.Primitive value) { |
| 2703 return buildStaticFunctionInvocation( | 2703 return buildStaticFunctionInvocation( |
| 2704 program.stringifyFunction, | 2704 program.stringifyFunction, |
| 2705 new CallStructure.unnamed(1), | 2705 new CallStructure.unnamed(1), |
| 2706 <ir.Primitive>[value]); | 2706 <ir.Primitive>[value]); |
| 2707 } | 2707 } |
| 2708 |
| 2709 ir.Node buildAwait(ir.Primitive value) { |
| 2710 return _continueWithExpression((k) => new ir.Await(value, k)); |
| 2711 } |
| 2708 } | 2712 } |
| 2709 | 2713 |
| 2710 | 2714 |
| 2711 /// Location of a variable relative to a given closure. | 2715 /// Location of a variable relative to a given closure. |
| 2712 class ClosureLocation { | 2716 class ClosureLocation { |
| 2713 /// If not `null`, this location is [box].[field]. | 2717 /// If not `null`, this location is [box].[field]. |
| 2714 /// The location of [box] can be obtained separately from an | 2718 /// The location of [box] can be obtained separately from an |
| 2715 /// enclosing [ClosureEnvironment] or [ClosureScope]. | 2719 /// enclosing [ClosureEnvironment] or [ClosureScope]. |
| 2716 /// If `null`, then the location is [field] on the enclosing function object. | 2720 /// If `null`, then the location is [field] on the enclosing function object. |
| 2717 final BoxLocal box; | 2721 final BoxLocal box; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2779 } | 2783 } |
| 2780 | 2784 |
| 2781 class SwitchCaseInfo { | 2785 class SwitchCaseInfo { |
| 2782 final List<ir.Primitive> constants = <ir.Primitive>[]; | 2786 final List<ir.Primitive> constants = <ir.Primitive>[]; |
| 2783 final SubbuildFunction buildBody; | 2787 final SubbuildFunction buildBody; |
| 2784 | 2788 |
| 2785 SwitchCaseInfo(this.buildBody); | 2789 SwitchCaseInfo(this.buildBody); |
| 2786 | 2790 |
| 2787 void addConstant(ir.Primitive constant) => constants.add(constant); | 2791 void addConstant(ir.Primitive constant) => constants.add(constant); |
| 2788 } | 2792 } |
| OLD | NEW |