skip to main content
10.1145/3033019.3033025acmotherconferencesArticle/Chapter ViewAbstractPublication PagesccConference Proceedingsconference-collections
research-article

One compiler: deoptimization to optimized code

Published: 05 February 2017 Publication History

Abstract

A multi-tier virtual machine (VM) deoptimizes and transfers last-tier execution to the first-tier execution when a speculative optimization is invalidated. The first-tier target of deoptimization is either an interpreter or code compiled by a baseline compiler. Because such a first-tier execution uses a fixed stack frame layout, this complicates all VM components that need to walk the stack. We propose to use the optimizing compiler also to compile deoptimization target code, i.e., the non-speculative first-tier code where execution continues after a deoptimization. Deoptimization entry points are described with the same scope descriptors used to describe the origin of the deoptimization, i.e., deoptimization is a two-way matching of two scope descriptors describing the same abstract frame at the same virtual program counter. We evaluate this deoptimization approach in a high-performance JavaScript VM. It strictly uses a one-compiler approach, i.e., all frames on the stack originate from the same compiler.

References

[1]
O. Agesen and D. Detlefs. Mixed-mode bytecode execution. Technical report, Sun Microsystems, Inc., 2000.
[2]
B. Alpern, S. Augart, S. M. Blackburn, M. Butrico, A. Cocchi, P. Cheng, J. Dolby, S. Fink, D. Grove, M. Hind, K. S. McKinley, M. Mergen, J. E. B. Moss, T. Ngo, and V. Sarkar. The Jikes Research Virtual Machine project: Building an open-source research community. IBM Systems Journal, 44(2):399–417, 2005.
[3]
M. Arnold, S. J. Fink, D. Grove, M. Hind, and P. F. Sweeney. Adaptive optimization in the Jalape˜no JVM. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 47–65. ACM Press, 2000.
[4]
M. Arnold, S. J. Fink, D. Grove, M. Hind, and P. F. Sweeney. A survey of adaptive optimization in virtual machines. Proceedings of the IEEE, 93(2):449–466, 2005.
[5]
J. R. Bell. Threaded code. Communications ACM, 16(6):370–372, 1973.
[6]
R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451–490, 1991.
[7]
B. Daloze, S. Marr, D. Bonetta, and H. Mössenböck. Efficient and thread-safe objects for dynamically-typed languages. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 642–659. ACM Press, 2016.
[8]
G. Duboscq, L. Stadler, T. Würthinger, D. Simon, C. Wimmer, and H. Mössenböck. Graal IR: An extensible declarative intermediate representation. In Proceedings of the Asia-Pacific Programming Languages and Compilers Workshop, 2013.
[9]
G. Duboscq, T. Würthinger, L. Stadler, C. Wimmer, D. Simon, and H. Mössenböck. An intermediate representation for speculative optimizations in a dynamic compiler. In Proceedings of the ACM Workshop on Virtual Machines and Intermediate Languages, 2013.
[10]
M. A. Ertl. Stack caching for interpreters. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 315–327. ACM Press, 1995.
[11]
M. A. Ertl and D. Gregg. The behavior of efficient virtual machine interpreters on modern architectures. In Proceedings of the International Conference on Parallel Processing, pages 403–412. Springer-Verlag, 2001.
[12]
S. J. Fink and F. Qian. Design, implementation and evaluation of adaptive recompilation with on-stack replacement. In Proceedings of the International Symposium on Code Generation and Optimization, pages 241–252. IEEE Computer Society, 2003.
[13]
D. Frampton, S. M. Blackburn, P. Cheng, R. J. Garner, D. Grove, J. E. B. Moss, and S. I. Salishev. Demystifying magic: high-level lowlevel programming. In Proceedings of the International Conference on Virtual Execution Environments, pages 81–90. ACM Press, 2009.
[14]
Y. Futamura. Partial evaluation of computation process–an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):721–728, 1971.
[15]
R. Griesemer. Generation of virtual machine code at startup. In Workshop on Simplicity, Performance and Portability in Virtual Machine Design, 1999.
[16]
U. Hölzle and D. Ungar. A third-generation SELF implementation: Reconciling responsiveness with performance. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 229–243. ACM Press, 1994.
[17]
U. Hölzle and D. Ungar. Optimizing dynamically-dispatched calls with run-time type feedback. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 326–336. ACM Press, 1994.
[18]
U. Hölzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 32–43. ACM Press, 1992.
[19]
T. Kotzmann and H. Mössenböck. Run-time support for optimizations based on escape analysis. In Proceedings of the International Symposium on Code Generation and Optimization, pages 49–60. IEEE Computer Society, 2007.
[20]
S. Marr, B. Daloze, and H. Mössenböck. Cross-language compiler benchmarking: Are we fast yet? In Proceedings of the Dynamic Languages Symposium, pages 120–131. ACM Press, 2016.
[21]
M. Paleczny, C. Vick, and C. Click. The Java HotSpot TM server compiler. In Proceedings of the Java Virtual Machine Research and Technology Symposium, pages 1–12. USENIX, 2001.
[22]
I. Piumarta and F. Riccardi. Optimizing direct threaded code by selective inlining. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 291– 300. ACM Press, 1998.
[23]
Y. Shi, K. Casey, M. A. Ertl, and D. Gregg. Virtual machine showdown: Stack versus registers. ACM Transactions on Architecture and Code Optimization, 4(4), 2008.
[24]
L. Stadler, A. Welc, C. Humer, and M. Jordan. Optimizing R language execution via aggressive speculation. In Proceedings of the Dynamic Languages Symposium, pages 84–95. ACM Press, 2016.
[25]
C. Wimmer, M. Haupt, M. L. Van De Vanter, M. Jordan, L. Daynès, and D. Simon. Maxine: An approachable virtual machine for, and in, Java. ACM Transactions on Architecture and Code Optimization, 9(4): 30:1–30:24, 2013.
[26]
T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward! ACM Press, 2013.

Cited By

View all

Index Terms

  1. One compiler: deoptimization to optimized code

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    CC 2017: Proceedings of the 26th International Conference on Compiler Construction
    February 2017
    141 pages
    ISBN:9781450352338
    DOI:10.1145/3033019
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 05 February 2017

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Java
    2. JavaScript
    3. deoptimization
    4. language implementation
    5. optimization
    6. virtual machine

    Qualifiers

    • Research-article

    Conference

    CC '17
    CC '17: Compiler Construction
    February 5 - 6, 2017
    TX, Austin, USA

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)32
    • Downloads (Last 6 weeks)2
    Reflects downloads up to 27 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media