Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index acd2f349c06aad76a73dc5ccb32ee7529d47842d..ec568c307d3a1329ae8a214c2cc71d1fb22d833d 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -1355,7 +1355,11 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( |
elements = BuildCheckForCapacityGrow(object, elements, elements_kind, |
length, key, is_js_array); |
- checked_key = key; |
+ if (!key->type().IsSmi()) { |
+ checked_key = AddInstruction(new(zone) HCheckSmiOrInt32(key)); |
+ } else { |
+ checked_key = key; |
+ } |
} else { |
checked_key = AddBoundsCheck( |
key, length, ALLOW_SMI_KEY, checked_index_representation); |