Index: lib/compiler/implementation/ssa/optimize.dart |
=================================================================== |
--- lib/compiler/implementation/ssa/optimize.dart (revision 11954) |
+++ lib/compiler/implementation/ssa/optimize.dart (working copy) |
@@ -627,7 +627,16 @@ |
Element field = |
findConcreteFieldForDynamicAccess(node.receiver, node.selector); |
if (field === null) return node; |
- return new HFieldSet(field, node.inputs[0], node.inputs[1]); |
+ HInstruction value = node.inputs[1]; |
+ if (compiler.enableTypeAssertions) { |
+ HInstruction other = value.convertType( |
+ compiler, field, HTypeConversion.CHECKED_MODE_CHECK); |
+ if (other != value) { |
+ node.block.addBefore(node, other); |
+ value = other; |
+ } |
+ } |
+ return new HFieldSet(field, node.inputs[0], value); |
} |
HInstruction visitStringConcat(HStringConcat node) { |