[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article
Open access

PYE: A Framework for Precise-Yet-Efficient Just-In-Time Analyses for Java Programs

Published: 02 July 2019 Publication History

Abstract

Languages like Java and C# follow a two-step process of compilation: static compilation and just-in-time (JIT) compilation. As the time spent in JIT compilation gets added to the execution-time of the application, JIT compilers typically sacrifice the precision of program analyses for efficiency. The alternative of performing the analysis for the whole program statically ignores the analysis of libraries (available only at runtime), and thereby generates imprecise results. To address these issues, in this article, we propose a two-step (static+JIT) analysis framework called precise-yet-efficient (PYE) that helps generate precise analysis-results at runtime at a very low cost.
PYE achieves the twin objectives of precision and performance during JIT compilation by using a two-pronged approach: (i) It performs expensive analyses during static compilation, while accounting for the unavailability of the runtime libraries by generating partial results, in terms of conditional values, for the input application. (ii) During JIT compilation, PYE resolves the conditions associated with these values, using the pre-computed conditional values for the libraries, to generate the final results. We have implemented the static and the runtime components of PYE in the Soot optimization framework and the OpenJDK HotSpot Server Compiler (C2), respectively. We demonstrate the usability of PYE by instantiating it to perform two context-, flow-, and field-sensitive heap-based analyses: (i) points-to analysis for null-dereference-check elimination; and (ii) escape analysis for synchronization elimination. We evaluate these instantiations against their corresponding state-of-the-art implementations in C2 over a wide range of benchmarks. The extensive evaluation results show that our strategy works quite well and fulfills both the promises it makes: enhanced precision while maintaining efficiency during JIT compilation.

Supplementary Material

a16-thakur (a16-thakur.webm)
Presentation at SIGPLAN SPLASH '19

References

[1]
Karim Ali. 2014. The Separate Compilation Assumption. Ph.D. Dissertation. University of Waterloo, Waterloo, Ontario, Canada. Advisor(s) Lhoták, Ondřej.
[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. 2005. The Jikes research virtual machine project: Building an open-source research community. IBM Syst. J. 44, 2 (Jan. 2005), 399--417.
[3]
Lars Ole Andersen. 1994. Program Analysis and Specialization for the C Programming Language. Technical Report.
[4]
Steven Arzt and Eric Bodden. 2016. StubDroid: Automatic inference of precise data-flow summaries for the android framework. In 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE). 725--735.
[5]
Stephen M. Blackburn, Robin Garner, Chris Hoffmann, Asjad M. Khang, Kathryn S. McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z. Guyer, Martin Hirzel, Antony Hosking, Maria Jump, Han Lee, J. Eliot B. Moss, Aashish Phansalkar, Darko Stefanović, Thomas VanDrunen, Daniel von Dincklage, and Ben Wiedermann. 2006. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications (OOPSLA’06). ACM, New York, NY, 169--190.
[6]
Bruno Blanchet. 2003. Escape analysis for JavaTM: Theory and practice. ACM Trans. Program. Lang. Syst. 25, 6 (Nov. 2003), 713--775.
[7]
Eric Bodden, Andreas Sewe, Jan Sinschek, Mira Mezini, and Hela Oueslati. 2011. Taming reflection: Aiding static analysis in the presence of reflection and custom class loaders. In Proceeding of the 33rd International Conference on Software Engineering (ICSE’11). ACM, New York, NY, 241--250.
[8]
Jeff Bogda and Urs Hölzle. 1999. Removing unnecessary synchronization in Java. In Proceedings of the 14th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA’99). ACM, New York, NY, 35--46.
[9]
Cristiano Calcagno, Dino Distefano, Peter W. O’Hearn, and Hongseok Yang. 2011. Compositional shape analysis by means of bi-abduction. J. ACM 58, 6, Article 26 (Dec. 2011), 66 pages.
[10]
Craig Chambers. 2002. Staged compilation. In Proceedings of the 2002 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation (PEPM’02). ACM, New York, NY, 1--8.
[11]
Jong-Deok Choi, Manish Gupta, Mauricio Serrano, Vugranam C. Sreedhar, and Sam Midkiff. 1999. Escape analysis for Java. In Proceedings of the 14th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA’99). ACM, New York, NY, 1--19.
[12]
Jong-Deok Choi, Keunwoo Lee, Alexey Loginov, Robert O’Callahan, Vivek Sarkar, and Manu Sridharan. 2002. Efficient and precise datarace detection for multithreaded object-oriented programs. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation (PLDI’02). ACM, New York, NY, 258--269.
[13]
Keith D. Cooper, Ken Kennedy, and Linda Torczon. 1986. Interprocedural optimization: Eliminating unnecessary recompilation. In Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction (SIGPLAN’86). ACM, New York, NY, 58--67.
[14]
Patrick Cousot and Radhia Cousot. 2002. Modular static program analysis. In Proceedings of the 11th International Conference on Compiler Construction (CC’02). Springer-Verlag, London, UK, 159--178. http://dl.acm.org/citation.cfm?id=647478.727794.
[15]
Charles Daly, Jane Horgan, James Power, and John Waldron. 2001. Platform independent dynamic Java virtual machine analysis: The Java grande forum benchmark suite. In Proceedings of the 2001 Joint ACM-ISCOPE Conference on Java Grande (JGI’01). ACM, New York, NY, 106--115.
[16]
Jens Dietrich, Nicholas Hollingum, and Bernhard Scholz. 2015. Giga-scale exhaustive points-to analysis for Java in under a minute. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’15). ACM, New York, NY, 535--551.
[17]
Tamar Domani, Gal Goldshtein, Elliot K. Kolodner, Ethan Lewis, Erez Petrank, and Dafna Sheinwald. 2002. Thread-local heaps for Java. In Proceedings of the 3rd International Symposium on Memory Management (ISMM’02). ACM, New York, NY, 76--87.
[18]
Eclipse. 2018. Eclipse IDE. Retrieved from http://www.eclipse.org/.
[19]
Andy Georges, Dries Buytaert, and Lieven Eeckhout. 2007. Statistically rigorous Java performance evaluation. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-oriented Programming Systems and Applications (OOPSLA’07). ACM, New York, NY, 57--76.
[20]
Graal. 2018. OpenJDK Graal. Retrieved from http://openjdk.java.net/projects/graal/.
[21]
Samuel Z. Guyer, Kathryn S. McKinley, and Daniel Frampton. 2006. Free-me: A static analysis for automatic individual object reclamation. In Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’06). ACM, New York, NY, 364--375.
[22]
Ben Hardekopf and Calvin Lin. 2007. The ant and the grasshopper: Fast and accurate pointer analysis for millions of lines of code. In Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’07). ACM, New York, NY, 290--299.
[23]
Uday P. Khedker and Bageshri Karkare. 2008. Efficiency, precision, simplicity, and generality in interprocedural data flow analysis: Resurrecting the classical call strings method. In Proceedings of the Joint European Conferences on Theory and Practice of Software 17th International Conference on Compiler Construction (CC’08/ETAPS’08). Springer-Verlag, Berlin, 213--228. http://dl.acm.org/citation.cfm?id=1788374.1788394.
[24]
Thomas Kotzmann and Hanspeter Mössenböck. 2005. Escape analysis in the context of dynamic compilation and deoptimization. In Proceedings of the 1st ACM/USENIX International Conference on Virtual Execution Environments (VEE’05). ACM, New York, NY, 111--120.
[25]
Kyungwoo Lee and Samuel P. Midkiff. 2006. A two-phase escape analysis for parallel Java programs. In Proceedings of the 15th International Conference on Parallel Architectures and Compilation Techniques (PACT’06). ACM, New York, NY, 53--62.
[26]
Alexey Loginov, Eran Yahav, Satish Chandra, Stephen Fink, Noam Rinetzky, and Mangala Nanda. 2008. Verifying dereference safety via expanding-scope analysis. In Proceedings of the 2008 International Symposium on Software Testing and Analysis (ISSTA’08). ACM, New York, NY, 213--224.
[27]
Ravichandhran Madhavan, G. Ramalingam, and Kapil Vaswani. 2015. A framework for efficient modular heap analysis. Found. Trends Program. Lang. 1, 4 (Jan. 2015), 269--381.
[28]
Steven S. Muchnick. 1997. Advanced Compiler Design and Implementation. Morgan Kaufmann.
[29]
Mangala Gowri Nanda and Saurabh Sinha. 2009. Accurate interprocedural null-dereference analysis for Java. In Proceedings of the 31st International Conference on Software Engineering (ICSE’09). IEEE Computer Society, Washington, DC, 133--143.
[30]
Gleb Naumovich, George S. Avrunin, and Lori A. Clarke. 1999. An efficient algorithm for computing MHP information for concurrent Java programs. In Proceedings of the 7th European Software Engineering Conference/7th ACM SIGSOFT International Symposium on Foundations of Software Engineering (ESEC/FSE-7). Springer-Verlag, London, UK, 338--354. http://dl.acm.org/citation.cfm?id=318773.319252.
[31]
Erik M. Nystrom, Hong-Seok Kim, and Wen-mei W. Hwu. 2004. Importance of heap specialization in pointer analysis. In Proceedings of the 5th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE’04). ACM, New York, NY, 43--48.
[32]
Michael Paleczny, Christopher Vick, and Cliff Click. 2001. The Java HotSpot™ server compiler. In Proceedings of the 2001 Symposium on Java™ Virtual Machine Research and Technology Symposium—Volume 1 (JVM’01). USENIX Association, Berkeley, CA, 1--1. http://dl.acm.org/citation.cfm?id=1267847.1267848.
[33]
Matthai Philipose, Craig Chambers, and Susan J. Eggers. 2002. Towards automatic construction of staged compilers. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’02). ACM, New York, NY, 113--125.
[34]
Erik Ruf. 2000. Effective synchronization removal for Java. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI’00). ACM, New York, NY, 208--218.
[35]
Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. 2002. Parametric shape analysis via 3-valued logic. ACM Trans. Program. Lang. Syst. 24, 3 (May 2002), 217--298.
[36]
Alexandru Salcianu and Martin Rinard. 2001. Pointer and escape analysis for multithreaded programs. In Proceedings of the 8th ACM SIGPLAN Symposium on Principles and Practices of Parallel Programming (PPoPP’01). ACM, New York, NY, 12--23.
[37]
Mauricio Serrano, Rajesh Bordawekar, Sam Midkiff, and Manish Gupta. 2000. Quicksilver: A quasi-static compiler for Java. In Proceedings of the 15th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA’00). ACM, New York, NY, 66--82.
[38]
M. Sharir and A. Pnueli. 1981. Two approaches to interprocedural data flow analysis. In Program Flow Analysis: Theory and Applications, ch. 7. Prentice- Hall.
[39]
Shamik D. Sharma, Anurag Acharya, and Joel Saltz. 1998. Deferred Data-Flow Analysis. Technical Report. University of Maryland.
[40]
SPECjbb. 2005. SPEC JBB2005. Retrieved from https://www.spec.org/jbb2005/.
[41]
SPECjvm. 2008. SPEC JVM2008. Retrieved from https://www.spec.org/jvm2008/.
[42]
Vugranam C. Sreedhar, Michael Burke, and Jong-Deok Choi. 2000. A framework for interprocedural optimization in the presence of dynamic class loading. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI’00). ACM, New York, NY, 196--207.
[43]
Lukas Stadler, Thomas Würthinger, and Hanspeter Mössenböck. 2014. Partial escape analysis and scalar replacement for Java. In Proceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO’14). ACM, New York, NY, Article 165, 10 pages.
[44]
Bjarne Steensgaard. 1996. Points-to analysis in almost linear time. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’96). ACM, New York, NY, 32--41.
[45]
Douglas R. Stinson. 1995. Cryptography: Theory and Practice (1st ed.). CRC Press, Inc., Boca Raton, FL.
[46]
Alexandru Sălcianu and Martin Rinard. 2005. Purity and side effect analysis for Java programs. In Proceedings of the 6th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI’05). Springer-Verlag, Berlin, 199--215.
[47]
Tian Tan, Yue Li, and Jingling Xue. 2017. Efficient and precise points-to analysis: Modeling the heap by merging equivalent automata. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’17). ACM, New York, NY, 278--291.
[48]
Manas Thakur and V. Krishna Nandivada. 2019. Compare less, defer more: Scaling value-contexts based whole-program heap analyses. In Proceedings of the 28th International Conference on Compiler Construction (CC’19). ACM, New York, NY, 135--146.
[49]
Raja Vallée-Rai, Phong Co, Etienne Gagnon, Laurie Hendren, Patrick Lam, and Vijay Sundaresan. 1999. Soot—A Java bytecode optimization framework. In Proceedings of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research (CASCON’99). IBM Press, 13--. http://dl.acm.org/citation.cfm?id=781995.782008.
[50]
Frédéric Vivien and Martin Rinard. 2001. Incrementalized pointer and escape analysis. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation (PLDI’01). ACM, New York, NY, 35--46.
[51]
WALA. 2018. The T. J. Watson Libraries for Analysis. Retrieved from http://wala.sourceforge.net.
[52]
John Whaley and Martin Rinard. 1999. Compositional pointer and escape analysis for Java programs. In Proceedings of the 14th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA’99). ACM, New York, NY, 187--206.

Cited By

View all
  • (2024)The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and EfficientlyProceedings of the ACM on Programming Languages10.1145/36898038:OOPSLA2(2606-2632)Online publication date: 8-Oct-2024
  • (2024)Reducing Write Barrier Overheads for Orthogonal PersistenceProceedings of the 17th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3687997.3695646(210-223)Online publication date: 17-Oct-2024
  • (2024)Optimistic Stack Allocation and Dynamic Heapification for Managed RuntimesProceedings of the ACM on Programming Languages10.1145/36563898:PLDI(296-319)Online publication date: 20-Jun-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 41, Issue 3
September 2019
278 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/3343145
Issue’s Table of Contents
© 2019 Association for Computing Machinery. ACM acknowledges that this contribution was authored or co-authored by an employee, contractor or affiliate of a national government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 02 July 2019
Accepted: 01 April 2019
Revised: 01 February 2019
Received: 01 April 2018
Published in TOPLAS Volume 41, Issue 3

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java program analysis
  2. precise and efficient program analysis

Qualifiers

  • Research-article
  • Research
  • Refereed

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)195
  • Downloads (Last 6 weeks)17
Reflects downloads up to 18 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and EfficientlyProceedings of the ACM on Programming Languages10.1145/36898038:OOPSLA2(2606-2632)Online publication date: 8-Oct-2024
  • (2024)Reducing Write Barrier Overheads for Orthogonal PersistenceProceedings of the 17th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3687997.3695646(210-223)Online publication date: 17-Oct-2024
  • (2024)Optimistic Stack Allocation and Dynamic Heapification for Managed RuntimesProceedings of the ACM on Programming Languages10.1145/36563898:PLDI(296-319)Online publication date: 20-Jun-2024
  • (2024)Partial program analysis for staged compilation systemsFormal Methods in System Design10.1007/s10703-024-00458-xOnline publication date: 13-Jun-2024
  • (2023)Persisting and Reusing Results of Static Program Analyses on a Large ScaleProceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE56229.2023.00080(888-900)Online publication date: 11-Nov-2023
  • (2022)ZS3: Marrying Static Analyzers and Constraint Solvers to Parallelize Loops in Managed RuntimesProceedings of the 32nd Annual International Conference on Computer Science and Software Engineering10.5555/3566055.3566082(213-220)Online publication date: 15-Nov-2022
  • (2022)A Study of the Impact of Callbacks in Staged Static+Dynamic Partial AnalysisCompanion Proceedings of the 2022 ACM SIGPLAN International Conference on Systems, Programming, Languages, and Applications: Software for Humanity10.1145/3563768.3563957(72-74)Online publication date: 29-Nov-2022
  • (2022)Principles of Staged Static+Dynamic Partial AnalysisStatic Analysis10.1007/978-3-031-22308-2_4(44-73)Online publication date: 5-Dec-2022
  • (2021)Optimizing demand‐driven null dereference verification via merging branchesExpert Systems10.1111/exsy.1270739:6Online publication date: 27-May-2021
  • (2020)How (not) to write Java pointer analyses after 2020Proceedings of the 2020 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3426428.3426923(134-145)Online publication date: 18-Nov-2020

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media