On-stack replacement for program generators and source-to-source compilers

On-stack replacement for program generators and source-to-source compilers
复制标题

程序生成器和源到源编译器的栈上替换

DOI:
10.1145/3486609.3487207
复制
发表时间:
2021
期刊:
Proceedings of the 20th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
影响因子:
--
通讯作者:
Tiark Rompf
Tiark Rompf
中科院分区:
--
文献类型:
--
作者:
Grégory M. Essertel;Ruby Y. Tahboub;Tiark Rompf

文献摘要

参考文献

被引文献

相似文献

堆栈上替换(OSR)描述了将当前执行的代码替换为不同版本的能力,该版本可以是更优化的版本(分层执行),也可以是更通用的版本(取消优化以撤消推测优化)。虽然OSR是所有现代语言(如Java或Java)的VM中的关键组件,但OSR直到最近才被作为独立于语言VM的更抽象的程序转换进行研究。尽管如此,以前的工作只考虑了基于堆栈帧、标签和跳转的低级执行模型中的OSR。为了使OSR更广泛地适用,本文提出了一种在源到源编译器或显式程序生成器中实现OSR的令人惊讶的简单模式,这些编译器或显式程序生成器针对具有结构化控制流(循环和条件)的语言。我们通过演示分级执行和推测性优化的实验来评估我们的方法,这些实验基于在运行时将SQL查询编译成C语言的最先进的内存数据库系统中的典型代码模式。我们进一步表明,将OSR转换为高级转换支持新的推测性优化模式,而不是通常在语言VM中实现的模式。
On-stack replacement (OSR) describes the ability to replace currently executing code with a different version, either a more optimized one (tiered execution) or a more general one (deoptimization to undo speculative optimization). While OSR is a key component in all modern VMs for languages like Java or JavaScript, OSR has only recently been studied as a more abstract program transformation, independent of language VMs. Still, previous work has only considered OSR in the context of low-level execution models based on stack frames, labels, and jumps. With the goal of making OSR more broadly applicable, this paper presents a surprisingly simple pattern for implementing OSR in source-to-source compilers or explicit program generators that target languages with structured control flow (loops and conditionals). We evaluate our approach through experiments demonstrating both tiered execution and speculative optimization, based on representative code patterns in the context of a state-of-the-art in-memory database system that compiles SQL queries to C at runtime. We further show that casting OSR as a high-level transformation enables new speculative optimization patterns beyond what is commonly implemented in language VMs.
编译查询的自适应执行
DOI: 10.1109/icde.2018.00027
发表时间: 2018
期刊: 2018 IEEE 34th International Conference on Data Engineering (ICDE)
影响因子: --
作者:
J. André Kohn;Viktor Leis;Thomas Neumann
通讯作者: Thomas Neumann
为现代硬件高效编译高效的查询计划
DOI: 10.14778/2002938.2002940
发表时间: 2011
期刊: Proc. VLDB Endow.
影响因子: --
作者:
T. Neumann
通讯作者: T. Neumann