Code-copying is a very attractive, simple-JIT, highly portable fast byte code execution technique with implementation costs close to a classical interpreter. The idea is to reuse, at Virtual Machine (VM) runtime, chunks of VM binary code, copy them, concatenate an d execute together at a greater speed. Unfortunatelly code-copying makes anwarranted assumptio ns about the code generated by the compiler used to compile the VM. It is therefore necessary to find which VM code chunks can be safely used after being copied and which can not. Previously used manual testing and assembly analysis were highly ineffective and error prone. In this work we present a test su ite, Bytecode Testing Framework (BTF) that contains a comprehensive set of fine-grained Java assembly t ests. These tests are then used in conjunction with SableVM JVM testing mode to semi-automatically detect one-by-one which code chunks are safe to use. With this techunique we ported SableVM’s code-copyi ng engine to several architectures and had external contributors with no VM knowledge port SableVM to n ew architectures within as little as one hour. The presented Bytecode Testing Framework greatly imp roved reliability and ease of porting of SableVM’s code-copying engine, thus its practical usabili ty.
[1]
Ian Piumarta,et al.
Optimizing direct threaded code by selective inlining
,
1998,
PLDI 1998.
[2]
Laurie J. Hendren,et al.
SableVM: A Research Framework for the Efficient Execution of Java Bytecode
,
2001,
Java Virtual Machine Research and Technology Symposium.
[3]
David Gregg,et al.
Optimizing indirect branch prediction accuracy in virtual machine interpreters
,
2003,
PLDI '03.
[4]
Etienne Gagnon,et al.
A portable research framework for the execution of java bytecode
,
2003
.
[5]
David Gregg,et al.
Retargeting JIT compilers by using C-compiler generated executable code
,
2004,
Proceedings. 13th International Conference on Parallel Architecture and Compilation Techniques, 2004. PACT 2004..
[6]
David Belanger.
SABLEJIT: A RETARGETABLE JUST-IN-TIME COMPILER
,
2004
.
[7]
David Gregg,et al.
Retargeting JIT Compilers by using C-Compiler Generated Executable Code
,
2004,
IEEE PACT.
[8]
Andreas Krall,et al.
Superinstructions and Replication in the Cacao JVM interpreter
,
2006
.