| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The memory64 `table.wast` test has started to depend on
function-references and gc (which WABT doesn't support yet), so vendor
an older version of the test.
|
|
|
|
|
| |
See https://github.com/WebAssembly/memory64/issues/51
Includes workaround for #2422
|
|
|
|
|
|
|
| |
The main change here is because `comments.wast` was updated to include
a "quoted" module at the top level.
Previously quoted modules had only been used as part of invalid or
malformed assertion expressions.
|
| |
|
|
|
|
|
| |
WastParser now handles the abbreviated (no tableidx) forms of
table.{get,set,size,grow,fill} (needed after
https://github.com/WebAssembly/spec/pull/1582).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As well as the testsuite update there are two notable changes that
come with it here. These can both be split out an landed first if
it makes sense.
1. wasm2c now supports element sections containing externref. Currently
only the null reference is supported.
2. element segments no longer use funcref as the default element type
but instead, unless explicitly included in the binary, the
element type defaults to the type of the table in which the segment
is active.
Fixes: #1612 #2022
|
| |
|
| |
|
|
|
|
| |
Remove test/binary/bad-function-missing-end.txt which is now
covered upstream: https://github.com/WebAssembly/spec/pull/1405
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
bulk-memory-operations and reference-types were completely
removed from the upstream testsuite becuase there were
merged into the upstream spec:
https://github.com/WebAssembly/testsuite/pull/44
In order to land this I had to disable several spec tests
under wasm2c because it lacks support for mutli-table and
reference types. I filed #1737 to track this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Bump third_party/testsuite
* Run test/update-spec-tests.py
* Skip new simd tests that are not implemented
* Rebase some tests in test/spec based on latest update to testsuite
* Define global_i64 for wasm2c global tests
* Skip more simd tests due to updated/new instructions
|
|
|
|
|
|
|
|
|
| |
This is an incremental bump of testsuite, the TOT has SIMD tests
which won't work yet.
The main fix is for a test added to the spec repo that has an invalid
functype in the type section. Based on the spec, the functype should be
a single byte 0x60. The leb encoding only comes into effect with the GC
proposal.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update testsuite
* Update test results
* Disallow lane nums with optional + for simd ops
* Update simd support
* Mark `test/spec/func.txt` as failing
Co-authored-by: Darin Morrison <darinmorrison@users.noreply.github.com>
|
|
|
| |
(this is HEAD~1 as of this writing, HEAD containing the Memory64 tests which I want to land separately)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interpreter and wasm2c were incorrectly handling some float-to-int
conversions. For clarity, the wasm2c implementations of these
conversions now matches the implementation in interp-math.h more closely
(e.g. the numeric ranges are written as `x >= min && x <= max` in both
cases).
Quite a few wasm2c tests were previously being skipped, since wasm2c
doesn't currently support multi-value; it's better instead to duplicate
the tests here and disable the parts that are not supported so we don't
lose test coverage.
|
|
|
|
|
|
|
|
|
| |
See https://github.com/WebAssembly/reference-types/issues/99.
This change also updates the testsuite, so the spec tests pass too.
In addition, the behavior of `br_table` is no longer different from MVP,
and has a text to confirm this. That is now fixed in `type-checker.cc`
too.
|
|
|
|
|
|
|
|
| |
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`
|
|
|
|
|
|
|
| |
Includes the three merged proposals (nontrapping-float-to-int,
sign-extension, multi-value).
It also has one bug fix when parsing table limits (when the min or max
size does not fit in a 32-bit int).
|
|
|
|
| |
* Add i{8x16,16x8,32x4}.abs instructions
* Implement IntAbs in interp-math.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new table-sub test, checks whether the subtyping is handled
properly w/ table.init and table.copy instructions.
The BeginElemSegment callback can't pass the element type anymore, since
it's not known yet. The callback also can't be deferred, since the
BeginElemSegmentInitExpr callback has to happen after the
BeginElemSegment callback, but the reference type is not always known
until after the initializer expression is read. To work around this, I
added a new OnElemSegmentElemType callback.
Other element segment changes:
* The element type must be tracked in the SharedValidator
* A subtle fix: when writing out the segment flags, we need to take into
account whether the element type of the segment is not funcref, even
if there are no element expressions. In that case, we have to use flag
bit 0x4 (SegUseElemExprs).
In addition, the TableCopy and TableInit instructions weren't handling
table indexes fully.
* TableCopy variables are read in the parser (both optional)
* TableCopy names are now resolved + applied
* TableCopy indexes are now validated
* TableInit table variables are read in the parser; this is subtle,
since the text format has order $table $segment, but the $table is
optional.
|
|
|
|
|
| |
The main change here is the addition of declared elem sections.
|
|
|
|
|
|
|
|
|
|
| |
* Remove `assert_return_func`. This is now handled by using
`assert_return` with `(ref.func)`.
* The reference types proposal depends on the bulk memory proposal, so
using `--enable-reference-types` automatically includes
`--enable-bulk-memory`.
* `table.fill` no longer clamps to the valid range, and instead checks
before writing anything. This matches the other bulk instructions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The two primary changes involved are:
1. Removal of `assert_return_canonical_nan`/`arithetic nan` in favor of
special `nan:canonical`/`nan:arithmetic` constants that can only be
used in test expectations.
See: https://github.com/WebAssembly/spec/pull/1104
2. New trapping behaviour for bulk memory operations. Range checks are
now performed up front for opterations such as memory.fill and
memory.copy.
See: https://github.com/webassembly/bulk-memory-operations/issues/111
And: https://github.com/webassembly/bulk-memory-operations/pull/123
The old behaviour is still kept around to support table.fill which
is defined in reference-types proposal and has yet to be updated.
|
|
|
|
|
|
|
| |
The only major change to the interpreter is to move segment
initialization out `ReadBinaryInterp` (in the binary reader) and into
interp.cc. This is because the test suite now expects out of bound
semgments to be reported during initialization rather than reported
as validation errors.
|
|
|
|
|
| |
* Remove passive keyword from bulk-memory
* Fix rounding on hex floats
* Allow underscores in NaN payloads
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When a module is instantiated, and the start function traps, the
contents of the memory and the table may have been modified. This case
is handled by the `assert_uninstantiable` check in a wast test.
In spectest-interp, assert_uninstantiable would instantiate the module,
but was incorrectly resetting the environment. In run-spec-wasm2c, the
`assert_uninstantiable` tests weren't being run at all. Now the module's
`init` function is run, and it is expected to trap.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This huge PR does all the renaming as described in issue #933. It also
updates to the latest testsuite so the new names are used.
The old names of the MVP instructions are still supported for
convenience (though we should remove those too at some point), but the
old simd and atomic instruction names are no longer supported.
|
| |
|
|
|
|
| |
Also fix bug when parsing elem/data segment; the table/memory index is
stored as an LEB128, not a U8.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
`grow_memory` -> `memory.grow`
`current_memory` -> `memory.size`
This could have been a smaller change, but I took the opportunity to
rename the Token types, Expr types, and callback functions too. Many of
these are sorted alphabetically, so I resorted based on their new names.
|
| |
|
|
|
|
| |
* Fix edge case elem segment bounds checking
* Fix bounds checking when importing spectest table
|
|
|
|
|
| |
The spectest module's functions and globals are no longer overloaded, so
their implementations in `spectest-interp` and `spec-wasm2c-prefix.c`
have to be changed as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `call_indirect` instruction now allows the type to be specified
inline or via the common "type use" syntax (or both):
```
call_indirect (type $t1) ...
call_indirect (param i32 f32) (result f64) ...
call_indirect (type $t2) (param i32) ...
```
This means that `CallIndirectExpr` changes from storing a `Var` (the
referenced func type) to a `FuncDeclaration`, which can store both a
type use and a function signature. Most of the changes here are fallout
from that change.
The other major change is that function signature resolution and error
checking now needs to iterate over a functions expr list looking for
`call_indirect` instructions. I'm not sure if this is a significant
overhead in parsing/validation yet, but there are plenty of ways to
optimize it if it ends up in profiles.
|
| |
|
| |
|
|
|
|
|
|
| |
* Mostly just updating test expectations
* Function signatures need to be checked as part of parsing (see
assert_malformed test in `testsuite/func.wast`; added
`ValidateFuncSignatures` for this.
|
|
|
|
|
|
|
| |
* Implicit function types are now appended to the module, not directly
after the function/import that uses them.
* Float and int literals can have an underscore separating digits.
|
| |
|
|
|
|
|
|
|
| |
* Return error when floats overflow (used to return inf)
* Significantly simplfy the significand parser in FloatParser::ParseHex
* Add some new parse tests to hexfloat.cc; the previous tests only
checked valid/canonical strings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add support for quoted modules: `(module quote "...")`
* Binary modules must be annotated: `(module binary "...")`
* Multiple result blocks are no longer a parser error:
`(func (result i32) (result i32) ...)`
* Function types can specify unused bind variables:
`(type (func (param $foo)))`
* Rename `RawModule` -> `ScriptModule`. This encapsulates a module that
may not be parsed yet, whether binary or "quoted".
* Validate load/store offsets and alignment in the parser, not in the
validator. The spec tests assume that you can catch these errors with
`assert_malformed`.
* Parse wast files in `wasm-interp` when checking malformed/invalid/etc.
modules. This allows us to run all assertions at the same time, which
is nice. `wasm-interp` should probably be renamed, though.
* Two tests in `type.wast` fail because they use:
`(assert_invalid (module quote "..."))`. I'd prefer that we don't
support this, since it's unnecessary, and additional work. I'll fix in
a follow-up CL if we decide this is worth keeping.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update testsuite; various lexing/parsing fixes
Lexer changes:
* Switch re2c parser to UTF-8 parser. This can almost be done "for
free" with a flag, but required a bit of work to allow us to catch
malformed UTF-8 as well.
* Change the re2c fill value to 0xff, since it's never a valid UTF-8 byte.
* Allow for more reserved tokens (basically any ascii aside from
parentheses, double-quote, and semi-colon)
* Remove "infinity" from lexer, only "inf" is allowed now.
* Change definition of EOF token, it was implemented incorrectly. The
correct way to handle it is to only return it from FILL when there is no
more data to fill.
* \r is a valid escape.
Parser changes:
* Changes to match the spec parser:
- block signatures use (result <type>) syntax
- func/global/table/memory can have multiple inline exports
- inline imports are handled in func definition instead of import
definition
- allow for inline modules (i.e. no "(module ...)" s-expr required)
* Remove FuncField. This was previously used for parsing
params/results/locals, but it's less code to just parse
right-recursive (i.e. backward) and insert everything at the front.
This requires reversing the indexes in the BindingHash too.
* Remove the nasty macros `APPEND_FIELD_TO_LIST`,
`APPEND_ITEM_TO_VECTOR`, `APPEND_INLINE_EXPORT`, and
`CHECK_IMPORT_ORDERING`. This behavior is all handled by
`append_module_fields` now.
* All inline imports/exports are handled by returning additional
ModuleFields in a list. This removes the need for `OptionalExport`,
`ExportedFunc`, `ExportedGlobal`, `ExportedTable`, and
`ExportedMemory`.
* Use "_opt" suffix instead of "non_empty_" prefix, e.g.:
- text_list => text_list_opt, non_empty_text_list => text_list
* The locations changed for some symbols, typically the use the name
following the LPAR now, e.g. (import
^^^^^^
* Add PPA for re2c 0.16
* add -y to skip confirmation on travis
|