Bug 1495611 - Part 4: Run binast/lazy and binast/nonlazy only on linux64 SM(p,cgc). r=Yoric,sfink
authorTooru Fujisawa <arai_a@mac.com>
Fri, 18 Jan 2019 13:52:31 +0900
changeset 454868 c60e6c0c2e2318295d1bec96e95ec7eaa9b48087
parent 454867 17e87458d7ec374800c3283a2af085234c9e1816
child 454869 cb5546692ed64bbb4d8e82dd971d21d0029810a3
child 455096 1c2d27a85d17c93d89deeb1e0cd1bcfe2a7a97bf
push id111366
push userarai_a@mac.com
push dateWed, 23 Jan 2019 02:24:49 +0000
treeherdermozilla-inbound@c60e6c0c2e23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric, sfink
bugs1495611
milestone66.0a1
first release with
nightly linux32
c60e6c0c2e23 / 66.0a1 / 20190123092826 / files
nightly linux64
c60e6c0c2e23 / 66.0a1 / 20190123092826 / files
nightly mac
c60e6c0c2e23 / 66.0a1 / 20190123092826 / files
nightly win32
c60e6c0c2e23 / 66.0a1 / 20190123092826 / files
nightly win64
c60e6c0c2e23 / 66.0a1 / 20190123092826 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1495611 - Part 4: Run binast/lazy and binast/nonlazy only on linux64 SM(p,cgc). r=Yoric,sfink Differential Revision: https://phabricator.services.mozilla.com/D16939
js/src/devtools/automation/autospider.py
js/src/devtools/automation/variants/compacting
js/src/devtools/automation/variants/plain
js/src/devtools/automation/variants/plaindebug
js/src/jit-test/jit_test.py
js/src/tests/lib/jittests.py
--- a/js/src/devtools/automation/autospider.py
+++ b/js/src/devtools/automation/autospider.py
@@ -337,25 +337,28 @@ def run_command(command, check=False, **
     finally:
         ACTIVE_PROCESSES.discard(proc)
     status = proc.wait()
     if check and status != 0:
         raise subprocess.CalledProcessError(status, command, output=stderr)
     return stdout, stderr, status
 
 
+# Replacement strings in environment variables.
+REPLACEMENTS = {
+    'DIR': DIR.scripts,
+    'TOOLTOOL_CHECKOUT': DIR.tooltool,
+    'MOZ_UPLOAD_DIR': env['MOZ_UPLOAD_DIR'],
+    'OUTDIR': OUTDIR,
+}
+
 # Add in environment variable settings for this variant. Normally used to
 # modify the flags passed to the shell or to set the GC zeal mode.
 for k, v in variant.get('env', {}).items():
-    env[k.encode('ascii')] = v.encode('ascii').format(
-        DIR=DIR.scripts,
-        TOOLTOOL_CHECKOUT=DIR.tooltool,
-        MOZ_UPLOAD_DIR=env['MOZ_UPLOAD_DIR'],
-        OUTDIR=OUTDIR,
-    )
+    env[k.encode('ascii')] = v.encode('ascii').format(**REPLACEMENTS)
 
 if AUTOMATION:
     # Currently only supported on linux64.
     if platform.system() == 'Linux' and platform.machine() == 'x86_64':
         use_minidump = variant.get('use_minidump', True)
     else:
         use_minidump = False
 else:
@@ -455,16 +458,20 @@ elif platform.system() == 'Windows':
     variant_platform = 'win64' if word_bits == 64 else 'win32'
 elif platform.system() == 'Linux':
     variant_platform = 'linux64' if word_bits == 64 else 'linux'
 elif platform.system() == 'Darwin':
     variant_platform = 'macosx64'
 else:
     variant_platform = 'other'
 
+# Override environment variant settings conditionally.
+for k, v in variant.get('conditional-env', {}).get(variant_platform, {}).items():
+    env[k.encode('ascii')] = v.encode('ascii').format(**REPLACEMENTS)
+
 # Skip any tests that are not run on this platform (or the 'all' platform).
 test_suites -= set(normalize_tests(variant.get('skip-tests', {}).get(variant_platform, [])))
 test_suites -= set(normalize_tests(variant.get('skip-tests', {}).get('all', [])))
 
 # Add in additional tests for this platform (or the 'all' platform).
 test_suites |= set(normalize_tests(variant.get('extra-tests', {}).get(variant_platform, [])))
 test_suites |= set(normalize_tests(variant.get('extra-tests', {}).get('all', [])))
 
--- a/js/src/devtools/automation/variants/compacting
+++ b/js/src/devtools/automation/variants/compacting
@@ -2,13 +2,18 @@
     "configure-args": "--enable-ctypes",
     "optimize": true,
     "debug": true,
     "env": {
         "JS_GC_ZEAL": "IncrementalMultipleSlices",
         "JITTEST_EXTRA_ARGS": "--jitflags=debug --ignore-timeouts={DIR}/cgc-jittest-timeouts.txt",
         "JSTESTS_EXTRA_ARGS": "--exclude-file={DIR}/cgc-jstests-slow.txt"
     },
+    "conditional-env": {
+        "linux64": {
+            "JITTEST_EXTRA_ARGS": "--jitflags=debug --ignore-timeouts={DIR}/cgc-jittest-timeouts.txt --run-binast"
+        }
+    },
     "skip-tests": {
         "win32": ["jstests"],
         "win64": ["jstests"]
     }
 }
--- a/js/src/devtools/automation/variants/plain
+++ b/js/src/devtools/automation/variants/plain
@@ -1,7 +1,12 @@
 {
     "configure-args": "",
     "optimize": true,
     "env": {
         "JSTESTS_EXTRA_ARGS": "--jitflags=all"
+    },
+    "conditional-env": {
+        "linux64": {
+            "JITTEST_EXTRA_ARGS": "--run-binast"
+        }
     }
 }
--- a/js/src/devtools/automation/variants/plaindebug
+++ b/js/src/devtools/automation/variants/plaindebug
@@ -1,7 +1,12 @@
 {
     "configure-args": "",
     "debug": true,
     "env": {
         "JSTESTS_EXTRA_ARGS": "--jitflags=debug"
+    },
+    "conditional-env": {
+        "linux64": {
+            "JITTEST_EXTRA_ARGS": "--run-binast"
+        }
     }
 }
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -173,16 +173,21 @@ def main(argv):
                   help='The test chunk to run.')
     op.add_option('--total-chunks', type=int, default=1,
                   help='The total number of test chunks.')
     op.add_option('--ignore-timeouts', dest='ignore_timeouts', metavar='FILE',
                   help='Ignore timeouts of tests listed in [FILE]')
     op.add_option('--test-reflect-stringify', dest="test_reflect_stringify",
                   help="instead of running tests, use them to test the "
                   "Reflect.stringify code in specified file")
+    op.add_option('--run-binast', action='store_true',
+                  dest="run_binast",
+                  help="By default BinAST testcases encoded from JS "
+                  "testcases are skipped. If specified, BinAST testcases "
+                  "are also executed.")
 
     options, args = op.parse_args(argv)
     if len(args) < 1:
         op.error('missing JS_SHELL argument')
     js_shell = which(args[0])
     test_args = args[1:]
     test_environment = get_environment_overlay(js_shell)
 
@@ -222,17 +227,17 @@ def main(argv):
         options.wasm_enabled = False
     if all(['--no-wasm' in flags for flags in test_flags]):
         options.asmjs_enabled = False
         options.wasm_enabled = False
 
     if test_args:
         read_all = False
         for arg in test_args:
-            test_list += jittests.find_tests(arg)
+            test_list += jittests.find_tests(arg, run_binast=options.run_binast)
 
     if options.read_tests:
         read_all = False
         try:
             f = open(options.read_tests)
             for line in f:
                 test_list.append(os.path.join(jittests.TEST_DIR,
                                               line.strip('\n')))
@@ -242,17 +247,17 @@ def main(argv):
                 read_all = True
             else:
                 sys.stderr.write("Exception thrown trying to read test file"
                                  " '{}'\n".format(options.read_tests))
                 traceback.print_exc()
                 sys.stderr.write('---\n')
 
     if read_all:
-        test_list = jittests.find_tests()
+        test_list = jittests.find_tests(run_binast=options.run_binast)
 
     # Exclude tests when code coverage is enabled.
     # This part is equivalent to:
     # skip-if = ccov
     if os.getenv('GCOV_PREFIX') is not None:
         # JSVM errors.
         options.exclude += [os.path.join('basic', 'functionnames.js')]           # Bug 1369783
         options.exclude += [os.path.join('debug', 'Debugger-findScripts-23.js')]
@@ -276,17 +281,17 @@ def main(argv):
             for line in fh:
                 line_exclude = line.strip()
                 if not line_exclude.startswith("#") and len(line_exclude):
                     options.exclude.append(line_exclude)
 
     if options.exclude:
         exclude_list = []
         for exclude in options.exclude:
-            exclude_list += jittests.find_tests(exclude)
+            exclude_list += jittests.find_tests(exclude, run_binast=options.run_binast)
         test_list = [test for test in test_list
                      if test not in set(exclude_list)]
 
     if not test_list:
         print("No tests found matching command line arguments.",
               file=sys.stderr)
         sys.exit(0)
 
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -394,23 +394,30 @@ class JitTest:
     # The test runner expects this to be set to give to get_command.
     js_cmd_prefix = None
 
     def get_command(self, prefix):
         """Shim for the test runner."""
         return self.command(prefix, LIB_DIR, MODULE_DIR)
 
 
-def find_tests(substring=None):
+def find_tests(substring=None, run_binast=False):
     ans = []
     for dirpath, dirnames, filenames in os.walk(TEST_DIR):
         dirnames.sort()
         filenames.sort()
         if dirpath == '.':
             continue
+
+        if not run_binast:
+            if os.path.join('binast', 'lazy') in dirpath:
+                continue
+            if os.path.join('binast', 'nonlazy') in dirpath:
+                continue
+
         for filename in filenames:
             if not (filename.endswith('.js') or filename.endswith('.binjs')):
                 continue
             if filename in ('shell.js', 'browser.js'):
                 continue
             test = os.path.join(dirpath, filename)
             if substring is None \
                or substring in os.path.relpath(test, TEST_DIR):