| 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 89be18055f4cd9ae13848700598f4035227cb020..2eb8faa652971dd10d0ce8635695b03d76c3482f 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
|
| @@ -1090,6 +1090,8 @@ abstract class HInstruction implements Spannable {
|
| } else if (kind == HTypeConversion.BOOLEAN_CONVERSION_CHECK) {
|
| // Boolean conversion checks work on non-nullable booleans.
|
| return new HTypeConversion(type, kind, HType.BOOLEAN, this);
|
| + } else if (kind == HTypeConversion.CHECKED_MODE_CHECK && !type.isRaw) {
|
| + throw 'creating compound check to $type (this = ${this})';
|
| } else {
|
| HType subtype = new HType.subtype(type, compiler);
|
| return new HTypeConversion(type, kind, subtype, this);
|
| @@ -2155,7 +2157,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;
|
| @@ -2222,6 +2223,23 @@ class HTypeConversion extends HCheck {
|
| instructionType = type;
|
| }
|
|
|
| + HTypeConversion.withTypeRepresentation(this.typeExpression, this.kind,
|
| + HType type, HInstruction input,
|
| + HInstruction typeRepresentation)
|
| + : super(<HInstruction>[input, typeRepresentation]),
|
| + receiverTypeCheckSelector = null {
|
| + sourceElement = input.sourceElement;
|
| + instructionType = type;
|
| + }
|
| +
|
| + bool get hasTypeRepresentation => inputs.length > 1;
|
| + HInstruction get typeRepresentation => inputs[1];
|
| +
|
| + HInstruction convertType(Compiler compiler, DartType type, int kind) {
|
| + if (typeExpression == type) return this;
|
| + return super.convertType(compiler, type, kind);
|
| + }
|
| +
|
| bool get isChecked => kind != NO_CHECK;
|
| bool get isCheckedModeCheck {
|
| return kind == CHECKED_MODE_CHECK
|
|
|