skip to main content
10.1145/353171.353189acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article
Free Access

Practical virtual method call resolution for Java

Authors Info & Claims
Published:01 October 2000Publication History

ABSTRACT

This paper addresses the problem of resolving virtual method and interface calls in Java bytecode. The main focus is on a new practical technique that can be used to analyze large applications. Our fundamental design goal was to develop a technique that can be solved with only one iteration, and thus scales linearly with the size of the program, while at the same time providing more accurate results than two popular existing linear techniques, class hierarchy analysis and rapid type analysis.We present two variations of our new technique, variable-type analysis and a coarser-grain version called declared-type analysis. Both of these analyses are inexpensive, easy to implement, and our experimental results show that they scale linearly in the size of the program.We have implemented our new analyses using the Soot frame-work, and we report on empirical results for seven benchmarks. We have used our techniques to build accurate call graphs for complete applications (including libraries) and we show that compared to a conservative call graph built using class hierarchy analysis, our new variable-type analysis can remove a significant number of nodes (methods) and call edges. Further, our results show that we can improve upon the compression obtained using rapid type analysis.We also provide dynamic measurements of monomorphic call sites, focusing on the benchmark code excluding libraries. We demonstrate that when considering only the benchmark code, both rapid type analysis and our new declared-type analysis do not add much precision over class hierarchy analysis. However, our finer-grained variable-type analysis does resolve significantly more call sites, particularly for programs with more complex uses of objects.

References

  1. 1.URL: http://www.sable.mcgill.ca/soot/.]]Google ScholarGoogle Scholar
  2. 2.URL: http://www.transvirtual.com/kaffe.html.]]Google ScholarGoogle Scholar
  3. 3.URL: http://www.sable.mcgill.ca/sablecc/.]]Google ScholarGoogle Scholar
  4. 4.URL: http://wwwipd.ira.uka.de/~pizza/.]]Google ScholarGoogle Scholar
  5. 5.O. Agesen. Constraint-based type inference and parametric polymorphism. In B. L. Charlier, editor, SAS'94|Proceedings of the First International Static Analysis Symposium, volume 864 of Lecture Notes in Computer Science, pages 78-100. Springer, 28-30 Sep. 1994.]]Google ScholarGoogle Scholar
  6. 6.O. Agesen. The Cartesian product algorithm: Simple and precise type inference of parametric polymorphism. In W. G. Olthofi, editor, ECOOP'95|Object-Oriented Programming, 9th European Conference, volume 952 of Lecture Notes in Computer Science, pages 2-26, - Aarhus, Denmark, 7-11 Aug. 1995. Springer.]] Google ScholarGoogle Scholar
  7. 7.G. Aigner and U. H.olzle. Eliminating virtual function calls in C++ programs. In P. Cointe, editor, ECOOP'96|Object-Oriented Programming, 10th European Conference, volume 1098 of Lecture Notes in Computer Science, pages 142-166, Linz, Austria, 8-12 Jul. 1996. Springer.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.D. F. Bacon and P. F. Sweeney. Fast static analysis of C++ virtual function calls. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, volume 31, 10 of ACM SIGPLAN Notices, pages 324-341, New York, Oct. 6-10 1996. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.B. Calder and D. Grunwald. Reducing indirect function call overhead in C++ programs. In 21st Symposium on Principles of Programming Languages, pages 397-408, Jan. 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.C. Chambers, D. Grove, G. DeFouw, and J. Dean. Call graph construction in object-oriented languages. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA-97), volume 32, 10 of ACM SIGPLAN Notices, pages 108-124, New York, Oct. 5-9 1997. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.P. Chang, E. Hao, and Y. Patt. Target prediction for indirect jumps. In Proceedings of the International Symposium on Computer Architecture, pages 274-283, June 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.R. Chatterjee, B. G. Ryder, and W. A. Landi. Relevant context inference. In ACM, editor, POPL '99. Proceedings of the 26th ACM SIGPLAN-SIGACT on Principles of programming languages, January 20-22, 1999, San Antonio, TX, pages 133-146, New York, NY, USA, 1999. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.J. Dean, G. DeFouw, D. Grove, V. Litvinov, and C. Chambers. VORTEX: An optimizing compiler for object-oriented languages. In Proceedings OOPSLA '96 Conference on Object-Oriented Programming Systems, Languages, and Applications, volume 31 of ACM SIGPLAN Notices, pages 83-100. ACM, Oct. 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.J. Dean, D. Grove, and C. Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In W. G. Oltho, editor, ECOOP'95|Object-Oriented Programming, 9th European Conference, volume 952 of Lecture Notes in Computer Science, pages 77-101, - Aarhus, Denmark, 7-11 Aug. 1995. Springer.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.G. DeFouw, D. Grove, and C. Chambers. Fast interprocedural class analysis. Technical Report TR-97-07-02, University ofWashington, Department of Computer Science and Engineering, Jul. 1997.]]Google ScholarGoogle Scholar
  16. 16.G. DeFouw, D. Grove, and C. Chambers. Fast interprocedural class analysis. In Conference Record of POPL '98: The 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 222-236, San Diego, California, 19-21 Jan. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.L. P. Deutsch. Effcient implementation of the Smalltalk-80 system. In Conference record of the 11th ACM Symposium on Principles of Programming Languages (POPL), pages 297-302, 1984.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.A. Diwan, J. E. B. Moss, and K. S. McKinley. Simple and effective analysis of statically-typed object-oriented programs. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, volume 31, 10 of ACM SIGPLAN Notices, pages 292-305, New York, Oct. 6-10 1996. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19.K. Driesen and U. H.olzle. The direct cost of virtual function calls in C. In Proceedings of OOPSLA-1996, pages 306-323, October 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20.K. Driesen and U. H.olzle. Multi-stage cascaded prediction. In EuroPar '99 Conference Proceedings, LNCS 1685, pages 1312-1321, September 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 21.M. F. Fernandez. Simple and effective link-time optimization of Modula-3 programs. In Proceedings of the ACM SIGPLAN'95 Conference onProgramming Language Design and Implementation (PLDI), pages 103-115, La Jolla, California, 18-21 Jun. 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 22.E. M. Gagnon, L. J. Hendren, and G. Marceau. Efficient inference of static types for Java bytecode. In Static Analysis Symposium 2000, Lecture Notes in Computer Science, pages 199-219, Santa Barbara, June 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 23.M. W. Hall and K. Kennedy. Eficient call graph analysis. ACM Letters on Programming Languages and Systems, 1(3):227-242, Sep. 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 24.U. H.olzle and D. Ungar. Optimizing dynamically-dispatched calls with run-time type feedback. In Proceedings of the Conference on Programming Language Design and Implementation, pages 326-336, New York, NY, USA, Jun. 1994. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 25.K. Ishizaki, M. Kawahito, T. Yasue, H. Komatsu, and T. Nakatani. A study of devirtualization techniques for Java Just-In-Time compiler. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA-2000), 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 26.A. Lakhotia. Constructing call multigraphs using dependence graphs. In Conference Record of the Twentieth ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 273-284, Charleston, South Carolina, Jan. 10-13, 1993. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 27.G. Muller, B. Moura, F. Bellard, and C. Consel. Harissa: A exible and efficient Java environment mixing bytecode and compiled code. In Proceedings of the 3rd Conference on Object-Oriented Technologies and Systems, pages 1-20, Berkeley, Jun.16-20 1997. Usenix Association.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 28.J. Palsberg and M. I. Schwartzbach. Object-Oriented Type Inference. In Proceedings of the OOPSLA '91 Conference on Object-oriented Programming Systems, Languages and Applications, pages 146-161, Nov. 1991. Published as ACM SIGPLAN Notices, volume 26, number 11.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 29.H. Pande and B. Ryder. Static type determination for C++. In USENIX Association, editor, Proceedings of the 1994 USENIX C++ Conference: April 11-14, 1994, Cambridge, MA, pages 85-97, Berkeley, CA, USA, Apr. 1994. USENIX.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. 30.J. Plevyak and A. A. Chien. Precise concrete type inference for object-oriented languages. ACM SIGPLAN Notices, 29(10):324-324, Oct. 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. 31.B. G. Ryder. Constructing the call graph of a program. IEEE Transactions on Software Engineering, 5(3):216-226, May 1979.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 32.O. Shivers. Control- ow analysis in Scheme. ACM SIGPLAN Notices, 23(7):164-174, Jul. 1988. Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. 33.O. Shivers. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie-Mellon University, May 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. 34.V. Sundaresan. Practical techniques for virtual call resolution in Java. Master's thesis, McGill University, Montreal, Canada, Sep. 1999.]]Google ScholarGoogle Scholar
  35. 35.F. Tip, C. Laffra, P. F.Sweeney, and D. Streeter. Practical experience with an application extractor for Java. In Proceedings of the Fourteenth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'99), pages 292-305, Denver, CO), 1999. SIGPLAN Notices 34(10).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 36.F. Tip and J. Palsberg. Scalable propagation-based call graph construction algorithms. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA-2000), 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. 37.R. Vallee-Rai, E. Gagnon, L. Hendren, P. Lam, P. Pominville, and V. Sundaresan. Optimizing Java bytecode using the Soot framework: Is it feasible? In D. A. Watt, editor, Compiler Construction, 9th International Conference, volume 1781 of Lecture Notes in Computer Science, pages 18-34, Berlin, Germany, March 2000. Springer.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Practical virtual method call resolution for Java

        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
        • Published in

          cover image ACM Conferences
          OOPSLA '00: Proceedings of the 15th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
          October 2000
          402 pages
          ISBN:158113200X
          DOI:10.1145/353171

          Copyright © 2000 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 October 2000

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          Overall Acceptance Rate268of1,244submissions,22%

          Upcoming Conference

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader