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.
Supplemental Material
- Karim Ali. 2014. The Separate Compilation Assumption. Ph.D. Dissertation. University of Waterloo, Waterloo, Ontario, Canada. Advisor(s) Lhoták, Ondřej.Google Scholar
- 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 Scholar
Digital Library
- Lars Ole Andersen. 1994. Program Analysis and Specialization for the C Programming Language. Technical Report.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Bruno Blanchet. 2003. Escape analysis for JavaTM: Theory and practice. ACM Trans. Program. Lang. Syst. 25, 6 (Nov. 2003), 713--775. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Eclipse. 2018. Eclipse IDE. Retrieved from http://www.eclipse.org/.Google Scholar
- 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 Scholar
Digital Library
- Graal. 2018. OpenJDK Graal. Retrieved from http://openjdk.java.net/projects/graal/.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Steven S. Muchnick. 1997. Advanced Compiler Design and Implementation. Morgan Kaufmann. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Shamik D. Sharma, Anurag Acharya, and Joel Saltz. 1998. Deferred Data-Flow Analysis. Technical Report. University of Maryland.Google Scholar
- SPECjbb. 2005. SPEC JBB2005. Retrieved from https://www.spec.org/jbb2005/.Google Scholar
- SPECjvm. 2008. SPEC JVM2008. Retrieved from https://www.spec.org/jvm2008/.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Douglas R. Stinson. 1995. Cryptography: Theory and Practice (1st ed.). CRC Press, Inc., Boca Raton, FL. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- WALA. 2018. The T. J. Watson Libraries for Analysis. Retrieved from http://wala.sourceforge.net.Google Scholar
- 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 Scholar
Digital Library
Index Terms
PYE: A Framework for Precise-Yet-Efficient Just-In-Time Analyses for Java Programs
Recommendations
DATALOG_SOLVE: A Datalog-Based Demand-Driven Program Analyzer
This work presents a practical Java program analysis framework that is obtained by combining a Java virtual machine with a general-purpose verification toolbox that we previously extended. In our methodology, Datalog clauses are used to specify complex ...
SPouT: Symbolic Path Recording During Testing - A Concolic Executor for the JVM
Software Engineering and Formal MethodsAbstractIn this paper, we present SPouT, a concolic executor for the Java virtual machine. To the user, SPouT is a java executable that takes some additional parameters for setting the values of concolic inputs and produces symbolic traces over variables ...
Layout-sensitive language extensibility with SugarHaskell
Haskell '12: Proceedings of the 2012 Haskell SymposiumProgrammers need convenient syntax to write elegant and concise programs. Consequently, the Haskell standard provides syntactic sugar for some scenarios (e.g., do notation for monadic code), authors of Haskell compilers provide syntactic sugar for more ...






Comments