Font Size: a A A

Design And Implementation Of JavaScript Interpreter On Mobile Phone Platform

Posted on:2010-09-06Degree:MasterType:Thesis
Country:ChinaCandidate:S K LiuFull Text:PDF
GTID:2178360278470339Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
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.
Keywords/Search Tags:JavaScript interpreter, mobile middleware platform, attributed grammar, object oriented
PDF Full Text Request
Related items