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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 1195573003: dart2js cps: Refactor and optimize string concatenations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Revert doc comment change 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
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 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (node.target.name.isEmpty) { 166 if (node.target.name.isEmpty) {
167 callName = '${className}'; 167 callName = '${className}';
168 } else { 168 } else {
169 callName = '${className}.${node.target.name}'; 169 callName = '${className}.${node.target.name}';
170 } 170 }
171 String cont = access(node.continuation); 171 String cont = access(node.continuation);
172 String args = formatArguments(node); 172 String args = formatArguments(node);
173 return '$indentation(InvokeConstructor $callName $args $cont)'; 173 return '$indentation(InvokeConstructor $callName $args $cont)';
174 } 174 }
175 175
176 String visitConcatenateStrings(ConcatenateStrings node) {
177 String cont = access(node.continuation);
178 String args = node.arguments.map(access).join(' ');
179 return '$indentation(ConcatenateStrings ($args) $cont)';
180 }
181
182 String visitInvokeContinuation(InvokeContinuation node) { 176 String visitInvokeContinuation(InvokeContinuation node) {
183 String name = access(node.continuation); 177 String name = access(node.continuation);
184 if (node.isRecursive) name = 'rec $name'; 178 if (node.isRecursive) name = 'rec $name';
185 String args = node.arguments.map(access).join(' '); 179 String args = node.arguments.map(access).join(' ');
186 return '$indentation(InvokeContinuation $name ($args))'; 180 return '$indentation(InvokeContinuation $name ($args))';
187 } 181 }
188 182
189 String visitThrow(Throw node) { 183 String visitThrow(Throw node) {
190 String value = access(node.value); 184 String value = access(node.value);
191 return '$indentation(Throw $value)'; 185 return '$indentation(Throw $value)';
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 void setReturnContinuation(Continuation node) { 453 void setReturnContinuation(Continuation node) {
460 assert(!_names.containsKey(node) || _names[node] == 'return'); 454 assert(!_names.containsKey(node) || _names[node] == 'return');
461 _names[node] = 'return'; 455 _names[node] = 'return';
462 } 456 }
463 457
464 String getName(Node node) { 458 String getName(Node node) {
465 if (!_names.containsKey(node)) return 'MISSING_NAME'; 459 if (!_names.containsKey(node)) return 'MISSING_NAME';
466 return _names[node]; 460 return _names[node];
467 } 461 }
468 } 462 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698