| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This makes it easier to install libbinaryen.so into an alternative
locations. Fixes part of issue #2999 for me.
|
|
|
| |
It was removed in #2841
|
|
|
|
|
| |
The spec interpreter is no longer used at all. Mozjs is still used optionally, but
while it was crucial in the past for test coverage, it is entirely optional now and
not run by default, so no need to warn.
|
|
|
|
|
|
| |
This PR contains:
- Changes that enable/disable tests on Windows to allow for better local testing.
- Also changes many abort() into Fatal() when it is really just exiting on error. This is because abort() generates a dialog window on Windows which is not great in automated scripts.
- Improvements to CMake to better work with the project in IDEs (VS).
|
| |
|
|
|
|
|
|
|
| |
Now that fastcomp has been removed from Emscripten, there is no need
for the asm2wasm tool which it used to compile fastcomp's asm.js output
to wasm.
See emscripten-core/emscripten#11860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets us run most tests at least on that platform.
Add a new function for skipping those tests, skip_if_on_windows,
so that it's easy to find which tests are disabled on windows for later fixing
efforts.
This fixes a few minor issues for windows, like comparisons
should ignore \r in some cases.
Rename all passes tests that use --dwarfdump to contain "dwarf"
in their name, which makes it easy to skip those (and is clearer
anyhow).
|
|
|
|
|
|
|
|
| |
This was useful back when we didn't have many VMs to test in, and
we weren't confident in our binaries being valid wasm. Today we have
lots of testing on VMs, and in particular, this test tends to fail when we
do things like reorder SIMD opcode constants. (This doesn't fail on CI
as we don't have v8 installed there, so this path is never reached, but
it does happen locally.)
|
|
|
|
|
|
|
| |
We now put outputs of all other tests in out/test in order not to
pollute the test directory, but validator tests didn't have a output
file specified so their output files were written in test/validator.
This adds `-o a.wasm` to validator tests command lines, in the same way
as other tests, to make them go into out/test directory.
|
|
|
|
| |
Remove rmtree call from check.py & auto_update_tests.py
|
| |
|
|
|
|
|
|
| |
These tests are now optional. However, if you run them and the
build is not found they will now error out, in order to avoid silently
failing.
|
|
|
|
|
|
| |
The intention is to move away from travis and appveyor which have
become very slow.
See: #2356
|
|
|
|
|
|
|
|
| |
Emit tuple.make, tuple.extract, and multivalue control flow, and tuple locals
and globals when multivalue is enabled. Also slightly refactors the top-level
`makeConcrete` function to be more selective about what it tries to
make based on the requested type to reduce the number of trivial nodes
created because the requested type is incompatible with the requested
node.
|
|
|
|
|
|
| |
The test there just wants to see that the reducer can remove
a significant amount of code. I changed it from a file of 3.6K
to 200 bytes, which is enough to see the effect, and much faster.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used std::cerr as a workaround for that this logging
interfered with spec testing. But it's easy enough to filter
out this stuff for the spec tests.
The benefit to using std::cout is that as you can see in
the test output here, this is relevant test output - it's not
a side channel for debugging. If the rest of the interpreter
output is in std::cout but only traps are in std::cerr then
they might end up out of order etc., so best to keep them
all together.
This will allow easier additions of tests for fuzz testcases
|
|
|
|
| |
Also, factor out auto-updating of binaryenjs testing so it lives
alongside the actual test code.
|
|
|
|
|
|
| |
This involves replacing `Literal::makeZero` with `Literal::makeZeroes`
and `Literal::makeSingleZero` and updating `isConstantExpression` to
handle constant tuples as well. Also makes `Literals` its own struct
and adds convenience methods on it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an invalid entry appears - either it began as such, or became
invalid after optimization - we should not emit (0, 0) which is
an end marker. Instead, emit an invalid entry marker, something
with (0, x) for x != 0.
As a bonus, if a test/passes case has "noprint" in the name,
don't print the wasm, which we do by default. In the testcase
here for example we just care about the dwarf, and the
printed module would be quite large.
Thank you to @paolosevMSFT for identifying and suggesting
the fix.
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the interpreter trap when the signature in `call_indirect`
instruction and that of the actual function in the table mismatch. This
also makes the `wasm-ctor-eval` not evaluate `call_indirect` in case the
signatures mismatch.
Before we only compared the arguments' signature and the function
signature, which was sufficient before we had subtypes, but now the
signature in `call_indirect` and that of the actual function can be
different even if the argument's signature is OK.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new version string looks like this:
wasm-opt version 90 (version_90-18-g77329439d)
The version reported here is the version from the CMakeLists.txt file
followed by the git version in brackets. We verify that the main
version here matches the CHANGELOG to prevent people from changing
one without changeing the other.
This will help with emscripten that wants to be able to programaticaly
check the --version of binaryen tools.
See https://github.com/emscripten-core/emscripten/issues/10175
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for the reference type proposal. This includes support
for all reference types (`anyref`, `funcref`(=`anyfunc`), and `nullref`)
and four new instructions: `ref.null`, `ref.is_null`, `ref.func`, and
new typed `select`. This also adds subtype relationship support between
reference types.
This does not include table instructions yet. This also does not include
wasm2js support.
Fixes #2444 and fixes #2447.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optionally track the binary format code section offsets,
that is, when loading a binary, remember where each IR
node was read from. This is necessary for DWARF
debug info, as these are the offsets DWARF refers to.
(Note that eventually we may want to do something
else, like first read the DWARF and only then add
debug info annotations into the IR in a more LLVM-like
manner, but this is more straightforward and should be
enough to update debug lines and ranges).
This tracking adds noticeable overhead - every single
IR node adds an entry in a map - so avoid it unless
actually necessary. Specifically, if the user passes in
-g and there are actually DWARF sections in the
binary, and we are not about to remove those sections,
then we need it.
Print binary format code section offsets in text, when
printing with -g. This will help debug and test dwarf
support. It looks like
;; code offset: 0x7
as an annotation right before each node.
Also add support for -g in wasm-opt tests (unlike
a pass, it has just one - as a prefix).
Helps #2400
|
|
|
|
|
|
| |
contains the passes (#2532)
We already supported this, but required that the filename be a number.
This lets the name be anything, and we check if *.passes exists for it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This creates utility functions for removing module elements: removing
one element by name, and removing multiple elements using a predicate
function. And makes other parts of code use it. I think this is a
light-handed approach than calling `Module::updateMaps` after removing
only a part of module elements.
This also fixes a bug in the inlining pass: it didn't call
`Module::updateMaps` after removing functions. After this patch callers
don't need to additionally call it anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This updates spec test suite to that of the current up-to-date version
of https://github.com/WebAssembly/spec repo.
- All failing tests are added in `BLACKLIST` in shared.py with reasons.
- For tests that already existed and was passing and started failing
after the update, we add the new test to the blacklist and preserve
the old file by renaming it to 'old_[FILENAME].wast' not to lose test
coverage. When the cause of the error is fixed or the unsupported
construct gets support so the new test passes, we can delete the
corresponding 'old_[FILENAME].wast' file.
- Adds support for `spectest.print_[type] style imports.
|
|
|
|
|
|
|
|
| |
This makes auto_update_tests.py update spec test outputs (ones that are
printed with `spectest.print` import) and extracts spec tests blacklist
into shared.py with comments for reasons why each of them fails.
Also deletes if-label-scope.fail.wast.log because it does not seem to
match with any of existing tests.
|
|
|
| |
These have not been used in years and seem outdated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current `<<` operator on `Literal` prints `[type].const` with it. But
`[type].const` is rather an instruction than a literal itself, and
printing it with the literals makes less sense when we later have
literals whose type don't have `const` instructions (such as reference
types).
This patch
- Makes `<<` operator on `Literal` print only its value
- Makes wasm-shell's shell interface comply with the spec interpreter's
printing format (`value : type`).
- Prints wasm-shell's `[trap]` message to stderr
These make all `fix_` routines for spec tests in check.py unnecessary.
|
|
|
|
|
| |
Don't directly import names from shared.py and support.py, and use
prefixes instead. Also this reorders imports based on PEP
recommendation.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds the ability to create multivalue types from vectors of concrete value
types. All types are transparently interned, so their representation is still a
single uint32_t. Types can be extracted into vectors of their component parts,
and all the single value types expand into vectors containing themselves.
Multivalue types are not yet used in the IR, but their creation and inspection
functionality is exposed and tested in the C and JS APIs.
Also makes common type predicates methods of Type and improves the ergonomics of
type printing.
|
|
|
|
|
|
|
|
| |
This makes test scripts simpler by reducing loop depths and extracting
repeating code into methods or variables.
- `get_tests` returns a list of tests with specified extensions. This
includes files with a full path rather than just file names.
- Reduces loop depths by using early exits and `get_tests`.
|
|
|
|
|
|
|
|
|
| |
- Adds `items` function for `FeatureOptions` so we can get a vector of
eligible types
- Replaces hardcoded enumeration of MVP types with `getConcreteTypes`,
which also adds v128 type to the list if SIMD is enabled
- Removes `getType()` function; this does not seem to be used anywhere
- Renames `vectorPick` with `pick`
- Use the absolute path for d8 in the fuzzer
|
|
|
| |
This allows fuzzing in parallel invocations.
|
|
|
|
|
|
| |
Sometimes wasm-metadce is the last tool to run over a binary in
Emscripten, and in that case it needs to know what features are
enabled in order to emit a valid binary. For example it needs to know
whether to emit a data count section.
|
|
|
|
|
| |
These files are produced alongside .exe when CMake is used on Windows.
Subsequently, check.py finds, tries to execute them and fails since they're not excluded.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
pep8 specifies 4 space indentation. The use of 2 spaces is, I believe
a historical anomaly where certain large organizations such as google
chose 2 over 4 and have yet to make the switch.
Since there isn't too much code in binaryen today it seems reasonable to
make the switch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds basic support for exception handling instructions, according
to the spec:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md
This PR includes support for:
- Binary reading/writing
- Wast reading/writing
- Stack IR
- Validation
- binaryen.js + C API
- Few IR routines: branch-utils, type-updating, etc
- Few passes: just enough to make `wasm-opt -O` pass
- Tests
This PR does not include support for many optimization passes, fuzzer,
or interpreter. They will be follow-up PRs.
Try-catch construct is modeled in Binaryen IR in a similar manner to
that of if-else: each of try body and catch body will contain a block,
which can be omitted if there is only a single instruction. This block
will not be emitted in wast or binary, as in if-else. As in if-else,
`class Try` contains two expressions each for try body and catch body,
and `catch` is not modeled as an instruction. `exnref` value pushed by
`catch` is get by `pop` instruction.
`br_on_exn` is special: it returns different types of values when taken
and not taken. We make `exnref`, the type `br_on_exn` pushes if not
taken, as `br_on_exn`'s type.
|
| |
|
|
|
|
|
| |
I fixed flatten.bin.txt which seems to have just had some corrupted data, and I removed some fancy unicode from the spec comments tests, which I'm not sure it's important enough to figure out how to fix.
Fixes #1691
|
|
|
|
|
|
|
| |
This upgrades the OS in the Travis CI to Bionic and GCC version to 7. This also
fixes a bug that COMPILER_FLAGS was not correctly added at build time in gcc
tests. Somehow this bug hasn't manifested so far, but after upgrading, this
failed thread sanitizer tests because -fsanitize=thread was added only at link
time and not in build time.
|
| |
|
| |
|
| |
|
|
|
| |
Also test in pass-debug mode, for better coverage.
|
|
|
|
|
| |
In the absence of the target features section or command line flags. When there are command line flags, it is an error if they do not exactly match the target features section, except if --detect-features has been provided.
Also adds a --print-features pass to print the command line flags for all enabled options and uses it to make the feature tests more rigorous.
|
|
|
|
|
|
| |
It was previously part of writing a binary, but changing the number of
segments at such a late stage would not work in the presence of bulk
memory's datacount section. Also updates the memory packing pass
to respect the web's limits on the number of data segments.
|