Generic Sensitivity: Generics-Guided Context Sensitivity for Pointer Analysis
Haofeng Li,Tian Tan,Yue Li,Jie Lu,Haining Meng,Liqing Cao,Yongheng Huang,Lian Li,Lin Gao,Peng Di,Liang Lin,Chenxi Cui
DOI: https://doi.org/10.1109/tse.2024.3377645
IF: 7.4
2024-01-01
IEEE Transactions on Software Engineering
Abstract:Generic programming has found widespread application in object-oriented languages like Java. However, existing context-sensitive pointer analyses fail to leverage the benefits of generic programming. This paper introduces generic sensitivity , a new context customization scheme targeting generics. We design our context customization scheme in such a way that generic instantiation sites, i.e., locations instantiating generic classes/methods with concrete types, are always preserved as key context elements. This is realized by augmenting contexts with a type variable lookup map, which is efficiently generated in a context-sensitive manner throughout the analysis process. We have implemented various variants of generic-sensitive analysis in WALA and conducted extensive experiments to compare it with state-of-the-art approaches, including both traditional and selective context-sensitivity methods. The evaluation results demonstrate that generic sensitivity effectively enhances existing context-sensitivity approaches, striking a new balance between efficiency and precision. For instance, it enables a 1-object-sensitive analysis to achieve overall better precision compared to a 2-object-sensitive analysis, with an average speedup of 12.6 times (up to 62 times).