Aspect-aware bytecode combinators for a dynamic AOP system with invokedynamic
Santi Nopnipa, Chanwit Kaewkasi
Abstract
Santi Nopnipa, Chanwit Kaewkasi
Abstract
This paper presents a weaving implementation named Aspect-Aware Bytecode Combinators (AABC) to help optimization of the dynamic AOP using invokedynamic, which has been included in the JVM since Java 7. The main contribution of this paper is to demonstrate how a dynamic AOP system could be developed with invokedynamic. This paper discusses 4 common kinds of advice, which are supported by AABC. They are before, after, around and after-return advice. This paper argues that filterArguments and filterReturnValue natively supported by the JVM are not suitable to use as the weaving mechanism as they have incorrect semantic to implement AOP advice. It is also found that they have some performance overheads to serve as the weaving mechanism. Thus, this paper presents a new set of bytecode combinators, named AABC, which are carefully designed to match the semantic of the pointcut-advice model of AspectJ. The experimental results showed that performance of AABC in the before advice experiment is faster than the standard bytecode combinators. In addition, the paper demonstrated that the around advice can be successfully implemented using MethodHandle supported in Java 7.
OpenAlex reports 1 citations for this work. Citation counts describe recorded attention and do not establish research quality.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
This paper presents a weaving implementation named Aspect-Aware Bytecode Combinators (AABC) to help optimization of the dynamic AOP using invokedynamic, which has been included in the JVM since Java 7. The main contribution of this paper is to demonstrate how a dynamic AOP system could be developed with invokedynamic. This paper discusses 4 common kinds of advice, which are supported by AABC. They are before, after, around and after-return advice. This paper argues that filterArguments and filterReturnValue natively supported by the JVM are not suitable to use as the weaving mechanism as they have incorrect semantic to implement AOP advice. It is also found that they have some performance overheads to serve as the weaving mechanism. Thus, this paper presents a new set of bytecode combinators, named AABC, which are carefully designed to match the semantic of the pointcut-advice model of AspectJ. The experimental results showed that performance of AABC in the before advice experiment is faster than the standard bytecode combinators. In addition, the paper demonstrated that the around advice can be successfully implemented using MethodHandle supported in Java 7.
Key concepts: Bytecode, Aspect-oriented programming, AspectJ, Computer science, Advice (programming), Programming language, Java, Weaving