Index: dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
=================================================================== |
--- dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 29808) |
+++ dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy) |
@@ -2024,6 +2024,8 @@ |
push(attachPosition(instruction, node)); |
} |
+ HInstruction peek() => stack.last; |
+ |
HInstruction pop() { |
return stack.removeLast(); |
} |
@@ -4519,6 +4521,17 @@ |
} |
} |
+ void setRtiIfNeeded(HInstruction object, Node node) { |
+ InterfaceType type = elements.getType(node); |
+ if (!backend.classNeedsRti(type.element) || type.treatAsRaw) return; |
+ List<HInstruction> arguments = <HInstruction>[]; |
+ for (DartType argument in type.typeArguments) { |
+ arguments.add(analyzeTypeArgument(argument)); |
+ } |
+ callSetRuntimeTypeInfo(type.element, arguments, object); |
+ compiler.enqueuer.codegen.registerInstantiatedType(type, elements); |
+ } |
+ |
visitLiteralList(LiteralList node) { |
HInstruction instruction; |
@@ -4534,6 +4547,7 @@ |
} |
instruction = buildLiteralList(inputs); |
add(instruction); |
+ setRtiIfNeeded(instruction, node); |
} |
TypeMask type = |
@@ -4736,6 +4750,7 @@ |
add(keyValuePairs); |
TypeMask mapType = new TypeMask.nonNullSubtype(backend.mapLiteralClass); |
pushInvokeStatic(node, backend.getMapMaker(), [keyValuePairs], mapType); |
+ setRtiIfNeeded(peek(), node); |
} |
visitLiteralMapEntry(LiteralMapEntry node) { |