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

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

Issue 10542119: Fix switch codegen: indentation is already added. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« no previous file with comments | « no previous file | 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) 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 final JavaScriptBackend backend; 6 final JavaScriptBackend backend;
7 SsaCodeGeneratorTask(JavaScriptBackend backend) 7 SsaCodeGeneratorTask(JavaScriptBackend backend)
8 : this.backend = backend, 8 : this.backend = backend,
9 super(backend.compiler); 9 super(backend.compiler);
10 String get name() => 'SSA code generator'; 10 String get name() => 'SSA code generator';
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 if (!isExpression) { 621 if (!isExpression) {
622 generateStatements(info.expression); 622 generateStatements(info.expression);
623 } 623 }
624 addIndentation(); 624 addIndentation();
625 for (LabelElement label in info.labels) { 625 for (LabelElement label in info.labels) {
626 if (label.isTarget) { 626 if (label.isTarget) {
627 writeLabel(label); 627 writeLabel(label);
628 buffer.add(":"); 628 buffer.add(":");
629 } 629 }
630 } 630 }
631 addIndented("switch ("); 631 buffer.add("switch (");
632 if (isExpression) { 632 if (isExpression) {
633 generateExpression(info.expression); 633 generateExpression(info.expression);
634 } else { 634 } else {
635 use(info.expression.conditionExpression, 635 use(info.expression.conditionExpression,
636 JSPrecedence.EXPRESSION_PRECEDENCE); 636 JSPrecedence.EXPRESSION_PRECEDENCE);
637 } 637 }
638 buffer.add(") {\n"); 638 buffer.add(") {\n");
639 indent++; 639 indent++;
640 for (int i = 0; i < info.matchExpressions.length; i++) { 640 for (int i = 0; i < info.matchExpressions.length; i++) {
641 for (Constant constant in info.matchExpressions[i]) { 641 for (Constant constant in info.matchExpressions[i]) {
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2800 startBailoutSwitch(); 2800 startBailoutSwitch();
2801 } 2801 }
2802 } 2802 }
2803 2803
2804 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { 2804 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) {
2805 if (labeledBlockInfo.body.start.hasGuards()) { 2805 if (labeledBlockInfo.body.start.hasGuards()) {
2806 endBailoutSwitch(); 2806 endBailoutSwitch();
2807 } 2807 }
2808 } 2808 }
2809 } 2809 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698