| 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 c1b9796ec9cbe58f70e8ea5889df11e536d25935..3dada638bcdb7da3150efe2f22a810a44cab6855 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
|
| @@ -2177,7 +2177,6 @@ class HIndexAssign extends HInstruction {
|
| HInstruction get value => inputs[2];
|
| }
|
|
|
| -// TODO(karlklose): use this class to represent type conversions as well.
|
| class HIs extends HInstruction {
|
| /// A check against a raw type: 'o is int', 'o is A'.
|
| static const int RAW_CHECK = 0;
|
| @@ -2185,16 +2184,26 @@ class HIs extends HInstruction {
|
| static const int COMPOUND_CHECK = 1;
|
| /// A check against a single type variable: 'o is T'.
|
| static const int VARIABLE_CHECK = 2;
|
| + /// A checked-mode check against a raw type.
|
| + static const int RAW_ASSERT = 3;
|
|
|
| final DartType typeExpression;
|
| final bool nullOk;
|
| final int kind;
|
| + final bool isCheckedModeTest;
|
|
|
| HIs(this.typeExpression, List<HInstruction> inputs, this.kind,
|
| - {this.nullOk: false}) : super(inputs) {
|
| - assert(kind >= RAW_CHECK && kind <= VARIABLE_CHECK);
|
| - setUseGvn();
|
| - instructionType = HType.BOOLEAN;
|
| + this.isCheckedModeTest, HType instructionType, {this.nullOk: false})
|
| + : super(inputs) {
|
| + assert(kind >= RAW_CHECK && kind <= RAW_ASSERT);
|
| + assert(isCheckedModeTest || instructionType == HType.BOOLEAN);
|
| + assert(isCheckedModeTest || instructionType != RAW_ASSERT);
|
| + if (isCheckedModeTest) {
|
| + setAllSideEffects();
|
| + } else {
|
| + setUseGvn();
|
| + }
|
| + this.instructionType = instructionType;
|
| }
|
|
|
| HInstruction get expression => inputs[0];
|
| @@ -2204,6 +2213,7 @@ class HIs extends HInstruction {
|
| return inputs[1];
|
| }
|
|
|
| + bool canThrow() => isCheckedModeTest;
|
| bool get isRawCheck => kind == RAW_CHECK;
|
| bool get isVariableCheck => kind == VARIABLE_CHECK;
|
| bool get isCompoundCheck => kind == COMPOUND_CHECK;
|
|
|