| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
This is in preparation for updating to latest version reference-types
proposal where there is an additional flag and they can be combined.
See: https://github.com/WebAssembly/bulk-memory-operations/issues/98
Also, add ERROR_IF to binary-reader.cc as logical corollary to the
existing ERROR_UNLESS.
|
|
|
|
|
|
| |
Tests will follow in the form of the spec tests from the reference-types
repo.
See: #1223
|
|
|
|
|
|
|
|
|
|
| |
This involved plumbing the table argument for `table.init` and
`table.copy` all the way through rather than assuming they were
always zero.
Update the rather complex logic for assigning names to elem segments to
handle active elem segments which both name themselves and the table
they apply too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add Hostref type which is an internal subtype of anyref used to
refer to host objects.
Since anyref is an abstract base type it should be be stored directly
on the value stack. The value stack instead must contain refs of
the concrete RefType enumeration (currently Null, Func, or Foreign).
These changes are needed for the implementation of the C API but are
separately useful for improving conformance with the reftype proposal.
Implement sub-typing rules for parameters and results when using
CallFunction in the interpreter.
|
|
|
|
|
|
|
| |
The _bits suffix is used the floating point types where we use types
that differ from the native C types. For v128 we have a native struct
type that we store and manipulate directly.
Also remove the unneeded bitcast operations.
|
|
|
|
| |
This requires the type of a global to be distinct from its current
TypedValue contents.
|
|
|
|
|
|
|
|
|
| |
This is needed as part of implementing the C API on top of the
interpreter.
Also remove the trailing `_` to match other struct members in this
file.
Also remove unneeded forward decls.
|
|
|
|
| |
- Implement ref.func everywhere.
- Implement table.get and table.set in the interpreter.
|
|
|
|
| |
This change also makes it easier to add an alternative import
resolver that is needed for implementing the C API.
|
|
|
|
|
|
|
|
|
| |
As per the reference-types spec, ref.null is a constant expression.
I did try to add support for ref.func at the same time, but I didn't
really understand the strategy of wabt and reference types; there seems
to be strong intertwingliness between func.ref and the element section,
whereas it does seem possible for a func.ref to be global. Oh well, I
didn't need it :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add support for v8x16.shuffle1 and v8x16.shuffle2_imm.
v8x16.shuffle2_imm is a rename of the previous v8x16.shuffle, but I add a copy of the code as if it were a new instruction in case the spec proposal makes further changes. The tests for old v8x16.shuffle remain in place and while there are new tests for the new v8x16.shuffle1, there are not for v8x16.shuffle2_imm. The behaviour and implementation are the same as for v8x16.shuffle, so we should simply search and replace the existing tests at some point, leaving one of them untested, probably the deprecated v8x16.shuffle.
I did test v8x16.shuffle1 against the SIMD spec test from WAVM and it passes. The WAVM spec tests for v8x16.shuffle2_imm parse but it has no invocations of the instruction.
* Rename v8x16.shuffle1 and x8v16.shuffle2_imm to v8x16.swizzle and v8x16.shuffle_imm.
* Update SIMD operands.
* Swizzle is just a binary operator.
* Shuffle is named "v8x16.shuffle".
* Add 4 new opcodes for load_splat.
* Remove legacy 0xfd 0x03 opcode for shuffle.
* Test all four load splats.
|
|
|
|
|
|
|
|
|
|
| |
The previous implementation was not properly dropping values on the
stack when performing a return_call or return_call_indirect.
In particular, the "keep count" (i.e. the number of values to keep that
are on the top of the stack) was set properly, but the "drop count" (the
number of values to drop below the keep count), was not.
This fixes issue #1108.
|
|
|
|
|
|
|
|
| |
* i32 init expression in data/elem segments
* Instructions after the last "end" instruction of the function (the
function label has been popped)
Fixes #1089, #1090, #1091
|
|
|
|
|
|
|
|
|
| |
* Implement bulk memory in interpreter
* Read/Write elem_type in element segments
* Binary format
* Text format (`(elem passive funcref...)`)
* Add DataSegment runtime objects
* Only initialize active data segments when instantiating
|
|
|
|
|
| |
* Store element segments as a vector of `ElemExpr`, instead of func index
* Read/write binary format for each element expression
* Read/write text format for each element expression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 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.
|
|
|
| |
This is useful for finding large functions with wasm-objdump.
|
|
|
|
|
|
| |
return_call
return_call_indirect
with some simple tests thereof.
|
|
* Create src/interp/ directory
* Move Thread::Trace into src/interp/interp-trace.cc
* Move Environment::Disassemble into src/interp/interp-disassemble.cc
* Move shared code into src/interp/interp-internal.h
|