Abstract
Points-to analysis is a static code analysis technique that establishes the relationships between variables of references and allocated objects. A number of points-to analysis algorithms have been proposed for procedural and object-oriented languages like C and Java, while few of them can be used for AspectJ as we know so far. One main reason is that AspectJ is an aspect-oriented language which implements the separation of crosscutting concerns by advices, pointcuts, and inter-type declarations, while a points-to analysis of AspectJ programs may be imprecise because any aspect woven into the base code may change the points-to relations in the program and thus a conservative analysis has to be taken in order to handle the aspects. In this paper, we propose a context-sensitive points-to analysis technique called AJPoints for AspectJ. Similar to the weaving mechanism for AspectJ, AJPoints obtains the constraints and templates on the points-to relations for the base code and the aspects, respectively, but weaves and solves them in an iterative manner in order to cross the boundary between the base code and the aspects. We have implemented AJPoints on abc AspectJ compiler and evaluated it by using twelve AspectJ benchmark programs. The experimental results show that our technique can achieve a high precision about points-to relations in AspectJ programs.
Similar content being viewed by others
References
Hind M, Pioli A. Which pointer analysis should I use? In: Proceedings of the 2000 ACM SIGSOFT International Symposium on Software Testing and Analysis. 2000, 113–123
Nguyen P H, Xue J. Interprocedural side-effect analysis and optimisation in the presence of dynamic class loading. In: Proceedings of the 28th Australasian Conference on Computer Science. 2005, 9–18
Zhao J. Slicing aspect-oriented software. In: Proceedings of the 10th International Workshop on Program Comprehension. 2002, 251–260
Sui Y, Ye D, Xue J. Static memory leak detection using full-sparse value-flow analysis. In: Proceedings of the 2012 International Symposium on Software Testing and Analysis. 2012, 254–264
Xie T, Zhao J. A framework and tool supports for generating test inputs of AspectJ programs. In: Proceedings of the 5th International Conference on Aspect-Oriented Software Development. 2006, 190–201
Milanova A, Rountev A, Ryder B G. Parameterized object sensitivity for points-to analysis for Java. ACM Transactions on Software Engineering and Methodology, 2002, 14: 1–41
Lhoták O, Hendren L. Scaling Java points-to analysis using SPARK. In: Proceedings of the 12th International Conference on Compiler Construction. 2003, 153–169
Xu G H, Rountev A. AJANA: a general framework for source-code-level interprocedural dataflow analysis of AspectJ software. In: Proceedings of the 7th International Conference on Aspect-Oriented Software Development. 2008, 36–47
Chatterjee R, Ryder B G, Landi WA. Complexity of points-to analysis of Java in the presence of exceptions. IEEE Transactions on Software Engineering, 2001, 27(6): 481–512
Whaley J, Lam M S. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In: Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation. 2004, 131–144
Andersen L. Program analysis and specialization for the C programming language. PhD thesis, Denmark: University of Copenhagen, 1994
Smaragdakis Y, Bravenboer M, Lhoták O. Pick your contexts well: understanding object-sensitivity. In: Proceedings of the 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 2011, 17–30
The AspectJ Programming Guide. The AspectJ Team, 2002
Sridharan M, Bodík R. Refinement-based context-sensitive points-to analysis for Java. In: Proceedings of the ACM SIGPLAN 2006 Conference on Programming Language Design and Implementation. 2006, 387–400
Shang L, Xie X, Xue J. On-demand dynamic summary-based points-to analysis. In: Proceedings of the 10th Annual IEEE/ACM International Symposium on Code Generation and Optimization. 2012, 264–274
Zhang Q, Lyu M R, Yuan H, Su Z. Fast algorithms for Dyck-CFL-reachability with applications to alias analysis. In: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation. 2013, 435–446
Lu Y, Shang L, Xie X, Xue J. Fast and precise points-to analysis with incremental CFL-reachability summarisation: preliminary experience. In: Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering. 2013, 270–273
The AspectBench Compiler. http://abc.comlab.ox.ac.uk/
Dufour B, Goard C, Hendren L J, Moord O, Sittampalam G, Verbrugge C. Measuring the dynamic behaviour of AspectJ programs. In: Proceedings of the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. 2004, 150–169
Glassbox. http://glassbox.sourceforge.net/
AJHSQLDB. http://ajhsqldb.sourceforge.net/
Hind M. Pointer analysis: haven’t we solved this problem yet? In: Proceedings of the 2001 ACMSIGPLAN-SIGSOFTWorkshop on Program Analysis for Software Tools and Engineering. 2001, 54–61
Liang D, Pennings M, Harrold M J. Extending and evaluating flow-insensitive and context-insensitive points-to analyses for Java. In: Proceedings of theWorkshop on Program Analysis for Software Tools and Engineering. 2001, 73–79
Steensgaard B. Points-to analysis in almost linear time. In: Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 1996, 32–41
Emami M, Ghiya R, Hendren L J. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In: Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation. 1994, 242–256
Landi W, Ryder B G, Zhang S. Interprocedural modification side effect analysis with pointer aliasing. In: Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation. 1993, 56–67
Whaley J, Rinard M. Compositional pointer and escape analysis for Java programs. In: Proceedings of the 14th Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications. 1999, 187–206
Wilson R, Lam M S. Efficient context-sensitive pointer analysis for C programs. In: Proceedings of the ACM SIGPLAN 1995 Conference on Programming Language Design and Implementation. 1995, 1–12
Whaley J, Lam M S. An efficient inclusion-based points-to analysis for strictly-typed languages. In: Proceedings of the 9th International Static Analysis Symposium. 2002, 180–195
Sui Y, Ye S, Xue J, Yew P C. SPAS: scalable path-sensitive pointer analysis on full-sparse SSA. In: Proceedings of the 9th Asian Conference on Programming Languages and Systems. 2011, 155–171
Li L, Cifuentes C, Keynes N. Precise and scalable context-sensitive pointer analysis via value flow graph. In: Proceedings of the 2013 International Symposium on Memory Management. 2013, 85–96
Kahlon V. Bootstrapping: a technique for scalable flow and context-sensitive pointer alias analysis. In: Proceedings of the ACM SIGPLAN 2008 conference on Programming Language Design and Implementation. 2008, 249–259
Yu H, Xue J, Huo W, Feng X, Zhang Z. Level by level: making flow- and context-sensitive pointer analysis scalable for millions of lines of code. In: Proceedings of the 8th International Symposium on Code Generation and Optimization. 2010, 218–229
Zhu J, Calman S. Symbolic pointer analysis revisited. In: Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation. 2004, 145–157
Lhoták O, Hendren L J. Context-sensitive points-to analysis: is it worth it? In: Proceedings of the 15th International Conference on Compiler Construction. 2006, 47–64
Sui Y, Li Y, Xue J. Query-directed adaptive heap cloning for optimizing compilers. In: Proceedings of the 2013 IEEE/ACM International Symposium on Code Generation and Optimization. 2013, 1–11
Choi J D, Burke M, Carini P. Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects. In: Proceedings of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 1993, 232–245
Hind M, Burke M, Carini P, Choi J D. Interprocedural pointer alias analysis. ACM Transactions on Programming Languages and Systems, 1999, 21(4): 848–894
Hardekopf B, Lin C. Semi-sparse flow-sensitive pointer analysis. In: Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 2009, 226–238
Rinard M, Sălcianu A, Bugrara S. A classification system and analysis for aspect-oriented programs. In: Proceedings of the 12th ACM SIGSOFT International Symposium on Foundations of Software Engineering. 2004, 147–158
Sun Q, Zhao J. Aspect-aware points-to analysis. In: Proceedings of the 8th IEEE International Working Conference on Source Code Analysis and Manipulation. 2008, 143–152
Avgustinov P, Christensen A S, Hendren L J, Kuzins S, Lhoták J, Lhoták O, Moord O, Sereni D, Sittampalam G, Tibble J. Optimising AspectJ. In: Proceedings of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation. 2005, 117–128
Author information
Authors and Affiliations
Corresponding author
Additional information
Qiang Sun received a BS degree in software engineering in 2004 and a MS degree in computer science in 2009 from Shanghai Jiao Tong University. He is now a PhD student in the Department of Computer Science and Engineering at Shanghai Jiao Tong Unviersity. Qiang Sun’s research interests include program analysis and testing, and aspect-oriented software engineering.
Yuting Chen received a BS and a MS degrees in computer science from Nanjing University, China in 2000 and 2003, respectively. He received a PhD degree in computer science from Hosei University, Japan in 2007. He joined the School of Software at Shanghai Jiao Tong University in 2008. Yuting Chen’s research interests include program analysis and testing, and software verification and validation.
Jianjun Zhao received a BE degree in computer science from Tsinghua University, China in 1987, and a PhD degree in computer science from Kyushu University, Japan in 1997. He was an assistant professor at the Department of Computer Science and Engineering, Fukuoka Institute of Technology, Japan from 1997 to 2000, and an associate professor from 2000 to 2005. He also worked as a visiting scientist at the Laboratory for Computer Science, Massachusetts Institute of Technology from 2002 to 2003. Since 2005, he has been a full professor at the School of Software, Shanghai Jiao Tong University, China. His primary research interest is program analysis, software testing, model checking, and formal specification and verification techniques.
Rights and permissions
About this article
Cite this article
Sun, Q., Chen, Y. & Zhao, J. A constraint-weaving approach to points-to analysis for AspectJ. Front. Comput. Sci. 8, 52–68 (2014). https://doi.org/10.1007/s11704-013-3106-2
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11704-013-3106-2