skip to main content
research-article

On-stack replacement, distilled

Published:11 June 2018Publication History
Skip Abstract Section

Abstract

On-stack replacement (OSR) is essential technology for adaptive optimization, allowing changes to code actively executing in a managed runtime. The engineering aspects of OSR are well-known among VM architects, with several implementations available to date. However, OSR is yet to be explored as a general means to transfer execution between related program versions, which can pave the road to unprecedented applications that stretch beyond VMs. We aim at filling this gap with a constructive and provably correct OSR framework, allowing a class of general-purpose transformation functions to yield a special-purpose replacement. We describe and evaluate an implementation of our technique in LLVM. As a novel application of OSR, we present a feasibility study on debugging of optimized code, showing how our techniques can be used to fix variables holding incorrect values at breakpoints due to optimizations.

Skip Supplemental Material Section

Supplemental Material

p166-delia.webm

References

  1. Ali-Reza Adl-Tabatabai. 1996. Source-Level Debugging of Globally Optimized Code. Ph.D. Dissertation. Carnegie Mellon University, Pittsburgh, PA, USA. Advisor(s) Gross, Thomas. URL http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.73.5762. Accessed: 2016-06-18.Google ScholarGoogle Scholar
  2. Ali-Reza Adl-Tabatabai and Thomas Gross. 1996. Source-level Debugging of Scalar Optimized Code. In Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation (PLDI '96). ACM, New York, NY, USA, 33-43. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Vasanth Bala, Evelyn Duesterwald, and Sanjeev Banerjia. 2000. Dynamo: A Transparent Dynamic Optimization System. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI '00). ACM, New York, NY, USA, 1-12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Roberto Baldoni, Emilio Coppa, Daniele Cono D'Elia, Camil Demetrescu, and Irene Finocchi. 2018. A Survey of Symbolic Execution Techniques. ACM Comput. Surv. 51, 3 (2018). Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Earl T. Barr and Mark Marron. 2014. TARDIS: Affordable Time-travel Debugging in Managed Runtimes. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA '14). ACM, New York, NY, USA, 67-82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Gilles Barthe, Juan Manuel Crespo, and César Kunz. 2011. Relational Verification Using Product Programs. In Proceedings of the 17th International Conference on Formal Methods (FM'11). Springer-Verlag, Berlin, Heidelberg, 200-214. http://dl.acm.org/citation.cfm?id=2021296.2021319 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Michael Bebenita, Florian Brandner, Manuel Fahndrich, Francesco Logozzo, Wolfram Schulte, Nikolai Tillmann, and Herman Venter. 2010. SPUR: A Trace-based JIT Compiler for CIL. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA '10). ACM, New York, NY, USA, 708-725. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Abhilash Bhandari and V. Krishna Nandivada. 2015. Loop Tiling in the Presence of Exceptions. In 29th European Conference on Object-Oriented Programming (ECOOP 2015) (Leibniz International Proceedings in Informatics (LIPIcs)), John Tang Boyland (Ed.), Vol. 37. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 124- 148.Google ScholarGoogle Scholar
  9. E. M. Clarke, E. A. Emerson, and A. P. Sistla. 1986. Automatic Verification of Finite-state Concurrent Systems Using Temporal Logic Specifications. ACM Transactions on Programming Languages and Systems 8, 2 (April 1986), 244-263. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Keith D. Cooper, L. Taylor Simpson, and Christopher A. Vick. 2001. Operator Strength Reduction. ACM Transactions on Programming Languages and Systems 23, 5 (Sept. 2001), 603-625. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Max Copperman and Charles E. McDowell. 1993. A Further Note on Hennessy's "Symbolic Debugging of Optimized Code". ACM Transactions Programming Languages and Systems 15, 2 (April 1993), 357-365. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. 1991. Efficiently Computing Static Single Assignment Form and the Control Dependence Graph. ACM Transactions on Programming Languages and Systems 13, 4 (Oct. 1991), 451-490. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Daniele Cono D'Elia and Camil Demetrescu. 2016. Flexible On-stack Replacement in LLVM. In Proceedings of the 2016 International Symposium on Code Generation and Optimization (CGO 2016). ACM, New York, NY, USA, 250-260. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Thomas G. Evans and D. Lucille Darley. 1966. On-line Debugging Techniques: A Survey. In Proceedings of the November 7-10, 1966, Fall Joint Computer Conference (AFIPS '66 (Fall)). ACM, New York, NY, USA, 37-50. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Stephen J Fink and Feng Qian. 2003. Design, Implementation and Evaluation of Adaptive Recompilation with On-Stack Replacement. In Proceedings of the International Symposium on Code Generation and Optimization: Feedback-directed and Runtime Optimization (CGO '03). IEEE Computer Society, 241-252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Olivier Flückiger, Gabriel Scherer, Ming-Ho Yee, Aviral Goel, Amal Ahmed, and Jan Vitek. 2017. Correctness of Speculative Optimizations with Dynamic Deoptimization. Proc. ACM Program. Lang. 2, POPL, Article 49 (Dec. 2017), 28 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Andreas Gal, Brendan Eich, Mike Shaver, David Anderson, David Mandelin, Mohammad R. Haghighat, Blake Kaplan, Graydon Hoare, Boris Zbarsky, Jason Orendorff, Jesse Ruderman, EdwinW. Smith, Rick Reitmaier, Michael Bebenita, Mason Chang, and Michael Franz. 2009. Trace-based Just-in-Time Type Specialization for Dynamic Languages. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '09). ACM, New York, NY, USA, 465-478. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Shu-yu Guo and Jens Palsberg. 2011. The Essence of Compiling with Traces. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '11). ACM, New York, NY, USA, 563-574. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Christopher M. Hayden, Stephen Magill, Michael Hicks, Nate Foster, and Jeffrey S. Foster. 2012. Specifying and Verifying the Correctness of Dynamic Software Updates. In Proceedings of the 4th International Conference on Verified Software: Theories, Tools, Experiments (VSTTE'12). Springer-Verlag, Berlin, Heidelberg, 278-293. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. John Hennessy. 1982. Symbolic Debugging of Optimized Code. ACM Transactions on Programming Languages and Systems 4, 3 (July 1982), 323-344. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. John L. Henning. 2006. SPEC CPU2006 Benchmark Descriptions. SIGARCH Computer Architecture News 34, 4 (Sept. 2006), 1-17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Michael Hicks and Scott Nettles. 2005. Dynamic Software Updating. ACM Trans. Program. Lang. Syst. 27, 6 (Nov. 2005), 1049-1096. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Urs Hölzle, Craig Chambers, and David Ungar. 1992. Debugging Optimized Code with Dynamic Deoptimization. In Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation (PLDI '92). ACM, New York, NY, USA, 32-43. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Urs Hölzle and David Ungar. 1994. A Third-generation SELF Implementation: Reconciling Responsiveness with Performance. In Proceedings of the Ninth Annual Conference on Object-oriented Programming Systems, Language, and Applications (OOPSLA '94). ACM, New York, NY, USA, 229-243. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Clara Jaramillo, Rajiv Gupta, and Mary Lou Soffa. 2000. FULLDOC: A Full Reporting Debugger for Optimized Code. In Proceedings of the 7th International Symposium on Static Analysis (SAS '00). Springer, Berlin, Heidelberg, 240-259. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Sudipta Kundu, Zachary Tatlock, and Sorin Lerner. 2009. Proving Optimizations Correct Using Parameterized Program Equivalence. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '09). ACM, New York, NY, USA, 327-337. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. David Lacey, Neil D. Jones, Eric Van Wyk, and Carl Christian Frederiksen. 2002. Proving Correctness of Compiler Optimizations by Temporal Logic. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '02). ACM, New York, NY, USA, 283-294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. David Lacey, Neil D. Jones, Eric Van Wyk, and Carl Christian Frederiksen. 2004. Compiler Optimization Correctness by Temporal Logic. Higher-Order and Symbolic Computation 17, 3 (Sept. 2004), 173-206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Nurudeen A. Lameed and Laurie J. Hendren. 2013. A Modular Approach to On-Stack Replacement in LLVM. In Proceedings of the 9th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments (VEE '13). ACM, New York, NY, USA, 143-154. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Sorin Lerner, Todd Millstein, and Craig Chambers. 2003. Automatically Proving the Correctness of Compiler Optimizations. In Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation (PLDI '03). ACM, New York, NY, USA, 220-231. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Sorin Lerner, Todd Millstein, Erika Rice, and Craig Chambers. 2005. Automated Soundness Proofs for Dataflow Analyses and Transformations via Local Rules. In Proceedings of the 32Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '05). ACM, New York, NY, USA, 364-377. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Nuno P. Lopes, David Menendez, Santosh Nagarakatte, and John Regehr. 2015. Provably Correct Peephole Optimizations with Alive. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '15). ACM, New York, NY, USA, 22-32. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Stephen Magill, Michael Hicks, Suriya Subramanian, and Kathryn S. McKinley. 2012. Automating Object Transformations for Dynamic Software Updating. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA '12). ACM, New York, NY, USA, 265-280. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Stephen Magill, Ming-Hsien Tsai, Peter Lee, and Yih-Kuen Tsay. 2008. THOR: A Tool for Reasoning About Shape and Arithmetic. In Proceedings of the 20th International Conference on Computer Aided Verification (CAV '08). Springer-Verlag, Berlin, Heidelberg, 428-432. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. George C. Necula. 2000. Translation Validation for an Optimizing Compiler. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI '00). ACM, New York, NY, USA, 83-94. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Karl J. Ottenstein, Robert A. Ballance, and Arthur B. MacCabe. 1990. The Program Dependence Web: A Representation Supporting Control-, Data-, and Demand-driven Interpretation of Imperative Languages. In Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation (PLDI '90). ACM, New York, NY, USA, 257-271. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Michael Paleczny, Christopher Vick, and Cliff Click. 2001. The Java HotSpot? Server Compiler. In Proceedings of the 2001 Symposium on JavaTM Virtual Machine Research and Technology Symposium - Volume 1 (JVM'01). USENIX Association, Berkeley, CA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Phoronix. 2016. Phoronix Test Suite (PTS). (2016). URL http://www.phoronix-test-suite.com/. Accessed: 2017-04-09.Google ScholarGoogle Scholar
  39. Amir Pnueli, Michael Siegel, and Eli Singerman. 1998. Translation Validation. In Proceedings of the 4th International Conference on Tools and Algorithms for Construction and Analysis of Systems (TACAS '98). Springer-Verlag, London, UK, UK, 151-166. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. David Schneider and Carl Friedrich Bolz. 2012. The Efficient Handling of Guards in the Design of RPython's Tracing JIT. In Proceedings of the Sixth ACM Workshop on Virtual Machines and Intermediate Languages (VMIL '12). ACM, New York, NY, USA, 3-12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Suriya Subramanian. 2010. Dynamic Software Updates: A VM-Centric Approach. Ph.D. Dissertation. The University of Texas at Austin, Austin, TX, USA. Advisor(s) McKinley, Kathryn. URL https://suriya.github.io/papers/suriya-thesis-final.pdf. Accessed: 2017-11-13.Google ScholarGoogle Scholar
  42. Suriya Subramanian, Michael Hicks, and Kathryn S. McKinley. 2009. Dynamic Software Updates: A VM-centric Approach. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '09). ACM, New York, NY, USA, 1-12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Kunshan Wang, Stephen M. Blackburn, Antony L. Hosking, and Michael Norrish. 2018. Hop, Skip, & Jump: Practical On-Stack Replacement for a Cross-Platform Language-Neutral VM. In Proceedings of the 14th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments (VEE '18). ACM, New York, NY, USA, 1-16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Kunshan Wang, Yi Lin, Stephen M. Blackburn, Michael Norrish, and Antony L. Hosking. 2015. Draining the Swamp: Micro Virtual Machines as Solid Foundation for Language Development. In 1st Summit on Advances in Programming Languages, SNAPL 2015, May 3-6, 2015, Asilomar, California, USA. 321-336.Google ScholarGoogle Scholar
  45. Christian Wimmer, Vojin Jovanovic, Erik Eckstein, and Thomas Würthinger. 2017. One Compiler: Deoptimization to Optimized Code. In Proceedings of the 26th International Conference on Compiler Construction (CC 2017). ACM, New York, NY, USA, 55-64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Christian Wimmer and Thomas Würthinger. 2012. Truffle: A Self-optimizing Runtime System. In Proceedings of the 3rd Annual Conference on Systems, Programming, and Applications: Software for Humanity (SPLASH '12). ACM, New York, NY, USA, 13-14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Le-Chun Wu, Rajiv Mirani, Harish Patil, Bruce Olsen, and Wen-mei W. Hwu. 1999. A New Framework for Debugging Globally Optimized Code. In Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation (PLDI '99). ACM, New York, NY, USA, 181-191. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Thomas Würthinger, Christian Wimmer, Christian Humer, Andreas Wöß, Lukas Stadler, Chris Seaton, Gilles Duboscq, Doug Simon, and Matthias Grimmer. 2017. Practical Partial Evaluation for High-performance Dynamic Language Runtimes. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). ACM, New York, NY, USA, 662-676. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Thomas Würthinger, Christian Wimmer, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Christian Humer, Gregor Richards, Doug Simon, and Mario Wolczko. 2013. One VM to Rule Them All. In Proceedings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software (Onward! 2013). ACM, New York, NY, USA, 187-204. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Polle T. Zellweger. 1983. An Interactive High-level Debugger for Control-flow Optimized Programs. In Proceedings of the Symposium on High-level Debugging (SIGSOFT '83). ACM, New York, NY, USA, 159-172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Yudi Zheng, Lubomír Bulej, and Walter Binder. 2015. Accurate Profiling in the Presence of Dynamic Compilation. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2015). ACM, New York, NY, USA, 433-450. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. On-stack replacement, distilled

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 53, Issue 4
          PLDI '18
          April 2018
          834 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/3296979
          Issue’s Table of Contents
          • cover image ACM Conferences
            PLDI 2018: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation
            June 2018
            825 pages
            ISBN:9781450356985
            DOI:10.1145/3192366

          Copyright © 2018 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 11 June 2018

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!