嵌入式JavaScript脚本解释器的研究与实现
论文标题:嵌入式JavaScript脚本解释器的研究与实现
The Research and Implementation of an Embedded JavaScript Interpreter
论文作者 王宜春
论文导师 吴健,论文学位 硕士,论文专业 计算机软件与理论
论文单位 西北工业大学,点击次数 153,论文页数 52页File Size1917k
2003-03-01论文网 http://www.lw23.com/lunwen_41757/ 嵌入式Web浏览器,JavaScript解释器,对象模型,反馈制导优化
Embedded Web Browser,JavaScript Interpreter,Object Model,Feedback-Directed Optimization
论 文在深入研究C++对象模型的基础上,提出了一种针对嵌入式开发环境的低运行成本和维护成本的对象模型——OOC对象模型,其执行效率可以和C++对象模 型相比。我们选择了嵌入式开发环境中普遍支持的C语言实现了该模型的程序设计环境,并在此环境中实现了解释器的前端。 论文在考察了目前较先进的优化机制的基础上,考虑到嵌入式环境的资源限制,提出了适用于JavaScript解释器的优化框架。该框架利用后端程序动态运 行信息,制导前端进行优化决策,在不降低系统可用性的前提下,选择出最有效的优化策略,从而使性能得到提高。 论文中结合了嵌入式平台和JavaScript语言的特点,采用了前后端分离的架构以使解释器获得良好的移植性和扩展性。解释器前端的设计实现利用了面向 对象技术。其中采用了对象来表示抽象语法树的结点,用对象之间的关联关系来表示语法成分之间的嵌套关系,并在字节码的生成过程中充分利用多态机制。同时, 该解释器提供了良好的应用程序接口,不仅可以为嵌入式Web浏览器提供脚本支持,也可以为其他需要脚本支持的宿主环境提供支持。 最后,我们开发的解释器通过了Mozilla浏览器所采用的JavaScript Test Library测试库的严格测试,可以说其正确性和健壮性已经达到了商用程度。
The first contribution of this thesis is a new object model called OOC object model. The model is originally based on C++ object model, but with the embedded environment"s resources restriction concerned, the model has low runtime overhead and low maintenance cost, and its performance in execution is comparative to C++ object model. We choose the C language, which should be the most popular high-level language supported in all embedded development environments, to implement a programming environment of the model. The front-end of the interpreter, which will be addressed in next paragraph, is totally implemented in this programming environment.The second contribution of this thesis is the design and implementation of an embedded JavaScript interpreter for the embedded web browser. In the interpreter, a front-end/back-end architecture is used to achieve a good degree of portability and extendibility, and a feedback-directed optimization framework is used to improve the interpreter"s performance. Also, the interpreter provides the host environment with a set of well-defined APIs. At last, the interpreter has passed the strict test with JavaScript Test Library used by Mozilla browser. The testing results prove that the interpreter"s correctness and robustness have reached a high level.
The Research and Implementation of an Embedded JavaScript Interpreter
论文作者 王宜春
论文导师 吴健,论文学位 硕士,论文专业 计算机软件与理论
论文单位 西北工业大学,点击次数 153,论文页数 52页File Size1917k
2003-03-01论文网 http://www.lw23.com/lunwen_41757/ 嵌入式Web浏览器,JavaScript解释器,对象模型,反馈制导优化
Embedded Web Browser,JavaScript Interpreter,Object Model,Feedback-Directed Optimization
论 文在深入研究C++对象模型的基础上,提出了一种针对嵌入式开发环境的低运行成本和维护成本的对象模型——OOC对象模型,其执行效率可以和C++对象模 型相比。我们选择了嵌入式开发环境中普遍支持的C语言实现了该模型的程序设计环境,并在此环境中实现了解释器的前端。 论文在考察了目前较先进的优化机制的基础上,考虑到嵌入式环境的资源限制,提出了适用于JavaScript解释器的优化框架。该框架利用后端程序动态运 行信息,制导前端进行优化决策,在不降低系统可用性的前提下,选择出最有效的优化策略,从而使性能得到提高。 论文中结合了嵌入式平台和JavaScript语言的特点,采用了前后端分离的架构以使解释器获得良好的移植性和扩展性。解释器前端的设计实现利用了面向 对象技术。其中采用了对象来表示抽象语法树的结点,用对象之间的关联关系来表示语法成分之间的嵌套关系,并在字节码的生成过程中充分利用多态机制。同时, 该解释器提供了良好的应用程序接口,不仅可以为嵌入式Web浏览器提供脚本支持,也可以为其他需要脚本支持的宿主环境提供支持。 最后,我们开发的解释器通过了Mozilla浏览器所采用的JavaScript Test Library测试库的严格测试,可以说其正确性和健壮性已经达到了商用程度。
The first contribution of this thesis is a new object model called OOC object model. The model is originally based on C++ object model, but with the embedded environment"s resources restriction concerned, the model has low runtime overhead and low maintenance cost, and its performance in execution is comparative to C++ object model. We choose the C language, which should be the most popular high-level language supported in all embedded development environments, to implement a programming environment of the model. The front-end of the interpreter, which will be addressed in next paragraph, is totally implemented in this programming environment.The second contribution of this thesis is the design and implementation of an embedded JavaScript interpreter for the embedded web browser. In the interpreter, a front-end/back-end architecture is used to achieve a good degree of portability and extendibility, and a feedback-directed optimization framework is used to improve the interpreter"s performance. Also, the interpreter provides the host environment with a set of well-defined APIs. At last, the interpreter has passed the strict test with JavaScript Test Library used by Mozilla browser. The testing results prove that the interpreter"s correctness and robustness have reached a high level.