使用跟踪编译的相位检测

Christian Wimmer, M. Cintra, Michael Bebenita, Mason Chang, A. Gal, M. Franz
{"title":"使用跟踪编译的相位检测","authors":"Christian Wimmer, M. Cintra, Michael Bebenita, Mason Chang, A. Gal, M. Franz","doi":"10.1145/1596655.1596683","DOIUrl":null,"url":null,"abstract":"Dynamic compilers can optimize application code specifically for observed code behavior. Such behavior does not have to be stable across the entire program execution to be beneficial for optimizations, it must only be stable for a certain program phase. To specialize code for a program phase, it is necessary to detect when the execution behavior of the program changes (phase change). Trace-based compilation is an efficient method to detect such phase changes. A trace tree is a collection of frequently executed code paths through a code region, which is assembled dynamically at run time as the program executes. Program execution tends to remain within such a trace tree during a stable phase, whereas phase changes cause a sudden increase in side exits from the trace tree. Because trace trees are recorded at run time by observing the interpreter, the actual values of variables and expressions are also available. This allows a definition of phases based not only on recurring control flow, but also on recurring data values. The compiler can use constant values for variables that change their value rarely and rely on phase detection to handle the case when the variable value actually changes. Our evaluation shows that phase detection based on trace trees results in phases that match the intuitive expectation of a programmer and that are also useful for compiler optimizations.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-08-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"12","resultStr":"{\"title\":\"Phase detection using trace compilation\",\"authors\":\"Christian Wimmer, M. Cintra, Michael Bebenita, Mason Chang, A. Gal, M. Franz\",\"doi\":\"10.1145/1596655.1596683\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Dynamic compilers can optimize application code specifically for observed code behavior. Such behavior does not have to be stable across the entire program execution to be beneficial for optimizations, it must only be stable for a certain program phase. To specialize code for a program phase, it is necessary to detect when the execution behavior of the program changes (phase change). Trace-based compilation is an efficient method to detect such phase changes. A trace tree is a collection of frequently executed code paths through a code region, which is assembled dynamically at run time as the program executes. Program execution tends to remain within such a trace tree during a stable phase, whereas phase changes cause a sudden increase in side exits from the trace tree. Because trace trees are recorded at run time by observing the interpreter, the actual values of variables and expressions are also available. This allows a definition of phases based not only on recurring control flow, but also on recurring data values. The compiler can use constant values for variables that change their value rarely and rely on phase detection to handle the case when the variable value actually changes. Our evaluation shows that phase detection based on trace trees results in phases that match the intuitive expectation of a programmer and that are also useful for compiler optimizations.\",\"PeriodicalId\":169989,\"journal\":{\"name\":\"Principles and Practice of Programming in Java\",\"volume\":\"30 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2009-08-27\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"12\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Principles and Practice of Programming in Java\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/1596655.1596683\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Principles and Practice of Programming in Java","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1596655.1596683","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 12

摘要

动态编译器可以针对观察到的代码行为专门优化应用程序代码。这样的行为不必在整个程序执行过程中保持稳定才能有利于优化,它必须只在某个程序阶段保持稳定。为了专门化程序阶段的代码,有必要检测程序的执行行为何时发生变化(阶段变化)。基于跟踪的编译是检测这种相位变化的有效方法。跟踪树是通过代码区域频繁执行的代码路径的集合,它在运行时随着程序的执行动态地进行组装。在稳定阶段,程序执行倾向于保持在这样的跟踪树中,而阶段变化会导致跟踪树中的侧出口突然增加。因为跟踪树是在运行时通过观察解释器记录的,所以变量和表达式的实际值也是可用的。这使得阶段的定义不仅基于反复出现的控制流,而且基于反复出现的数据值。编译器可以对很少改变其值的变量使用常量值,并依靠相位检测来处理变量值实际改变的情况。我们的评估表明,基于跟踪树的阶段检测结果与程序员的直观期望相匹配,并且对编译器优化也很有用。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Phase detection using trace compilation
Dynamic compilers can optimize application code specifically for observed code behavior. Such behavior does not have to be stable across the entire program execution to be beneficial for optimizations, it must only be stable for a certain program phase. To specialize code for a program phase, it is necessary to detect when the execution behavior of the program changes (phase change). Trace-based compilation is an efficient method to detect such phase changes. A trace tree is a collection of frequently executed code paths through a code region, which is assembled dynamically at run time as the program executes. Program execution tends to remain within such a trace tree during a stable phase, whereas phase changes cause a sudden increase in side exits from the trace tree. Because trace trees are recorded at run time by observing the interpreter, the actual values of variables and expressions are also available. This allows a definition of phases based not only on recurring control flow, but also on recurring data values. The compiler can use constant values for variables that change their value rarely and rely on phase detection to handle the case when the variable value actually changes. Our evaluation shows that phase detection based on trace trees results in phases that match the intuitive expectation of a programmer and that are also useful for compiler optimizations.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术官方微信