Abstract
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%.