| Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 30754)
|
| +++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
|
| @@ -214,7 +214,7 @@
|
| Element element = backend.jsIndexableLength;
|
| bool isFixed = isFixedLength(actualReceiver.instructionType, compiler);
|
| HFieldGet result = new HFieldGet(
|
| - element, actualReceiver, backend.intType,
|
| + element, actualReceiver, backend.positiveIntType,
|
| isAssignable: !isFixed);
|
| return result;
|
| } else if (actualReceiver.isConstantMap()) {
|
| @@ -830,12 +830,15 @@
|
| HInstruction indexArgument) {
|
| Compiler compiler = backend.compiler;
|
| HFieldGet length = new HFieldGet(
|
| - backend.jsIndexableLength, array, backend.intType,
|
| + backend.jsIndexableLength, array, backend.positiveIntType,
|
| isAssignable: !isFixedLength(array.instructionType, compiler));
|
| indexNode.block.addBefore(indexNode, length);
|
|
|
| + TypeMask type = indexArgument.isPositiveInteger(compiler)
|
| + ? indexArgument.instructionType
|
| + : backend.positiveIntType;
|
| HBoundsCheck check = new HBoundsCheck(
|
| - indexArgument, length, array, backend.intType);
|
| + indexArgument, length, array, type);
|
| indexNode.block.addBefore(indexNode, check);
|
| // If the index input to the bounds check was not known to be an integer
|
| // then we replace its uses with the bounds check, which is known to be an
|
|
|