summaryrefslogtreecommitdiff
path: root/test/wasm2c/spec/memory.txt
Commit message (Collapse)AuthorAgeFilesLines
* Update testsuite (#2495)Keith Winstein2024-10-301-1/+1
| | | | | 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.
* The great renaming (#985)Ben Smith2018-12-191-1/+1
| | | | | | | | 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.
* Update to the lastest spec testsuite (#953)Ben Smith2018-11-071-1/+1
|
* Update testsuite; enable mut. globals by default (#884)Ben Smith2018-08-031-1/+1
| | | | | | | | 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.
* Add wasm2c tool (#710)Ben Smith2018-01-081-0/+5
Add `wasm2c`, a new tool that reads a `.wasm` file and generates a C source file and its accompanying header file. The C output currently only supports gcc/clang compilers, since it uses builtins for some functionality. The resulting C code is not standalone; there are runtime functions that must be provided, as well as pointers to all imports. The C runtime symbols that must be provided are as follows: * `void wasm_rt_trap(wasm_rt_trap_t code)`: Called when the WebAssembly code traps. This function must not return. * `u32 wasm_rt_register_func_type(u32 param_count, u32 result_count, ...)`: Register a function type with the given signature. This function must check whether this signature has already been registered and return the original index. * `void wasm_rt_allocate_memory(wasm_rt_memory_t*, u32 initial, u32 max)`: Allocate the memory buffer for the given memory object, given the number of pages. The memory must be zeroed before returning. * `u32 wasm_rt_grow_memory(wasm_rt_memory_t*, u32 delta)`: Grow memory by the given number of pages. If allocation fails, or the new pages size is larger than the maximum, return -1. Otherwise return the previous number of pages. The newly allocated memory must be zeroed. * `void wasm_rt_allocate_table(wasm_rt_table_t*, u32 initial, u32 max)`: Allocate the buffer for the given table object. The buffer must be zeroed before returning. * `u32 wasm_rt_call_stack_depth`: A symbol that tracks the current call stack depth. If this value exceeds `WASM_RT_MAX_CALL_STACK_DEPTH` then a trap occurs. This value defaults to 500, but can redefined. An example implementation can be found in `spec-wasm2c-prefix.c`. All functionality from the WebAssembly MVP is supported, and the generated code passes all of the core spec tests. There is a new test tool called `run-spec-wasm2c.py` which runs the following: * `wast2json` to convert the spec test to json and wasm files * `wasm2c` to convert the wasm to C source and headers * a C compiler (default `cc`) to compile and link all C source files, including a C test runner (`spec-wasm2c-prefix.c`) * Finally, the resulting executable to produce output