Font Size: a A A

Improving Type Predictability Of JavaScript Programs With Offline Profile

Posted on:2018-12-26Degree:MasterType:Thesis
Country:ChinaCandidate:Y J LiFull Text:PDF
GTID:2348330512486743Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Main-stream JavaScript engines(such as V8)adopt type specialization technique to optimize the performance of programs.Type specialization technique needs to predict the type set of each variable at every program point in a program.But the dynamic nature of JavaScript drags type predictability of a program,makes engine fail to predict type sets of a program or hard to produce good prediction,which has a negative effect on the performance of a program.This work analyzes programs in 3 benchmark suites(Octane,Kraken,and Sun-Spider).discovers a strategy of increasing type predictability and adjust the layout of objects can increase type connectivity.Hence according to this strategy,this work pro-poses an offline profile based technique.This work contributes as following:1)Analyze the behaviors of programs in benchmarks,propose a hint that im-provement of type predictability can be achieved by improving type connectivity.This work concludes 6 patterns-HIC,ENP,AGV,AOA,MPO and PTC-that can cause Deoptimization from 48 programs,and analyzes how they are connected with the type system of the engine.The results show that type predictability can be improved by increasing type connectivity(sharing common info in between types).2)According to the type sets that engines predict for variables at each program point,analyze the connection of types in each type set,and propose a hint that the improvement of type connectivity can be achieved by adjusting the layouts of programs.The engine predicts the type sets of variables at each program point.The connection in between types in each type set has 4 attributes(MPA,PPA,DPA and SHA)by analyzing type sets whose size is greater than 1,drawing a conclusion that type connectivity can be improved by adjusting the layout of objects.3)Propose an offline profile based technique to adjust the layouts of objects,and implement it in V8.This technique is divided into two stages:Profiling and Optimizing.Profiling stage will collect program points which adapt to the attributes mentioned in 2)by applying dynamic analysis.V8 will summarize this collected infor-mation at the end of the analysis,produce the strategy of adjusting the layout of objects(so-called property adjustment reference).Optimizing stage will read those prop-erties adjustment reference,adjust the layouts of objects while running a program to improve the type connectivity and achieving the improvement of type predictability.Experiment results show that this technique reduces 22%of Deoptimization in total on all programs and improves the speed of programs up to 6%.This work proposes that type predictability can be improved by increasing the type connectivity,and proposes a technique to improve type connectivity by adjusting the layout of objects.The analysis of programs done by this work shed a light to JavaScript programmers and relevant engine programmer.
Keywords/Search Tags:JavaScript, JavaScript Engine, Dynamic Analysis, Offline Profile, Type Predictability
PDF Full Text Request
Related items