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

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

Issue 10511007: Make HBreak and HContinue not extend HGoto. They now extend HJump which is independent of HGoto. To… (Closed) Base URL: https://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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/nodes.dart
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index d9f52e8b6f2dfe35ee473f6fd373049149999bd3..a6d20d5cadabd7571ef94d10d6b072b6b78b52d1 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -254,8 +254,8 @@ class HBaseVisitor extends HGraphVisitor implements HVisitor {
visitBitXor(HBitXor node) => visitBinaryBitOp(node);
visitBoolify(HBoolify node) => visitInstruction(node);
visitBoundsCheck(HBoundsCheck node) => visitCheck(node);
- visitBreak(HBreak node) => visitGoto(node);
- visitContinue(HContinue node) => visitGoto(node);
+ visitBreak(HBreak node) => visitJump(node);
+ visitContinue(HContinue node) => visitJump(node);
visitCheck(HCheck node) => visitInstruction(node);
visitConstant(HConstant node) => visitInstruction(node);
visitDivide(HDivide node) => visitBinaryArithmetic(node);
@@ -285,6 +285,7 @@ class HBaseVisitor extends HGraphVisitor implements HVisitor {
=> visitInvokeStatic(node);
visitInvokeStatic(HInvokeStatic node) => visitInvoke(node);
visitInvokeSuper(HInvokeSuper node) => visitInvoke(node);
+ visitJump(HJump node) => visitControlFlow(node);
visitLess(HLess node) => visitRelational(node);
visitLessEqual(HLessEqual node) => visitRelational(node);
visitLiteralList(HLiteralList node) => visitInstruction(node);
@@ -1661,20 +1662,24 @@ class HGoto extends HControlFlow {
accept(HVisitor visitor) => visitor.visitGoto(this);
}
-class HBreak extends HGoto {
+abstract class HJump extends HControlFlow {
final TargetElement target;
final LabelElement label;
- HBreak(this.target) : label = null;
- HBreak.toLabel(LabelElement label) : label = label, target = label.target;
+ HJump(this.target) : label = null, super(const <HInstruction>[]);
+ HJump.toLabel(LabelElement label)
+ : label = label, target = label.target, super(const <HInstruction>[]);
+}
+
+class HBreak extends HJump {
+ HBreak(TargetElement target) : super(target);
+ HBreak.toLabel(LabelElement label) : super.toLabel(label);
toString() => (label !== null) ? 'break ${label.labelName}' : 'break';
accept(HVisitor visitor) => visitor.visitBreak(this);
}
-class HContinue extends HGoto {
- final TargetElement target;
- final LabelElement label;
- HContinue(this.target) : label = null;
- HContinue.toLabel(LabelElement label) : label = label, target = label.target;
+class HContinue extends HJump {
+ HContinue(TargetElement target) : super(target);
+ HContinue.toLabel(LabelElement label) : super.toLabel(label);
toString() => (label !== null) ? 'continue ${label.labelName}' : 'continue';
accept(HVisitor visitor) => visitor.visitContinue(this);
}

Powered by Google App Engine
This is Rietveld 408576698