blog.cfallin

  • Fast(er) JavaScript on WebAssembly: Portable Baseline Interpreter and Future Plans

    For the past year, I have been hard at work trying to improve the performance of the SpiderMonkey JavaScript engine when compiled as a WebAssembly module. For server-side applications that use WebAssembly (and WASI, its “system” layer) as a software distribution and sandboxing technology with significant exciting potential, this is an important enabling technology: it allows existing software written in JavaScript to be run within the sandboxed environment and to interact with other Wasm modules.

    Read More →
  • Cranelift's Instruction Selector DSL, ISLE: Term-Rewriting Made Practical

    Today I’m going to be writing about ISLE, or the “instruction selection/lowering expressions” domain-specific language (DSL), which over the past year we have designed, improved, and fully adopted in the Cranelift compiler project. ISLE is now used to express both our instruction-lowering patterns for each of four target architectures, and also machine-independent optimizing rewrites. It allows us to develop these parts of the compiler in an extremely productive way: we can write the key idea – that one opcode or instruction should map to another – in a concise way, while maintaining type-safety with an expressive type system, and allowing us to use the declarative patterns for many different purposes.

    Read More →
  • Cranelift, Part 4: A New Register Allocator

    This post is the fourth part of a three-part series1 describing work that I have been doing to improve the Cranelift compiler. In this post, I’ll describe the work that went into regalloc2, a new register allocator I developed over the past year. The allocator started as an effort to port IonMonkey’s register allocator to Rust and a standalone form usable by Cranelift (“how hard could it be?”), but quickly evolved during a focused optimization effort to have its own unique design and implementation aspects.

    1. which is to say, the original 

    Read More →
  • Cranelift, Part 3: Correctness in Register Allocation

    This post is the last in a three-part series about Cranelift. In the first post, I covered overall context and the instruction-selection problem; in the second post, I took a deep dive into compiler performance via careful algorithmic design.

    Read More →
  • Cranelift, Part 2: Compiler Efficiency, CFGs, and a Branch Peephole Optimizer

    This post is the second in a three-part series about Cranelift. In the first post, I described the context around Cranelift and our project to replace its backend code-generation infrastructure, and detailed the instruction-selection problem and how we solve it. The remaining two posts will be deep-dives into some interesting engineering problems.

    Read More →
  • A New Backend for Cranelift, Part 1: Instruction Selection

    This post is the first in a three-part series about my recent work on Cranelift as part of my day job at Mozilla. In this first post, I will set some context and describe the instruction selection problem. In particular, I’ll talk about a revamp to the instruction selector and backend framework in general that we’ve been working on for the last nine months or so. This work has been co-developed with my brilliant colleagues Julian Seward and Benjamin Bouvier, with significant early input from Dan Gohman as well, and help from all of the wonderful Cranelift hackers.

    Read More →
  • blog.cfallin is live!

    Hello, and welcome to blog.cfallin! I’ve thought for a while that it might be nice to share, occasionally, some thoughts on whatever technical tidbits interest me. This blog will likely be home to assorted ramblings on compilers, runtimes, and the like; you can find a bit more about my background at ‘About’.

    Read More →