透過您的圖書館登入
IP:3.147.67.166
  • 學位論文

本土平台支援Android即時系統編譯器

Support of Just-in-Time Compiler for Android on Indigenous platforms

指導教授 : 李政崑
若您是本文的作者,可授權文章由華藝線上圖書館中協助推廣。

摘要


即時編譯器是一個用於即時改善虛擬機器程式執行效能的方法。因為在 虛擬機器當中,字節位元碼(虛擬機器碼) 被直譯的速度,將會慢於將其編 譯為目標機器碼執行的速度。有鑑於此,即時編譯器將著力於字節位元碼 被執行前,提前將其編譯為目標機器碼以用於讓系統能更快速執行。 為了提高虛擬機器整體的執行效能,虛擬機器當中將會提供合適的即時編 譯器,並用以轉譯字節位元碼,且對產物進行若干最佳化,最終目的為產 生出目標處理器之機器碼,以期得到更好更佳的效能。 在這篇論文當中,我們將提供一個以片段做為最小單位的即時編譯器於 Android 之中。而這個即時系統編譯器將具備有下列之特性: 1. 字節位元碼將除了被直譯以外,將連帶被用於分析辨認是否為一個熱 門片段。 2. 已經被編譯好的片段將會被串連在一起,以期能在執行時得到更好的 效能改善。 3. 編譯的流程上將會特別針對嵌入式系統做最小化記憶體的使用。 4. 即時編譯器一旦發現熱門片段後,將會很迅速的展現出效能上的改 善。 為了讓這個即時編譯器能支援本土化平台於Android 之上,我們設計了 一個特別的即時編譯流程。即時編譯器將轉換Dalvik 字節位元碼為本土化 平台的目標處理器機器碼。除此之外,即時編譯器將透過將Dalvik 字節位 元碼轉換為兩層中間表示語言,並考量兩層中間表示語言的特色,提供若 干最佳化技術。 我們除了在這個論文當中建置了適當的即時編譯器於晶心(Andes) 的開發 板上,並透過實驗以呈現即時編譯器在Dalvik 虛擬機器中所能獲得的效能 改善。

並列摘要


Just-in-Time(JIT) compiler is a well-known method to improve the runtime performance of computer programs in virtual machines. Since byte code(virtual machine code) is slower as interpreted than compiled to native code, JIT compiler will compile byte code to physical machine code in advance in order to run faster. To speed up the virtual machine performance, the virtual machine will provide the Just-in-Time compiler for translating and optimizing the byte code to intended CPU machine code. In this dissertation, we support the Trace-granularity JIT compiler in Android which has the following property: • The byte code is interpreted with profiling to identify hot trace. • The compiled fragments are chained together for speeding up performance. • The compilation minimizes the memory usage critical for embedded devices. • The compiler is very rapidly return of performance boost once hotness detected. To support the JIT compiler for Android on an indigenous platform, we design a special JIT compilation flow for an indigenous platform. The JIT compiler will translate the Dalvik byte code to the indigenous platform machine code. In addition, the JIT compiler provides optimizations, such as constant propagation, loop-invariant code motion, redundant branch elimination by considering two level intermediate representations. We have implemented our JIT compiler design on Andes AG101 and AG102 developing boards and performed experiments to obtain the speeding up of performance in Dalvik virtual machine. The geometric average for selected benchmark CaffeineMark 3.0 is 4.5x and the average speed up on 0xbench benchmark is 5x over then C-stub interpreter version without JIT compiler. In addition to evaluating the JIT compiler robustness, we also take the applications from the Android Market and list the applications which runs with JIT compiler.

參考文獻


[4] J. Aycock. A Brief History of Just-In-Time. ACM Comput. Surv.,
ACM, 2003, 35, 97-113.
[5] A. V. Hoff. The case for java as a programming language. IEEE INTERNET
[6] Sun Microsystems Inc, The Java HotSpot virtual machine. White paper..
Santa Clara, CA. 2001.

延伸閱讀