skip to main content
10.1145/2542142.2542143acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

An intermediate representation for speculative optimizations in a dynamic compiler

Published: 28 October 2013 Publication History

Abstract

We present a compiler intermediate representation (IR) that allows dynamic speculative optimizations for high-level languages. The IR is graph-based and contains nodes fixed to control flow as well as floating nodes. Side-effecting nodes include a framestate that maps values back to the original program. Guard nodes dynamically check assumptions and, on failure, deoptimize to the interpreter that continues execution. Guards implicitly use the framestate and program position of the last side-effecting node. Therefore, they can be represented as freely floating nodes in the IR. Exception edges are modeled as explicit control flow and are subject to full optimization. We use profiling and deoptimization to speculatively reduce the number of such edges. The IR is the core of a just-in-time compiler that is integrated with the Java HotSpot VM. We evaluate the design decisions of the IR using major Java benchmark suites.

References

[1]
Graal, revision 5a9d68c3a7d7. URL http://hg.openjdk.java.net/graal/graal/file/5a9d68c3a7d7.
[2]
HotSpot Express 25, build 43. URL http://hg.openjdk.java.net/hsx/hsx25/hotspot/file/hs25-b43.
[3]
B. Blanchet. Escape analysis for JavaTM: Theory and practice. ACM Transactions on Programming Languages and Systems, 25(6):713--775, Nov. 2003.
[4]
J.-D. Choi, D. Grove, M. Hind, and V. Sarkar. Efficient and precise modeling of exceptions for the analysis of java programs. In Proceedings of the ACMSIGPLAN-SIGSOFT work- shop on Program Analysis for Software Tools and Engineering, pages 21--31. ACM Press, 1999. ISBN 1-58113-137-2.
[5]
C. Click. Global code motion/global value numbering. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 246--257. ACM Press, 1995. ISBN 0-89791-697-2.
[6]
C. Click and M. Paleczny. A simple graph-based intermediate representation. In Papers from the ACM SIGPLAN workshop on Intermediate representations, IR '95, pages 35--49. ACM Press, 1995. ISBN 0-89791-754-5.
[7]
C. N. Click, Jr. Combining Analyses, Combining Optimizations. PhD thesis, Rice University, 1995.
[8]
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, Oct. 1991. ISSN 0164-0925.
[9]
DaCapo Project. The DaCapo Benchmark Suite, 2012. URL http://dacapobench.org/.
[10]
J. C. Dehnert, B. K. Grant, J. P. Banning, R. Johnson, T. Kistler, A. Klaiber, and J. Mattson. The Transmeta Code MorphingTM software: using speculation, recovery, and adaptive retranslation to address real-life challenges. In Proceedings of the International Symposium on Code Generation and Optimization, pages 15--24. IEEE Computer Society, 2003. ISBN 0-7695-1913-X.
[11]
L. Djoudi, J.-T. Acquaviva, and D. Barthou. Compositional approach applied to loop specialization. Concurrency and Computation: Practice and Experience, 21(1):71--84, Jan. 2009. ISSN 1532-0626.
[12]
G. Duboscq, L. Stadler, T. Würthinger, D. Simon, and C. Wimmer. Graal IR: An extensible declarative intermediate representation. In Proceedings of the Asia-Pacific Programming Languages and Compilers Workshop, 2013.
[13]
J. Ferrante, K. J. Ottenstein, and J. D. Warren. The program dependence graph and its use in optimization. ACM Transactions on Programming Languages and Systems, 9(3):319--349, July 1987. ISSN 0164-0925.
[14]
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. ISBN 0-7695-1913-X.
[15]
Google. V8 JavaScript Engine, . URL http://code.google.com/p/v8/.
[16]
Google. V8 SVN repository, . URL http://v8.googlecode.com/svn/.
[17]
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. ISBN 0-89791-475-9.
[18]
K. Kelsey, T. Bai, C. Ding, and C. Zhang. Fast track: A software system for speculative program optimization. In Proceedings of the International Symposium on Code Generation and Optimization, pages 157--168. IEEE Computer Society, 2009. ISBN 978-0-7695-3576-0.
[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. ISBN 0-7695-2764-7.
[20]
T. Kotzmann, C. Wimmer, H. Mössenböck, T. Rodriguez, K. Russell, and D. Cox. Design of the Java HotSpotTM client compiler for Java 6. ACM Transactions on Architecture and Code Optimization, 5(1), May 2008. ISSN 1544-3566.
[21]
T. Lindholm and F. Yellin. The JavaTM Virtual Machine Specification. Addison-Wesley, 2nd edition, 1999.
[22]
R. Odaira and K. Hiraki. Sentinel pre: Hoisting beyond exception dependency with dynamic deoptimization. In Proceedings of the International Symposium on Code Generation and mOptimization, pages 328--338. IEEE Computer Society, 2005. ISBN 0-7695-2298-X.
[23]
OpenJDK Community. Graal Project, 2012. URL http://openjdk.java.net/projects/graal/.
[24]
M. Paleczny, C. Vick, and C. Click. The Java HotSpotTM server compiler. In Proceedings of the Symposium on Java Virtual Machine Research and Technology, pages 1--12. USENIX, 2001.
[25]
D. Schneider and C. F. Bolz. The efficient handling of guards in the design of RPython's tracing JIT. In Proceedings of the ACM workshop on Virtual Machines and Intermediate Languages, pages 3--12. ACM Press, 2012. ISBN 978-1-4503-1633-0.
[26]
J. W. Sias, S.-z. Ueng, G. A. Kent, I. M. Steiner, E. M. Nystrom, and W.-m. W. Hwu. Field-testing impact epic research results in itanium 2. In Proceedings of the International Symposium on Computer architecture, pages 26--. IEEE Computer Society, 2004. ISBN 0-7695-2143-6.
[27]
Standard Performance Evaluation Corporation. SPECjbb2005, . URL http://www.spec.org/jbb2005/.
[28]
Standard Performance Evaluation Corporation. SPECjvm2008, . URL http://www.spec.org/jvm2008/.
[29]
L. Su and M. H. Lipasti. Speculative optimization using hardware-monitored guarded regions for java virtual machines. pages 22--32. ACM Press, 2007. ISBN 978-1-59593-630-1.
[30]
V. Sundaresan, M. Stoodley, and P. Ramarao. Removing redundancy via exception check motion. In Proceedings of the International Symposium on Code Generation and Optimization, pages 134--143. ACM Press, 2008. ISBN 978-1-59593-978-4.
[31]
J. Whaley. Partial method compilation using dynamic profile information. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 166--179. ACM Press, 2001. ISBN 1-58113-335-9.

Cited By

View all
  • (2025)OpenVADL: An Open Source Implementation of the Vienna Architecture Description LanguageArchitecture of Computing Systems10.1007/978-3-032-03281-2_11(156-171)Online publication date: 23-Oct-2025
  • (2025)Divining Profiler Accuracy: An Approach to Approximate Profiler Accuracy through Machine Code-Level SlowdownProceedings of the ACM on Programming Languages10.1145/37631809:OOPSLA2(3615-3641)Online publication date: 9-Oct-2025
  • (2025)Heap-Snapshot Matching and Ordering using CAHPs: A Context-Augmented Heap-Path Representation for Exact and Partial Path Matching using Prefix TreesProceedings of the ACM on Programming Languages10.1145/37631039:OOPSLA2(1484-1511)Online publication date: 9-Oct-2025
  • Show More Cited By

Index Terms

  1. An intermediate representation for speculative optimizations in a dynamic compiler

    Recommendations

    Comments