“but I don't believe it leverages block versioning[2] at the moment.”
Simple and Effective Type Check Removal through Lazy Basic Block Versioning
惰性生成按类型特化的基本块,消除 JIT 中的冗余类型检查
JavaScript、Python 等动态类型语言把类型检查推迟到运行时,而类型推断分析往往昂贵,需要在编译时间和精度之间权衡。论文提出惰性基本块版本化:一种简单的 JIT 技术,运行时按需惰性生成按类型特化的基本块,并传播与上下文相关的类型信息,无需昂贵的程序分析,也避免推测式优化的实现复杂度。在 JavaScript JIT 编译器中实现过程内版本后,它在所有基准上与经典基于流的类型分析相当或更好,平均消除 71% 的类型测试,加速最高 50%,并在若干基准上生成比 TraceMonkey 更高效的机器码。
评论者把它当作基本块版本化的原始论文来引用,并指出该思路后来成为 Ruby YJIT 提速的基础(作者之一参与发明了这一方法)。
HN 书评
推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及“See e.g. Lazy Basic Block Versioning[1], but existing tracing JITs do quite well also.”
“you can see an early paper on this at Simple and Effective Type Check Removal through Lazy Basic Block Versioning”
“Maxime coinvented the Basic Block Versioning approach to JITs[0] during her studies.”
“I believe this is the paper that started it all (there are a couple of follow up papers): Simple and Effective Type Check Removal through Lazy Basic Block Versioning”