skip to main content
research-article
Free Access

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

Published:02 July 2019Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

a16-thakur

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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Lars Ole Andersen. 1994. Program Analysis and Specialization for the C Programming Language. Technical Report.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bruno Blanchet. 2003. Escape analysis for JavaTM: Theory and practice. ACM Trans. Program. Lang. Syst. 25, 6 (Nov. 2003), 713--775. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Eclipse. 2018. Eclipse IDE. Retrieved from http://www.eclipse.org/.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Graal. 2018. OpenJDK Graal. Retrieved from http://openjdk.java.net/projects/graal/.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Steven S. Muchnick. 1997. Advanced Compiler Design and Implementation. Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  39. Shamik D. Sharma, Anurag Acharya, and Joel Saltz. 1998. Deferred Data-Flow Analysis. Technical Report. University of Maryland.Google ScholarGoogle Scholar
  40. SPECjbb. 2005. SPEC JBB2005. Retrieved from https://www.spec.org/jbb2005/.Google ScholarGoogle Scholar
  41. SPECjvm. 2008. SPEC JVM2008. Retrieved from https://www.spec.org/jvm2008/.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Douglas R. Stinson. 1995. Cryptography: Theory and Practice (1st ed.). CRC Press, Inc., Boca Raton, FL. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. WALA. 2018. The T. J. Watson Libraries for Analysis. Retrieved from http://wala.sourceforge.net.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

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

          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 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

            Copyright © 2019 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 2 July 2019
            • Accepted: 1 April 2019
            • Revised: 1 February 2019
            • Received: 1 April 2018
            Published in toplas Volume 41, Issue 3

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article
            • Research
            • Refereed

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader

          HTML Format

          View this article in HTML Format .

          View HTML Format
          About Cookies On This Site

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

          Learn more

          Got it!