| Index: src/ia32/codegen-ia32.cc
|
| diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc
|
| index 736afc63fffa2dd758bb20e541d8a2352a981262..3cb8f5dace148400144592765748aa4aa5a01ee5 100644
|
| --- a/src/ia32/codegen-ia32.cc
|
| +++ b/src/ia32/codegen-ia32.cc
|
| @@ -9952,12 +9952,6 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_type) {
|
| __ CmpObjectType(receiver.reg(), JS_ARRAY_TYPE, tmp.reg());
|
| deferred->Branch(not_equal);
|
|
|
| - // Check that the key is within bounds. Both the key and the length of
|
| - // the JSArray are smis. Use unsigned comparison to handle negative keys.
|
| - __ cmp(key.reg(),
|
| - FieldOperand(receiver.reg(), JSArray::kLengthOffset));
|
| - deferred->Branch(above_equal);
|
| -
|
| // Get the elements array from the receiver and check that it is not a
|
| // dictionary.
|
| __ mov(tmp.reg(),
|
| @@ -9983,6 +9977,14 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_type) {
|
| Immediate(FACTORY->fixed_array_map()));
|
| deferred->Branch(not_equal);
|
|
|
| + // Check that the key is within bounds. Both the key and the length of
|
| + // the JSArray are smis (because the fixed array check above ensures the
|
| + // elements are in fast case). Use unsigned comparison to handle negative
|
| + // keys.
|
| + __ cmp(key.reg(),
|
| + FieldOperand(receiver.reg(), JSArray::kLengthOffset));
|
| + deferred->Branch(above_equal);
|
| +
|
| // Store the value.
|
| __ mov(FixedArrayElementOperand(tmp.reg(), key.reg()), result.reg());
|
| __ IncrementCounter(COUNTERS->keyed_store_inline(), 1);
|
|
|