標題: 基於LLVM編譯器之JavaScript語言前端實作
A Simple JavaScript Front-end for the LLVM Compiler Infrastructure
作者: 劉耀中
游逸平
Liu, Yao-Chung
You, Yi-Ping
資訊科學與工程研究所
關鍵字: JavaScript;編譯器;LLVM;JavaScript;Compilers;Front-end;LLVM
公開日期: 2017
摘要: 由於動態語言在快速原型開發上的優勢以及方便性,動態語言已經成為現在開發者開發應用程式的優先選擇。JavaScript是一種動態語言,近年來,不僅應用在開發網頁前端,也用在一些網路應用程式中負責高密集運算。近年來JavaScript engine的效能隨著編譯技術的進步與日俱增,但由於動態語言天生的限制,使得JavaScript在效能上仍有瓶頸在。 在本篇論文中,我們提出了一個JavaScript的編譯器,將JavaScript在透過靜態時期的分析、取得變數的型別資訊之後轉譯成靜態語言LLVM IR,使得其能夠使用現有的其他最佳化技術,來取得效能的提升。在我們的實驗中,我們拿SunSpider benchmark來測試對於高密集運算程式的效能改進,結果平均得到了3倍的效能提升。
Due to the advantages of dynamic languages for fast prototyping and development, dynamic languages are a prior choice for programmers to develop applications. JavaScript is one of the dynamic languages and is used not only in front-end web development but also for computation-intensive applications. As the just-in-time compilation techniques evolve, the performance of JavaScript engine is improved year by year. However, there is still a performance bottleneck due to the dynamic features of JavaScript. In this thesis, we propose a simple JavaScript front-end for the LLVM compiler infrastructure, which statically translates JavaScript programs into LLVM intermediate representation (IR) by three main phases: parsing, type inference, and code generation. Our goal is to translate compute-intensive JavaScript programs to native executables to achieve the performance improvement. We evaluated the proposed approach by comparing the performance of JavaScript programs from the SunSpider benchmark with the performance of the binaries programs that are translated by our framework. The results showed that the performance improvement of average 3 times and up to 10 times was obtained.
URI: http://etd.lib.nctu.edu.tw/cdrfb3/record/nctu/#GT070256113
http://hdl.handle.net/11536/141246
顯示於類別:畢業論文