跳到主要內容

臺灣博碩士論文加值系統

(216.73.216.223) 您好!臺灣時間:2026/08/29 10:20
字體大小: 字級放大   字級縮小   預設字形  
回查詢結果 :::

詳目顯示

: 
twitterline
研究生:吳晞浩
研究生(外文):Wu, Si-Hao
論文名稱:為JavaScript設計之預先式編譯器
論文名稱(外文):JASM: An Ahead-of-Time Compiler for JavaScript Programs
指導教授:游逸平
指導教授(外文):You, Yi-Ping
口試委員:楊武單智君陳鵬升
口試委員(外文):Wu, YangShann, Jyh-JiunChen, Peng-Sheng
口試日期:2014-11-27
學位類別:碩士
校院名稱:國立交通大學
系所名稱:資訊科學與工程研究所
學門:工程學門
學類:電資工程學類
論文種類:學術論文
論文出版年:2014
畢業學年度:103
語文別:英文
論文頁數:43
中文關鍵詞:JavaScript編譯器型別推導程式碼生成
外文關鍵詞:JavaScriptCompilerType inferenceCode generation
相關次數:
  • 被引用被引用:0
  • 點閱點閱:506
  • 評分評分:
  • 下載下載:25
  • 收藏至我的研究室書目清單書目收藏:0
由於網路應用程式的發展和流行,JavaScript已經不同於以往只是來做網頁上頁面排版及顯示的輔助,而是在網路應用程式中負責高密集運算的程式,對高效能JavaScript程式的需求也與日俱增。
近年來JavaScript engine不斷地做改進優化並且也引用了即時編譯的技術,在效能上都有明顯得改進。但是JavaScript中允許變數型別直接轉換,此先天語言的弱型別特性從過去以來不斷造成了效能突破上的瓶頸。
在本篇論文,我們實作了一個Ahead-of-time的編譯器(JSAM)並且提出了data-flow-based 型別推理的方法將JavaScript程式在靜態時期轉成具強型別且執行效能較佳的JavaScript子及 : asm.js,如此我們能夠受益於asm.js的優化。我們跑在SunsPider benchmark實驗的結果顯示了我們所提出的方法能夠有效地提升JavaScript benchmark程式平均約40倍的執行效能。

Due to the development and the popularity of Web applications, JavaScript is not only for assisting the display of items in websites but also be used for computation-intensive programs. The demand for higher performance JavaScript programs is growing.
For decades, JavaScript engines have improved dramatically due to the introduced just-in-time (JIT) compilation techniques and some other optimizations. However, the nature of JavaScript language makes it difficult for further optimizations because its dynamic features make the program behavior unpredictable and hard to determine its type information at static time.
In this thesis, we present an ahead-of-time JavaScript compiler, called JASM, which translates JavaScript programs into asm.js programs, which is a subset of the JavaScript language and has high-performance execution. subset of JavaScript and runs with high speeds. We also propose a data-flow-based type-inference system that infer all possible data types at static time. Our evaluations demonstrated that the proposed method is effective in improving the execution time of JavaScript programs in the test benchmarks on an average of 40x and 20x speedup on a PC and a mobile device, respectively.

Acknowledgements i
Contents i
List of Figures iii
List of Tables iv
1 Introduction 1
1.1 JavaScript . . 1
1.2 Performance problem . . 2
1.3 Motivation . . 4
2 Background 5
2.1 asm.js . . 5
2.2 Emscripten compiler . . 6
3 Framework Overview and Preliminary Analysis 8
3.1 Overview . . 8
3.2 Parser . . 10
3.3 IR instruction . . 10
4 Data-flow-based Type Inference 14
4.1 Workflow . . 14
4.2 Type Lattice . . 15
4.3 Type Analysis . . 19
4.4 Value Set Analysis . . 25
5 Code Generation 30
5.1 Object Property . . 31
5.2 Closure . . 32
5.3 Variable Renaming . . 32
5.4 Main Function . . 33
5.5 Built-in Library . . 33
6 Evaluation 34
6.1 Performance results . . 34
6.2 Time Breakdown . . 36
6.3 Code Size . . 36
7 Related Work 39
8 Conclusion and Future Work 40
8.1 Conclusion . . 40
8.2 Future Work . . 40

[1] asmjs. http://asmjs.org/.
[2] Box2d. http://box2d.org/.
[3] Dart. https://www.dartlang.org/.
[4] Javascriptcore engine. http://trac.webkit.org/wiki/JavaScriptCore.
[5] Nodejs. http://nodejs.org/.
[6] phc – the open source php compiler. http://www.phpcompiler.org/.
[7] Physicsjs. https://developer.mozilla.org/en-US/docs/Web/WebGL.
[8] Rendering engine. http://en.wikipedia.org/wiki/Web_browser_engine.
[9] shedskin. https://code.google.com/p/shedskin/.
[10] Typescript. http://www.typescriptlang.org.
[11] V8 javascript engine. https://code.google.com/p/v8/.
[12] Webgl. https://developer.mozilla.org/en-US/docs/Web/WebGL.
[13] Shisheng Li, Buqi Cheng, and Xiao-Feng Li. Typecastor: Demystify dynamic
typing of javascript applications. In Proceedings of the 6th International Confer-
ence on High Performance and Embedded Architectures and Compilers, HiPEAC
’11, pages 55–65, New York, NY, USA, 2011. ACM.
[14] Yi-Ping You Poyu Chen. Jscomp: A static compiler for hybrid execution of
javascript programs. In Proceedings of the 20th Workshop on Compiler Tech-
niques for High-Performance Computing, CTHPC ’14, 2014.
[15] Gregor Richards, Sylvain Lebresne, Brian Burg, and Jan Vitek. An analysis of
the dynamic behavior of javascript programs. In Proceedings of the 2010 ACM
SIGPLAN Conference on Programming Language Design and Implementation,
PLDI ’10, pages 1–12, New York, NY, USA, 2010. ACM.
[16] A. Schlichtkrull and R. T. Tjalk-Bøggild. Compiling dynamic languages,
2013. DTU supervisors: Christian Probst, cwpr@dtu.dk, and Sven Karlsson,
svea@dtu.dk, DTU Compute.
[17] Haiping Zhao, Iain Proctor, Minghui Yang, Xin Qi, Mark Williams, Qi Gao,
Guilherme Ottoni, Andrew Paroski, Scott MacVicar, Jason Evans, and Stephen
Tu. The hiphop compiler for php. In Proceedings of the ACM International Con-
ference on Object Oriented Programming Systems Languages and Applications,
OOPSLA ’12, pages 575–586, New York, NY, USA, 2012. ACM

連結至畢業學校之論文網頁點我開啟連結
註: 此連結為研究生畢業學校所提供,不一定有電子全文可供下載,若連結有誤,請點選上方之〝勘誤回報〞功能,我們會盡快修正,謝謝!
QRCODE
 
 
 
 
 
                                                                                                                                                                                                                                                                                                                                                                                                               
第一頁 上一頁 下一頁 最後一頁 top