Lightweight virtual machine support for AspectJ

Ryan M. Golbeck, Samuel Davis, Immad Naseer, Igor Ostrovsky, Gregor Kiczales. Lightweight virtual machine support for AspectJ. In Theo D Hondt, editor, Proceedings of the 7th International Conference on Aspect-Oriented Software Development, AOSD 2008, Brussels, Belgium, March 31 - April 4, 2008. pages 180-190, ACM, 2008. [doi]

Abstract

Advice weaving can be efficiently supported with only lightweight enhancements to existing Virtual Machines. Performing weaving at the Java bytecode (JBC) level while preserving appropriate metadata enables the VM to understand the AspectJ-specific semantics of the code and optimize it. This allows the overhead of advice weaving and performing non-local advice dispatch optimization to occur prior to runtime. It also allows the VM to perform optimizations that are unavailable to a bytecode level weaver.

An experimental implementation shows that this approach can take advantage of previously known macro optimizations of expensive constructs, including cflow, as well as micro optimizations including those based on improved type analysis unavailable to JBC-based advice dispatch. A thorough benchmark evaluation confirms that the use of this architecture does not result in runtime performance overhead and benefits from the implemented optimizations.