Skip to content

feat: add v8_lite_mode cargo feature for jitless builds#1979

Open
bartlomieju wants to merge 3 commits into
mainfrom
feat-v8-lite-mode
Open

feat: add v8_lite_mode cargo feature for jitless builds#1979
bartlomieju wants to merge 3 commits into
mainfrom
feat-v8-lite-mode

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Adds an opt-in cargo feature, v8_lite_mode, that produces a smaller
prebuilt static-library archive by building V8 with the optimizing JIT
tiers compiled out: Turbofan, Maglev and Sparkplug are disabled and the
runtime is switched to jitless mode. WebAssembly support is retained
via the DrumBrake interpreter, so embedders that don't need the JIT
tiers can still run Wasm.

DrumBrake requires pointer compression and only supports x64/arm64 on
macOS, Linux and Windows, so the feature transitively enables
v8_enable_pointer_compression and the CI matrix publishes the
resulting _ptrcomp_lite release archive for exactly those targets.
build.rs maps the feature to the corresponding GN args
(v8_jitless, v8_enable_turbofan, v8_enable_maglev,
v8_enable_sparkplug, v8_enable_webassembly, v8_enable_drumbrake)
and threads _lite through the prebuilt binary suffix.

Adds an opt-in `v8_lite_mode` feature that builds V8 in jitless mode with
Turbofan, Maglev and Sparkplug disabled. WebAssembly support is retained
via the DrumBrake interpreter, which requires pointer compression, so the
feature transitively enables `v8_enable_pointer_compression`.

The build.rs wiring emits the corresponding GN args
(v8_jitless, v8_enable_turbofan, v8_enable_maglev, v8_enable_sparkplug,
v8_enable_webassembly, v8_enable_drumbrake) and a new `_lite` prebuilt
binary suffix. New release-only CI matrix entries publish lite-mode
archives for the macOS, Linux and Windows x64/arm64 targets supported
by DrumBrake.
@Hajime-san
Copy link
Copy Markdown

Oh, I was just about to try out JIT-less build in a side project.😃
Would it be speed up the time of bootstrapping on the environment like AWS Lambda if JIT is disabled?

@bartlomieju
Copy link
Copy Markdown
Member Author

Would it be speed up the time of bootstrapping on the environment like AWS Lambda if JIT is disabled?

Not directly, this is only for experiment to see how small V8 build can be.

The DrumBrake interpreter currently fails to build against this V8
revision: wasm-interpreter-runtime.cc uses inline accessors from
wasm-objects-inl.h without including it, tripping -Werror,-Wundefined-inline.
Disable WebAssembly in lite mode for now; we can reintroduce DrumBrake
once that V8 source issue is fixed upstream.
V8's jitless-only code paths have latent warnings (e.g. unused 'is_code'
label in builtins-x64.cc when V8_JITLESS_BOOL is true) that fire under
-Werror,-Wunused-variable. Drop treat_warnings_as_errors for the
lite_mode build variant only; the default build still treats warnings
as errors.
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.

2 participants