SCoPE is an extended AspectJ compiler that optimizes conditional pointcuts (i.e. if pointcuts). With SCoPE compiler, you can write expressive pointcuts within standard AspectJ language without runtime overheads.

With SCoPE compiler, the following advice declaration, which adds extra behavior to calls to methods with only lower case characters, runs without runtime overheads:

before(): call(* *) && if(thisJoinPoint.getSignature().getName().matches("^[a-z]+$")){
  ...
}

Note that the advice uses if pointcut to identify method names. With standard AspectJ compilers, the expression in the if pointcut is evaluated everytime a method is called in a program. The SCoPE compiler recognizes that the pointcut statically matches specific method call expressions in the program, and weaves advice directly before matching calls.

More examples can be found here.

Implementation

SCoPE is currently built on top of abc, the <nop>AspectBench Compiler for AspectJ. We greatly thank the members of this project for releasing such a nice implementation.

Current implementation of the SCoPE compiler is available here.

People

  • Tomoyuki Aotani
  • Hidehiko Masuhara

Papers

  • Tomoyuki Aotani and Hidehiko Masuhara, SCoPE: an AspectJ Compiler for Supporting User-Defined Analysis-Based Pointcuts, In Proceedings of the Sixth International Conference on Aspect-Oriented Software Development (AOSD.07), to apper.
  • Tomoyuki Aotani and Hidehiko Masuhara, Compiling Conditional Pointcuts for User-Level Semantic Pointcuts. In Proceedings of the SPLAT workshop at the 4th international conference on Aspect-Oriented Software Development (AOSD.05).
  • Hidehiko Masuhara and Tomoyuki Aotani, ``Issues on Observing Aspect Effects from Expressive Pointcuts'', In Proceedings of Workshop on Aspects, Dependencies and Interactions (ADI'06), pp.53--61, July 2006.

Related Projects