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

Unified Diff: frog/leg/ssa/codegen.dart

Issue 9632018: Switch-implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: frog/leg/ssa/codegen.dart
diff --git a/frog/leg/ssa/codegen.dart b/frog/leg/ssa/codegen.dart
index 3d235b59ca0d022cc58c9e0c85cbc2ff1400adec..d037ced0da86bbc2433f658080b563512ba27d1a 100644
--- a/frog/leg/ssa/codegen.dart
+++ b/frog/leg/ssa/codegen.dart
@@ -240,7 +240,7 @@ class SsaCodeGenerator implements HVisitor {
void handleLabeledBlock(HLabeledBlockInformation labeledBlockInfo) {
addIndentation();
- for (SourceString label in labeledBlockInfo.labels) {
+ for (LabelElement label in labeledBlockInfo.labels) {
addLabel(label);
buffer.add(":");
}
@@ -422,8 +422,8 @@ class SsaCodeGenerator implements HVisitor {
// Used to write the name of labels.
// The default implementation uses the unmodified Dart label name.
// Specializations might change this.
- void addLabel(SourceString label) {
- buffer.add(label.slowToString());
+ void addLabel(LabelElement label) {
+ buffer.add(label.labelName);
}
visitBreak(HBreak node) {
@@ -671,7 +671,7 @@ class SsaCodeGenerator implements HVisitor {
} else {
buffer.add(compiler.namer.CURRENT_ISOLATE);
buffer.add(".");
- buffer.add(name);
+ buffer.add(name);
}
}
@@ -1127,8 +1127,8 @@ class SsaOptimizedCodeGenerator extends SsaCodeGenerator {
void beginLoop(HBasicBlock block) {
addIndentation();
- for (SourceString label in block.loopInformation.labels) {
- buffer.add("${label.slowToString()}:");
+ for (LabelElement label in block.loopInformation.labels) {
+ buffer.add(label.labelName);
}
buffer.add('while (true) {\n');
indent++;
@@ -1294,8 +1294,8 @@ class SsaUnoptimizedCodeGenerator extends SsaCodeGenerator {
// Adds a "$" in front of names of labels from the original source.
// This avoids conflicts with labels introduced by bailouts, which
// starts with a non-"$" character.
- void addLabel(SourceString label) {
- buffer.add("\$$label");
+ void addLabel(LabelElement label) {
+ buffer.add("\$${label.labelName}");
}
void beginLoop(HBasicBlock block) {
@@ -1306,7 +1306,7 @@ class SsaUnoptimizedCodeGenerator extends SsaCodeGenerator {
}
addIndentation();
- for (SourceString label in block.loopInformation.labels) {
+ for (LabelElement label in block.loopInformation.labels) {
addLabel(label);
buffer.add(":");
}

Powered by Google App Engine
This is Rietveld 408576698