使用离线profile提升JavaScript程序的类型可预测性
[Abstract]:Mainstream JavaScript engines, such as V8, use type-specific techniques to optimize program performance, which requires predicting the type set of variables at run time for each program point. But the dynamic nature of the JavaScript language reduces the type predictability of the program, causing the engine to fail to predict the type (causing the optimization code to be Deoptimization, or de-optimized) or to produce poor prediction results (resulting in the generation of low-quality code). It can have a negative effect on the procedure. Based on the analysis of programs in Octane,Kraken and SunSpider test sets, a strategy to improve the predictability of program types is found, and an optimization scheme based on offline profile is designed and implemented. The main contributions of this paper are as follows: (1) analyze the behavior of the applications in these test sets during the running process and propose a strategy to improve the predictability of the types by improving the correlation degree of the types. This paper summarizes six patterns that lead to Deoptimization from 48 applications and analyzes their association with engine type systems. The analysis results show that type predictability can be enhanced by increasing the relationship between types (called type correlation). (2) based on the type set predicted by the engine for each attribute access point object, This paper analyzes the relationship between types in each set and proposes a strategy to improve the correlation of types by adjusting the layout of objects. By analyzing the attribute access points whose size of the predicted type set is greater than 1, the relationship between these types is divided into four categories, taking the visited attributes as the bridge. Thus, the strategy of increasing type correlation by adjusting object layout is put forward. (3) A scheme based on offline Profile is proposed to adjust object layout, which is implemented in V8. The scheme is divided into three stages: pile insertion, Profiling and optimization. According to the four characteristics mentioned in (2), the program points will be identified and the code of collecting variable type information will be inserted in the program. The Profiling phase executes the code of the inserted pile to collect the type information in these program points and further generate the adjustment scheme for the property layout (that is, the attribute adjustment reference). In the optimization phase, the attribute adjustment reference information is read at startup, and the optimization code is generated to adjust the layout of the object in order to increase the correlation between the types and improve the predictability of the types. The experimental results show that the proposed scheme reduces 22% of Deoptimization, on all test sets and increases the running speed by up to 6%. This paper proposes a strategy to improve the predictability of program types by increasing the type correlation degree, and proposes a scheme based on offline profile to adjust the object layout to increase the type correlation degree. In addition, the analysis of common code patterns can be used as a reference for JavaScript programmers and language engine optimizers.
【学位授予单位】:中国科学技术大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP312.2
【相似文献】
相关期刊论文 前10条
1 周辉腾;用JavaScript自动选择留言板[J];上海微型计算机;2000年Z3期
2 孙小淋;;基于JavaScript的消息管理机制探讨[J];软件;2013年07期
3 洪留荣,贺蕴普,于娟;用JavaScript实现WEB数据库的交并集查询[J];计算机系统应用;1999年04期
4 张志远;JavaScript与客户端安全[J];东莞理工学院学报;2002年02期
5 陈晓勇,沈良琼;JavaScript在科学设计与计算中的应用[J];西南科技大学学报(自然科学版);2002年03期
6 柯琦;;JavaScript程序设计基础课程教学浅析[J];教育教学论坛;2013年05期
7 ;千里之堤会毁于一穴吗? Java、JavaScript的漏洞既有可能减小障碍,也会发生重大问题[J];每周电脑报;1997年37期
8 汪迎春;;基于JavaScript技术的网页课程设计项目设计[J];信息与电脑(理论版);2013年10期
9 田会;;JavaScript与Java在Web开发中的应用与区别[J];电子技术与软件工程;2014年09期
10 李轶;;基于JavaScript的面向对象程序设计研究[J];江汉大学学报(自然科学版);2010年03期
相关会议论文 前1条
1 段寿建;张旭洁;胡绍波;李忠态;;基于JavaScript和PHP的多级联动下拉菜单的设计与实现[A];AECC专题学术研讨会论文集[C];2007年
相关重要报纸文章 前4条
1 浙江 潘贤林;用 JavaScript 批量浏览图片[N];电脑报;2001年
2 赵泽欣;老道的JavaScript精华子集[N];中华读书报;2012年
3 邓飞;JavaScript网页特效[N];中国电脑教育报;2002年
4 于翔;JavaScript升级引发微软、Mozilla论战[N];网络世界;2007年
相关硕士学位论文 前8条
1 林水明;不透明谓词在JavaScript代码保护的应用研究[D];广东工业大学;2016年
2 黎遇军;使用离线profile提升JavaScript程序的类型可预测性[D];中国科学技术大学;2017年
3 吴通;基于程序分析和机器学习的JavaScript代码推荐研究[D];上海交通大学;2014年
4 郭小福;嵌入式JavaScript引擎的优化与实现[D];电子科技大学;2012年
5 柯宏;嵌入式JavaScript解释器在机顶盒中的设计与实现[D];华中科技大学;2007年
6 张锐;嵌入式JavaScript引擎即时编译器的研究与设计[D];电子科技大学;2011年
7 徐青;JavaScript恶意代码检测技术研究[D];西南交通大学;2014年
8 余启洋;嵌入式JavaScript引擎并行化研究与设计[D];电子科技大学;2013年
,本文编号:2406631
本文链接:https://www.wllwen.com/shoufeilunwen/xixikjs/2406631.html