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

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

Issue 1195573003: dart2js cps: Refactor and optimize string concatenations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove renegade linebreak 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_tracer; 5 library dart2js.ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 import 'cps_ir_nodes.dart' as cps_ir hide Function; 8 import 'cps_ir_nodes.dart' as cps_ir hide Function;
9 import '../tracer.dart'; 9 import '../tracer.dart';
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (node.target.name.isEmpty) { 168 if (node.target.name.isEmpty) {
169 callName = '${className}'; 169 callName = '${className}';
170 } else { 170 } else {
171 callName = '${className}.${node.target.name}'; 171 callName = '${className}.${node.target.name}';
172 } 172 }
173 String args = node.arguments.map(formatReference).join(', '); 173 String args = node.arguments.map(formatReference).join(', ');
174 String kont = formatReference(node.continuation); 174 String kont = formatReference(node.continuation);
175 printStmt(dummy, "InvokeConstructor $callName ($args) $kont"); 175 printStmt(dummy, "InvokeConstructor $callName ($args) $kont");
176 } 176 }
177 177
178 visitConcatenateStrings(cps_ir.ConcatenateStrings node) {
179 String dummy = names.name(node);
180 String args = node.arguments.map(formatReference).join(', ');
181 String kont = formatReference(node.continuation);
182 printStmt(dummy, "ConcatenateStrings ($args) $kont");
183 }
184
185 visitThrow(cps_ir.Throw node) { 178 visitThrow(cps_ir.Throw node) {
186 String dummy = names.name(node); 179 String dummy = names.name(node);
187 String value = formatReference(node.value); 180 String value = formatReference(node.value);
188 printStmt(dummy, "Throw $value"); 181 printStmt(dummy, "Throw $value");
189 } 182 }
190 183
191 visitRethrow(cps_ir.Rethrow node) { 184 visitRethrow(cps_ir.Rethrow node) {
192 String dummy = names.name(node); 185 String dummy = names.name(node);
193 printStmt(dummy, "Rethrow"); 186 printStmt(dummy, "Rethrow");
194 } 187 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 } 489 }
497 490
498 visitInvokeMethodDirectly(cps_ir.InvokeMethodDirectly exp) { 491 visitInvokeMethodDirectly(cps_ir.InvokeMethodDirectly exp) {
499 addEdgeToContinuation(exp.continuation); 492 addEdgeToContinuation(exp.continuation);
500 } 493 }
501 494
502 visitInvokeConstructor(cps_ir.InvokeConstructor exp) { 495 visitInvokeConstructor(cps_ir.InvokeConstructor exp) {
503 addEdgeToContinuation(exp.continuation); 496 addEdgeToContinuation(exp.continuation);
504 } 497 }
505 498
506 visitConcatenateStrings(cps_ir.ConcatenateStrings exp) {
507 addEdgeToContinuation(exp.continuation);
508 }
509
510 visitThrow(cps_ir.Throw exp) { 499 visitThrow(cps_ir.Throw exp) {
511 } 500 }
512 501
513 visitRethrow(cps_ir.Rethrow exp) { 502 visitRethrow(cps_ir.Rethrow exp) {
514 } 503 }
515 504
516 visitUnreachable(cps_ir.Unreachable node) { 505 visitUnreachable(cps_ir.Unreachable node) {
517 } 506 }
518 507
519 visitSetMutableVariable(cps_ir.SetMutableVariable exp) { 508 visitSetMutableVariable(cps_ir.SetMutableVariable exp) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { 606 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) {
618 unexpectedNode(node); 607 unexpectedNode(node);
619 } 608 }
620 visitTypeTest(cps_ir.TypeTest node) { 609 visitTypeTest(cps_ir.TypeTest node) {
621 unexpectedNode(node); 610 unexpectedNode(node);
622 } 611 }
623 visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) { 612 visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) {
624 unexpectedNode(node); 613 unexpectedNode(node);
625 } 614 }
626 } 615 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698