Skip to content

SpiderMonkey

arai-a edited this page Jun 17, 2020 · 17 revisions

Building SpiderMonkey with SmooshMonkey enabled, with local jsparagus clone

Prerequisites

  • Clone jsparagus (referred as $JSPARAGUS below)
  • Setup development environment for Firefox.
    • NOTE: While running bootstrap.py, clone mozilla-central or mozilla-unified (referred as $MOZROOT below) next to jsparagus

Build

cd $JSPARAGUS
make all
cargo run --bin smoosh_tools build

cargo run --bin smoosh_tools build does the following internally:

  • Modify $MOZROOT/js/src/frontend/smoosh/Cargo.toml to point local jsparagus clone
  • Run ./mach build using $JSPARAGUS/mozconfigs/smoosh-debug
    • the important config here is --enable-smoosh

Running SpiderMonkey JS shell

cd $JSPARAGUS
cargo run --bin smoosh_tools shell

or, directly run the binary by:

$MOZROOT/obj-smoosh-debug/dist/bin/js --smoosh

Running tests

cd $JSPARAGUS
cargo run --bin smoosh_tools test

cargo run --bin smoosh_tools test does the following internally:

  • Run ./mach jstest using $JSPARAGUS/mozconfigs/smoosh-debug
  • Run ./mach jit-test using $JSPARAGUS/mozconfigs/smoosh-debug

Bumping jsparagus revision in mozilla-central

cd $JSPARAGUS
cargo run --bin smoosh_tools bump

And then add the updated files and commit it.

cargo run --bin smoosh_tools bump does the following internally:

  • Modify $MOZROOT/js/src/frontend/smoosh/Cargo.toml to point the latest ci_generated branch HEAD
  • Run ./mach vendor rust to re-vendor jsparagus