ScienceDirect® Home Skip Main Navigation Links
You have guest access to ScienceDirect. Find out more.
 
Home
Browse
My Settings
Alerts
Help
 Quick Search
 Search tips (Opens new window)
    Clear all fields    
Computer Languages, Systems & Structures
Volume 32, Issues 2-3, July-October 2006, Pages 125-139
Smalltalk
 
Font Size: Decrease Font Size  Increase Font Size
 Abstract - selected
Article
Purchase PDF (272 K)

 
 
 
Related Articles in ScienceDirect
View More Related Articles
 
View Record in Scopus
 
doi:10.1016/j.cl.2005.10.002    How to Cite or Link Using DOI (Opens New Window)
Copyright © 2005 Elsevier Ltd All rights reserved.

Runtime bytecode transformation for Smalltalkstar, open

Marcus Denkera, Corresponding Author Contact Information, E-mail The Corresponding Author, Stéphane Ducassea, b, E-mail The Corresponding Author and Éric Tanterc, E-mail The Corresponding Author

aSoftware Composition Group, IAM, Universität Bern, Switzerland bLanguage and Software Evolution Group, LISTIC, Université de Savoie, France cCenter for Web Research, DCC, University of Chile, Santiago, Chile

Received 17 September 2005. 
Available online 21 November 2005.

Purchase the full-text article



References and further reading may be available for this article. To view references and further reading you must purchase this article.

Abstract

Transforming programs to alter their semantics is of wide interest, for purposes as diverse as off-the-shelf component adaptation, optimization, trace generation, and experimentation with new language features. The current wave of interest in advanced technologies for better separation of concerns, such as aspect-oriented programming, is a solid testimony of this fact. Strangely enough, almost all proposals are formulated in the context of Java, in which tool providers encounter severe restrictions due to the rigidity of the environment. This paper presents BYTESURGEON, a library to transform binary code in Smalltalk. BYTESURGEON takes full advantage of the flexibility of the Squeak environment to enable bytecode transformation at runtime, thereby allowing dynamic, on-the-fly modification of applications. BYTESURGEON operates on bytecode in order to cope with situations where the source code is not available, while providing appropriate high-level abstractions so that users do not need to program at the bytecode level. We illustrate the use of BYTESURGEON via the implementation of method wrappers and a simple MOP, and report on its efficiency.

Keywords: Smalltalk; Object-oriented programming; Bytecode transformation; Metaprogramming

Article Outline

1. Introduction
2. The need for bytecode manipulation
2.1. Disadvantages of source code transformation
2.2. Bytecode transformation approaches
2.3. Motivation
3. ByteSurgeon at work
3.1. Introspecting method bodies
3.2. Reification of language operations
3.3. Modifying method bodies
3.3.1. Accessing static information: user-defined variables
3.3.2. Accessing runtime information: metavariables
3.3.3. Altering method evaluation
4. Inside ByteSurgeon
4.1. Squeak
4.2. The closure compiler and its intermediate representation
4.3. Low-level transformation API
4.4. Implementation of metavariables
5. Validation
5.1. Method wrappers
5.2. A small runtime MOP
5.3. Benchmarks
6. Conclusion and future work
Acknowledgements
References







Computer Languages, Systems & Structures
Volume 32, Issues 2-3, July-October 2006, Pages 125-139
Smalltalk
 
Home
Browse
My Settings
Alerts
Help
Elsevier.com (Opens new window)
About ScienceDirect  |  Contact Us  |  Information for Advertisers  |  Terms & Conditions  |  Privacy Policy
Copyright © 2008 Elsevier B.V. All rights reserved. ScienceDirect® is a registered trademark of Elsevier B.V.