Embedded platforms are resource-constrained systems in whichperformance and memory requirements of executed code are ofcritical importance. However, standard techniques such as full just-in-time(JIT) compilation and/or adaptive optimization (AO) may not be appropriate for this type of systems due to memory and compilation overheads.
The research presented in this paper proposes a technique that combines some of the main benefits of JIT compilation, superoperators(SOs) and profile-guided optimization, in order to deliver a lightweight Java bytecode compilation system, targeted for resource-constrained environments, that achieves runtime performance similar to that of state-of-the-art JIT/AO systems, while having a minimal impact on runtime memory consumption.The key ideas are to use profiler-selected, extended bytecode basic blocks as superoperators (new bytecode instructions) and to perform few, but very targeted, JIT/AO-like optimizations at compile time only on the superoperators. bytecode, as directed by compilation .hints. encoded as annotations. As such, our system achieves competitive performance to a JIT/AO system, but witha much lower impact on runtime memory consumption. Moreover,it is shown that our proposed system can further improveprogram performance by selectively inlining method calls embedded in the chosen superoperators, as directed by runtime profiling data and with minimal impact on classfile size.
For experimental evaluation, we developed three Virtual Machines(VMs) that employ the ideas presented above. The customized VMs are first compared (w.r.t. runtime performance) to a simple, fast-to-develop VM (baseline) and then to a VM that employs JIT/AO. Our best-performing system attains speedups ranging from a factor of 1.52 to a factor of 3.07, w.r.t. to the baseline VM. When compared to a state-of-the-art JIT/AO VM, our proposed system performs better for three of the benchmarks and worse by less than a factor of 2 for three others. But our SO-extended VM outperforms the JIT/AO system by a factor of 16, on average, w.r.t. runtime memory consumption.
[1]
Frank Yellin,et al.
The Java Virtual Machine Specification
,
1996
.
[2]
Ben Stephenson,et al.
Multicodes: optimizing virtual machines using bytecode sequences
,
2003,
OOPSLA '03.
[3]
Laurie J. Hendren,et al.
Effective Inline-Threaded Interpretation of Java Bytecode Using Preparation Sequences
,
2003,
CC.
[4]
Michael D. Bond,et al.
Continuous path and edge profiling
,
2005,
38th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO'05).
[5]
Alexandru Nicolau,et al.
Annotation-aware dynamic compilation and interpretation
,
2002
.
[6]
Todd A. Proebsting.
Optimizing an ANSI C interpreter with superoperators
,
1995,
POPL '95.
[7]
David Gregg,et al.
Towards Superinstructions for Java Interpreters
,
2003,
SCOPES.
[8]
Laurie J. Hendren,et al.
A framework for optimizing Java using attributes
,
2000,
CASCON.
[9]
David Gregg,et al.
Virtual machine showdown: stack versus registers
,
2005,
VEE '05.
[10]
Andreas Krall,et al.
Superinstructions and Replication in the Cacao JVM interpreter
,
2006
.
[11]
Alexander V. Veidenbaum,et al.
High performance annotation-aware JVM for Java cards
,
2005,
EMSOFT.
[12]
James F. Power,et al.
Identifying and Evaluating a Generic Set of Superinstructions for Embedded Java Programs
,
2004,
ESA/VLSI.
[13]
Ben Stephenson,et al.
Advancements in multicode optimization
,
2004,
OOPSLA '04.