After reading Chris Fallin’s aegraph post, new ZJIT contributor dak2 landed a block-local version of the canonicalize function in #16828. The pseudocode of the block-local canonicalize function looks ...
Compilers, especially method just-in-time compilers, operate on one function at a time. It is a natural code unit size, especially for a dynamic language JIT: at a given point in time, what more infor...
Short post today. New ZJIT contributor dak2 submitted a PR to fix an overflow bug in fixnum division in ZJIT. We did the division fine, but lied about the type of the result in the case of dividing FI...
I just got back from a three and a half week trip to Japan. It was the longest trip I have ever been on (aside from studying abroad in Germany, which felt different). I made the following wild circuit...
In compilers, static single information form (SSI) is a common extension to static single assignment form (SSA). It was introduced by C. Scott Ananian in 1999 in his MS thesis (/assets/img/ananian-the...
Originally published on Rails At Scale. Look! A trace of slow events in a benchmark! Hover over the image to see it get bigger. Now read on to see what the slow events are and how we got this pretty...
Another entry in the Toy Optimizer series. It’s hard to get compiler optimizers right. Even if you build up a painstaking test suite by hand, you will likely miss corner cases, especially corner case...
在玩具优化器系列 中,又一项新成果。 上一次,我们是在玩具优化器的背景下实现了“加载-存储转发”机制。我们成功地在编译时对从堆中读取和向堆中写入的结果进行了缓存! 我们特别注意对象别名问题:根据读取/写入所引用的偏移量,我们将堆信息划分为不同的别名类。 这样一来,即使我们不知道对象 a 和 b 是否存在别名关系,至少也能确定不同偏移量永远不会发生别名(前提是我们的对象不会重叠, 且内存访问发生...
Background and bytecode design The ZJIT compiler compiles Ruby bytecode (YARV) to machine code. It starts by transforming the stack machine bytecode into a high-level graph-based intermediate represe...
Originally published on Rails At Scale. ZJIT is a new just-in-time (JIT) Ruby compiler built into the reference Ruby implementation, YARV, by the same compiler group that brought you YJIT. We (Aaron ...
Another entry in the Toy Optimizer series. A long, long time ago (two years!) CF Bolz-Tereick and I made a video about load/store forwarding and an accompanying GitHub Gist about load/store forwardi...