Skip to content

Instantly share code, notes, and snippets.

@bnjbvr
Last active April 15, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnjbvr/f39bfc41082c3b50cbbb92877cfc7e9f to your computer and use it in GitHub Desktop.
Save bnjbvr/f39bfc41082c3b50cbbb92877cfc7e9f to your computer and use it in GitHub Desktop.
Misc spidermonkey commands
1. When running configure, pass the `--enable-perf` configuration option. Re-build the shell.
2. Run the shell with
```
IONPERF=func perf record $jsshell --no-wasm-multi-value --shared-memory=off --wasm-compiler=cranelift /path/to/script.js
```
An ExecutableAllocator is leaked on shutdown, which causes an assertion to
trigger: `Assertion failure: m_refCount == 1, at /home/ben/code/mozilla-inbound/js/src/jit/ExecutableAllocator.cpp:51`
3. Perf mapping should be generated in /tmp as `perf-$PID.map`, and a `perf.data` file should have
been generated in the current working directory. It can then be inspected with `perf report`, or
[HotSpot](https://github.com/KDAB/hotspot/), etc.
1. Use a build with debug enabled (`--enable-debug`) or jit spew enabled (`--enable-jitspew`).
2. Run with `IONFLAGS=logs $jsshell /path/to/script > /tmp/logs 2>&1`. This generates a large log,
since it contains generated JIT code for JS too.
3. Open /tmp/logs and grep "wasm cranelift". You'll see `Start of wasm cranelift code for function
...`, and there's also something at the end of the wasm cranelift code for the given function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment