Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

Practical virtual method call resolution for Java

Published: 01 October 2000 Publication 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]
URL: http://www.sable.mcgill.ca/soot/.]]
[2]
URL: http://www.transvirtual.com/kaffe.html.]]
[3]
URL: http://www.sable.mcgill.ca/sablecc/.]]
[4]
URL: http://wwwipd.ira.uka.de/~pizza/.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[20]
K. Driesen and U. H.olzle. Multi-stage cascaded prediction. In EuroPar '99 Conference Proceedings, LNCS 1685, pages 1312-1321, September 1999.]]
[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.]]
[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.]]
[23]
M. W. Hall and K. Kennedy. Eficient call graph analysis. ACM Letters on Programming Languages and Systems, 1(3):227-242, Sep. 1992.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[30]
J. Plevyak and A. A. Chien. Precise concrete type inference for object-oriented languages. ACM SIGPLAN Notices, 29(10):324-324, Oct. 1994.]]
[31]
B. G. Ryder. Constructing the call graph of a program. IEEE Transactions on Software Engineering, 5(3):216-226, May 1979.]]
[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.]]
[33]
O. Shivers. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie-Mellon University, May 1991.]]
[34]
V. Sundaresan. Practical techniques for virtual call resolution in Java. Master's thesis, McGill University, Montreal, Canada, Sep. 1999.]]
[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).]]
[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.]]
[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.]]

Cited By

View all
  • (2023)Evaluating the Impact of Possible Dependencies on Architecture-Level MaintainabilityIEEE Transactions on Software Engineering10.1109/TSE.2022.317128849:3(1064-1085)Online publication date: 1-Mar-2023
  • (2022)Record and replay of online traffic for microservices with automatic mocking point identificationProceedings of the 44th International Conference on Software Engineering: Software Engineering in Practice10.1145/3510457.3513029(221-230)Online publication date: 21-May-2022
  • (2022)On The (In)Effectiveness of Static Logic Bomb Detection for Android AppsIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2021.310805719:6(3822-3836)Online publication date: 1-Nov-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 35, Issue 10
Oct. 2000
402 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/354222
Issue’s Table of Contents
  • 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
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: 01 October 2000
Published in SIGPLAN Volume 35, Issue 10

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)298
  • Downloads (Last 6 weeks)54
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Evaluating the Impact of Possible Dependencies on Architecture-Level MaintainabilityIEEE Transactions on Software Engineering10.1109/TSE.2022.317128849:3(1064-1085)Online publication date: 1-Mar-2023
  • (2022)Record and replay of online traffic for microservices with automatic mocking point identificationProceedings of the 44th International Conference on Software Engineering: Software Engineering in Practice10.1145/3510457.3513029(221-230)Online publication date: 21-May-2022
  • (2022)On The (In)Effectiveness of Static Logic Bomb Detection for Android AppsIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2021.310805719:6(3822-3836)Online publication date: 1-Nov-2022
  • (2022)Record and Replay of Online Traffic for Microservices with Automatic Mocking Point Identification2022 IEEE/ACM 44th International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP)10.1109/ICSE-SEIP55303.2022.9793867(221-230)Online publication date: May-2022
  • (2022)Static Call Graph Combination to Simulate Dynamic Call Graph BehaviorIEEE Access10.1109/ACCESS.2022.322918210(131829-131840)Online publication date: 2022
  • (2022)Präzi: from package-based to call-based dependency networksEmpirical Software Engineering10.1007/s10664-021-10071-927:5Online publication date: 1-Sep-2022
  • (2021)Judging a type by its pointer: optimizing GPU virtual functionsProceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/3445814.3446734(241-254)Online publication date: 19-Apr-2021
  • (2021)[Engineering] eNYPD—Entry Points Detector Jakarta Server Faces Use Case2021 IEEE 21st International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM52516.2021.00013(30-35)Online publication date: Sep-2021
  • (2019)A Preparation Guide for Java Call Graph ComparisonActa Cybernetica10.14232/actacyb.24.1.2019.1024:1(131-155)Online publication date: 21-May-2019
  • (2019)Judge: identifying, understanding, and evaluating sources of unsoundness in call graphsProceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3293882.3330555(251-261)Online publication date: 10-Jul-2019
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media