Optimising aspectJ

  • Authors:
  • Pavel Avgustinov;Aske Simon Christensen;Laurie Hendren;Sascha Kuzins;Jennifer Lhoták;Ondřej Lhoták;Oege de Moor;Damien Sereni;Ganesh Sittampalam;Julian Tibble

  • Affiliations:
  • Oxford University, United Kingdom;University of Aarhus, Denmark;McGill University, Montreal, Canada;Oxford University, United Kingdom;McGill University, Montreal, Canada;McGill University, Montreal, Canada;Oxford University, United Kingdom;Oxford University, United Kingdom;Oxford University, United Kingdom;Oxford University, United Kingdom

  • Venue:
  • Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

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.