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

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

Issue 1285173002: dart2js cps: Rewrite more List operations into JS array operations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: receiverIsNotNull -> optional param 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) 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 Expression visitFunctionExpression(FunctionExpression node) { 340 Expression visitFunctionExpression(FunctionExpression node) {
341 visitInnerFunction(node.definition); 341 visitInnerFunction(node.definition);
342 return node; 342 return node;
343 } 343 }
344 344
345 Expression visitApplyBuiltinOperator(ApplyBuiltinOperator node) { 345 Expression visitApplyBuiltinOperator(ApplyBuiltinOperator node) {
346 rewriteList(node.arguments); 346 rewriteList(node.arguments);
347 return node; 347 return node;
348 } 348 }
349 349
350 Expression visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
351 node.receiver = visitExpression(node.receiver);
352 if (!node.receiverIsNotNull) {
353 // If the receiver is null, the method lookup throws.
354 ++impureCounter;
355 }
356 rewriteList(node.arguments);
357 ++impureCounter;
358 return node;
359 }
360
350 @override 361 @override
351 Expression visitForeignExpression(ForeignExpression node) { 362 Expression visitForeignExpression(ForeignExpression node) {
352 rewriteList(node.arguments); 363 rewriteList(node.arguments);
353 if (node.nativeBehavior.sideEffects.hasSideEffects()) { 364 if (node.nativeBehavior.sideEffects.hasSideEffects()) {
354 ++impureCounter; 365 ++impureCounter;
355 } 366 }
356 return node; 367 return node;
357 } 368 }
358 } 369 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698