Contextual dispatch for function specialization

Contextual dispatch for function specialization
复制标题

函数专业化的上下文调度

DOI:
10.1145/3428288
复制
发表时间:
2020
影响因子:
--
通讯作者:
Vitek, Jan
Vitek, Jan
中科院分区:
--
文献类型:
--
作者:
Flückiger, Olivier;Chari, Guido;Yee, Ming-Ho;Ječmen, Jan;Hain, Jakob;Vitek, Jan

文献摘要

参考文献

被引文献

相似文献

为了生成有效的代码,动态语言编译器通常需要程序源中不容易获得的信息,例如动态类型。利用静态和动态信息的混合,这些编译器推测缺失的信息。在一个编译单元中,他们将生成的代码专门化为以前观察到的行为,并认为过去是序幕。当推测失败时,执行必须跳回到未优化的代码。在本文中,我们提出了一种方法来进一步的专业化,解开类的行为到单独的优化单元。通过上下文分派,函数是版本化的,每个版本都是在不同的假设下编译的。当一个函数被调用时,实现会分派到一个在匹配调用的动态上下文的假设下优化的版本。作为概念验证,我们描述了一个使用这种方法的R语言编译器。我们的实现平均比GNU R参考实现快1.7倍。我们评估上下文调度的一组基准测试和测量额外的加速,在传统的推测与去优化技术。在这种情况下,上下文调度提高了我们的基准测试套件中46个程序中的18个程序的性能。
In order to generate efficient code, dynamic language compilers often need information, such as dynamic types, not readily available in the program source. Leveraging a mixture of static and dynamic information, these compilers speculate on the missing information. Within one compilation unit, they specialize the generated code to the previously observed behaviors, betting that past is prologue. When speculation fails, the execution must jump back to unoptimized code. In this paper, we propose an approach to further the specialization, by disentangling classes of behaviors into separate optimization units. With contextual dispatch, functions are versioned and each version is compiled under different assumptions. When a function is invoked, the implementation dispatches to a version optimized under assumptions matching the dynamic context of the call. As a proof-of-concept, we describe a compiler for the R language which uses this approach. Our implementation is, on average, 1.7× faster than the GNU R reference implementation. We evaluate contextual dispatch on a set of benchmarks and measure additional speedup, on top of traditional speculation with deoptimization techniques. In this setting contextual dispatch improves the performance of 18 out of 46 programs in our benchmark suite.
动态语言基于跟踪的即时类型专业化
DOI: 10.1145/1542476.1542528
发表时间: 2009
影响因子: 19
作者:
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
通讯作者: M. Franz
DOI: 10.1145/3133876
发表时间: 2016-02
影响因子: --
作者:
Edd Barrett;Carl Friedrich Bolz-Tereick;Rebecca Killick;S. Mount;L. Tratt
通讯作者: Edd Barrett;Carl Friedrich Bolz-Tereick;Rebecca Killick;S. Mount;L. Tratt
DOI: 10.1145/378795.378797
发表时间: 2001-05
期刊: --
影响因子: --
作者:
A. Kennedy;Don Syme
通讯作者: A. Kennedy;Don Syme
JavaScript 的快速、精确的混合类型推理
DOI: 10.1145/2254064.2254094
发表时间: 2012
期刊: Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation
影响因子: --
作者:
Brian Hackett;Shu
通讯作者: Shu
Riposte:R 中矢量代码的跟踪驱动编译器和并行 VM
DOI: --
发表时间: 2012
期刊: International Conference on Parallel Architectures and Compilation Techniques
影响因子: --
作者:
Justin Talbot;Zach DeVito;P. Hanrahan
通讯作者: P. Hanrahan