Abstract
AspectJ, an aspect-oriented extension of Java, is becoming increasingly popular. However, not much work has been directed at optimising compilers for AspectJ. Optimising AOP languages provides many new and interesting challenges for compiler writers, and this paper identifies and addresses three such challenges.First, compiling around advice efficiently is particularly challenging. We provide a new code generation strategy for around advice, which (unlike previous implementations) both avoids the use of excessive inlining and the use of closures. We show it leads to more compact code, and can also improve run-time performance. Second, woven code sometimes includes run-time tests to determine whether advice should execute. One important case is the cflow pointcut which uses information about the dynamic calling context. Previous techniques for cflow were very costly in terms of both time and space. We present new techniques to minimise or eliminate the overhead of cflow using both intra- and inter-procedural analyses. Third, we have addressed the general problem of how to structure an optimising compiler so that traditional analyses can be easily adapted to the AOP setting.We have implemented all of the techniques in this paper in abc, our AspectBench Compiler for AspectJ, and we demonstrate significant speedups with empirical results. Some of our techniques have already been integrated into the production AspectJ compiler, ajc 1.2.1.
- abc. The AspectBench Compiler. Home page with downloads, FAQ, documentation, support mailing lists, and bug database. http://aspectbench.org.]]Google Scholar
- André Årnes. PKI certificate revocation. Available at http://www.pvv.ntnu.no/~andrearn/certrev/.]]Google Scholar
- R. Dale Asberry. Aspect Oriented Programming (AOP): Using AspectJ to implement and enforce coding standards. http://www.daleasberry.com/newsletters/200210/20021002.shtml, 2002.]]Google Scholar
- AspectJ Eclipse Home. The AspectJ home page. http://eclipse.org/aspectj/,2003.]]Google Scholar
- Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhoták, Ondřej Lhoták, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. abc: An extensible AspectJ compiler. In AOSD 2005, pages 87--98, March 2005.]] Google ScholarDigital Library
- David F. Bacon and Peter F. Sweeney. Fast static analysis of C++ virtual function calls. In OOPSLA 1996, pages 324--341, 1996.]] Google ScholarDigital Library
- Christoph Bockisch, Michael Haupt, Mira Mezini, and Klaus Ostermann. Virtual machine support for dynamic join points. In AOSD 2004, pages 83--92, 2004.]] Google ScholarDigital Library
- Jonas Boner. AspectWerkz - dynamic AOP for Java. Available from URL: http://codehaus.org/~jboner/papers/aosd2004_aspectwerkz.pdf, 2004.]]Google Scholar
- Jeffrey Dean, David Grove, and Craig Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In ECOOP 1995, volume 952 of LNCS, pages 77--101, 1995.]] Google ScholarDigital Library
- Bruno Dufour, Karel Driesen, Laurie Hendren, and Clark Verbrugge. Dynamic metrics for Java. In OOPSLA 2003, pages 149-168. ACM Press, 2003.]] Google ScholarDigital Library
- Erik Hilsdale and Jim Hugunin. Advice weaving in AspectJ. In K. Lieberherr, editor, AOSD 2004, pages 26--35. ACM Press, 2004.]] Google ScholarDigital Library
- JBoss. JBoss Aspect Oriented Programming. Home page with down-loads, documentation, wiki. http://www.jboss.org/index. html?module=html&op=userdisplay&id=developer's/projects/jboss/aop.]]Google Scholar
- Ondřej Lhoták. Spark: A flexible points-to analysis framework for Java. Master's thesis, McGill University, December 2002.]]Google Scholar
- Ondřej Lhoták and Laurie Hendren. Scaling Java points-to analysis using Spark. In G. Hedin, editor, CC 2003, volume 2622 of LNCS, pages 153--169. Springer, April 2003.]] Google ScholarDigital Library
- Ondřej Lhoták and Laurie Hendren. Jedd: a BDD-based relational extension of Java. In PLDI 2004, pages 158--169, 2004.]] Google ScholarDigital Library
- Karl Lieberherr, David H. Lorenz, and Pengcheng Wu. A case for statically executable advice: checking the Law of Demeter with AspectJ. In AOSD 2003, pages 40--49. ACM Press, 2003.]] Google ScholarDigital Library
- Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, second edition, 1999.]] Google ScholarDigital Library
- Hidehiko Masuhara, Gregor Kiczales, and Chris Dutchyn. A compilation and optimization model for aspect-oriented programs. In CC 2003, volume 2622 of Springer Lecture Notes in Computer Science, pages 46--60, 2003.]] Google ScholarDigital Library
- Martin Rinard, Alexandru Salcianu, and Suhabe Bugrara. A classification system and analysis for aspect-oriented programs. In Proceedings of the Twelfth International Symposium on the Foundations of Software Engineering, pages 147--158, 2004.]] Google ScholarDigital Library
- Damien Sereni and Oege de Moor. Static analysis of aspects. In AOSD 2003, pages 30--39, 2003.]] Google ScholarDigital Library
- Therapon Skotiniotis and David H. Lorenz. Cona: aspects for contracts and contracts for aspects. In OOPSLA 2004 Companion, pages 196--197, 2004.]] Google ScholarDigital Library
- Vijay Sundaresan, Laurie Hendren, Chrislain Razafimahefa, Raja Vallée-Rai, Patrick Lam, Etienne Gagnon, and Charles Godin. Practical virtual method call resolution for Java. In OOPSLA 2000, pages 264--280, 2000.]] Google ScholarDigital Library
- Frank Tip and Jens Palsberg. Scalable propagation-based call graph construction algorithms. In OOPSLA 2000, pages 281--293, 2000.]] Google ScholarDigital Library
- Raja Vallée-Rai, Etienne Gagnon, Laurie J. Hendren, Patrick Lam, Patrice Pominville, and Vijay Sundaresan. Optimizing Java bytecode using the Soot framework: Is it feasible? In CC 2000, pages 18--34, 2000.]] Google ScholarDigital Library
- Ian H. Witten and Eibe Frank. Data Mining: Practical Machine Learning Tools and Techniques with Java implementations. Morgan Kaufmann Publishers, 2000.]] Google ScholarDigital Library
- Jianjun Zhao and Martin Rinard. System dependence graph construction for aspect-oriented programs. Technical Report MIT-LCS-TR-891, Laboratory for Computer Science, MIT, 2003.]]Google Scholar
Index Terms
- Optimising aspectJ
Recommendations
abc the aspectBench compiler for aspectJ a workbench for aspect-oriented programming language and compilers research
OOPSLA '05: Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applicationsAspect-oriented programming (AOP) is gaining popularity as a new way of modularising cross-cutting concerns. The aspectbench compiler (abc) is a new workbench for AOP research which provides an extensible research framework for both new language ...
Optimising aspectJ
PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementationAspectJ, an aspect-oriented extension of Java, is becoming increasingly popular. However, not much work has been directed at optimising compilers for AspectJ. Optimising AOP languages provides many new and interesting challenges for compiler writers, ...
Deriving refactorings for aspectJ
OOPSLA '04: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applicationsIn this paper we present aspect-oriented programming laws that are useful for deriving refactorings for AspectJ. The laws help developers to verify if the transformations they define preserve behavior. We illustrate that by deriving several AspectJ ...
Comments