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

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

Issue 1525163002: dart2js cps: Use oneshot interceptors and 'instanceof' expressions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years 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) 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 ++impureCounter; 252 ++impureCounter;
253 return node; 253 return node;
254 } 254 }
255 255
256 Expression visitInvokeConstructor(InvokeConstructor node) { 256 Expression visitInvokeConstructor(InvokeConstructor node) {
257 super.visitInvokeConstructor(node); 257 super.visitInvokeConstructor(node);
258 ++impureCounter; 258 ++impureCounter;
259 return node; 259 return node;
260 } 260 }
261 261
262 Expression visitOneShotInterceptor(OneShotInterceptor node) {
263 super.visitOneShotInterceptor(node);
264 ++impureCounter;
265 return node;
266 }
267
262 Expression visitConditional(Conditional node) { 268 Expression visitConditional(Conditional node) {
263 node.condition = visitExpression(node.condition); 269 node.condition = visitExpression(node.condition);
264 // Visit the branches to detect impure subexpressions, but do not pull 270 // Visit the branches to detect impure subexpressions, but do not pull
265 // expressions out of the branch. 271 // expressions out of the branch.
266 ++branchCounter; 272 ++branchCounter;
267 node.thenExpression = visitExpression(node.thenExpression); 273 node.thenExpression = visitExpression(node.thenExpression);
268 node.elseExpression = visitExpression(node.elseExpression); 274 node.elseExpression = visitExpression(node.elseExpression);
269 --branchCounter; 275 --branchCounter;
270 return node; 276 return node;
271 } 277 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 372
367 @override 373 @override
368 Expression visitForeignExpression(ForeignExpression node) { 374 Expression visitForeignExpression(ForeignExpression node) {
369 rewriteList(node.arguments); 375 rewriteList(node.arguments);
370 if (node.nativeBehavior.sideEffects.hasSideEffects()) { 376 if (node.nativeBehavior.sideEffects.hasSideEffects()) {
371 ++impureCounter; 377 ++impureCounter;
372 } 378 }
373 return node; 379 return node;
374 } 380 }
375 } 381 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698