WebKit Switches Away From LLVM For Its JavaScript JIT Compiler
Written by Michael Larabel in LLVM on 22 February 2016 at 05:19 AM EST. Add A Comment
For the past two years WebKit has had an LLVM JIT back-end for its JavaScript engine, but now with the latest upstream code, Mac x86_64 users of WebKit have a new compiler implementation not based on LLVM.

WebKit has a new "Bare Bones Backend" (B3 for short) that replaces LLVM as the low-level optimizer in WebKit's FTL (Faster Than Light) JIT compiler. The WebKit blog post by Filip Pizlo explains, "while LLVM is an excellent optimizer, it isn’t specifically designed for the optimization challenges of dynamic languages like JavaScript. We felt that we could get a bigger speed-up if we combined the best of the FTL architecture with a new compiler backend that incorporated what we learned from using LLVM but was tuned specifically for our needs."

Pizlo also explained, "B3 is designed to enable the same kinds of optimizations as we previously got from LLVM while generating code in less time. It also enables optimizations specific to the FTL JIT, like precise modeling of the effects of self-modifying code." And concluded with, "B3 generates code that is as good as LLVM on the benchmarks we tried, and makes WebKit faster overall by reducing the amount of time spent compiling. We’re happy to have enabled the new B3 compiler in the FTL JIT. Having our own low-level compiler backend gives us an immediate boost on some benchmarks. We hope that in the future it will allow us to better tune our compiler infrastructure for the web. B3 is not yet complete. We still need to finish porting B3 to ARM64. B3 passes all tests, but we haven’t finished optimizing performance on ARM. Once all platforms that used the FTL switch to B3, we plan to remove LLVM support from the FTL JIT."

If you are curious about WebKit's B3 JIT compiler, learn more via WebKit.org.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week