Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2371963002: [crankshaft] TypedArrayInitialize: force length to be a Smi (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-650404.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-650404.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698