Swift
Yuan Zhang, Min Yang, Bo Zhou et al. · 2012
Code quality and compilation speed are two challenges to JIT compilers, while selective compilation is commonly used to trade-off these two issues. Meanwhile, with more and more Java applications running in mobile devices, selective compilation meets many problems. Since these applications always have flat execution profile and short live time, a lightweight JIT technique without losing code quality is extremely needed. However, the overhead of compiling stack-based Java bytecode to heterogeneous register-based machine code is significant in embedded devices. This paper presents a fast and effective JIT technique for mobile devices, building on a register-based Java bytecode format which is more similar to the underlying machine architecture. Through a comprehensive study on the characteristics of Java applications, we observe that virtual registers used by more than 90% Java methods can be directly fulfilled by 11 physical registers. Based on this observation, this paper proposes Swift, a novel JIT compiler on register-based bytecode, which generates native code for RISC machines. After mapping virtual registers to physical registers, the code is generated efficiently by looking up a translation table. And the code quality is guaranteed by the static compiler which is used to generate register-based bytecode. Besides, we design two lightweight optimizations and an efficient code unloader to make Swift more suitable for embedded environment. As the prevalence of Android, a prototype of Swift is implemented upon DEX bytecode which is the official distribution format of Android applications.
Cited by 10 works. doi:10.1145/2151024.2151035
Authors
References
- Tracing the meta-level
- Efficient and language-independent mobile programs
- Overview of the IBM Java Just-in-Time Compiler
- Trace-based just-in-time type specialization for dynamic languages
- Java intermediate bytecodes
- Java Intermediate Bytecode.
- The java hotspot TM server compiler
- The structure and performance of interpreters
- Efficient JavaVM just-in-time compilation
- HotpathVM