使用離線profile提升JavaScript程序的類型可預(yù)測性
[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.
【學(xué)位授予單位】:中國科學(xué)技術(shù)大學(xué)
【學(xué)位級別】:碩士
【學(xué)位授予年份】:2017
【分類號】:TP312.2
【相似文獻(xiàn)】
相關(guān)期刊論文 前10條
1 周輝騰;用JavaScript自動選擇留言板[J];上海微型計(jì)算機(jī);2000年Z3期
2 孫小淋;;基于JavaScript的消息管理機(jī)制探討[J];軟件;2013年07期
3 洪留榮,賀蘊(yùn)普,于娟;用JavaScript實(shí)現(xiàn)WEB數(shù)據(jù)庫的交并集查詢[J];計(jì)算機(jī)系統(tǒng)應(yīng)用;1999年04期
4 張志遠(yuǎn);JavaScript與客戶端安全[J];東莞理工學(xué)院學(xué)報(bào);2002年02期
5 陳曉勇,沈良瓊;JavaScript在科學(xué)設(shè)計(jì)與計(jì)算中的應(yīng)用[J];西南科技大學(xué)學(xué)報(bào)(自然科學(xué)版);2002年03期
6 柯琦;;JavaScript程序設(shè)計(jì)基礎(chǔ)課程教學(xué)淺析[J];教育教學(xué)論壇;2013年05期
7 ;千里之堤會毀于一穴嗎? Java、JavaScript的漏洞既有可能減小障礙,也會發(fā)生重大問題[J];每周電腦報(bào);1997年37期
8 汪迎春;;基于JavaScript技術(shù)的網(wǎng)頁課程設(shè)計(jì)項(xiàng)目設(shè)計(jì)[J];信息與電腦(理論版);2013年10期
9 田會;;JavaScript與Java在Web開發(fā)中的應(yīng)用與區(qū)別[J];電子技術(shù)與軟件工程;2014年09期
10 李軼;;基于JavaScript的面向?qū)ο蟪绦蛟O(shè)計(jì)研究[J];江漢大學(xué)學(xué)報(bào)(自然科學(xué)版);2010年03期
相關(guān)會議論文 前1條
1 段壽建;張旭潔;胡紹波;李忠態(tài);;基于JavaScript和PHP的多級聯(lián)動下拉菜單的設(shè)計(jì)與實(shí)現(xiàn)[A];AECC專題學(xué)術(shù)研討會論文集[C];2007年
相關(guān)重要報(bào)紙文章 前4條
1 浙江 潘賢林;用 JavaScript 批量瀏覽圖片[N];電腦報(bào);2001年
2 趙澤欣;老道的JavaScript精華子集[N];中華讀書報(bào);2012年
3 鄧飛;JavaScript網(wǎng)頁特效[N];中國電腦教育報(bào);2002年
4 于翔;JavaScript升級引發(fā)微軟、Mozilla論戰(zhàn)[N];網(wǎng)絡(luò)世界;2007年
相關(guān)碩士學(xué)位論文 前8條
1 林水明;不透明謂詞在JavaScript代碼保護(hù)的應(yīng)用研究[D];廣東工業(yè)大學(xué);2016年
2 黎遇軍;使用離線profile提升JavaScript程序的類型可預(yù)測性[D];中國科學(xué)技術(shù)大學(xué);2017年
3 吳通;基于程序分析和機(jī)器學(xué)習(xí)的JavaScript代碼推薦研究[D];上海交通大學(xué);2014年
4 郭小福;嵌入式JavaScript引擎的優(yōu)化與實(shí)現(xiàn)[D];電子科技大學(xué);2012年
5 柯宏;嵌入式JavaScript解釋器在機(jī)頂盒中的設(shè)計(jì)與實(shí)現(xiàn)[D];華中科技大學(xué);2007年
6 張銳;嵌入式JavaScript引擎即時(shí)編譯器的研究與設(shè)計(jì)[D];電子科技大學(xué);2011年
7 徐青;JavaScript惡意代碼檢測技術(shù)研究[D];西南交通大學(xué);2014年
8 余啟洋;嵌入式JavaScript引擎并行化研究與設(shè)計(jì)[D];電子科技大學(xué);2013年
,本文編號:2406631
本文鏈接:http://sikaile.net/shoufeilunwen/xixikjs/2406631.html