Lune

OOPSLA2020顶会

Contextual dispatch for function specialization

Olivier Flückiger, Guido Chari, Ming-Ho Yee, Jan Jecmen, Jakob Hain, Jan Vitek

摘要

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. We evaluate contextual dispatch on a set of benchmarks and compare it to traditional speculation with deoptimization techniques. Our implementation is, on average, 1.7× faster than the GNU R reference implementation, and contextual dispatch improves the performance of 18 out of 46 programs in our benchmark suite.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Reusing Just-in-Time Compiled Code 引用了 Deoptless: speculation with dispatched on-stack replacement and specialized continuations
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. Type stability in Julia: avoiding performance pathologies in JIT compilationArtem Pelenitsyn, Julia Belyakova, Benjamin Chung, Ross Tate 等OOPSLA 2021 · 13 次引用
  2. Reusing Just-in-Time Compiled CodeMeetesh Kalpesh Mehta, Sebastián Krynski, Hugo Musso Gualandi, Manas Thakur 等OOPSLA 2023 · 9 次引用
  3. Dynamic dispatch of context-sensitive optimizationsGabriel Poesia, Fernando Magno Quintão PereiraOOPSLA 2020 · 7 次引用
  4. Deoptless: speculation with dispatched on-stack replacement and specialized continuationsOlivier Flückiger, Jan Jecmen, Sebastián Krynski, Jan VitekPLDI 2022 · 5 次引用

相关 Paper

  1. Formally verified speculation and deoptimization in a JIT compilerAurèle Barrière, Sandrine Blazy, Olivier Flückiger, David Pichardie 等POPL 2021 · 38 次引用
  2. Promises are made to be broken: migrating R to strict semanticsAviral Goel, Jan Jecmen, Sebastián Krynski, Olivier Flückiger 等OOPSLA 2021 · 2 次引用
  3. Compiler and runtime support for continuation marksMatthew Flatt, R. Kent DybvigPLDI 2020 · 9 次引用
  4. CoSSJIT: Combining Static Analysis and Speculation in JIT CompilersAditya Anand, Vijay Sundaresan, Daryl Maier, Manas ThakurOOPSLA 2025 · 4 次引用
  5. Decidable Subtyping of Existential Types for JuliaJulia Belyakova, Benjamin Chung, Ross Tate, Jan VitekPLDI 2024 · 2 次引用
黄昏的海面,两侧是细线勾勒的悬崖