Engine Backends
Notes on SpiderMonkey, JavaScriptCore, and V8 support.
Overview
o- can run JavaScript on multiple engine backends behind the same
JSEngine interface.
SpiderMonkey
Path:
toolchains/spidermonkeyNotes:
- Loads the shared
jstdbootstrap before running user code. - Uses a dedicated SpiderMonkey runtime wrapper.
- Runtime teardown is currently treated conservatively to avoid shutdown-time crashes in this embedding.
JavaScriptCore
Path:
toolchains/javascriptcoreNotes:
- Uses
rust_jsc. - Registers shared host callbacks and then evaluates the same
jstdbootstrap used by the other engines.
V8
Path:
toolchains/v8Notes:
- Uses the Rust
v8bindings. - Initializes the V8 platform once, then creates a fresh isolate/context for each run.
- Installs the same
__jstd_*host callbacks and executes the shared bootstrap before evaluating your script.
Shared Contract
All engines are expected to:
- implement the shared
JSEnginetrait fromo-core - return the shared
JSError/JSResulttypes - expose the
jstdhost hooks needed by the bootstrap script - make common built-ins behave the same way where possible