跳到主要內容

臺灣博碩士論文加值系統

(216.73.216.94) 您好!臺灣時間:2026/08/30 11:46
字體大小: 字級放大   字級縮小   預設字形  
回查詢結果 :::

詳目顯示

: 
twitterline
研究生:陳柏裕
研究生(外文):Chen, Po-Yu
論文名稱:為混合執行模式設計之JavaScript靜態編譯器
論文名稱(外文):JSComp: A Static Compiler for Hybrid Execution of JavaScript Programs
指導教授:游逸平
指導教授(外文):You, Yi-Ping
學位類別:碩士
校院名稱:國立交通大學
系所名稱:資訊科學與工程研究所
學門:工程學門
學類:電資工程學類
論文種類:學術論文
論文出版年:2014
畢業學年度:102
語文別:英文
論文頁數:33
中文關鍵詞:JavaScript型別推理編譯器
外文關鍵詞:JavaScriptType inferenceCompiler
相關次數:
  • 被引用被引用:1
  • 點閱點閱:341
  • 評分評分:
  • 下載下載:16
  • 收藏至我的研究室書目清單書目收藏:0
JavaScript是一種被廣泛應用在瀏覽器中的動態語言,執行JavaScript的程式我們稱之為JavaScript Engine。JavaScript engine的實作通常為直譯器(interpreter)或是JIT編譯器(Just-in-time compiler)。然而因為JavaScript其動態語言特性的影響,其表現通常受到極大的限制。
在這篇論文中,我們提出了一個JavaScript的編譯器,透過在靜態時期的分析將JavaScript部分編譯為Native Client或asm.js以達到性能的提升。並且透過混合執行模型(結合了靜態編譯優化及執行期的編譯),得到了性能的優勢,並保留了動態之特性。
而在我們的實驗中顯示,我們所提出的這個方法可以在SunSpider benchmark中平均大約得到50%之效能提升。

JavaScript is a dynamic language that is widely supported in modern Web browsers.JavaScript programs are usually executed by a JavaScript engine, which is implemented using an interpreter or a just-in-time compiler. However, the dynamic aspects of interpretation and run-time compilation intrinsically limit the performance of JavaScript programs. In this paper, we propose a JavaScript compiler, called JSComp,that statically translates partial JavaScript programs into Native Client modules or asm.js programs for improving the execution performance and also a hybrid execution model (a combination of static compilation and dynamic interpretation) for JavaScript programs so as to take advantages of high-performance execution in the compilation model and dynamic code evaluation in the interpretation model. Our evaluations demonstrated that the proposed mechanisms were effective in improving the execution performance of JavaScript programs in the SunSpider benchmark suite by an average of 50%.
1 Introduction 1
1.1 Introduction to JavaScript . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Performance Bottleneck . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Background 5
2.1 Native Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Asm.js . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 System Design and Implementation 7
3.1 System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Symbol Table Construction . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.2 Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 Type Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4.1 Basic Concept . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.1 Generating C++ . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.5.2 Revising JavaScript . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6 Limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Experimental Results 21
4.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 Performance Breakdown . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.3 Code Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.4 Performance and Optimization Level . . . . . . . . . . . . . . . . . . 25
5 Related Work 29
6 Conclusions and Future Work 30
6.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
[1] asm.js. http://asmjs.org/.
[2] Closure tools. https://developers.google.com/closure/.
[3] emscripten. https://github.com/kripken/emscripten.
[4] Native client. https://developers.google.com/native-client/dev/.
[5] phc – the open source php compiler. http://www.phpcompiler.org/.
[6] shedskin. https://code.google.com/p/shedskin/.
[7] Spidermonkey javascript engine. https://developer.mozilla.org/en-US/
docs/Mozilla/Projects/SpiderMonkey.
[8] Sunspider 1.0.2 javascript benchmark. https://www.webkit.org/perf/
sunspider/sunspider.html.
[9] V8 javascript engine. https://code.google.com/p/v8/.
[10] Paul Biggar, Edsko de Vries, and David Gregg. A practical solution for scripting
language compilers. In Proceedings of the 2009 ACM Symposium on Applied
Computing, SAC ’09, pages 1916–1923, New York, NY, USA, 2009. ACM.
[11] Craig Chambers, John Hennessy, and Mark Linton. The design and implementation
of the self compiler, an optimizing compiler for object-oriented programming
languages. Technical report, 1992.
[12] Andreas Gal, Brendan Eich, Mike Shaver, David Anderson, David Mandelin,
Mohammad R. Haghighat, Blake Kaplan, Graydon Hoare, Boris Zbarsky, Jason
Orendorff, Jesse Ruderman, Edwin W. Smith, Rick Reitmaier, Michael Bebenita,
Mason Chang, and Michael Franz. Trace-based just-in-time type specialization
for dynamic languages. In Proceedings of the 2009 ACM SIGPLAN Conference
on Programming Language Design and Implementation, PLDI ’09, pages 465–
478, New York, NY, USA, 2009. ACM.
[13] Brian Hackett and Shu-yu Guo. Fast and precise hybrid type inference for
javascript. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming
Language Design and Implementation, PLDI ’12, pages 239–250, New York,
NY, USA, 2012. ACM.
[14] Bennet Yee, David Sehr, Gregory Dardyk, J. Bradley Chen, Robert Muth, Tavis
Ormandy, Shiki Okasaka, Neha Narula, and Nicholas Fullagar. Native client: A
sandbox for portable, untrusted x86 native code. In Proceedings of the 2009 30th
IEEE Symposium on Security and Privacy, SP ’09, pages 79–93, Washington,
DC, USA, 2009. IEEE Computer Society.
[15] Alon Zakai. Emscripten: An llvm-to-javascript compiler. In Proceedings of the
ACM International Conference Companion on Object Oriented Programming
Systems Languages and Applications Companion, SPLASH ’11, pages 301–312,
New York, NY, USA, 2011. ACM.
[16] 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 Conference
on Object Oriented Programming Systems Languages and Applications,
OOPSLA ’12, pages 575–586, New York, NY, USA, 2012. ACM.
連結至畢業學校之論文網頁點我開啟連結
註: 此連結為研究生畢業學校所提供,不一定有電子全文可供下載,若連結有誤,請點選上方之〝勘誤回報〞功能,我們會盡快修正,謝謝!
QRCODE
 
 
 
 
 
                                                                                                                                                                                                                                                                                                                                                                                                               
第一頁 上一頁 下一頁 最後一頁 top