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

Side by Side Diff: test/mjsunit/regress/regress-crbug-650404.js

Issue 2371963002: [crankshaft] TypedArrayInitialize: force length to be a Smi (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 function c4(w, h) {
8 var size = w * h;
9 if (size < 0) size = 0;
10 return new Uint32Array(size);
11 }
12
13 for (var i = 0; i < 3; i++) {
14 // Computing -0 as the result makes the "size = w * h" multiplication IC
15 // go into double mode.
16 c4(0, -1);
17 }
18 // Optimize Uint32ConstructFromLength.
19 for (var i = 0; i < 1000; i++) c4(2, 2);
20
21 // This array will have a HeapNumber as its length:
22 var bomb = c4(2, 2);
23
24 function reader(o, i) {
25 // Dummy try-catch, so that TurboFan is used to optimize this.
26 try {} catch(e) {}
27 return o[i];
28 }
29 // Optimize reader!
30 for (var i = 0; i < 3; i++) reader(bomb, 0);
31 %OptimizeFunctionOnNextCall(reader);
32 reader(bomb, 0);
33
34 for (var i = bomb.length; i < 100; i++) {
35 assertEquals(undefined, reader(bomb, i));
36 }
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698