author | martin |
Wed, 10 Dec 2014 09:23:00 -0800 | |
changeset 28057 | 1a47ceecdba5 |
parent 24778 | 2ff5d7041566 |
permissions | -rw-r--r-- |
16147 | 1 |
/* |
16151 | 2 |
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
16147 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
4 |
* |
16147 | 5 |
* This code is free software; you can redistribute it and/or modify it |
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
8 |
* |
16147 | 9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
14 |
* |
16147 | 15 |
* You should have received a copy of the GNU General Public License version |
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
18 |
* |
16147 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
/** |
|
25 |
* runsunspider : runs the sunspider tests and checks for compliance |
|
26 |
* |
|
24743
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24719
diff
changeset
|
27 |
* @test |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24719
diff
changeset
|
28 |
* @option -timezone=PST |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24719
diff
changeset
|
29 |
* @runif external.sunspider |
16147 | 30 |
*/ |
31 |
||
32 |
/** |
|
33 |
* This is not a test, but a test "framework" for running sunspider tests. |
|
34 |
*/ |
|
35 |
||
36 |
function assertEq(a, b) { |
|
37 |
if (a !== b) { |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
38 |
throw "ASSERTION FAILED: " + a + " should be " + b; |
16147 | 39 |
} |
40 |
} |
|
41 |
||
24719 | 42 |
function pprint(x) { |
43 |
if (verbose_run) { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
44 |
print(x); |
24719 | 45 |
} |
46 |
} |
|
47 |
||
16147 | 48 |
var runs = 0; |
49 |
var total_time = 0; |
|
50 |
||
51 |
function runbench(name) { |
|
52 |
var filename = name.split("/").pop(); |
|
24719 | 53 |
pprint("Running (warmup/sanity) " + filename); |
16147 | 54 |
|
55 |
var start = new Date; |
|
24719 | 56 |
load(name); |
24751 | 57 |
|
16147 | 58 |
var stop = new Date - start; |
59 |
total_time += stop; |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
60 |
|
24719 | 61 |
pprint(filename + " done in " + stop + " ms"); |
16147 | 62 |
runs++; |
63 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
64 |
|
24719 | 65 |
var m_w; |
66 |
var m_z; |
|
67 |
var MAXINT; |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
68 |
|
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
69 |
//produce deterministic random numbers for test suite |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
70 |
function pseudorandom() { |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
71 |
m_z = 36969 * (m_z & 65535) + (m_z >> 16); |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
72 |
m_w = 18000 * (m_w & 65535) + (m_w >> 16); |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
73 |
return (Math.abs((m_z << 16) + m_w) & MAXINT) / MAXINT; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
74 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
75 |
|
24719 | 76 |
function initrandom() { |
77 |
m_w = 4711; |
|
78 |
m_z = 17; |
|
79 |
MAXINT = 0x7fffffff; |
|
80 |
Math.random = pseudorandom; |
|
81 |
} |
|
82 |
||
83 |
var rtimes = 0; |
|
84 |
var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__; |
|
85 |
var single; |
|
86 |
var verbose_run = false; |
|
24751 | 87 |
var runall = false; |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
88 |
|
24719 | 89 |
var args = []; |
90 |
if (typeof $ARGS !== 'undefined') { |
|
91 |
args = $ARGS; |
|
92 |
} else if (typeof arguments !== 'undefined' && arguments.length != 0) { |
|
93 |
args = arguments; |
|
94 |
} |
|
95 |
||
96 |
for (var i = 0; i < args.length; i++) { |
|
97 |
if (args[i] === '--verbose') { |
|
98 |
verbose_run = true; |
|
99 |
} else if (args[i] === '--times') { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
100 |
i++; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
101 |
rtimes = +args[i]; |
24719 | 102 |
} else if (args[i] === '--single') { |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
103 |
i++; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
104 |
single = args[i]; |
24751 | 105 |
} else if (args[i] === '--runall') { |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
106 |
i++; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
107 |
runall = true; |
24719 | 108 |
} |
109 |
} |
|
110 |
||
111 |
function runsuite(tests) { |
|
112 |
var changed = false; |
|
113 |
var res = []; |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
114 |
var oldRandom = Math.random; |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
115 |
|
16147 | 116 |
try { |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
117 |
for (var n = 0; n < tests.length; n++) { |
24751 | 118 |
try { |
119 |
path = dir + '../external/sunspider/tests/sunspider-1.0.2/' + tests[n].name |
|
24719 | 120 |
|
24751 | 121 |
initrandom(); |
24719 | 122 |
|
24751 | 123 |
var dd = new Date; |
24719 | 124 |
|
24751 | 125 |
runbench(path); |
126 |
if (typeof tests[n].actual !== 'undefined') { |
|
127 |
assertEq(tests[n].actual(), tests[n].expected()); |
|
128 |
} |
|
24719 | 129 |
|
24768
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
130 |
var times = 0; |
24751 | 131 |
if (typeof tests[n].rerun !== 'undefined' && tests[n].times > 0) { |
132 |
pprint("rerunning " + tests[n].name + " " + tests[n].times + " times..."); |
|
133 |
var to = tests[n].times; |
|
24719 | 134 |
|
24751 | 135 |
var elemsPerPercent = to / 100; |
136 |
var po = 0|(to / 10); |
|
24719 | 137 |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
138 |
pprint("Doing warmup."); |
24768
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
139 |
for (times = 0; times < to; times++) { |
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
140 |
initrandom(); |
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
141 |
tests[n].rerun(); |
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
142 |
} |
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
143 |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
144 |
pprint("Doing hot runs."); |
24768
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
145 |
for (times = 0; times < to; times++) { |
24751 | 146 |
initrandom(); |
147 |
tests[n].rerun(); |
|
148 |
if ((times % (po|0)) == 0) { |
|
24768
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
149 |
pprint("\t" + times/to * 100 + "%"); |
24751 | 150 |
} |
151 |
} |
|
152 |
} |
|
24719 | 153 |
|
24768
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
154 |
var t = Math.round(((new Date - dd) / (times == 0 ? 1 : times)) * 100 / 100); |
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
155 |
pprint("time per iteration: " + t + " ms"); |
24751 | 156 |
if (typeof tests[n].actual !== 'undefined') { |
157 |
assertEq(tests[n].actual(), tests[n].expected()); |
|
158 |
} |
|
159 |
res.push(t); |
|
160 |
||
161 |
pprint(""); |
|
24719 | 162 |
|
24751 | 163 |
changed = true; |
164 |
} catch(e) { |
|
24768
ae21f28f0ddc
8044102: Ensure bechmark exclude list for Octane benchmarks is in only one place, project.properties, and fix benchmark harness
lagergren
parents:
24751
diff
changeset
|
165 |
if (runall) { |
24751 | 166 |
print("FAIL!"); |
167 |
} else { |
|
168 |
throw e; |
|
169 |
} |
|
170 |
} |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
171 |
} |
24719 | 172 |
} catch (e) { |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
173 |
print("FAIL!"); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
174 |
throw e; |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
175 |
// no scripting or something, silently fail |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
176 |
} finally { |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
177 |
Math.random = oldRandom; |
16147 | 178 |
} |
24719 | 179 |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
180 |
for (var n = 0; n < tests.length; n++) { |
24719 | 181 |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
182 |
var time = "" + res[n]; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
183 |
while (time.length < 6) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
184 |
time = " " + time; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
185 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
186 |
time += " ms"; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
187 |
if (res[n] == -1) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
188 |
time = "<couldn't be rerun>"; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
189 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
190 |
var str = tests[n].name; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
191 |
for (var spaces = str.length; spaces < 32; spaces++) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
192 |
str += " "; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
193 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
194 |
str += " "; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
195 |
str += time; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
196 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
197 |
if (tests[n].times > 0) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
198 |
str += " ["; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
199 |
str += tests[n].times + " reruns]"; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
200 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
201 |
pprint(str); |
24719 | 202 |
} |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
203 |
|
16147 | 204 |
return changed; |
205 |
} |
|
206 |
||
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
207 |
function hash(str) { |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
208 |
var s = "" + str; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
209 |
var h = 0; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
210 |
var off = 0; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
211 |
for (var i = 0; i < s.length; i++) { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
212 |
h = 31 * h + s.charCodeAt(off++); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
213 |
h &= 0x7fffffff; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
214 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
215 |
return h ^ s.length; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
216 |
} |
16147 | 217 |
|
218 |
var tests = [ |
|
24719 | 219 |
|
220 |
{ name: 'regexp-dna.js', |
|
221 |
actual: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
222 |
return dnaOutputString + dnaInput; |
24751 | 223 |
}, |
24719 | 224 |
expected: function() { |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
225 |
return expectedDNAOutputString + expectedDNAInput; |
24719 | 226 |
}, |
24751 | 227 |
}, |
24719 | 228 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
229 |
{ name: 'string-base64.js', |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
230 |
actual: function() { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
231 |
return hash(str); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
232 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
233 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
234 |
return 1544571068; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
235 |
}, |
24719 | 236 |
times: rtimes, |
237 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
238 |
toBinaryTable = [ |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
239 |
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
240 |
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
241 |
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
242 |
52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
243 |
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
244 |
15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
245 |
-1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
246 |
41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
247 |
]; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
248 |
var str = ""; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
249 |
for (var i = 0; i < 8192; i++) |
24719 | 250 |
str += String.fromCharCode((25 * Math.random()) + 97); |
251 |
||
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
252 |
for (var i = 8192; i <= 16384; i *= 2) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
253 |
var base64; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
254 |
base64 = toBase64(str); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
255 |
var encoded = base64ToString(base64); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
256 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
257 |
str += str; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
258 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
259 |
toBinaryTable = null; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
260 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
261 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
262 |
{ name: 'date-format-xparb.js', |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
263 |
actual: function() { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
264 |
return shortFormat + longFormat; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
265 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
266 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
267 |
return "2017-09-05Tuesday, September 05, 2017 8:43:48 AM"; |
24719 | 268 |
}, |
269 |
times: rtimes, |
|
270 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
271 |
date = new Date("1/1/2007 1:11:11"); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
272 |
for (i = 0; i < 4000; ++i) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
273 |
var shortFormat = date.dateFormat("Y-m-d"); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
274 |
var longFormat = date.dateFormat("l, F d, Y g:i:s A"); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
275 |
date.setTime(date.getTime() + 84266956); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
276 |
} |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
277 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
278 |
|
24719 | 279 |
}, |
280 |
{ name: 'string-validate-input.js', |
|
281 |
actual: function() { |
|
282 |
return hash(endResult); |
|
283 |
}, |
|
284 |
expected: function() { |
|
285 |
return 726038055; |
|
286 |
}, |
|
287 |
times: rtimes, |
|
288 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
289 |
doTest(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
290 |
}, |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
291 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
292 |
{ name: '3d-morph.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
293 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
294 |
var acceptableDelta = 4e-15; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
295 |
return (testOutput - 6.394884621840902e-14) < acceptableDelta; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
296 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
297 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
298 |
return true; |
24719 | 299 |
}, |
300 |
times: rtimes, |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
301 |
rerun: function() { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
302 |
a = Array() |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
303 |
for (var i=0; i < nx*nz*3; ++i) |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
304 |
a[i] = 0 |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
305 |
for (var i = 0; i < loops; ++i) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
306 |
morph(a, i/loops) |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
307 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
308 |
testOutput = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
309 |
for (var i = 0; i < nx; i++) |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
310 |
testOutput += a[3*(i*nx+i)+1]; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
311 |
a = null; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
312 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
313 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
314 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
315 |
{ name: 'crypto-aes.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
316 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
317 |
return plainText; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
318 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
319 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
320 |
return decryptedText; |
24719 | 321 |
}, |
322 |
times: rtimes, |
|
323 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
324 |
cipherText = AESEncryptCtr(plainText, password, 256); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
325 |
decryptedText = AESDecryptCtr(cipherText, password, 256); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
326 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
327 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
328 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
329 |
{ name: 'crypto-md5.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
330 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
331 |
return md5Output; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
332 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
333 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
334 |
return "a831e91e0f70eddcb70dc61c6f82f6cd"; |
24719 | 335 |
}, |
336 |
times: rtimes, |
|
337 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
338 |
md5Output = hex_md5(plainText); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
339 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
340 |
}, |
24751 | 341 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
342 |
{ name: 'crypto-sha1.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
343 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
344 |
return sha1Output; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
345 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
346 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
347 |
return "2524d264def74cce2498bf112bedf00e6c0b796d"; |
24719 | 348 |
}, |
349 |
times: rtimes, |
|
350 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
351 |
sha1Output = hex_sha1(plainText); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
352 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
353 |
}, |
24719 | 354 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
355 |
{ name: 'bitops-bitwise-and.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
356 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
357 |
return result; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
358 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
359 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
360 |
return 0; |
24719 | 361 |
}, |
362 |
times: rtimes, |
|
363 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
364 |
bitwiseAndValue = 4294967296; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
365 |
for (var i = 0; i < 600000; i++) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
366 |
bitwiseAndValue = bitwiseAndValue & i; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
367 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
368 |
result = bitwiseAndValue; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
369 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
370 |
}, |
24719 | 371 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
372 |
{ name: 'bitops-bits-in-byte.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
373 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
374 |
return result; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
375 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
376 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
377 |
return 358400; |
24719 | 378 |
}, |
379 |
times: rtimes, |
|
380 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
381 |
result = TimeFunc(bitsinbyte); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
382 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
383 |
}, |
24719 | 384 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
385 |
{ name: 'bitops-nsieve-bits.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
386 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
387 |
var ret = 0; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
388 |
for (var i = 0; i < result.length; ++i) { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
389 |
ret += result[i]; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
390 |
} |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
391 |
ret += result.length; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
392 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
393 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
394 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
395 |
return -1286749539853; |
24719 | 396 |
}, |
397 |
times: rtimes, |
|
398 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
399 |
result = sieve(); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
400 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
401 |
}, |
24719 | 402 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
403 |
{ name: 'bitops-3bit-bits-in-byte.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
404 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
405 |
return sum; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
406 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
407 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
408 |
return 512000; |
24719 | 409 |
}, |
410 |
times: rtimes, |
|
411 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
412 |
sum = TimeFunc(fast3bitlookup); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
413 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
414 |
}, |
24719 | 415 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
416 |
{ name: 'access-nbody.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
417 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
418 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
419 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
420 |
expected: function() { |
20947
ab64f6cdcad0
8026498: Revert: latest runsunspider.js tests contains several bugs
jlaskey
parents:
20942
diff
changeset
|
421 |
return -1.3524862408537381; |
24719 | 422 |
}, |
423 |
times: rtimes, |
|
424 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
425 |
var ret = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
426 |
for (var n = 3; n <= 24; n *= 2) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
427 |
(function(){ |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
428 |
var bodies = new NBodySystem( Array( |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
429 |
Sun(),Jupiter(),Saturn(),Uranus(),Neptune() |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
430 |
)); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
431 |
var max = n * 100; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
432 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
433 |
ret += bodies.energy(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
434 |
for (var i=0; i<max; i++){ |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
435 |
bodies.advance(0.01); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
436 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
437 |
ret += bodies.energy(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
438 |
})(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
439 |
} |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
440 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
441 |
}, |
24719 | 442 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
443 |
{ name: 'access-binary-trees.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
444 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
445 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
446 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
447 |
expected: function() { |
20947
ab64f6cdcad0
8026498: Revert: latest runsunspider.js tests contains several bugs
jlaskey
parents:
20942
diff
changeset
|
448 |
return -4; |
24719 | 449 |
}, |
450 |
times: rtimes, |
|
451 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
452 |
ret = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
453 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
454 |
for (var n = 4; n <= 7; n += 1) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
455 |
var minDepth = 4; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
456 |
var maxDepth = Math.max(minDepth + 2, n); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
457 |
var stretchDepth = maxDepth + 1; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
458 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
459 |
var check = bottomUpTree(0,stretchDepth).itemCheck(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
460 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
461 |
var longLivedTree = bottomUpTree(0,maxDepth); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
462 |
for (var depth=minDepth; depth<=maxDepth; depth+=2){ |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
463 |
var iterations = 1 << (maxDepth - depth + minDepth); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
464 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
465 |
check = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
466 |
for (var i=1; i<=iterations; i++){ |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
467 |
check += bottomUpTree(i,depth).itemCheck(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
468 |
check += bottomUpTree(-i,depth).itemCheck(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
469 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
470 |
} |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
471 |
|
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
472 |
ret += longLivedTree.itemCheck(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
473 |
} |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
474 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
475 |
}, |
24719 | 476 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
477 |
{ name: 'access-fannkuch.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
478 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
479 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
480 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
481 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
482 |
return 22; |
24719 | 483 |
}, |
484 |
times: rtimes, |
|
485 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
486 |
n = 8; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
487 |
ret = fannkuch(n); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
488 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
489 |
}, |
24719 | 490 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
491 |
{ name: 'math-spectral-norm.js', |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
492 |
actual: function() { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
493 |
var ret = ''; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
494 |
for (var i = 6; i <= 48; i *= 2) { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
495 |
ret += spectralnorm(i) + ','; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
496 |
} |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
497 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
498 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
499 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
500 |
return "1.2657786149754053,1.2727355112619148,1.273989979775574,1.274190125290389,"; |
24719 | 501 |
}, |
502 |
times: rtimes, |
|
503 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
504 |
total = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
505 |
for (var i = 6; i <= 48; i *= 2) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
506 |
total += spectralnorm(i); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
507 |
} |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
508 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
509 |
}, |
24719 | 510 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
511 |
{ name: '3d-raytrace.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
512 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
513 |
return hash(testOutput); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
514 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
515 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
516 |
return 230692593; |
24719 | 517 |
}, |
518 |
times: rtimes, |
|
519 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
520 |
testOutput = arrayToCanvasCommands(raytraceScene()); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
521 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
522 |
}, |
24719 | 523 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
524 |
{ name: 'math-cordic.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
525 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
526 |
return total; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
527 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
528 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
529 |
return 10362.570468755888; |
24719 | 530 |
}, |
531 |
times: rtimes, |
|
532 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
533 |
total = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
534 |
cordic(25000); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
535 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
536 |
}, |
24719 | 537 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
538 |
{ name: 'controlflow-recursive.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
539 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
540 |
var ret = 0; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
541 |
for (var i = 3; i <= 5; i++) { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
542 |
ret += ack(3,i); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
543 |
ret += fib(17.0+i); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
544 |
ret += tak(3*i+3,2*i+2,i+1); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
545 |
} |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
546 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
547 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
548 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
549 |
return 57775; |
24719 | 550 |
}, |
551 |
times: rtimes, |
|
552 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
553 |
result = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
554 |
for (var i = 3; i <= 5; i++) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
555 |
result += ack(3,i); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
556 |
result += fib(17.0+i); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
557 |
result += tak(3*i+3,2*i+2,i+1); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
558 |
} |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
559 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
560 |
}, |
24719 | 561 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
562 |
{ name: 'date-format-tofte.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
563 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
564 |
return shortFormat + longFormat; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
565 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
566 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
567 |
return "2008-05-01Thursday, May 01, 2008 6:31:22 PM"; |
24719 | 568 |
}, |
569 |
times: rtimes, |
|
570 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
571 |
date = new Date("1/1/2007 1:11:11"); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
572 |
for (i = 0; i < 500; ++i) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
573 |
var shortFormat = date.formatDate("Y-m-d"); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
574 |
var longFormat = date.formatDate("l, F d, Y g:i:s A"); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
575 |
date.setTime(date.getTime() + 84266956); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
576 |
} |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
577 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
578 |
}, |
24719 | 579 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
580 |
{ name: 'string-tagcloud.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
581 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
582 |
// The result string embeds floating-point numbers, which can vary a bit on different platforms, |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
583 |
// so we truncate them a bit before comparing. |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
584 |
var tagcloud_norm = tagcloud.replace(/([0-9.]+)px/g, function(str, p1) { return p1.substr(0, 10) + 'px' }) |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
585 |
return tagcloud_norm.length; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
586 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
587 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
588 |
return 295906; |
24719 | 589 |
}, |
590 |
times: rtimes, |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
591 |
rerun: function() { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
592 |
tagInfo = tagInfoJSON.parseJSON(function(a, b) { if (a == "popularity") { return Math.log(b) / log2; } else {return b; } }); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
593 |
tagcloud = makeTagCloud(tagInfo); |
24719 | 594 |
} |
595 |
}, |
|
596 |
||
597 |
{ name: 'math-partial-sums.js', |
|
598 |
actual: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
599 |
return total; |
24719 | 600 |
}, |
601 |
expected: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
602 |
return 60.08994194659945; |
24719 | 603 |
}, |
604 |
times: rtimes, |
|
605 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
606 |
total = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
607 |
for (var i = 1024; i <= 16384; i *= 2) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
608 |
total += partial(i); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
609 |
} |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
610 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
611 |
}, |
24719 | 612 |
|
613 |
{ name: 'access-nsieve.js', |
|
614 |
actual: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
615 |
return result; |
24719 | 616 |
}, |
617 |
expected: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
618 |
return 14302; |
24719 | 619 |
}, |
620 |
times: rtimes, |
|
621 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
622 |
result = sieve(); |
24751 | 623 |
} |
24719 | 624 |
}, |
625 |
||
626 |
{ name: '3d-cube.js', |
|
627 |
times: rtimes, |
|
628 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
629 |
Q = new Array(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
630 |
MTrans = new Array(); // transformation matrix |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
631 |
MQube = new Array(); // position information of qube |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
632 |
I = new Array(); // entity matrix |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
633 |
Origin = new Object(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
634 |
Testing = new Object(); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
635 |
for ( var i = 20; i <= 160; i *= 2 ) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
636 |
Init(i); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
637 |
} |
24719 | 638 |
} |
639 |
}, |
|
640 |
||
641 |
//TODO no easy way to sanity check result |
|
642 |
{ name: 'string-fasta.js', |
|
643 |
times: rtimes, |
|
644 |
rerun: function() { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
645 |
ret = 0; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
646 |
count = 7; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
647 |
fastaRepeat(2*count*100000, ALU); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
648 |
fastaRandom(3*count*1000, IUB); |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
649 |
fastaRandom(5*count*1000, HomoSap); |
24719 | 650 |
} |
24751 | 651 |
}, |
24719 | 652 |
|
653 |
//TODO no easy way to sanity check result |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
654 |
{ name: 'string-unpack-code.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
655 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
656 |
return decompressedMochiKit.length == 106415 && |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
657 |
decompressedMochiKit[2000] == '5' && |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
658 |
decompressedMochiKit[12000] == '_' && |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
659 |
decompressedMochiKit[82556] == '>'; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
660 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
661 |
expected: function() { |
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
662 |
return true; |
24719 | 663 |
}, |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
664 |
}, |
24719 | 665 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
666 |
]; |
16147 | 667 |
|
24719 | 668 |
tests.sort(function(a,b) { return a.name.localeCompare(b.name); }); |
669 |
if (typeof single !== 'undefined') { |
|
670 |
for (i in tests) { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
671 |
if (tests[i].name === single) { |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
672 |
singleTest = tests[i]; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
673 |
tests = [singleTest]; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
674 |
break; |
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
675 |
} |
24719 | 676 |
} |
677 |
if (tests.length != 1) { |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24768
diff
changeset
|
678 |
throw "unknown single test '" + single + "'"; |
24719 | 679 |
} |
680 |
} |
|
681 |
||
682 |
||
16147 | 683 |
// handle the case this script may be run by a JS engine that doesn't |
684 |
// support __DIR__ global variable. |
|
685 |
||
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
686 |
runsuite(tests); |
16147 | 687 |
|
24719 | 688 |
pprint('\n' + runs + "/" + tests.length + " tests were successfully run in " + total_time + " ms "); |
16147 | 689 |
|
690 |
print("Sunspider finished!"); |