研究生: |
曾楚榮 |
---|---|
論文名稱: |
Enabling Ahead-of-Time Java Compilation on Embedded Systems |
指導教授: | 李政崑 |
口試委員: | |
學位類別: |
碩士 Master |
系所名稱: |
電機資訊學院 - 資訊工程學系 Computer Science |
論文出版年: | 2010 |
畢業學年度: | 98 |
語文別: | 英文 |
論文頁數: | 32 |
中文關鍵詞: | Java 、預先編譯 、嵌入式系統 、編譯器 、目的碼尺寸最佳化 |
外文關鍵詞: | Java, ahead-of-time, embedded system, compiler, code size optimization |
相關次數: | 點閱:2 下載:0 |
分享至: |
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
近年嵌入式系統在許多應用下都有著極佳的成果。以往專注於PC上的辦公應用、網路及系統工具都在嵌入式系統上漸漸有了需求,例如許多次世代手機、PDA或平板電腦之類。因此軟體開發者在維護自家軟體時發現,同時維護這麼多平台的移植相當困難。為了避開這個問題,許多軟體是以跨平台的程式語言撰寫。Java就是這麼一個跨平台的程式語言,同時它還具備物件導向的特性,並且在執行效率與開發速度之間取得相當不錯的平衡,因此在嵌入式系統上的軟體開發也一直佔有一席之地。但是Java執行時所使用的虛擬機器一直以來都比用C語言寫出的程式慢上三至數十倍不等。
在這篇碩士論文中展示了一個運作於Andes嵌入式處理器和Android平台上的Java預先編譯器工具組。這套基於GCC的Java預先編譯器從x86上被移植到我們的實驗平台,並且API函式庫也針對嵌入式系統和Android的需求重整,不需要的套件也被移除。預先編譯過的Java程式相較Android提供的快速轉譯(interpreter)虛擬機器,性能提升至少2.5倍;而API函式庫經過整理後整體大小不到原本一半。其實預先編譯技術會造成較大的可執行檔,但這篇論文也提出兩項最佳化技巧,再度將最後的函式庫尺寸減少了16%。
Embedded systems become more and more popular in recent years.
Many office, web, and system applications used to be on PCs are ported to various embedded systems such as smartphones, PDAs, and tablet computers.
Software developers must maintain numerous versions of their products, since there are too many different platforms.
To efficiently reuse existent codes across multiple platforms, many applications are written in portable programming languages.
The Java programming language is a object-oriented and cross-platform programming language.
Java also has a good balance between developing efficiency and runtime performance, and hence are widely used on embedded applications.
However, the nature of traditional Java virtual machines are three to ten times slower than equivalent C programs.
In this paper we presented an Java ahead-of-time compilation tool on Android platform, for the Andes embedded architecture.
The compiler is re-targeted to our experiment platform, and the Java API library is greatly reorganized and unneeded components are stripped.
Many incompatibilities on Android are fixed in order to meet the needs of the ABI for Andes architecture.
Compiled Java programs speedup by a factor of 2.5 over a threaded-code interpreter,
and the size of Java API library is reduced by more than 50%.
Although this technique still results in large program image size,
we have proposed two optimization schemes to further reduce the final image size by 16%.
[1] K. Arnold, J. Gosling, and D. Holmes. The JavaTM Programming Language.
Addison-Wesley Professional, 2005.
[2] J. Gosling, B. Joy, G. Steele, and G. Bracha. The JavaTM Language Specification.
Addison-Wesley Professional, 2005.
[3] T. Lindholm and F. Yellin. Java virtual machine specification. Addison-Wesley
Longman Publishing Co., Inc. Boston, MA, USA, 1999.
[4] M. Ertl and D. Gregg. The behavior of efficient virtual machine interpreters on
modern architectures. Euro-Par 2001 Parallel Processing, pages 403–413.
[5] J.R. Bell. Threaded code. Communications of the ACM, 16(6):370–372, 1973.
[6] J. Aycock. A brief history of just-in-time. ACM Computing Surveys (CSUR),
35(2):113, 2003.
[7] M. Paleczny, C. Vick, and C. Click. The java hotspotTM server compiler. In
Proceedings of the 2001 Symposium on Java TM Virtual Machine Research and
Technology Symposium-Volume 1, page 1. USENIX Association, 2001.
[8] T.A. Proebsting, G. Townsend, P. Bridges, J.H. Hartman, T. Newsham, and
S.A. Watterson. Toba: Java for applications: A way ahead of time (WAT)
compiler. In Proceedings of the 3rd Conference on Object-Oriented Technologies
and Systems, pages 41–53, 1997.
[9] R. Stallman et al. the GNU Compiler Collection.
[10] GNU Classpath. Classpath, essential libraries for Java.
[11] R. Stallman. GNU General Public License. Free Software Foundation, Inc.,
Tech. Rep, 1991.