Points-to analysis is a fundamental static program analysis technique for tools including compilers and bug-checkers. Although object-based context sensitivity is known to improve precision of points-to analysis, scaling it for large Java codebases remains a challenge. In this work, we develop a tunable, client-independent, object-sensitive points-to analysis framework where heap cloning is applied selectively. This approach is aimed at large codebases where standard analysis is typically expensive. Our design includes a pre-analysis that determines program points that contribute to the cost of an object-sensitive points-to analysis. A subsequent analysis then determines the context depth for each allocation site. While our framework can run standalone, it is also possible to tune it – the user of the framework can use the knowledge of the codebase being analysed to influence the selection of expensive program points as well as the process to differentiate the required context-depth. Overall, the approach determines where the cloning is beneficial and where the cloning is unlikely to be beneficial. We have implemented our approach using Soufflé (a Datalog compiler) and an extension of the DOOP framework. Our experiments on large programs, including OpenJDK, show that our technique is efficient and precise. For the OpenJDK, our analysis reduces 27% of runtime and 18% of memory usage in comparison with 2O1H points-to analysis for a negligible loss of precision, while for Jython from the DaCapo benchmark suite, the same analysis reduces 91% of runtime for no loss of precision.
[1]
Barbara G. Ryder,et al.
Adaptive Context-sensitive Analysis for JavaScript
,
2015,
ECOOP.
[2]
Hongseok Yang,et al.
Selective context-sensitivity guided by impact pre-analysis
,
2014,
PLDI.
[3]
Xin Zhang,et al.
On abstraction refinement for program analyses in Datalog
,
2014,
PLDI 2014.
[4]
Yannis Smaragdakis,et al.
Introspective analysis: context-sensitivity, across the board
,
2014,
PLDI.
[5]
Amer Diwan,et al.
The DaCapo benchmarks: java benchmarking development and analysis
,
2006,
OOPSLA '06.
[6]
Yannis Smaragdakis,et al.
Strictly declarative specification of sophisticated points-to analyses
,
2009,
OOPSLA '09.
[7]
Ondrej Lhoták,et al.
Pick your contexts well: understanding object-sensitivity
,
2011,
POPL '11.
[8]
Padmanabhan Krishnan,et al.
Combining type-analysis with points-to analysis for analyzing Java library source-code
,
2015,
SOAP@PLDI.
[9]
Barbara G. Ryder,et al.
Parameterized object sensitivity for points-to analysis for Java
,
2005,
TSEM.
[10]
Till Westmann,et al.
On fast large-scale program analysis in Datalog
,
2016,
CC.
[11]
Yannis Smaragdakis,et al.
Pointer Analysis
,
2015,
Found. Trends Program. Lang..