Dependent advice: A general approach to optimizing history-based Aspects

From FSL
Jump to: navigation, search

Eric Bodden, Feng Chen and Grigore Rosu
AOSD'09, ACM, pp 3--14. 2009.
Abstract. Many aspects used for runtime monitoring are \emph{history-based}: they contain advice that execute conditionally, based on the observed execution history. History-based aspects are notorious for causing high runtime overhead. Compilers can apply powerful optimizations to history-based aspects using domain knowledge. Unfortunately, current aspect languages like AspectJ impede optimizations, as they provide no means to express this domain knowledge.
In this paper we present the concept and an implementation of \emph{dependent advice}, a novel AspectJ language extension. A dependent advice contains dependency annotations that preserve crucial domain knowledge: a dependent advice needs to execute only when its dependencies are fulfilled. Optimizations can exploit this knowledge: we present a flow-insensitive whole-program analysis that removes dispatch code for dependent advice from program locations at which the advice's dependencies cannot be fulfilled.
Programmers often choose to have history-based aspects generated automatically, from formal specifications from model-driven development or runtime monitoring. As we show, code generation tools can use knowledge contained in the specification to automatically generate dependency annotations as well. Concretely, we modified code generators for two runtime-monitoring approaches, tracematches and JavaMOP, to generate dependent advice from monitor specifications in various formalisms.
We extensively evaluated our approach using the DaCapo benchmark suite. Our results show that the use of dependent advice can significantly lower, and sometimes even completely eliminate, the runtime overhead caused by history-based aspects. Most interestingly, the optimization succeeds independently of the specification formalism. This indicates that dependent advice express dependencies within history-based aspects in a natural way.

Personal tools