| Index: pkg/compiler/lib/src/ssa/optimize.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
|
| index 2ac63daee04c0f4b8830ef960e51622d190b007b..5b617e2210d7a53b52fe9920c0f3e7443ca1dfea 100644
|
| --- a/pkg/compiler/lib/src/ssa/optimize.dart
|
| +++ b/pkg/compiler/lib/src/ssa/optimize.dart
|
| @@ -903,10 +903,9 @@ class SsaInstructionSimplifier extends HBaseVisitor
|
| if (type.isContainer && type.length != null) {
|
| HInstruction constant = graph.addConstantInt(type.length, closedWorld);
|
| if (type.isNullable) {
|
| - // If the container can be null, we update all uses of the
|
| - // length access to use the constant instead, but keep the
|
| - // length access in the graph, to ensure we still have a
|
| - // null check.
|
| + // If the container can be null, we update all uses of the length
|
| + // access to use the constant instead, but keep the length access in
|
| + // the graph, to ensure we still have a null check.
|
| node.block.rewrite(node, constant);
|
| return node;
|
| } else {
|
| @@ -914,6 +913,14 @@ class SsaInstructionSimplifier extends HBaseVisitor
|
| }
|
| }
|
| }
|
| +
|
| + if (node.isAssignable &&
|
| + isFixedLength(receiver.instructionType, closedWorld)) {
|
| + // The input type has changed to fixed-length so change to an unassignable
|
| + // HGetLength to allow more GVN optimizations.
|
| + return new HGetLength(receiver, node.instructionType,
|
| + isAssignable: false);
|
| + }
|
| return node;
|
| }
|
|
|
|
|