Index: lib/compiler/implementation/ssa/nodes.dart |
=================================================================== |
--- lib/compiler/implementation/ssa/nodes.dart (revision 8378) |
+++ lib/compiler/implementation/ssa/nodes.dart (working copy) |
@@ -964,16 +964,27 @@ |
bool dataEquals(HInstruction other) => true; |
} |
-class HCheck extends HInstruction { |
+/** |
+ * A [HCheck] instruction is an instruction that might do a dynamic |
+ * check at runtime on another instruction. To have proper instruction |
+ * dependencies in the graph, instructions that depend on the check |
+ * being done reference the [HCheck] instruction instead of the |
+ * instruction itself. |
+ */ |
+abstract class HCheck extends HInstruction { |
HCheck(inputs) : super(inputs); |
- |
- // TODO(floitsch): make class abstract instead of adding an abstract method. |
- abstract accept(HVisitor visitor); |
- |
HInstruction get checkedInput() => inputs[0]; |
} |
-class HTypeGuard extends HCheck { |
+/** |
+ * A [HCheckStatement] instruction is a [HCheck instruction] that |
+ * cannot be generated as an expression. |
+ */ |
+abstract class HCheckStatement extends HCheck { |
+ HCheckStatement(inputs) : super(inputs); |
+} |
+ |
+class HTypeGuard extends HCheckStatement { |
final int state; |
final HType guardedType; |
bool isOn = false; |
@@ -1001,7 +1012,7 @@ |
bool dataEquals(HTypeGuard other) => guardedType == other.guardedType; |
} |
-class HBoundsCheck extends HCheck { |
+class HBoundsCheck extends HCheckStatement { |
static final int ALWAYS_FALSE = 0; |
static final int FULL_CHECK = 1; |
static final int ALWAYS_ABOVE_ZERO = 2; |
@@ -1031,7 +1042,7 @@ |
bool dataEquals(HInstruction other) => true; |
} |
-class HIntegerCheck extends HCheck { |
+class HIntegerCheck extends HCheckStatement { |
bool alwaysFalse = false; |
HIntegerCheck(value) : super(<HInstruction>[value]); |