Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 1353843002: dart2js cps: Support sync* and yield. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '../common/names.dart' show 7 import '../common/names.dart' show
8 Names, 8 Names,
9 Selectors; 9 Selectors;
10 import '../compile_time_constants.dart' show 10 import '../compile_time_constants.dart' show
(...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after
2799 ir.Primitive buildStringify(ir.Primitive value) { 2799 ir.Primitive buildStringify(ir.Primitive value) {
2800 return buildStaticFunctionInvocation( 2800 return buildStaticFunctionInvocation(
2801 program.stringifyFunction, 2801 program.stringifyFunction,
2802 new CallStructure.unnamed(1), 2802 new CallStructure.unnamed(1),
2803 <ir.Primitive>[value]); 2803 <ir.Primitive>[value]);
2804 } 2804 }
2805 2805
2806 ir.Node buildAwait(ir.Primitive value) { 2806 ir.Node buildAwait(ir.Primitive value) {
2807 return _continueWithExpression((k) => new ir.Await(value, k)); 2807 return _continueWithExpression((k) => new ir.Await(value, k));
2808 } 2808 }
2809
2810 void buildYield(ir.Primitive value, bool hasStar) {
2811 _continueWithExpression((k) {
2812 return new ir.Yield(value, hasStar, k);
2813 });
2814 }
2809 } 2815 }
2810 2816
2811
2812 /// Location of a variable relative to a given closure. 2817 /// Location of a variable relative to a given closure.
2813 class ClosureLocation { 2818 class ClosureLocation {
2814 /// If not `null`, this location is [box].[field]. 2819 /// If not `null`, this location is [box].[field].
2815 /// The location of [box] can be obtained separately from an 2820 /// The location of [box] can be obtained separately from an
2816 /// enclosing [ClosureEnvironment] or [ClosureScope]. 2821 /// enclosing [ClosureEnvironment] or [ClosureScope].
2817 /// If `null`, then the location is [field] on the enclosing function object. 2822 /// If `null`, then the location is [field] on the enclosing function object.
2818 final BoxLocal box; 2823 final BoxLocal box;
2819 2824
2820 /// The field in which the variable is stored. 2825 /// The field in which the variable is stored.
2821 final Entity field; 2826 final Entity field;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 } 2885 }
2881 2886
2882 class SwitchCaseInfo { 2887 class SwitchCaseInfo {
2883 final List<ir.Primitive> constants = <ir.Primitive>[]; 2888 final List<ir.Primitive> constants = <ir.Primitive>[];
2884 final SubbuildFunction buildBody; 2889 final SubbuildFunction buildBody;
2885 2890
2886 SwitchCaseInfo(this.buildBody); 2891 SwitchCaseInfo(this.buildBody);
2887 2892
2888 void addConstant(ir.Primitive constant) => constants.add(constant); 2893 void addConstant(ir.Primitive constant) => constants.add(constant);
2889 } 2894 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698