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

Support weval-based ahead-of-time compilation of JavaScript. #91

Merged
merged 6 commits into from
Jul 31, 2024

Commits on Jul 29, 2024

  1. 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
    cfallin committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    d9ebc0d View commit details
    Browse the repository at this point in the history
  2. support weval testing

    guybedford committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    3c3de2c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    89a5e08 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. 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.
    cfallin committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    4804bf4 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Configuration menu
    Copy the full SHA
    14e7cd3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bb4ac7a View commit details
    Browse the repository at this point in the history