SpiderMonkey Newsletter 7 (Firefox 82-83)


SpiderMonkey is the JavaScript engine used in Mozilla Firefox. This newsletter gives an overview of the JavaScript and WebAssembly work we’ve done as part of the Firefox 82 and 83 Nightly release cycles.

If you like these newsletters, you may also enjoy Yulia’s Compiler Compiler live stream.

🏆 New contributors

  • Yozaam optimized part of our private fields implementation.

👷🏽‍♀️ New features

Firefox 82-83

  • Adam added Reflect[Symbol.toStringTag] and Jeff added Intl[Symbol.toStringTag].

In progress

🚀 WarpBuilder

WarpBuilder is the JIT project to replace the frontend of our optimizing JIT (IonBuilder) and the engine’s Type Inference mechanism with a new MIR builder based on compiling CacheIR to MIR. WarpBuilder will let us improve security, performance, memory usage and maintainability of the whole engine.

We have enabled WarpBuilder by default for Firefox 83 🎉 This resulted in improved responsiveness, page load performance and memory usage. Feedback from Nightly users has been very positive.

A few of the other Warp changes that landed the past months:

🧹 Garbage Collection

  • Jon added a header to dynamic object slots to store the object slot span and capacity.
  • Jon refactored the tracing interface and simplified how slots and elements are stored on the mark stack. These changes will help us experiment with concurrent marking.
  • Jon optimized the GC barrier code.

❇️ Stencil

Stencil is our project to create an explicit interface between the frontend (parser, bytecode emitter) and the rest of the VM, decoupling those components. This lets us improve web-browsing performance, simplify a lot of code and improve bytecode caching.

  • Kannan landed the ParserAtom conversion. The frontend no longer depends on the GC to allocate atoms.
  • Ted landed various follow-up optimizations for ParserAtoms.
  • Arai added a browser pref that switches off-thread parsing to use the Stencil format instead of off-thread GC allocations.
  • Kannan added support for serializing the Stencil format to XDR.
  • Arai added support for incremental XDR-encoding.
  • Denis added telemetry probes for JS parsing and execution.
  • Arai updated the Stencil data structures to support moving between threads.
  • Arai cleaned up the interaction of Stencil with delazification.
  • Matthew simplified handling of BigInt properties in the frontend.
  • Ted updated Debugger to compile less when inserting breakpoints.

⚡ WebAssembly

  • Benjamin enabled Cranelift by default for ARM64 hardware in Nightly builds.
  • Lars added support for SIMD instructions on ARM64 to the baseline compiler.
  • Dmitry from Igalia landed more call ABI changes for speeding up indirect calls.

📚 Miscellaneous changes

  • Jason optimized lexical variables in generators and async functions.
  • Tom Ritter added a disnative shell function for disassembling JIT/Wasm code.
  • Nicolas changed the callWithABI interface. This lets us generate ABI tests for each signature.
  • Steve made jsapi-tests faster by letting tests reuse a JS context/global.
  • Iain added a jitsrc command for rr to help debug JIT code.
  • Jeff started splitting up jsfriendapi.h into smaller headers.
  • Jon and André cleaned up many headers, removing a lot of unnecessary #includes.
  • Arai added documentation explaining how async functions and async generators are implemented.
  • Jan and Ryan removed a lot of code for TypedObject. This feature has been non-standard and Nightly-only for years, but the underlying code is now being reused for Wasm GC support.
  • Jon simplified locking for helper thread tasks.
  • Iain cleaned up the bailout code in the Ion backend.
  • Denis made canceling off-thread parse tasks more robust.