| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
See https://github.com/WebAssembly/memory64/issues/51
Includes workaround for #2422
|
| |
|
|
|
|
|
| |
This makes the `then` block mandatory per the spec, and parses
multiple foldedinstrs in the `if` predicate (exercised by the new
if.wast test).
|
|
|
|
|
| |
This matches the behaviour of i32 printing.
Ref: https://github.com/WebAssembly/wabt/pull/2342
|
|
|
|
|
|
|
| |
The tag name subsection currently has the speculative ID of 10.
However, the extended-name-section proposal has now been updated to
use an ID of 11 for the tag name section. This updates the
NameSectionSubsection enum accordingly, as well as adding a field
name section with the ID of 10.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, attempting to read from a pipe would result in an error:
'not a regular file', disallowing use of files like /dev/stdin or
/dev/fd/3, named fifos, sockets, etc.
The tools already understand how to (try to) read from non-regular
files, so this change attempts to do so when the input is not seek-able
(the "regular file" capability that's in use here).
Additionally, this adds a test for the new behavior using a bash
herestring and process substitution (the latter of which shows up in
argv as something like `/dev/fd/NN`). Since bash isn't commonly
installed on Windows, this change also introduces a new capability to
filter tests to specific platforms (sorry).
|
|
|
|
|
|
| |
This continues the work from #1783 and reduces special handling of elem
exprs, by treating them the same as other const expressions (init
expressions).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, in BinaryReaderObjdumpDisassemble::BeginFunctionBody,
we had:
local_index_ = objdump_state_->function_param_counts[index];
where index is the index of the function i.e. we treat the keys of
function_param_counts as function indices.
However, function_param_counts is populated in OnFuncType with:
objdump_state_->function_param_counts[index] = param_count;
where index is the index of the type i.e. we treat the keys of
function_param_counts as type indices.
This discrepancy would cause the locals to be incorrectly numbered
in the "Code Disassembly" section.
This fixes the discrepancy by adding a new field, function_types,
which maps from function indices to type indices, and is populated
in BinaryReaderObjdump::OnFunction. This field is used in
BinaryReaderObjdumpDisassemble::BeginFunctionBody to get the type
index for the given function, which is then used to get the
parameter count.
Fixes #2264.
|
|
|
| |
Fixes #1631
|
| |
|
| |
|
|
|
|
|
|
|
| |
Use the text format convention of putting the table before the
type. Also track type names so they can be reported along with
the table name, if available.
Fixes: #1865
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
| |
Fixes #1815
|
| |
|
|
|
| |
Fixes: #1799
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This finishes #985. This
- replaces the old names in the tests with the new names
- drops support for the deprecated names
- renames test files to match new instruction names
I don't think dropping support for the old names will be a problem at
this point. #985 says the old names are supported for convenience but we
should remove those too at some point; that "some point" may have well
arrived given that three years have passed.
The lists of names updated are in #933, #1564, WebAssembly/spec#720.
|
|
|
|
|
|
|
|
| |
This requires `Type::GetName` to return to be dynamicllay created and
return `std::string` rather then a `const char*`
As this diff shows this type name is only used in textual output and
error messages so should this change should not have a effect of binary
parse time or the interpreter.
|
|
|
|
| |
Use `LogOpcodeType` rather than LogOpcodeBare` when the select
instruction has a type.
|
|
|
|
| |
There were a few cases where some hand-editing had creped but its niced
if running `run-tests.py --rebase` is a completely no-op.
|
|
|
|
|
|
|
|
|
| |
Tag names are not officially part of the extended-name-section proposal
(because it only deals with naming things that are in the spec already).
However, I think its reasonable (and useful) to include these names
under a speculative subsection ID, on the basis that tags can only exist
when exceptions are enabled and that engines should ignore unknown name
types.
|
| |
|
|
|
|
| |
blocks. (#1695)
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Without this change, when bulk memory is enabled, the DataCount is
always written when then removed if it proves that its not needed by any
instruction.
However, if we know there are no data segments we can avoid writing it
altogether. This happens to be more compact but I'm hoping to land this
now in anticipation of enabled bulk memory by default. Once we do that
we don't want all the `dump` tests to include the writing and truncating
of the DataCount section in cases when there is no data.
|
|
|
|
|
| |
* 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)
|
|
|
|
|
|
| |
Matches recent changes in the exception handling spec that allowed
this case to reduce special cases in the syntax:
https://github.com/WebAssembly/exception-handling/pull/157
|
|
|
| |
`unwind` was removed. See WebAssembly/exception-handling#156.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This the label resolution code. Example from the spec (https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md):
```
try $l1
try
call $foo
delegate $l1 ;; (= delegate 0)
catch
...
catch_all
...
end
```
The label `$l1` should resolve to `0` in the delegate target, which is 1 less than how typical block constructs work. The current code mis-resolves this to `1`. It should also error in cases like the following:
```
try $l1
nop
delegate $l1
```
Because it's not possible to represent the label `$l1` in the binary format, as a `try-delegate` cannot target itself.
|
|
|
|
|
|
|
|
|
|
|
| |
We recently decided to change 'event' to 'tag', and 'event section' to
'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.
See
- https://github.com/WebAssembly/exception-handling/issues/159#issuecomment-857910130
- https://github.com/WebAssembly/exception-handling/pull/161
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is a new kind of ir/ast node/instruction. It has 3 immediates:
memarg align, memarg offset, and lane index. This required new visitor
functions in all the places.
Drive-by cleanup to share the simd lane parsing logic between shuffle,
lane op and this new load lane instructions. This requires rebasing some
tests because the error messages are slightly different now.
|
|
|
|
|
|
|
|
|
|
|
|
| |
4 double precision conversion instructions are implemented:
- f32x4.demote_f64x2_zero
- f64x2.demote_low_f32x4
- f64x2.convert_low_i32x4_s
- f64x2.convert_low_i32x4_u
This is now sufficient to unskip simd_conversions.txt.
Rebase a bunch of tests due to the rename from widen to extend.
|
|
|
|
|
|
|
|
|
|
|
| |
* Rename all any_true to v128.any_true
* Add i64x2.bitmask and i64x2.all_true, rebase simd_boolean
* Unskip spec/simd/simd_i16x8_arith2.txt since i64x2.abs is now implemented
* Unskip spec/simd/simd_lane.txt
* Update dump interp tests, rebase
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Give `catch_all` its own opcode:
Previously `catch_all` shared an opcode with `else`, but
the spec now allocates it the 0x19 opcode.
Adjust rethrow depth semantics:
Previously this had interpreted the rethrow depth argument
as counting only catch blocks, but the spec has clarified that
it should count all blocks (in a similar fashion as `br` and
related instructions).
|
|
|
|
|
|
|
|
|
|
| |
This PR updates the support of exception handling to the latest proposal (that is compatible with future 2-phase exception handling) described in https://github.com/WebAssembly/exception-handling/pull/137 and https://github.com/WebAssembly/exception-handling/pull/143.
* Adds back tagged `catch $e`, `catch_all`, and `rethrow N` from a previous version of wabt, but with updates to match the current spec (e.g., `catch_all` shares an opcode with `else`, `rethrow`'s depth indexes only catch blocks, etc).
* Adds `unwind` and `delegate` instructions.
* Removes `exnref` and `br_on_exn`.
* Updates relevant tests.
There are some details that could still change (e.g., maybe how `delegate`'s depth is validated), but I'd be happy to submit further PRs if the spec details change.
|
| |
|
|
|
| |
Also fix ordering of data names and table segment names.
|
| |
|
|
|
|
| |
I'm not sure why we were using stdout but the convention is normally to
write all logging and error message to stderr.
|
|
|
| |
This should really have been part of #1554
|
|
|
| |
Signed-off-by: Radu M <root@radu.sh>
|
|
|
|
|
|
|
|
| |
atomic.notify -> memory.atomic.notify
i32.atomic.wait -> memory.atomic.wait32
i64.atomic.wait -> memory.atomic.wait64
These were renamed upstream a while ago, but the new names were not
added to wabt.
|