Design and Implementation of JavaScript Interpreter on Mobile Phone Platform

Author
LiuShiKun
Advisor
JinZuo
School
Central South University
Major
Applied Computer Technology
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2009
Downloads
285
Citations
3

Request the full text

Abstract

Low-end mobile phones occupies 50 percent of the entire handset market, but due to low hardware processing power, less memory and other shortages, current applications based on low-end mobile phones are still scarce, and there does not exist an JavaScript interpreter running on low-end mobile phones yet. With the rapid development of mobile applications represented by Web 2.0, the design of a JavaScript interpreter based on low-end mobile phones has important practical significance.A JavaScript interpreter was developed based on one kind of middleware platform in closed system mobile phones (VRE middleware platform). The memory management algorithm of this middleware is not good enough at using small size memory chunk, especially in the case of very limited system memory. Aimed at the characters of mobile phone hardware and the memory management of algorithm, this thesis introduced the key techniques and methods of JavaScript interpreter.The interpreter consists of front-end and back-end, the middle byte code is between the ends. The interpreter takes the method that syntax parsing part drives accident parsing and semantic parsing part. The massive small memory chunk use is cut down, the ratio of effective memory using is increased.In the accident parsing section, one kind of keyword storage table based on length grouping was designed; it increased the speed of figuring out the keywords and the user defined identifiers, which is slow in other interpreters. In the syntax parsing section, the attributed grammar which can generate the Abstract Syntax Tree was constructed firstly, and two syntax stacks and symbol table which would be used in syntax parsing were designed, furthermore, applying the interpretation method of syntax directed, the control function of syntax and semantic parsing was developed. In open source project WebKit, its JavaScript interpreter is a simple syntax tree walker which is low effitient. Taking the interpretation technology of Java as reference, the interpretation mode based on byte code was designed. And the thesis put forward a method which was dividing the JavaScript statements into sections and each section was interpreted individually, this method cut down the nodes and the depth of Abstract Syntax Tree effectively. In the back-ends section, the key data structure and control function were designed; the interpretation based on user-designed byte code was implemented. Aimed at the low efficiency in modifying the class’s attributes for other interpreters, a kind of independent class container was designed, and it was related with the object, which solves the problem efficiently, and the interpretation of single inheritance was solved. What’s more, considering of the characters of low-end mobile phone hardware, a kind of optimizing method based on storage space in chip was put forward, and the effect is obvious. This interpreter also can be applied to hight-end mobile phones.

Table of contents

Abstract 4-5 ABSTRACT 5-9 first chapter 9-18 1.1 research background and significance 9 -11 1.1.1 mobile application development status 9-10 1.1.2 development of low-end mobile application market 10-11 1.2 among low-end phones pc platform 11-12 1.3 mobile browser JavaScript interpreter development Overview 12-15 1.4 programming language interpreter technology overview 15-16 < br /> 1.5 research purpose and content 16 1.6 thesis organization 16-18 the second chapter explains the overall structure of control system design 18-28 <br / > 2.1 mobile middleware platform memory strategies 18-21 2.1.1 Doug Lea memory management algorithms outlined 19-20 2.1.2 Doug Lea memory management overhead of memory blocks 20-21 2.2 JavaScript language 21-23 2.2.1 JavaScript Profile 21-22 2.2.2 JavaScript and ECMAScript 22-23 2.2.3 support JavaScript language interpreter point 23 2.3 VRE interpreter based system architecture design 23-27 2.3.1 JavaScript interpreter relationship with mobile platforms 23-24 2.3.2 JavaScript interpreter in the browser location 24-25 2.3.3 JavaScript interpreter system architecture design 25-27 2.4 Summary 27-28 Chapter JavaScript interpreter front-end design and implementation 28-44 3.1 based on fast lookup table lexical analysis and design 28-32 3.1.1 low-end mobile platforms lexical analysis strategy design 28-29 3.1.2 lexical analyzer to achieve 29-31 3.1.3 Keywords Operator fast lookup table design 31-32 3.2 design and Implementation of a symbol table 32-35 3.2.1 strategic Analysis of the symbol table construction 32-33 3.2.2 hash function design 33-34 3.2.3 symbol table hash function for a conflict handling design 34-35 3.3 low-end mobile platforms parser designed 35-43 3.3.1 parsing strategy analysis 35-36 3.3.2 parser designed 36-38 3.3.3 JavaScript attribute grammar design 38-39 3.3.4 syntax stack with abstract syntax tree design 39 -42 3.3.5 syntactic and semantic analysis component to achieve 42-43 3.4 Summary 43-44 Chapter backend design and interpretation of the intermediate code 44-59 4.1 based on abstract syntax tree explain the problem 44-45 4.2 design and intermediate code generation 45-50 4.2.1 executable block segmentation strategy design 46-47 4.2.2 variable declaration intermediate code generation design 47 4.2.3 control statements if-else intermediate code generation design 47-48 4.2.4 loop for () intermediate code generation design 48-50 4.3 explains backend design 50-54 4.3 .1 explains the backend key data structure design 51-52 4.3.2 explain the backend control program 52-54 4.4 object's single inheritance explains design 54-56 4.5 constructor functions interpretation and design 56-57 4.6 Chapter Summary 57-59 Chapter system design and Performance optimization contrast 59-64 5.1 based on chip memory optimization design 59-61 5.2 performance Comparison with other interpreter 61-63 5.3 of this chapter Summary 63-64 Chapter VI Conclusion and Outlook 64-66 6.1 Conclusion 64-65 6.2 Prospects 65 - 66 References 66-70 Appendix 70-80 Thanks 80-81 master's degree during the main research results 81

Related dissertations

  1. The Design and Realization the Library Management System for Primary and Secondary School Based on.NET
  2. Design and Implementation of Case Law Enforcement Supervision Management System for Grassroots Public Security Agencies
  3. Design and Implementation of a Quality Metric Commodity Product Information Online Management System
  4. The Design and Implementation of Firearms Routine Training Management System
    JiaWeiGang ·Dalian University of Technology ·2013 ·Master's thesis
  5. The Design and Implementation of Student Information Management System Based on Web
  6. The Design and Implementation of Excellent Course Management System
    SunBaoHong ·Shandong Normal University ·2014 ·Master's thesis
  7. The Key Technology Research on Identification of Oil Spill on SAR Image
  8. Research about the Intelligent Marketing System Modeling Based on IEC
    LiangXueZuo ·Ningxia University ·2013 ·Master's thesis
  9. Research on Object Oriented Air Pollution Management Decision Support System Model Base
    CaoDeYou ·Tongji University ·2007 ·Master's thesis
  10. Object Oriented Integrated Modelin and Simulation Research for Petrochemical Lndustry
    QiRuiChao ·Zhejiang University ·2014 ·Master's thesis
  11. Land Use Changes and Effects on Soil and Water Resources of the Yellow River Delta
    ChangChunYan ·Shandong Agricultural University ·2013 ·Doctoral dissertation
  12. Study of Haiti remote sensing classification rules of object oriented coastal zone
    YueAng ·Tianjin Normal University ·2013 ·Master's thesis
  13. Classification of Polsar Image Based on Target Decomposition、object-oriented and Decision Tree Algorithm
    ZuoLaYue ·Liaoning Technical University ·2013 ·Master's thesis
  14. The Design and Implementation of CUDA-Based Ray Tracing Renderer
  15. The Design and Implementation of Intelligent Power Saving System of the Basestation Equipment
  16. Analysis and Design of Teaching Affairs Management Information Systems for Shijiazhuang Posts and Telecommunications Technical College (SPTC)
  17. The Design and Implementation of Meeting Management Information System
    GuoXiaoWen ·Tianjin University ·2012 ·Master's thesis
  18. Design and Implementation of Parameter Decide Tax System
    ZhaoHuan ·Nanchang University ·2012 ·Master's thesis
  19. Design and implementation of personnel management system of enterprise based on.NET platform
  20. Design and Implementation of Student Status and Performance Management System Based on B/S Architecture