You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support weval-based ahead-of-time compilation of JavaScript. (#91)
* Support weval-based ahead-of-time compilation of JavaScript.
When the `WEVAL` option is turned on (`cmake -DWEVAL=ON`), this PR adds:
- Integration to the CMake machinery to fetch a PBL+weval-ified version
of SpiderMonkey artifacts;
- Likewise, to fetch weval binaries;
- A rule to pre-build a compilation cache of IC bodies specific to the
StarlingMonkey build, so weval can use this cache and spend time only
on user-provided code on first run;
- Integration in `componentize.sh`.
When built with:
```
$ mkdir build/; cd build/
$ cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_WASM_OPT=OFF -DWEVAL=ON
$ make
```
We can then do:
```
$ build/componentize.sh file.js --aot -o file.wasm
$ wasmtime serve -S cli=y file.wasm
```
Using the Richards Octane benchmark adapted slightly with a `main()` for
the HTTP server world [1], I get the following results:
```
% build/componentize.sh
richards.js --aot -o weval.wasm
Componentizing richards.js into weval.wasm
[ verbose weval progress output ]
% wasmtime serve -S cli=y weval.wasm
Serving HTTP on http://0.0.0.0:8080/
stdout [0] :: Log: Richards: 676
stdout [0] :: Log: ----
stdout [0] :: Log: Score (version 9): 676
% wasmtime serve -S cli=y base.wasm
Serving HTTP on http://0.0.0.0:8080/
stdout [0] :: Log: Richards: 189
stdout [0] :: Log: ----
stdout [0] :: Log: Score (version 9): 189
```
[1]: https://gist.github.com/cfallin/4b18da12413e93f7e88568a92d09e4b7
* support weval testing
* add ci workflow for Weval test suite
* Update weval, resolving two test failures.
This commit updates to weval v0.2.7 which has no output by default,
allowing the expected-failure tests checking syntax error messages to
pass; we now pass 9/10 integration tests.
It also updates the flags on `componentize.sh`: a `--verbose` flag to
allow the user to see weval progress messages (perhaps useful if the
build is taking a long time, or to see the stats on function
specializations); and removal of the `--aot` flag, because there is only
one valid setting for a build configuration and it is not baked into the
shell script automatically.
* Update SpiderMonkey version to include two fixes (bytecodealliance/spidermonkey-wasi-embedding#19).
---------
Co-authored-by: Guy Bedford <gbedford@fastly.com>
0 commit comments