1. 11

For some time now, Apple have been working on using LLVM as a fourth tier JIT. For those not familiar with the concept, the modern JS JITs have a series of tiers optimised for different workloads. e.g. JavascriptCore starts in an interpreted mode (low compilation time) and when a function/loop is invoked enough the code is compiled under the baseline JIT for higher performance. These tiers are documented at: https://trac.webkit.org/wiki/JavaScriptCore

The FTLJIT is documented here https://trac.webkit.org/wiki/FTLJIT and as the name suggests, converts the JavascriptCore internal representation to LLVM IR, and then uses LLVM to generate machine code. As documented on the JavascriptCore wiki page, it will be used for functions invoked thousands of times or loops traversed tens of thousands of times.

This is Mac only for now, and requires extra work for e.g. Linux or Windows support: https://lists.webkit.org/pipermail/webkit-dev/2014-April/026.... So - anyone built this and done some benchmarks?

As always, if you’re interested in LLVM, Clang and related projects you should subscribe to my mailing list http://llvmweekly.org and follow @llvmweekly on twitter.

  1.  

  2. 1

    This looks very interesting and impressive! Thanks for the very welcome additional explanation in the comment.

    Your “extra work for Linux or Windows support” link seems to be broken – I believe you were referring to this post in the “GTK build of FTL JIT” thread.