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 84 and 85 Nightly release cycles.
If you like these newsletters, you may also enjoy Yulia’s Compiler Compiler live stream.
This has been an unusual year for many of us, but the team is proud of everything we accomplished in 2020. Happy Holidays!
👷🏽♀️ New features
Firefox 84-85
- André enabled support for the
fractionalSecondDigits
option forIntl.DateTimeFormat
. - André added support for the
collation
option forIntl.Collator
.
In progress
- Tom implemented the
at()
proposal (Nightly-only) - Yulia implemented support for top-level await (disabled by default)
⚡ WebAssembly
- Dmitry from Igalia landed patches to make the internal call ABI more efficient.
- Julian enabled the Cranelift compiler on ARM64 hardware (in Nightly).
- Lars made many changes to improve SIMD support.
- Ryan simplified the TypedObject code more by using Wasm’s type system.
- Mike Hommey fixed crashes on Apple ARM64 hardware.
- Jan prototyped support for large (more than 2 GB) ArrayBuffers, DataViews and typed arrays. Lars did some work to take advantage of this for WebAssembly.
- Asumu and Ioanna from Igalia started landing patches for Wasm exception handling.
❇️ 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.
- Ted made line/column source notes relative to the initial line/column to allow more bytecode sharing.
- Arai optimized Stencil instantiation by moving more malloc allocations off-thread.
- Arai and Ted landed many changes to optimize conversion from parser atoms to GC atoms.
- Ted made more parser atoms
constexpr
. - Arai replaced pointers to atoms and script-things with indexes to save memory and to optimize bytecode caching.
- Ted used a LifoAlloc (bump allocator) to speed up allocations for Stencil data structures.
🚀 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.
After enabling Warp by default in Firefox 83, we started removing IonBuilder and TI in Firefox 85. This has let us remove about 50,000 lines of complicated code.
- Jan landed more than 100 patches to remove most of the IonBuilder/TI code.
- Ted and Tom also landed various changes to delete code we no longer needed.
- Iain made many changes to the bailout code to eliminate bailout loops. The goal is to detect this class of subtle performance cliffs in debug builds with assertions.
- André added support for sparse element operations to the transpiler.
- Jan added support for optimizing
typeof
operations to the transpiler.
🧹Garbage Collection
- Steve switched the static analysis (for rooting hazards) in automation to use the new
mach
command. - Steve fixed an OOM issue when running the static analysis locally.
- Jon used nursery strings in more places.
- Yoshi landed a change to stop string pre-tenuring when many strings are finalized.
- Jon simplified marking of slot value ranges.
- Jon changed private slots of objects to store a
PrivateValue
orPrivateGCThingValue
to simplify GC code.
📚 Miscellaneous changes
- Tom improved the ‘illegal character’ parser error message to include the character.
- Ted removed some bytecode operations for global bindings, to make the bytecode more compact and to speed up the bytecode emitter.
- Christian replaced the more-deterministic configure option with a shell flag to simplify differential testing.
- Jeff updated test262 to the latest revision.
- Nicolas made it possible to dump telemetry values in the JS shell.
- Yozaam converted more code to the new
BytecodeLocation
interface. - Ted reduced the number of functions that are delazified for debugger breakpoints.
- Jeff moved more code out of jsfriendapi.h into smaller header files.