SCoPE: an AspectJ compiler for supporting user-defined analysis-based pointcuts

This paper proposes an approach called SCoPE, which supports user-defined analysis-based pointcuts in aspect-oriented programming (AOP) languages. The advantage of our approach is better integration with existing AOP languages than previous approaches. Instead of extending the language, SCoPE allows the programmer to write a pointcut that analyzes a program by using a conditional (if) pointcut with introspective reflection libraries. A compilation scheme automatically eliminates runtime tests for such a pointcut. The approach also makes effects of aspects visible to the analysis, which is essential for determining proper aspect interactions. We implemented a SCoPE compiler for the AspectJ language on top of the AspectBench compiler using a backpatching technique. The implementation efficiently finds analysis-based pointcuts, and generates woven code without runtime tests for those pointcuts. Our benchmark tests with JHotDraw and other programs showed that SCoPE compiles programs with less than 1% compile-time overhead, and generates a program that is as efficient as an equivalent program that uses merely static pointcuts.

[1]  Michael Eichberg,et al.  Pointcuts as Functional Queries , 2004, APLAS.

[2]  Stephanie Weirich,et al.  Good advice for type-directed programming aspect-oriented programming and extensible generic functions , 2006, WGP '06.

[3]  Rémi Douence,et al.  Composition, reuse and interaction analysis of stateful aspects , 2004, AOSD '04.

[4]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[5]  Shigeru Chiba,et al.  Josh: an open AspectJ-like language , 2004, AOSD '04.

[6]  Ramnivas Laddad,et al.  Aspectj in Action: Practical Aspect-Oriented Programming , 2003 .

[7]  Kris Gybels,et al.  Arranging language features for more robust pattern-based crosscuts , 2003, AOSD '03.

[8]  Hidehiko Masuhara,et al.  Issues on Observing Aspect Effects from Expressive Pointcuts , 2006 .

[9]  Karl J. Lieberherr,et al.  Shadow programming: reasoning about programs using lexical join point information , 2005, GPCE'05.

[10]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[11]  Shigeru Chiba,et al.  Load-Time Structural Reflection in Java , 2000, ECOOP.

[12]  Hidehiko Masuhara,et al.  Dataflow Pointcut in Aspect-Oriented Programming , 2003, APLAS.

[13]  Ondrej Lhoták,et al.  Adding trace matching with free variables to AspectJ , 2005, OOPSLA '05.

[14]  Ondrej Lhoták,et al.  abc : An Extensible AspectJ Compiler , 2006, LNCS Trans. Aspect Oriented Softw. Dev..

[15]  Tzilla Elrad,et al.  Aspect-oriented programming: Introduction , 2001, CACM.

[16]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[17]  Wilson C. Hsieh,et al.  Splice: Aspects That Analyze Programs , 2004, GPCE.

[18]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[19]  Karl J. Lieberherr,et al.  Assuring good style for object-oriented programs , 1989, IEEE Software.

[20]  Lars Ole Andersen,et al.  Program Analysis and Specialization for the C Programming Language , 2005 .

[21]  David Grove,et al.  Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis , 1995, ECOOP.

[22]  Ankit Shah,et al.  XAspects: an extensible system for domain-specific aspect languages , 2003, OOPSLA '03.

[23]  Shriram Krishnamurthi,et al.  Pointcuts and advice in higher-order languages , 2003, AOSD '03.

[24]  Mira Mezini,et al.  Expressive Pointcuts for Increased Modularity , 2005, ECOOP.

[25]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[26]  Robert J. Walker,et al.  Implicit context: easing software evolution and reuse , 2000, SIGSOFT '00/FSE-8.

[27]  Laurence Duchien,et al.  JAC: A Flexible Solution for Aspect-Oriented Programming in Java , 2001, Reflection.

[28]  Stefan Hanenberg,et al.  Evolvable Pattern Implementations Need Generic Aspects , 2004, RAM-SE.

[29]  Klaus Ostermann,et al.  Back to the Future: Pointcuts as Predicates over Traces , 2005 .

[30]  Ondrej Lhoták,et al.  Points-to analysis using BDDs , 2003, PLDI '03.

[31]  Gustavo Alonso,et al.  Dynamic weaving for aspect-oriented programming , 2002, AOSD '02.

[32]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[33]  Laurie Hendren,et al.  Soot---a java optimization framework , 1999 .

[34]  Kim Mens,et al.  Managing the Evolution of Aspect-Oriented Software with Model-Based Pointcuts , 2006, ECOOP.

[35]  David F. Bacon,et al.  Fast static analysis of C++ virtual function calls , 1996, OOPSLA '96.