Trace-based just-in-time type specialization for dynamic languages

Trace-based just-in-time type specialization for dynamic languages
复制标题

动态语言基于跟踪的即时类型专业化

DOI:
10.1145/1542476.1542528
复制
发表时间:
2009
影响因子:
19
通讯作者:
M. Franz
M. Franz
中科院分区:
生物学1区
文献类型:
--
作者:
A. Gal;Brendan Eich;Mike Shaver;David Anderson;David Mandelin;M. Haghighat;Blake Kaplan;Graydon Hoare;B. Zbarsky;Jason Orendorff;J. Ruderman;Edwin W. Smith;Rick Reitmaier;Michael Bebenita;Mason Chang;M. Franz

文献摘要

被引文献

相似文献

与静态键入的语言相比,诸如JavaScript之类的动态语言更难编译。由于没有可用的具体类型信息,因此传统编译器需要发出可以在运行时处理所有可能类型组合的通用代码。我们为动态类型的语言提出了一种替代编译技术,该技术在运行时识别经常执行的循环轨迹,然后即时生成机器代码,该机器代码专门针对通过循环中每种路径上发生的实际动态类型。我们的方法提供了廉价的手术间类型的专业化,并提供了一种优雅,有效的方法,可以通过嵌套环逐渐汇集懒惰发现的替代路径。我们已经基于我们的技术实施了JavaScript的动态编译器,并为某些基准程序测量了10倍的加速度。
Dynamic languages such as JavaScript are more difficult to compile than statically typed ones. Since no concrete type information is available, traditional compilers need to emit generic code that can handle all possible type combinations at runtime. We present an alternative compilation technique for dynamically-typed languages that identifies frequently executed loop traces at run-time and then generates machine code on the fly that is specialized for the actual dynamic types occurring on each path through the loop. Our method provides cheap inter-procedural type specialization, and an elegant and efficient way of incrementally compiling lazily discovered alternative paths through nested loops. We have implemented a dynamic compiler for JavaScript based on our technique and we have measured speedups of 10x and more for certain benchmark programs.