A Declarative Framework for Analysis and Optimization

  • Henry Falconer
  • Paul H. J. Kelly
  • David M. Ingram
  • Michael R. Mellor
  • Tony Field
  • Olav Beckmann
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4420)

Abstract

DeepWeaver-1 is a tool supporting cross-cutting program analysis and transformation components, called “weaves”. Like an aspect, a DeepWeaver weave consists of a query part, and a part which may modify code. DeepWeaver’s query language is based on Prolog, and provides access to data-flow and control-flow reachability analyses. DeepWeaver provides a declarative way to access the internal structure of methods, and supports cross-cutting weaves which operate on code blocks from different parts of the codebase simultaneously. DeepWeaver operates at the level of bytecode, but offers predicates to extract structured control flow constructs. This paper motivates the design, and demonstrates some of its power, using a sequence of examples including performance profiling and domain-specific performance optimisations for database access and remote method invocation.

References

  1. 1.
    Adams, B., Tourwé, T.: Aspect orientation for C: Express yourself. In: AOSD SPLAT Workshop (2005)Google Scholar
  2. 2.
    Ahern, A., Yoshida, N.: Formalising Java RMI with explicit code mobility. In: OOPSLA ’05: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, San Diego, CA, USA, pp. 403–422. ACM Press, New York (2005), doi:10.1145/1094811.1094843CrossRefGoogle Scholar
  3. 3.
    Allan, C., et al.: ABC the AspectBench compiler for AspectJ: A workbench for aspect-oriented programming language and compilers research. In: OOPSLA ’05: Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, San Diego, CA, USA, pp. 88–89. ACM Press, New York (2005), doi:10.1145/1094855.1094877CrossRefGoogle Scholar
  4. 4.
    Allan, C., et al.: Adding trace matching with free variables to AspectJ. In: OOPSLA ’05: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, San Diego, CA, USA, pp. 345–364. ACM Press, New York (2005)CrossRefGoogle Scholar
  5. 5.
    Beyer, D., Lewerentz, C.: CrocoPat: Efficient pattern analysis in object-oriented programs. In: Proceedings of the 11th IEEE International Workshop on Program Comprehension (IWPC 2003), Portland, OR, May 10-11, 2003, pp. 294–295. IEEE Computer Society Press, Los Alamitos (2003), http://mtc.epfl.ch/~beyer/CrocoPat/ Google Scholar
  6. 6.
    Cordy, J.R., Halpern-Hamu, C.D., Promislow, E.: TXL: a rapid prototyping system for programming language dialects. Computer Languages 16(1), 97–107 (1991)CrossRefGoogle Scholar
  7. 7.
    Davis, M.K., Quinlan, D.J.: ROSE: An Optimizing Transformation System for C++ Array-Class Libraries. In: Demeyer, S., Bosch, J. (eds.) ECOOP 1998 Workshops. LNCS, vol. 1543, pp. 452–453. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  8. 8.
    Engler, D.R.: Incorporating application semantics and control into compilation. In: USENIX Conference on Domain-Specific Languages (DSL’97), pp. 103–118. USENIX (1997), citeseer.ist.psu.edu/engler97incorporating.html
  9. 9.
    Hajiyev, E., Verbaere, M., de Moor, O.: Codequest: Scalable source code queries with datalog. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 2–27. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  10. 10.
    Smaragdakis, Y., Zook, D., Huang, S.S.: Statically Safe Program Generation with SafeGen. In: Glück, R., Lowry, M. (eds.) GPCE 2005. LNCS, vol. 3676, pp. 309–326. Springer, Heidelberg (2005)Google Scholar
  11. 11.
    Lacey, D., et al.: Proving correctness of compiler optimizations by temporal logic. Higher-Order and Symbolic Computation 17(2) (2004)Google Scholar
  12. 12.
    Laddad, R.: AspectJ in Action: Practical Aspect-Oriented Programming. Manning Publications Co., Greenwich (2003)Google Scholar
  13. 13.
    Lam, M.S., et al.: Context-sensitive program analysis as database queries. In: PODS ’05: Proceedings of the twenty-fourth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, Baltimore, Maryland, pp. 1–12. ACM Press, New York (2005)CrossRefGoogle Scholar
  14. 14.
    Lerner, S., et al.: Automated soundness proofs for dataflow analyses and transformations via local rules. In: POPL 2005: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, Long Beach, Ca, USA, pp. 364–377. ACM Press, New York (2005)CrossRefGoogle Scholar
  15. 15.
    Masuhara, H., Kawauchi, K.: Dataflow pointcut in aspect-oriented programming. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 105–121. Springer, Heidelberg (2003)Google Scholar
  16. 16.
    The Eclipse Foundation Inc. The Eclipse extensible development platform.Google Scholar
  17. 17.
    Vallée-Rai, R., et al.: SOOT - a Java optimization framework. In: Proceedings of CASCON 1999, pp. 125–135 (1999)Google Scholar
  18. 18.
    Verbaere, M., Ettinger, R., de Moor, O.: JunGL: a scripting language for refactoring. In: ICSE ’06: Proceeding of the 28th international conference on Software engineering, Shanghai, China, pp. 172–181. ACM Press, New York (2006)CrossRefGoogle Scholar
  19. 19.
    Visser, E.: Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0. In: Lengauer, C., et al. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)Google Scholar
  20. 20.
    De Volder, K.: Jquery: A generic code browser with a declarative configuration language. In: Van Hentenryck, P. (ed.) PADL 2006. LNCS, vol. 3819, pp. 88–102. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  21. 21.
    Yeung, K.C., Kelly, P.H.J.: Optimising Java RMI programs by communication restructuring. In: Endler, M., Schmidt, D.C. (eds.) Middleware 2003. LNCS, vol. 2672, Springer, Heidelberg (2003)CrossRefGoogle Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Henry Falconer
    • 1
  • Paul H. J. Kelly
    • 1
  • David M. Ingram
    • 1
  • Michael R. Mellor
    • 1
  • Tony Field
    • 1
  • Olav Beckmann
    • 1
  1. 1.Department of Computing, Imperial College London, 180 Queen’s Gate, London SW7 2BZU.K.

Personalised recommendations