随着互联网和万维网的流行以及JavaScript在web浏览器中的作用越来越重要,对JavaScript程序的执行行为的研究将有利于提高浏览器的性能,改善用户的体验.传统的研究认为JavaScript语言的动态性是其性能的主要瓶颈,因此大部分主流的JavaScript执行引擎都将优化集中在其动态性的处理上.为了更深入的研究JavaScript程序的动态性,提出了两种算法:类型预测算法和基于位置的内联缓存算法,分别用于处理JavaScript程序中元数据和对象的类型.以这些算法为基础,在SunSpider测试程序集上系统地研究了JavaScript的类型系统.实验表明,算法平均能够正确识别或者预测99%的类型实例,因此可以认为,尽管JavaScript语言提供了丰富的动态性,实际的应用程序所使用到的动态行为是有限的.这是已知文献中首次提出类似的观点.
the JavaSc behavior o experienc~ the maj engines As the Internet and the World Wide Web become more and more popular nowadays, and ript programming language is becoming a key role in Web browsers, investigation on the f JavaScript applications is important to improve Web browser's performance and user '. Traditional study believes that, the dynamic typing nature of the JavaScript language is or performance bottleneck. are all focused on dynamic language in based depth, two no caching", are So the main optimizations typing problems. To learn vel predication-based algorithms, of most advanced mainstream JavaScript the dynamic typing nature of JavaScript called "type prediction" and "position introduced to tackle the problems. system of JavaScript language is studied systematically and representative JavaScript performance applications, the predication-based algo And so it is believed that although the J benchmark--SunSpider. rithms can avaScript 1 system, the actual applications do not really use most time. This is the first time that such disco identify the anguage prov With these algorithms, the typing the In type ides techniques are evaluated with a experiments with the SunSpider s with 99% accu abundant dynami all the features and hence their beha very is made and published. racy on average. cs with its typing viors are static at