BinAST-encoded jit-test is added

Skip to first unread message

Tooru Fujisawa

Jan 27, 2019, 7:17:58 PM1/27/19
to js-internals
Hi all.

Bug 1495611 [1] added several BinAST encoded testcases to jit-test.
Those tests are encoded from some existing plain JS jit-test files,
and stored in js/src/jit-test/tests/binast/{lazy,nonlazy}/ directories.

# Run them in jit-test

They're disabled by default to avoid timeout on some automation jobs.
Passing `--run-binast` option to enables them.

For more details, see js/src/jit-test/tests/binast/ [2].

# Run them in JS shell

On JS shell, passing `-B BINAST_FILE_PATH` runs the BinAST encoded file.

# Update BinAST-encoded test files

This should be the most important part of this message and relevant to
many people.

If you modified the original plain JS testcase (for example, for API change
or spec change or something), the change should also be reflected to the
BinAST encoded testcase.

To update those files, you first need to clone and build binjs-ref [3]
which is the reference encoder for BinAST.

After building binjs-ref, you can update the BinAST encoded testcase by
running js/src/jsapi-tests/binast/ [4] like the following:

./ \
--topsrcdir=~/somewhere/mozilla-unified \
--binjsdir=~/somewhere/binjs-ref \
--binjs_encode=~/somewhere/binjs-ref/target/debug/binjs_encode \

where PATH_TO_BINAST_TESTCASE is substring match. and in practice you can
pass the plain JS file's path (relative path from js/src/jit-test/tests/)
excluding the trailing ".js".

For more details, see js/src/jsapi-tests/binast/ [5].

# Exclude tests from BinAST encoding

If the source plain JS file of a BinAST file becomes incompatible with
BinAST (for example, when the testcase uses ES6+ feature that is not yet
supported) and either the encoder or the test fails, add the BinAST file's
path to js/src/jsapi-tests/binast/jit-test.ignore [6] file
(the pattern is prefix match), and remove the BinAST test files from the

# Automation

On automation, they are enabled only in the following jobs:

- linux64 opt SM(p)
- linux64 debug SM(p)
- linux64 debug SM(cgc)

To run them on other jobs, add the following property to the variant files
in js/src/devtools/automation/variants/ directory.

"conditional-env": {
"JITTEST_EXTRA_ARGS": "--run-binast"

where `{PLATFORM_HERE}` is the value of `variant_platform` variable
in [7].



Reply all
Reply to author
0 new messages