Safe and atomic run-time code evolution for Java and its application to dynamic AOP

Dynamic updates to running programs improve development productivity and reduce downtime of long-running applications. This feature is however severely limited in current virtual machines for object-oriented languages. In particular, changes to classes often apply only to methods invoked after a class change, but not to active methods on the call stack of threads. Additionally, adding and removing methods as well as fields is often not supported. We present a novel programming model for safe and atomic code updates of Java programs that also updates methods that are currently executed. We introduce safe update regions and pause threads only there before an update. We automatically convert the stack frames to suit the new versions of the methods. Our implementation is based on a production-quality Java virtual machine. Additionally, we present SafeWeave, a dynamic aspect-oriented programming system that exposes the atomic code updates through a high-level programming model. AspectJ advice can be added to and removed from a running application.Changes are atomic and correctness is guaranteed even though weaving happens in parallel to program execution, and the system fully supports the dynamic class loading of Java. We show that the enhanced evolution features do not incur any performance penalty before and after version changes.

[1]  Vinny Cahill,et al.  Supporting Unanticipated Dynamic Adaptation of Application Behaviour , 2002, ECOOP.

[2]  Earl T. Barr,et al.  Runtime Support for Type-Safe Dynamic Java Classes , 2000, ECOOP.

[3]  Tobias Ritzau,et al.  Dynamic Code Update in JDRUMS , 2000 .

[4]  Ophir Frieder,et al.  On-the-fly program modification: systems for dynamic updating , 1993, IEEE Software.

[5]  Alessandro Orso,et al.  A technique for dynamic updating of Java software , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[6]  Gunter Saake,et al.  Towards Unanticipated Runtime Adaptation of Java Applications , 2008, 2008 15th Asia-Pacific Software Engineering Conference.

[7]  Robert Hirschfeld,et al.  AspectS - Aspect-Oriented Programming with Squeak , 2002, NetObjectDays.

[8]  Gavin M. Bierman,et al.  Mutatis Mutandis: Safe and predictable dynamic software updating , 2007, TOPL.

[9]  Walter Binder,et al.  Flexible calling context reification for aspect-oriented programming , 2009, AOSD '09.

[10]  Paul H. J. Kelly,et al.  Profiling with AspectJ , 2007, Softw. Pract. Exp..

[11]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[12]  Thomas Würthinger Dynamic code evolution for Java , 2010, PPPJ.

[13]  Manuel Oriol,et al.  Practical dynamic software updating for C , 2006, PLDI '06.

[14]  Gustavo Alonso,et al.  Dynamic weaving for aspect-oriented programming , 2002, AOSD '02.

[15]  Walter Binder,et al.  Polymorphic bytecode instrumentation , 2011, AOSD '11.

[16]  Hanspeter Mössenböck,et al.  Improving aspect-oriented programming with dynamic code evolution in an enhanced Java virtual machine , 2010, RAM-SE@ECOOP.

[17]  Gustavo Alonso,et al.  Controlled, systematic, and efficient code replacement for running java programs , 2008, Eurosys '08.

[18]  Alexandre Bergel FacetS: First Class Entities for an Open Dynamic AOP Language , 2006 .

[19]  Rida A. Bazzi,et al.  Immediate Multi-Threaded Dynamic Software Updates Using Stack Reconstruction , 2009, USENIX Annual Technical Conference.

[20]  Michael Eichberg,et al.  An execution layer for aspect-oriented programming languages , 2005, VEE '05.

[21]  Hanspeter Mössenböck,et al.  Applications of enhanced dynamic code evolution for Java in GUI development and dynamic aspect-oriented programming , 2010, GPCE '10.

[22]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[23]  Mikhail Dmitriev,et al.  Safe class and data evolution in large and long-lived Java applications , 2001 .

[24]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[25]  Wim Vanderperren,et al.  JAsCo: an aspect-oriented approach tailored for component based software development , 2003, AOSD '03.

[26]  Ophir Frieder,et al.  On dynamically updating a computer program: From concept to prototype , 1991, J. Syst. Softw..

[27]  Kathryn S. McKinley,et al.  Dynamic software updates: a VM-centric approach , 2009, PLDI '09.

[28]  Michiaki Tatsubori,et al.  Using HotSwap for Implementing Dynamic AOP Systems , 2003 .

[29]  Craig Chambers,et al.  Debugging optimized code with dynamic deoptimization , 1992, PLDI '92.

[30]  Wim Vanderperren,et al.  Adaptive programming in JAsCo , 2005, AOSD '05.

[31]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[32]  Michael Haupt,et al.  Virtual machine support for dynamic join points , 2004, AOSD '04.

[33]  I. Lee,et al.  DYMOS: a dynamic modification system , 1983, SIGSOFT '83.

[34]  Gustavo Alonso,et al.  Making Applications Persistent at Run-time , 2007, 2007 IEEE 23rd International Conference on Data Engineering.

[35]  Jim Hugunin,et al.  Advice weaving in AspectJ , 2004, AOSD '04.

[36]  Walter Binder,et al.  Advanced runtime adaptation for Java , 2009, GPCE '09.

[37]  Ondrej Lhoták,et al.  abc: an extensible AspectJ compiler , 2005, AOSD '05.

[38]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..

[39]  Luis Daniel Benavides Navarro,et al.  Debugging and Testing Middleware with Aspect-Based Control-Flow and Causal Patterns , 2008, Middleware.

[40]  Gustavo Alonso,et al.  Just-in-time aspects: efficient dynamic weaving for Java , 2003, AOSD '03.