Abstract
Method inlining is one of the most important optimizations for JIT compilers in Java virtual machines. In order to increase the number of inlining opportunities, a type analysis can be used to identify monomorphic virtual calls. In a JIT environment, the compiler and type analysis must also handle dynamic class loading properly because class loading can invalidate previous analysis results and invalidate some speculative inlining decisions. To date, a very simple type analysis, class hierarchy analysis (CHA), has been used successfully in JIT compilers for speculative inlining with invalidation techniques as backup.
This paper seeks to determine if more powerful dynamic type analyses could further improve inlining opportunities in a JIT compiler. To achieve this goal we developed a general dynamic type analysis framework which we have used for designing and implementing dynamic versions of several well-known static type analyses, including CHA, RTA, XTA and VTA. Surprisingly, the simple dynamic CHA is nearly as good as an ideal type analysis for inlining virtual method calls. There is little room for further improvement. On the other hand, only a reachability-based interprocedural type analysis (VTA) is able to capture the majority of monomorphic interface calls.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Alpern, B., Attanasio, C.R., Barton, J.J., Burke, M.G., Cheng, P., Choi, J.-D., Cocchi, A., Fink, S.J., Grove, D., Hind, M., Hummel, S.F., Lieber, D., Litvinov, V., Mergen, M.F., Ngo, T., Russell, J.R., Sarkar, V., Serrano, M.J., Shepherd, J.C., Smith, S.E., Sreedhar, V.C., Srinivasan, H., Whaley, J.: The Jalapeño Virtual Machine. IBM Systems Journal 39(1), 211–238 (2000)
Alpern, B., Cocchi, A., Fink, S.J., Grove, D., Lieber, D.: Efficient Implementation of Java Interfaces: Invokeinterface Considered Harmless. In: Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA 2001), pp. 108–124 (2001)
Arnold, K., Gosling, J., Holmes, D.: The Java Programming Language, 3rd edn. Addison-Wesley, Reading (2000)
Arnold, M., Ryder, B.G.: Thin Guards: A Simple and Effective Technique for Reducing the Penalty of Dynamic Class Loading. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 498–524. Springer, Heidelberg (2002)
Bacon, D.F., Sweeney, P.F.: Fast Static Analysis of C++ Virtual Function Calls. In: Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA 1996), pp. 324–341 (October 1996)
Certrevsim, http://www.pvv.ntnu.no/andrearn/certrev/sim.html
Gnu classpath, http://www.gnu.org/classpath
Dean, J., Grove, D., Chambers, C.: Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 77–101. Springer, Heidelberg (1995)
Detlefs, D., Agesen, O.: Inlining of Virtual Methods. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 258–278. Springer, Heidelberg (1999)
Fink, S.J., Qian, F.: Design, Implementation and Evaluation of Adaptive Recompilation with On-Stack Replacement. In: International Symposium on Code Generation and Optimization (CGO 2003), pp. 241–252 (March 2003)
Hazelwood, K., Grove, D.: Adaptive Online Context-Sentitive Inlining. In: International Symposium on Code Generation and Optimization (CGO 2003), pp. 253–264 (March 2003)
Ishizaki, K., Kawahito, M., Yasue, T., Komatsu, H., Nakatani, T.: A Study of Devirtualization Techniques for a Java Just-In-Time Compiler. In: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2000), pp. 294–310 (2000)
JikesTM Research Virtual Machine, http://www-124.ibm.com/developerworks/oss/jikesrvm/
Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. Addison-Wesley, Reading (1996)
Pechtchanski, I., Sarkar, V.: Dynamic optimistic interprocedural analysis: A framework and an application. In: Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, pp. 195–210 (2001)
Qian, F., Hendren, L.: Towards Dynamic Interprocedural Analysis in JVMs. In: 3rd Virtual Machine Research and Technology Symposium (VM 2004), pp. 139–150 (May 2004)
Spec JBB2000 benchmark, http://www.spec.org/jbb2000/
Spec JVM98 benchmarks, http://www.spec.org/osg/jvm98/index.html
Sundaresan, V., Hendren, L.J., Razafimahefa, C., Vallée-Rai, R., Lam, P., Gagnon, E., Godin, C.: Practical Virtual Method Call Resolution for Java. In: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2000), pp. 264–280 (2000)
Tip, F., Palsberg, J.: Scalable Propagation-based Call Graph Construction Algorithms. In: Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA 2000), pp. 281–293 (October 2000)
Hölzle, U., Chambers, C., Ungar, D.: Debugging Optimized Code with Dynamic Deoptimization. In: Proceedings of the Conference on Programming Language Design and Implementation, pp. 32–43 (1992)
Weka 3: Data Mining Software in Java, http://www.cs.waikato.ac.nz/ml/weka/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Qian, F., Hendren, L. (2005). A Study of Type Analysis for Speculative Method Inlining in a JIT Environment. In: Bodik, R. (eds) Compiler Construction. CC 2005. Lecture Notes in Computer Science, vol 3443. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-31985-6_20
Download citation
DOI: https://doi.org/10.1007/978-3-540-31985-6_20
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-25411-9
Online ISBN: 978-3-540-31985-6
eBook Packages: Computer ScienceComputer Science (R0)