研究生: |
許宏榮 Hsu, Hong-Rong |
---|---|
論文名稱: |
Icing: An Ahead of Time Compilation Framework Complement to the Android Dalvik JIT Icing: 設計實作一個可強化Android Dalvik JIT之提前式編譯架構 |
指導教授: |
石維寬
Shih, Wei-Kuan |
口試委員: | |
學位類別: |
碩士 Master |
系所名稱: |
電機資訊學院 - 資訊工程學系 Computer Science |
論文出版年: | 2010 |
畢業學年度: | 98 |
語文別: | 英文 |
論文頁數: | 48 |
中文關鍵詞: | 提前式編譯 、最佳化 、動態編譯 、谷哥 、虛擬機器 |
外文關鍵詞: | Google Android, Dalvik VM, Ahead of Time Compiler, JIT, Optimization |
相關次數: | 點閱:2 下載:0 |
分享至: |
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
Immediately after Google launched the Android software platform, hardware and software developers around the world started investing in Android-based research development projects, hoping to take advantage of business opportunities relating to the new platform. The result has been a recent increase in Android-based smart phones, and it seems that these devices will become increasingly popular over time. However, one of the biggest drawbacks of the Android platform stems from its lackluster speed and performance. In response to this problem, Google has migrated a Just-in-Time compiler (JIT) to the latest version of the Android SDK (Software-Development-Kit). However, for a resource-limited embedded system like an Android smart phone, dynamic compilation will directly influence user-response time at startup, making deeper optimization levels unachievable. As a result, we propose an Ahead-of-Time Compilation (AOTC) framework, named Icing, which can serve as a complement to the Dalvik JIT and improve its performance. Icing is a mixture of traditional Java AOTC approaches and our novel design for the Dalvik VM. In this paper, we describe the implementation of each translation phase in the Icing framework, and present how Icing cooperates with the Dalvik JIT by considering the trade-off between both compilers’ characteristics. On average, our cooperating mechanism improves performance by 2.89 times the original JIT-only Dalvik VM.
Google在2007年釋出了Android開放手機平台,至今學界、業界皆投入相當的心力在Android嵌入式產品的研發,國內大廠如宏達電、華碩、宏□等皆推出了基於Android作業系統的智慧型手機與小型筆記型電腦且廣受國際歡迎;未來,平板電腦、電子書、甚至車輛電子皆會有以Android為作業系統的產品問世,不可否認,Android是個趨勢,也是國內在嵌入式軟體平台的一個機會。
目前Android平台的效能是被廣泛討論的議題,為了強調應用程式的高移植性,Google選擇了以Java作為其應用程式開發語言,並創造了名為Dalvik的虛擬機器(VM)和Run-Time Library來支援Java應用程式的運行;根據實驗比較,Dalvik VM的效能比其傳統Java VM在嵌入式系統上的表現,還有很多最佳化的空間;直至2009年11月,Google整合了Dalvik動態編譯器(JIT)至其最新的Code tree,來嘗試解決Dalvik效能低落的問題。
動態編譯器利用執行期間來做Profiling與Compilation的動作,除了有直接影響使用者反應時間的缺點外,其能產生code的quality也有限(不能作深度太深的最佳化);本論文提出一個名為”Icing”的提前式編譯環境,在off-line時將程式的熱門片段編譯成native code來避開VM直譯器的overhead;另外Icing的Static-Time Profiling依Ahead-of-Time Compiler(AOTC)與Just in Time Compiler(JIT)的特性,將程式中的method分工成適合AOTC、適合JIT兩類,藉由結合兩個Compiler的優點,來提升整體Android應用程式的效能。
Icing是結合了我們針對Dalvik VM設計的特殊最佳化,與傳統AOTC for Java設計考量的一個編譯環境,在這篇論文我們會詳細介紹Icing中各個Translation Phase的實作。數據方面,比較JIT-only的Android,加上Icing的輔助能將其效能平均提升2.89倍。
[1] Google Android - An Open Handset Alliance Project, 2008. http://code.google.com/android/
[2] Systronix Practical Embedded Java BenchMarks, 2009. http://www.practicalembeddedjava.com/benchmark/11a/benchmark_android.html
[3] Sun Java Native Interface, 1997.
http://java.sun.com/j2se/1.3/docs/guide/jni/
[4] Proebsting, T. A., Townsend, G., Bridges, P., Hartman, J. H., Newsham, T. and Watterson, S. A. Toba: Java For Applications: A Way Ahead of Time (WAT) Compiler. University of Arizona, 1997.
[5] Muller, G., B, Moura, r., Bellard, F. and Consel, C. Harissa: a flexible and efficient java environment mixing bytecode and compiled code. In Proceedings of the Proceedings of the 3rd conference on USENIX Conference on Object-Oriented Technologies (COOTS) - Volume 3 (Portland, Oregon, 1997). USENIX Association.
[6] Weiss, M., Fran, Ferri, o. d., Delsart, B., Fabre, C., Hirsch, F., Johnson, E. A., Joloboff, V., Roy, F., Siebert, F. and Spengler, X. TurboJ, a Java Bytecode-to-Native Compiler. In Proceedings of the Proceedings of the ACM SIGPLAN Workshop on Languages, Compilers, and Tools for Embedded Systems (1998). Springer-Verlag.
[7] Varma, A. and Bhattacharyya, S. S. Java-through-C Compilation: An Enabling Technology for Java in Embedded Systems. In Proceedings of the Proceedings of the conference on Design, automation and test in Europe - Volume 3 (2004). IEEE Computer Society.
[8] Dean, J., Grove, D. and Chambers, C. Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis. In Proceedings of the Proceedings of the 9th European Conference on Object-Oriented Programming (1995). Springer-Verlag.
[9] Krintz, C. Coupling on-line and off-line profile information to improve program performance. In Proceedings of the Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization (San Francisco, California, 2003). IEEE Computer Society
[10] Krintz, C. and Calder, B. Using annotations to reduce dynamic optimization time. In Proceedings of the Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation (Snowbird, Utah, United States, 2001). ACM.
[11] Hong, S., Kim, J.-C., Shin, J. W., Moon, S.-M., Oh, H.-S., Lee, J. and Choi, H.-K. Java client ahead-of-time compiler for embedded systems. SIGPLAN Not., 42, 7 2007), 63-72.
[12] Sun javac - Java programming language compiler, 2002. http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html
[13] Google Android Dx tool, 2007. http://developer.android.com/intl/zh-TW/guide/developing/tools/othertools.html#dx
[14] JesusFreke smali/baksmali: An assembler for Android's dex format 2009). http://code.google.com/p/smali/
[15] Leonid Batyuk, A.-D. S., Hans-Gunther Schmidt, Ahmet Camtepe, and Sahin Albayrak Developing and Benchmarking Native Linux Applications on Android, MobileWireless Middleware, Operating Systems, and Applications Second International Conference, Mobilware 20092009 ), 381-392.
[16] Jung, D.-H., Park, J., Bae, S.-H., Lee, J. and Moon, S.-M. Efficient exception handling in Java bytecode-to-C ahead-of-time compiler for embedded systems. Comput. Lang. Syst. Struct., 34, 4 2008), 170-183.
[17] Google Dalvik Optimization and Verification With dexopt, 2008. http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/dexopt.html;hb=master
[18] Gal, A., Eich, B., Shaver, M., Anderson, D., Mandelin, D., Haghighat, M. R., Kaplan, B., Hoare, G., Zbarsky, B., Orendorff, J., Ruderman, J., Smith, E. W., Reitmaier, R., Bebenita, M., Chang, M. and Franz, M. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation (Dublin, Ireland, 2009). ACM.
[19] Pendragon CaffeineMark1997. http://www.benchmarkhq.ru/cm30/
[20] Vall, R., e-Rai, Co, P., Gagnon, E., Hendren, L., Lam, P. and Sundaresan, V. Soot - a Java bytecode optimization framework. In Proceedings of the Proceedings of the 1999 conference of the Centre for Advanced Studies on Collaborative research (Mississauga, Ontario, Canada, 1999). IBM Press.
[21] dex2jar: Translate android DEX bytecode back to Java bytecode. http://code.google.com/p/dex2jar/