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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart

Issue 1686973002: Dart2js CPS: Implement 'await for'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Not all for-in local variables are declared in the for-in. Created 4 years, 10 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 | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | tests/html/html.status » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.pull_into_initializers; 5 library tree_ir.optimization.pull_into_initializers;
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 9
10 /// Where a variable has been assigned. 10 /// Where a variable has been assigned.
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 ++impureCounter; 258 ++impureCounter;
259 return node; 259 return node;
260 } 260 }
261 261
262 Expression visitOneShotInterceptor(OneShotInterceptor node) { 262 Expression visitOneShotInterceptor(OneShotInterceptor node) {
263 super.visitOneShotInterceptor(node); 263 super.visitOneShotInterceptor(node);
264 ++impureCounter; 264 ++impureCounter;
265 return node; 265 return node;
266 } 266 }
267 267
268 Expression visitAwait(Await node) {
269 super.visitAwait(node);
270 ++impureCounter;
271 return node;
272 }
273
268 Expression visitConditional(Conditional node) { 274 Expression visitConditional(Conditional node) {
269 node.condition = visitExpression(node.condition); 275 node.condition = visitExpression(node.condition);
270 // Visit the branches to detect impure subexpressions, but do not pull 276 // Visit the branches to detect impure subexpressions, but do not pull
271 // expressions out of the branch. 277 // expressions out of the branch.
272 ++branchCounter; 278 ++branchCounter;
273 node.thenExpression = visitExpression(node.thenExpression); 279 node.thenExpression = visitExpression(node.thenExpression);
274 node.elseExpression = visitExpression(node.elseExpression); 280 node.elseExpression = visitExpression(node.elseExpression);
275 --branchCounter; 281 --branchCounter;
276 return node; 282 return node;
277 } 283 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 370
365 @override 371 @override
366 Expression visitForeignExpression(ForeignExpression node) { 372 Expression visitForeignExpression(ForeignExpression node) {
367 rewriteList(node.arguments); 373 rewriteList(node.arguments);
368 if (node.nativeBehavior.sideEffects.hasSideEffects()) { 374 if (node.nativeBehavior.sideEffects.hasSideEffects()) {
369 ++impureCounter; 375 ++impureCounter;
370 } 376 }
371 return node; 377 return node;
372 } 378 }
373 } 379 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698