| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |