The performance of embedded Java virtual machine can be improved by ahead-of-time compiler (AOTC), which translates bytecode into machine code in the server and installs the machine code on the client device. Although AOTC is more advantageous than just-in-time compiler (JITC) due to its absence of the translation overhead, AOTC cannot be applicable to dynamically downloaded classes at runtime. This paper proposes client-AOTC (c-AOTC) which performs AOTC on the client device using the JITC module installed on the device, complementing the server-AOTC. The machine code of a method translated by JITC is cached on a persistent memory of the device, and when the method is invoked again in a later run of the program, the machine code is loaded and executed directly without the translation and interpretation overhead. One of major issues in c-AOTC is relocation because some of the addresses used by the cached machine code are not correct when the machine code is loaded and used in a different run; those addresses should be corrected before they are used. Constant pool resolution and inlining complicate the relocation problem and we propose our solutions. We developed a c-AOTC on Sun's CDC VM reference implementation (RI) and our evaluation results indicate that c-AOTC can improve the performance significantly, as much as an average of 12%. We also experiment with the issue of reducing the number of c-AOTC methods to be cached when the persistent space is tight, with a graceful degradation of performance.
Many embedded Java software platforms execute two types of Java classes: those installed statically on the client device and those downloaded dynamically from service providers at runtime. For higher performance, it would be desirable to compile static Java classes by ahead-of-time compiler (AOTC) and to handle dynamically downloaded classes by just-in-time compiler (JITC), providing a hybrid compilation environment. This paper proposes a hybrid Java compilation approach and performs an initial case study with a hybrid environment, which is constructed simply by merging an existing AOTC and a JITC for the same Java virtual machine. Both compilers are developed independently for their own performance advantages with a generally accepted approach of compilation, but we merged them as efficiently as possible. Contrary to our expectations, the hybrid environment does not deliver a performance, in-between of full-JITC's and full-AOTC's. In fact, its performance is even lower than full-JITC's for many benchmarks. We analyzed the result and found that a naive merge of JITC and AOTC may result in inefficiencies, especially due to calls between JITC methods and AOTC methods. Based on these observations, we propose some ideas to reduce such a call overhead. We also observed that the distribution of JITC methods and AOTC methods is also important, and experimented with various distributions to understand when a hybrid environment can deliver a desired performance. Finally, we discuss how JITC and AOTC should be designed for efficient hybrid execution.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.