首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 156 毫秒
1.
基于预测的JavaScript类型系统研究   总被引:1,自引:0,他引:1  
随着互联网和万维网的流行以及JavaScript在Web浏览器中的作用越来越重要,对JavaScript程序的执行行为的研究将有利于提高浏览器的性能,改善用户的体验.传统的研究认为JavaScript语言的动态性是其性能的主要瓶颈,因此大部分主流的JavaScript执行引擎都将优化集中在其动态性的处理上.为了更深入的研究JavaScript程序的动态性,提出了两种算法:类型预测算法和基于位置的内联缓存算法,分别用于处理JavaScript程序中元数据和对象的类型.以这些算法为基础,在SunSpider测试程序集上系统地研究了JavaScript的类型系统.实验表明,算法平均能够正确识别或者预测99%的类型实例,因此可以认为,尽管JavaScript语言提供了丰富的动态性,实际的应用程序所使用到的动态行为是有限的.这是已知文献中首次提出类似的观点.  相似文献   

2.
JavaScript作为Web应用的主要编程语言之一,其解释执行、动态类型、面向原型等特性成为限制Web应用性能的主要因素。为了加快JavaScript运行速度,提升Web应用性能,本文提出一种采用预先编译的V8引擎优化方法。该方法将Web应用第一次解释执行过程中热点函数的字节码或机器码进行保存,Web应用下次运行时可以直接运行热点函数已保存的字节码或机器码,避免了热点函数的解释代价和编译代价,而且提出了新的代价模型来确定保存热点函数字节码或机器码带来的时间增益和空间代价。本文在V8引擎最新编译架构上实现了基于字节码的预先编译方法,并使用标准JavaScript引擎测试集进行了性能测试,实验结果表明在Kraken、Octane测试集上分别可以取得11%和13.6%的性能提升。  相似文献   

3.
姚金阳  赵荣彩  王琦  李颖颖 《计算机科学》2018,45(9):220-223, 236
对现有的编译器而言,间接数组索引不能被高效地向量化,这使得程序中包含有该类访存形式的间接数组索引不能利用SIMD扩展部件,这也是程序向量化研究中的热点问题。为了高效地利用SIMD扩展部件,充分挖掘程序中的向量化潜能,提出了一种对间接数组索引进行向量化的新方法,且提供了性能收益方法,分别对各种间接数组索引进行性能收益分析。实验结果表明,使用该向量化方法可以显著地提高程序的执行效率。  相似文献   

4.
随着多媒体应用的普及,越来越多的处理器集成了SIMD扩展,但是非连续或者非对齐访存会阻碍程序的向量化或者造成性能损失。针对实际应用中出现的数组引用不连续的情况,提出了一种数学模型,用以刻画数组的访存模式和数据重组方案,以判断这些数组引用是否可以通过数组转置的方法满足连续性要求;并采用过程间数组填充、循环剥离和基于SLP的向量化代码生成方法等进行对齐优化。最后基于SPEC2000测试集对该算法进行了测试,结果表明,该方法可以有效地提升向量化程序的执行效率。  相似文献   

5.
谢骋超 《Internet》2014,(3):56-60
Nodejs的执行速度远超Ruby、Python等脚本语言,这背后都是V8引擎的功劳。本文将介绍如何编写高性能Nodejs代码。V8是Chrome背后的JavaScript引擎,因此本文的相关优化经验也适用于基于Chrome浏览器的JavaScript引擎。  相似文献   

6.
一种利用数据融合来提高局部性和减少伪共享的方法   总被引:6,自引:0,他引:6  
某些应用程序不能通过数组内元素的重排优化获得性能提高 .针对这一问题 ,该文扩展了数组之间数据重组优化方法 ,着重分析了将多个数组的数据按一定方式进行融合来提高局部性和减少伪共享优化方法的特性 .文章针对几种典型的数组关联模式 ,提出了相应的数据融合方法 ,并建立了一组粗略的性能代价判别规则 ,以指导编译器有选择地融合数组以提高程序的全局优化效果 .根据在多个平台上的测试结果 ,该文还分析了数据融合优化方法在不同体系结构上的性能可移植性 ,并将体系结构特征加入到性能代价判别规则中 ,使得此优化方法能适用于不同的体系结构 .测试结果表明 ,数据融合优化方法对提高某些应用程序的性能 ,尤其是其在软件DSM体系结构上的性能 ,是非常有效的  相似文献   

7.
使用JavaScript实现了表单的多个下拉列表框的级联效果,对其实现过程进行了详细的描述,从级联表单的设计、数组优化、使用文字下标的数组进行再次优化,逐步完成了对省市级联下拉框的实现和优化。  相似文献   

8.
丁锐  赵荣彩  韩林 《计算机科学》2012,39(3):290-294
计算和数据自动划分是并行化编译中一种自动分配计算和数据到各个处理机的优化技术,划分的结果直接影响程序并行的性能。数组是划分处理的主要对象之一,一些数组分布后的收益不高,但带来的并行约束却能对其它数组的划分产生干扰,导致大量数据重分布通信的产生。现有的划分算法中没有约定数组分布的优先次序,因此无法限制这些数组并行约束的传播,降低了优化编译器后端自动生成并行代码的性能。提出了一种基于主导值的计算和数据自动划分算法:将划分过程中数组对程序并行性的影响量化为主导值,并依据主导值的大小约定数组分布的优先次序,限制干扰数组并行约束的传播速度,提高划分结果的合理性。实验结果表明,算法能够获得良好的划分效果。  相似文献   

9.
高性能计算越来越广泛地应用到科学和工程的各个领域,但实际应用程序获得的性能并未随着机器峰值性能的提高而同比例提高,应用程序只能发挥峰值性能的5%~10%左右,而且两者的差距在扩大,程序性能优化作为解决该问题的方法之一得到了学术界的广泛关注。本文基于安腾微处理器,总结了程序优化的通用方法,给出了程序优化与分析的一般步骤。根据优化与分析步骤,首先对四个程序进行了详细的性能分析,找到性能瓶颈和重点子程序;然后分别根据四个程序的特点,采用基于Cache和指令流水线的优化技术,对程序进行了性能优化;最后给出了性能优化测试结果,分别得到8%~33%的性能提高,取得了良好的优化效果。  相似文献   

10.
测试用例预优化是一种先进的软件回归测试用例集优化技术。相比测试用例选择和测试用例集约简技术,它具有更好的灵活性,更容易适应实际软件回归测试过程中的迭代与变化。基于多目标的测试用例预优化技术是当前研究的热点,针对选定的多个优化目标,算法是多目标测试用例集优化的关键。提出了一种基于蚁群优化算法(ant colony optimization,ACO)的多目标测试用例预优化方法,针对平均语句覆盖率和有效执行时间两个优化目标,实现了测试用例集的预优化,并针对多目标解集优劣评价方法进行了改进。同时对蚁群优化算法中的信息素挥发因子ρ、启发因子α和β、蚁群规模m等相关参数对多目标测试用例预优化结果的影响进行了实验分析。实验中使用的被测程序既包括广泛使用的软件测试样本库SIR(software-artifact infrastructure repository)中的程序,也包括Google发布的大规模开源程序JavaScript引擎V8。实验结果表明,当参数α=1,4β6,ρ=0.1时,针对小规模程序,蚁群规模m=32时,算法求得较优解;针对较大规模程序flex和V8,则需要适当增大蚁群的规模以获得较优解集。  相似文献   

11.
Modern virtual machines for JavaScript use just-in-time (JIT) compilation to produce binary code. JIT compilers cannot perform complex optimizations. In contrast, static compilation has unlimited capabilities for complex optimizing transformations, but it cannot be efficiently applied to dynamic languages, such as JavaScript. In this paper, a general approach to the ahead-of-time compilation of programs in dynamic languages is proposed, and this approach is used for improving two virtual machines JavaScript- Core and V8. In the implementation of the improved JavaScriptCore engine with ahead-of-time compilation, the specifics of using JavaScript programs as a part of locally stored applications for the ARM platform were taken into account. In the V8 engine for the x86-64 platform, the ahead-of-time compilation is implemented by caching an optimized internal representation in a separate file.  相似文献   

12.
JavaScript emerges today as one of the most important programming languages for the development of client-side web applications. Therefore, it is essential that browsers be able to execute JavaScript programs efficiently. However, the dynamic nature of this programming language makes it very challenging to achieve this much needed efficiency. In this paper we propose parameter-based value specialization as a way to improve the quality of the code produced by JIT engines. We have empirically observed that almost 60% of the JavaScript functions found in the world's 100 most popular websites are called only once, or are called with the same parameters. Capitalizing on this observation, we adapt a number of classic compiler optimizations to specialize code based on the runtime values of function's actual parameters. We have implemented the techniques proposed in this paper in IonMonkey, an industrial quality JavaScript JIT compiler developed at the Mozilla Foundation. Our experiments, run across three popular JavaScript benchmarks, SunSpider, V8 and Kraken, show that, in spite of its highly speculative nature, our optimization pays for itself. As an example, we have been able to speed up V8 by 4.83%, and to reduce the size of its generated native code by 18.84%.  相似文献   

13.
即时编译机制(just-in-time compilation)改善了网页浏览器执行JavaScript脚本的性能,同时也为攻击者向浏览器进程注入恶意代码提供了便利.借助即时编译器,攻击者可以将脚本中的整型常数放置到动态代码缓存区,以便注入二进制恶意代码片段(称为gadget).通过常数致盲等去毒化处理,基于常数的注入已经得到有效遏制.证实了不使用常数转而通过填充脚本代码块也能实施gadget注入,并实现图灵完备的计算功能.在编译一段给定的脚本代码时,即时编译器生成的动态代码中通常存在着一些固定的机器指令序列.这些指令序列的存在性不受常数致盲和地址空间布局随机化等安全机制的影响,同时,这些指令序列中可能蕴涵着攻击者期望的gadget.在实施攻击时,攻击者可以汇集特定的脚本代码块来构造一个攻击脚本,再借助即时编译器来注入gadget.在x86-64架构上评估了这种注入攻击在SpiderMonkey和GoogleV8这两个开源即时编译引擎上的可行性.通过给这两个引擎输入大量的JavaScript脚本,可以得到较为丰富的动态代码块.在这些动态代码块上的统计分析结果表明,这两个引擎生成的动态代码中都存在图灵完备的gadget集合.在实际攻击场景中,攻击者可以利用的脚本集合完全包含且远远多于实验用的脚本.因此,攻击者可以采用该方法注入需要的gadget,以便构造出实现任意功能的ROP(return-orientedprogramming)代码.  相似文献   

14.
Despite the popularity of JavaScript for client‐side web applications, there is a lack of effective software tools supporting JavaScript development and testing. The dynamic characteristics of JavaScript pose software engineering challenges such as program understanding and security. One important feature of JavaScript is that its objects support flexible mechanisms such as property changes at runtime and prototype‐based inheritance, making it difficult to reason about object behavior. We have performed an empirical study on real JavaScript applications to understand the dynamic behavior of JavaScript objects. We present metrics to measure behavior of JavaScript objects during execution (e.g., operations associated with an object, object size, and property type changes). We also investigated the behavioral patterns of observed objects to understand the coding or user interaction practices in JavaScript software. Copyright © 2015 John Wiley & Sons, Ltd.  相似文献   

15.
JavaScript provides the technological foundation of Web 2.0 applications. AJAX (Asynchronous JavaScript And XML) applications have received wide-spread attention as a new way to develop highly interactive web applications. Breaking with the complete-page-reload paradigm of traditional web applications, AJAX applications rival desktop applications in their look-and-feel. But AJAX places a high burden on a web developer requiring extensive JavaScript knowledge as well as other advanced client-side technologies. In this paper, we introduce a technique that allows a developer to implement an application in Java or any.NET language and then automatically cross-compile it to an AJAX-enabled web application.  相似文献   

16.
随着Web 2.0时代的到来,Web应用程序越来越强调丰富的用户体验。而这恰恰主要通过客户端大量的JavaScript来提供友好的交互,于是如何选择一个方便有效的JavaScript框架进行开发便成为一个大家关注的问题。通过比较目前流行的两种JavaScript框架(jQuery和ExtJS),分析各自优缺点,以期为Web开发者选择合适的JavaScript框架提供帮助。  相似文献   

17.
JavaScript框架jQuery和ExtJS的对比研究   总被引:1,自引:0,他引:1  
随着Web 2.0时代的到来,Web应用程序越来越强调丰富的用户体验。而这恰恰主要通过客户端大量的JavaScript来提供友好的交互,于是如何选择一个方便有效的JavaScript框架进行开发便成为一个大家关注的问题。通过比较目前流行的两种JavaScript框架(jQuery和ExtJS),分析各自优缺点,以期为Web开发者选择合适的JavaScript框架提供帮助。  相似文献   

18.
Statically analyzing JavaScript applications often requires an analysis of JavaScript libraries because many JavaScript applications use libraries. However, static analysis techniques for JavaScript are not yet ready for analyzing libraries in a scalable and precise manner. Simply loading JavaScript libraries uses various dynamic features of JavaScript, which cause static analyzers to suffer from mutually intermingled problems of scalability and imprecision. In this paper, we present a loop‐sensitive analysis (LSA) technique, which can improve the analysis scalability when analyzing JavaScript libraries by enhancing the analysis precision of loops. The LSA technique distinguishes loop iterations when loop conditions can be determined to be either true or false precisely. We formalize LSA in the abstract interpretation framework in the presence of tricky language features such as exceptions and prove its soundness and precision theorems using Coq. We evaluate our LSA implementation with the analysis results of programs that use 5 JavaScript libraries and show that LSA significantly improves the analysis scalability and precision of an existing JavaScript static analyzer when analyzing JavaScript libraries. In addition, using the configurability of LSA, we experimentally show the correlation between scalability and precision in the analysis of JavaScript libraries. We found that even the analysis of simple programs that just load jQuery, which is the most popular JavaScript library, in a scalable way requires distinguishing not only the last 4 functions being called but also 40 iterations in each loop with 2‐level nested loops at least. Both the mechanization and implementation of LSA are publicly available.  相似文献   

19.
Web应用同本地应用一样面临恶意主机威胁.如何确保暴露于用户主机中的Web应用核心算法或关键业务流程等重要信息的安全成为亟待解决的问题.针对现有JavaScript代码保护方法难以抵御动态分析且抗累积攻击效果差的问题,提出了一种具有时间多样性的JavaScript代码保护(TDJSP)方法.首先,通过程序多样化处理和路径空间模糊化,使JavaScript程序在执行时具有多样性效果,以有效抵御累积攻击;其次,检测调试器、模拟器等非正常执行环境的特征,并根据检测结果进行响应,增加攻击者进行动态分析的难度.理论分析和实验结果表明,JavaScript程序的抗逆向分析能力得到了提高,同时,其空间增长率约为3.1(优于JScrambler3),时间延迟为毫秒级.因此,该方法能够在不影响程序性能的前提下提升Web应用的安全性.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号