用类型化对象扩展基本块版本控制
Extending Basic Block Versioning with Typed Object Shapes
摘要:
典型的JavaScript(JS)程序以大量的对象属性访问为特征。因此,快速的属性读取和写入对于良好的性能至关重要。不幸的是,在每个属性访问中隐含了许多(通常是冗余的)动态检查,JS的语义复杂性使得很难通过程序分析优化这些测试。我们介绍了两种技术,以有效地消除了很大一部分的动态检查相关的对象属性访问。类型化形状支持基于对象属性类型的代码专门化,而无需进行复杂且昂贵的分析。形状传播允许消除内联缓存中的冗余形状检查。这两种技术与基本块版本控制(BBV)结合得特别好,但应该很容易适应跟踪即时(JIT)编译器和带有类型反馈的方法JIT。为了评估所提出的技术的有效性,我们在Higgs中实现了它们,Higgs是一个用于JS的类型专用JIT编译器。这些技术相比,使用多态内联缓存(PIC)的基线,以及商业JS实现。实证结果表明,在测试的26个基准测试中,这些技术平均消除了48%的类型测试,将代码大小减少了17%,并将执行时间减少了25%。在几个基准测试中,Higgs的性能优于当前的生产JS虚拟机
英文摘要:
Typical JavaScript (JS) programs feature a large number of object property accesses. Hence, fast property reads and writes are crucial for good performance. Unfortunately, many (often redundant) dynamic checks are implied in each property access and the semantic complexity of JS makes it difficult to optimize away these tests through program analysis. We introduce two techniques to effectively eliminate a large proportion of dynamic checks related to object property accesses. Typed shapes enable code specialization based on object property types without potentially complex and expensive analyses. Shape propagation allows the elimination of redundant shape checks in inline caches. These two techniques combine particularly well with Basic Block Versioning (BBV), but should be easily adaptable to tracing Just-In-Time (JIT) compilers and method JITs with type feedback. To assess the effectiveness of the techniques presented, we have implemented them in Higgs, a type-specializing JIT compiler for JS. The techniques are compared to a baseline using polymorphic Inline Caches (PICs), as well as commercial JS implementations. Empirical results show that across the 26 benchmarks tested, these techniques eliminate on average 48% of type tests, reduce code size by 17% and reduce execution time by 25%. On several benchmarks, Higgs performs better than current production JS virtual machines
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。