Language implementation frameworks, e.g., RPython and Truffle/Graal, are practical tools for creating efficient virtual machines, including a well-functioning just-in-time (JIT) compiler. It is demanding to support multitier JIT compilation in such a framework for language developers. This paper presents an idea to generate threaded code by reusing an existing meta-tracing JIT compiler, as well as an interpreter design for it. Our approach does not largely modify RPython itself but constructs an effective interpreter definition to enable threaded code generation in RPython. We expect our system to be extended to support multilevel JIT compilation in the RPython framework. We measured the potential performance of our threaded code generation by simulating its behavior in PyPy. We confirmed that our approach reduced code sizes by 80 \% and compilation times by 60 \% compared to PyPy's JIT compiler on average, and ran about 7 \% faster than the interpreter-only execution.
翻译:语言实施框架,例如Rpython和Truffle/Graal,是创建高效虚拟机器的实用工具,包括运行良好的即时(JIT)编集器。它要求支持语言开发者在这样一个框架中多层次的JIT编集。本文提出了一个想法,即通过重新使用现有的元跟踪JIT编集器,以及为此的翻译设计来生成线形代码。我们的方法基本上不修改Rpython本身,而是构建一个有效的翻译定义,以便能够在Rpython生成线形代码。我们期望我们的系统能够扩展,以支持Rpython框架中的多层次JIT编集。我们通过模拟PyPy的行为来测量我们线形代码生成的潜在性能。我们确认,我们的方法比PyPy的JIT编集器平均减少了80 ⁇ 和60 ⁇ 个编译次数,比只翻译执行速度要快约7 ⁇ 。