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
58
Embed
Nu: a Dynamic Aspect-Oriented Intermediate Language Model ...nu/papers/aosd08-slides.pdf · Overview Motivation Our Approach Evaluation Summary I Motivation: Supporting dynamic aspect-oriented
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Nu: a Dynamic Aspect-Oriented IntermediateLanguage Model and Virtual Machine for
Flexible Runtime Adaptation
Robert Dyer and Hridesh Rajan
Department of Computer ScienceIowa State University
{rdyer,hridesh}@cs.iastate.edu
7th International Conference onAspect-Oriented Software Development
OverviewMotivation
Our ApproachEvaluationSummary
I Motivation: Supporting dynamic aspect-oriented constructsI Approach: NuI Evaluation: Expressiveness and performanceI Technical Contributions:
I Flexible, dynamic AO intermediate language modelI Implementation in industrial strength VM (Sun Hotspot)I Dedicated AO caching mechanism
Robert Dyer and Hridesh Rajan 2 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
Need For a Dynamic IL Model
I Currently: Dynamic, high-level AO constructs → low-levelOO representation
I AO compilers need “building blocks”!I Perhaps an example...
Robert Dyer and Hridesh Rajan 3 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts
I History-based pointcuts [Douence, Fradet, and Sudholt]I Temporal constructs in AspectJ [Stolz and Bodden]
�� ����������� �
������������
Robert Dyer and Hridesh Rajan 4 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts
I History-based pointcuts [Douence, Fradet, and Sudholt]I Temporal constructs in AspectJ [Stolz and Bodden]
�� ����������� � ������������
Robert Dyer and Hridesh Rajan 5 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts - Static Translation
Robert Dyer and Hridesh Rajan 6 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts - Static Translation
Robert Dyer and Hridesh Rajan 7 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts - Dynamic Support
Robert Dyer and Hridesh Rajan 8 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts - Dynamic Support
Robert Dyer and Hridesh Rajan 9 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts - Dynamic Support
Robert Dyer and Hridesh Rajan 10 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
History-based Pointcuts - Dynamic Support
Robert Dyer and Hridesh Rajan 11 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
Need For a Dynamic IL Model
I Inadequate support for dynamic use cases in current ILsI Dynamic deployment,I Dynamic adaptation,I Policy changes, etc
I Dynamically adapting set of advised join pointsI Morphing aspects [Hanenberg et al.]I Open Aspects [Hirschfeld and Hanenberg]
Robert Dyer and Hridesh Rajan 12 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
Overview of the Nu Model
I JPM: Point-in-time model [Masuhara et al.]I New primitives: bind and removeI Advice as delegate methodsI Library of patterns
I First-class, immutable objects
Robert Dyer and Hridesh Rajan 13 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
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 15 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
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 16 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
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 17 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
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 18 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
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 19 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
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
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
Implementation Overview
I Built on top of Sun Hotspot VMI Adds code to the interpreter for join point dispatchI bind and remove implemented as native methods
Robert Dyer and Hridesh Rajan 21 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
Implementation Overview
Robert Dyer and Hridesh Rajan 22 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
Implementation Overview
Robert Dyer and Hridesh Rajan 23 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
Novel AO Caching Mechanism
Robert Dyer and Hridesh Rajan 24 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
Caching Mechanism
��������������
��� ���������
������������������
����
������������
��
�����������������
����
���������������� !������
��
Robert Dyer and Hridesh Rajan 25 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
The Nu Intermediate Language ModelThe Nu Virtual Machine
Caching Mechanism
��������������
��� ���������
������������������
����
������������
��
�����������������
����
���������������� !������
��
Robert Dyer and Hridesh Rajan 26 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
Expressing Constructs
I Supports multiple language constructs:I AspectJ aspects, pointcuts and adviceI cflow, cflowbelowI History-based pointcutsI CaesarJ’s deploy
Robert Dyer and Hridesh Rajan 27 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
Expressing Constructs
I Supports multiple language constructs:I AspectJ aspects, pointcuts and adviceI cflow, cflowbelowI History-based pointcutsI CaesarJ’s deploy
Robert Dyer and Hridesh Rajan 28 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
cflow(execution(setWord)) && execution(setBit)
Robert Dyer and Hridesh Rajan 29 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
cflow(execution(setWord)) && execution(setBit)
Robert Dyer and Hridesh Rajan 30 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
cflow(execution(setWord)) && execution(setBit)
Robert Dyer and Hridesh Rajan 31 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
Performance Evaluation Overview
I Java Grande, SPEC JVM98, and custommicro-benchmarks
I Unmodified VM, Nu VM (caching), Nu VM (no caching)I Only about 1.5% overhead
Robert Dyer and Hridesh Rajan 32 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
Robert Dyer and Hridesh Rajan 33 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
Robert Dyer and Hridesh Rajan 34 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
ExpressivenessPerformance
Robert Dyer and Hridesh Rajan 35 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
Related Work
I Steamloom - Bockisch, Haupt, Mezini, and OstermannI Prose - Popovici, Alonso, and GrossI Delegation-based Machine Model - Haupt and SchippersI Morphing Aspects and Continuous Weaving - Hanenberg,
Hirschfeld, and Unland
Robert Dyer and Hridesh Rajan 36 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
Future Work
Robert Dyer and Hridesh Rajan 37 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
I Motivation: Supporting dynamic aspect-oriented constructsI cflow, deploy, history-based, etcI Compiled into static constructsI Lower-level support may yield run-time benefits
I Approach: NuI IL-level primitives for dynamic deploymentI Dedicated caching mechanism (low overhead)
I Evaluation: Expressiveness and performanceI Supports large subset of dynamic AO constructsI Only about 1.5% overhead
I Technical Contributions:I Flexible, dynamic AO intermediate language modelI Implementation in industrial strength VM (Sun Hotspot)I Dedicated AO caching mechanism
Robert Dyer and Hridesh Rajan 38 Nu: Dynamic AO IL Model and VM
OverviewMotivation
Our ApproachEvaluationSummary
Questions?
http://www.cs.iastate.edu/˜nu/
Robert Dyer and Hridesh Rajan 39 Nu: Dynamic AO IL Model and VM