gecko-dev/js/rust
Jon Coppeard ad4df9ae33 Bug 1581574 - Remove Heap<T> write barrier and rely on existing read barrier to make incremental marking work r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D46133

--HG--
extra : moz-landing-system : lando
2019-09-20 10:09:19 +00:00
..
etc Bug 1534967 - Part 2: Use RootedIdVector in rust binding. r=jonco,fitzgen 2019-04-08 10:46:58 +08:00
src Bug 1581574 - Remove Heap<T> write barrier and rely on existing read barrier to make incremental marking work r=sfink 2019-09-20 10:09:19 +00:00
tests Bug 1573844 - Remove js::Class definition and alias JSClass to it r=tcampbell,mccr8 2019-08-15 08:32:22 +00:00
.gitignore
CMakeLists.txt
Cargo.toml Bug 1580908 - Part 7: Update glob to 0.3. r=froydnj 2019-09-12 21:46:17 +00:00
README.md
build.rs Bug 1573844 - Remove references to js::Class and remove the alias r=tcampbell 2019-08-14 19:13:12 +00:00

README.md

The js Crate: Rust Bindings to SpiderMonkey

User Documentation

Building

To build a release version of SpiderMonkey and the Rust code with optimizations enabled:

$ cargo build --release

To build with SpiderMonkey's DEBUG checks and assertions:

$ cargo build --features debugmozjs

Raw FFI bindings to JSAPI are machine generated with rust-lang-nursery/rust-bindgen, and requires libclang >= 3.9. See ./build.rs for details.

Cargo Features

  • debugmozjs: Create a DEBUG build of SpiderMonkey with many extra assertions enabled. This is decoupled from whether the crate and its Rust code is built in debug or release mode.

  • promises: Enable SpiderMonkey native promises.

  • nonzero: Leverage the unstable NonZero type. Requires nightly Rust.

Testing

Make sure to test both with and without the debugmozjs feature because various structures have different sizes and get passed through functions differently at the ABI level! At minimum, you should test with debugmozjs to get extra assertions and checking.

$ cargo test
$ cargo test --features debugmozjs