summaryrefslogtreecommitdiff
path: root/test/dump
Commit message (Collapse)AuthorAgeFilesLines
* [wasm-objdump] Fix reporting of imported 64-bit tables (#2425)Sam Clegg2024-05-221-6/+13
|
* Update testsuite and implement table64 (#2418)Sam Clegg2024-05-151-2/+6
| | | | | See https://github.com/WebAssembly/memory64/issues/51 Includes workaround for #2422
* [wasm-objdump] set function types for correct params+locals indexing (#2353)Rod Vagg2023-12-131-1/+1
|
* WastParser: tighten parsing of folded `if` (#2349)Keith Winstein2023-12-051-2/+2
| | | | | This makes the `then` block mandatory per the spec, and parses multiple foldedinstrs in the `if` predicate (exercised by the new if.wast test).
* [wasm-objdump] Print i64 values as unsigned (#2344)Rod Vagg2023-12-011-4/+4
| | | | | This matches the behaviour of i32 printing. Ref: https://github.com/WebAssembly/wabt/pull/2342
* Update ID for tag name subsection (#2336)Michael Williamson2023-11-271-1/+1
| | | | | | | 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.
* feat: treat non-seekable files as pipes (#2309)sethp2023-10-021-1/+1
| | | | | | | | | | | | | | | 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).
* Share reading/validation code between elem exprs & other const exprs (#2288)Keith Winstein2023-09-068-13/+38
| | | | | | This continues the work from #1783 and reduces special handling of elem exprs, by treating them the same as other const expressions (init expressions).
* wasm-objdump: Fix local numbering in disassembly (#2265)Michael Williamson2023-06-272-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* objdump: take care of opcodes whose bytes are non-canonical leb128 (#1632)Ng Zhi An2023-02-131-0/+39
| | | Fixes #1631
* wast-parser.cc: disallow exception tag unless exceptions enabled (#2110)Keith Winstein2022-12-231-1/+1
|
* [wasm-objdump] Print segment offsets as unsigned (#2023)Sam Clegg2022-10-252-47/+61
|
* wasm-objdump: Improve disassembly of call_indirect (#1866)Sam Clegg2022-03-167-288/+315
| | | | | | | 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
* wasm-objdump: support extended const expressions (#1859)Sam Clegg2022-03-111-0/+197
|
* Add initial support for code metadata (#1840)Yuri Iozzelli2022-02-251-0/+43
| | | | | | | | | | | | | | | | | | | | | 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)
* wasm-objdump: Print local names during disassembly (#1818)Michael Williamson2022-02-021-149/+319
| | | Fixes #1815
* objdump: Consider params when printing local decl index (#1819)Michael Williamson2022-02-013-10/+10
|
* Don't include empty names for locals (#1801)Sam Clegg2022-01-081-23/+19
| | | Fixes: #1799
* Finish instruction renaming (#1792)Heejin Ahn2021-12-2029-109/+109
| | | | | | | | | | | | | 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.
* Fix type names for function references (#1787)Sam Clegg2021-12-132-11/+11
| | | | | | | | 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.
* wasm-objdump: Fix disassembly output of selectT instruction (#1777)Sam Clegg2021-12-081-22/+24
| | | | Use `LogOpcodeType` rather than LogOpcodeBare` when the select instruction has a type.
* Re-generate all test expectations using `--rebase`. NFC (#1776)Sam Clegg2021-12-082-2/+6
| | | | 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.
* Show tag names in objdump disassembly (#1774)Sam Clegg2021-12-071-135/+177
| | | | | | | | | 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.
* Add multi-memory feature support (#1751)Yuhan Deng2021-11-302-2/+2
|
* Support function references in parameters and results of functions and ↵Dmitry Bezhetskov2021-11-162-0/+362
| | | | blocks. (#1695)
* Fix for wasm-objdump and memory64 segment offsets (#1743)Sam Clegg2021-10-181-0/+27
|
* Enable reference types by default (#1729)Sam Clegg2021-10-133-9/+11
| | | | | | | | | 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.
* Enable bulk memory by default (#1728)Sam Clegg2021-10-1310-6/+27
| | | | | | | | | | | 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
* Avoid writing DataCount section when it is not needed. (#1727)Sam Clegg2021-10-139-224/+162
| | | | | | | | | | | 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 (#1712)Ng Zhi An2021-09-2012-11/+3
| | | | | * SIMD is now phase 5, enable it by default * Update test flags, rebase test, and docs
* Add objdump flag to print section offsets instead of file offsets (#1696)Derek Schuff2021-08-051-0/+61
| | | Currently implemented just for disassembly. It could be added for other sections/functionality in the future.
* Begin support for typed function references proposal: added the flag and ↵Dmitry Bezhetskov2021-07-251-0/+108
| | | | supported call_ref (#1691)
* Allow plain `try` with no `catch` or `delegate` (#1676)Asumu Takikawa2021-06-291-22/+32
| | | | | | 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
* [EH] Remove `unwind` (#1682)Heejin Ahn2021-06-291-90/+0
| | | `unwind` was removed. See WebAssembly/exception-handling#156.
* Fix resolution of delegate labels (#1675)Asumu Takikawa2021-06-291-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [EH] Replace event with tag (#1678)Heejin Ahn2021-06-229-75/+75
| | | | | | | | | | | 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
* objdump: add support for segments flags in the linking section (#1669)Sam Clegg2021-05-136-24/+24
|
* [simd] Implement store lane (#1647)Ng Zhi An2021-03-221-0/+162
|
* [simd] Implement load lane (#1646)Ng Zhi An2021-03-221-0/+162
| | | | | | | | | 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.
* [simd] Rename widen to extend, implement some double precision ops (#1633)Ng Zhi An2021-03-111-351/+351
| | | | | | | | | | | | 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.
* [simd] Rename any_true, implement i64x2 bitmask and all_true (#1624)Ng Zhi An2021-03-041-148/+128
| | | | | | | | | | | * 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
* Update rethrow depth handling and catch_all opcode (#1608)Asumu Takikawa2021-02-181-0/+87
| | | | | | | | | | | | | 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).
* Update exception handling support to current proposal (#1596)Asumu Takikawa2021-02-105-161/+283
| | | | | | | | | | 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.
* objdump: Set table name based on import name (#1599)Sam Clegg2021-01-291-26/+32
|
* wasm-objdump: Report data segment names (#1588)Sam Clegg2020-12-092-81/+87
| | | Also fix ordering of data names and table segment names.
* wasm-objdump: display name of start function (#1581)Sam Clegg2020-12-031-11/+46
|
* Use stderr for all logging and error output (#1579)Sam Clegg2020-12-0397-103/+287
| | | | I'm not sure why we were using stdout but the convention is normally to write all logging and error message to stderr.
* wasm-objdump: Honor extended names section (#1573)Sam Clegg2020-11-203-6/+6
| | | This should really have been part of #1554
* Update output from type to func type in binary writer and reader (#1570)Radu M2020-11-1686-120/+120
| | | Signed-off-by: Radu M <root@radu.sh>
* Rename atomic.notify, *.atomic.wait (#1564)Ben Smith2020-11-031-3/+3
| | | | | | | | 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.