nashorn/test/script/basic/run-octane.js
author lagergren
Fri, 02 May 2014 18:22:29 +0200
changeset 24749 1549c85f8200
parent 24743 138ee369abd8
child 24751 ccbd9cd3f720
permissions -rw-r--r--
8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies Reviewed-by: jlaskey, attila
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     1
/*
16151
97c1e756ae1e 8005663: Update copyright year to 2013
jlaskey
parents: 16147
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     4
 * 
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     8
 * 
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    13
 * accompanied this code).
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    14
 * 
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    18
 * 
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    21
 * questions.
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    22
 */
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    23
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    24
/**
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    25
 * @subtest
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    26
 */
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    27
24749
1549c85f8200 8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies
lagergren
parents: 24743
diff changeset
    28
var read;
1549c85f8200 8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies
lagergren
parents: 24743
diff changeset
    29
try {
1549c85f8200 8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies
lagergren
parents: 24743
diff changeset
    30
    read = readFully;
1549c85f8200 8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies
lagergren
parents: 24743
diff changeset
    31
} catch (e) {
1549c85f8200 8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies
lagergren
parents: 24743
diff changeset
    32
    print("ABORTING: Cannot find 'readFully'. You must have scripting enabled to use this test harness. (-scripting)");
1549c85f8200 8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies
lagergren
parents: 24743
diff changeset
    33
    throw e;
1549c85f8200 8041625: AccessorProperty currentType must only by Object.class when non-primitive, and scoping followup problem for lazily generated with bodies
lagergren
parents: 24743
diff changeset
    34
}
24743
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    35
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    36
function initZlib() {
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    37
    zlib = new BenchmarkSuite('zlib', [152815148], [
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    38
						    new Benchmark('zlib', false, true, 10,
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    39
								  runZlib, undefined, tearDownZlib, null, 3)]);
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    40
}
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    41
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    42
var tests = [
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    43
    {name:"box2d",         files:["box2d.js"],                         suite:"Box2DBenchmark"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    44
    {name:"code-load",     files:["code-load.js"],                     suite:"CodeLoad"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    45
    {name:"crypto",        files:["crypto.js"],                        suite:"Crypto"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    46
    {name:"deltablue",     files:["deltablue.js"],                     suite:"DeltaBlue"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    47
    {name:"earley-boyer",  files:["earley-boyer.js"],                  suite:"EarleyBoyer"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    48
    {name:"gbemu",         files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    49
    {name:"mandreel",      files:["mandreel.js"],                      suite:"MandreelBenchmark"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    50
    {name:"navier-stokes", files:["navier-stokes.js"],                 suite:"NavierStokes"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    51
    {name:"pdfjs",         files:["pdfjs.js"],                         suite:"PdfJS"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    52
    {name:"raytrace",      files:["raytrace.js"],                      suite:"RayTrace"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    53
    {name:"regexp",        files:["regexp.js"],                        suite:"RegExpSuite"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    54
    {name:"richards",      files:["richards.js"],                      suite:"Richards"},
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    55
    {name:"splay",         files:["splay.js"],                         suite:"Splay"},
24743
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    56
    {name:"typescript",    files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"},
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    57
    //zlib currently disabled - requires read
24743
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    58
    {name:"zlib",          files:["zlib.js", "zlib-data.js"], suite:"zlib", before:initZlib}
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    59
];
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    60
var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    61
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    62
// 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
    63
var path = dir + "../external/octane/";
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    64
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    65
var runtime = "";
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    66
var verbose = false;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    67
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    68
var numberOfIterations = 5;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    69
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    70
function endsWith(str, suffix) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    71
    return str.indexOf(suffix, str.length - suffix.length) !== -1;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    72
}
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    73
16525
1409942e618e 8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents: 16201
diff changeset
    74
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
    75
    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
    76
}
1409942e618e 8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents: 16201
diff changeset
    77
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    78
function load_bench(arg) {
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    79
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    80
    for (var idx = 0; idx < arg.files.length; idx++) {
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    81
	var f = arg.files[idx];
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    82
	var file = f.split('/');
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    83
	var file_name = path + file[file.length - 1];
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
    84
    
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    85
	var compile_and_return = should_compile_only(file_name);
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    86
	if (compile_and_return) {
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    87
	    if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    88
		return true;
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    89
	    }
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    90
	}
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    91
	
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    92
	print_verbose(arg, "loading '" + arg.name + "' [" + f + "]...");
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    93
	load(file_name); 
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    94
    }
24743
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    95
    
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    96
    if (typeof arg.before !== 'undefined') {
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    97
	arg.before();
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
    98
    }
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
    99
16525
1409942e618e 8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents: 16201
diff changeset
   100
    if (compile_and_return) {
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   101
	print_always(arg, "Compiled OK");
16201
889ddb179cdf 8007062: Split Lower up into Lower/Attr/FinalizeTypes. Integrate AccessSpecalizer into FinalizeTypes.
lagergren
parents: 16163
diff changeset
   102
    }
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   103
    return !compile_and_return;
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   104
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   105
}
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   106
24743
138ee369abd8 8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents: 24740
diff changeset
   107
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   108
function run_one_benchmark(arg, iters) {
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   109
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   110
    if (!load_bench(arg)) {
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   111
	return;
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   112
    }    
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   113
    
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   114
    var success = true;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   115
    var current_name;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   116
    
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   117
    if (iters == undefined) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   118
	iters = numberOfIterations;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   119
    } else {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   120
	numberOfIterations = iters;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   121
    }
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
   122
    
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
   123
    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
   124
    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
   125
    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
   126
    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
   127
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
    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
   129
	for (var x = 0; x < benchmarks.length ; x++) { 
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   130
	    //do warmup run
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   131
	    //reset random number generator needed as of octane 9 before each run
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   132
	    BenchmarkSuite.ResetRNG();
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
   133
	    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
   134
	}
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   135
	BenchmarkSuite.ResetRNG();
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   136
	print_verbose(arg, "running '" + arg.name + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")");
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
   137
	
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
	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
   139
	
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
	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
   141
	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
   142
	
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   143
	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
   144
	    //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
   145
	    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
   146
	    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
   147
	    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
   148
	    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
   149
		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
   150
		    benchmarks[i].run();
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   151
		    //important - no timing here like elapsed = new Date() - start, as in the 
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   152
		    //original harness. This will make timing very non-deterministic.
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   153
		    //NOTHING else must live in this loop
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
   154
		}	    
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   155
		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
   156
		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
   157
	    } 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
   158
	    
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   159
	    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
   160
	    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
   161
	    var name = it == 0 ? "warmup" : "iteration " + it;   
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   162
	    print_verbose(arg, name + " finished " + score.toFixed(0) + " ops/minute");
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
   163
	}
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   164
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   165
	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
   166
	    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
   167
	}
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   168
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
	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
   170
	    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
   171
	    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
   172
	    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
   173
	}
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   174
	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
   175
3f0a680149b9 8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents: 17774
diff changeset
   176
    } 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
   177
	print_always("*** Aborted and setting score to zero. Reason: " + e);
24740
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   178
	if (e instanceof java.lang.Throwable) {
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   179
	    e.printStackTrace();
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   180
	}
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
   181
	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
   182
	scores = [0];
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   183
    }
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
   184
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   185
    var res = mean_score.toFixed(0);
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
   186
    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
   187
	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
   188
    }
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   189
    print_always(arg, res);
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
   190
}
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
   191
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   192
function print_always(arg, x) {
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   193
    print("[" + arg.name + "] " + x);
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
   194
}
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
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   196
function print_verbose(arg, x) {
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
   197
    if (verbose) {
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   198
	print_always(arg, x)
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
   199
    }
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   200
}
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   201
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   202
function run_suite(tests, iters) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   203
    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
   204
	run_one_benchmark(tests[idx], iters);
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   205
    }
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   206
}
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   207
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   208
runtime = "command line";
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   209
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   210
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
   211
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   212
if (typeof $ARGS !== 'undefined') {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   213
    args = $ARGS;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   214
} else if (typeof arguments !== 'undefined' && arguments.length != 0) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   215
    args = arguments;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   216
}  
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   217
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   218
var new_args = [];
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   219
for (i in args) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   220
    if (args[i].toString().indexOf(' ') != -1) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   221
	args[i] = args[i].replace(/\/$/, '');
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   222
	var s = args[i].split(' ');
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   223
	for (j in s) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   224
	    new_args.push(s[j]);
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   225
	}
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   226
    } else {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   227
	new_args.push(args[i]);
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   228
    }
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   229
}
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   230
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   231
if (new_args.length != 0) {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   232
    args = new_args;
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   233
}
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   234
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   235
var tests_found = [];
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   236
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
   237
var min_time = 5;
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   238
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   239
for (var i = 0; i < args.length; i++) { 
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   240
    arg = args[i];
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   241
    if (arg == "--iterations") {
24740
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   242
	iters = +args[++i];	
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   243
	if (isNaN(iters)) {
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   244
	    throw "'--iterations' must be followed by integer";
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   245
	}
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   246
    } else if (arg == "--runtime") {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   247
	runtime = args[++i];
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   248
    } else if (arg == "--verbose") {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   249
	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
   250
    } 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
   251
	min_time = +args[++i];
24740
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   252
	if (isNaN(iters)) {
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   253
	    throw "'--min-time' must be followed by integer";
26791be09688 8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents: 24719
diff changeset
   254
	}
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   255
    } else if (arg == "") {
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   256
	continue; //skip
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   257
    } 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
   258
	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
   259
	for (j in tests) {
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   260
	    if (tests[j].name === arg) {
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
   261
		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
   262
		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
   263
		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
   264
	    }
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
   265
	}
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
   266
	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
   267
	    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
   268
	    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
   269
		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
   270
		    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
   271
		}
22384
042ba96233f6 8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents: 17777
diff changeset
   272
		str += "'" + tests[j].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
   273
	    }
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
   274
	    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
   275
	}
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   276
    }
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   277
}
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   278
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   279
if (tests_found.length == 0) {    
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   280
    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
   281
	tests_found.push(tests[i]);
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   282
    }
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   283
} 
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   284
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   285
tests_found.sort();
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   286
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
   287
load(path + 'base.js');
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   288
run_suite(tests_found, iters);
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   289
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   290
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
   291