Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
index 8b6b0dcd553b71fbbb9af25752ded0bc7633d4d9..b71cd81d9ac20c8c80cbb68c9153c73b147f7f53 100644 |
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
@@ -2398,29 +2398,14 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
checkType(input, type); |
attachLocationToLast(node); |
} |
- if (node.hasTypeInfo()) { |
+ if (node.hasArgumentChecks()) { |
InterfaceType interfaceType = type; |
ClassElement cls = type.element; |
Link<DartType> arguments = interfaceType.typeArguments; |
js.Expression result = pop(); |
- for (TypeVariableType typeVariable in cls.typeVariables) { |
- use(node.typeInfoCall); |
- int index = RuntimeTypeInformation.getTypeVariableIndex(typeVariable); |
- js.PropertyAccess field = new js.PropertyAccess.indexed(pop(), index); |
- // Also test for 'undefined' in case the object does not have |
- // any type variable. |
- js.Prefix undefinedTest = new js.Prefix('!', field); |
- if (arguments.head == compiler.types.dynamicType) { |
- result = new js.Binary('&&', result, undefinedTest); |
- } else { |
- RuntimeTypeInformation rti = backend.rti; |
- String typeName = rti.getStringRepresentation(arguments.head); |
- js.Expression genericName = new js.LiteralString("'$typeName'"); |
- js.Binary eqTest = new js.Binary('===', field, genericName); |
- result = new js.Binary( |
- '&&', result, new js.Binary('||', undefinedTest, eqTest)); |
- } |
- arguments = arguments.tail; |
+ for (int i = 0; i < node.checkCount; i++) { |
+ use(node.getCheck(i)); |
+ result = new js.Binary('&&', result, pop()); |
} |
push(result, node); |
} |