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. CCS Concepts: • Software and its engineering → Compilers.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper4
- Type stability in Julia: avoiding performance pathologies in JIT compilationArtem Pelenitsyn, Julia Belyakova, Benjamin Chung, Ross Tate 等OOPSLA 2021 · 被引用 13 次
- Reusing Just-in-Time Compiled CodeMeetesh Kalpesh Mehta, Sebastián Krynski, Hugo Musso Gualandi, Manas Thakur 等OOPSLA 2023 · 被引用 9 次
- Dynamic dispatch of context-sensitive optimizationsGabriel Poesia, Fernando Magno Quintão PereiraOOPSLA 2020 · 被引用 7 次
- Deoptless: speculation with dispatched on-stack replacement and specialized continuationsOlivier Flückiger, Jan Jecmen, Sebastián Krynski, Jan VitekPLDI 2022 · 被引用 5 次
相关 Paper
- Formally verified speculation and deoptimization in a JIT compilerAurèle Barrière, Sandrine Blazy, Olivier Flückiger, David Pichardie 等POPL 2021 · 被引用 38 次
- Promises are made to be broken: migrating R to strict semanticsAviral Goel, Jan Jecmen, Sebastián Krynski, Olivier Flückiger 等OOPSLA 2021 · 被引用 2 次
- CoSSJIT: Combining Static Analysis and Speculation in JIT CompilersAditya Anand, Vijay Sundaresan, Daryl Maier, Manas ThakurOOPSLA 2025 · 被引用 4 次
- Adaptive Code Generation for Data-Intensive AnalyticsWangda Zhang, Junyoung Kim, Kenneth A. Ross, Eric Sedlar 等VLDB 2021 · 被引用 12 次
- ConTExT: A Generic Approach for Mitigating SpectreMichael Schwarz, Moritz Lipp, Claudio Canella, Robert Schilling 等NDSS 2020
