DocumentCode
3471838
Title
Dynamic class hierarchy mutation
Author
Su, Lixin ; Lipasti, Mikko H.
Author_Institution
Dept. of Electr. & Comput. Eng., Wisconsin-Madison Univ., Madison, WI, USA
fYear
2006
fDate
26-29 March 2006
Abstract
Class hierarchies in object-oriented programs are used to capture various attributes of the underlying objects they represent, allowing programmers to encapsulate common attributes in base classes while distributing private attributes in lower-level derived classes. In essence, the semantics of the class hierarchy elegantly capture some of the possible states that a particular object can assume. However, class hierarchies are often poorly designed or evolve in ways that fail to fully capture the stateful behavior of objects. This paper proposes an automated approach for detecting stateful class attributes, and then mutating the class hierarchy dynamically to capture such behavior by creating implicit derived classes that can be specialized for specific object states. Our scheme captures both run-time static behavior, which could have been captured by the programmer by restructuring the class hierarchy at the source level; as well as run-time variant behavior, which cannot be captured using source code transformations. In the latter case, objects transition from one state to another and are dynamically mutated from a derived class to a peer derived class corresponding to the object´s new state. These class hierarchy mutations create new opportunities for conventional optimizations such as constant propagation, function specialization, and dead code elimination. For our benchmark set, which includes two versions of SPECjbb, we measure speedups of 1.9% to 31.4% within our Jikes-based prototype implementation, with negligible increases in compilation overhead and object code size.
Keywords
data encapsulation; object-oriented programming; Jikes-based prototype implementation; SPECjbb; attributes encapsulation; class hierarchy semantic; compilation overhead; constant propagation; conventional optimizations; dead code elimination; dynamic class hierarchy mutation; function specialization; object-oriented programs; run-time static behavior; run-time variant behavior; source code transformations; Animals; Genetic mutations; Java; Object detection; Object oriented programming; Programming profession; Prototypes; Runtime; Size measurement; Velocity measurement;
fLanguage
English
Publisher
ieee
Conference_Titel
Code Generation and Optimization, 2006. CGO 2006. International Symposium on
Print_ISBN
0-7695-2499-0
Type
conf
DOI
10.1109/CGO.2006.14
Filename
1611533
Link To Document