Logo image
An Ahead-of-Time compilation and optimization framework based on LLVM for Google Android
Thesis

An Ahead-of-Time compilation and optimization framework based on LLVM for Google Android

王誌陞
Masters, 國立清華大學, 資訊工程學系
2010

Abstract

編譯器
The execution environment of Android system is based on a virtual machine called Dalvik virtual machine (DVM) in which the execution of an application program is in interpret-mode. To reduce the interpretation overhead of DVM, Google has included a trace-based just-in-time compiler (JITC) in the latest version of Android. Due to limited resources and the requirement for reasonable response time, the JITC is unable to apply deep optimizations to generate high quality code. In this paper, we propose a method-based ahead-of-time compiler (AOTC) based on LLVM[27], to speed up the execution of Android applications without the modification of any components of Android framework. The main idea is to convert the hot methods of an application program from DEX code to C code and uses the GCC compiler to translate the C code to the corresponding native code. With the Java Native Interface (JNI) library, the translated native code can be called by DVM. Both AOTC and JITC have their strength and weakness. In order to combine the strength and avoid the weakness of AOTC and JITC, we have proposed a cost model to determine whether a method should be handled by AOTC or JITC during profiling. To evaluate the performance, three benchmarks used by Google JITC are used as test cases. The performance results show that, with AOTC, the execution time of an application is 3.6 to 5.7 times faster than that without JITC, and -0.4% to 58.4% faster than that with JITC.

Metrics

1 Record Views

Details

Logo image