arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.20543cs.PL
收藏

基线JIT编译器的元编译:Druid

Meta-compilation of Baseline JIT Compilers with Druid

Nahuel Palumbo, Guillermo Polito, Stéphane Ducasse, Pablo Tesone

AI总结:

本文提出Druid,一种从解释器自动生成基线JIT编译器前端的元编译方法,在Pharo上验证,生成的前端比解释器快2倍,达到手写JIT编译器0.7倍性能,仅需修改60个调用点,提升了虚拟机可维护性。

摘要:

虚拟机(VM)结合解释器和即时(JIT)编译代码以实现良好的性能。然而,实现不同的执行引擎增加了开发和维护此类解决方案的成本。基于元编译的JIT编译器通过自动生成优化的JIT编译器来应对这些问题。这留下了一个问题:元编译如何应用于基线JIT编译器,后者通过权衡优化来改善预热时间。在本文中,我们提出了Druid,一种从解释器自动生成基线JIT编译器前端的前期(ahead-of-time)方法。语言开发者通过注解解释器代码并使用Druid的内置函数(intrinsics)来指导元编译。Druid将元编译目标定位到现有的JIT编译器基础设施,以实现良好的预热性能。我们在Pharo编程语言的背景下应用了Druid,并通过将自动生成的JIT编译器前端与生产环境中使用了超过10年的前端进行比较来评估。我们生成的JIT编译器前端平均比解释器快2倍,平均达到手写JIT编译器性能的0.7倍。我们的实验仅需在解释器中更改60个调用点,表明我们的解决方案使语言虚拟机在长期内更易于维护和演进。

英文摘要:

Virtual Machines (VMs) combine interpreters and just-in-time (JIT) compiled code to achieve good performance. However, implementing different execution engines increases the cost of developing and maintaining such solutions. JIT compilers based on meta-compilation cope with these issues by automatically generating optimizing JIT compilers. This leaves open the question of how meta-compilation applies to baseline JIT compilers, which improve warmup times by trading off optimizations. In this paper, we present Druid, an ahead-of-time automatic approach to generate baseline JIT compiler frontends from interpreters. Language developers guide meta-compilation by annotating interpreter code and using Druid's intrinsics. Druid targets the meta-compilation to an existing JIT compiler infrastructure to achieve good warm-up performance. We applied Druid in the context of the Pharo programming language and evaluated it by comparing an autogenerated JIT compiler frontend against the one in production for more than 10 years. Our generated JIT compiler frontend is 2x faster on average than the interpreter and achieves on average 0.7x the performance of the handwritten JIT compiler. Our experiment only required changes in 60 call sites in the interpreter, showing that our solution makes language VMs **easier to maintain and evolve in the long run**.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑