On-Stack Replacement \`a la Carte
Daniele Cono D'Elia, Camil Demetrescu

TL;DR
This paper introduces a formal framework for on-stack replacement (OSR) that enables flexible, safe, and automatic code transitions in runtime systems, facilitating better optimization and debugging.
Contribution
It presents a provably sound abstract framework for OSR, including an algorithm to generate OSR machinery for live-variable equivalent transformations, implemented in LLVM.
Findings
OSR transitions are possible almost everywhere with common optimizations.
The framework supports safe composition of OSR-aware compiler transformations.
Potential applications include improved debugging of optimized code.
Abstract
On-stack replacement (OSR) dynamically transfers execution between different code versions. This mechanism is used in mainstream runtime systems to support adaptive and speculative optimizations by running code tailored to provide the best expected performance for the actual workload. Current approaches either restrict the program points where OSR can be fired or require complex optimization-specific operations to realign the program's state during a transition. The engineering effort to implement OSR and the lack of abstractions make it rarely accessible to the research community, leaving fundamental question regarding its flexibility largely unexplored. In this article we make a first step towards a provably sound abstract framework for OSR. We show that compiler optimizations can be made OSR-aware in isolation, and then safely composed. We identify a class of transformations, which…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Logic, programming, and type systems · Security and Verification in Computing
