Bug 927685 - Enable --ion-parallel-compile=on by default in the shell; r=jandem,sr=jorendorff
☠☠ backed out by 20e4d6b3c819 ☠ ☠
authorTerrence Cole <terrence@mozilla.com>
Tue, 12 Nov 2013 14:02:24 -0800
changeset 173740 c14453ff87648f20be5b3805695d16257fd08212
parent 173660 f23fd773d7d1ffba4091e1caa81c89b8a9cdee74
child 173741 0e796e3648153bde5b56d2c745c45fbfc94617e6
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, jorendorff
bugs927685
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 927685 - Enable --ion-parallel-compile=on by default in the shell; r=jandem,sr=jorendorff
js/src/jit-test/jit_test.py
js/src/shell/js.cpp
js/src/tests/jstests.py
js/src/tests/lib/tests.py
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -10,16 +10,17 @@ def add_libdir_to_path():
     js_src_dir = dirname(dirname(realpath(sys.argv[0])))
     assert exists(join(js_src_dir,'jsapi.h'))
     sys.path.insert(0, join(js_src_dir, 'lib'))
     sys.path.insert(0, join(js_src_dir, 'tests', 'lib'))
 
 add_libdir_to_path()
 
 import jittests
+from tests import TBPL_FLAGS
 
 def main(argv):
 
     # If no multiprocessing is available, fallback to serial test execution
     max_jobs_default = 1
     if jittests.HAVE_MULTIPROCESSING:
         try:
             max_jobs_default = jittests.cpu_count()
@@ -156,27 +157,18 @@ def main(argv):
 
     if not options.run_slow:
         test_list = [ _ for _ in test_list if not _.slow ]
 
     # The full test list is ready. Now create copies for each JIT configuration.
     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)
     elif options.ion:
         flags = [['--baseline-eager'], ['--ion-eager']]
         for test in test_list:
             for variant in flags:
                 new_test = test.copy()
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5520,32 +5520,23 @@ ProcessArgs(JSContext *cx, JSObject *obj
 
     if (op->getBoolOption("ion-eager"))
         jit::js_IonOptions.setEagerCompilation();
 
     if (op->getBoolOption("ion-compile-try-catch"))
         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 */
 
 #endif /* JS_ION */
 
 #ifdef DEBUG
     if (op->getBoolOption("dump-entrained-variables"))
         dumpEntrainedVariables = true;
--- a/js/src/tests/jstests.py
+++ b/js/src/tests/jstests.py
@@ -6,17 +6,17 @@ See the adjacent README.txt for more det
 """
 
 import os, sys, textwrap
 from os.path import abspath, dirname, realpath
 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
 
 if (sys.platform.startswith('linux') or
     sys.platform.startswith('darwin')
    ):
     from lib.tasks_unix import run_all_tests
 else:
@@ -81,18 +81,19 @@ def parse_args():
 
     harness_og = OptionGroup(op, "Harness Controls", "Control how tests are run.")
     harness_og.add_option('-j', '--worker-count', type=int, default=max(1, get_cpu_count()),
                           help='Number of tests to run in parallel (default %default)')
     harness_og.add_option('-t', '--timeout', type=float, default=150.0,
                           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.')
     harness_og.add_option('--passthrough', action='store_true', help='Run tests with stdin/stdout attached to caller.')
     harness_og.add_option('--valgrind', action='store_true', help='Run tests in valgrind.')
     harness_og.add_option('--valgrind-args', default='', help='Extra args to pass to valgrind.')
     op.add_option_group(harness_og)
 
@@ -201,26 +202,16 @@ def parse_args():
 
     # Hide the progress bar if it will get in the way of other output.
     options.hide_progress = (options.tinderbox or
                              not ProgressBar.conservative_isatty() or
                              options.hide_progress)
 
     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)
         skip_list: [iterable<Test>] Tests found but skipped.
         test_list: [iterable<Test>] Tests found that should be run.
     """
     import lib.manifest as manifest
 
@@ -238,28 +229,31 @@ def load_tests(options, requested_paths,
     test_dir = dirname(abspath(__file__))
     test_list = manifest.load(test_dir, xul_tester)
     skip_list = []
 
     if options.make_manifests:
         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:
             paths |= set([ line.strip() for line in open(test_file).readlines()])
         test_list = [ _ for _ in test_list if _.path in paths ]
 
     if requested_paths:
         def p(path):
--- a/js/src/tests/lib/tests.py
+++ b/js/src/tests/lib/tests.py
@@ -4,16 +4,27 @@
 # metadata, and know how to run the tests and determine failures.
 
 import datetime, os, sys, time
 from subprocess import Popen, PIPE
 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)
     return l[1]
 
 def set_limits():
     # resource module not supported on all platforms
     try: