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

Side by Side Diff: test/mjsunit/global-infinity.js

Issue 1077343002: [turbofan] Optimize loads of global constants in JSTypedLowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/types.cc ('k') | test/mjsunit/global-infinity-strict.js » ('j') | 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 2015 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 test(expected, f) {
8 assertEquals(expected, f());
9 assertEquals(expected, f());
10 %OptimizeFunctionOnNextCall(f);
11 assertEquals(expected, f());
12 assertEquals(expected, f());
13 }
14
15 function f1() { return Infinity; }
16 test((1/0), f1);
17
18 function f2() { return (1/0); }
19 test((1/0), f2);
20
21 function f3() { return (1/0) == (1/0); }
22 test(true, f3);
23
24 function f4() { return (1/0) == Infinity; }
25 test(true, f4);
26
27 function f5() { return Infinity == (1/0); }
28 test(true, f5);
29
30 function f6() { return "" + Infinity; }
31 test("Infinity", f6);
32
33 function f7() { return (1/0) === (1/0); }
34 test(true, f7);
35
36 function f8() { return (1/0) === Infinity; }
37 test(true, f8);
38
39 function f9() { return Infinity === (1/0); }
40 test(true, f9);
41
42 delete Infinity;
43
44 function g1() { return Infinity; }
45 test((1/0), g1);
46
47 function g2() { return (1/0); }
48 test((1/0), g2);
49
50 function g3() { return (1/0) == (1/0); }
51 test(true, g3);
52
53 function g4() { return (1/0) == Infinity; }
54 test(true, g4);
55
56 function g5() { return Infinity == (1/0); }
57 test(true, g5);
58
59 function g6() { return "" + Infinity; }
60 test("Infinity", g6);
61
62 function g7() { return (1/0) === (1/0); }
63 test(true, g7);
64
65 function g8() { return (1/0) === Infinity; }
66 test(true, g8);
67
68 function g9() { return Infinity === (1/0); }
69 test(true, g9);
70
71 Infinity = 111;
72
73 function h1() { return Infinity; }
74 test((1/0), h1);
75
76 function h2() { return (1/0); }
77 test((1/0), h2);
78
79 function h3() { return (1/0) == (1/0); }
80 test(true, h3);
81
82 function h4() { return (1/0) == Infinity; }
83 test(true, h4);
84
85 function h5() { return Infinity == (1/0); }
86 test(true, h5);
87
88 function h6() { return "" + Infinity; }
89 test("Infinity", h6);
90
91 function h7() { return (1/0) === (1/0); }
92 test(true, h7);
93
94 function h8() { return (1/0) === Infinity; }
95 test(true, h8);
96
97 function h9() { return Infinity === (1/0); }
98 test(true, h9);
99
100 // -------------
101
102 function k1() { return this.Infinity; }
103 test((1/0), k1);
104
105 function k2() { return (1/0); }
106 test((1/0), k2);
107
108 function k3() { return (1/0) == (1/0); }
109 test(true, k3);
110
111 function k4() { return (1/0) == this.Infinity; }
112 test(true, k4);
113
114 function k5() { return this.Infinity == (1/0); }
115 test(true, k5);
116
117 function k6() { return "" + this.Infinity; }
118 test("Infinity", k6);
119
120 function k7() { return (1/0) === (1/0); }
121 test(true, k7);
122
123 function k8() { return (1/0) === this.Infinity; }
124 test(true, k8);
125
126 function k9() { return this.Infinity === (1/0); }
127 test(true, k9);
OLDNEW
« no previous file with comments | « src/types.cc ('k') | test/mjsunit/global-infinity-strict.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698