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

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

Issue 1253333002: dart2js cps: Support async/await by rewriting the JavaScript AST. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rewrite to switch. Created 5 years, 4 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 '../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
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
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 }
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