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

Side by Side Diff: test/mjsunit/compiler/regress-5100.js

Issue 2035893004: [turbofan] Introduce a dedicated CheckBounds operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 4 years, 6 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/compiler/verifier.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 var a = [0, 1];
8 a["true"] = "true";
9 a["false"] = "false";
10 a["null"] = "null";
11 a["undefined"] = "undefined";
12
13 // Ensure we don't accidentially truncate true when used to index arrays.
14 (function() {
15 function f(x) { return a[x]; }
16
17 assertEquals(0, f(0));
18 assertEquals(0, f(0));
19 %OptimizeFunctionOnNextCall(f);
20 assertEquals("true", f(true));
21 })();
22
23 // Ensure we don't accidentially truncate false when used to index arrays.
24 (function() {
25 function f( x) { return a[x]; }
26
27 assertEquals(0, f(0));
28 assertEquals(0, f(0));
29 %OptimizeFunctionOnNextCall(f);
30 assertEquals("false", f(false));
31 })();
32
33 // Ensure we don't accidentially truncate null when used to index arrays.
34 (function() {
35 function f( x) { return a[x]; }
36
37 assertEquals(0, f(0));
38 assertEquals(0, f(0));
39 %OptimizeFunctionOnNextCall(f);
40 assertEquals("null", f(null));
41 })();
42
43 // Ensure we don't accidentially truncate undefined when used to index arrays.
44 (function() {
45 function f( x) { return a[x]; }
46
47 assertEquals(0, f(0));
48 assertEquals(0, f(0));
49 %OptimizeFunctionOnNextCall(f);
50 assertEquals("undefined", f(undefined));
51 })();
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698