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

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

Issue 1201753004: Revert "dart2js cps: Refactor and optimize string concatenations." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/tree_ir/tree_ir_nodes.dart ('k') | no next file » | 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) 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 tree_ir_tracer; 5 library tree_ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 import '../tracer.dart'; 8 import '../tracer.dart';
9 import 'tree_ir_nodes.dart'; 9 import 'tree_ir_nodes.dart';
10 10
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 if (node.target.name.isEmpty) { 378 if (node.target.name.isEmpty) {
379 callName = '${className}'; 379 callName = '${className}';
380 } else { 380 } else {
381 callName = '${className}.${node.target.name}'; 381 callName = '${className}.${node.target.name}';
382 } 382 }
383 String args = formatArguments(node); 383 String args = formatArguments(node);
384 String keyword = node.constant != null ? 'const' : 'new'; 384 String keyword = node.constant != null ? 'const' : 'new';
385 return "$keyword $callName($args)"; 385 return "$keyword $callName($args)";
386 } 386 }
387 387
388 String visitConcatenateStrings(ConcatenateStrings node) {
389 String args = node.arguments.map(visitExpression).join(', ');
390 return "concat [$args]";
391 }
392
388 String visitLiteralList(LiteralList node) { 393 String visitLiteralList(LiteralList node) {
389 String values = node.values.map(visitExpression).join(', '); 394 String values = node.values.map(visitExpression).join(', ');
390 return "list [$values]"; 395 return "list [$values]";
391 } 396 }
392 397
393 String visitLiteralMap(LiteralMap node) { 398 String visitLiteralMap(LiteralMap node) {
394 List<String> entries = new List<String>(); 399 List<String> entries = new List<String>();
395 node.entries.forEach((LiteralMapEntry entry) { 400 node.entries.forEach((LiteralMapEntry entry) {
396 String key = visitExpression(entry.key); 401 String key = visitExpression(entry.key);
397 String value = visitExpression(entry.value); 402 String value = visitExpression(entry.value);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 String prefix = v.element == null ? 'v' : '${v.element.name}_'; 550 String prefix = v.element == null ? 'v' : '${v.element.name}_';
546 while (name == null || _usedNames.contains(name)) { 551 while (name == null || _usedNames.contains(name)) {
547 name = "$prefix${_counter++}"; 552 name = "$prefix${_counter++}";
548 } 553 }
549 _names[v] = name; 554 _names[v] = name;
550 _usedNames.add(name); 555 _usedNames.add(name);
551 } 556 }
552 return name; 557 return name;
553 } 558 }
554 } 559 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698