Abstract
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.
- B. Alpern, C. R. Attanasio, J. J. Barton, B. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. F. Mergen, N. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeno virtual machine. IBM Systems Journal, 39 (1): 211--238, 2000. Google Scholar
Digital Library
- J. Andersson and T. Ritzau. Dynamic code update in JDrums. In Workshop on Software Engineering for Wearable and Pervasive Computing, 2000.Google Scholar
- P. Avgustinov, A. S. Christensen, L. J. 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 Proceedings of the International Conference on Aspect-Oriented Software Development, pages 87--98. ACM Press, 2005. 10.1145/1052898.1052906. Google Scholar
Digital Library
- L. D. Benavides, R. Douence, and M. Südholt. Debugging and testing middleware with aspect-based control-flow and causal patterns. In Proceedings of the International Conference on Middleware, pages 183--202. Springer-Verlag, 2008. Google Scholar
Digital Library
- A. Bergel. FacetS: First class entities for an open dynamic AOP language. In Proceedings of the Open and Dynamic Aspect Languages Workshop, 2006.Google Scholar
- 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. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 169--190. ACM Press, 2006. 10.1145/1167473.1167488. Google Scholar
Digital Library
- C. Bockisch, M. Haupt, M. Mezini, and K. Ostermann. Virtual machine support for dynamic join points. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 83--92. ACM Press, 2004. 10.1145/976270.976282. Google Scholar
Digital Library
- S. Chiba, Y. Sato, and M. Tatsubori. Using HotSwap for implementing dynamic AOP systems. In Proceedings of the Workshop on Advancing the State-of-the-Art in Run-time Inspection, 2003.Google Scholar
- R. P. Cook and I. Lee. DYMOS: A dynamic modification system. In Proceedings of the Symposium on High-level Debugging, pages 201--202. ACM Press, 1983. 10.1145/1006147.1006188. Google Scholar
Digital Library
- M. Dmitriev. Safe Class and Data Evolution in Large and Long-Lived Java Applications. PhD thesis, University of Glasgow, 2001.Google Scholar
- O. Frieder and M. E. Segal. On dynamically updating a computer program: From concept to prototype. Journal on System Software, 14: 111--128, February 1991. 10.1016/0164--1212(91)90096-O. Google Scholar
Digital Library
- M. Haupt, M. Mezini, C. Bockisch, T. Dinkelaker, M. Eichberg, and M. Krebs. An execution layer for aspect-oriented programming languages. In Proceedings of the ACM/USENIX International Conference on Virtual Execution Environments, pages 142--152. ACM Press, 2005. 10.1145/1064979.1065000. Google Scholar
Digital Library
- E. Hilsdale and J. Hugunin. Advice weaving in AspectJ. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 26--35. ACM Press, 2004. 10.1145/976270.976276. Google Scholar
Digital Library
- R. Hirschfeld. AspectS - aspect-oriented programming with Squeak. In Revised Papers from the International Conference NetObjectDays on Objects, Components, Architectures, Services, and Applications for a Networked World, pages 216--232. Springer-Verlag, 2003. Google Scholar
Digital Library
- U. Hölzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 32--43. ACM Press, 1992. 10.1145/143095.143114. Google Scholar
Digital Library
- Dynamic Code Evolution VM. Institute for System Software, Johannes Kepler University Linz, 2011. http://ssw.jku.at/dcevm/.Google Scholar
- JBoss AOP. JBoss, 2011. http://labs.jboss.com/jbossaop/.Google Scholar
- G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-Oriented Programming. In Proceedings of the European Conference on Object-Oriented Programming, pages 220--242. Springer-Verlag, 1997.Google Scholar
- G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In Proceedings of the European Conference on Object-Oriented Programming, pages 327--353. Springer-Verlag, 2001. Google Scholar
Digital Library
- T. Lindholm and F. Yellin. The Java#8482; Virtual Machine Specification. Addison-Wesley, 2nd edition, 1999. Google Scholar
Digital Library
- K. Makris and R. Bazzi. Immediate multi-threaded dynamic software updates using stack reconstruction. In Proceedings of the USENIX Annual Technical Conference. USENIX Association, 2009. Google Scholar
Digital Library
- S. Malabarba, R. Pandey, J. Gragg, E. Barr, and J. F. Barnes. Runtime support for type-safe dynamic Java classes. In Proceedings of the European Conference on Object-Oriented Programming, pages 337--361. Springer-Verlag, 2000. Google Scholar
Digital Library
- P. Moret, W. Binder, and É. Tanter. Polymorphic bytecode instrumentation. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 129--140. ACM Press, 2011. 10.1145/1960275.1960292. Google Scholar
Digital Library
- I. Neamtiu, M. Hicks, G. Stoyle, and M. Oriol. Practical dynamic software updating for C. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, 2006. 10.1145/1133981.1133991. Google Scholar
Digital Library
- A. Nicoara and G. Alonso. Making applications persistent at run-time. Proceedings of the International Conference on Data Engineering, pages 1368--1372, 2007. 10.1109/ICDE.2007.369013.Google Scholar
Cross Ref
- A. Nicoara, G. Alonso, and T. Roscoe. Controlled, systematic, and efficient code replacement for running Java programs. In Proceedings of the European Conference on Computer Systems, pages 233--246. ACM Press, 2008. 10.1145/1352592.1352617. Google Scholar
Digital Library
- Java Platform Debugger Architecture. Oracle Corporation, 2011. http://java.sun.com/javase/technologies/core/toolsapis/jpda/.Google Scholar
- A. Orso, A. Rao, and M. J. Harrold. A technique for dynamic updating of Java software. In Proceedings of the International Conference on Software Maintenance, pages 649--658. IEEE Computer Society, 2002. 10.1109/ICSM.2002.1167829. Google Scholar
Digital Library
- D. J. Pearce, M. Webster, R. Berry, and P. H. J. Kelly. Profiling with AspectJ. Software: Practice and Experience, 37 (7): 747--777, 2007. 10.1002/spe.788. Google Scholar
Digital Library
- A. Popovici, T. Gross, and G. Alonso. Dynamic weaving for aspect-oriented programming. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 141--147. ACM Press, 2002. 10.1145/508386.508404. Google Scholar
Digital Library
- A. Popovici, G. Alonso, and T. Gross. Just-in-time aspects: efficient dynamic weaving for Java. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 100--109. ACM Press, 2003. 10.1145/643603.643614. Google Scholar
Digital Library
- M. Pukall, C. Kastner, and G. Saake. Towards unanticipated runtime adaptation of Java applications. In Proceedings of the Asia-Pacific Software Engineering Conference, pages 85--92. IEEE Computer Society, 2008. 10.1109/APSEC.2008.66. Google Scholar
Digital Library
- B. Redmond and V. Cahill. Supporting unanticipated dynamic adaptation of application behaviour. In Proceedings of the European Conference on Object-Oriented Programming, pages 205--230. Springer-Verlag, 2002. 10.1007/3--540--47993--7_9. Google Scholar
Digital Library
- M. E. Segal and O. Frieder. On-the-fly program modification: Systems for dynamic updating. IEEE Software, 10: 53--65, 1993. 10.1109/52.199735. Google Scholar
Digital Library
- G. Stoyle, M. Hicks, G. Bierman, P. Sewell, and I. Neamtiu. Mutatis mutandis: Safe and predictable dynamic software updating. ACM Transactions on Programming Languages and Systems, 29 (4), 2007. 10.1145/1255450.1255455. Google Scholar
Digital Library
- S. Subramanian, M. Hicks, and K. S. McKinley. Dynamic software updates: a VM-centric approach. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 1--12. ACM Press, 2009. 10.1145/1542476.1542478. Google Scholar
Digital Library
- D. Suvée, W. Vanderperren, and V. Jonckers. JAsCo: an aspect-oriented approach tailored for component based software development. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 21--29. ACM Press, 2003. 10.1145/643603.643606. Google Scholar
Digital Library
- W. Vanderperren, D. Suvée, B. Verheecke, M. A. Cibrán, and V. Jonckers. Adaptive programming in JAsCo. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 75--86. ACM Press, 2005. 10.1145/1052898.1052905. Google Scholar
Digital Library
- A. Vasseur. Dynamic AOP and runtime weaving for Java -- How does AspectWerkz address it? In Dynamic Aspects Workshop, 2004.Google Scholar
- A. Villazón, W. Binder, D. Ansaloni, and P. Moret. Advanced runtime adaptation for Java. In Proceedings of the International Conference on Generative Programming and Component Engineering, pages 85--94. ACM Press, 2009. 10.1145/1621607.1621621. Google Scholar
Digital Library
- A. Villazón, W. Binder, and P. Moret. Flexible calling context reification for aspect-oriented programming. In Proceedings of the International Conference on Aspect-Oriented Software Development, pages 63--74. ACM Press, 2009. 10.1145/1509239.1509249. Google Scholar
Digital Library
- T. Würthinger, W. Binder, D. Ansaloni, P. Moret, and H. Mössenböck. Improving aspect-oriented programming with dynamic code evolution in an enhanced Java virtual machine. In Proceedings of the Workshop on Reflection, AOP and Meta-Data for Software Evolution, pages 5:1--5:5. ACM Press, 2010. 10.1145/1890683.1890688. Google Scholar
Digital Library
- T. Würthinger, W. Binder, D. Ansaloni, P. Moret, and H. Mössenböck. Applications of enhanced dynamic code evolution for Java in GUI development and dynamic aspect-oriented programming. In Proceedings of the International Conference on Generative Programming and Component Engineering, pages 123--126. ACM Press, 2010. 10.1145/1868294.1868312. Google Scholar
Digital Library
- T. Würthinger, C. Wimmer, and L. Stadler. Dynamic code evolution for java. In Proceedings of the International Conference on the Principles and Practice of Programming in Java, pages 10--19. ACM Press, 2010. 10.1145/1852761.1852764. Google Scholar
Digital Library
Index Terms
Safe and atomic run-time code evolution for Java and its application to dynamic AOP
Recommendations
Applications of enhanced dynamic code evolution for Java in GUI development and dynamic aspect-oriented programming
GPCE '10: Proceedings of the ninth international conference on Generative programming and component engineeringWhile dynamic code evolution in object-oriented systems is an important feature supported by dynamic languages, there is currently only limited support for dynamic code evolution in high-performance, state-of-the-art runtime systems for statically typed ...
Safe and atomic run-time code evolution for Java and its application to dynamic AOP
OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applicationsDynamic 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 ...
Dynamic aspect-oriented programming in java: the hotwave experience
Transactions on Aspect-Oriented Software Development IXDynamic aspect-oriented programming (AOP) enables runtime adaptation of programs. It enables sophisticated, aspect-based software engineering tools, such as adaptive profilers or debuggers, which dynamically modify instrumentation code in response to ...







Comments