author | lagergren |
Mon, 27 May 2013 17:57:07 +0200 | |
changeset 17777 | 3f0a680149b9 |
parent 17774 | 0407501fa563 |
child 22384 | 042ba96233f6 |
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. |
4 |
* |
|
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. |
|
8 |
* |
|
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). |
|
14 |
* |
|
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. |
|
18 |
* |
|
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 |
* @subtest |
|
26 |
*/ |
|
27 |
||
28 |
var tests = [ |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
29 |
{file:"box2d",suite:"Box2DBenchmark"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
30 |
{file:"code-load",suite:"CodeLoad"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
31 |
{file:"crypto",suite:"Crypto"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
32 |
{file:"deltablue",suite:"DeltaBlue"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
33 |
{file:"earley-boyer", suite:"EarleyBoyer"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
34 |
{file:"gbemu", suite:"GameboyBenchmark"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
35 |
{file:"mandreel", suite:"MandreelBenchmark"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
36 |
{file:"navier-stokes", suite:"NavierStokes"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
37 |
{file:"pdfjs", suite:"PdfJS"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
38 |
{file:"raytrace", suite:"RayTrace"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
39 |
{file:"regexp", suite:"RegExpSuite"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
40 |
{file:"richards", suite:"Richards"}, |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
41 |
{file:"splay", suite:"Splay"} |
16147 | 42 |
]; |
43 |
var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__; |
|
44 |
||
45 |
// TODO: why is this path hard coded when it's defined in project properties? |
|
16163
71f4cff209a9
8005940: provide ant targets to get and update external test scripts
sundar
parents:
16151
diff
changeset
|
46 |
var path = dir + "../external/octane/"; |
16147 | 47 |
|
48 |
var runtime = ""; |
|
49 |
var verbose = false; |
|
50 |
||
51 |
var numberOfIterations = 5; |
|
52 |
||
53 |
function endsWith(str, suffix) { |
|
54 |
return str.indexOf(suffix, str.length - suffix.length) !== -1; |
|
55 |
} |
|
56 |
||
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
57 |
function should_compile_only(name) { |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
58 |
return (typeof compile_only !== 'undefined') |
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
59 |
} |
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
60 |
|
16147 | 61 |
function run_one_benchmark(arg, iters) { |
62 |
var file_name; |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
63 |
var file = (arg.file + ".js").split('/'); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
64 |
|
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
65 |
file_name = path + file[file.length - 1]; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
66 |
|
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
67 |
var compile_and_return = should_compile_only(file_name); |
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
68 |
if (compile_and_return) { |
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
69 |
if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them |
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
70 |
return; |
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
71 |
} |
16201
889ddb179cdf
8007062: Split Lower up into Lower/Attr/FinalizeTypes. Integrate AccessSpecalizer into FinalizeTypes.
lagergren
parents:
16163
diff
changeset
|
72 |
} |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
73 |
|
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
74 |
print_verbose("Loading... " + file_name); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
75 |
load(file_name); |
16147 | 76 |
|
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
77 |
if (compile_and_return) { |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
78 |
print_always("Compiled OK: " + arg.file); |
16147 | 79 |
return; |
80 |
} |
|
81 |
||
82 |
var success = true; |
|
83 |
var current_name; |
|
84 |
||
85 |
if (iters == undefined) { |
|
86 |
iters = numberOfIterations; |
|
87 |
} else { |
|
88 |
numberOfIterations = iters; |
|
89 |
} |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
90 |
|
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
91 |
var benchmarks = eval(arg.suite + ".benchmarks"); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
92 |
var min_score = 1e9; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
93 |
var max_score = 0; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
94 |
var mean_score = 0; |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
95 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
96 |
try { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
97 |
for (var x = 0; x < benchmarks.length ; x++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
98 |
benchmarks[x].Setup(); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
99 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
100 |
print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
101 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
102 |
var scores = []; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
103 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
104 |
var min_time_ms = min_time * 1000; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
105 |
var len = benchmarks.length; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
106 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
107 |
for (var it = 0; it < iters + 1; it++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
108 |
//every iteration must take a minimum of 10 secs |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
109 |
var ops = 0; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
110 |
var elapsed = 0; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
111 |
var start = new Date; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
112 |
do { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
113 |
for (var i = 0; i < len; i++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
114 |
benchmarks[i].run(); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
115 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
116 |
ops += len; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
117 |
elapsed = new Date - start; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
118 |
} while (elapsed < min_time * 1000); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
119 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
120 |
var score = ops / elapsed * 1000 * 60; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
121 |
scores.push(score); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
122 |
var name = it == 0 ? "warmup" : "iteration " + it; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
123 |
print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute"); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
124 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
125 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
126 |
for (var x = 0; x < benchmarks.length ; x++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
127 |
benchmarks[x].TearDown(); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
128 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
129 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
130 |
for (var x = 1; x < iters + 1 ; x++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
131 |
mean_score += scores[x]; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
132 |
min_score = Math.min(min_score, scores[x]); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
133 |
max_score = Math.max(max_score, scores[x]); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
134 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
135 |
mean_score /= iters; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
136 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
137 |
} catch (e) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
138 |
print_always("*** Aborted and setting score to zero. Reason: " + e); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
139 |
mean_score = min_score = max_score = 0; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
140 |
scores = [0]; |
16147 | 141 |
} |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
142 |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
143 |
var res = "[" + arg.file + "] " + mean_score.toFixed(0); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
144 |
if (verbose) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
145 |
res += " ops/minute (" + min_score.toFixed(0) + "-" + max_score.toFixed(0) + "), warmup=" + scores[0].toFixed(0); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
146 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
147 |
print_always(res); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
148 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
149 |
|
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
150 |
function print_always(x) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
151 |
print(x); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
152 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
153 |
|
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
154 |
function print_verbose(x) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
155 |
if (verbose) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
156 |
print(x); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
157 |
} |
16147 | 158 |
} |
159 |
||
160 |
function run_suite(tests, iters) { |
|
161 |
for (var idx = 0; idx < tests.length; idx++) { |
|
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
162 |
run_one_benchmark(tests[idx], iters); |
16147 | 163 |
} |
164 |
} |
|
165 |
||
166 |
runtime = "command line"; |
|
167 |
||
168 |
var args = []; |
|
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
169 |
|
16147 | 170 |
if (typeof $ARGS !== 'undefined') { |
171 |
args = $ARGS; |
|
172 |
} else if (typeof arguments !== 'undefined' && arguments.length != 0) { |
|
173 |
args = arguments; |
|
174 |
} |
|
175 |
||
176 |
var new_args = []; |
|
177 |
for (i in args) { |
|
178 |
if (args[i].toString().indexOf(' ') != -1) { |
|
179 |
args[i] = args[i].replace(/\/$/, ''); |
|
180 |
var s = args[i].split(' '); |
|
181 |
for (j in s) { |
|
182 |
new_args.push(s[j]); |
|
183 |
} |
|
184 |
} else { |
|
185 |
new_args.push(args[i]); |
|
186 |
} |
|
187 |
} |
|
188 |
||
189 |
if (new_args.length != 0) { |
|
190 |
args = new_args; |
|
191 |
} |
|
192 |
||
193 |
var tests_found = []; |
|
194 |
var iters = undefined; |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
195 |
var min_time = 5; |
16147 | 196 |
|
197 |
for (var i = 0; i < args.length; i++) { |
|
198 |
arg = args[i]; |
|
199 |
if (arg == "--iterations") { |
|
200 |
iters = +args[++i]; |
|
201 |
} else if (arg == "--runtime") { |
|
202 |
runtime = args[++i]; |
|
203 |
} else if (arg == "--verbose") { |
|
204 |
verbose = true; |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
205 |
} else if (arg == "--min-time") { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
206 |
min_time = +args[++i]; |
16147 | 207 |
} else if (arg == "") { |
208 |
continue; //skip |
|
209 |
} else { |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
210 |
var found = false; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
211 |
for (j in tests) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
212 |
if (tests[j].file === arg) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
213 |
tests_found.push(tests[j]); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
214 |
found = true; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
215 |
break; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
216 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
217 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
218 |
if (!found) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
219 |
var str = "unknown test name: '" + arg + "' -- valid names are: "; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
220 |
for (j in tests) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
221 |
if (j != 0) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
222 |
str += ", "; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
223 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
224 |
str += "'" + tests[j].file + "'"; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
225 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
226 |
throw str; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
227 |
} |
16147 | 228 |
} |
229 |
} |
|
230 |
||
231 |
if (tests_found.length == 0) { |
|
232 |
for (i in tests) { |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
233 |
tests_found.push(tests[i]); |
16147 | 234 |
} |
235 |
} |
|
236 |
||
237 |
tests_found.sort(); |
|
238 |
||
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
239 |
load(path + 'base.js'); |
16147 | 240 |
run_suite(tests_found, iters); |
241 |
||
242 |
||
243 |