Nu: a Dynamic Aspect-Oriented Intermediate Language Model and Virtual Machine for Flexible Runtime Adaptation Robert Dyer and Hridesh Rajan Department of Computer Science Iowa State University { rdyer,hridesh } @cs.iastate.edu 7 th International Conference on Aspect-Oriented Software Development
Overview Motivation Our Approach Evaluation Summary ◮ Motivation: Supporting dynamic aspect-oriented constructs ◮ Approach: Nu ◮ Evaluation: Expressiveness and performance ◮ Technical Contributions: ◮ Flexible, dynamic AO intermediate language model ◮ Implementation in industrial strength VM (Sun Hotspot) ◮ Dedicated AO caching mechanism Robert Dyer and Hridesh Rajan 2 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary Need For a Dynamic IL Model ◮ Currently: Dynamic, high-level AO constructs → low-level OO representation ◮ AO compilers need “building blocks”! ◮ Perhaps an example... Robert Dyer and Hridesh Rajan 3 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts ◮ History-based pointcuts [Douence, Fradet, and S¨ udholt] ◮ Temporal constructs in AspectJ [Stolz and Bodden] Robert Dyer and Hridesh Rajan 4 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts ◮ History-based pointcuts [Douence, Fradet, and S¨ udholt] ◮ Temporal constructs in AspectJ [Stolz and Bodden] ������������� ������������ �� �� �� Robert Dyer and Hridesh Rajan 5 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts - Static Translation Robert Dyer and Hridesh Rajan 6 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts - Static Translation Robert Dyer and Hridesh Rajan 7 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts - Dynamic Support Robert Dyer and Hridesh Rajan 8 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts - Dynamic Support Robert Dyer and Hridesh Rajan 9 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts - Dynamic Support Robert Dyer and Hridesh Rajan 10 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary History-based Pointcuts - Dynamic Support Robert Dyer and Hridesh Rajan 11 Nu: Dynamic AO IL Model and VM
Overview Motivation Our Approach Evaluation Summary Need For a Dynamic IL Model ◮ Inadequate support for dynamic use cases in current ILs ◮ Dynamic deployment, ◮ Dynamic adaptation, ◮ Policy changes, etc ◮ Dynamically adapting set of advised join points ◮ Morphing aspects [Hanenberg et al.] ◮ Open Aspects [Hirschfeld and Hanenberg] Robert Dyer and Hridesh Rajan 12 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Overview of the Nu Model ◮ JPM: Point-in-time model [Masuhara et al.] ◮ New primitives: bind and remove ◮ Advice as delegate methods ◮ Library of patterns ◮ First-class, immutable objects Robert Dyer and Hridesh Rajan 13 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Two New Primitives: Bind and Remove Stack Transition Exceptions bind ..., Pattern , Delegate → NullPointerEx ..., BindHandle remove ..., BindHandle → ... IllegalArgumentEx This talk uses source representation for ease. Robert Dyer and Hridesh Rajan 14 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Bind and Remove Example public class AuthLogger { } Robert Dyer and Hridesh Rajan 15 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Bind and Remove Example public class AuthLogger { protected static Pattern p; protected static Delegate d; static { p = new Execution(new Method("*.login")); d = new Delegate(AuthLogger.class, "log"); } public static void log() { // record the time of login } } Robert Dyer and Hridesh Rajan 16 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Bind and Remove Example public class AuthLogger { protected static Pattern p; protected static Delegate d; static { p = new Execution(new Method("*.login")); d = new Delegate(AuthLogger.class, "log"); } public static void log() { // record the time of login } } Robert Dyer and Hridesh Rajan 17 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Bind and Remove Example public class AuthLogger { protected static Pattern p; protected static Delegate d; static { p = new Execution(new Method("*.login")); d = new Delegate(AuthLogger.class, "log"); } public static void log() { // record the time of login } } Robert Dyer and Hridesh Rajan 18 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Bind and Remove Example public class AuthLogger { protected static Pattern p; protected static Delegate d; protected static BindHandle id = null; static { p = new Execution(new Method("*.login")); d = new Delegate(AuthLogger.class, "log"); } public static void enable() { id = bind(p, d); } public static void log() { // record the time of login } } Robert Dyer and Hridesh Rajan 19 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Bind and Remove Example public class AuthLogger { protected static Pattern p; protected static Delegate d; protected static BindHandle id = null; static { p = new Execution(new Method("*.login")); d = new Delegate(AuthLogger.class, "log"); } public static void enable() { id = bind(p, d); } public static void disable() { remove(id); } public static void log() { // record the time of login } } Robert Dyer and Hridesh Rajan 20 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Implementation Overview ◮ Built on top of Sun Hotspot VM ◮ Adds code to the interpreter for join point dispatch ◮ bind and remove implemented as native methods Robert Dyer and Hridesh Rajan 21 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Implementation Overview Robert Dyer and Hridesh Rajan 22 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Implementation Overview Robert Dyer and Hridesh Rajan 23 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Novel AO Caching Mechanism Robert Dyer and Hridesh Rajan 24 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Caching Mechanism ������������� ��� ������ �� �������� ��� ���������� ���������� !������� ��������������� ���� ����� ������� ������ ����������������� ���������������� Robert Dyer and Hridesh Rajan 25 Nu: Dynamic AO IL Model and VM
Overview Motivation The Nu Intermediate Language Model Our Approach The Nu Virtual Machine Evaluation Summary Caching Mechanism ������������� ��� ������ �� �������� ��� ���������� ���������� !������� ��������������� ���� ����� ������� ������ ����������������� ���������������� Robert Dyer and Hridesh Rajan 26 Nu: Dynamic AO IL Model and VM
Overview Motivation Expressiveness Our Approach Performance Evaluation Summary Expressing Constructs ◮ Supports multiple language constructs: ◮ AspectJ aspects, pointcuts and advice ◮ cflow, cflowbelow ◮ History-based pointcuts ◮ CaesarJ’s deploy Robert Dyer and Hridesh Rajan 27 Nu: Dynamic AO IL Model and VM
Recommend
More recommend