| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This adds support in the binary/text parsers and writers,
the validator and interpreter, and objdump (but not wasm2c).
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This adds support for the new opcodes from the Relaxed SIMD proposal
(https://github.com/WebAssembly/relaxed-simd) behind the
"--enable-relaxed-simd" flag.
The exception is the f32x4.relaxed_dot_bf16x8_add_f32x4 instruction
which is not yet implemented.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See https://github.com/WebAssembly/tool-conventions/blob/main/CodeMetadata.md for the specification.
In particular this pr implements the following:
- Parsing code metadata sections in BinaryReader, providing appropriate callbacks that a BinaryReaderDelegate can implement:
- BinaryReaderObjdump: show the sections in a human-readable form
- BinaryReaderIr: add code metadata in the IR as expressions
- Parsing code metadata annotations in text format, adding them in the IR like the BinaryReaderIR does
- Writing the code metadata present in the IR in the proper sections when converting IR to binary
- Support in wasm-decompiler for showing code metadata as comments in the pseudo-code
All the features have corresponding tests.
Support for code metadata is gated through the --enable-code-metadata feature. For reading/writing in the text format, --enable-annotations is also required.
Missing features:
Support for function-level code metadata (offset 0)
Extensive validation in validator.cc (like making sure that all metadata instances are at the same code offset of an instruction)
|
|
|
|
|
|
|
|
|
|
| |
The primary changes here are to the interpreter and how it handles
initializer expressions. With this change we model these are normal
function that we run during module initialization.
I imagine we could optimize this further by creating one long function
and encoding the `global.set`/`memory.init`/`table.init` into the
function itself, but this change seems like a good first step to make
the current tests pass.
|
| |
|
|
|
|
|
|
|
|
|
| |
This features was finished earlier this year:
https://github.com/WebAssembly/proposals/blob/master/finished-proposals.md
One thing to note is that the version of the spec tests we currently
have in third_party/testsuite doesn't have ref types merged yet so
this change disables ref types when running some of those tests. This
can be removed in a followup when we update the testsuite.
|
|
|
|
|
|
|
|
|
|
|
| |
This features was finished earlier this year:
https://github.com/WebAssembly/proposals/blob/master/finished-proposals.md
One thing to note is that the version of the spec tests we currently
have in third_party/testsuite doesn't have bulk memory merged yet so
this change disables bulk memory when running some of those tests. This
will be removed in a followup when we update the testsuite.
Fixes: #1717
|
|
|
|
|
| |
* SIMD is now phase 5, enable it by default
* Update test flags, rebase test, and docs
|
|
|
| |
Currently implemented just for disassembly. It could be added for other sections/functionality in the future.
|
|
|
|
| |
supported call_ref (#1691)
|
| |
|
|
|
|
|
|
|
|
| |
Main changes:
* Rename `anyref` -> `externref`
* Remove `nullref`
* Rename `hostref` -> `externref`
* `ref.null` and `ref.is_null` now have "ref kind" parameter
* Add ref kind keywords: `func`, `extern`, `exn`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've been used the tests from wasi-sdk to get started:
https://github.com/WebAssembly/wasi-sdk/tree/master/tests
All these tests now pass. Still this isn't saying much, there are still
some big missing pieces. Started using the new serdes
(serialize/deserialze) API in uvwasi. I think we are almost at the
point were we can look at auto-generating some of this stuff from witx
to avoid having the hand code all this marshelling stuff.
Add support for ArgumentCount::ZeroOrMore to OptionParser and also the
ability to force the end of option processing using `--`. This allows
is to pass options through the underlying wasi program when running
wasm-interp.
|
|
|
|
| |
This is almost enough to pass all the tiny tests in the wasi-sdk
repo.
|
|
|
|
|
|
|
|
|
|
| |
This is proof of concept that only implements the `proc_exit` and
`fd_write` APIs.
Extending this to the full WASI API will to follow assuming this
approach seems reasonable.
Fixes #1409
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This enables three proposals by default since they've been merged into
the upstream specification:
* `saturating-float-to-int` - WebAssembly/spec#1143
* `sign-extension` - WebAssembly/spec#1144
* `multi-value` - WebAssembly/spec#1145
Most of the fallout from this is in the test suite with lots of
`--enable` flags getting removed and some tests which now
unconditionally pass also getting removed. Two spec tests explicitly
pass `--disable` until the spec test submodule is updated.
|
| |
|
|
|
| |
Without this the default was to write the wasm files but not the json
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes: #1106
Ported versioning system from [Binaryen CMakeLists.txt](https://github.com/WebAssembly/binaryen/blob/dc31b460fef47dfb3415b4ae6276fff4919a03e2/CMakeLists.txt#L10-L23)
```
bin/wasm2c --version
1.0.11-44-g71f883ad
```
Applied to (all) tools in `src/tools/`.
|
|
|
|
| |
(#1138)
|
|
|
| |
This adds `--enable-all` option that enables all existing features.
|
|
|
|
| |
You can now pass `--dummy-import-func` to `wasm-interp`, which will
provide a function that logs the call and returns zero.
|
|
|
|
|
|
| |
Lex custom annotations, but discard them in the parser. In the future we
should be able to parse some of them, but this is simple and
spec-compliant for now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add support for the reference types proposal
This commit adds support for the reference types proposal to wabt.
Namely it adds new opcodes like `table.{get,set,grow}` as well as adds a
new `anyref` type. These are plumbed throughout for various operations
in relatively simple fashions, no support was added for a subtyping
relationship between `anyref` and `anyfunc` just yet.
This also raises the restriction that multiple tables are disallowed,
allowing multiple tables to exist when `--enable-reference-types` is
passed.
* Allow nonzero table indices in `call_indirect`
Plumb support throughout for the `call_indirect` instruction (and
`return_call_indirect`) to work with multi-table modules according to
the reference types proposal.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit starts to add support in wabt's various tools for the
upcoming [bulk memory proposal][1]. This is based off the current
proposal's overview, although these may get tweaked over time!
This is also the first time I've significantly contributed to wabt, and
what I thought would be a relatively simple addition ended up being much
larger than I imagined! I didn't add many negative tests yet but if more
tests are desired please let me know!
[1]: https://github.com/webassembly/bulk-memory-operations
|
|
|
|
|
|
|
|
|
|
|
|
| |
This doesn't do any of the real work yet, it just adds the
ReturnCall/ReturnCallIndirect Expr and Opcode types, and the
"--enable-tail-call" flag.
Still TODO:
* Parse the opcodes in binary-reader.cc
* Validate the opcodes in validator.cc and type-checker.cc
* Implement the opcodes in interp.cc
* Write standard wabt tests, and enable the spec proposal tests too
|
|
|
| |
These were long supported in `wasm2wat`
|
|
|
|
|
|
|
|
| |
The newest testsuite update enables mutable globals by default, which
matches the v1 WebAssembly spec.
This change changes the default for all wabt tools, and changes the flag
to `--disable-mutable-globals` in case you need the previous behavior.
This flag will likely be removed in the future.
|
|
|
| |
Resolves #872
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the `--enable-multi-value` flag to enable.
A lot of code already "worked" with multi-value, and just needed to
remove the restrictions. Most of the other changes are modifying the
callback APIs to be more general, e.g. taking more than 1 result type.
* Types are now stored as the negative values; this works nicely with
the encoding of inline function types (used for block signatures),
which are always positive values.
* Remove `BlockSignature` and use `BlockDeclaration` instead, which
is just a typedef to `FuncSignature`. This allows for explicit or
implicit type specifications on the block signatures.
* Allow for >1 "keep" values in the DropKeep interpreter instruction
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a wasm engine fails to parse a custom section, it must not be an
error. In wabt we often won't want to continue if a custom section can't
be parsed, but it still may be useful to be able to continue.
This change adds a new flag `--ignore-custom-section-errors` to
`wasm2wat` and `wasm-validate`, which will partially parse a custom
section with errors. This could lead to some strange behavior (partially
completed data structures), but generally should be safe to do.
See issue #378 and the discussion on pull #830 for more info.
|
|
|
|
|
|
| |
This is been superseded by lld and we no longer have the
bandwidth to maintain a separate linker.
|
|
|
|
| |
As suggested in https://github.com/WebAssembly/wabt/pull/725#discussion_r162516714.
|
|
|
| |
Also reorder the flags so they are alphabetical order.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add WatWriter option for inline imports
Inline imports are more flexible than regular imports, since they can be
combined with inline exports. For example:
```
(func (export "baz") (import "foo" "bar") (param i32))
```
* Remove unused overload of WriteInlineImport
|
| |
|
| |
|
|
|
|
| |
It's currently identical to wasm2wat, without the part to write out a
.wat file.
|
|
|
|
|
|
| |
* `wasm-interp` tool now only runs `.wasm` file, not spec tests
* `wasm-interp` has a new flag `--host-print` for importing a print
function named "host.print"
* `spectest-interp` tool runs only `.json` files
|
| |
|
|
|
|
|
| |
Objdump should really make a best effort to display
anything its given. There are other tools that are
better suited for validation.
|
|
|
|
| |
* wat2wasm only parses wat files (individual modules)
* wast2json parses spec test files and generates json + wasm
|
|
|
| |
See issue #543.
|
|
|
|
|
|
|
|
| |
* Add i{32,64}.extend{8,16,32}_s operators
Also add thread feature (via `--enable-threads`).
* Update with re2c generated output
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add saturating truncation operators as described here:
https://github.com/webassembly/nontrapping-float-to-int-conversions.
This change also codifies the mechanism for enabling new WebAssembly features
by passing the `Features` object. Opcode now has a `IsEnabled(const Features&)`
member function to query if the opcode is enabled. This means that the
`--future-exceptions` flag has been renamed to `--enable-exceptions` for
consistency. Checking whether the feature is enabled always happens at input;
either WastParser or BinaryReader.
|
|
|
|
|
|
|
|
| |
* Allow wasm-objdump to handle exceptions.
* Fix writing exception section.
* Make wasm-objdump handle exceptions, and add tests.
|