| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
relpath here was failing with on windows when TMPDIR is on a different
drive. This is because `new_module_filename` lives in the TMPDIR
where and json_dir might be on different drive.
These paths don't get embedded in the final JS anyway because we
embed them directly binary strings so its not important that they are
relative.
|
|
|
| |
These are pretty minimal, more will be added as part of feature-PRs.
|
|
|
|
|
|
|
|
| |
pep8 specifies 4 space indentation. The use of 2 spaces is, I believe,
a historical anomaly where certain large organizations such as google
chose 2 over 4 and have yet to make the switch.
For a project like wabt with little python code I think the cost of
switching is small enough to justify the churn.
|
|
|
|
|
|
| |
There's a lot more that this tool could do, but even this is helpful for
now.
Fixes issue #631.
|
|
|
|
|
|
| |
This is been superseded by lld and we no longer have the
bandwidth to maintain a separate linker.
|
|
|
|
|
| |
This does remove some functionality (the ability to run directly with a
specified JS-engine), but it wasn't actually tested anywhere. IMO, it's
better to just remove for simplicity's sake.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove `run-objdump.py`; replace with `RUN` cmds
This CL introduces two new TOOLs for tests:
* `run-objdump-gen-wasm`: Run objdump on wasm files generated by
`gen-wasm.py`.
* `run-objdump-spec`: Run objdump on wasm files generated by
`wast2json`. For now, this requires each test to specify the files
manually: `%(temp_file)s.0.wasm %(temp_file)s.1.wasm` etc.
`gen_wasm_py` has been added as a new RUN variable as well.
* Call FixPythonExecutable after expanding variables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
It's currently identical to wasm2wat, without the part to write out a
.wat file.
|
|
|
|
|
|
| |
* `wasm-interp` tool now only runs `.wasm` file, not spec tests
* `wasm-interp` has a new flag `--host-print` for importing a print
function named "host.print"
* `spectest-interp` tool runs only `.json` files
|
| |
|
|
|
|
| |
* wat2wasm only parses wat files (individual modules)
* wast2json parses spec test files and generates json + wasm
|
|
|
| |
See issue #543.
|
|
|
| |
This is where 'make install' will put stuff by default.
|
|
|
|
| |
This is more consistent with how llvm and binutils
name such tools.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add support for yapf python formatting tool
This changs adds .style.yapf to define the python style
we are using.
I also ran yapf over all the python files:
$ yapf -i `git ls-files *.py`
Going forward, we should probably add a travis test to
prevent regressions. We should probably also switch to
more conventional 4-space indentation, which is used by
almost everybody outside of Google.
|
|
|
| |
This simplifies the invocations and aids maintainability.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds support for writing wasm modules such
that they are compatible with the proposed linking spec:
https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md
Basically this means that wast2wasm will generate and extra
'reloc' sections and will pad any LEBs in the code section
that might require relocation.
This mode is activated by passing the -r flag to wast2wasm.
Also, start work on wasm-link which should be able to link
such modules together.
|
| |
|
|
|
|
|
|
| |
* Add wasmdump binary for inspecting wasm files
Run this tool to as part of the 'dump' tests rather
than using the -d flag to wast2wasm.
|
|
|
|
|
| |
Also rename the last few places using SexprWasm, WasmWast. Make
formatting a little nicer too.
|
|
|
|
|
|
|
|
| |
This is followup to (#102) which renamed the executable
files. It propagated the rename the tools and test
runner.
It also fixes the 'run-tests' target which was passing
the wrong argument name to the run_tests.py script.
|
|
|
|
|
| |
It's not really the appropriate place to handle it. Now that we have
wasm-wast and wasm-interp, we can at least verify that the tools are
internally consistent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix build on Windows
Changed stderr and stdout to binary mode on Windows. This avoids printing \r\r\n which causes tests to fail
Make sure not to print backward slash in .json file
* Explicitly pass the program name to print usage instead of getting it from argv.
The format was too different between Linux and Windows (forward slash vs backward slash && .exe at the on Windows).
This was failing a lot of baseline checks in the test suite.
* Read wast file as binary instead of text mode. Buffer offset to file offset is unreliable in text mode.
Added support for carriage return when searching for line offset
* Test tools, search binary using .exe on Windows
Account for backward slash in spec.js
* Fix diffing file by ignoring endline (this is too unstable between Windows and other platforms)
* CR Fixes
|
| |
|
| |
|
|
|
|
| |
Works by generating an instruction stream for a simple stack machine.
|
| |
|
|
* run-tests.py now takes a `--d8-executable` flag
* Added a `TOOL` directive to tests to reduce boilerplate
* Change all tests to use the new `TOOL` directive
* Factor out executable searching with fallback to find_exe.py
This fixes issue #43.
|