Profile Guided Offline Optimization of Hidden Class Graphs for JavaScript VMs in Embedded Systems

Tomoharu Ugawa, Stefan Marr, Richard E. Jones
{"title":"Profile Guided Offline Optimization of Hidden Class Graphs for JavaScript VMs in Embedded Systems","authors":"Tomoharu Ugawa, Stefan Marr, Richard E. Jones","doi":"10.1145/3563838.3567678","DOIUrl":null,"url":null,"abstract":"JavaScript is increasingly used for the Internet of Things (IoT) on embedded systems. However, JavaScript's memory footprint is a challenge, because normal JavaScript virtual machines (VMs) do not fit into the small memory of IoT devices. In part this is because a significant amount of memory is used by hidden classes, which are used to represent JavaScript's dynamic objects efficiently. In this research, we optimize the hidden class graph to minimize their memory use. Our solution collects the hidden class graph and related information for an application in a profiling run, and optimizes the graph offline. We reduce the number of hidden classes by avoiding introducing intermediate ones, for instance when properties are added one after another. Our optimizations allow the VM to assign the most likely final hidden class to an object at its creation. They also minimize re-allocation of storage for property values, and reduce the polymorphism of inline caches. We implemented these optimizations in a JavaScript VM, eJSVM, and found that offline optimization can eliminate 61.9% of the hidden classes on average. It also improves execution speed by minimizing the number of hidden class transitions for an object and reducing inline cache misses.","PeriodicalId":262449,"journal":{"name":"Proceedings of the 14th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages","volume":"211 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-11-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 14th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3563838.3567678","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

JavaScript is increasingly used for the Internet of Things (IoT) on embedded systems. However, JavaScript's memory footprint is a challenge, because normal JavaScript virtual machines (VMs) do not fit into the small memory of IoT devices. In part this is because a significant amount of memory is used by hidden classes, which are used to represent JavaScript's dynamic objects efficiently. In this research, we optimize the hidden class graph to minimize their memory use. Our solution collects the hidden class graph and related information for an application in a profiling run, and optimizes the graph offline. We reduce the number of hidden classes by avoiding introducing intermediate ones, for instance when properties are added one after another. Our optimizations allow the VM to assign the most likely final hidden class to an object at its creation. They also minimize re-allocation of storage for property values, and reduce the polymorphism of inline caches. We implemented these optimizations in a JavaScript VM, eJSVM, and found that offline optimization can eliminate 61.9% of the hidden classes on average. It also improves execution speed by minimizing the number of hidden class transitions for an object and reducing inline cache misses.
Profile引导离线优化的隐藏类图在嵌入式系统中的JavaScript虚拟机
JavaScript越来越多地用于嵌入式系统上的物联网(IoT)。然而,JavaScript的内存占用是一个挑战,因为普通的JavaScript虚拟机(vm)不适合物联网设备的小内存。在某种程度上,这是因为隐藏类使用了大量内存,这些隐藏类用于有效地表示JavaScript的动态对象。在本研究中,我们优化了隐藏类图,以最小化它们的内存使用。我们的解决方案在分析运行中为应用程序收集隐藏的类图和相关信息,并离线优化图。我们通过避免引入中间类来减少隐藏类的数量,例如当属性一个接一个地添加时。我们的优化允许VM在对象创建时将最有可能的最终隐藏类分配给对象。它们还最大限度地减少了属性值的存储重新分配,并减少了内联缓存的多态性。我们在JavaScript虚拟机eJSVM中实现了这些优化,发现离线优化平均可以消除61.9%的隐藏类。它还通过最小化对象的隐藏类转换数量和减少内联缓存丢失来提高执行速度。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信