ABSTRACT
Dynamic class loading during program execution in the Java Programming Language is an impediment for generating code that is as efficient as code generated using static whole-program analysis and optimization. Whole-program analysis and optimization is possible for languages, such as C++, that do not allow new classes and/or methods to be loaded during program execution. One solution for performing whole-program analysis and avoiding incorrect execution after a new class is loaded is to invalidate and recompile affected methods. Runtime invalidation and recompilation mechanisms can be expensive in both space and time, and, therefore, generally restrict optimization.
To address these drawbacks, we propose a new framework, called the extant analysis framework, for interprocedural optimization of programs that support dynamic class (or method)loading. Given a set of classes comprising the closed world, we perform an offline static analysis which partitions references into two categories:(1) unconditionally extant references which point only to objects whose runtime type is guaranteed to be in the closed world; and (2) conditionally extant references which point to objects whose runtime type is not guaranteed to be in the closed world. Optimizations solely dependent on the first categorycan be statically performed, and are guaranteed to be correct even with any future class/method loading. Optimizations dependent on the second category are guarded by dynamic tests, called extant safety tests, for correct execution behavior.We describe the properties for extant safety tests, and provide algorithms for their generation and placement.
References
- 1.B. Alpern, D. Attanasio, J. J. Barton, A. Cocchi, D. Lieber, S. Smith, and T. Ngo. Implementing Jalapeno no in Java. In ACM Conference on Object- Oriented Programming Systems, Languages, and Applications, 1999.]] Google Scholar
Digital Library
- 2.B. Alpern, M. Charney, J.-D. Choi, T. Cocchi, and D. Lieber. Dynamic linking on a shared-memory multiprocessor. In International Conference onParallel Architectures and Compilation Techniques, 1999.]] Google Scholar
Digital Library
- 3.D. F. Bacon and P. F. Sweeney. Fast static analysis of C++ virtual function calls. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 324-341, Oct. 1996.]] Google Scholar
Digital Library
- 4.S. Baylor, M. Devarakonda, S. Fink, E. Gluzberg, M. Kalantar, P. Muttineni, E. Barsness, R. Arora, R. Dimpsey, and S. Munroe. Java server benchmarks. IBM Systems Journal Special Issue on Java Performance, 39(1), 2000.]] Google Scholar
Digital Library
- 5.M. Burke and L. Torczon. Interprocedural optimization: Eliminating unnecessary recompilation. ACM Transactions on Programming Languages and Systems, 15(3):367-399, July 1993.]] Google Scholar
Digital Library
- 6.C. Chambers. The Design and Implementation of the Self Compiler, an Optimizing Compiler for Object- Oriented Programming Languages. PhD thesis, Stanford University, 1992.]] Google Scholar
Digital Library
- 7.D. R. Chase, M. Wegman, and F. K. Zadeck. Analysis of pointers and structures. In SIGPLAN '90 Conference on Programming Language Design and Implementation, pages 296-310, June 1990. SIGPLAN Notices 25(6).]] Google Scholar
Digital Library
- 8.R. Chatterjee, B. G. Ryder, and W. A. Landi. Relevant context inference. In 26th Annual ACM SIGACT- SIGPLAN Symposium on the Principles of Programming Languages, Jan. 1999.]] Google Scholar
Digital Library
- 9.J.-D. Choi, M. Burke, and P. Carini. Efficient low-sensitive interprocedural computation of pointerinduced aliases and side effects. In 20th Annual ACM SIGACT-SIGPLAN Symposium on the Principles of Programming Languages, pages 232-245, Jan. 1993.]] Google Scholar
Digital Library
- 10.J.-D. Choi, R. Cytron, and J. Ferrante. Automatic construction of sparse data ow evaluation graphs. In 18th Annual ACM Symposium on the Principles of Programming Languages, pages 55-66, Jan. 1991.]] Google Scholar
Digital Library
- 11.J.-D. Choi, M. Gupta, M. Serrano, V. C. Sreedhar, and S. Midkiff. Escape analysis for Java. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, 1999.]] Google Scholar
Digital Library
- 12.C. Consel and F. Noel. A general approach for run-time specialization and its application to C. In In 1996 ACM Symposium on Principles of Programming Languages, pages 145-156. ACM, January 1996.]] Google Scholar
Digital Library
- 13.R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, andF. K. Zadeck. An efficient method for computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451-490, 1991.]] Google Scholar
Digital Library
- 14.J. Dean, C. Chambers, and D. Grove. Selective specialization for object-oriented languages. In SIGPLAN '95 Conference onProgramming Language Design and Implementation, pages 93-102, June 1995. SIGPLAN Notices, 30(6).]] Google Scholar
Digital Library
- 15.D. Detlefs and O. Agesen. Inlining of virtual methods. In the 13 European Conference on Object-Oriented Programming, pages 258-278, 1999.]] Google Scholar
Digital Library
- 16.M. Emami, R. Ghiya, and L. J. Hendren. Contextsensitive interprocedural points-to analysis in the presence of function pointers. In SIGPLAN '94 Conference on Programming Language Design and Implementation, pages 242-256, June 1994. SIGPLAN Notices, 29(6).]] Google Scholar
Digital Library
- 17.R. Fitzgerald, T. B. Knoblock, E. Ruf, B. Steensgaard, and D. Tarditi. Marmot: An optimizing compiler for Java. Technical Report MSR-TR-99-33, Microsoft Research, June 1999.]]Google Scholar
- 18.J. Gosling, B. Joy, and G. Steele. The Java Language Specification. Addison Wesley, 1996.]] Google Scholar
Digital Library
- 19.U. Holzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In SIGPLAN '92 Conference onProgramming Language Design and Implementation, June 1992. SIGPLAN Notices 27(6).]] Google Scholar
Digital Library
- 20.U. Holzle and D. Ungar. Optimizing dynamicallydispatched calls with run-time type feedback. In SIG- PLAN '94 Conference onProgramming Language Design and Implementation, pages 326-336, June 1994. SIGPLAN Notices, 29(6).]] Google Scholar
Digital Library
- 21.U. Holzle and D. Ungar. A third generation self implementation: Reconciling responsiveness with performance. In ACM Conference onObject-Oriented Programming Systems, Languages, and Applications, pages 229-243, 1994.]] Google Scholar
Digital Library
- 22.IBM Corporation. IBM High Performance Compiler for Java, 1997. See http://www.alphaWorks.ibm.com/formula/hpc.]]Google Scholar
- 23.K. Ishizaki, M. Kawahito, T. Yasue, M. Takeuchi, T. Ogasawara, T. Suganuma, T. Onodera, H. Komatsu, and T. Nakatani. Design, implementation, and evaluation of optimizations in a just-in-time compiler. In ACM 1999 Java Grande Conference, pages 119-128, June 1999.]] Google Scholar
Digital Library
- 24.W. Landi and B. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In SIGPLAN '92 Conference onProgramming Language Design and Implementation, pages 235-248, June 1992. SIGPLAN Notices 27(6).]] Google Scholar
Digital Library
- 25.S. Liang and G. Bracha. Dynamic class loading in the Java virtual machine. In ACM Conference onObject- Oriented Programming Systems, Languages, and Applications. ACM, 1998.]] Google Scholar
Digital Library
- 26.T. Lindholm and F. Yellin. The Java Virtual Machine Specification. The Java Series. Addison-Wesley, 1996.]] Google Scholar
Digital Library
- 27.S. Meloan. The java hotspot{tm} performance engine: An in-depth look, 1999.]]Google Scholar
- 28.NaturalBridge. BulletTrain optimizing compiler and runtime for JVM bytecodes, 1996. See http://www.naturalbridge.com.]]Google Scholar
- 29.A. Rountev, B. Ryder, and W. Landi. Data ow analysis of program fragments. In Proceedings of the 7th Symposium on the Foundations of Software Engineering, 1999.]] Google Scholar
Digital Library
- 30.M. Sagiv, T. Reps, and R. Wilhelm. Solving shapeanalysis problems in languages with destructive updating. ACM Transactions on Programming Languages and Systems, 20(1):1-50, Jan. 1998.]] Google Scholar
Digital Library
- 31.V. Saraswat. Java is not type-safe, 1997. Information available in Web page at http://www.research.att.com/vj/bug.html.]]Google Scholar
- 32.B. Steensgaard. Points-to analysis in almost linear time. In 23rd Annual ACM SIGACT-SIGPLAN Symposium on the Principles of Programming Languages, pages 32- 41, Jan. 1996.]] Google Scholar
Digital Library
- 33.F. Tip, C. Laffra, P. F.Sweeney, and D. Streeter. Practical experience with an application extractor for Java. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Nov. 1999.]] Google Scholar
Digital Library
- 34.R. P. Wilson and M. S. Lam. Efficient context-sensitive pointer analysis for C programs. In SIGPLAN '95 Conference onProgramming Language Design and Implementation, pages 1-12, June 1995. SIGPLAN Notices, 30(6).]] Google Scholar
Digital Library
Index Terms
A framework for interprocedural optimization in the presence of dynamic class loading





Comments