-
Notifications
You must be signed in to change notification settings - Fork 28
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
Experimental: add ahead-of-time compilation via weval and PBL. #883
Merged
Commits on Aug 1, 2024
-
Experimental: add ahead-of-time compilation via weval and PBL.
This PR pulls in my work to use "weval", the WebAssembly partial evaluator, to perform ahead-of-time compilation of JavaScript using the PBL interpreter we previously contributed to SpiderMonkey. This work has been merged into the BA fork of SpiderMonkey in bytecodealliance/gecko-dev#45, bytecodealliance/gecko-dev#46, bytecodealliance/gecko-dev#47, bytecodealliance/gecko-dev#48, bytecodealliance/gecko-dev#51, bytecodealliance/gecko-dev#52, bytecodealliance/gecko-dev#53, bytecodealliance/gecko-dev#54, bytecodealliance/gecko-dev#55, and then integrated into StarlingMonkey in bytecodealliance/StarlingMonkey#91. The feature is off by default; it requires a `--enable-experimental-aot` flag to be passed to `js-compute-runtime-cli.js`. This requires a separate build of the engine Wasm module to be used when the flag is passed. This should still be considered experimental until it is tested more widely. The PBL+weval combination passes all jit-tests and jstests in SpiderMonkey, and all integration tests in StarlingMonkey; however, it has not yet been widely tested in real-world scenarios. Initial speedups we are seeing on Octane (CPU-intensive JS benchmarks) are in the 3x-5x range. This is roughly equivalent to the speedup that a native JS engine's "baseline JIT" compiler tier gets over its interpreter, and it uses the same basic techniques -- compiling all polymorphic operations (all basic JS operators) to inline-cache sites that dispatch to stubs depending on types. Further speedups can be obtained eventually by inlining stubs from warmed-up IC chains, but that requires warmup. Important to note is that this compilation approach is *fully ahead-of-time*: it requires no profiling or observation or warmup of user code, and compiles the JS directly to Wasm that does not do any further codegen/JIT at runtime. Thus, it is suitable for the per-request isolation model (new Wasm instance for each request, with no shared state).
Configuration menu - View commit details
-
Copy full SHA for 9836c60 - Browse repository at this point
Copy the full SHA 9836c60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 16b8c48 - Browse repository at this point
Copy the full SHA 16b8c48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 395f40c - Browse repository at this point
Copy the full SHA 395f40cView commit details -
Configuration menu - View commit details
-
Copy full SHA for aa37232 - Browse repository at this point
Copy the full SHA aa37232View commit details
Commits on Aug 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 383b07f - Browse repository at this point
Copy the full SHA 383b07fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b47ca50 - Browse repository at this point
Copy the full SHA b47ca50View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8d5d18 - Browse repository at this point
Copy the full SHA a8d5d18View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1a3578 - Browse repository at this point
Copy the full SHA d1a3578View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4147560 - Browse repository at this point
Copy the full SHA 4147560View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37ebf2a - Browse repository at this point
Copy the full SHA 37ebf2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 72c274d - Browse repository at this point
Copy the full SHA 72c274dView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.