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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.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) 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 dart2js.ir_nodes_sexpr; 5 library dart2js.ir_nodes_sexpr;
6 6
7 import '../constants/values.dart'; 7 import '../constants/values.dart';
8 import '../util/util.dart'; 8 import '../util/util.dart';
9 import 'cps_ir_nodes.dart'; 9 import 'cps_ir_nodes.dart';
10 import '../universe/universe.dart' show Selector, CallStructure; 10 import '../universe/universe.dart' show Selector, CallStructure;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 String args = node.arguments.map(access).join(' '); 319 String args = node.arguments.map(access).join(' ');
320 return '(CreateInvocationMirror $selector ($args))'; 320 return '(CreateInvocationMirror $selector ($args))';
321 } 321 }
322 322
323 String visitApplyBuiltinOperator(ApplyBuiltinOperator node) { 323 String visitApplyBuiltinOperator(ApplyBuiltinOperator node) {
324 String operator = node.operator.toString(); 324 String operator = node.operator.toString();
325 String args = node.arguments.map(access).join(' '); 325 String args = node.arguments.map(access).join(' ');
326 return '(ApplyBuiltinOperator $operator ($args))'; 326 return '(ApplyBuiltinOperator $operator ($args))';
327 } 327 }
328 328
329 String visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
330 String method = node.method.toString();
331 String receiver = access(node.receiver);
332 String args = node.arguments.map(access).join(' ');
333 return '(ApplyBuiltinMethod $method $receiver ($args))';
334 }
335
329 String visitForeignCode(ForeignCode node) { 336 String visitForeignCode(ForeignCode node) {
330 String arguments = node.arguments.map(access).join(' '); 337 String arguments = node.arguments.map(access).join(' ');
331 String continuation = node.continuation == null ? '' 338 String continuation = node.continuation == null ? ''
332 : ' ${access(node.continuation)}'; 339 : ' ${access(node.continuation)}';
333 return '(JS ${node.type} ${node.codeTemplate} ($arguments)$continuation)'; 340 return '(JS ${node.type} ${node.codeTemplate} ($arguments)$continuation)';
334 } 341 }
335 342
336 String visitGetLength(GetLength node) { 343 String visitGetLength(GetLength node) {
337 String object = access(node.object); 344 String object = access(node.object);
338 return '(GetLength $object)'; 345 return '(GetLength $object)';
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 void setReturnContinuation(Continuation node) { 471 void setReturnContinuation(Continuation node) {
465 assert(!_names.containsKey(node) || _names[node] == 'return'); 472 assert(!_names.containsKey(node) || _names[node] == 'return');
466 _names[node] = 'return'; 473 _names[node] = 'return';
467 } 474 }
468 475
469 String getName(Node node) { 476 String getName(Node node) {
470 if (!_names.containsKey(node)) return 'MISSING_NAME'; 477 if (!_names.containsKey(node)) return 'MISSING_NAME';
471 return _names[node]; 478 return _names[node];
472 } 479 }
473 } 480 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698