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 '../closure.dart' hide ClosureScope; | 7 import '../closure.dart' hide ClosureScope; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
10 Names, | 10 Names, |
(...skipping 2795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2806 | 2806 |
2807 ir.Node buildAwait(ir.Primitive value) { | 2807 ir.Node buildAwait(ir.Primitive value) { |
2808 return _continueWithExpression((k) => new ir.Await(value, k)); | 2808 return _continueWithExpression((k) => new ir.Await(value, k)); |
2809 } | 2809 } |
2810 | 2810 |
2811 void buildYield(ir.Primitive value, bool hasStar) { | 2811 void buildYield(ir.Primitive value, bool hasStar) { |
2812 _continueWithExpression((k) { | 2812 _continueWithExpression((k) { |
2813 return new ir.Yield(value, hasStar, k); | 2813 return new ir.Yield(value, hasStar, k); |
2814 }); | 2814 }); |
2815 } | 2815 } |
| 2816 |
| 2817 ir.Primitive buildRefinement(ir.Primitive value, TypeMask type) { |
| 2818 return addPrimitive(new ir.Refinement(value, type)); |
| 2819 } |
2816 } | 2820 } |
2817 | 2821 |
2818 /// Location of a variable relative to a given closure. | 2822 /// Location of a variable relative to a given closure. |
2819 class ClosureLocation { | 2823 class ClosureLocation { |
2820 /// If not `null`, this location is [box].[field]. | 2824 /// If not `null`, this location is [box].[field]. |
2821 /// The location of [box] can be obtained separately from an | 2825 /// The location of [box] can be obtained separately from an |
2822 /// enclosing [ClosureEnvironment] or [ClosureScope]. | 2826 /// enclosing [ClosureEnvironment] or [ClosureScope]. |
2823 /// If `null`, then the location is [field] on the enclosing function object. | 2827 /// If `null`, then the location is [field] on the enclosing function object. |
2824 final BoxLocal box; | 2828 final BoxLocal box; |
2825 | 2829 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2886 } | 2890 } |
2887 | 2891 |
2888 class SwitchCaseInfo { | 2892 class SwitchCaseInfo { |
2889 final List<ir.Primitive> constants = <ir.Primitive>[]; | 2893 final List<ir.Primitive> constants = <ir.Primitive>[]; |
2890 final SubbuildFunction buildBody; | 2894 final SubbuildFunction buildBody; |
2891 | 2895 |
2892 SwitchCaseInfo(this.buildBody); | 2896 SwitchCaseInfo(this.buildBody); |
2893 | 2897 |
2894 void addConstant(ir.Primitive constant) => constants.add(constant); | 2898 void addConstant(ir.Primitive constant) => constants.add(constant); |
2895 } | 2899 } |
OLD | NEW |