Optimizing AspectJ with abc
Dr. Laurie Hendren
McGill University

Abstract

AspectJ, an aspect-oriented extension of Java, is becoming increasingly popular. However, not much work has been directed at optimizing compilers for AspectJ. Optimizing aspect-oriented languages provides many new and interesting challenges for compiler writers, and this talk will identify and address three such challenges.

The talk will first introduce the important notions of aspect-oriented programming through examples using AspectJ and will also provide an introduction to abc, our AspectBench compiler for AspectJ. We will then explain the challenges and how we have addressed these challenges within the context of abc.

The challenges are as follows. First, compiling around advice efficiently is particularly difficult. 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 minimize 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 optimizing compiler so that traditional analyses can be easily adapted to the aspect-oriented setting.

The talk will conclude with some discussion of the next important problems to address in optimizing AspectJ.

* Joint work with Pavel Avgustinov, Sascha Kuzins, Oege de Moor, Damien Sereni, Ganesh Sittampalam and Julian Tibble (Oxford); Jennifer Lhotak and Ondrej Lhotak (McGill); and Aske Simon Chirstensen (Aarhus).

The research page most relevant to the talk is: http://aspectbench.org.

MASPLAS 2006

MASPLAS 2006

Slides

Prof. Hendren's slides (pdf).