Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to include some gecko-dev fixes for StarlingMonkey. #19

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

cfallin
Copy link
Member

@cfallin cfallin commented Jul 31, 2024

Two issues discovered while debugging the testsuite in StarlingMonkey:

With these two changes, this version of SpiderMonkey allows the StarlingMonkey integration test suite to pass in
bytecodealliance/StarlingMonkey#91.

@cfallin
Copy link
Member Author

cfallin commented Jul 31, 2024

I'll update the commit hash once the two PRs above merge; wanted to stage this in parallel in the meantime.

Two issues discovered while debugging the testsuite in StarlingMonkey:

- bytecodealliance/gecko-dev#54: fixes handling of conditionals by weval
  when LLVM applies if-conversion in a new place; use of weval intrinsic
  for value-specialization / subcontext splitting should make this more
  robust.

- bytecodealliance/gecko-dev#55: fixes missing interpreter-PC values in
  stack frames up the stack during unwind because of too-aggressive
  optimization trick in weval'd bodies.

With these two changes, this version of SpiderMonkey allows the
StarlingMonkey integration test suite to pass in
bytecodealliance/StarlingMonkey#91.
@cfallin cfallin merged commit 99d3bca into bytecodealliance:main Jul 31, 2024
1 check passed
@cfallin cfallin deleted the update-20240730 branch July 31, 2024 18:04
guybedford added a commit to bytecodealliance/StarlingMonkey that referenced this pull request Jul 31, 2024
* 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants