ABSTRACT
Many aspects for runtime monitoring are history-based: they contain pieces of advice that execute conditionally, based on the observed execution history. History-based aspects are notorious for causing high runtime overhead. Compilers can apply powerful optimizations to history-based aspects using domain knowledge. Unfortunately, current aspect languages like AspectJ impede optimizations, as they provide no means to express this domain knowledge.
In this paper we present dependent advice, a novel AspectJ language extension. A dependent advice contains dependency annotations that preserve crucial domain knowledge: a dependent advice needs to execute only when its dependencies are fulfilled. Optimizations can exploit this knowledge: we present a whole-program analysis that removes advice-dispatch code from program locations at which an advice's dependencies cannot be fulfilled.
Programmers often opt to have history-based aspects generated automatically, from formal specifications from model-driven development or runtime monitoring. As we show using code-generation tools for two runtime-monitoring approaches, tracematches and JavaMOP, such tools can use knowledge contained in the specification to automatically generate dependency annotations as well.
Our extensive evaluation using the DaCapo benchmark suite shows that the use of dependent advice can significantly lower, sometimes even completely eliminate, the runtime overhead caused by history-based aspects, independently of the specification formalism.
- C. Allan, P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, O. Lhoták, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. Adding Trace Matching with Free Variables to AspectJ. In OOPSLA, pages 345--364. ACM Press, Oct. 2005. Google ScholarDigital Library
- P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, J. Lhoták, O. Lhoták, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. abc: An extensible AspectJ compiler. In AOSD, pages 87--98. ACM Press, Mar. 2005. Google ScholarDigital Library
- P. Avgustinov, J. Tibble, and O. de Moor. Making trace monitoring feasible. In OOPSLA, pages 589--608. ACM Press, Oct. 2007. Google ScholarDigital Library
- S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanovic, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In OOPSLA, pages 169--190. ACM Press, Oct. 2006. Google ScholarDigital Library
- E. Bodden. J-LO -- A tool for runtime-checking temporal assertions. Master's thesis, RWTH Aachen University, November 2005.Google Scholar
- E. Bodden, F. Chen, and G. Rosu. Dependent Advice: A General Approach to Optimizing History-based Aspects (Extended version). Technical Report abc-2008-2, http://www.aspectbench.org/, March 2008.Google Scholar
- E. Bodden and K. Havelund. Racer: Effective race detection using AspectJ. In ISSTA, pages 155--165. ACM Press, July 2008. Google ScholarDigital Library
- E. Bodden, L. J. Hendren, and O. Lhoták. A staged static program analysis to improve the performance of runtime monitoring. In ECOOP, volume 4609 of LNCS, pages 525--549. Springer, July 2007. Google ScholarDigital Library
- E. Bodden, P. Lam, and L. Hendren. Finding programming errors earlier by evaluating runtime monitors ahead-of-time. In FSE, pages 36--47, New York, NY, USA, 2008. ACM. Google ScholarDigital Library
- F. Chen and G. Rosu. Towards monitoring--oriented programming: A paradigm combining specification and implementation. In RV, volume 89(2) of ENTCS, pages 108--127, July 2003.Google Scholar
- F. Chen and G. Rosu. MOP: an efficient and generic runtime verification framework. In OOPSLA, pages 569--588. ACM Press, Oct. 2007. Google ScholarDigital Library
- W. F. Clocksin and C. Mellish. Programming in Prolog, 5th Edition. Springer, 2003. Google ScholarDigital Library
- S. Goldsmith, R. O'Callahan, and A. Aiken. Relational queries over program traces. In OOPSLA, pages 385--402. ACM Press, Oct. 2005. Google ScholarDigital Library
- E. Hilsdale and J. Hugunin. Advice weaving in AspectJ. In AOSD, pages 26--35. ACM Press, Mar. 2004. Google ScholarDigital Library
- G. Kniesel, T. Rho, and S. Hanenberg. Evolvable pattern implementations need generic aspects. In ECOOP 2004 Workshop on Reflection, AOP and Meta-Data for Software Evolution, June 2004.Google Scholar
- I. H. Krüger, G. Lee, and M. Meisinger. Automating software architecture exploration with M2Aspects. In SCESM, pages 51--58. ACM Press, 2006. Google ScholarDigital Library
- O. Lhoták and L. Hendren. Scaling Java points-to analysis using Spark. In CC, volume 2622 of LNCS, pages 153--169, Apr. 2003. Google ScholarDigital Library
- K. Lieberherr and D. H. Lorenz. Coupling aspect-oriented and adaptive programming. In R. E. Filman, T. Elrad, S. Clarke, and M. Aksit, editors, Aspect-Oriented Software Development, pages 145--164. Addison-Wesley, 2005.Google Scholar
- S. Maoz and D. Harel. From multi-modal scenarios to code: compiling LSCs into AspectJ. In FSE, pages 219--230. ACM Press, Nov. 2006. Google ScholarDigital Library
- M. Martin, B. Livshits, and M. S. Lam. Finding application errors using PQL: a program query language. In OOPSLA, pages 365--383, Oct. 2005. Google ScholarDigital Library
- H. Masuhara and K. Kawauchi. Dataflow pointcut in aspect-oriented programming. In 1st Asian Symposium on Programming Languages and Systems, volume 2895 of LNCS, pages 105--121. Springer, Dec. 2003.Google ScholarCross Ref
- H. Masuhara, G. Kiczales, and C. Dutchyn. A compilation and optimization model for aspect-oriented programs. In CC, volume 2622 of LNCS, pages 46--60. Springer, Apr. 2003. Google ScholarDigital Library
- N. A. Naeem and O. Lhoták. Typestate-like analysis of multiple interacting objects. In OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object oriented programming systems languages and applications, pages 347--366, New York, NY, USA, 2008. ACM. Google ScholarDigital Library
- K. Sakurai, H. Masuhara, N. Ubayashi, S. Matsuura, and S. Komiya. Association aspects. In AOSD, pages 16--25, Mar. 2004. Google ScholarDigital Library
- M. Sridharan and R. Bodík. Refinement-based context-sensitive points-to analysis for Java. In PLDI, pages 387--400, June 2006. Google ScholarDigital Library
- V. Stolz and E. Bodden. Temporal Assertions using AspectJ. In 5th Workshop on Runtime Verification, volume 144 of Electronic Notes in Theoretical Computer Science, pages 109--124, July 2005. Google ScholarDigital Library
Index Terms
- Dependent advice: a general approach to optimizing history-based aspects
Recommendations
Static and Dynamic Program Compilation by Interpreter Specialization
Interpretation and run-time compilation techniques are increasingly important because they can support heterogeneous architectures, evolving programming languages, and dynamically-loaded code. Interpretation is simple to implement, but yields poor ...
Untangling crosscutting concerns in domain-specific languages with domain-specific join points
DSAL '09: Proceedings of the 4th workshop on Domain-specific aspect languagesLike programs written in general-purpose languages, programs written in DSLs may also suffer from tangling and scattering in the presence of domain-specific crosscutting concerns. This paper presents an architecture that supports aspect-oriented ...
Specification of domain-specific languages based on concern interfaces
FOAL '14: Proceedings of the 13th workshop on Foundations of aspect-oriented languagesConcern-Driven Development (CDD) is a set of software engineering approaches that focus on reusing existing software models. In CDD, a concern encapsulates related software models and provides three interfaces to facilitate reuse. These interfaces allow ...
Comments