Optimizing AspectJ Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhotak, Ondrej Lhotak, Oege de Moor, Damien Sereni,

Slides:



Advertisements
Similar presentations
A proposed Trusted-Flow system architecture with aspect-oriented implementation Paolo Falcarin, Mario Baldi Riccardo Scandariato, Maurizio Morisio (Politecnico.
Advertisements

School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
The University of Adelaide, School of Computer Science
Recursion vs. Iteration The original Lisp language was truly a functional language: –Everything was expressed as functions –No local variables –No iteration.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
ASTA Aspect Software Testing Assistant Juha Gustafsson, Juha Taina, Jukka Viljamaa University of Helsinki.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
Aspect Oriented Programming - AspectJ Radhika Rajput.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
Overview of AspectJ Aspect Oriented Software Development Seminar Technion presented by Oren Mishali.
CS412/413 Introduction to Compilers Radu Rugina Lecture 16: Efficient Translation to Low IR 25 Feb 02.
Aspect-Oriented Programming In Eclipse ® Aspect-Oriented Programming in Eclipse with AspectJ Dr Helen Hawkins and Sian January.
University of British Columbia Software Practices Lab Fluid AOP Join Point Models Terry Hon Gregor Kiczales.
Advice Weaving in AspectJ Alex Gontmakher. Outline Possible implementation approaches Quick JVM primer AJC implementation Performance Evaluation.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
An Untyped Calculus of Aspect- Oriented Programs Radha Jagadeesan Alan Jeffrey James Riely DEPAUL UNIVERSITY, CHICAGO.
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
December 5, 2004 Seminar on Aspect-Oriented Software Development (236800) Static Analysis of Aspects Evgeniy Gabrilovich
Aspect-Oriented Software Development (AOSD) Tutorial #2 AspectJ Basics.
Rigorous Fault Tolerance Using Aspects and Formal Methods Shmuel Katz Computer Science Department The Technion Haifa, Israel
Aspect Oriented Programming Written by Michael Beder.
More on AspectJ. aspect MoveTracking { private static boolean _flag = false; public static boolean testAndClear() { boolean result = _flag; _flag = false;
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Inline Function. 2 Expanded in a line when it is invoked Ie compiler replace the function call with function code To make a function inline the function.
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Debugging Support.
Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Recursion Chapter 7. Chapter Objectives  To understand how to think recursively  To learn how to trace a recursive method  To learn how to write recursive.
Abc Compiler Zak Fry. Who and Where Programming Tools Group at Oxford University, UK – Oege de Moor Sable Research Group at McGill University, Quebec.
Session 2: AspectJ Mark Stobbe September 13,
Aspect Oriented Programming Scott Nykl CSSE 411 Senior Seminar.
Adding Trace Matching with Free Variables to AspectJ Chris Allan, Pavel Avgustinov, Sascha Kuzins, Oege de Moor, Damien Sereni, Ganesh Sittampalam and.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Aspect Oriented Programming Gülşah KARADUMAN.
AOSD1 Aspect-Oriented Software Design Karl Lieberherr Theo Skotiniotis.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
CCC: An Aspect-Oriented Intermediate Language on.Net Platform Yingfei Xiong and Feng Wan University of Electronic Science and Technology of China, China.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
Introducing ABC: Programming Languages and AOP Oege de Moor Programming Tools Group University of Oxford joint work with Ganesh Sittampalam, Sascha Kuzins,
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
Region Pointcut for AspectJ Shumpei Akai Shigeru Chiba Muga Nishizawa.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Slicing AspectJ Woven Code Luca Cavallaro Mattia Monga Antonio Castaldo D'Ursi Davide Balzarotti Politecnico di Milano.
AspectJ – AOP for Java Tom Janofsky. Instructor at Penn State Abington Consultant with Chariot Solutions JUG Member.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Topics for exam in AOSD Basic concepts: tangling, scattering, joinpoint, advice, cross-cutting, weaving AspectJ: syntax, pointcut notations, around, proceed,
Aspect Oriented Development Alex Beatty.  Purpose  Cross-cutting Concerns  Join Points, Pointcuts, and Advices  Weaving  Invasive vs. Non-Invasive.
CS4432: Database Systems II Query Processing- Part 2.
Rémi Douence, Thomas Fritz Nicolas Loriant, Jean-Marc Menaud Marc Ségura-Devillechaise, Mario Südholt OBASCO group EMN/INRIA An expressive aspect language.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Adrian Colyer IBM Hursley OOPSLA, October
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
Just-In-Time Aspects Based on:  Efficient Dynamic Weaving for Java By: Andrei Popivici, Gustavo Alonso and Thomas Gross  Dynamic Aspect Oriented Infrastructure.
ABC: an implementation of AspectJ Oege de Moor Programming Tools Group University of Oxford joint work with Ganesh Sittampalam, Sascha Kuzins, Chris Allan,
Recursion ITFN The Stack. A data structure maintained by each program at runtime. Push Pop.
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Component 1.6.
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Implementation of the INFOD System using AOP
Structuring Adaptive Applications using AspectJ and AOM
Aspect Oriented Programming
Dynamic Binary Translators and Instrumenters
Presentation transcript:

Optimizing AspectJ Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhotak, Ondrej Lhotak, Oege de Moor, Damien Sereni, Ganesh Sittampalam, Julian Tibble Oxford University University of Aarhus McGill University PLDI 2005 Presented by Geoff Hulette

What is AspectJ? Aspect-Oriented Programming (AOP) language extension for Java

What is AOP? AOP addresses cross-cutting concerns Examples: logging, debug traces, method- level security Goal: remove cross-cutting concerns from objects, put them in aspects

What is an Aspect? Join point: span of code in the execution of a program Pointcut: query that picks out join points Advice: code to execute at a join point

Why Optimize? Dynamic model  naïve compilers add considerable overhead Fortunately, a lot of advice can be compiled statically

Case 1: Around Advice Executes instead of a join point, but can transfer control back into the join point using proceed() Problem: how do you know where proceed should take you?

Standard Solution Closures: pass an object to the advice method with the right code and context “Inlining”: duplicate the advice method for each join point

ABC’s Solution Keep proceed method in the original class Call the advice method with IDs for the originating class and join point Sort it out with a switch statement

Results Code is 25% smaller, on average. Recursive execution times are much faster (3 to 6 times) when recursive advice is applied, about the same otherwise ABC is insensitive to recursive advice

Case 2: cflow Cflow(p): picks out join points in the control flow of p Example pointcut: cflow(call(bar())) && call(foo())

AJC’s Solution Create a stack for each cflow Where p becomes true, push context At join points, test if stack is non-empty

First the easy stuff Combine cflow stacks: cflow(call(a())) && call(b)|| cflow(call(a())) && call(c)  cflow(call(a())) && (call(b)||call(c)) Use counters instead of stacks, if possible Cache stacks/counters

Then the hard stuff Goal: classify instructions to make dynamic checks into static ones

Examples

MayCflow Instructions are in mayCflow(sh) if they may be in the scope of update shadow sh If a query is not in mayCflow, we can replace it with neverMatch

Compute MayFlow Begin with instructions in an update shadow (between push and pop) Add all instructions that might be called from within

MustCflow Instructions are in MustCflow(stack) if that instruction is always in that cflow Replace queries in set with alwaysMatch

Compute MustFlow Pre-compute a list of all statements within a cflow that have no dynamic queries Start with all statements Eliminate those that can be reached from entry points without passing through the pre-computed list

NecessaryShadows Set of update shadows whose effects may be observed, and whose effects are not duplicated Any update shadow not in this set can be eliminated

Compute NecessaryShadows The set of update shadows whose mayFlow sets contain no dynamic queries Also remove those that are in the mustflow of another update

Results Easy stuff led to biggest gains (up to 54x) Hard stuff helped too, but generally not much

Other Optimizations Static Joinpoint data Eliminate boxing/unboxing Other standard optimizations