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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 tree_ir.optimization.statement_rewriter; 5 library tree_ir.optimization.statement_rewriter;
6 6
7 import 'optimization.dart' show Pass; 7 import 'optimization.dart' show Pass;
8 import '../tree_ir_nodes.dart'; 8 import '../tree_ir_nodes.dart';
9 import '../../io/source_information.dart'; 9 import '../../io/source_information.dart';
10 10
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 Expression visitForeignExpression(ForeignExpression node) { 1100 Expression visitForeignExpression(ForeignExpression node) {
1101 _rewriteList(node.arguments); 1101 _rewriteList(node.arguments);
1102 return node; 1102 return node;
1103 } 1103 }
1104 1104
1105 @override 1105 @override
1106 Statement visitForeignStatement(ForeignStatement node) { 1106 Statement visitForeignStatement(ForeignStatement node) {
1107 _rewriteList(node.arguments); 1107 _rewriteList(node.arguments);
1108 return node; 1108 return node;
1109 } 1109 }
1110
1111 @override
1112 Expression visitAwait(Await node) {
1113 return node;
1114 }
1110 } 1115 }
1111 1116
1112 /// Result of combining two expressions, with the potential for reverting the 1117 /// Result of combining two expressions, with the potential for reverting the
1113 /// combination. 1118 /// combination.
1114 /// 1119 ///
1115 /// Reverting a combination is done by calling [uncombine]. In this case, 1120 /// Reverting a combination is done by calling [uncombine]. In this case,
1116 /// both the original expressions should remain in the tree, and the [combined] 1121 /// both the original expressions should remain in the tree, and the [combined]
1117 /// expression should be orphaned. 1122 /// expression should be orphaned.
1118 /// 1123 ///
1119 /// Explicitly reverting a combination is necessary to maintain variable 1124 /// Explicitly reverting a combination is necessary to maintain variable
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 VariableUseVisitor(this.callback); 1202 VariableUseVisitor(this.callback);
1198 1203
1199 visitVariableUse(VariableUse use) => callback(use); 1204 visitVariableUse(VariableUse use) => callback(use);
1200 1205
1201 visitInnerFunction(FunctionDefinition node) {} 1206 visitInnerFunction(FunctionDefinition node) {}
1202 1207
1203 static void visit(Expression node, VariableUseCallback callback) { 1208 static void visit(Expression node, VariableUseCallback callback) {
1204 new VariableUseVisitor(callback).visitExpression(node); 1209 new VariableUseVisitor(callback).visitExpression(node);
1205 } 1210 }
1206 } 1211 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698