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

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

Issue 1616143003: Lower map literals to constructor or function calls in builder (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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) 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 285 }
286 286
287 Expression visitLiteralList(LiteralList node) { 287 Expression visitLiteralList(LiteralList node) {
288 super.visitLiteralList(node); 288 super.visitLiteralList(node);
289 if (node.type != null) { 289 if (node.type != null) {
290 ++impureCounter; // Type casts can throw. 290 ++impureCounter; // Type casts can throw.
291 } 291 }
292 return node; 292 return node;
293 } 293 }
294 294
295 Expression visitLiteralMap(LiteralMap node) {
296 super.visitLiteralMap(node);
297 if (node.type != null) {
298 ++impureCounter; // Type casts can throw.
299 }
300 return node;
301 }
302
303 Expression visitTypeOperator(TypeOperator node) { 295 Expression visitTypeOperator(TypeOperator node) {
304 super.visitTypeOperator(node); 296 super.visitTypeOperator(node);
305 if (!node.isTypeTest) { 297 if (!node.isTypeTest) {
306 ++impureCounter; // Type casts can throw. 298 ++impureCounter; // Type casts can throw.
307 } 299 }
308 return node; 300 return node;
309 } 301 }
310 302
311 Expression visitGetField(GetField node) { 303 Expression visitGetField(GetField node) {
312 super.visitGetField(node); 304 super.visitGetField(node);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 364
373 @override 365 @override
374 Expression visitForeignExpression(ForeignExpression node) { 366 Expression visitForeignExpression(ForeignExpression node) {
375 rewriteList(node.arguments); 367 rewriteList(node.arguments);
376 if (node.nativeBehavior.sideEffects.hasSideEffects()) { 368 if (node.nativeBehavior.sideEffects.hasSideEffects()) {
377 ++impureCounter; 369 ++impureCounter;
378 } 370 }
379 return node; 371 return node;
380 } 372 }
381 } 373 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698