Practical virtual method call resolution for Java

Abstract

This paper addresses the problem of resolving virtual method and interface calls in Java. The main focus is on practical, flow-insensitive techniques that can be used to analyze large applications. We present a new flow-insensitive analysis called reaching-type analysis, which is used to estimate the set of types that reach the receiver of virtual method/interface calls. We present two variations of this analysis, variable-type analysis and a coarser-grain version called declared-type analysis. We also demonstrate how a points-to style analysis, called refers-to analysis, can be used to resolve the types of receivers. We have implemented our techniques using the Soot framework, and we report on empirical results for 9 Java benchmarks, including the 7 benchmarks from SPECjvm98. We have measured the success of the various analyses at building accurate call graphs, and we conclude that reaching-type analysis leads to call graphs with 17 % to 44 % fewer edges and 14 % to 48 % fewer nodes than the corresponding call graph built using a standard class hierarchy analysis.

    Similar works

    Full text

    thumbnail-image

    Available Versions