Bug 927685 - Enable --ion-parallel-compile=on by default in the shell; r=jandem,sr=jorendorff

--HG--
extra : rebase_source : b416f0008ae96d4734ebd6d33be901f02a3ac560
This commit is contained in:
Terrence Cole 2013-11-12 14:02:24 -08:00
parent e95b9d9a2e
commit b3c2a12536
4 changed files with 28 additions and 40 deletions

View File

@ -15,6 +15,7 @@ def add_libdir_to_path():
add_libdir_to_path()
import jittests
from tests import TBPL_FLAGS
def main(argv):
@ -161,17 +162,8 @@ def main(argv):
job_list = []
if options.tbpl:
# Running all bits would take forever. Instead, we test a few interesting combinations.
flags = [
[], # no flags, normal baseline and ion
['--ion-eager'], # implies --baseline-eager
['--ion-eager', '--ion-check-range-analysis', '--no-sse3'],
['--baseline-eager'],
['--baseline-eager', '--no-ti', '--no-fpu'],
['--no-baseline', '--no-ion'],
['--no-baseline', '--no-ion', '--no-ti'],
]
for test in test_list:
for variant in flags:
for variant in TBPL_FLAGS:
new_test = test.copy()
new_test.jitflags.extend(variant)
job_list.append(new_test)

View File

@ -5525,22 +5525,13 @@ ProcessArgs(JSContext *cx, JSObject *obj_, OptionParser *op)
jit::js_IonOptions.compileTryCatch = true;
#ifdef JS_THREADSAFE
bool parallelCompilation = false;
bool parallelCompilation = true;
if (const char *str = op->getStringOption("ion-parallel-compile")) {
if (strcmp(str, "on") == 0) {
if (cx->runtime()->workerThreadCount() == 0) {
fprintf(stderr, "Parallel compilation not available without helper threads");
return EXIT_FAILURE;
}
parallelCompilation = true;
} else if (strcmp(str, "off") != 0) {
if (strcmp(str, "off") == 0)
parallelCompilation = false;
else if (strcmp(str, "on") != 0)
return OptionFailure("ion-parallel-compile", str);
}
}
/*
* Note: In shell builds, parallel compilation is only enabled with an
* explicit option.
*/
cx->runtime()->setParallelIonCompilationEnabled(parallelCompilation);
#endif /* JS_THREADSAFE */

View File

@ -11,7 +11,7 @@ from copy import copy
from subprocess import list2cmdline, call
from lib.results import NullTestOutput
from lib.tests import TestCase
from lib.tests import TestCase, TBPL_FLAGS
from lib.results import ResultsSink
from lib.progressbar import ProgressBar
@ -86,8 +86,9 @@ def parse_args():
help='Set maximum time a test is allows to run (in seconds).')
harness_og.add_option('-a', '--args', dest='shell_args', default='',
help='Extra args to pass to the JS shell.')
harness_og.add_option('--jitflags', default='',
help='Example: --jitflags=m,amd to run each test with -m, -a -m -d [default=%default]')
harness_og.add_option('--jitflags', default='', help="Obsolete. Does nothing.")
harness_og.add_option('--tbpl', action='store_true',
help='Runs each test in all configurations tbpl tests.')
harness_og.add_option('-g', '--debug', action='store_true', help='Run a test in debugger.')
harness_og.add_option('--debugger', default='gdb -q --args', help='Debugger command.')
harness_og.add_option('-J', '--jorendb', action='store_true', help='Run under JS debugger.')
@ -206,16 +207,6 @@ def parse_args():
return (options, requested_paths, excluded_paths)
def parse_jitflags(op_jitflags):
jitflags = [ [ '-' + flag for flag in flags ]
for flags in op_jitflags.split(',') ]
for flags in jitflags:
for flag in flags:
if flag not in ('-m', '-a', '-p', '-d', '-n'):
print('Invalid jit flag: "%s"'%flag)
sys.exit(1)
return jitflags
def load_tests(options, requested_paths, excluded_paths):
"""
Returns a tuple: (skipped_tests, test_list)
@ -243,18 +234,21 @@ def load_tests(options, requested_paths, excluded_paths):
manifest.make_manifests(options.make_manifests, test_list)
sys.exit()
# Create a new test list. Apply each JIT configuration to every test.
if options.jitflags:
# Create a new test list. Apply each TBPL configuration to every test.
if options.tbpl:
new_test_list = []
jitflags_list = parse_jitflags(options.jitflags)
flags_list = TBPL_FLAGS
for test in test_list:
for jitflags in jitflags_list:
for jitflags in flags_list:
tmp_test = copy(test)
tmp_test.options = copy(test.options)
tmp_test.options.extend(jitflags)
new_test_list.append(tmp_test)
test_list = new_test_list
if options.jitflags:
print("Warning: the --jitflags option is obsolete and does nothing now.")
if options.test_file:
paths = set()
for test_file in options.test_file:

View File

@ -9,6 +9,17 @@ from threading import Thread
from results import TestOutput
# When run on tbpl, we run each test multiple times with the following arguments.
TBPL_FLAGS = [
[], # no flags, normal baseline and ion
['--ion-eager', '--ion-parallel-compile=off'], # implies --baseline-eager
['--ion-eager', '--ion-parallel-compile=off', '--ion-check-range-analysis', '--no-sse3'],
['--baseline-eager'],
['--baseline-eager', '--no-ti', '--no-fpu'],
['--no-baseline', '--no-ion'],
['--no-baseline', '--no-ion', '--no-ti'],
]
def do_run_cmd(cmd):
l = [ None, None ]
th_run_cmd(cmd, l)