Efficient Just-InTime Execution of Dynamically Typed Languages Via Code Specialization Using Precise Runtime Type Inference

Efficient Just-InTime Execution of Dynamically Typed Languages Via Code Specialization Using Precise Runtime Type Inference
复制标题

使用精确的运行时类型推断,通过代码专业化高效即时执行动态类型语言

DOI:
--
复制
发表时间:
2007
期刊:
影响因子:
--
通讯作者:
M. Franz
M. Franz
中科院分区:
--
文献类型:
--
作者:
Mason Chang;Michael Bebenita;Alexander Yermolovich;A. Gal;M. Franz

文献摘要

被引文献

相似文献

动态类型语言(如JavaScript)对实时编译器提出了挑战。与静态类型语言(如JVML)相比,静态类型语言中有特定的操作码用于基本类型的常见操作(如整数加法的iadd),动态类型语言(如JavaScript)中的所有操作都是后期绑定的。通常情况下,类型不能在执行之前确定地推断出来。因此,动态类型语言的即时编译器往往比静态类型的编译器性能更差。我们提出了一种新的方法来编译动态类型的语言,在执行过程中观察到的代码跟踪动态专门为每个实际观察到的运行时类型。对于大多数基准测试程序,我们的原型JavaScript虚拟机优于我们已知的所有其他JavaScript平台。
Dynamically typed languages such as JavaScript present a challenge to just-in-time compilers. In contrast to statically typed languages such as JVML, in which there are specific opcodes for common operations on primitive types (such as iadd for integer addition), all operations in dynamically typed language such as JavaScript are late-bound. Often enough, types cannot be inferred with certainty ahead of execution. As a result, just-in-time compilers for dynamically typed languages have tended to perform worse than their statically-typed counterparts. We present a new approach to compiling dynamically typed languages in which code traces observed during execution are dynamically specialized for each actually observed run-time type. For most benchmark programs, our prototype JavaScript virtual machine outperforms every other JavaScript platform known to us.