| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index b3f428cb3a793ffbb2c940fd7040cda7d65b1c54..57329ba726a3958f033b11467460e58d0cf6889e 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -3925,8 +3925,16 @@ HInstruction* HGraphBuilder::BuildMonomorphicElementAccess(HValue* object,
|
| length = AddInstruction(new(zone()) HJSArrayLength(object));
|
| checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length));
|
| AddInstruction(elements);
|
| + if (is_store) {
|
| + AddInstruction(new(zone()) HCheckMap(
|
| + elements, isolate()->factory()->fixed_array_map()));
|
| + }
|
| } else {
|
| AddInstruction(elements);
|
| + if (is_store) {
|
| + AddInstruction(new(zone()) HCheckMap(
|
| + elements, isolate()->factory()->fixed_array_map()));
|
| + }
|
| length = AddInstruction(new(zone()) HFixedArrayLength(elements));
|
| checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length));
|
| }
|
| @@ -4033,6 +4041,8 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
|
| elements = AddInstruction(new(zone()) HLoadElements(object));
|
| elements->ClearFlag(HValue::kUseGVN);
|
| if (is_store) {
|
| + AddInstruction(new(zone()) HCheckMap(
|
| + elements, isolate()->factory()->fixed_array_map()));
|
| access = AddInstruction(
|
| new(zone()) HStoreKeyedFastElement(elements, checked_key, val));
|
| } else {
|
| @@ -4049,6 +4059,10 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
|
| set_current_block(if_fastobject);
|
| elements = AddInstruction(new(zone()) HLoadElements(object));
|
| elements->ClearFlag(HValue::kUseGVN);
|
| + if (is_store) {
|
| + AddInstruction(new(zone()) HCheckMap(
|
| + elements, isolate()->factory()->fixed_array_map()));
|
| + }
|
| length = AddInstruction(new(zone()) HFixedArrayLength(elements));
|
| checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length));
|
| if (is_store) {
|
|
|