Bytecode-to-C Ahead-of-Time Compilation for Android Dalvik Virtual Machine
Hyeong-Seok Oha, Ji Hwan Yeob and Soo-Mook Moonc
Department of Electrical and Computer Engineering, Seoul National University, Seoul, Korea.
Android employs Java for programming its apps which is executed by its own virtual machine called the Dalvik VM (DVM). One problem of the DVM is its performance. Its just-intime compiler (JITC) cannot generate high-performance code due to its trace-based compilation with short traces and modest optimizations, compared to JVM's method-based compilation with ample optimziations. This paper proposes a bytecode-to-C ahead-of-time compilation (AOTC) for the DVM to accelerate preinstalled apps. We translated the bytecode of some of the hot methods used by these apps to C code, which is then compiled together with the DVM source code. AOTC-generated code works with the existing Android zygote mechanism, with corrects garbage collection and exception handling. Due to off-line, method-based compilation using existing compiler with full optimizations and Java-specific optimizations, AOTC can generate quality code while obviating runtime compilation overhead. For benchmarks, AOTC can improve the performance by 10% to 500%. When we compare this result with the recentlyintroduced ART, which also performs ahead-of-time compilation, our AOTC performs better.
Full Text (PDF)