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 110 and 111 Nightly release cycles.
SpiderMonkey now has a JIT/Wasm backend for the 64-bit RISC-V architecture! This port was contributed by PLCT Lab and they’ll also be maintaining it going forward. Adding a backend for a new platform is a lot of work so we’re grateful to them for making SpiderMonkey run well on this exciting new architecture.
We’re working on improving performance for popular web frameworks such as React. We can’t list all of these improvements here, but the list below covers some of this work.
We’re working on improving our implementation of modules. This includes supporting modules in Workers, adding support for Import Maps, and ESMification (replacing the JSM module system for Firefox internal JS code with standard ECMAScript modules).
High-level programming languages currently need to bring their own GC if they want to run on WebAssembly. This can result in memory leaks because it cannot collect cycles that form with the browser. The Wasm GC proposal adds struct and array types to Wasm so these languages can use the browser’s GC instead.
We’re working on better (in-memory) caching of JS scripts based on the new Stencil format. This will let us integrate better with other resource caches used in Gecko and might also allow us to potentially cache JIT-related hints in the future.
The team is currently working on removing the dependency on JSContext
for off-thread parsing. This will make it easier to integrate with
browser background threads and will let us further simplify and optimize
the JS engine.
JSContext
in the bytecode emitter, the parser, and many other data structures.