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

Side by Side Diff: frog/leg/ssa/codegen.dart

Issue 9642001: Make string juxtaposition combine properly with string interpolations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments. Created 8 years, 9 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA code generator'; 7 String get name() => 'SSA code generator';
8 8
9 String generate(WorkItem work, HGraph graph) { 9 String generate(WorkItem work, HGraph graph) {
10 return measure(() { 10 return measure(() {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 abstract startThen(HIf node); 137 abstract startThen(HIf node);
138 abstract endThen(HIf node); 138 abstract endThen(HIf node);
139 abstract startElse(HIf node); 139 abstract startElse(HIf node);
140 abstract endElse(HIf node); 140 abstract endElse(HIf node);
141 141
142 void beginExpression(int precedence) { 142 void beginExpression(int precedence) {
143 if (precedence < expectedPrecedence) { 143 if (precedence < expectedPrecedence) {
144 buffer.add('('); 144 buffer.add('(');
145 } 145 }
146 } 146 }
147
147 void endExpression(int precedence) { 148 void endExpression(int precedence) {
148 if (precedence < expectedPrecedence) { 149 if (precedence < expectedPrecedence) {
149 buffer.add(')'); 150 buffer.add(')');
150 } 151 }
151 } 152 }
152 153
153 visitGraph(HGraph graph) { 154 visitGraph(HGraph graph) {
154 currentGraph = graph; 155 currentGraph = graph;
155 indent++; // We are already inside a function. 156 indent++; // We are already inside a function.
156 subGraph = new SubGraph(graph.entry, graph.exit); 157 subGraph = new SubGraph(graph.entry, graph.exit);
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 // need to work together to avoid the parenthesis. See r4928 for an 665 // need to work together to avoid the parenthesis. See r4928 for an
665 // implementation that still dealt with precedence. 666 // implementation that still dealt with precedence.
666 ConstantHandler handler = compiler.constantHandler; 667 ConstantHandler handler = compiler.constantHandler;
667 String name = handler.getNameForConstant(node.constant); 668 String name = handler.getNameForConstant(node.constant);
668 if (name === null) { 669 if (name === null) {
669 assert(!node.constant.isObject()); 670 assert(!node.constant.isObject());
670 node.constant.writeJsCode(buffer, handler); 671 node.constant.writeJsCode(buffer, handler);
671 } else { 672 } else {
672 buffer.add(compiler.namer.CURRENT_ISOLATE); 673 buffer.add(compiler.namer.CURRENT_ISOLATE);
673 buffer.add("."); 674 buffer.add(".");
674 buffer.add(name); 675 buffer.add(name);
675 } 676 }
676 } 677 }
677 678
678 visitLoopBranch(HLoopBranch node) { 679 visitLoopBranch(HLoopBranch node) {
679 HBasicBlock branchBlock = currentBlock; 680 HBasicBlock branchBlock = currentBlock;
680 handleLoopCondition(node); 681 handleLoopCondition(node);
681 List<HBasicBlock> dominated = currentBlock.dominatedBlocks; 682 List<HBasicBlock> dominated = currentBlock.dominatedBlocks;
682 // For a do while loop, the body has already been visited. 683 // For a do while loop, the body has already been visited.
683 if (!node.isDoWhile()) { 684 if (!node.isDoWhile()) {
684 visitBasicBlock(dominated[0]); 685 visitBasicBlock(dominated[0]);
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 startBailoutSwitch(); 1392 startBailoutSwitch();
1392 } 1393 }
1393 } 1394 }
1394 1395
1395 void endElse(HIf node) { 1396 void endElse(HIf node) {
1396 if (node.elseBlock.hasBailouts()) { 1397 if (node.elseBlock.hasBailouts()) {
1397 endBailoutSwitch(); 1398 endBailoutSwitch();
1398 } 1399 }
1399 } 1400 }
1400 } 1401 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698