Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introducing ABC: Programming Languages and AOP Oege de Moor Programming Tools Group University of Oxford joint work with Ganesh Sittampalam, Sascha Kuzins,

Similar presentations


Presentation on theme: "Introducing ABC: Programming Languages and AOP Oege de Moor Programming Tools Group University of Oxford joint work with Ganesh Sittampalam, Sascha Kuzins,"— Presentation transcript:

1 Introducing ABC: Programming Languages and AOP Oege de Moor Programming Tools Group University of Oxford joint work with Ganesh Sittampalam, Sascha Kuzins, Chris Allan, Pavel Avgustinov, Julian Tibble, Damien Sereni (Oxford) Laurie Hendren, Jennifer Lhoták, Ondřej Lhoták, Bruno Dufour, Christopher Goard, Clark Verbrugge (McGill) Aske Simon Christensen (Århus)

2 Roadmap ● Novel features – The fun has just begun ● Performance – It may become cheap ● ABC: the AspectBench Compiler – Extensible: Polyglot – Analysis & optimisation: Soot

3 Tracecuts a d e b c g f h before a, before b, before c, after c, before d, after d, after b, before e, before f, before g, after g, before h, after h, after f, after e, after a j oinpoint tree

4 Observer as tracecut aspect observer { tracecut update(Subject s, Observer o): // declaration of events of interest: create_observer: after returning(o) call(Observer.new(..)) && args(s) update_subject: after call(* Subject.update(..)) && target(s); // regular expression pattern to match against suffixes of traces: create_observer update_subject+ // advice to execute (once for each (s,o) binding) { o.update_view(); }

5 Performance

6 The AspectBench Compiler AspectJ extension AspectJ source, and jars Polyglot Java compiler aspectInfo Java extracts of source Jimple intertype adjuster advice weaver Soot analysis and transformation framework class files analyse & optimise

7 Polyglot: scope for intertype decls public class A { int x; class B { int x; } aspect Aspect { static int x; static int y; int A.B.foo() { class C { int x = 3; int bar() {return x + A.this.x;} } return (new C()).bar() + x + y; } need to disambiguate: when do we refer to host? ● no explicit receiver? if it was introduced into environment by the host, give it “this” from host. ● explicit “this” or “super”? if there is no qualifier and we're not inside a local class, it refers to the host. If there is a qualifier Q, it refers to the host if the host has an enclosing instance of type Q. implementation: ● extend environment type ● new AST nodes “hostSpecial” (this/super) ● ITDs add accessible members from host ● rewrite rules to disambiguate this/super to “Special” or “hostSpecial”

8 Jimple public static int Aspect$foo$1(A$B) { A$B this$2; Aspect$1C $r0; int $i0, $i1, $i2, $i3, $i4; this$2 := @parameter0: A$B; $r0 = new Aspect$1C; specialinvoke $r0. (A$B)>(this$2); $i0 = virtualinvoke $r0. (); $i1 = this$2. ; $i2 = $i0 + $i1; $i3 = ; $i4 = $i2 + $i3; return $i4; } ● 3-address intermediate form ● proven basis for static analysis ● easy to weave into

9 ABC performance

10 ABC Summary ● A second compiler helps language research – precise language description ● Whole-program, aimed at – extensibility, – static analysis – performance of compiled code ● Suite of tools: decompiler, performance measurement, visualisation in Eclipse ● Small, easy to learn: < 500 classes, 45 KLOC ● Current status: – pass majority of ajc tests – likely release mid-October


Download ppt "Introducing ABC: Programming Languages and AOP Oege de Moor Programming Tools Group University of Oxford joint work with Ganesh Sittampalam, Sascha Kuzins,"

Similar presentations


Ads by Google