@@ -634,24 +634,32 @@ class SsaInstructionSimplifier extends HBaseVisitor
634634 return splitInstruction;
635635 }
636636
637- // TODO(sra): Implement tagging with `JSArray<String>` for new rti.
638-
639637 node.block.addBefore (node, splitInstruction);
640638
641- HInstruction stringTypeInfo = new HTypeInfoExpression (
642- TypeInfoExpressionKind .COMPLETE ,
643- _closedWorld.elementEnvironment.getThisType (commonElements.stringClass),
644- < HInstruction > [],
645- _abstractValueDomain.dynamicType);
646- node.block.addBefore (node, stringTypeInfo);
647-
648- HInstruction typeInfo = new HTypeInfoExpression (
649- TypeInfoExpressionKind .INSTANCE ,
650- _closedWorld.elementEnvironment
651- .getThisType (commonElements.jsArrayClass),
652- < HInstruction > [stringTypeInfo],
653- _abstractValueDomain.dynamicType);
654- node.block.addBefore (node, typeInfo);
639+ HInstruction typeInfo;
640+ if (_options.experimentNewRti) {
641+ typeInfo = HLoadType (
642+ _closedWorld.elementEnvironment.createInterfaceType (
643+ commonElements.jsArrayClass, [commonElements.stringType]),
644+ _abstractValueDomain.dynamicType);
645+ node.block.addBefore (node, typeInfo);
646+ } else {
647+ HInstruction stringTypeInfo = new HTypeInfoExpression (
648+ TypeInfoExpressionKind .COMPLETE ,
649+ _closedWorld.elementEnvironment
650+ .getThisType (commonElements.stringClass),
651+ < HInstruction > [],
652+ _abstractValueDomain.dynamicType);
653+ node.block.addBefore (node, stringTypeInfo);
654+
655+ typeInfo = new HTypeInfoExpression (
656+ TypeInfoExpressionKind .INSTANCE ,
657+ _closedWorld.elementEnvironment
658+ .getThisType (commonElements.jsArrayClass),
659+ < HInstruction > [stringTypeInfo],
660+ _abstractValueDomain.dynamicType);
661+ node.block.addBefore (node, typeInfo);
662+ }
655663
656664 HInvokeStatic tagInstruction = new HInvokeStatic (
657665 commonElements.setRuntimeTypeInfo,
0 commit comments