Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index 00b667376a8247460526087fec984c12156e0349..a450b2404809a92d46daca12445340f29e712e42 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -10273,6 +10273,8 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize( |
HInstruction* length = AddUncasted<HDiv>(byte_length, |
Add<HConstant>(static_cast<int32_t>(element_size))); |
+ // Callers (in typedarray.js) ensure that length <= %_MaxSmi(). |
+ length = AddUncasted<HForceRepresentation>(length, Representation::Smi()); |
Add<HStoreNamedField>(obj, |
HObjectAccess::ForJSTypedArrayLength(), |