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

Side by Side Diff: lib/compiler/implementation/ssa/tracer.dart

Issue 10544026: Simplify generated code for string interpolation by delaying the constant folding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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('tracer'); 5 #library('tracer');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('ssa.dart'); 8 #import('ssa.dart');
9 #import('../leg.dart'); 9 #import('../leg.dart');
10 10
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 String visitShiftRight(HShiftRight node) => visitInvokeStatic(node); 375 String visitShiftRight(HShiftRight node) => visitInvokeStatic(node);
376 376
377 String visitStatic(HStatic node) 377 String visitStatic(HStatic node)
378 => "Static ${node.element.name.slowToString()}"; 378 => "Static ${node.element.name.slowToString()}";
379 String visitStaticStore(HStaticStore node) { 379 String visitStaticStore(HStaticStore node) {
380 String lhs = node.element.name.slowToString(); 380 String lhs = node.element.name.slowToString();
381 return "Static $lhs = ${temporaryId(node.inputs[0])}"; 381 return "Static $lhs = ${temporaryId(node.inputs[0])}";
382 } 382 }
383 383
384 String visitStringConcat(HStringConcat node) {
385 var leftId = temporaryId(node.left);
386 var rightId = temporaryId(node.right);
387 return "StringConcat: $leftId + $rightId";
388 }
389
384 String visitSubtract(HSubtract node) => visitInvokeStatic(node); 390 String visitSubtract(HSubtract node) => visitInvokeStatic(node);
385 391
386 String visitSwitch(HSwitch node) { 392 String visitSwitch(HSwitch node) {
387 StringBuffer buf = new StringBuffer(); 393 StringBuffer buf = new StringBuffer();
388 buf.add("Switch: ("); 394 buf.add("Switch: (");
389 buf.add(temporaryId(node.inputs[0])); 395 buf.add(temporaryId(node.inputs[0]));
390 buf.add(") "); 396 buf.add(") ");
391 for (int i = 1; i < node.inputs.length; i++) { 397 for (int i = 1; i < node.inputs.length; i++) {
392 buf.add(temporaryId(node.inputs[i])); 398 buf.add(temporaryId(node.inputs[i]));
393 buf.add(": B"); 399 buf.add(": B");
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 String visitIs(HIs node) { 463 String visitIs(HIs node) {
458 String type = node.typeExpression.toString(); 464 String type = node.typeExpression.toString();
459 return "TypeTest: ${temporaryId(node.expression)} is $type"; 465 return "TypeTest: ${temporaryId(node.expression)} is $type";
460 } 466 }
461 467
462 String visitTypeConversion(HTypeConversion node) { 468 String visitTypeConversion(HTypeConversion node) {
463 String type = node.propagatedType.toString(); 469 String type = node.propagatedType.toString();
464 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type"; 470 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type";
465 } 471 }
466 } 472 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698