skip to main content
article

Optimising aspectJ

Published:12 June 2005Publication History
Skip Abstract Section

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.

References

  1. abc. The AspectBench Compiler. Home page with downloads, FAQ, documentation, support mailing lists, and bug database. http://aspectbench.org.]]Google ScholarGoogle Scholar
  2. André Årnes. PKI certificate revocation. Available at http://www.pvv.ntnu.no/~andrearn/certrev/.]]Google ScholarGoogle Scholar
  3. 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 ScholarGoogle Scholar
  4. AspectJ Eclipse Home. The AspectJ home page. http://eclipse.org/aspectj/,2003.]]Google ScholarGoogle Scholar
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. David F. Bacon and Peter F. Sweeney. Fast static analysis of C++ virtual function calls. In OOPSLA 1996, pages 324--341, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Christoph Bockisch, Michael Haupt, Mira Mezini, and Klaus Ostermann. Virtual machine support for dynamic join points. In AOSD 2004, pages 83--92, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jonas Boner. AspectWerkz - dynamic AOP for Java. Available from URL: http://codehaus.org/~jboner/papers/aosd2004_aspectwerkz.pdf, 2004.]]Google ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. Bruno Dufour, Karel Driesen, Laurie Hendren, and Clark Verbrugge. Dynamic metrics for Java. In OOPSLA 2003, pages 149-168. ACM Press, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Erik Hilsdale and Jim Hugunin. Advice weaving in AspectJ. In K. Lieberherr, editor, AOSD 2004, pages 26--35. ACM Press, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle Scholar
  13. Ondřej Lhoták. Spark: A flexible points-to analysis framework for Java. Master's thesis, McGill University, December 2002.]]Google ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Ondřej Lhoták and Laurie Hendren. Jedd: a BDD-based relational extension of Java. In PLDI 2004, pages 158--169, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, second edition, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. Damien Sereni and Oege de Moor. Static analysis of aspects. In AOSD 2003, pages 30--39, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Therapon Skotiniotis and David H. Lorenz. Cona: aspects for contracts and contracts for aspects. In OOPSLA 2004 Companion, pages 196--197, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. Frank Tip and Jens Palsberg. Scalable propagation-based call graph construction algorithms. In OOPSLA 2000, pages 281--293, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ian H. Witten and Eibe Frank. Data Mining: Practical Machine Learning Tools and Techniques with Java implementations. Morgan Kaufmann Publishers, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle Scholar

Index Terms

  1. Optimising aspectJ

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 40, Issue 6
      Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
      June 2005
      325 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1064978
      Issue’s Table of Contents
      • cover image ACM Conferences
        PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
        June 2005
        338 pages
        ISBN:1595930566
        DOI:10.1145/1065010

      Copyright © 2005 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 12 June 2005

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader