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
期刊:
Proceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization
影响因子:
--
通讯作者:
C. Batten
C. Batten
中科院分区:
--
文献类型:
--
作者:
Lin Cheng;Berkin Ilbeyi;Carl Friedrich Bolz;C. Batten

文献摘要

被引文献

相似文献

动态编程语言越来越受欢迎。虽然即时(JIT)编译可以提高动态编程语言的性能,但相对于提前编译语言,仍然存在显着的性能差距。现有的JIT编译器通过类型专门化利用类型单态,并使用运行时检查来确保正确性。不幸的是,这些检查可能会引入不可忽略的开销。在本文中,我们提出了类型冻结,一种新的软件解决方案,利用属性类型单态。类型冻结“冻结”用户定义类型的类型单态属性,并且在从这些属性执行读取时消除了运行时类型检查的必要性。相反,运行时类型检查是在编写这些属性以验证类型单态时完成的。我们将类型冻结作为PyPy的扩展来实现,PyPy是Python最先进的跟踪JIT编译器。我们的评估表明,类型冻结可以提高性能,减少动态指令数的应用程序与大量的属性访问。
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.