Bug 1293305 - Part 1.1: Add need-for-each flag to jit-test harness. r=evilpie
authorTooru Fujisawa <arai_a@mac.com>
Mon, 21 Nov 2016 15:03:30 +0900
changeset 323564 c8d173e66fa2c9ddf5cec2bf20411e7e29404ce4
parent 323563 63ec09d6484c37e80958849ec2ebc891d375bce6
child 323565 6b118584e84177fe6697b33dfcaad130f5dcebde
push id30978
push usercbook@mozilla.com
push dateMon, 21 Nov 2016 14:44:46 +0000
treeherdermozilla-central@0534254e9a40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie
bugs1293305
milestone53.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 1293305 - Part 1.1: Add need-for-each flag to jit-test harness. r=evilpie
js/src/tests/lib/jittests.py
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -117,16 +117,17 @@ class JitTest:
         self.test_also_wasm_baseline = False # True means run with and and without
                                        # wasm baseline compiler enabled.
         self.test_also = [] # List of other configurations to test with.
         self.test_join = [] # List of other configurations to test with all existing variants.
         self.expect_error = '' # Errors to expect and consider passing
         self.expect_status = 0 # Exit status to expect from shell
         self.expect_crash = False # Exit status or error output.
         self.is_module = False
+        self.need_for_each = False # Enable for-each syntax
         self.test_reflect_stringify = None  # Reflect.stringify implementation to test
 
         # Expected by the test runner. Always true for jit-tests.
         self.enable = True
 
     def copy(self):
         t = JitTest(self.path)
         t.jitflags = self.jitflags[:]
@@ -141,16 +142,17 @@ class JitTest:
         t.test_also = self.test_also
         t.test_join = self.test_join
         t.expect_error = self.expect_error
         t.expect_status = self.expect_status
         t.expect_crash = self.expect_crash
         t.test_reflect_stringify = self.test_reflect_stringify
         t.enable = True
         t.is_module = self.is_module
+        t.need_for_each = self.need_for_each
         return t
 
     def copy_and_extend_jitflags(self, variant):
         t = self.copy()
         t.jitflags.extend(variant)
         return t
 
     def copy_variants(self, variants):
@@ -257,16 +259,18 @@ class JitTest:
                         test.test_join.append([name[len('test-join='):]])
                     elif name == 'module':
                         test.is_module = True
                     elif name == 'crash':
                         test.expect_crash = True
                     elif name.startswith('--'):
                         # // |jit-test| --ion-gvn=off; --no-sse4
                         test.jitflags.append(name)
+                    elif name == 'need-for-each':
+                        test.need_for_each = True
                     else:
                         print('{}: warning: unrecognized |jit-test| attribute'
                               ' {}'.format(path, part))
 
         if options.valgrind_all:
             test.valgrind = True
 
         if options.test_reflect_stringify is not None:
@@ -292,16 +296,19 @@ class JitTest:
             quotechar = '"'
         else:
             quotechar = "'"
         expr = "const platform={}; const libdir={}; const scriptdir={}".format(
             js_quote(quotechar, sys.platform),
             js_quote(quotechar, libdir),
             js_quote(quotechar, scriptdir_var))
 
+        if self.need_for_each:
+            expr += "; enableForEach()"
+
         # We may have specified '-a' or '-d' twice: once via --jitflags, once
         # via the "|jit-test|" line.  Remove dups because they are toggles.
         cmd = prefix + ['--js-cache', JitTest.CacheDir]
         cmd += list(set(self.jitflags)) + ['-e', expr]
         if self.is_module:
             cmd += ['--module-load-path', moduledir]
             cmd += ['--module', path]
         elif self.test_reflect_stringify is None: