{"id":13676,"date":"2016-02-25T11:01:44","date_gmt":"2016-02-25T16:01:44","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=13676"},"modified":"2016-07-12T09:31:19","modified_gmt":"2016-07-12T13:31:19","slug":"introducing-the-b3-jit-compiler","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/02\/25\/introducing-the-b3-jit-compiler\/","title":{"rendered":"Introducing the B3 JIT Compiler"},"content":{"rendered":"<p><a href=\"https:\/\/webkit.org\/blog\/5852\/introducing-the-b3-jit-compiler\/\">Filip Pizlo<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=11103765\">comments<\/a>):<\/p>\r\n<blockquote cite=\"https:\/\/webkit.org\/blog\/5852\/introducing-the-b3-jit-compiler\/\"><p>As of <a href=\"http:\/\/trac.webkit.org\/changeset\/195562\">r195562<\/a>, WebKit&rsquo;s <a href=\"\/blog\/3362\/introducing-the-webkit-ftl-jit\/\">FTL JIT<\/a> (Faster Than Light Just In Time compiler) now uses a new backend on OS X. The <a href=\"https:\/\/webkit.org\/docs\/b3\/\">Bare Bones Backend<\/a>, or B3 for short, replaces <a href=\"http:\/\/www.llvm.org\/\">LLVM<\/a> as the low-level optimizer in the FTL JIT. While LLVM is an excellent optimizer, it isn&rsquo;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.<\/p>\r\n<p>[&#8230;]<\/p>\r\n<p>We knew that we could get a speed-up on lots of real-world JavaScript code if we could get all of FTL&rsquo;s high level optimizations without paying the full price of LLVM&rsquo;s compile time. But we also knew that LLVM&rsquo;s low-level optimizations were essential for benchmarks that ran long enough to hide compile time. This was a huge opportunity and a huge risk: beating LLVM&rsquo;s compile times seemed easy, but it would only be a net win if the new backend could compete on throughput. [&#8230;] We projected that if we could build a backend that compiled about ten times faster than LLVM while still generating comparable code, then we would get speed-ups on code that currently blocks on LLVM compilation.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Filip Pizlo (comments): As of r195562, WebKit&rsquo;s FTL JIT (Faster Than Light Just In Time compiler) now uses a new backend on OS X. The Bare Bones Backend, or B3 for short, replaces LLVM as the low-level optimizer in the FTL JIT. While LLVM is an excellent optimizer, it isn&rsquo;t specifically designed for the optimization [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[255,31,346,30,138,328],"class_list":["post-13676","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-compiler","tag-ios","tag-javascript","tag-mac","tag-optimization","tag-webkit"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=13676"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13676\/revisions"}],"predecessor-version":[{"id":15151,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13676\/revisions\/15151"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=13676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=13676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=13676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}