MAJOR: AN ASPECT WEAVER WITH FULL COVERAGE SUPPORT
Palabras clave:
Aspect-oriented Programming, Aspect Weaving, Bytecode Instrumentation, Java Virtual MachineResumen
Prevailing Aspect-Oriented Programming (AOP) frameworks for Java, such as AspectJ, use bytecode instrumentation techniques to weave aspects into application code. Unfortunately, those frameworks do not support weaving in the Java class library. When implementing aspect-based tools, such as profilers, debugger, or dynamic program analysis tools in general, the aforementioned restriction becomes an important limitation for successfully applying AOP.In this article we present MAJOR, an aspect weaver with full coverage support. That is, MAJOR ensures that aspects are woven into all classes loaded in a Java Virtual Machine, including those in the standard Java class library. We describe the intricacies of instrumentation of the Java class library and present an extended instrumentation approach allowing the user to choose between a pure Java weaving solution based on a two-phases instrumentation scheme, or a single-phase one requiring a tiny native code layer. The single-phase approach allows to better isolate the weaving process from the execution of the woven code.Descargas
Referencias
Oracle Corporation. “JVM Tool Interface (JVMTI) version 1.2.1.” Internet:
http://docs.oracle.com/javase/6/docs/platform/jvmti/jvmti.html , 2007.
The Apache Commons Project. “The Byte Code Engineering Library (BCEL).” Internet:
http://commons.apache.org/bcel/.
OW2 Consortium. “ASM – A Java bytecode engineering library.” Internet: http://asm.ow2.org/.
Jboss. “Javassist Project.” Internet: at http://www.jboss.org/javassist.
M. Denker et al. “Runtime bytecode transformation for Smalltalk.” Journal of Computer Languages, Systems and Structures, vol. 32, no. 2-3, pp. 125–139, July 2006.
G. Kiczales. et al. “Aspect-oriented programming.” In M. Akşit and S.Matsuoka, editors ECOOP’97: Proceedings of the 11th European Conference on Object-Oriented Programming, volume 1241 of Lecture Notes in Computer Science, pp. 220–242, Jyväkylä, Finnland, June 1997. Springer-Verlag
G. Kiczales. et al. “An overview of AspectJ.” In J. L. Knudsen, editor, Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP-2001), volume 2072 of Lecture Notes in Computer Science, pp. 327–353, 2001.
E. Hilsdale and J. Hugunin. “Advice weaving in AspectJ.” In AOSD ’04: Proceedings of the 3rd International Conference on Aspect- Oriented Software Development, pp. 26–35, New York, NY, USA, 2004. ACM.
D. J. Pearce et al. “Profiling with AspectJ.” Software: Practice and Experience, vol. 37, no. 7, pp. 747–777, June 2007.
G. Ammons et al. “Exploiting hardware performance counters with flow and context sensitive profiling.” In PLDI ’97: Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementation, pp. 85–96. ACM Press, 1997.
S. Artzi et al. “ReCrash: Making Software Failures Reproducible by Preserving Object States.” In J. Vitek, editor, ECOOP ’08: Proceedings of the 22th European Conference on Object-Oriented Programming, volume 5142 of Lecture Notes in Computer Science, pp. 542–565, Paphos, Cyprus, 2008. Springer-Verlag.
W. Binder et al. “Advanced Java Bytecode Instrumentation.” In PPPJ’07: Proceedings of the 5th International Symposium on Principles and Practice of Programming in Java, pp. 135–144, New York, NY, USA, 2007. ACM Press.
A. Popovici et al. “Just-in-time aspects: efficient dynamic weaving for Java.” In AOSD ’03: Proceedings of the 2nd International Conference on Aspect-Oriented Software Development, pp. 100–109, New York, NY, USA, 2003. ACM Press.
A. Villazón et al. “Aspect Weaving in Standard Java Class Libraries.” In PPPJ ’08: Proceedings of the 6th International Symposium on Principles and Practice of Programming in Java, pp. 159–167, New York, NY, USA, Sept. 2008. ACM.
A. Villazón et al. “Comprehensive Aspect Weaving for Java,” in Science of Computer Programming, vol. 76, no. 11, pp. 1015–1036, Elsevier North-Holland, Inc. Nov. 2011. Amsterdam, The Netherlands.
R. Valleée-Rai et al. “Optimizing Java bytecode using the Soot framework: Is it feasible?” In Compiler Construction, 9th International Conference (CC 2000), pp. 18–34, 2000
T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, Reading, MA, USA, second edition, 1999.
G. Xu and A. Rountev. “Precise memory leak detection for Java software using container profiling.” In ICSE ’08: Proceedings of the 30th international conference on Software engineering, pp. 151–160, New York, NY, USA, 2008. ACM.
D. L. Heine and M. S. Lam. “Static detection of leaks in polymorphic containers.” In ICSE ’06: Proceedings of the 28th international conference on Software engineering, pp. 252–261, New York, NY, USA, 2006. ACM.
P. Moret et al. “Polymorphic Bytecode Instrumentation.” In AOSD ’11: Proceedings of the 10nd International Conference on Aspect-Oriented Software Development, pp. 129–140, New York, NY, USA, 2011. ACM Press
M. Haupt et al. “An execution layer for aspect-oriented programming languages.” In VEE ’05: Proceedings of the 1st ACM/USENIX international conference on Virtual execution environments, pp. 142–152, New York, NY, USA, 2005. ACM.
M. Dmitriev. “Profiling Java applications using code hotswapping and dynamic call graph revelation.” In WOSP ’04: Proceedings of the Fourth International Workshop on Software and Performance, pp. 139–150. ACM Press, 2004.
M. Factor et al. “Instrumentation of standard libraries in object-oriented languages: The twin class hierarchy approach.” In OOPSLA ’04: Proceedings of the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 288–300, New York, NY, USA, 2004. ACM.
E. Tilevich and Y. Smaragdakis. “Transparent program transformations in the presence of opaque code.” In GPCE ’06: Proceedings of the 5th International Conference on Generative Programming and Component Engineering, pp. 89–94, New York, NY, USA, 2006. ACM
E. Tanter. “Execution levels for aspect-oriented programming.” In Proceedings of the 9th ACM International Conference on Aspect-Oriented Software Development (AOSD 2010), pp. 37–48, Rennes and Saint Malo, France, Mar. 2010. ACM Press.
M. Dmitriev. “Profiling Java applications using code hotswapping and dynamic call graph revelation.” In WOSP ’04: Proceedings of the Fourth International Workshop on Software and Performance, pp. 139–150. ACM Press, 2004
NetBeans, “The NetBeans Profiler Project.” Internet: http://profiler.netbeans.org/.
T. Würthinger et al. “Improving Aspect-Oriented Programming with Dynamic Code Evolution in an Enhanced Java Virtual Machine.” In RAM-SE’10: Proceedings of the 7th ECOOP, Workshop on Reflection, AOP and Meta-Data for Software Evolution, Maribor, Slovenia, 2010
A. Villazón et al. “Advanced Runtime Adaptation for Java.” In GPCE ’09: Proceedings of the Eighth International Conference on Generative Programming and Component Engineering, pp. 85-94. ACM, Oct. 2009.
Jikes RVM. “Research Virtual Machine.” Internet: http://jikesrvm.org/.
T. Würthinger et al. “Applications of enhanced dynamic code evolution for Java in GUI development and dynamic aspect-oriented programming.” In Proceedings of the 9th ACM SIGPLAN International Conference on Generative Programming and Component Engineering (GPCE 2010), pp. 123–126, Eindhoven, The Netherlands, Oct. 2010. ACM Press.
T. Würthinger et al. “Safe and Atomic Run-time Code Evolution and its Application to Dynamic AOP.” In OOPSLA ’11: Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 825-844, New York, NY, USA, 2011. ACM Press.
Publicado
Cómo citar
Número
Sección
Licencia
Reconocimiento-NoComercial-CompartirIgual
CC BY-NC-SA
Esta licencia permite a otros entremezclar, ajustar y construir a partir de su obra con fines no comerciales, siempre y cuando le reconozcan la autoría y sus nuevas creaciones estén bajo una licencia con los mismos términos.
Los autores pueden realizar acuerdos contractuales adicionales separados para la distribución no exclusiva de la versión publicada del artículo publicado en la revista (por ejemplo, publicarlo en un repositorio institucional o en un libro), sujeto a un reconocimiento de su publicación inicial en esta revista