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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart

Issue 14969004: Implement continue for switch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment updated. Created 7 years, 7 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index 592dfa1b67ed01b83ac272355212b62baf56aa58..352e3719471bd8b720a002fe5e5542603be948a2 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -1673,7 +1673,7 @@ class HBitNot extends HInvokeUnary {
instructionType = HType.INTEGER;
}
accept(HVisitor visitor) => visitor.visitBitNot(this);
-
+
UnaryOperation operation(ConstantSystem constantSystem)
=> constantSystem.bitNot;
int typeCode() => HInstruction.BIT_NOT_TYPECODE;
@@ -1702,8 +1702,16 @@ abstract class HJump extends HControlFlow {
}
class HBreak extends HJump {
- HBreak(TargetElement target) : super(target);
- HBreak.toLabel(LabelElement label) : super.toLabel(label);
+ /**
+ * Signals that this is a special break instruction for the synthetic loop
+ * generatedfor a switch statement with continue statements. See
+ * [SsaBuilder.buildComplexSwitchStatement] for detail.
+ */
+ final bool breakSwitchContinueLoop;
+ HBreak(TargetElement target, {bool this.breakSwitchContinueLoop: false})
+ : super(target);
+ HBreak.toLabel(LabelElement label)
+ : breakSwitchContinueLoop = false, super.toLabel(label);
toString() => (label != null) ? 'break ${label.labelName}' : 'break';
accept(HVisitor visitor) => visitor.visitBreak(this);
}
@@ -2468,6 +2476,8 @@ class LoopTypeVisitor extends Visitor {
int visitFor(For node) => HLoopBlockInformation.FOR_LOOP;
int visitDoWhile(DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP;
int visitForIn(ForIn node) => HLoopBlockInformation.FOR_IN_LOOP;
+ int visitSwitchStatement(SwitchStatement node) =>
+ HLoopBlockInformation.SWITCH_CONTINUE_LOOP;
}
class HLoopBlockInformation implements HStatementInformation {
@@ -2475,6 +2485,7 @@ class HLoopBlockInformation implements HStatementInformation {
static const int FOR_LOOP = 1;
static const int DO_WHILE_LOOP = 2;
static const int FOR_IN_LOOP = 3;
+ static const int SWITCH_CONTINUE_LOOP = 4;
static const int NOT_A_LOOP = -1;
final int kind;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698