Deoptimization for dynamic language JITs on typed, stack-based virtual machines
Deoptimization for dynamic language JITs on typed, stack-based virtual machines
复制标题
类型化、基于堆栈的虚拟机上动态语言 JIT 的去优化
DOI:
10.1145/2576195.2576209
复制
发表时间:
2014
期刊:
影响因子:
--
通讯作者:
B. Hardekopf
中科院分区:
文献类型:
--
作者:
Madhukar N. Kedlaya;Behnam Robatmili;Calin Cascaval;B. Hardekopf
We are interested in implementing dynamic language runtimes on top of language-level virtual machines. Type specialization is a critical optimization for dynamic language runtimes: generic code that handles any type of data is replaced with specialized code for particular types observed during execution. However, types can change, and the runtime must recover whenever unexpected types are encountered. The state-of-the-art recovery mechanism is called deoptimization. Deoptimization is a well-known technique for dynamic language runtimes implemented in low-level languages like C. However, no dynamic language runtime implemented on top of a virtual machine such as the Common Language Runtime (CLR) or the Java Virtual Machine (JVM) uses deoptimization, because the implementation thereof used in low-level languages is not possible.
In this paper we propose a novel technique that enables deoptimization for dynamic language runtimes implemented on top of typed, stack-based virtual machines. Our technique does not require any changes to the underlying virtual machine. We implement our proposed technique in a JavaScript language implementation, MCJS, running on top of the Mono runtime (CLR). We evaluate our implementation against the current state-of-the-art recovery mechanism for virtual machine-based runtimes, as implemented both in MCJS and in IronJS. We show that deoptimization provides significant performance benefits, even for runtimes running on top of a virtual machine.