Type freezing: exploiting attribute type monomorphism in tracing JIT compilers
Type freezing: exploiting attribute type monomorphism in tracing JIT compilers
复制标题
类型冻结:在跟踪 JIT 编译器中利用属性类型单态性
DOI:
10.1145/3368826.3377907
复制
发表时间:
2020
期刊:
影响因子:
--
通讯作者:
C. Batten
中科院分区:
文献类型:
--
作者:
Lin Cheng;Berkin Ilbeyi;Carl Friedrich Bolz;C. Batten
Dynamic programming languages continue to increase in popularity. While just-in-time (JIT) compilation can improve the performance of dynamic programming languages, a significant performance gap remains with respect to ahead-of-time compiled languages. Existing JIT compilers exploit type monomorphism through type specialization, and use runtime checks to ensure correctness. Unfortunately, these checks can introduce non-negligible overhead. In this paper, we present type freezing, a novel software solution for exploiting attribute type monomorphism. Type freezing "freezes" type monomorphic attributes of user-defined types, and eliminates the necessity of runtime type checks when performing reads from these attributes. Instead, runtime type checks are done when writing these attributes to validate type monomorphism. We implement type freezing as an extension to PyPy, a state-of-the-art tracing JIT compiler for Python. Our evaluation shows type freezing can improve performance and reduce dynamic instruction count for those applications with a significant number of attribute accesses.