Dynamic class hierarchy mutation

L. Su, Mikko H. Lipasti
{"title":"Dynamic class hierarchy mutation","authors":"L. Su, Mikko H. Lipasti","doi":"10.1109/CGO.2006.14","DOIUrl":null,"url":null,"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.","PeriodicalId":196640,"journal":{"name":"International Symposium on Code Generation and Optimization (CGO'06)","volume":"51 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2006-03-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Symposium on Code Generation and Optimization (CGO'06)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/CGO.2006.14","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

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.
动态类层次突变
面向对象程序中的类层次结构用于捕获它们所代表的底层对象的各种属性,允许程序员将公共属性封装在基类中,同时将私有属性分布在低级派生类中。本质上,类层次结构的语义优雅地捕获了特定对象可以假设的一些可能状态。然而,类层次结构通常设计得很差,或者以无法完全捕获对象的有状态行为的方式发展。本文提出了一种自动检测有状态类属性的方法,然后动态地改变类层次结构,通过创建可专门用于特定对象状态的隐式派生类来捕获这种行为。我们的方案捕获运行时静态行为,程序员可以通过在源级重构类层次结构来捕获静态行为;以及不能使用源代码转换捕获的运行时变量行为。在后一种情况下,对象从一种状态转换到另一种状态,并从派生类动态地变化到与对象的新状态相对应的对等派生类。这些类层次结构的变化为常规的优化创造了新的机会,比如常量传播、函数专门化和死代码消除。对于我们的基准测试集,其中包括两个版本的SPECjbb,我们在基于jikes的原型实现中测量了1.9%到31.4%的加速,编译开销和目标代码大小的增加可以忽略不计。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书